﻿/* =====================================================================
   TonganTranslator.com - "Warm Pacific" design system (2026)
   Tokens -> base -> layout -> components -> pages -> DevExpress overrides
   ===================================================================== */

:root {
  --red: #9E1B32;          /* Tongan red, deepened for contrast */
  --red-strong: #7E1428;
  --red-soft: #F7E3E6;
  --sand: #FBF7F1;          /* page */
  --sand-2: #F4EDE3;        /* subtle panels */
  --surface: #FFFFFF;
  --ink: #1F1A17;
  --ink-2: #3D3530;
  --muted: #6F655C;
  --line: #E8DFD3;
  --tapa: #7A5236;          /* ngatu brown */
  --ocean: #0E6E78;
  --ok: #1E7A4C;   --ok-soft: #E3F3EA;
  --warn: #8A5A00; --warn-soft: #FBF0D9;
  --no: #A1302B;   --no-soft: #F9E4E2;
  --focus: #0E6E78;

  --font-sans: "Noto Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-serif: "Noto Serif", Georgia, "Times New Roman", serif;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 24px rgba(60, 40, 20, .07);
  --shadow-lg: 0 2px 6px rgba(60, 40, 20, .08), 0 18px 48px rgba(60, 40, 20, .12);
  --wrap: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --red: #E0566C; --red-strong: #F07A8C; --red-soft: #3A1B21;
    --sand: #15110E; --sand-2: #1D1814; --surface: #221C17;
    --ink: #F3ECE4; --ink-2: #DDD3C8; --muted: #B3A698; --line: #3A2F27;
    --tapa: #C79A72; --ocean: #4FB8C2;
    --ok: #6FD3A0; --ok-soft: #173A29; --warn: #E9BE63; --warn-soft: #3B2E12; --no: #F08A83; --no-soft: #3D1D1B;
    --focus: #4FB8C2;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 24px rgba(0,0,0,.35);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.45), 0 18px 48px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --red: #E0566C; --red-strong: #F07A8C; --red-soft: #3A1B21;
  --sand: #15110E; --sand-2: #1D1814; --surface: #221C17;
  --ink: #F3ECE4; --ink-2: #DDD3C8; --muted: #B3A698; --line: #3A2F27;
  --tapa: #C79A72; --ocean: #4FB8C2;
  --ok: #6FD3A0; --ok-soft: #173A29; --warn: #E9BE63; --warn-soft: #3B2E12; --no: #F08A83; --no-soft: #3D1D1B;
  --focus: #4FB8C2;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.45), 0 18px 48px rgba(0,0,0,.45);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--sand); color: var(--ink);
  font: 400 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; display: flex; flex-direction: column;
}
body > form { display: flex; flex-direction: column; flex: 1; }
img, svg { max-width: 100%; }
a { color: var(--red); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--red-strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--ink); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.serif { font-family: var(--font-serif); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--sand); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
main { flex: 1; }
.page { padding-top: 36px; padding-bottom: 64px; }
.page-head { margin-bottom: 28px; }
.page-head .lede { font-size: 1.1rem; color: var(--muted); max-width: 62ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--tapa); margin-bottom: .5rem; display: block; }

