    :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;
    }

    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); }
    }

    .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: 90px 20px 170px;
        margin: 0 auto;
        width: auto;
      }

      .bottom-nav {
        display: flex;
      }
    }

    /* Page */
    .main {
      padding: 112px 24px 140px;
      max-width: 1280px;
      margin: 0 auto 0 280px;
      width: calc(100% - 280px);
      min-height: 100vh;
    }

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

    .title {
      font-size: 2.0rem;
      font-weight: 800;
      letter-spacing: -0.02em;
      margin: 0;
    }

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

    .controls {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      align-items: center;
      justify-content: flex-end;
    }

    .input, .select {
      padding: 12px 14px;
      border-radius: 14px;
      border: 1px solid rgba(255,255,255,0.10);
      background: rgba(18,24,36,0.85);
      color: var(--text);
      outline: none;
      font-weight: 650;
      min-width: 210px;
    }

    .theme-light .input, .theme-light .select {
      background: rgba(255,255,255,0.9);
      border: 1px solid rgba(0,0,0,0.08);
    }

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

    .pill {
      background: rgba(79,124,255,0.12);
      border: 1px solid rgba(79,124,255,0.28);
      padding: 10px 12px;
      border-radius: 14px;
      color: var(--text);
      font-weight: 800;
      display: inline-flex;
      gap: 10px;
      align-items: center;
      justify-content: center;
    }

    .pill small { color: var(--muted); font-weight: 800; }

    .grid {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 14px;
      margin-top: 18px;
    }

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

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

    @media (max-width: 740px) {
      .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .input, .select { min-width: 160px; }
    }

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

    .tile {
      background: linear-gradient(145deg, rgba(20,27,46,0.95), rgba(15,21,36,0.92));
      border-radius: 18px;
      padding: 14px;
      border: 1px solid rgba(255,255,255,0.06);
      box-shadow: 0 16px 50px rgba(0,0,0,0.30);
      backdrop-filter: blur(8px);
      transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
      display: flex;
      flex-direction: column;
      gap: 10px;
      min-height: 170px;
      position: relative;
      overflow: hidden;
    }

    .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);
      box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    }

    .tile::before {
      content: "";
      position: absolute;
      inset: -60px;
      background: radial-gradient(220px 180px at 20% 10%, rgba(79,124,255,0.20), transparent 60%);
      opacity: 0.6;
      pointer-events: none;
    }

    .tile:hover {
      transform: translateY(-2px);
      border-color: rgba(79,124,255,0.22);
      box-shadow: 0 22px 60px rgba(0,0,0,0.36);
    }

    .tagrow {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      position: relative;
      z-index: 1;
    }

    .tag {
      font-size: 0.78rem;
      font-weight: 800;
      padding: 6px 10px;
      border-radius: 999px;
      border: 1px solid rgba(255,255,255,0.10);
      background: rgba(0,0,0,0.20);
      color: var(--muted);
      white-space: nowrap;
    }

    .theme-light .tag {
      background: rgba(15,23,42,0.06);
      border: 1px solid rgba(15,23,42,0.10);
      color: #4b5563;
    }

    .tag.accent {
      border-color: rgba(79,124,255,0.28);
      background: rgba(79,124,255,0.12);
      color: var(--text);
    }

    .tag.good {
      border-color: rgba(57,217,138,0.30);
      background: rgba(57,217,138,0.10);
      color: var(--text);
    }

    .tag.bad {
      border-color: rgba(255,107,107,0.30);
      background: rgba(255,107,107,0.10);
      color: var(--text);
    }

    .qtitle {
      font-weight: 900;
      letter-spacing: -0.01em;
      position: relative;
      z-index: 1;
      line-height: 1.2;
    }

    .qmeta {
      color: var(--muted);
      font-weight: 700;
      font-size: 0.90rem;
      position: relative;
      z-index: 1;
    }

    .btnrow {
      margin-top: auto;
      display: flex;
      gap: 10px;
      position: relative;
      z-index: 1;
    }

    .btn {
      flex: 1;
      padding: 10px 12px;
      border-radius: 14px;
      border: 1px solid rgba(255,255,255,0.08);
      font-size: 0.95rem;
      font-weight: 900;
      cursor: pointer;
      background: rgba(79,124,255,0.18);
      color: var(--text);
      transition: transform .15s, filter .15s, background .15s, box-shadow .15s;
      user-select: none;
    }

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

    .btn:hover { transform: translateY(-1px); filter: brightness(1.07); }

    .btn.practice {
      background: rgba(79,124,255,0.28);
      border-color: rgba(79,124,255,0.35);
    }

    .theme-light .btn.practice {
      background: rgba(79,124,255,0.18);
      border-color: rgba(79,124,255,0.28);
    }

    .btn.tutor {
      background: rgba(57,217,138,0.12);
      border-color: rgba(57,217,138,0.22);
      opacity: 0.85;
    }

    .theme-light .btn.tutor {
      background: rgba(57,217,138,0.14);
      border-color: rgba(57,217,138,0.28);
      color: #0f172a;
      opacity: 1;
    }

    .btn.tutor:hover { filter: brightness(1.10); }

    .status {
      margin-top: 16px;
      color: var(--muted);
      font-weight: 750;
      text-align: center;
    }

    .error {
      background: rgba(255,107,107,0.14);
      border: 1px solid rgba(255,107,107,0.22);
      color: rgba(230,234,240,0.95);
      padding: 14px;
      border-radius: 14px;
      margin-top: 14px;
      font-weight: 800;
      text-align: center;
    }

    .pop { animation: popIn 220ms cubic-bezier(.2,.9,.2,1) both; }
    @keyframes popIn {
      from { opacity: 0; transform: translateY(8px) scale(0.99); }
      to   { opacity: 1; transform: translateY(0) scale(1); }
    }

    /* Small pagination */
    .pager {
      display: flex;
      gap: 10px;
      justify-content: center;
      align-items: center;
      margin-top: 18px;
      flex-wrap: wrap;
    }

    .pbtn {
      padding: 10px 14px;
      border-radius: 14px;
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(18,24,36,0.8);
      color: var(--text);
      font-weight: 900;
      cursor: pointer;
      transition: transform .15s, filter .15s;
    }

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

    .pbtn:hover { transform: translateY(-1px); filter: brightness(1.07); }

    .pbtn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

  
    @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%;
      }
    }
