    :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;
      overflow-y: hidden !important;
    }

    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 !important;
    }

    .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 !important;
      left: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      padding: 10px 12px;
      border-radius: 0;
      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 !important;
      justify-content: space-around;
      gap: 8px;
      z-index: 1200;
      backdrop-filter: blur(8px);
      will-change: transform;
      -webkit-backface-visibility: hidden;
      backface-visibility: hidden;
    }

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

    .theme-light .bottom-nav a:hover {
      color: #0f172a;
      background: rgba(79,124,255,0.12);
    }

    .theme-light .bottom-nav-more button:hover {
      color: #0f172a;
    }

    .bottom-nav-more {
      position: relative;
      flex: 1;
    }

    .bottom-nav-more button {
      width: 100%;
      background: none;
      border: 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;
      cursor: pointer;
      transition: background 0.2s ease, color 0.2s ease;
    }

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

    .bottom-nav-more button:hover {
      background: rgba(79,124,255,0.12);
    }

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

    .bottom-nav-more-menu {
      position: absolute;
      bottom: calc(100% + 12px);
      right: 0;
      background: rgba(12,16,26,0.96);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 16px;
      padding: 8px;
      min-width: 180px;
      box-shadow: 0 12px 40px rgba(0,0,0,0.5);
      backdrop-filter: blur(12px);
      display: none !important;
      flex-direction: column;
      gap: 4px;
      z-index: 1250;
    }

    .bottom-nav-more-menu.active {
      display: flex;
    }

    .theme-light .bottom-nav-more-menu {
      background: rgba(255,255,255,0.96);
      border: 1px solid rgba(0,0,0,0.12);
    }

    .bottom-nav-more-menu a {
      padding: 12px 16px;
      color: var(--text);
      text-decoration: none;
      border-radius: 12px;
      font-size: 0.9rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 10px;
      transition: background 0.2s ease;
    }

    .bottom-nav-more-menu a:hover {
      background: rgba(79,124,255,0.15);
    }

    .bottom-nav-more-menu a .icon {
      font-size: 1.2rem;
    }

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

      .hamburger,
      .overlay {
        display: none !important;
      }

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

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

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

    .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.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease, box-shadow 0.3s 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;
      transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .tile::after {
      content: "";
      position: absolute;
      inset: -3px;
      border-radius: 18px;
      background: linear-gradient(135deg, rgba(79,124,255,0.5), rgba(57,217,138,0.3));
      opacity: 0;
      z-index: -1;
      filter: blur(15px);
      transition: opacity 0.3s ease;
    }

    .tile:hover {
      transform: translateY(-5px) scale(1.02);
      border-color: rgba(79,124,255,0.35);
      box-shadow:
        0 25px 65px rgba(0,0,0,0.42),
        0 0 35px rgba(79,124,255,0.2);
    }

    .tile:hover::before {
      opacity: 1;
      transform: scale(1.1);
    }

    .tile:hover::after {
      opacity: 1;
    }

    .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 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
      user-select: none;
      position: relative;
      overflow: hidden;
    }

    .btn::before {
      content: "";
      position: absolute;
      top: 50%;
      left: 50%;
      width: 0;
      height: 0;
      border-radius: 50%;
      background: rgba(255,255,255,0.2);
      transform: translate(-50%, -50%);
      transition: width 0.5s ease, height 0.5s ease;
    }

    .btn:hover::before {
      width: 200px;
      height: 200px;
    }

    .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(-2px) scale(1.05);
      filter: brightness(1.12);
      box-shadow:
        0 10px 28px rgba(79,124,255,0.2),
        0 0 25px rgba(79,124,255,0.15);
    }

    .btn:active {
      transform: translateY(0) scale(1);
      transition: transform 0.1s ease;
    }

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

    .btn.practice:hover {
      box-shadow:
        0 12px 32px rgba(79,124,255,0.3),
        0 0 30px rgba(79,124,255,0.25);
    }

    .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.15);
      opacity: 1;
      box-shadow:
        0 10px 28px rgba(57,217,138,0.2),
        0 0 25px rgba(57,217,138,0.15);
    }

    .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 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease, box-shadow 0.25s ease;
      position: relative;
    }

    .pbtn::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: 14px;
      background: linear-gradient(135deg, rgba(79,124,255,0.2), transparent);
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .pbtn:hover::after {
      opacity: 1;
    }

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

    .pbtn:hover {
      transform: translateY(-2px) scale(1.05);
      filter: brightness(1.12);
      box-shadow:
        0 8px 22px rgba(79,124,255,0.15),
        0 0 20px rgba(79,124,255,0.1);
    }

    .pbtn:active {
      transform: translateY(0) scale(1);
      transition: transform 0.1s ease;
    }

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

  
    @media (max-width: 820px) {
      /* Hide text labels on all mobile screens */
      .bottom-nav a span:not(.icon),
      .bottom-nav-more button span:not(.icon) {
        display: none !important;
      }

      /* Remove gap since no text */
      .bottom-nav a,
      .bottom-nav-more button {
        font-size: 0 !important;
        gap: 0 !important;
      justify-content: center !important;
      align-items: center !important;
      }

      /* Ensure icons are centered and properly sized */
      .bottom-nav a .icon,
      .bottom-nav-more button .icon {
        font-size: 1.3rem !important;
      display: block !important;
      }
    }

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