/* ---------- Tapa (ngatu-inspired) band ---------- */
.tapa-band {
  height: 10px;
  background-color: var(--tapa);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='10' viewBox='0 0 28 10'%3E%3Cpath d='M0 10 L7 0 L14 10 Z' fill='%23F4EDE3' fill-opacity='.85'/%3E%3Cpath d='M14 10 L21 3 L28 10 Z' fill='%23F4EDE3' fill-opacity='.45'/%3E%3C/svg%3E");
  background-size: 28px 10px;
}
.tapa-bg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%237A5236' stroke-opacity='.10' stroke-width='1.5'%3E%3Cpath d='M24 4 L44 24 L24 44 L4 24 Z'/%3E%3Cpath d='M24 14 L34 24 L24 34 L14 24 Z'/%3E%3Cpath d='M0 0 L8 8 M48 0 L40 8 M0 48 L8 40 M48 48 L40 40'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 48px 48px;
}

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 20px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-serif); font-weight: 700; font-size: 1.15rem; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 1.35rem; line-height: 1; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.brand small { display: block; font-family: var(--font-sans); font-weight: 500; font-size: .72rem; color: var(--muted); letter-spacing: .02em; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a, .nav .linklike { color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: .95rem; }
.nav a:hover, .nav .linklike:hover { background: var(--sand-2); color: var(--ink); }
.nav a.is-active { color: var(--red); background: var(--red-soft); }
.nav .btn { margin-left: 6px; }
.nav a.btn-primary, .nav a.btn-primary:hover { color: #fff; background: var(--red); }
.nav a.btn-primary:hover { background: var(--red-strong); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 10px; width: 42px; height: 42px; color: var(--ink); cursor: pointer; }
.nav-toggle svg { width: 22px; height: 22px; }

.account { position: relative; }
.account > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.account > summary::-webkit-details-marker { display: none; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--tapa); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; text-transform: uppercase; }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px; z-index: 50; }
.account-menu a, .account-menu .menu-btn { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: .93rem; background: none; border: 0; font: inherit; cursor: pointer; }
.account-menu a:hover, .account-menu .menu-btn:hover { background: var(--sand-2); color: var(--ink); }
.account-menu .menu-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 10px 12px 4px; }
.account-menu hr { margin: 6px 0; }
.count-pill { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 18px; }

.theme-toggle { background: none; border: 0; color: var(--muted); width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.theme-toggle:hover { background: var(--sand-2); color: var(--ink); }
.theme-toggle svg { width: 19px; height: 19px; }

@media (max-width: 880px) {
  .nav-toggle { display: inline-grid; place-items: center; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px 16px; box-shadow: var(--shadow); gap: 2px; }
  .nav.is-open { display: flex; }
  .nav a, .nav .linklike { padding: 12px 14px; border-radius: 10px; }
  .nav .btn { margin: 8px 0 0; text-align: center; }
  .account > summary { width: 100%; }
  .account-menu { position: static; box-shadow: none; border: 0; padding: 4px 0 0; }
  .theme-toggle { align-self: flex-start; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 .95rem/1 var(--font-sans); padding: 12px 20px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-strong); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--sand-2); color: var(--ink); }
.btn-soft { background: var(--red-soft); color: var(--red); }
.btn-soft:hover { color: var(--red-strong); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-danger { background: transparent; color: var(--no); border-color: color-mix(in srgb, var(--no) 40%, transparent); }
.btn-sm { padding: 8px 14px; font-size: .85rem; }
.btn-lg { padding: 15px 26px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.aspNetDisabled { opacity: .55; cursor: not-allowed; }
.icon-btn { background: none; border: 0; color: var(--muted); padding: 6px; border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--sand-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Cards / layout helpers ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card + .card { margin-top: 20px; }
.card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title h2, .card-title h3 { margin: 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: 1fr 1fr; gap: 12px; } .stat-value { font-size: 1.6rem; } .wrap { padding: 0 16px; } .card { padding: 18px; } }
.split > *, .grid > * { min-width: 0; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { justify-content: space-between; }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: inherit; display: block; }
a.stat:hover { border-color: var(--red); color: inherit; }
.stat-value { font-family: var(--font-serif); font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--ink); }
.stat-label { color: var(--muted); font-size: .88rem; margin-top: 4px; }
.stat--accent { background: var(--red); border-color: var(--red); }
.stat--accent .stat-value, .stat--accent .stat-label { color: #fff; }

/* ---------- Badges / chips ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--wait { background: var(--warn-soft); color: var(--warn); }
.badge--no { background: var(--no-soft); color: var(--no); }
.badge--neutral { background: var(--sand-2); color: var(--muted); }
.pos { font-style: italic; color: var(--muted); font-size: .85rem; font-family: var(--font-serif); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-size: .9rem; }
a.chip:hover { border-color: var(--red); color: var(--red); }
.chip b { color: var(--muted); font-weight: 600; font-size: .78rem; }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 18px; border: 1px solid transparent; font-size: .95rem; }
.alert:empty { display: none; }
.alert--info { background: color-mix(in srgb, var(--ocean) 10%, var(--surface)); border-color: color-mix(in srgb, var(--ocean) 30%, transparent); }
.alert--ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert--warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert--error { background: var(--no-soft); color: var(--no); border-color: color-mix(in srgb, var(--no) 25%, transparent); }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

/* ---------- Forms ---------- */
.form { max-width: 560px; }
.form-wide { max-width: none; }
.field { margin-bottom: 18px; }
.field > label, .label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; color: var(--ink-2); }
.field .hint { display: block; font-size: .82rem; color: var(--muted); margin-top: 6px; }
.req { color: var(--red); }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=search], .field select, .field textarea {
  width: 100%; font: 400 1rem/1.4 var(--font-sans); color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 110px; resize: vertical; }
