  :root {
    --font-display: 'Fraunces', serif;
    --font-body: 'Work Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --paper: #FBF7EF;
    --paper-dim: #F3EDE0;
    --ink: #1E2A32;
    --ink-soft: #4B5B63;
    --aegean: #1C5D78;
    --aegean-deep: #123F52;
    --aegean-bright: #2F8FB4;
    --gold: #C89B3C;
    --terracotta: #B5502D;
    --line: #DDD3BC;
    --card-bg: #FFFFFF;
    --card-shadow: 0 1px 2px rgba(30, 42, 50, 0.06);
  }

  body.dark {
    --paper: #1B1F23;
    --paper-dim: #22272C;
    --ink: #ECE7DC;
    --ink-soft: #ACA598;
    --aegean: #7FC2E3;
    --aegean-deep: #9ED4EE;
    --aegean-bright: #59AEDA;
    --gold: #E0B85C;
    --terracotta: #E1794F;
    --line: #383E44;
    --card-bg: #262B30;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  }

  /* Santorini — Cycladic blue & white */
  body.theme-santorini {
    --paper: #EAF6FC;
    --paper-dim: #DCEEF7;
    --ink: #12303D;
    --ink-soft: #3E6478;
    --aegean: #0E6BA8;
    --aegean-deep: #083654;
    --aegean-bright: #1E90C9;
    --gold: #D7A93B;
    --terracotta: #C1562E;
    --line: #BFE0EE;
    --card-bg: #FFFFFF;
    --card-shadow: 0 1px 2px rgba(8, 54, 84, 0.08);
  }

  /* Sunset Aegean — warm coral & gold */
  body.theme-sunset {
    --paper: #FCF2E7;
    --paper-dim: #F7E6D2;
    --ink: #3A2418;
    --ink-soft: #7A5C46;
    --aegean: #B5502D;
    --aegean-deep: #8C3B1F;
    --aegean-bright: #E1794F;
    --gold: #D9A441;
    --terracotta: #8C3B1F;
    --line: #EAD2B8;
    --card-bg: #FFFFFF;
    --card-shadow: 0 1px 2px rgba(58, 36, 24, 0.08);
  }

  /* Olive Grove — muted green & clay */
  body.theme-olive {
    --paper: #F4F3EA;
    --paper-dim: #E9E7D6;
    --ink: #2B301F;
    --ink-soft: #5C6449;
    --aegean: #5B6E3D;
    --aegean-deep: #3E4C28;
    --aegean-bright: #7D9455;
    --gold: #B98A2E;
    --terracotta: #A24B2A;
    --line: #D9D5BC;
    --card-bg: #FFFFFF;
    --card-shadow: 0 1px 2px rgba(43, 48, 31, 0.08);
  }

  /* Meltemi — breezy grey-blue, like the Aegean wind */
  body.theme-meltemi {
    --paper: #EEF1F3;
    --paper-dim: #E3E8EB;
    --ink: #23303A;
    --ink-soft: #57666F;
    --aegean: #3E7089;
    --aegean-deep: #2A4D5E;
    --aegean-bright: #5B9AB5;
    --gold: #B7A66B;
    --terracotta: #8C6A54;
    --line: #D3DADD;
    --card-bg: #FFFFFF;
    --card-shadow: 0 1px 2px rgba(35, 48, 58, 0.08);
  }

  /* Volcanic — Santorini caldera, black sand & ember */
  body.theme-volcanic {
    --paper: #201C1C;
    --paper-dim: #2A2424;
    --ink: #EDE3DD;
    --ink-soft: #B3A199;
    --aegean: #C1562E;
    --aegean-deep: #8C3B1F;
    --aegean-bright: #E1794F;
    --gold: #D9A441;
    --terracotta: #E1794F;
    --line: #3D3535;
    --card-bg: #2A2424;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  }

  /* Papyrus — ancient scroll, cream & sepia */
  body.theme-papyrus {
    --paper: #F1E7D0;
    --paper-dim: #E8D9B8;
    --ink: #3B2E1E;
    --ink-soft: #705C41;
    --aegean: #7A5A32;
    --aegean-deep: #574019;
    --aegean-bright: #9C7C46;
    --gold: #B98A2E;
    --terracotta: #954A2A;
    --line: #D9C296;
    --card-bg: #FBF3DF;
    --card-shadow: 0 1px 2px rgba(59, 46, 30, 0.1);
  }

  /* Aegean Night — deep navy dark mode */
  body.theme-aegean-night {
    --paper: #0E1B2A;
    --paper-dim: #15263A;
    --ink: #E4EEF5;
    --ink-soft: #9AB0C2;
    --aegean: #4A90C2;
    --aegean-deep: #2D5F85;
    --aegean-bright: #6FB4E0;
    --gold: #E3C25E;
    --terracotta: #E08A5E;
    --line: #24354A;
    --card-bg: #16283D;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }

  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    transition: background 0.2s ease, color 0.2s ease;
  }

  .meander { width: 100%; height: 22px; display: block; }
  .meander rect { fill: none; }

  header.site-head {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .head-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px 24px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .head-top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .brand-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
  .logo-mark { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; }
  .brand-text-row { display: flex; align-items: center; gap: 10px; }
  .brand {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.35rem;
    color: var(--aegean-deep);
    letter-spacing: 0.01em;
  }
  .brand span { color: var(--terracotta); font-style: italic; font-weight: 500; }

  .font-size-group {
    display: flex;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
  }
  .font-size-group button {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-soft);
    background: var(--card-bg);
    border: none;
    padding: 7px 10px;
    cursor: pointer;
    border-right: 1px solid var(--line);
  }
  .font-size-group button:last-child { border-right: none; }
  .font-size-group button.active { background: var(--aegean-deep); color: var(--paper); }
  .font-size-group button:hover:not(.active) { background: var(--paper-dim); }

  .theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    font-family: var(--font-body);
  }
  .theme-option:hover { background: var(--paper-dim); }
  .theme-option.active { border-color: var(--aegean-bright); background: var(--paper-dim); }
  .theme-option-label { display: flex; flex-direction: column; gap: 1px; }
  .theme-option-label b { font-size: 0.85rem; color: var(--ink); font-weight: 600; }
  .theme-option-label small { font-size: 0.72rem; color: var(--ink-soft); font-weight: 400; }
  .swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
    border: 2px solid transparent;
  }
  .theme-option.active .swatch { border-color: var(--aegean-bright); }
  .swatch[data-theme="paper"] { background: linear-gradient(135deg, #FBF7EF 50%, #C89B3C 50%); }
  .swatch[data-theme="dark"] { background: linear-gradient(135deg, #1B1F23 50%, #59AEDA 50%); }
  .swatch[data-theme="santorini"] { background: linear-gradient(135deg, #EAF6FC 50%, #0E6BA8 50%); }
  .swatch[data-theme="sunset"] { background: linear-gradient(135deg, #FCF2E7 50%, #B5502D 50%); }
  .swatch[data-theme="olive"] { background: linear-gradient(135deg, #F4F3EA 50%, #5B6E3D 50%); }
  .swatch[data-theme="meltemi"] { background: linear-gradient(135deg, #EEF1F3 50%, #3E7089 50%); }
  .swatch[data-theme="volcanic"] { background: linear-gradient(135deg, #201C1C 50%, #C1562E 50%); }
  .swatch[data-theme="papyrus"] { background: linear-gradient(135deg, #F1E7D0 50%, #7A5A32 50%); }
  .swatch[data-theme="aegean-night"] { background: linear-gradient(135deg, #0E1B2A 50%, #4A90C2 50%); }

  nav.tabs {
    display: flex;
    gap: 4px;
    padding-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  nav.tabs::-webkit-scrollbar { display: none; }
  nav.tabs button {
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--ink-soft);
    background: none;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    position: relative;
    transition: color 0.15s ease;
    white-space: nowrap;
  }
  nav.tabs button:hover { color: var(--aegean-deep); }
  nav.tabs button.active { color: var(--aegean-deep); }
  nav.tabs button.active::after {
    content: "";
    position: absolute;
    left: 10px; right: 10px; bottom: -1px;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
  }

  .hero { max-width: 1000px; margin: 0 auto; padding: 40px 24px 20px; }
  .hero h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.1rem, 5vw, 3rem);
    line-height: 1.08;
    margin: 0 0 10px;
    color: var(--ink);
  }
  .hero h1 em { color: var(--aegean); font-style: italic; font-weight: 500; }
  .hero p.lede { max-width: 56ch; color: var(--ink-soft); font-size: 1.02rem; line-height: 1.55; margin: 0; }

  .hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: start; }
  @media (max-width: 760px) { .hero-grid { grid-template-columns: 1fr; } }

  .stat-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
  .stat-chips .chip {
    display: flex; flex-direction: column; align-items: flex-start;
    padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--card-bg); min-width: 84px;
  }
  .stat-chips .chip .num { font-family: var(--font-display); font-size: 1.3rem; color: var(--aegean-deep); font-weight: 600; line-height: 1; }
  .stat-chips .chip .lbl { font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin-top: 4px; }

  .wotd-card {
    background: linear-gradient(155deg, var(--aegean-deep), var(--aegean));
    color: var(--paper);
    border-radius: 16px;
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
  }
  .wotd-card::after {
    content: "";
    position: absolute; right: -30px; bottom: -30px;
    width: 120px; height: 120px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
  }
  .wotd-card .wotd-label { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.8; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .wotd-card .wotd-gr { font-family: var(--font-display); font-size: 1.7rem; font-weight: 500; margin: 10px 0 4px; position: relative; }
  .wotd-card .wotd-ph { font-family: var(--font-mono); font-size: 0.85rem; opacity: 0.85; position: relative; }
  .wotd-card .wotd-en { font-family: var(--font-body); font-size: 0.92rem; margin-top: 10px; opacity: 0.95; position: relative; }
  .wotd-card .wotd-listen {
    width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.1); display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
  }
  .wotd-card .wotd-listen svg { width: 16px; height: 16px; stroke: #fff; fill: none; }

  .fact-card {
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px;
    background: var(--card-bg);
  }
  .fact-card .fact-label { font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); margin-bottom: 6px; }
  .fact-card .fact-text { font-family: var(--font-body); font-size: 0.88rem; line-height: 1.5; color: var(--ink); }

  .proceed-btn {
    margin-top: 20px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    background: var(--aegean-deep);
    color: var(--paper);
    border: none;
    padding: 13px 26px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  .proceed-btn:hover { opacity: 0.92; }
  .proceed-btn span { font-size: 1.1em; transition: transform 0.15s ease; }
  .proceed-btn:hover span { transform: translateX(3px); }

  .progress-strip {
    max-width: 1000px;
    margin: 18px auto 0;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .progress-strip .bar {
    flex: 1;
    height: 7px;
    background: var(--paper-dim);
    border: 1px solid var(--line);
    border-radius: 99px;
    overflow: hidden;
  }
  .progress-strip .bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--terracotta));
    border-radius: 99px;
    transition: width 0.3s ease;
  }
  .progress-strip .label {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--ink-soft);
    white-space: nowrap;
  }

  .speech-banner {
    margin-top: 18px;
    padding: 12px 16px;
    background: #FBEEE3;
    border: 1px solid #E4B999;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #7A3E1D;
    line-height: 1.5;
    max-width: 62ch;
  }
  body.dark .speech-banner { background: #3A2A1E; border-color: #6B4426; color: #F0C8A0; }
  .speech-banner b { color: inherit; }

  .controls {
    max-width: 1000px;
    margin: 0 auto;
    padding: 22px 24px 0;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
  }
  .search-wrap { flex: 1 1 260px; position: relative; }
  .search-wrap input {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.98rem;
    padding: 11px 14px 11px 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--ink);
    outline: none;
    transition: border-color 0.15s ease;
  }
  .search-wrap input:focus { border-color: var(--aegean-bright); }
  .search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--ink-soft); }
  .result-count { font-size: 0.85rem; color: var(--ink-soft); white-space: nowrap; }

  .voice-select {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--ink);
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 8px 10px;
    max-width: 180px;
  }
  .voice-select:focus { border-color: var(--aegean-bright); }

  .gender-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
  .gender-toggle button {
    font-family: var(--font-body);
    font-size: 0.85rem; font-weight: 500;
    background: var(--card-bg); color: var(--ink-soft);
    border: none; padding: 9px 12px; cursor: pointer;
    border-right: 1px solid var(--line);
  }
  .gender-toggle button:last-child { border-right: none; }
  .gender-toggle button.active { background: var(--aegean-deep); color: var(--paper); }

  .test-sound-btn {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--card-bg);
    color: var(--aegean-deep);
    border: 1px solid var(--line);
    padding: 9px 14px;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
  }
  .test-sound-btn:hover { border-color: var(--aegean-bright); }

  .pillbar { max-width: 1000px; margin: 0 auto; padding: 16px 24px 0; display: flex; gap: 8px; flex-wrap: wrap; }
  .pillbar button {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card-bg);
    color: var(--ink-soft);
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .pillbar button:hover { border-color: var(--aegean-bright); color: var(--aegean-deep); }
  .pillbar button.active { background: var(--aegean-deep); border-color: var(--aegean-deep); color: var(--paper); }

  main { max-width: 1000px; margin: 0 auto; padding: 20px 24px 60px; }
  .section-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
    margin: 26px 2px 10px;
    font-weight: 500;
  }
  .section-label:first-child { margin-top: 4px; }
  .section-label { display: flex; align-items: center; gap: 7px; }
  .section-label .cat-icon { display: inline-flex; width: 16px; height: 16px; }
  .section-label .cat-icon svg { width: 100%; height: 100%; stroke: var(--gold); }

  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }

  .card {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 44px 14px 40px;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s ease, transform 0.1s ease;
  }
  .card:hover { border-color: var(--aegean-bright); }
  .card:active { transform: scale(0.99); }

  .card .eng { font-size: calc(0.88rem * var(--font-scale, 1)); color: var(--ink-soft); margin-bottom: 6px; line-height: 1.35; }
  .card .gr { font-family: var(--font-display); font-size: calc(1.18rem * var(--font-scale, 1)); font-weight: 500; color: var(--aegean-deep); line-height: 1.3; margin-bottom: 4px; }
  .card .ph { font-family: var(--font-mono); font-size: calc(0.78rem * var(--font-scale, 1)); color: var(--terracotta); letter-spacing: 0.01em; }

  .card .copy-flag {
    position: absolute; top: 10px; right: 44px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--aegean-bright);
    opacity: 0;
    transition: opacity 0.15s ease;
  }
  .card.copied .copy-flag { opacity: 1; }

  .card .listen-btn {
    position: absolute; top: 8px; right: 8px;
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 1.5px solid var(--line);
    background: var(--paper);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
  }
  .card .listen-btn svg { width: 20px; height: 20px; stroke: var(--aegean-deep); fill: none; }
  .card .listen-btn:hover { background: var(--aegean-deep); border-color: var(--aegean-deep); }
  .card .listen-btn:hover svg { stroke: var(--paper); }
  .card .listen-btn.speaking { background: var(--gold); border-color: var(--gold); }
  .card .listen-btn.speaking svg { stroke: #fff; }

  .card .side-actions {
    position: absolute; top: 8px; left: 8px;
    display: flex; flex-direction: column; gap: 5px;
  }
  .card .icon-btn {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--paper);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0;
  }
  .card .icon-btn svg { width: 13px; height: 13px; stroke: var(--ink-soft); fill: none; transition: all 0.15s ease; }
  .card .fav-btn.active svg { stroke: var(--terracotta); fill: var(--terracotta); }
  .card .learn-btn.active svg { stroke: #4B8F5C; fill: #4B8F5C; }
  .card .learn-btn.active { border-color: #4B8F5C; }
  .card .fav-btn.active { border-color: var(--terracotta); }

  .empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
  .empty-state .big { font-family: var(--font-display); font-style: italic; font-size: 1.3rem; color: var(--aegean); display: block; margin-bottom: 6px; }

  /* ---------- Group chat ---------- */
  .chat-wrap { max-width: 640px; margin: 10px auto 0; }
  .chat-setup { display: flex; gap: 8px; margin-bottom: 14px; }
  .chat-setup input {
    flex: 1; font-family: var(--font-body); font-size: 0.95rem;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--card-bg); color: var(--ink);
  }
  .chat-setup button {
    font-family: var(--font-body); font-weight: 600; font-size: 0.88rem;
    background: var(--aegean-deep); color: var(--paper); border: none;
    padding: 10px 16px; border-radius: 8px; cursor: pointer;
  }
  .chat-banner {
    padding: 12px 16px; background: #FBEEE3; border: 1px solid #E4B999;
    border-radius: 8px; font-size: 0.85rem; color: #7A3E1D; line-height: 1.5;
    margin-bottom: 14px;
  }
  body.dark .chat-banner { background: #3A2A1E; border-color: #6B4426; color: #F0C8A0; }
  .chat-log {
    display: flex; flex-direction: column; gap: 8px;
    max-height: 50vh; overflow-y: auto;
    padding: 14px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--card-bg); margin-bottom: 12px;
  }
  .chat-msg { max-width: 82%; padding: 8px 12px; border-radius: 12px; background: var(--paper-dim); align-self: flex-start; }
  .chat-msg.mine { align-self: flex-end; background: var(--aegean-deep); color: var(--paper); }
  .chat-msg .who { font-family: var(--font-mono); font-size: 0.68rem; opacity: 0.7; margin-bottom: 2px; }
  .chat-msg .txt { font-family: var(--font-body); font-size: 0.92rem; line-height: 1.4; word-break: break-word; }
  .chat-input-row { display: flex; gap: 8px; }
  .chat-input-row input {
    flex: 1; font-family: var(--font-body); font-size: 0.95rem;
    padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--card-bg); color: var(--ink);
  }
  .chat-input-row button {
    font-family: var(--font-body); font-weight: 600; font-size: 0.9rem;
    background: var(--terracotta); color: #fff; border: none;
    padding: 11px 18px; border-radius: 8px; cursor: pointer;
  }
  .chat-empty { text-align: center; color: var(--ink-soft); font-size: 0.88rem; padding: 20px; }

  /* ---------- Admin panel ---------- */
  .admin-lock { display: flex; flex-direction: column; gap: 10px; max-width: 320px; margin: 20px auto; text-align: center; }
  .admin-lock input {
    font-family: var(--font-body); font-size: 0.95rem;
    padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--card-bg); color: var(--ink); text-align: center;
  }
  .admin-lock button {
    font-family: var(--font-body); font-weight: 600; font-size: 0.9rem;
    background: var(--aegean-deep); color: var(--paper); border: none;
    padding: 11px 16px; border-radius: 8px; cursor: pointer;
  }
  .admin-form {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    padding: 16px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--card-bg); margin-bottom: 18px;
  }
  .admin-form .full { grid-column: 1 / -1; }
  .admin-form label { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); display: block; margin-bottom: 4px; }
  .admin-form input, .admin-form select {
    width: 100%; font-family: var(--font-body); font-size: 0.92rem;
    padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px;
    background: var(--paper); color: var(--ink);
  }
  .admin-form button {
    grid-column: 1 / -1;
    font-family: var(--font-body); font-weight: 600; font-size: 0.92rem;
    background: var(--terracotta); color: #fff; border: none;
    padding: 12px; border-radius: 8px; cursor: pointer; margin-top: 4px;
  }
  .admin-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
    background: var(--card-bg); margin-bottom: 6px;
  }
  .admin-row .info { flex: 1; font-size: 0.85rem; }
  .admin-row .info .gr { font-family: var(--font-display); color: var(--aegean-deep); font-weight: 500; }
  .admin-row .info .meta { font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-soft); }
  .admin-row .del-btn {
    background: none; border: 1px solid var(--terracotta); color: var(--terracotta);
    border-radius: 7px; width: 30px; height: 30px; cursor: pointer; flex-shrink: 0;
  }
  .admin-note { font-size: 0.8rem; color: var(--ink-soft); line-height: 1.5; margin-bottom: 14px; }

  /* ---------- Practice mode ---------- */
  .practice-wrap { max-width: 640px; margin: 10px auto 0; }
  .practice-controls {
    display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px;
    align-items: center; justify-content: center;
  }
  .practice-controls select, .practice-controls label {
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--ink);
  }
  .practice-controls select {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--card-bg);
    color: var(--ink);
  }
  .practice-controls .chk {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--card-bg);
    cursor: pointer;
  }

  .flashcard-area { display: flex; flex-direction: column; align-items: center; gap: 18px; }
  .deck-progress { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
  .streak-badge { font-family: var(--font-body); font-weight: 600; font-size: 0.8rem; color: var(--terracotta); }
  .hype-msg {
    font-family: var(--font-body); font-size: 0.92rem; text-align: center;
    color: var(--aegean-deep); background: var(--paper-dim); border: 1px solid var(--line);
    border-radius: 10px; padding: 10px 16px; max-width: 480px;
  }
  @keyframes emojiPop {
    0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
    30% { transform: translate(-50%, -80%) scale(1.4); opacity: 1; }
    100% { transform: translate(-50%, -160%) scale(1.1); opacity: 0; }
  }
  .emoji-burst {
    position: fixed; left: 50%; top: 45%; font-size: 3rem;
    animation: emojiPop 0.9s ease-out forwards;
    pointer-events: none; z-index: 60;
  }

  .flashcard {
    width: 100%;
    max-width: 480px;
    min-height: 240px;
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 26px;
    cursor: pointer;
    text-align: center;
    position: relative;
  }
  .flashcard .prompt {
    font-family: var(--font-display);
    font-size: calc(1.5rem * var(--font-scale, 1));
    color: var(--ink);
    line-height: 1.3;
  }
  .flashcard .reveal { margin-top: 18px; display: none; flex-direction: column; align-items: center; gap: 8px; }
  .flashcard.flipped .reveal { display: flex; }
  .flashcard .reveal .gr { font-family: var(--font-display); font-size: calc(1.5rem * var(--font-scale, 1)); color: var(--aegean-deep); font-weight: 500; }
  .flashcard .reveal .ph { font-family: var(--font-mono); font-size: calc(0.85rem * var(--font-scale, 1)); color: var(--terracotta); }
  .flashcard .tap-hint { margin-top: 16px; font-size: 0.78rem; color: var(--ink-soft); font-style: italic; }
  .flashcard.flipped .tap-hint { display: none; }
  .flashcard .fc-listen {
    margin-top: 10px;
    width: 46px; height: 46px;
    border-radius: 50%;
    border: 1.5px solid var(--line);
    background: var(--paper);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
  }
  .flashcard .fc-listen svg { width: 22px; height: 22px; stroke: var(--aegean-deep); fill: none; }

  .flash-actions { display: flex; gap: 10px; width: 100%; max-width: 480px; }
  .flash-actions button {
    flex: 1;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.92rem;
    padding: 12px;
    border-radius: 9px;
    border: 1px solid var(--line);
    cursor: pointer;
    background: var(--card-bg);
    color: var(--ink);
  }
  .flash-actions .knew-it { border-color: #4B8F5C; color: #4B8F5C; }
  .flash-actions .knew-it:hover { background: #4B8F5C; color: #fff; }
  .flash-actions .still-learning { border-color: var(--terracotta); color: var(--terracotta); }
  .flash-actions .still-learning:hover { background: var(--terracotta); color: #fff; }

  .nav-row { display: flex; gap: 10px; }
  .nav-row button {
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 8px 14px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: var(--card-bg);
    color: var(--ink-soft);
    cursor: pointer;
  }
  .nav-row button:hover { color: var(--aegean-deep); border-color: var(--aegean-bright); }

  footer { border-top: 1px solid var(--line); padding: 26px 24px 40px; }
  .footer-inner { max-width: 1000px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
  footer p { font-size: 0.85rem; color: var(--ink-soft); margin: 0; }
  .share-btn {
    font-family: var(--font-body);
    font-size: 0.85rem; font-weight: 500;
    background: var(--terracotta); color: #fff;
    border: none; padding: 9px 16px; border-radius: 7px; cursor: pointer;
  }
  .share-btn:hover { background: #9c4224; }

  #toast {
    position: fixed; bottom: 22px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1E2A32; color: #FBF7EF;
    padding: 10px 18px; border-radius: 8px; font-size: 0.88rem;
    opacity: 0; pointer-events: none; transition: all 0.2s ease; z-index: 50;
    max-width: 86vw; text-align: center;
  }
  #toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  @media (max-width: 560px) {
    .grid { grid-template-columns: 1fr; }
    .head-inner { padding-top: 14px; }
    .brand-row { gap: 8px; }
    .voice-select { max-width: 74px !important; font-size: 0.7rem; }
    .font-size-group button { padding: 6px 7px; font-size: 0.72rem; }
    .theme-toggle-btn span:last-child { display: none; }
  }
  @media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
  button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--aegean-bright); outline-offset: 2px; }

  /* ---------- Modals (welcome + privacy) ---------- */
  .modal-overlay {
    position: fixed; inset: 0;
    background: rgba(20, 26, 30, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
  }
  .modal-overlay.show { display: flex; }
  .modal-box {
    background: var(--card-bg);
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    max-height: 84vh;
    overflow-y: auto;
    padding: 30px 28px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  }
  .modal-box h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--aegean-deep);
    margin: 0 0 4px;
  }
  .modal-box .modal-sub {
    font-size: 0.88rem;
    color: var(--ink-soft);
    margin-bottom: 18px;
  }
  .modal-box p, .modal-box li {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--ink);
  }
  .modal-box h3 {
    font-family: var(--font-body);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gold);
    margin: 18px 0 6px;
  }
  .modal-box .close-btn {
    margin-top: 20px;
    width: 100%;
    background: var(--aegean-deep);
    color: var(--paper);
    border: none;
    padding: 12px;
    border-radius: 9px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
  }
  .modal-box .close-btn:hover { opacity: 0.9; }
  .modal-box .link-btn {
    background: none; border: none; color: var(--aegean-bright);
    font-size: 0.85rem; cursor: pointer; text-decoration: underline;
    padding: 0; margin-top: 10px;
  }

  .founder-link {
    background: none; border: none; padding: 0; margin: 0;
    font: inherit; font-weight: 700; color: var(--aegean-deep);
    cursor: pointer; text-decoration: none; border-bottom: 1px dotted currentColor;
  }
  .founder-link:hover, .founder-link:focus-visible { text-decoration: none; opacity: 0.85; }

  .founder-modal-box { max-width: 640px; position: relative; padding-top: 54px; }
  .founder-back-btn {
    position: absolute; top: 14px; left: 16px;
    display: flex; align-items: center; gap: 4px;
    background: none; border: none; cursor: pointer;
    color: var(--aegean-bright, var(--aegean-deep)); font-size: 0.85rem; font-family: var(--font-body);
    padding: 4px 6px;
  }
  .founder-back-btn svg { width: 16px; height: 16px; }
  .founder-photo-wrap { display: flex; justify-content: center; margin-bottom: 14px; }
  .founder-photo-img {
    width: 112px; height: 112px; border-radius: 50%;
    object-fit: cover; display: block;
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
    border: 3px solid var(--card-bg);
  }
  .founder-modal-box h3:first-of-type { margin-top: 18px; }

  .admin-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--paper-dim); }
  .admin-tab-btn {
    background: none; border: none; cursor: pointer; font-family: var(--font-body);
    font-size: 0.88rem; font-weight: 500; color: var(--ink-soft);
    padding: 8px 4px; border-bottom: 2px solid transparent; margin-bottom: -1px;
  }
  .admin-tab-btn.active { color: var(--aegean-deep); border-bottom-color: var(--gold); }

  .footer-credit {
    font-size: 0.8rem;
    color: var(--ink-soft);
  }
  .footer-credit button {
    background: none; border: none; color: var(--ink-soft);
    text-decoration: underline; cursor: pointer; font-size: 0.8rem; padding: 0;
    font-family: var(--font-body);
  }

  /* ============ Account header button (top right) ============ */
  .account-btn {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex-shrink: 0;
    color: var(--ink-soft); background: var(--card-bg);
    border: 1px solid var(--line); border-radius: 999px;
    padding: 0; cursor: pointer;
    margin-left: auto;
  }
  .account-btn:hover { background: var(--paper-dim); }
  .account-btn svg { width: 18px; height: 18px; stroke: var(--aegean-deep); }
  .account-btn.signed-in { border-color: var(--aegean-bright); color: var(--aegean-deep); }
  .account-btn-dot {
    display: none;
    position: absolute; top: 2px; right: 2px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--aegean-bright); border: 2px solid var(--card-bg);
  }
  .account-btn.signed-in .account-btn-dot { display: block; }

  /* ============ Nav tab dividers (grouping) ============ */
  .tab-divider {
    width: 1px; height: 18px; align-self: center;
    background: var(--line); margin: 0 6px; flex-shrink: 0;
  }

  /* ============ Home feature boxes ============ */
  .feature-boxes {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
    margin: 28px 0 8px;
  }
  @media (max-width: 760px) { .feature-boxes { grid-template-columns: 1fr; } }
  .feature-box {
    background: var(--card-bg); border: 1px solid var(--line);
    border-radius: 14px; padding: 16px 18px; box-shadow: var(--card-shadow);
  }
  .feature-box-title {
    font-family: var(--font-display); font-size: 1.02rem; font-weight: 600;
    color: var(--aegean-deep); margin-bottom: 4px;
  }
  .feature-box-sub { font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 12px; }
  .feature-box-links { display: flex; flex-wrap: wrap; gap: 8px; }
  .feature-box-links button {
    font-family: var(--font-body); font-size: 0.83rem; font-weight: 500;
    color: var(--aegean-deep); background: var(--paper-dim);
    border: 1px solid var(--line); border-radius: 999px;
    padding: 7px 13px; cursor: pointer;
  }
  .feature-box-links button:hover { background: var(--aegean-deep); color: var(--paper); border-color: var(--aegean-deep); }

  /* ============ Call feature ============ */
  .call-wrap { max-width: 640px; margin: 10px auto 0; padding: 0 4px; }
  .call-panel {
    background: var(--card-bg); border: 1px solid var(--line); border-radius: 16px;
    padding: 24px; box-shadow: var(--card-shadow); text-align: center;
  }
  .call-icon { margin-bottom: 8px; color: var(--aegean-deep); display: flex; justify-content: center; }
  .call-icon svg { width: 32px; height: 32px; }
  .call-heading { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
  .call-sub { font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 18px; line-height: 1.5; }
  .call-btn-primary {
    font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
    background: var(--aegean-deep); color: var(--paper); border: none;
    border-radius: 999px; padding: 13px 28px; cursor: pointer; display: inline-flex;
    align-items: center; gap: 8px;
  }
  .call-btn-primary:hover { opacity: 0.92; }
  .call-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
  .call-btn-secondary {
    font-family: var(--font-body); font-weight: 500; font-size: 0.88rem;
    background: none; color: var(--ink-soft); border: 1px solid var(--line);
    border-radius: 999px; padding: 10px 20px; cursor: pointer;
  }
  .call-btn-secondary:hover { background: var(--paper-dim); }
  .call-spinner {
    width: 34px; height: 34px; border-radius: 50%;
    border: 3px solid var(--line); border-top-color: var(--aegean-bright);
    margin: 0 auto 14px; animation: call-spin 0.8s linear infinite;
  }
  @keyframes call-spin { to { transform: rotate(360deg); } }
  .call-available-box {
    text-align: left; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
  }
  .call-available-title { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin-bottom: 10px; }
  .call-available-list { display: flex; flex-direction: column; gap: 6px; }
  .call-available-row { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--ink); }
  .call-dot { width: 8px; height: 8px; border-radius: 50%; background: #3FAE5A; flex-shrink: 0; }
  .group-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: #E0483E; flex-shrink: 0; display: inline-block; }
  .call-empty { font-size: 0.85rem; color: var(--ink-soft); font-style: italic; }
  .call-active-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--aegean-deep); margin-bottom: 4px; }
  .call-timer { font-family: var(--font-mono); font-size: 1.6rem; color: var(--ink); margin-bottom: 20px; letter-spacing: 0.03em; }
  .call-controls { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
  .call-ctrl-btn {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: var(--paper-dim); border: 1px solid var(--line); border-radius: 14px;
    padding: 12px 18px; cursor: pointer; font-family: var(--font-body); font-size: 0.72rem;
    color: var(--ink); min-width: 76px;
  }
  .call-ctrl-btn:hover { background: var(--line); }
  .call-ctrl-btn.danger { background: var(--terracotta); color: #fff; border-color: var(--terracotta); }
  .call-ctrl-btn.danger:hover { opacity: 0.9; }
  .call-ctrl-btn .ico { display: inline-flex; }
  .call-ctrl-btn .ico svg { width: 17px; height: 17px; }
  .suggestion-box {
    text-align: left; margin-top: 22px; background: var(--paper-dim);
    border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  }
  .suggestion-label { font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold); margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .suggestion-refresh { background: none; border: none; color: var(--aegean-bright); font-size: 0.72rem; cursor: pointer; text-decoration: underline; font-family: var(--font-body); text-transform: none; letter-spacing: 0; }
  .suggestion-gr { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); margin-bottom: 3px; }
  .suggestion-ph { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 5px; }
  .suggestion-en { font-size: 0.86rem; color: var(--ink-soft); }
  .suggestion-loading { font-size: 0.85rem; color: var(--ink-soft); font-style: italic; }
  .call-name-prompt { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 14px; }
  .call-name-prompt input {
    font-family: var(--font-body); font-size: 0.9rem; padding: 10px 14px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
    color: var(--ink); min-width: 200px;
  }

  /* ============ Leaderboard ============ */
  .leaderboard-wrap { max-width: 560px; margin: 10px auto 0; padding: 0 4px; }
  .leaderboard-table { width: 100%; border-collapse: collapse; background: var(--card-bg); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
  .leaderboard-table th {
    font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--ink-soft); text-align: left; padding: 10px 14px; background: var(--paper-dim); border-bottom: 1px solid var(--line);
  }
  .leaderboard-table td { padding: 10px 14px; font-size: 0.9rem; color: var(--ink); border-bottom: 1px solid var(--line); }
  .leaderboard-table tr:last-child td { border-bottom: none; }
  .leaderboard-rank { font-family: var(--font-display); font-weight: 600; color: var(--aegean-deep); width: 34px; }
  .leaderboard-rank.gold { color: var(--gold); }
  .leaderboard-me { background: var(--paper-dim); }
  .leaderboard-note { font-size: 0.8rem; color: var(--ink-soft); margin-top: 12px; text-align: center; }

  /* ================= Login screen ================= */
  #loginView {
    position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 20% 15%, rgba(23,74,110,0.55), transparent 55%),
                radial-gradient(circle at 85% 85%, rgba(200,155,60,0.25), transparent 50%),
                #0f1620;
    padding: 24px; overflow-y: auto;
  }
  .login-card {
    width: 100%; max-width: 380px; background: rgba(20, 27, 35, 0.86); backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.09); border-radius: 22px; padding: 32px 26px 26px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.45); color: #eef2f5; animation: loginIn 0.45s cubic-bezier(.2,.8,.3,1);
  }
  @keyframes loginIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
  .login-logo-row { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 6px; }
  .login-logo-row img { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 6px 18px rgba(0,0,0,0.35); }
  .login-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; text-align: center; margin: 4px 0 2px; color: #fff; }
  .login-sub { font-size: 0.85rem; text-align: center; color: rgba(238,242,245,0.62); margin-bottom: 22px; }
  .login-tabs { display: flex; background: rgba(255,255,255,0.06); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
  .login-tabs button { flex: 1; border: none; background: transparent; color: rgba(238,242,245,0.65); font-family: var(--font-body); font-weight: 600; font-size: 0.85rem; padding: 9px 0; border-radius: 9px; cursor: pointer; transition: all .2s; }
  .login-tabs button.active { background: var(--gold, #c89b3c); color: #171310; box-shadow: 0 4px 12px rgba(200,155,60,0.35); }
  .login-field { margin-bottom: 14px; }
  .login-field label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(238,242,245,0.5); margin-bottom: 6px; }
  .login-field input {
    width: 100%; box-sizing: border-box; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 11px; padding: 12px 14px; color: #fff; font-size: 0.95rem; font-family: var(--font-body); transition: border-color .2s, background .2s;
  }
  .login-field input:focus { outline: none; border-color: var(--gold, #c89b3c); background: rgba(255,255,255,0.09); }
  .login-row-between { display: flex; align-items: center; justify-content: space-between; margin: -2px 0 18px; font-size: 0.8rem; }
  .login-remember { display: flex; align-items: center; gap: 7px; color: rgba(238,242,245,0.72); cursor: pointer; user-select: none; }
  .login-remember input { accent-color: var(--gold, #c89b3c); width: 15px; height: 15px; }
  .login-forgot { background: none; border: none; color: var(--gold, #c89b3c); cursor: pointer; font-size: 0.8rem; padding: 0; font-family: var(--font-body); }
  .login-forgot:hover { text-decoration: underline; }
  .login-submit {
    width: 100%; border: none; border-radius: 12px; padding: 13px 0; font-family: var(--font-display); font-weight: 600;
    font-size: 1rem; letter-spacing: 0.01em; cursor: pointer; background: linear-gradient(135deg, var(--gold, #c89b3c), #b5842a);
    color: #171310; box-shadow: 0 10px 24px rgba(200,155,60,0.3); transition: transform .15s, box-shadow .15s;
  }
  .login-submit:active { transform: translateY(1px) scale(0.99); }
  .login-submit:disabled { opacity: 0.6; cursor: default; }
  .login-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0 16px; color: rgba(238,242,245,0.4); font-size: 0.75rem; }
  .login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.12); }
  .login-google {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.16); background: rgba(255,255,255,0.04); color: #eef2f5; padding: 11px 0;
    font-family: var(--font-body); font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: background .2s;
  }
  .login-google:hover { background: rgba(255,255,255,0.09); }
  .login-google svg { width: 18px; height: 18px; }
  .login-msg { font-size: 0.82rem; padding: 10px 13px; border-radius: 10px; margin-bottom: 14px; display: none; }
  .login-msg.show { display: block; }
  .login-msg.error { background: rgba(220,80,80,0.15); border: 1px solid rgba(220,80,80,0.35); color: #ffb3b3; }
  .login-msg.ok { background: rgba(90,180,120,0.15); border: 1px solid rgba(90,180,120,0.35); color: #a8e6bf; }
  .login-guest { display: block; width: 100%; text-align: center; background: none; border: none; margin-top: 18px; color: rgba(238,242,245,0.45); font-size: 0.78rem; cursor: pointer; font-family: var(--font-body); }
  .login-guest:hover { color: rgba(238,242,245,0.7); }
  .login-hint { font-size: 0.74rem; margin-top: 6px; min-height: 1em; }
  .login-hint.checking { color: rgba(238,242,245,0.45); }
  .login-hint.ok { color: #a8e6bf; }
  .login-hint.taken { color: #ffb3b3; }

  /* ================= Direct-nav feature cards (homepage) ================= */
  .feature-cards-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 28px 0 8px;
  }
  .feature-nav-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left;
    background: var(--paper, #fff); border: 1px solid var(--line); border-radius: 18px; padding: 18px 16px;
    cursor: pointer; font-family: var(--font-body); transition: transform .18s cubic-bezier(.2,.8,.3,1), box-shadow .18s, border-color .18s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04); position: relative; overflow: hidden;
  }
  .feature-nav-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,0.09); border-color: var(--gold, #c89b3c); }
  .feature-nav-card:active { transform: translateY(-1px) scale(0.98); }
  .feature-nav-card.disabled { opacity: 0.5; cursor: default; }
  .feature-nav-card.disabled:hover { transform: none; box-shadow: none; border-color: var(--line); }
  .feature-nav-card .fnc-icon { line-height: 1; display: inline-flex; width: 28px; height: 28px; color: var(--gold, #c89b3c); }
  .feature-nav-card .fnc-icon svg { width: 100%; height: 100%; }
  .feature-nav-card .fnc-label { font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; color: var(--ink); }
  .feature-nav-card .fnc-sub { font-size: 0.74rem; color: var(--ink-soft); }

  /* ================= Homepage: 4 main-section cards ================= */
  .main-sections-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 32px 0 24px; }
  .main-section-card {
    padding: 26px 20px; border-radius: 22px; gap: 12px; min-height: 128px; justify-content: center;
  }
  .main-section-card .fnc-icon { width: 34px; height: 34px; }
  .main-section-card .fnc-label { font-size: 1.12rem; }
  .main-section-card .fnc-sub { font-size: 0.8rem; }
  @media (max-width: 520px) {
    .main-sections-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .main-section-card { padding: 20px 16px; min-height: 108px; border-radius: 18px; }
  }

  /* ================= Hub subpages (Learn / Train / Connect) ================= */
  .hub-wrap { max-width: 1000px; margin: 0 auto; padding: 8px 24px 40px; }
  .hub-intro { margin: 4px 0 6px; }
  .hub-intro p { color: var(--ink-soft); font-size: 0.9rem; max-width: 46em; }
  .hub-cards-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-top: 18px; }

  /* ================= Bottom navigation ================= */
  .bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    display: flex; justify-content: space-around; align-items: stretch;
    background: var(--paper, #fff); border-top: 1px solid var(--line);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.05);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  body { padding-bottom: 64px; }
  .bottom-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: none; border: none; padding: 6px 4px; cursor: pointer;
    color: var(--ink-soft); font-family: var(--font-body); font-size: 0.68rem;
    border-radius: 12px; transition: color .15s ease, background .15s ease, transform .15s ease;
    min-height: 48px; justify-content: center;
  }
  .bottom-nav-item svg { width: 21px; height: 21px; transition: transform 0.15s ease; }
  .bottom-nav-item:hover { color: var(--ink); }
  .bottom-nav-item.active { color: var(--gold, #c89b3c); background: var(--paper-dim); }
  .bottom-nav-item.active svg { stroke-width: 2.1; transform: translateY(-1px); }
  @media (min-width: 860px) {
    .bottom-nav { position: static; box-shadow: none; border-top: 1px solid var(--line); margin-top: 32px; }
    body { padding-bottom: 0; }
  }

  /* ================= Single-page back bar (replaces old multi-tab nav) ================= */
  .page-back-bar { display: flex; align-items: center; gap: 12px; padding: 10px 0 14px; }
  .page-back-btn {
    display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--paper, #fff);
    color: var(--ink); font-family: var(--font-body); font-weight: 600; font-size: 0.85rem; padding: 7px 14px 7px 10px;
    border-radius: 999px; cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .15s ease;
    min-height: 44px; box-shadow: 0 1px 3px rgba(30,42,50,0.05);
  }
  .page-back-btn:hover { border-color: var(--gold, #c89b3c); background: var(--paper-dim); transform: translateX(-2px); }
  .page-back-btn svg { width: 16px; height: 16px; }
  .page-back-title { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; color: var(--ink); }

  /* ================= Language selection screen ================= */
  #langView {
    position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 20% 15%, rgba(23,74,110,0.55), transparent 55%),
                radial-gradient(circle at 85% 85%, rgba(200,155,60,0.25), transparent 50%),
                #0f1620;
    padding: 24px; overflow-y: auto;
  }
  .lang-card { max-width: 460px; }
  .lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
  .lang-option {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.05); color: #eef2f5;
    font-family: var(--font-body); font-weight: 600; font-size: 0.9rem; cursor: pointer; text-align: left;
    transition: border-color .15s, background .15s, transform .1s;
  }
  .lang-option:hover { border-color: var(--gold, #c89b3c); background: rgba(255,255,255,0.09); }
  .lang-option:active { transform: scale(0.98); }
  .lang-option .lang-flag { font-size: 1.3rem; line-height: 1; }
  .lang-option .lang-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  .lang-option .lang-native { font-size: 0.72rem; color: rgba(238,242,245,0.55); font-weight: 500; }
  .lang-option .lang-soon { font-size: 0.65rem; color: var(--gold, #c89b3c); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
  .lang-option.lang-available { border-color: rgba(200,155,60,0.35); }

  /* ================= Exam mode ================= */
  .exam-setup { max-width: 520px; margin: 0 auto; padding: 6px 4px 24px; }
  .exam-question-area { max-width: 520px; margin: 0 auto; padding: 6px 4px 24px; display: flex; flex-direction: column; gap: 10px; }
  .exam-timer-track { width: 100%; height: 6px; border-radius: 999px; background: var(--paper-dim); overflow: hidden; }
  .exam-timer-fill { height: 100%; background: linear-gradient(90deg, var(--gold, #c89b3c), var(--aegean-bright, #2f7fb8)); transition: width 1s linear; }
  .exam-options { display: flex; flex-direction: column; gap: 10px; width: 100%; }
  .exam-option {
    width: 100%; box-sizing: border-box; text-align: left; padding: 13px 16px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--paper, #fff); color: var(--ink); font-family: var(--font-body);
    font-size: 1rem; cursor: pointer; transition: border-color .15s, background .15s;
  }
  .exam-option:hover:not(:disabled) { border-color: var(--gold, #c89b3c); }
  .exam-option:disabled { cursor: default; opacity: 0.85; }
  .exam-option.correct { border-color: #3d9a5c; background: rgba(61,154,92,0.12); color: #2c7a45; font-weight: 700; }
  .exam-option.incorrect { border-color: #c0433f; background: rgba(192,67,63,0.12); color: #a5342f; font-weight: 700; }

  .exam-option-row { display: flex; align-items: stretch; gap: 8px; }
  .exam-option-row .exam-option { flex: 1; }
  .exam-option-sound {
    flex: 0 0 auto;
    width: 44px;
    border-radius: 10px;
    border: 1.5px solid var(--line);
    background: var(--paper);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
  }
  .exam-option-sound svg { width: 18px; height: 18px; stroke: var(--aegean-deep); fill: none; }
  .exam-option-sound:hover { background: var(--aegean-deep); border-color: var(--aegean-deep); }
  .exam-option-sound:hover svg { stroke: var(--paper); }
  .exam-option-sound.speaking { background: var(--gold); border-color: var(--gold); }
  .exam-option-sound.speaking svg { stroke: #fff; }

  /* ============ Account page: profile card + grouped list ============ */
  .acct-profile-card {
    display: flex; align-items: center; gap: 16px;
    padding: 22px 18px;
    border-radius: var(--acct-radius, 16px);
    margin-bottom: 18px;
    background: linear-gradient(135deg, var(--aegean-deep), var(--aegean));
    box-shadow: var(--card-shadow);
  }
  .acct-avatar-wrap { position: relative; flex-shrink: 0; width: 68px; height: 68px; }
  .acct-avatar {
    width: 68px; height: 68px; border-radius: 50%;
    background: rgba(255,255,255,0.16);
    border: 2px solid rgba(255,255,255,0.55);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
  }
  .acct-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .acct-avatar-initials { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; color: #fff; }
  .acct-avatar-edit {
    position: absolute; bottom: -2px; right: -2px;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--gold); border: 2px solid var(--card-bg);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0; color: var(--aegean-deep);
  }
  .acct-avatar-edit svg { width: 13px; height: 13px; }
  .acct-avatar-edit:hover { filter: brightness(1.06); }
  .acct-avatar-edit.busy { opacity: 0.6; cursor: default; }
  .acct-avatar-edit.busy svg { animation: acct-spin 0.9s linear infinite; }
  @keyframes acct-spin { to { transform: rotate(360deg); } }
  .acct-profile-info { min-width: 0; }
  .acct-name {
    font-family: var(--font-display); font-size: 1.15rem; font-weight: 600;
    color: #fff; line-height: 1.25;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .acct-email {
    font-size: 0.82rem; color: rgba(255,255,255,0.78); margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  .acct-section-label {
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--ink-soft);
    margin: 18px 4px 8px;
  }
  .acct-list {
    background: var(--card-bg); border: 1px solid var(--line);
    border-radius: var(--acct-radius, 14px); overflow: hidden; box-shadow: var(--card-shadow);
  }
  .acct-list-row {
    width: 100%; display: flex; align-items: center; gap: 12px;
    padding: 13px 14px; border: none; border-bottom: 1px solid var(--line);
    background: none; cursor: pointer; text-align: left;
    font-family: var(--font-body); color: var(--ink);
  }
  .acct-list-row:last-child { border-bottom: none; }
  .acct-list-row:hover { background: var(--paper-dim); }
  .acct-row-icon {
    flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
    background: var(--paper-dim);
    display: flex; align-items: center; justify-content: center;
  }
  .acct-row-icon svg { width: 16px; height: 16px; stroke: var(--aegean-deep); }
  .acct-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
  .acct-row-text b { font-size: 0.92rem; font-weight: 600; }
  .acct-row-text small { font-size: 0.8rem; color: var(--ink-soft); }
  .acct-row-chevron { flex: 0 0 auto; font-size: 1.3rem; line-height: 1; color: var(--ink-soft); }
  .acct-row-danger .acct-row-text b { color: var(--terracotta); }
  .acct-row-danger .acct-row-icon svg { stroke: var(--terracotta); }

  /* ============ Account page: tier progress + quick links ============ */
  .acct-profile-top { display: flex; align-items: center; gap: 16px; }
  .acct-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .acct-chip {
    font-size: 0.72rem; font-weight: 600; color: #fff;
    background: rgba(255,255,255,0.22); border-radius: 999px;
    padding: 2px 9px; white-space: nowrap;
  }
  .acct-tier { margin-top: 16px; }
  .acct-tier-label { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: #fff; margin-bottom: 8px; }
  .acct-tier-track { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.28); overflow: hidden; }
  .acct-tier-fill { height: 100%; background: #fff; border-radius: 999px; transition: width 0.3s ease; }
  .acct-tier-msg { font-size: 0.78rem; color: rgba(255,255,255,0.85); margin-top: 8px; }

  .acct-quicklinks {
    display: flex; align-items: stretch;
    background: var(--card-bg); border: 1px solid var(--line);
    border-radius: var(--acct-radius, 12px); margin: 10px 0 18px; padding: 4px;
    box-shadow: var(--card-shadow);
  }
  .acct-quicklink {
    flex: 1; background: none; border: none; cursor: pointer;
    padding: 10px 8px; font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
    color: var(--terracotta); display: flex; align-items: center; justify-content: center; gap: 4px;
    border-radius: 9px;
  }
  .acct-quicklink:hover { background: var(--paper-dim); }
  .acct-quicklink-divider { width: 1px; background: var(--line); margin: 6px 2px; }

  /* ============ Account page: inline Appearance panel ============ */
  .acct-appearance-card {
    background: var(--card-bg); border: 1px solid var(--line);
    border-radius: var(--acct-radius, 14px); padding: 16px; box-shadow: var(--card-shadow);
  }
  .acct-appearance-label {
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--ink-soft);
    margin: 0 0 8px; display: flex; align-items: center; gap: 6px;
  }
  .acct-appearance-label svg { width: 14px; height: 14px; flex-shrink: 0; stroke: var(--gold); }
  .acct-appearance-card .acct-appearance-label:not(:first-child) { margin-top: 18px; }
  .acct-preview-strip {
    background: linear-gradient(135deg, var(--aegean-deep), var(--aegean));
    border-radius: 12px; padding: 16px; margin-bottom: 18px; text-align: center;
  }
  .acct-preview-gr { font-family: var(--font-display); font-size: 1.3rem; color: #fff; font-weight: 600; }
  .acct-preview-en { font-family: var(--font-body); font-size: 0.8rem; color: rgba(255,255,255,0.8); margin-top: 4px; }
  .acct-theme-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 6px;
  }
  .acct-theme-grid .theme-option { transition: transform 0.12s ease, box-shadow 0.12s ease; }
  .acct-theme-grid .theme-option:hover { transform: translateY(-1px); }
  .swatch-check { width: 14px; height: 14px; stroke: #fff; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.4)); }
  .acct-font-chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .acct-font-chip {
    padding: 7px 13px; border-radius: 999px; border: 1.5px solid var(--line);
    background: var(--paper); color: var(--ink); cursor: pointer;
    font-family: var(--font-body); font-size: 0.82rem;
    transition: background 0.12s ease, transform 0.12s ease;
  }
  .acct-font-chip:hover { background: var(--paper-dim); transform: translateY(-1px); }
  .acct-font-chip.active { background: var(--aegean-deep); border-color: var(--aegean-deep); color: #fff; }

  /* Picture-mode flashcards / exam prompt */
  .prompt-picture { text-align: center; }
  .prompt-emoji-frame {
    display: inline-flex; align-items: center; justify-content: center;
    width: 108px; height: 108px; border-radius: 18px;
    background: linear-gradient(160deg, var(--paper-dim), var(--paper));
    border: 1.5px solid var(--line); box-shadow: var(--card-shadow);
    margin-bottom: 6px;
  }
  .prompt-emoji { font-size: 3.4rem; line-height: 1; }

  /* ============ Color-coded tiers + Greek-key motif ============ */
  .acct-profile-card { position: relative; overflow: hidden; }
  .acct-meander {
    position: absolute; top: 0; left: 0; width: 100%; height: 14px;
    color: rgba(255,255,255,0.35); opacity: 0.9;
  }
  .acct-tier-medal { margin-right: 6px; }

  .acct-tier-bronze  { background: linear-gradient(135deg, #7A4A2B, #B87333); }
  .acct-tier-silver  { background: linear-gradient(135deg, #6B7280, #C0C6CC); }
  .acct-tier-gold    { background: linear-gradient(135deg, #8A6A11, #E6B93D); }
  .acct-tier-platinum{ background: linear-gradient(135deg, #2B4C6F, #8FD3E8); }

  /* ============ Upgraded Appearance panel ============ */
  .acct-appearance-card { padding: 18px 16px 20px; }
  .acct-theme-grid { grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 8px; }
  .acct-theme-grid .theme-option {
    flex-direction: column; align-items: flex-start; gap: 8px;
    border-color: var(--line); padding: 10px;
  }
  .acct-theme-grid .theme-option .swatch { width: 100%; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
  .acct-theme-grid .theme-option.active { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
  .acct-theme-grid .theme-option-label { font-size: 0.78rem; }
  .acct-font-chip {
    font-family: var(--chip-font, var(--font-body));
  }

  /* ============ Typing practice mode ============ */
  .type-answer-input {
    width: 100%; box-sizing: border-box; padding: 12px 14px; margin-top: 14px;
    border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper);
    color: var(--ink); font-family: var(--font-body); font-size: 1rem;
  }
  .type-answer-input:focus { border-color: var(--aegean-deep); outline: none; }
  .type-answer-input:disabled { opacity: 0.75; }
  .type-feedback { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 0.92rem; }
  .type-feedback-correct { background: rgba(46,160,67,0.14); color: #1f7a34; }
  .type-feedback-wrong { background: rgba(200,60,60,0.12); color: var(--terracotta); }
  .type-feedback .ph { opacity: 0.75; font-size: 0.85em; margin-left: 4px; }

  /* ============ Listening exam mode ============ */
  .exam-listen-btn {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--aegean-deep); border: none; color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; margin-bottom: 8px;
  }
  .exam-listen-btn svg { width: 26px; height: 26px; }
  .exam-listen-btn:hover { filter: brightness(1.08); }

  /* ============ Admin panel upgrade ============ */
  .admin-tabs {
    display: flex; gap: 6px; padding: 4px; margin-bottom: 18px;
    background: var(--paper-dim); border-radius: 12px; border: none;
  }
  .admin-tab-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 8px; border-radius: 9px; border: none; background: none;
    color: var(--ink-soft); font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
    cursor: pointer;
  }
  .admin-tab-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
  .admin-tab-btn.active { background: var(--card-bg); color: var(--aegean-deep); box-shadow: var(--card-shadow); }
  .admin-tab-count {
    font-size: 0.68rem; font-weight: 700; background: var(--terracotta); color: #fff;
    border-radius: 999px; padding: 1px 7px; margin-left: 2px;
  }
  .admin-tab-btn.active .admin-tab-count { background: var(--gold); }

  .admin-card {
    background: var(--card-bg); border: 1px solid var(--line); border-radius: 14px;
    padding: 16px; margin-bottom: 18px; box-shadow: var(--card-shadow);
  }
  .admin-card-title { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; margin-bottom: 12px; }

  .admin-row { display: flex; align-items: center; gap: 10px; }
  .admin-row .acct-row-icon { flex-shrink: 0; }

  .admin-users-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
  .admin-users-toolbar input[type="text"] {
    flex: 1; min-width: 160px; padding: 9px 12px; border-radius: 10px;
    border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font-size: 0.85rem;
  }
  .admin-users-toolbar select {
    padding: 9px 10px; border-radius: 10px; border: 1.5px solid var(--line);
    background: var(--paper); color: var(--ink); font-size: 0.85rem;
  }

  .admin-user-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 4px; border-bottom: 1px solid var(--line);
  }
  .admin-user-row:last-child { border-bottom: none; }
  .admin-avatar {
    flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
    background: var(--aegean-deep); color: #fff; overflow: hidden;
    display: flex; align-items: center; justify-content: center; font-size: 0.82rem; font-weight: 600;
  }
  .admin-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .admin-user-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .admin-user-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
  .admin-ban-btn {
    font-size: 0.72rem; padding: 5px 10px; border-radius: 8px;
    border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer;
    white-space: nowrap;
  }
  .admin-ban-btn:hover { background: var(--paper-dim); }

  .status-pill { font-size: 0.66rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em; }
  .status-pill.status-active { background: rgba(46,160,67,0.15); color: #1f7a34; }
  .status-pill.status-banned { background: rgba(200,60,60,0.14); color: var(--terracotta); }
  .status-pill.status-unconfirmed { background: rgba(200,160,40,0.16); color: #8a6a11; }

  /* ============ Retry button (network-failure states) ============ */
  .retry-btn {
    margin-top: 10px; padding: 8px 18px; border-radius: 9px;
    border: 1.5px solid var(--aegean-deep); background: none; color: var(--aegean-deep);
    font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; cursor: pointer;
  }
  .retry-btn:hover { background: var(--aegean-deep); color: #fff; }

  /* ============ Appearance redesign: hero preview, sliders, switches, ripple ============ */
  .acct-appearance-hero { padding: 0; overflow: hidden; background: none; border: none; box-shadow: none; }
  .acct-preview-strip {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, var(--aegean-deep), var(--aegean));
    border-radius: var(--acct-radius, 20px); padding: 28px 20px; text-align: center;
    box-shadow: 0 10px 30px rgba(18, 63, 82, 0.28);
  }
  .acct-preview-glass {
    position: absolute; top: -40%; left: -10%; width: 120%; height: 90%;
    background: radial-gradient(ellipse at top, rgba(255,255,255,0.28), transparent 65%);
    pointer-events: none;
  }
  .acct-preview-gr { position: relative; font-family: var(--font-display); font-size: 1.5rem; color: #fff; font-weight: 600; }
  .acct-preview-en { position: relative; font-family: var(--font-body); font-size: 0.88rem; color: rgba(255,255,255,0.88); margin-top: 6px; }
  .acct-preview-ph { position: relative; font-family: var(--font-mono); font-size: 0.72rem; color: rgba(255,255,255,0.65); margin-top: 4px; letter-spacing: 0.02em; }

  .acct-theme-grid-2col { grid-template-columns: repeat(2, 1fr); }
  .acct-theme-grid .theme-option.active {
    border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset, 0 4px 10px rgba(0,0,0,0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  }

  /* Slider (text size / line spacing) */
  .acct-slider {
    width: 100%; margin: 6px 0 4px; -webkit-appearance: none; appearance: none;
    height: 6px; border-radius: 999px; background: var(--line); outline: none;
  }
  .acct-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
    background: var(--gold); border: 3px solid var(--card-bg); box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    cursor: pointer;
  }
  .acct-slider::-moz-range-thumb {
    width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--card-bg);
    background: var(--gold); box-shadow: 0 1px 4px rgba(0,0,0,0.25); cursor: pointer;
  }
  .acct-slider-labels {
    display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--ink-soft); margin-top: 2px;
  }

  /* Toggle switch rows */
  .acct-toggle-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid var(--line);
    min-height: 48px;
  }
  .acct-toggle-row:last-of-type { border-bottom: none; }
  .acct-toggle-text b { font-size: 0.88rem; display: block; }
  .acct-toggle-text small { font-size: 0.76rem; color: var(--ink-soft); }
  .acct-switch {
    position: relative; flex-shrink: 0; width: 46px; height: 27px; border-radius: 999px;
    background: var(--line); border: none; cursor: pointer; padding: 0;
    transition: background 0.2s ease;
  }
  .acct-switch.on { background: var(--aegean-deep); }
  .acct-switch-knob {
    position: absolute; top: 2.5px; left: 2.5px; width: 22px; height: 22px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: transform 0.2s ease;
  }
  .acct-switch.on .acct-switch-knob { transform: translateX(19px); }

  /* Segmented control (corner style / reading width) */
  .acct-segmented {
    display: flex; background: var(--paper-dim); border-radius: 10px; padding: 3px; gap: 2px;
  }
  .acct-segmented button {
    flex: 1; padding: 9px 6px; min-height: 40px; border: none; border-radius: 8px; background: none;
    color: var(--ink-soft); font-family: var(--font-body); font-size: 0.82rem; font-weight: 600; cursor: pointer;
    position: relative; overflow: hidden;
  }
  .acct-segmented button.active { background: var(--card-bg); color: var(--aegean-deep); box-shadow: var(--card-shadow); }

  /* Accent colour swatches */
  .acct-accent-row { display: flex; gap: 12px; flex-wrap: wrap; }
  .acct-accent-swatch {
    width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent;
    cursor: pointer; position: relative; overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
  }
  .acct-accent-swatch.active { border-color: var(--ink); transform: scale(1.08); }
  .acct-accent-swatch.active::after {
    content: '\2713'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1rem; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  }

  /* Ripple micro-interaction */
  .ripple {
    position: absolute; border-radius: 50%; background: rgba(255,255,255,0.5);
    transform: scale(0); animation: ripple-anim 0.5s ease-out; pointer-events: none;
  }
  body.dark .ripple, body.theme-aegean-night .ripple, body.theme-volcanic .ripple { background: rgba(255,255,255,0.25); }
  @keyframes ripple-anim { to { transform: scale(2.2); opacity: 0; } }

  /* Reduce motion: a blanket override, purely subtractive so it can't break layout */
  body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }

  /* High contrast: strengthens borders and text, doesn't change layout */
  body.high-contrast { --line: #8a8a8a; }
  body.high-contrast .acct-list-row,
  body.high-contrast .admin-row,
  body.high-contrast .acct-appearance-card,
  body.high-contrast .acct-list { border-width: 2px; }
  body.high-contrast .acct-row-text small, body.high-contrast .meta, body.high-contrast .admin-note, body.high-contrast .acct-email { color: var(--ink) !important; }

  /* Reading width / line spacing best-effort application */
  #content, .exam-setup, .chat-wrap { max-width: var(--reading-max-width, 680px); margin-left: auto; margin-right: auto; }
  .eng, .gr, .ph, .prompt, .reveal { line-height: var(--reading-line-height, 1.5) !important; }
