﻿:root {
        color-scheme: dark;
        --ink: #e8efff;
        --ink-soft: rgba(232, 239, 255, 0.65);
        --accent: #58c3ff;
        --accent-deep: #2b7bff;
        --accent-warm: #2b7bff;
        --card: rgba(18, 24, 38, 0.96);
        --glass: rgba(12, 18, 32, 0.9);
        --shadow: 0 22px 46px rgba(4, 10, 22, 0.55);
        --bg-1: #0b1220;
        --bg-2: #0a0f1c;
        --bg-3: #080b15;
        --glow-1: rgba(88, 195, 255, 0.2);
        --glow-2: rgba(43, 123, 255, 0.18);
      }

      body.light {
        color-scheme: light;
        --ink: #0e1422;
        --ink-soft: rgba(14, 20, 34, 0.62);
        --accent: #ff7a3d;
        --accent-deep: #e85f1c;
        --accent-warm: #ff7a3d;
        --card: rgba(255, 255, 255, 0.98);
        --glass: rgba(255, 255, 255, 0.9);
        --shadow: 0 20px 40px rgba(12, 19, 36, 0.16);
        --bg-1: #f7f8fb;
        --bg-2: #eef3fb;
        --bg-3: #ffffff;
        --glow-1: rgba(255, 122, 61, 0.22);
        --glow-2: rgba(255, 169, 116, 0.2);
      }

      * {
        box-sizing: border-box;
      }

      body {
        margin: 0;
        font-family: "Space Grotesk", "Segoe UI", sans-serif;
        background: radial-gradient(circle at top left, var(--bg-1) 0%, var(--bg-2) 55%, var(--bg-3) 100%);
        min-height: 100vh;
        padding: 32px;
        color: var(--ink);
        position: relative;
        overflow-x: hidden;
      }

      body::before,
      body::after {
        content: "";
        position: fixed;
        inset: -20% auto auto -10%;
        width: 420px;
        height: 420px;
        background: radial-gradient(circle, var(--glow-1), transparent 70%);
        filter: blur(20px);
        z-index: -1;
      }

      body::after {
        inset: auto -10% -20% auto;
        background: radial-gradient(circle, var(--glow-2), transparent 70%);
      }

      .board {
        max-width: 1100px;
        margin: 0 auto;
        border-radius: 28px;
        background: var(--glass);
        box-shadow: var(--shadow);
        border: 1px solid rgba(89, 165, 255, 0.2);
        overflow: hidden;
        backdrop-filter: blur(12px);
        animation: fadeIn 400ms ease;
      }

      .navbar {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 8px;
        padding: 16px;
        background: rgba(10, 15, 26, 0.85);
        border-bottom: 1px solid rgba(89, 165, 255, 0.15);
        position: relative;
      }

      body.light .navbar {
        background: rgba(255, 255, 255, 0.78);
        border-bottom-color: rgba(255, 122, 61, 0.2);
      }

      .theme-toggle {
        position: static;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        border: 1px solid rgba(89, 165, 255, 0.35);
        background: rgba(10, 15, 26, 0.7);
        color: var(--ink);
        font-size: 18px;
        display: grid;
        place-items: center;
        justify-self: end;
        align-self: center;
        cursor: pointer;
        transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
      }

      .theme-toggle:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
        border-color: rgba(89, 165, 255, 0.6);
      }

      body.light .theme-toggle {
        background: rgba(255, 255, 255, 0.85);
        border-color: rgba(255, 122, 61, 0.4);
      }

      .nav-btn {
        padding: 12px 16px;
        text-align: center;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
        border: 1px solid transparent;
        border-radius: 999px;
        background: transparent;
        color: var(--ink-soft);
        cursor: pointer;
        transition: all 160ms ease;
      }

      .nav-btn:hover {
        color: var(--ink);
        border-color: rgba(89, 165, 255, 0.35);
        background: rgba(89, 165, 255, 0.12);
      }

      .nav-btn.active {
        background: linear-gradient(135deg, var(--accent), var(--accent-deep));
        color: #fff;
        box-shadow: 0 10px 18px rgba(17, 84, 214, 0.25);
      }

      .controls {
        display: flex;
        gap: 16px;
        align-items: center;
        padding: 18px 20px;
        flex-wrap: wrap;
        background: rgba(12, 18, 32, 0.8);
        border-bottom: 1px solid rgba(89, 165, 255, 0.12);
      }

      body.light .controls {
        background: rgba(255, 255, 255, 0.7);
        border-bottom-color: rgba(255, 122, 61, 0.15);
      }

      .controls label {
        font-weight: 600;
        font-size: 14px;
        color: var(--ink-soft);
      }

      select {
        padding: 10px 14px;
        border-radius: 14px;
        border: 1px solid rgba(89, 165, 255, 0.35);
        min-width: 220px;
        font-family: inherit;
        color: var(--ink);
        background: rgba(9, 15, 28, 0.95);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
        outline: none;
      }

      body.light select {
        background: rgba(255, 255, 255, 0.95);
        border-color: rgba(255, 122, 61, 0.4);
        box-shadow: 0 6px 12px rgba(12, 19, 36, 0.12);
      }

      select:focus {
        border-color: rgba(89, 165, 255, 0.6);
        box-shadow: 0 0 0 3px rgba(89, 165, 255, 0.2);
      }

      .content {
        padding: 22px;
        min-height: 360px;
        background: linear-gradient(180deg, rgba(12, 18, 32, 0.3), rgba(12, 18, 32, 0.75));
      }

      body.light .content {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(245, 239, 232, 0.9));
      }

      .box-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 16px;
      }

      .box-grid.measure-mode {
        display: block;
      }

      .measure-wrap {
        overflow-x: auto;
        border-radius: 18px;
        border: 1px solid rgba(89, 165, 255, 0.22);
        background: var(--card);
        box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
        backdrop-filter: blur(10px);
      }

      .measure-head {
        padding: 18px 18px 12px;
        border-bottom: 1px solid rgba(89, 165, 255, 0.16);
      }

      .measure-head h3 {
        margin: 0;
        font-size: 18px;
        letter-spacing: 0.4px;
      }

      .measure-head p {
        margin: 4px 0 0;
        color: var(--ink-soft);
        font-size: 13px;
      }

      .measure-table {
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
        min-width: 680px;
        font-size: 14px;
      }

      .measure-table th,
      .measure-table td {
        padding: 12px 14px;
        border-bottom: 1px solid rgba(89, 165, 255, 0.12);
        text-align: left;
        white-space: nowrap;
      }

      .measure-table th {
        color: var(--ink-soft);
        text-transform: uppercase;
        letter-spacing: 0.8px;
        font-size: 14px;
        background: rgba(88, 195, 255, 0.08);
      }

      .measure-table th,
      .measure-table td {
        text-align: center;
      }

      .measure-table tr:last-child td {
        border-bottom: none;
      }

      .measure-table tbody tr:nth-child(even) td {
        background: rgba(88, 195, 255, 0.04);
      }

      .measure-table tbody tr:hover td {
        background: rgba(88, 195, 255, 0.1);
      }

      .measure-table .col-value {
        text-align: center;
        font-variant-numeric: tabular-nums;
      }

      .delta-pill {
        display: inline-block;
        min-width: 90px;
        text-align: center;
        padding: 4px 10px;
        border-radius: 999px;
        border: 1px solid transparent;
        font-weight: 700;
      }

      .delta-positive {
        color: #32d089;
        background: rgba(50, 208, 137, 0.14);
        border-color: rgba(50, 208, 137, 0.4);
      }

      .delta-negative {
        color: #ff6a73;
        background: rgba(255, 106, 115, 0.15);
        border-color: rgba(255, 106, 115, 0.42);
      }

      body.light .measure-head {
        border-bottom-color: rgba(255, 122, 61, 0.22);
      }

      body.light .measure-table th {
        background: rgba(255, 122, 61, 0.1);
      }

      body.light .measure-table tbody tr:nth-child(even) td {
        background: rgba(255, 122, 61, 0.06);
      }

      body.light .measure-table tbody tr:hover td {
        background: rgba(255, 122, 61, 0.12);
      }

      @media (min-width: 1100px) {
        .box-grid {
          grid-template-columns: repeat(3, minmax(220px, 1fr));
        }
      }

      @media (max-width: 1099px) and (min-width: 720px) {
        .box-grid {
          grid-template-columns: repeat(2, minmax(200px, 1fr));
        }
      }

      @media (max-width: 719px) {
        .box-grid {
          grid-template-columns: 1fr;
        }
      }

      .box {
        padding: 16px 18px;
        background: var(--card);
        border: 1px solid rgba(89, 165, 255, 0.2);
        border-radius: 18px;
        color: var(--ink);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
        backdrop-filter: blur(10px);
        transform: translateY(0);
        transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, font-size 180ms ease;
        animation: riseIn 260ms ease;
        position: relative;
        overflow: hidden;
        font-size: 14px;
        cursor: pointer;
      }

      .box ul {
        list-style: none;
        margin: 0;
        padding: 0;
        display: grid;
        gap: 8px;
      }

      .box li {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding-bottom: 6px;
        border-bottom: 1px solid rgba(89, 165, 255, 0.18);
        font-weight: 500;
      }

      .box li:last-child {
        border-bottom: none;
        padding-bottom: 0;
      }

      .box .ingredient-name {
        text-transform: capitalize;
      }

      .box .ingredient-weight {
        font-variant-numeric: tabular-nums;
        color: var(--ink-soft);
        padding: 2px 8px;
        border-radius: 999px;
        background: rgba(88, 195, 255, 0.18);
        border: 1px solid rgba(88, 195, 255, 0.35);
        font-size: 12px;
        letter-spacing: 0.3px;
      }

      body.light .box li {
        border-bottom-color: rgba(255, 122, 61, 0.22);
      }

      body.light .box .ingredient-weight {
        color: #7a2f0f;
        background: rgba(255, 122, 61, 0.16);
        border-color: rgba(255, 122, 61, 0.32);
      }

      .box:hover {
        transform: translateY(-2px);
        box-shadow: 0 22px 34px rgba(0, 0, 0, 0.5);
        background: rgba(30, 42, 68, 0.98);
        font-size: 15.5px;
      }

      .box::after {
        content: "";
        position: absolute;
        inset: -60% 10% auto 10%;
        height: 180%;
        background: radial-gradient(circle, var(--glow-1), var(--glow-2), transparent 70%);
        opacity: 0;
        transform: translateY(10%);
        transition: opacity 180ms ease, transform 180ms ease;
        pointer-events: none;
      }

      .box:hover::after {
        opacity: 1;
        transform: translateY(0);
      }

      body.light .box::after {
        background: radial-gradient(circle, var(--glow-1), var(--glow-2), transparent 70%);
      }

      body.light .box:hover {
        background: rgba(255, 242, 234, 0.95);
      }

      .box.selected {
        transform: translateY(-4px);
        background: rgba(18, 31, 56, 0.98);
        box-shadow: 0 26px 40px rgba(0, 0, 0, 0.65);
        font-size: 18px;
        padding: 24px 26px;
        border-color: rgba(88, 195, 255, 0.8);
      }

      body.light .box.selected {
        background: rgba(255, 236, 222, 0.98);
        border-color: rgba(255, 122, 61, 0.6);
        box-shadow: 0 20px 34px rgba(12, 19, 36, 0.28);
      }

      .hint {
        margin-top: 16px;
        font-size: 13px;
        color: var(--ink-soft);
      }

      @keyframes fadeIn {
        from {
          opacity: 0;
          transform: translateY(8px);
        }
        to {
          opacity: 1;
          transform: translateY(0);
        }
      }

      @keyframes riseIn {
        from {
          opacity: 0;
          transform: translateY(8px);
        }
        to {
          opacity: 1;
          transform: translateY(0);
        }
      }

      @media (max-width: 900px) {
        body {
          padding: 20px;
        }

        .navbar {
          grid-template-columns: repeat(3, 1fr);
        }

        .theme-toggle {
          justify-self: end;
          margin-top: 4px;
        }
      }

      @media (max-width: 760px) {
        .measure-wrap {
          overflow-x: visible;
          border-radius: 14px;
        }

        .measure-head {
          padding: 14px 14px 10px;
        }

        .measure-head h3 {
          font-size: 16px;
        }

        .measure-head p {
          font-size: 12px;
        }

        .measure-table {
          min-width: 0;
          table-layout: auto;
        }

        .measure-table thead {
          display: none;
        }

        .measure-table,
        .measure-table tbody {
          display: block;
        }

        .measure-table tbody tr {
          display: block;
          margin: 10px 12px;
          padding: 12px;
          border: 1px solid rgba(89, 165, 255, 0.2);
          border-radius: 14px;
          background: rgba(88, 195, 255, 0.06);
        }

        .measure-table th,
        .measure-table td {
          border-bottom: none;
          white-space: normal;
        }

        .measure-table tbody tr:nth-child(even) td,
        .measure-table tbody tr:hover td {
          background: transparent;
        }

        .measure-table td {
          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: 10px;
          padding: 6px 0;
          text-align: left !important;
        }

        .measure-table td::before {
          content: attr(data-label);
          color: var(--ink-soft);
          font-size: 11px;
          text-transform: uppercase;
          letter-spacing: 0.7px;
        }

        .measure-table td.measure-name {
          display: block;
          padding: 0 0 10px;
          margin-bottom: 4px;
          border-bottom: 1px solid rgba(89, 165, 255, 0.2);
          font-size: 14px;
          font-weight: 700;
          text-align: left !important;
        }

        .measure-table td.measure-name::before {
          content: none;
        }

        .measure-table .col-value {
          font-size: 14px;
        }

        .delta-pill {
          min-width: 78px;
          padding: 4px 8px;
          font-size: 12px;
        }

        body.light .measure-table tbody tr {
          background: rgba(255, 122, 61, 0.09);
          border-color: rgba(255, 122, 61, 0.25);
        }

        body.light .measure-table td.measure-name {
          border-bottom-color: rgba(255, 122, 61, 0.25);
        }
      }
