/* DB GenAI Platform — Main Stylesheet */
    /* ═══════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════ */
    :root {
      --navy-deep: #060d1f;
      --navy-mid: #0b1730;
      --navy-light: #112244;
      --electric: #1e90ff;
      --electric-glow: #3fa8ff;
      --electric-dim: #0d5fbb;
      --accent-teal: #00d4c8;
      --accent-amber: #f0a500;
      --text-primary: #e8edf5;
      --text-secondary: #8a9bbf;
      --text-muted: #4a5a7a;
      --border: rgba(30, 144, 255, 0.18);
      --border-strong: rgba(30, 144, 255, 0.35);
      --card-bg: rgba(11, 23, 48, 0.88);
      --radius: 14px;
      --radius-sm: 8px;
      --shadow: 0 8px 32px rgba(0, 0, 30, 0.55);
      --shadow-glow: 0 0 40px rgba(30, 144, 255, 0.12);
      --trans: 0.28s cubic-bezier(.4, 0, .2, 1);
      --header-h: 62px;
    }

    [data-theme="light"] {
      --navy-deep: #f2f5fc;
      --navy-mid: #e5ebf8;
      --navy-light: #d6dfef;
      --electric: #1060cc;
      --electric-glow: #0040aa;
      --electric-dim: #3070dd;
      --card-bg: rgba(255, 255, 255, 0.92);
      --shadow: 0 8px 32px rgba(16, 96, 204, 0.1);
    }

    [data-theme="hc"] {
      --navy-deep: #000;
      --navy-mid: #0a0a0a;
      --navy-light: #151515;
      --electric: #00e5ff;
      --electric-glow: #aaff00;
      --accent-teal: #ffff00;
      --accent-amber: #ffcc00;
      --text-primary: #ffffff;
      --text-secondary: #dddddd;
      --text-muted: #aaaaaa;
      --border: rgba(0, 229, 255, 0.55);
      --card-bg: rgba(15, 15, 15, 0.98);
      --shadow: 0 0 0 1px rgba(0, 229, 255, 0.3);
    }

    /* ═══════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════ */
    *,
    *::before,
    *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0
    }

    html {
      scroll-behavior: smooth
    }

    body {
      font-family: 'DM Sans', sans-serif;
      background: var(--navy-deep);
      color: var(--text-primary);
      min-height: 100vh;
      overflow-x: hidden;
      transition: background var(--trans), color var(--trans);
    }

    a {
      color: var(--electric);
      text-decoration: none
    }

    a:hover {
      color: var(--electric-glow)
    }

    ::-webkit-scrollbar {
      width: 5px
    }

    ::-webkit-scrollbar-track {
      background: var(--navy-deep)
    }

    ::-webkit-scrollbar-thumb {
      background: var(--navy-light);
      border-radius: 3px
    }

    /* top accent bar */
    body::before {
      content: '';
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: 2px;
      background: linear-gradient(90deg, var(--electric), var(--accent-teal), var(--electric));
      background-size: 200% 100%;
      animation: shimmer 4s linear infinite;
      z-index: 9999;
      pointer-events: none;
    }

    @keyframes shimmer {
      0% {
        background-position: 0 0
      }

      100% {
        background-position: 200% 0
      }
    }

    /* ═══════════════════════════════════════════
   AUTH GATE (shown before login)
═══════════════════════════════════════════ */
    #auth-gate {
      position: fixed;
      inset: 0;
      background: var(--navy-deep);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      z-index: 10000;
      padding: 24px;
      transition: opacity 0.5s ease;
    }

    #auth-gate.hidden {
      opacity: 0;
      pointer-events: none
    }

    .gate-card {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 52px 44px;
      text-align: center;
      max-width: 420px;
      width: 100%;
      box-shadow: var(--shadow), var(--shadow-glow);
      backdrop-filter: blur(12px);
      position: relative;
      overflow: hidden;
    }

    .gate-card::before {
      content: '';
      position: absolute;
      top: -80px;
      right: -80px;
      width: 280px;
      height: 280px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(30, 144, 255, 0.08) 0%, transparent 70%);
      pointer-events: none;
    }

    .gate-logo {
      width: 52px;
      height: 52px;
      border-radius: 12px;
      margin: 0 auto 20px;
      background: linear-gradient(135deg, var(--electric-dim), var(--electric));
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: 'Syne', sans-serif;
      font-weight: 800;
      font-size: 1.1rem;
      color: #fff;
      box-shadow: 0 0 24px rgba(30, 144, 255, 0.4);
    }

    .gate-card h1 {
      font-family: 'Syne', sans-serif;
      font-weight: 800;
      font-size: 1.5rem;
      color: var(--text-primary);
      margin-bottom: 8px;
      letter-spacing: -0.5px;
    }

    .gate-card p {
      font-size: 0.84rem;
      color: var(--text-secondary);
      line-height: 1.7;
      margin-bottom: 32px;
    }

    .btn-signin {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      width: 100%;
      padding: 14px 24px;
      background: var(--electric);
      border: none;
      border-radius: 10px;
      color: #fff;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.9rem;
      font-weight: 600;
      cursor: pointer;
      transition: var(--trans);
      letter-spacing: 0.2px;
    }

    .btn-signin:hover {
      background: var(--electric-glow);
      box-shadow: 0 0 28px rgba(30, 144, 255, 0.45);
      transform: translateY(-1px);
    }

    .gate-note {
      margin-top: 18px;
      font-size: 0.72rem;
      color: var(--text-muted);
      line-height: 1.6;
    }

    .gate-note a {
      color: var(--electric);
      font-size: 0.72rem
    }

    .secure-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.68rem;
      color: var(--text-muted);
      margin-top: 24px;
      letter-spacing: 0.5px;
    }

    .secure-badge::before {
      content: '🔒';
      font-size: 0.7rem
    }

    /* ═══════════════════════════════════════════
   MAIN APP (shown after auth)
═══════════════════════════════════════════ */
    #app {
      display: none
    }

    #app.visible {
      display: block
    }

    /* ═══════════════════════════════════════════
   HEADER
═══════════════════════════════════════════ */
    header {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: var(--header-h);
      background: rgba(6, 13, 31, 0.94);
      backdrop-filter: blur(18px);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 22px;
      z-index: 900;
    }

    [data-theme="light"] header {
      background: rgba(242, 245, 252, 0.94)
    }

    [data-theme="hc"] header {
      background: #000;
      border-bottom: 2px solid var(--electric)
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      cursor: pointer;
      user-select: none
    }

    .brand-mark {
      width: 36px;
      height: 36px;
      border-radius: 8px;
      flex-shrink: 0;
      background: linear-gradient(135deg, var(--electric-dim), var(--electric));
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: 'Syne', sans-serif;
      font-weight: 800;
      font-size: 0.85rem;
      color: #fff;
      box-shadow: 0 0 18px rgba(30, 144, 255, 0.35);
    }

    .brand-text .b-name {
      font-family: 'Syne', sans-serif;
      font-weight: 800;
      font-size: 0.95rem;
      color: var(--text-primary);
      letter-spacing: -0.3px
    }

    .brand-text .b-sub {
      font-size: 0.61rem;
      color: var(--electric);
      font-weight: 500;
      letter-spacing: 0.9px;
      text-transform: uppercase;
      display: block;
      margin-top: 2px
    }

    .header-right {
      display: flex;
      align-items: center;
      gap: 10px
    }

    .user-chip {
      display: flex;
      align-items: center;
      gap: 8px;
      background: rgba(30, 144, 255, 0.08);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 5px 12px 5px 8px;
      font-size: 0.75rem;
      color: var(--text-secondary);
    }

    .user-avatar {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--electric-dim), var(--accent-teal));
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.62rem;
      font-weight: 700;
      color: #fff;
      flex-shrink: 0;
    }

    .btn-icon {
      background: none;
      border: 1px solid var(--border);
      color: var(--text-secondary);
      cursor: pointer;
      width: 36px;
      height: 36px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: var(--trans);
      font-size: 1rem;
    }

    .btn-icon:hover {
      border-color: var(--electric);
      color: var(--electric);
      background: rgba(30, 144, 255, 0.08)
    }

    .btn-signout {
      background: none;
      border: 1px solid var(--border);
      color: var(--text-muted);
      font-family: 'DM Sans', sans-serif;
      font-size: 0.75rem;
      font-weight: 500;
      padding: 6px 14px;
      border-radius: 7px;
      cursor: pointer;
      transition: var(--trans);
    }

    .btn-signout:hover {
      border-color: rgba(255, 80, 80, 0.5);
      color: #ff5050
    }

    /* NAV TABS */
    .nav-tabs {
      display: flex;
      align-items: center;
      gap: 4px;
      margin-left: 24px
    }

    .nav-tab {
      background: none;
      border: none;
      color: var(--text-muted);
      font-family: 'DM Sans', sans-serif;
      font-size: 0.82rem;
      font-weight: 500;
      padding: 8px 14px;
      border-radius: 7px;
      cursor: pointer;
      transition: var(--trans);
      white-space: nowrap;
    }

    .nav-tab:hover {
      color: var(--text-secondary);
      background: rgba(30, 144, 255, 0.06)
    }

    .nav-tab.active {
      color: var(--electric);
      background: rgba(30, 144, 255, 0.12)
    }

    @media(max-width:600px) {
      .nav-tabs {
        display: none
      }

      .mobile-nav {
        display: flex !important
      }
    }

    .mobile-nav {
      display: none;
      background: none;
      border: none;
      color: var(--text-secondary);
      cursor: pointer;
      padding: 6px;
      flex-direction: column;
      gap: 5px;
      margin-right: 6px;
    }

    .mobile-nav span {
      display: block;
      width: 20px;
      height: 2px;
      background: var(--electric);
      border-radius: 2px;
      transition: var(--trans)
    }

    /* MOBILE DRAWER */
    .mobile-drawer {
      position: fixed;
      top: var(--header-h);
      left: 0;
      right: 0;
      background: var(--navy-mid);
      border-bottom: 1px solid var(--border);
      z-index: 850;
      transform: translateY(-100%);
      transition: transform var(--trans);
      padding: 12px 16px;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .mobile-drawer.open {
      transform: translateY(0)
    }

    .drawer-tab {
      background: none;
      border: none;
      color: var(--text-secondary);
      font-family: 'DM Sans', sans-serif;
      font-size: 0.9rem;
      font-weight: 500;
      padding: 12px 16px;
      border-radius: 8px;
      cursor: pointer;
      transition: var(--trans);
      text-align: left;
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .drawer-tab.active {
      color: var(--electric);
      background: rgba(30, 144, 255, 0.1)
    }

    .drawer-tab:hover {
      background: rgba(30, 144, 255, 0.08)
    }

    /* USERNAME — truncate on small screens */
    .username-label {
      max-width: 100px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap
    }

    @media(max-width:420px) {
      .username-label {
        display: none
      }
    }

    /* ═══════════════════════════════════════════
   SIDEBAR LAYOUT MODE
═══════════════════════════════════════════ */
    body.sidebar-mode header .nav-tabs {
      display: none
    }

    body.sidebar-mode .app-sidebar {
      display: flex !important
    }

    body.sidebar-mode main {
      margin-left: 220px
    }

    .app-sidebar {
      display: none;
      position: fixed;
      top: var(--header-h);
      left: 0;
      bottom: 0;
      width: 220px;
      background: var(--navy-mid);
      border-right: 1px solid var(--border);
      z-index: 800;
      flex-direction: column;
      padding: 16px 10px;
      gap: 4px;
      overflow-y: auto;
    }

    .sidebar-nav-btn {
      background: none;
      border: none;
      color: var(--text-secondary);
      font-family: 'DM Sans', sans-serif;
      font-size: 0.85rem;
      font-weight: 500;
      padding: 11px 14px;
      border-radius: 8px;
      cursor: pointer;
      transition: var(--trans);
      text-align: left;
      display: flex;
      align-items: center;
      gap: 10px;
      width: 100%;
      border-left: 2px solid transparent;
    }

    .sidebar-nav-btn:hover {
      background: rgba(30, 144, 255, 0.08);
      color: var(--text-primary)
    }

    .sidebar-nav-btn.active {
      color: var(--electric);
      background: rgba(30, 144, 255, 0.1);
      border-left-color: var(--electric)
    }

    .sidebar-divider {
      height: 1px;
      background: var(--border);
      margin: 6px 4px
    }

    .sidebar-bottom {
      margin-top: auto;
      padding-top: 12px;
      border-top: 1px solid var(--border)
    }

    @media(max-width:600px) {
      body.sidebar-mode .app-sidebar {
        display: none !important
      }

      body.sidebar-mode main {
        margin-left: 0
      }
    }

    /* ═══════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════ */
    main {
      margin-top: var(--header-h);
      min-height: calc(100vh - var(--header-h));
      padding: 0;
    }

    .page {
      display: none;
      animation: fadeUp 0.35s ease both
    }

    .page.active {
      display: block
    }

    @keyframes fadeUp {
      from {
        opacity: 0;
        transform: translateY(14px)
      }

      to {
        opacity: 1;
        transform: translateY(0)
      }
    }

    /* ═══════════════════════════════════════════
   HOME PAGE
═══════════════════════════════════════════ */
    .home-hero {
      background: var(--card-bg);
      border-bottom: 1px solid var(--border);
      padding: 48px 40px 44px;
      position: relative;
      overflow: hidden;
      backdrop-filter: blur(8px);
    }

    .home-hero::before {
      content: '';
      position: absolute;
      top: -100px;
      right: -100px;
      width: 500px;
      height: 500px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(30, 144, 255, 0.07) 0%, transparent 65%);
      pointer-events: none;
    }

    .home-hero::after {
      content: '';
      position: absolute;
      bottom: -80px;
      left: 30%;
      width: 400px;
      height: 400px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(0, 212, 200, 0.05) 0%, transparent 65%);
      pointer-events: none;
    }

    .hero-inner {
      max-width: 840px;
      margin: 0 auto;
      position: relative;
      z-index: 1
    }

    .platform-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: rgba(30, 144, 255, 0.1);
      border: 1px solid var(--border);
      color: var(--electric);
      font-size: 0.68rem;
      font-weight: 600;
      letter-spacing: 1.2px;
      text-transform: uppercase;
      padding: 5px 14px;
      border-radius: 20px;
      margin-bottom: 20px;
    }

    .badge-pulse {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--accent-teal);
      animation: blink 2s ease-in-out infinite
    }

    @keyframes blink {

      0%,
      100% {
        opacity: 1
      }

      50% {
        opacity: 0.25
      }
    }

    .home-hero h1 {
      font-family: 'Syne', sans-serif;
      font-weight: 800;
      font-size: 2.1rem;
      color: var(--text-primary);
      letter-spacing: -0.8px;
      line-height: 1.25;
      margin-bottom: 14px;
      padding-bottom: 4px;
    }

    .home-hero h1 em {
      font-style: normal;
      color: var(--electric)
    }

    .home-hero .sub {
      font-size: 0.9rem;
      color: var(--text-secondary);
      line-height: 1.8;
      max-width: 560px;
    }

    .hero-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 20px;
      margin-top: 28px;
    }

    .meta-stat {
      display: flex;
      flex-direction: column
    }

    .meta-num {
      font-family: 'Syne', sans-serif;
      font-weight: 800;
      font-size: 1.55rem;
      color: var(--electric);
      line-height: 1;
    }

    .meta-label {
      font-size: 0.72rem;
      color: var(--text-muted);
      margin-top: 3px;
      font-weight: 500;
      letter-spacing: 0.3px
    }

    .meta-divider {
      width: 1px;
      background: var(--border);
      align-self: stretch;
      margin: 4px 0
    }

    /* APP GRID SECTION */
    .grid-section {
      max-width: 880px;
      margin: 0 auto;
      padding: 36px 24px 48px
    }

    .grid-header {
      margin-bottom: 28px
    }

    .grid-header h2 {
      font-family: 'Syne', sans-serif;
      font-weight: 700;
      font-size: 1.1rem;
      color: var(--text-secondary);
      letter-spacing: 1.5px;
      text-transform: uppercase;
    }

    .accent-line {
      width: 32px;
      height: 2px;
      border-radius: 2px;
      background: linear-gradient(90deg, var(--electric), var(--accent-teal));
      margin-top: 10px
    }

    .app-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 18px
    }

    @media(max-width:640px) {
      .app-grid {
        grid-template-columns: 1fr
      }
    }

    @media(min-width:641px) and (max-width:900px) {
      .app-grid {
        grid-template-columns: 1fr 1fr
      }
    }

    .app-card {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 28px 24px;
      position: relative;
      overflow: hidden;
      cursor: pointer;
      transition: var(--trans);
      backdrop-filter: blur(8px);
    }

    .app-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 2px;
      background: linear-gradient(90deg, var(--electric), var(--accent-teal));
      opacity: 0;
      transition: var(--trans);
    }

    .app-card:hover::before,
    .app-card.featured::before {
      opacity: 1
    }

    .app-card:hover {
      border-color: var(--border-strong);
      box-shadow: 0 16px 48px rgba(30, 144, 255, 0.14);
      transform: translateY(-3px);
    }

    .app-card.coming-soon {
      cursor: default
    }

    .app-card.coming-soon:hover {
      transform: none;
      border-color: var(--border);
      box-shadow: var(--shadow)
    }

    .card-number {
      font-family: 'Syne', sans-serif;
      font-weight: 800;
      font-size: 0.65rem;
      color: var(--text-muted);
      letter-spacing: 2px;
      text-transform: uppercase;
      margin-bottom: 10px;
      display: block;
    }

    .card-icon {
      font-size: 2rem;
      margin-bottom: 14px;
      display: block
    }

    .app-card h3 {
      font-family: 'Syne', sans-serif;
      font-weight: 700;
      font-size: 1rem;
      color: var(--text-primary);
      margin-bottom: 8px;
    }

    .card-desc {
      font-size: 0.78rem;
      color: var(--text-secondary);
      line-height: 1.65;
      margin-bottom: 20px
    }

    .card-cta {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--electric);
      transition: var(--trans);
    }

    .card-cta:hover {
      gap: 10px
    }

    .card-cta svg {
      width: 14px;
      height: 14px;
      stroke: currentColor;
      fill: none;
      stroke-width: 2.5;
      flex-shrink: 0
    }

    .badge-soon {
      display: inline-block;
      background: rgba(30, 144, 255, 0.08);
      border: 1px solid var(--border);
      color: var(--text-muted);
      font-size: 0.65rem;
      font-weight: 700;
      letter-spacing: 1.5px;
      text-transform: uppercase;
      padding: 3px 12px;
      border-radius: 20px;
    }

    .card-tag {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: rgba(0, 212, 200, 0.08);
      border: 1px solid rgba(0, 212, 200, 0.2);
      color: var(--accent-teal);
      font-size: 0.65rem;
      font-weight: 600;
      letter-spacing: 0.8px;
      text-transform: uppercase;
      padding: 3px 10px;
      border-radius: 20px;
      margin-bottom: 12px;
    }

    /* ═══════════════════════════════════════════
   APP PAGES (App 1/2/3)
═══════════════════════════════════════════ */
    .app-page {
      max-width: 880px;
      margin: 0 auto;
      padding: 32px 24px 48px
    }

    .app-page-header {
      display: flex;
      align-items: center;
      gap: 16px;
      margin-bottom: 28px;
      flex-wrap: wrap;
    }

    .back-btn {
      background: none;
      border: 1px solid var(--border);
      color: var(--text-muted);
      border-radius: 7px;
      padding: 7px 14px;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.78rem;
      cursor: pointer;
      transition: var(--trans);
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }

    .back-btn:hover {
      border-color: var(--electric);
      color: var(--electric)
    }

    .app-page-title {
      font-family: 'Syne', sans-serif;
      font-weight: 800;
      font-size: 1.4rem;
      color: var(--text-primary);
      letter-spacing: -0.4px;
    }

    .app-page-sub {
      font-size: 0.8rem;
      color: var(--text-muted);
      margin-top: 3px
    }

    /* JAPANESE TRAINER SPECIFIC */
    .trainer-layout {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 18px
    }

    @media(max-width:680px) {
      .trainer-layout {
        grid-template-columns: 1fr
      }
    }

    .trainer-card {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 24px;
      backdrop-filter: blur(8px);
      box-shadow: var(--shadow);
    }

    .trainer-card-title {
      font-family: 'Syne', sans-serif;
      font-weight: 700;
      font-size: 0.82rem;
      color: var(--text-muted);
      letter-spacing: 1.5px;
      text-transform: uppercase;
      margin-bottom: 16px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .trainer-card-title::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--border)
    }

    /* Word display */
    .word-display {
      text-align: center;
      padding: 28px 16px;
      border-radius: 10px;
      background: rgba(30, 144, 255, 0.04);
      border: 1px solid var(--border);
      margin-bottom: 16px;
    }

    .word-kanji {
      font-size: 3.2rem;
      color: var(--text-primary);
      line-height: 1.2;
      margin-bottom: 8px;
      font-family: 'DM Sans', sans-serif;
    }

    .word-reading {
      font-size: 1rem;
      color: var(--electric);
      margin-bottom: 6px;
      font-weight: 500;
    }

    .word-meaning {
      font-size: 0.85rem;
      color: var(--text-secondary)
    }

    .word-level {
      display: inline-block;
      margin-top: 10px;
      background: rgba(0, 212, 200, 0.1);
      border: 1px solid rgba(0, 212, 200, 0.25);
      color: var(--accent-teal);
      font-size: 0.65rem;
      font-weight: 700;
      letter-spacing: 1.2px;
      text-transform: uppercase;
      padding: 2px 10px;
      border-radius: 20px;
    }

    /* Controls */
    .trainer-controls {
      display: flex;
      flex-direction: column;
      gap: 10px
    }

    .mode-select {
      width: 100%;
      padding: 10px 12px;
      background: var(--navy-light);
      border: 1px solid var(--border);
      border-radius: 8px;
      color: var(--text-primary);
      font-family: 'DM Sans', sans-serif;
      font-size: 0.84rem;
      outline: none;
      transition: var(--trans);
      cursor: pointer;
    }

    .mode-select:focus {
      border-color: var(--electric);
      box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.12)
    }

    .btn-trainer {
      width: 100%;
      padding: 11px 16px;
      border: none;
      border-radius: 8px;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
      transition: var(--trans);
    }

    .btn-trainer.primary {
      background: var(--electric);
      color: #fff
    }

    .btn-trainer.primary:hover {
      background: var(--electric-glow);
      box-shadow: 0 0 20px rgba(30, 144, 255, 0.35)
    }

    .btn-trainer.secondary {
      background: rgba(30, 144, 255, 0.08);
      border: 1px solid var(--border);
      color: var(--text-secondary)
    }

    .btn-trainer.secondary:hover {
      border-color: var(--electric);
      color: var(--electric)
    }

    /* Quiz area */
    .quiz-options {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-top: 12px
    }

    .quiz-option {
      padding: 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: rgba(30, 144, 255, 0.04);
      font-family: 'DM Sans', sans-serif;
      font-size: 0.82rem;
      color: var(--text-secondary);
      cursor: pointer;
      transition: var(--trans);
      text-align: center;
    }

    .quiz-option:hover {
      border-color: var(--electric);
      color: var(--electric);
      background: rgba(30, 144, 255, 0.1)
    }

    .quiz-option.correct {
      border-color: #00c97a;
      color: #00c97a;
      background: rgba(0, 201, 122, 0.08)
    }

    .quiz-option.wrong {
      border-color: #ff5050;
      color: #ff5050;
      background: rgba(255, 80, 80, 0.08)
    }

    /* Progress */
    .progress-bar-wrap {
      background: var(--navy-light);
      border-radius: 4px;
      height: 5px;
      margin-top: 12px;
      overflow: hidden
    }

    .progress-bar-fill {
      height: 100%;
      border-radius: 4px;
      background: linear-gradient(90deg, var(--electric), var(--accent-teal));
      transition: width 0.5s ease
    }

    .session-stats {
      display: flex;
      gap: 16px;
      margin-top: 14px;
      flex-wrap: wrap
    }

    .stat-pill {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 0.75rem;
      color: var(--text-muted);
    }

    .stat-pill strong {
      color: var(--text-secondary);
      font-weight: 600
    }

    /* History log */
    .history-log {
      max-height: 220px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 6px;
      padding-right: 4px;
    }

    .history-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      border-radius: 7px;
      background: rgba(30, 144, 255, 0.04);
      border: 1px solid var(--border);
      font-size: 0.76rem;
    }

    .history-item .h-word {
      font-weight: 600;
      color: var(--text-primary);
      min-width: 60px
    }

    .history-item .h-result {
      margin-left: auto
    }

    .h-correct {
      color: #00c97a
    }

    .h-wrong {
      color: #ff5050
    }

    /* API status indicator */
    .api-status {
      display: flex;
      align-items: center;
      gap: 7px;
      font-size: 0.7rem;
      color: var(--text-muted);
      margin-bottom: 16px;
      padding: 6px 12px;
      border-radius: 6px;
      background: rgba(30, 144, 255, 0.04);
      border: 1px solid var(--border);
      width: fit-content;
    }

    .status-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      flex-shrink: 0
    }

    .status-dot.online {
      background: #00c97a;
      box-shadow: 0 0 6px #00c97a
    }

    .status-dot.offline {
      background: #ff5050
    }

    .status-dot.loading {
      background: var(--accent-amber);
      animation: blink 1s ease-in-out infinite
    }

    /* COMING SOON PAGE */
    .coming-soon-page {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      min-height: 60vh;
      text-align: center;
      padding: 40px 24px;
    }

    .cs-icon {
      font-size: 3.5rem;
      margin-bottom: 20px;
      opacity: 0.7
    }

    .cs-title {
      font-family: 'Syne', sans-serif;
      font-weight: 800;
      font-size: 1.4rem;
      color: var(--text-primary);
      margin-bottom: 10px
    }

    .cs-desc {
      font-size: 0.85rem;
      color: var(--text-secondary);
      max-width: 380px;
      line-height: 1.7
    }

    .cs-badge {
      display: inline-block;
      margin-top: 20px;
      background: rgba(240, 165, 0, 0.1);
      border: 1px solid rgba(240, 165, 0, 0.3);
      color: var(--accent-amber);
      font-size: 0.68rem;
      font-weight: 700;
      letter-spacing: 1.5px;
      text-transform: uppercase;
      padding: 5px 16px;
      border-radius: 20px;
    }

    /* ═══════════════════════════════════════════
   ABOUT PAGE
═══════════════════════════════════════════ */
    .about-section {
      max-width: 760px;
      margin: 0 auto;
      padding: 40px 24px 60px
    }

    .about-hero {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 36px 32px;
      margin-bottom: 20px;
      backdrop-filter: blur(8px);
      box-shadow: var(--shadow);
    }

    .about-hero h2 {
      font-family: 'Syne', sans-serif;
      font-weight: 800;
      font-size: 1.4rem;
      color: var(--text-primary);
      margin-bottom: 10px
    }

    .about-body {
      font-size: 0.875rem;
      color: var(--text-secondary);
      line-height: 1.85
    }

    .about-body p+p {
      margin-top: 12px
    }

    .about-body strong {
      color: var(--text-primary)
    }

    .tag-cloud {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 16px
    }

    .tag {
      background: rgba(30, 144, 255, 0.07);
      border: 1px solid var(--border);
      color: var(--text-secondary);
      font-size: 0.72rem;
      padding: 4px 12px;
      border-radius: 20px;
      transition: var(--trans);
      cursor: default
    }

    .tag:hover {
      background: rgba(30, 144, 255, 0.18);
      color: var(--electric);
      border-color: var(--electric)
    }

    .disclaimer-body {
      font-size: 0.84rem;
      color: var(--text-secondary);
      line-height: 1.8
    }

    .disclaimer-body p+p {
      margin-top: 12px
    }

    .disclaimer-divider {
      border: none;
      border-top: 1px solid var(--border);
      margin: 16px 0
    }

    .disclaimer-body strong {
      color: var(--text-primary)
    }

    .card {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 24px 28px;
      box-shadow: var(--shadow);
      margin-bottom: 16px;
      backdrop-filter: blur(8px);
    }

    .card-title {
      font-family: 'Syne', sans-serif;
      font-weight: 700;
      font-size: 0.94rem;
      color: var(--text-primary);
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      gap: 9px
    }

    .dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--electric);
      box-shadow: 0 0 8px var(--electric);
      flex-shrink: 0
    }

    /* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
    footer {
      border-top: 1px solid var(--border);
      padding: 20px 24px;
      text-align: center;
      font-size: 0.72rem;
      color: var(--text-muted);
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      gap: 10px;
      max-width: 880px;
      margin: 0 auto;
    }

    footer a {
      color: var(--text-muted);
      transition: var(--trans)
    }

    footer a:hover {
      color: var(--electric)
    }

    .footer-div {
      opacity: 0.3
    }

    /* ═══════════════════════════════════════════
   THEME MODAL
═══════════════════════════════════════════ */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.65);
      backdrop-filter: blur(5px);
      z-index: 2000;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      pointer-events: none;
      transition: opacity var(--trans);
    }

    .modal-overlay.active {
      opacity: 1;
      pointer-events: all
    }

    .modal {
      background: var(--navy-mid);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 28px;
      width: min(360px, 90vw);
      transform: scale(0.93) translateY(10px);
      transition: transform var(--trans);
      box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65);
    }

    .modal-overlay.active .modal {
      transform: scale(1) translateY(0)
    }

    .modal h3 {
      font-family: 'Syne', sans-serif;
      font-weight: 700;
      font-size: 1rem;
      color: var(--text-primary);
      margin-bottom: 6px
    }

    .shortcut-hint {
      font-size: 0.7rem;
      color: var(--text-muted);
      margin-bottom: 16px
    }

    .theme-options {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 10px;
      margin-bottom: 18px
    }

    .theme-btn {
      padding: 14px 8px;
      border-radius: 9px;
      border: 1px solid var(--border);
      background: var(--navy-light);
      color: var(--text-secondary);
      cursor: pointer;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.78rem;
      font-weight: 500;
      transition: var(--trans);
      text-align: center;
      line-height: 1.5;
    }

    .theme-btn:hover,
    .theme-btn.active {
      border-color: var(--electric);
      color: var(--electric);
      background: rgba(30, 144, 255, 0.1)
    }

    .t-icon {
      display: block;
      font-size: 1.2rem;
      margin-bottom: 5px
    }

    .modal-close {
      width: 100%;
      padding: 9px;
      background: none;
      border: 1px solid var(--border);
      border-radius: 8px;
      color: var(--text-secondary);
      cursor: pointer;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.82rem;
      transition: var(--trans);
    }

    .modal-close:hover {
      border-color: var(--text-muted);
      color: var(--text-primary)
    }

    /* ═══════════════════════════════════════════
   COOKIE MODAL (full preference UI)
═══════════════════════════════════════════ */
    .cookie-modal {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.7);
      backdrop-filter: blur(6px);
      z-index: 3000;
      display: flex;
      align-items: flex-end;
      justify-content: center;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.4s ease;
    }

    .cookie-modal.show {
      opacity: 1;
      pointer-events: all
    }

    .cookie-panel {
      background: var(--navy-mid);
      border: 1px solid var(--border);
      border-radius: var(--radius) var(--radius) 0 0;
      width: 100%;
      max-width: 640px;
      padding: 32px 28px 28px;
      transform: translateY(100%);
      transition: transform 0.45s cubic-bezier(.4, 0, .2, 1);
      box-shadow: 0 -20px 60px rgba(0, 0, 30, 0.6);
    }

    .cookie-modal.show .cookie-panel {
      transform: translateY(0)
    }

    .cookie-panel h3 {
      font-family: 'Syne', sans-serif;
      font-weight: 700;
      font-size: 1.05rem;
      color: var(--text-primary);
      margin-bottom: 6px
    }

    .cookie-panel p {
      font-size: 0.8rem;
      color: var(--text-secondary);
      line-height: 1.6;
      margin-bottom: 22px
    }

    .cookie-categories {
      display: flex;
      flex-direction: column;
      gap: 12px;
      margin-bottom: 22px
    }

    .cookie-cat {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      padding: 14px 16px;
      border-radius: 9px;
      background: rgba(30, 144, 255, 0.04);
      border: 1px solid var(--border);
    }

    .cookie-cat-info h4 {
      font-size: 0.83rem;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 3px
    }

    .cookie-cat-info p {
      font-size: 0.73rem;
      color: var(--text-muted);
      margin-bottom: 0;
      line-height: 1.5
    }

    .toggle-switch {
      position: relative;
      width: 40px;
      height: 22px;
      flex-shrink: 0;
      margin-top: 2px
    }

    .toggle-switch input {
      opacity: 0;
      width: 0;
      height: 0;
      position: absolute
    }

    .toggle-slider {
      position: absolute;
      inset: 0;
      cursor: pointer;
      background: var(--navy-light);
      border-radius: 11px;
      transition: var(--trans);
      border: 1px solid var(--border);
    }

    .toggle-slider::before {
      content: '';
      position: absolute;
      height: 16px;
      width: 16px;
      left: 2px;
      top: 2px;
      border-radius: 50%;
      background: var(--text-muted);
      transition: var(--trans);
    }

    input:checked+.toggle-slider {
      background: var(--electric);
      border-color: var(--electric)
    }

    input:checked+.toggle-slider::before {
      transform: translateX(18px);
      background: #fff
    }

    input:disabled+.toggle-slider {
      cursor: not-allowed;
      opacity: 0.7
    }

    .cookie-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px
    }

    .cookie-btn-modal {
      flex: 1;
      min-width: 120px;
      padding: 10px 16px;
      border-radius: 8px;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.82rem;
      font-weight: 600;
      cursor: pointer;
      transition: var(--trans);
    }

    .cookie-btn-modal.outline {
      background: none;
      border: 1px solid var(--border);
      color: var(--text-secondary);
    }

    .cookie-btn-modal.outline:hover {
      border-color: var(--electric);
      color: var(--electric)
    }

    .cookie-btn-modal.primary {
      background: var(--electric);
      border: none;
      color: #fff
    }

    .cookie-btn-modal.primary:hover {
      background: var(--electric-glow);
      box-shadow: 0 0 20px rgba(30, 144, 255, 0.3)
    }

    /* ═══════════════════════════════════════════
   RESPONSIVE EXTRAS
═══════════════════════════════════════════ */
    @media(max-width:520px) {
      .home-hero {
        padding: 32px 20px 30px
      }

      .home-hero h1 {
        font-size: 1.55rem
      }

      .hero-meta {
        gap: 14px
      }

      .grid-section {
        padding: 24px 16px 36px
      }

      .app-page {
        padding: 24px 16px 36px
      }

      .about-section {
        padding: 28px 16px 48px
      }
    }

    @media(min-width:768px) {
      .home-hero {
        padding: 60px 48px 54px
      }

      .home-hero h1 {
        font-size: 2.4rem
      }
    }

    /* Lens Summariser */
    .summariser-container {
      max-width: 800px;
      margin: 0 auto;
      padding: 1rem;
    }

    .summariser-controls {
      display: flex;
      gap: 1rem;
      margin-bottom: 1rem;
      align-items: center;
    }

    .summariser-select {
      flex: 1;
      padding: .6rem;
      background: #1a1a2e;
      color: #e0e0e0;
      border: 1px solid #00e5d4;
      border-radius: 8px;
    }

    .summariser-btn {
      padding: .6rem 1.4rem;
      background: #00e5d4;
      color: #000;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      font-weight: 600;
    }

    .summariser-btn:disabled {
      opacity: .5;
      cursor: not-allowed;
    }

    .summariser-input {
      width: 100%;
      padding: .8rem;
      background: #1a1a2e;
      color: #e0e0e0;
      border: 1px solid #333;
      border-radius: 8px;
      resize: vertical;
      font-size: .95rem;
      box-sizing: border-box;
    }

    .summariser-charcount {
      text-align: right;
      font-size: .8rem;
      color: #888;
      margin-top: .3rem;
    }

    .summariser-result {
      margin-top: 1.5rem;
      background: #1a1a2e;
      border: 1px solid #00e5d4;
      border-radius: 8px;
      padding: 1rem;
    }

    .summariser-result-header {
      display: flex;
      justify-content: space-between;
      font-weight: 600;
      margin-bottom: .8rem;
    }

    .summariser-badge {
      background: #00e5d4;
      color: #000;
      padding: .2rem .6rem;
      border-radius: 12px;
      font-size: .75rem;
    }

    .summariser-bullets {
      padding-left: 1.2rem;
      line-height: 1.8;
    }

    .summariser-error {
      margin-top: 1rem;
      color: #ff6b6b;
      background: #2a1a1a;
      border: 1px solid #ff6b6b;
      border-radius: 8px;
      padding: .8rem;
    }

    .summariser-loading {
      margin-top: 1rem;
      color: #00e5d4;
      text-align: center;
    }
