    :root {
      --bg: #0b0f14;
      --panel: #121824;
      --accent: #4f7cff;
      --text: #e6eaf0;
      --muted: #9aa4b2;
      --good: #39d98a;
      --bad: #ff6b6b;
    }

    :root.theme-light {
      --bg: #f6f7fb;
      --panel: #ffffff;
      --text: #111827;
      --muted: #5f6675;
      --good: #17b26a;
      --bad: #e5484d;
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      font-family: 'Inter', system-ui, sans-serif;
      background: var(--bg);
      color: var(--text);
      overflow-x: hidden;
    }

    /* Ambient animated backdrop */
    body::before {
      content: "";
      position: fixed;
      inset: -20vh -20vw;
      background:
        radial-gradient(900px 500px at 20% 10%, rgba(79,124,255,0.28), transparent 55%),
        radial-gradient(700px 420px at 80% 20%, rgba(57,217,138,0.14), transparent 60%),
        radial-gradient(900px 520px at 60% 90%, rgba(255,107,107,0.12), transparent 62%);
      filter: blur(18px);
      opacity: 0.9;
      animation: drift 14s ease-in-out infinite alternate;
      z-index: -2;
      pointer-events: none;
    }

    .theme-light body::before {
      background:
        radial-gradient(900px 500px at 20% 10%, rgba(79,124,255,0.16), transparent 55%),
        radial-gradient(700px 420px at 80% 20%, rgba(57,217,138,0.10), transparent 60%),
        radial-gradient(900px 520px at 60% 90%, rgba(255,107,107,0.08), transparent 62%);
      opacity: 0.6;
    }

    @keyframes drift {
      from { transform: translate3d(-1.2%, -0.8%, 0) scale(1); }
      to   { transform: translate3d( 1.2%,  0.9%, 0) scale(1.02); }
    }

    /* bottom wave */
    .waves {
      position: fixed;
      left: 0;
      right: 0;
      bottom: -2px;
      height: 170px;
      z-index: -1;
      pointer-events: none;
      opacity: 0.55;
    }

    .waves svg {
      width: 120%;
      height: 100%;
      transform: translateX(-8%);
    }

    .wave1 { animation: waveMove 10s ease-in-out infinite; }
    .wave2 { animation: waveMove 14s ease-in-out infinite reverse; opacity: 0.7; }

    @keyframes waveMove {
      0%   { transform: translateX(-8%); }
      50%  { transform: translateX(-2%); }
      100% { transform: translateX(-8%); }
    }

    /* NAV */
    .nav {
      position: fixed;
      top: 0;
      left: 0;
      height: 100vh;
      width: 280px;
      background: linear-gradient(180deg, rgba(18,24,36,0.98), rgba(11,15,22,0.96));
      padding: 26px 24px 48px;
      border-right: 1px solid rgba(255,255,255,0.06);
      box-shadow: 18px 0 60px rgba(0,0,0,0.45);
      transform: translateX(0);
      transition: transform 0.42s cubic-bezier(.2,.9,.2,1);
      z-index: 1000;
    }

    .theme-light .nav {
      background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,246,252,0.96));
      border-right: 1px solid rgba(0,0,0,0.08);
      box-shadow: 12px 0 36px rgba(0,0,0,0.12);
    }

    .nav.open { transform: translateX(0); }

    .nav-title {
      font-weight: 700;
      font-size: 1.4rem;
      margin-bottom: 24px;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .nav a {
      display: flex;
      align-items: center;
      gap: 14px;
      margin: 12px 0;
      padding: 12px 14px;
      border-radius: 12px;
      color: var(--text);
      text-decoration: none;
      font-weight: 500;
      transition: background 0.25s, color 0.25s, transform 0.15s;
    }

    .nav a:hover {
      background: rgba(79, 124, 255, 0.15);
      color: var(--accent);
      transform: translateX(4px);
    }

    .nav a.active {
      background: rgba(79, 124, 255, 0.2);
      color: #d7e2ff;
      box-shadow: inset 0 0 0 1px rgba(79, 124, 255, 0.35);
    }

    .theme-light .nav a {
      color: #1f2937;
    }

    .theme-light .nav a.active {
      color: #0f172a;
      background: rgba(79,124,255,0.18);
      box-shadow: inset 0 0 0 1px rgba(79,124,255,0.28);
    }

    .icon { width: 22px; text-align: center; }

    .hamburger,
    .overlay {
      display: none;
    }

    .hamburger {
      position: fixed;
      top: 20px;
      left: 20px;
      font-size: 28px;
      cursor: pointer;
      z-index: 1100;
      user-select: none;
      transition: left 0.35s ease;
    }

    .hamburger.open { left: 300px; }

    .overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.55);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.42s cubic-bezier(.2,.9,.2,1);
      z-index: 900;
    }

    .overlay.show {
      opacity: 1;
      pointer-events: auto;
    }

    /* Bottom nav */
    .bottom-nav {
      position: fixed;
      left: 12px;
      right: 12px;
      bottom: 14px;
      padding: 10px 12px;
      border-radius: 22px;
      background: rgba(12,16,26,0.92);
      border: 1px solid rgba(255,255,255,0.08);
      box-shadow: 0 16px 50px rgba(0,0,0,0.45);
      display: none;
      justify-content: space-around;
      gap: 8px;
      z-index: 1200;
      backdrop-filter: blur(8px);
    }

    .theme-light .bottom-nav {
      background: rgba(255,255,255,0.95);
      border: 1px solid rgba(0,0,0,0.08);
      box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    }

    .bottom-nav a {
      flex: 1;
      text-decoration: none;
      color: var(--muted);
      font-weight: 700;
      font-size: 0.75rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      padding: 8px 6px;
      border-radius: 14px;
      transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    }

    .bottom-nav a .icon {
      font-size: 1.15rem;
    }

    .bottom-nav a.active {
      color: var(--text);
      background: rgba(79,124,255,0.22);
      box-shadow: inset 0 0 0 1px rgba(79,124,255,0.4);
      transform: translateY(-1px);
    }

    .theme-light .bottom-nav a {
      color: #5f6675;
    }

    .theme-light .bottom-nav a.active {
      color: #0f172a;
    }

    @media (min-width: 821px) {
      .nav {
        transform: translateX(0);
      }

      .hamburger,
      .overlay {
        display: none;
      }

      .main {
        margin: 0 auto 0 280px;
        width: calc(100% - 280px);
      }
    }

    @media (max-width: 820px) {
      .nav,
      .overlay,
      .hamburger {
        display: none;
      }

      body {
        padding-bottom: 120px;
      }

      .main {
        padding: 96px 20px 170px;
        margin: 0 auto;
        width: auto;
      }

      .bottom-nav {
        display: flex;
      }
    }

    /* MAIN */
    .main {
      padding: 100px 24px 120px;
      max-width: 1100px;
      margin: 0 auto 0 280px;
      width: calc(100% - 280px);
      min-height: 100vh;
    }

    .header {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 16px;
      margin-bottom: 22px;
    }

    .title {
      font-size: 2.3rem;
      font-weight: 800;
      letter-spacing: 0.2px;
      margin: 0;
    }

    .subtitle {
      margin: 6px 0 0;
      color: var(--muted);
      font-weight: 500;
    }

    .panel {
      background: linear-gradient(145deg, rgba(20,27,46,0.95), rgba(15,21,36,0.92));
      border-radius: 20px;
      padding: 18px;
      border: 1px solid rgba(255,255,255,0.06);
      box-shadow: 0 20px 60px rgba(0,0,0,0.35);
      backdrop-filter: blur(8px);
    }

    .theme-light .panel {
      background: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(243,246,252,0.98));
      border: 1px solid rgba(0,0,0,0.06);
      box-shadow: 0 18px 40px rgba(0,0,0,0.12);
    }

    .controls {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-top: 12px;
    }

    .topic-panel {
      margin-top: 18px;
      border-radius: 18px;
      padding: 16px;
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(11,15,24,0.55);
    }

    .theme-light .topic-panel {
      background: rgba(255,255,255,0.8);
      border: 1px solid rgba(0,0,0,0.08);
    }

    .topic-panel-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      margin-bottom: 14px;
    }

    .topic-title {
      font-weight: 800;
      font-size: 1rem;
    }

    .topic-clear {
      border: 1px solid rgba(255,255,255,0.12);
      background: rgba(18,24,36,0.8);
      color: var(--text);
      border-radius: 10px;
      padding: 8px 12px;
      font-weight: 700;
      cursor: pointer;
      transition: transform 0.15s ease, border-color 0.15s ease;
    }

    .theme-light .topic-clear {
      background: #ffffff;
      border: 1px solid rgba(0,0,0,0.12);
      color: #0f172a;
    }

    .topic-clear:hover {
      transform: translateY(-1px);
      border-color: rgba(79,124,255,0.45);
    }

    .topic-advanced {
      border: 1px solid rgba(255,255,255,0.12);
      background: rgba(79,124,255,0.16);
      color: var(--text);
      border-radius: 10px;
      padding: 8px 12px;
      font-weight: 700;
      cursor: pointer;
      transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    }

    .theme-light .topic-advanced {
      background: rgba(79,124,255,0.12);
      border: 1px solid rgba(79,124,255,0.25);
      color: #0f172a;
    }

    .topic-advanced:hover {
      transform: translateY(-1px);
      border-color: rgba(79,124,255,0.55);
      background: rgba(79,124,255,0.24);
    }

    .topic-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 18px;
    }

    .topic-card {
      background: linear-gradient(170deg, rgba(24,34,58,0.96), rgba(12,17,30,0.96));
      border-radius: 18px;
      padding: 16px;
      border: 1px solid rgba(255,255,255,0.09);
      box-shadow: 0 10px 26px rgba(0,0,0,0.28);
      display: grid;
      gap: 12px;
      transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .theme-light .topic-card {
      background: linear-gradient(170deg, rgba(255,255,255,0.98), rgba(238,242,248,0.98));
      border: 1px solid rgba(0,0,0,0.08);
      box-shadow: 0 10px 22px rgba(0,0,0,0.12);
    }

    .topic-card:hover {
      transform: translateY(-2px);
      border-color: rgba(79,124,255,0.3);
      box-shadow: 0 16px 36px rgba(0,0,0,0.38);
    }

    .topic-card:has(.topic-super-checkbox:checked) {
      transform: translateY(-3px) scale(1.01);
      border-color: rgba(57,217,138,0.55);
      box-shadow:
        0 16px 40px rgba(0,0,0,0.45),
        0 0 0 1px rgba(57,217,138,0.25),
        0 0 22px rgba(57,217,138,0.18);
    }

    .topic-card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }

    .topic-hint {
      font-size: 0.78rem;
      color: var(--muted);
      font-weight: 600;
      letter-spacing: 0.2px;
      opacity: 0.9;
    }

    .topic-super {
      display: flex;
      align-items: center;
      gap: 8px;
      font-weight: 800;
      font-size: 1rem;
      letter-spacing: 0.3px;
      color: var(--text);
      padding: 10px 12px;
      border-radius: 12px;
      background: rgba(79,124,255,0.14);
      border: 1px solid rgba(79,124,255,0.3);
    }

    .theme-light .topic-super {
      background: rgba(79,124,255,0.12);
      border: 1px solid rgba(79,124,255,0.25);
    }

    .topic-sublist {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 10px;
    }

    .topic-grid:not(.show-advanced) .topic-sublist {
      display: none;
    }

    .topic-option {
      display: grid;
      grid-template-columns: 16px 1fr;
      align-items: center;
      gap: 10px;
      font-size: 0.9rem;
      color: var(--muted);
      line-height: 1.35;
      padding: 10px 12px;
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,0.06);
      background: rgba(14,19,30,0.7);
      transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    }

    .theme-light .topic-option {
      background: rgba(255,255,255,0.9);
      border: 1px solid rgba(0,0,0,0.06);
    }

    .topic-option:hover {
      background: rgba(79,124,255,0.12);
      border-color: rgba(79,124,255,0.28);
      color: #d4dbea;
      transform: translateY(-1px);
    }

    .theme-light .topic-option:hover {
      color: #0f172a;
    }

    .topic-super:has(input:checked) {
      background: rgba(57,217,138,0.18);
      border-color: rgba(57,217,138,0.45);
      color: #dff7eb;
    }

    .topic-option:has(input:checked) {
      background: rgba(57,217,138,0.12);
      border-color: rgba(57,217,138,0.35);
      color: #dff7eb;
    }

    .theme-light .topic-super:has(input:checked),
    .theme-light .topic-option:has(input:checked) {
      color: #0f172a;
    }

    .topic-option input,
    .topic-super input {
      margin-top: 0;
      width: 16px;
      height: 16px;
    }

    .topic-option-text,
    .topic-super-text {
      display: inline-block;
    }

    input[type="checkbox"] {
      accent-color: var(--accent);
    }

    .field { display: grid; gap: 6px; }

    label {
      font-size: 0.82rem;
      color: var(--muted);
      font-weight: 600;
      letter-spacing: 0.2px;
    }

    .theme-light label {
      color: #4b5563;
    }

    select, input {
      width: 100%;
      padding: 12px 12px;
      border-radius: 14px;
      border: 1px solid rgba(255,255,255,0.10);
      background: rgba(18,24,36,0.92);
      color: var(--text);
      outline: none;
      font-weight: 600;
    }

    .theme-light select,
    .theme-light input {
      background: #ffffff;
      border: 1px solid rgba(0,0,0,0.12);
      color: #0f172a;
    }

    .theme-light input::placeholder {
      color: #6b7280;
    }

    select:focus, input:focus {
      border-color: rgba(79,124,255,0.55);
      box-shadow: 0 0 0 6px rgba(79,124,255,0.10);
    }

    .grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 18px;
      margin-top: 18px;
    }

    .tile {
      background: linear-gradient(145deg, rgba(27,36,64,0.9), rgba(15,21,36,0.92));
      border-radius: 20px;
      padding: 22px;
      border: 1px solid rgba(255,255,255,0.06);
      cursor: pointer;
      transition: transform 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
      min-height: 150px;
      display: grid;
      gap: 10px;
    }

    .theme-light .tile {
      background: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(238,242,248,0.98));
      border: 1px solid rgba(0,0,0,0.08);
    }

    .tile:hover {
      transform: translateY(-3px);
      border-color: rgba(79,124,255,0.35);
      filter: brightness(1.05);
    }

    .tile .top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .badge {
      font-size: 0.78rem;
      font-weight: 800;
      padding: 6px 10px;
      border-radius: 999px;
      background: rgba(79,124,255,0.14);
      border: 1px solid rgba(79,124,255,0.26);
      color: var(--text);
    }

    .theme-light .badge {
      background: rgba(79,124,255,0.12);
      border: 1px solid rgba(79,124,255,0.22);
      color: #0f172a;
    }

    .tile h3 {
      margin: 0;
      font-size: 1.15rem;
      font-weight: 800;
    }

    .tile p {
      margin: 0;
      color: var(--muted);
      line-height: 1.45;
      font-weight: 550;
    }

    .theme-light .tile p {
      color: #4b5563;
    }

    .count {
      margin-top: 6px;
      color: rgba(230,234,240,0.9);
      font-weight: 800;
      letter-spacing: 0.2px;
    }

    .theme-light .count {
      color: #111827;
    }

    .mini {
      margin-top: 10px;
      color: var(--muted);
      font-weight: 650;
      font-size: 0.9rem;
    }

    @media (max-width: 860px) {
      .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }

    @media (max-width: 1020px) {
      .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }

    @media (max-width: 680px) {
      .topic-grid { grid-template-columns: 1fr; }
      .topic-card { padding: 16px; }
      .topic-super { font-size: 1rem; }
      .topic-option { font-size: 0.95rem; }
      .topic-sublist { grid-template-columns: 1fr; }
      .topic-option { min-height: 44px; }
    }

    @media (max-width: 520px) {
      .controls { grid-template-columns: 1fr; }
    }
  
    @media (max-width: 540px) {
      .bottom-nav a span:not(.icon) {
        display: none;
      }

      .bottom-nav a {
        font-size: 0;
        gap: 0;
      }

      .bottom-nav a .icon {
        font-size: 1.25rem;
      }
    }

    @media (max-width: 820px) {
      .main {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
      }
    }