.input:hover, .field input:hover, .field select:hover, .field textarea:hover { border-color: color-mix(in srgb, var(--tapa) 45%, var(--line)); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ocean); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ocean) 18%, transparent); }
.field .val { display: block; color: var(--no); font-size: .82rem; margin-top: 6px; font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }
.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.g-recaptcha { margin: 6px 0 18px; }
.auth-shell { max-width: 460px; margin: 0 auto; }
.auth-shell .card { padding: 32px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: .93rem; }

/* Tongan character keys */
.tkeys { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tkeys[hidden] { display: none; }
.tkey { min-width: 38px; height: 34px; padding: 0 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; font: 600 1rem/1 var(--font-serif); cursor: pointer; }
.tkey:hover { border-color: var(--red); color: var(--red); }
.tkeys-label { font-size: .78rem; color: var(--muted); align-self: center; margin-right: 4px; }

/* ---------- Search box (home + search page) ---------- */
.searchbox { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 14px; position: relative; }
.dir-toggle { display: inline-flex; align-items: center; gap: 4px; background: var(--sand-2); border-radius: 999px; padding: 4px; margin: 0 0 12px; }
.dir-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.dir-toggle label { padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: .88rem; color: var(--muted); cursor: pointer; user-select: none; }
.dir-toggle input:checked + label { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.dir-toggle input:focus-visible + label { outline: 3px solid var(--focus); }
.dir-swap { border: 0; background: none; color: var(--muted); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.dir-swap:hover { color: var(--red); background: var(--surface); }
.searchbox-row { display: flex; gap: 10px; align-items: stretch; }
.searchbox-input { position: relative; flex: 1; }
.searchbox-input svg.lead { position: absolute; left: 16px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbox input[type=search], .searchbox input[type=text] {
  width: 100%; height: 60px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--sand);
  font: 500 1.25rem/1 var(--font-sans); color: var(--ink); padding: 0 16px 0 50px;
}
.searchbox input:focus { outline: none; border-color: var(--ocean); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ocean) 16%, transparent); }
.searchbox .btn { height: 60px; padding: 0 26px; border-radius: 14px; }
@media (max-width: 560px) { .searchbox-row { flex-direction: column; } .searchbox .btn { height: 52px; } .searchbox input[type=search] { font-size: 1.1rem; } }

.live { position: absolute; left: 14px; right: 14px; top: calc(100% - 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 0 0 16px 16px; box-shadow: var(--shadow-lg); z-index: 30; overflow: hidden; }
.live[hidden] { display: none; }
.live a { display: flex; justify-content: space-between; gap: 16px; padding: 12px 18px; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line); }
.live a:first-child { border-top: 0; }
.live a:hover, .live a.is-active { background: var(--sand-2); }
.live .from { font-weight: 600; }
.live .to { color: var(--red); font-family: var(--font-serif); font-weight: 600; text-align: right; }
.live .more { justify-content: center; color: var(--muted); font-size: .9rem; }
.live mark, .result mark { background: color-mix(in srgb, var(--warn) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- Results ---------- */
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.result { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.result:hover { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.result .w-from { font-weight: 600; font-size: 1.05rem; }
.result .w-to { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 700; color: var(--red); }
.result .w-meta { display: block; font-size: .82rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.result .w-actions { display: flex; gap: 2px; }
.result a.w-link { color: inherit; text-decoration: none; }
.result a.w-link:hover { text-decoration: underline; }
.result.is-exact { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
@media (max-width: 600px) { .result { grid-template-columns: 1fr auto; } .result .w-to { grid-column: 1; } .result .w-actions { grid-row: 1 / span 2; grid-column: 2; } }
.result-count { color: var(--muted); font-size: .92rem; margin: 18px 0 12px; }

.empty { text-align: center; padding: 40px 20px; background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--radius); }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 46ch; margin: 0 auto 16px; }

/* ---------- Home ---------- */
.hero { padding: 56px 0 48px; border-bottom: 1px solid var(--line); }
.hero h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.2rem); max-width: 18ch; margin-bottom: .3em; }
.hero .greet { font-family: var(--font-serif); color: var(--red); font-style: italic; font-size: 1.15rem; margin-bottom: .3rem; }
.hero .lede { font-size: 1.12rem; color: var(--ink-2); max-width: 56ch; margin-bottom: 26px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 40px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-try { margin-top: 14px; font-size: .9rem; color: var(--muted); }
.hero-try a { margin: 0 3px; }

.wotd { background: #7A5236; color: #FBF3E8; border-radius: 20px; padding: 26px; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
.wotd::after { content: ""; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23FFF' stroke-opacity='.10' stroke-width='1.4'%3E%3Cpath d='M20 3 L37 20 L20 37 L3 20 Z'/%3E%3Cpath d='M20 12 L28 20 L20 28 L12 20 Z'/%3E%3C/g%3E%3C/svg%3E"); pointer-events: none; }
.wotd > * { position: relative; z-index: 1; }
.wotd .eyebrow { color: #F1D9BF; }
.wotd .w-to { font-family: var(--font-serif); font-size: clamp(2rem, 1.5rem + 2vw, 2.6rem); font-weight: 700; line-height: 1.1; color: #fff; }
.wotd .w-en { font-size: 1.1rem; margin-top: 6px; }
.wotd .w-ex { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.2); font-size: .93rem; }
.wotd .w-ex em { display: block; font-family: var(--font-serif); font-size: 1.02rem; color: #fff; }
.wotd a { color: #fff; }

.section { padding: 52px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; }
.step::before { counter-increment: step; content: counter(step); width: 34px; height: 34px; border-radius: 50%; background: var(--red-soft); color: var(--red); font-weight: 800; display: grid; place-items: center; margin-bottom: 12px; font-family: var(--font-serif); }
.step h3 { margin-bottom: 6px; }
.step p { color: var(--muted); margin: 0; font-size: .95rem; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }
.cta-band { background: var(--red); color: #fff; border-radius: 22px; padding: 36px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin: 0 0 6px; }
.cta-band p { margin: 0; opacity: .9; }
.cta-band .btn { background: #fff; color: var(--red); }
.cta-band .btn:hover { background: #FBF3E8; color: var(--red-strong); }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.recent-list li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.recent-list a { color: var(--ink); text-decoration: none; font-weight: 600; }
.recent-list a:hover { color: var(--red); }
.recent-list .to { font-family: var(--font-serif); color: var(--red); font-weight: 600; }
@media (max-width: 600px) { .recent-list { grid-template-columns: 1fr; } }

/* ---------- Word page ---------- */
.word-hero { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 34px; box-shadow: var(--shadow); }
.word-hero .w-to { font-family: var(--font-serif); font-size: clamp(2.2rem, 1.6rem + 3vw, 3.4rem); font-weight: 700; color: var(--red); line-height: 1.05; margin: 0; }
.word-hero .w-pron { font-size: 1.05rem; color: var(--muted); margin-top: 8px; }
.word-hero .w-en { font-size: 1.35rem; margin-top: 16px; }
.word-hero .w-en b { font-weight: 700; }
.example { border-left: 4px solid var(--tapa); background: var(--sand-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 14px 18px; margin-top: 22px; }
.example .to { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 600; }
.example .en { color: var(--muted); margin-top: 4px; }
.breadcrumbs { font-size: .88rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumbs a { color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 12px 16px; background: var(--sand-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .to { font-family: var(--font-serif); font-weight: 600; color: var(--red); }
.table .note { display: block; font-size: .83rem; color: var(--muted); margin-top: 4px; }

/* ---------- Browse A-Z ---------- */
.letter-bar { display: flex; flex-wrap: wrap; gap: 4px; position: sticky; top: 66px; z-index: 20; background: var(--sand); padding: 10px 0; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.letter-bar a { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; text-decoration: none; font-weight: 700; color: var(--ink-2); font-size: .9rem; }
.letter-bar a:hover { background: var(--red-soft); color: var(--red); }
.letter-group { scroll-margin-top: 130px; margin-bottom: 26px; }
.letter-group h2 { font-size: 1.6rem; color: var(--red); border-bottom: 2px solid var(--line); padding-bottom: 4px; margin-bottom: 4px; }
.az-list { list-style: none; margin: 0; padding: 0; columns: 2 300px; column-gap: 32px; }
.az-list li { break-inside: avoid; display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dotted var(--line); }
.az-list a { color: var(--ink); text-decoration: none; font-weight: 500; }
.az-list a:hover { color: var(--red); }
.az-list .to { font-family: var(--font-serif); color: var(--red); text-align: right; }
.az-list li[hidden] { display: none; }

/* ---------- Dashboard ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.wanted .chip { cursor: pointer; }
.side-nav { list-style: none; margin: 0; padding: 0; }
.side-nav a { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.side-nav a:hover { background: var(--sand-2); color: var(--ink); }

/* ---------- Ads ---------- */
.ad-slot { margin: 28px 0; text-align: center; min-height: 100px; }
.ad-slot .ad-label { display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: auto; }
.site-footer .wrap { padding-top: 40px; padding-bottom: 28px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; }
.foot-grid h4 { font-family: var(--font-sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin: 6px 0; }
.foot-grid a { color: var(--ink-2); text-decoration: none; }
.foot-grid a:hover { color: var(--red); }
.foot-note { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
@media (max-width: 700px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--sand); padding: 10px 18px; border-radius: 999px; font-size: .9rem; opacity: 0; transition: opacity .2s, transform .2s; z-index: 90; pointer-events: none; }
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- DevExpress (admin) ---------- */
.dx-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; overflow-x: auto; }
.dx-wrap .dxgvControl_Office365, .dx-wrap table.dxgvControl_Office365 { width: 100% !important; border: 0 !important; }
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-tabs a { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.admin-tabs a.is-active, .admin-tabs a:hover { border-color: var(--red); color: var(--red); }
.review-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.review-actions { display: flex; flex-direction: column; gap: 8px; min-width: 150px; }
.review-meta { font-size: .84rem; color: var(--muted); margin-top: 8px; }
.dup-warn { margin-top: 10px; font-size: .86rem; background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 8px 12px; }
@media (max-width: 640px) { .review-card { grid-template-columns: 1fr; } .review-actions { flex-direction: row; flex-wrap: wrap; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .ad-slot, .nav-toggle, .w-actions { display: none !important; } body { background: #fff; } }
