/* SingkatanKata v3 – mobile-first, mode terang/gelap */
:root {
  --bg: #f7f5ef;
  --surface: #ffffff;
  --surface-2: #f0ede4;
  --ink: #1c2528;
  --ink-2: #4a5659;
  --muted: #6b7779;
  --line: #e2ddd0;
  --brand: #0f4c5c;
  --brand-2: #16697a;
  --brand-ink: #ffffff;
  --accent: #e3a33b;
  --accent-soft: #fbefd7;
  --danger: #b3261e;
  --ok: #1e7a46;
  --focus: #e3a33b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 30, 32, .05), 0 6px 22px rgba(20, 30, 32, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1d22; --surface: #10262c; --surface-2: #163239; --ink: #e8efef; --ink-2: #c3d0d1; --muted: #93a6a8;
    --line: #23434b; --brand: #5cc2d6; --brand-2: #7fd3e3; --brand-ink: #062027; --accent: #f0b65a; --accent-soft: #3a3020;
    --danger: #ff8a80; --ok: #7ad7a0; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1d22; --surface: #10262c; --surface-2: #163239; --ink: #e8efef; --ink-2: #c3d0d1; --muted: #93a6a8;
  --line: #23434b; --brand: #5cc2d6; --brand-2: #7fd3e3; --brand-ink: #062027; --accent: #f0b65a; --accent-soft: #3a3020;
  --danger: #ff8a80; --ok: #7ad7a0; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); overflow-wrap: anywhere; }
img, svg, canvas { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-2); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; color: var(--ink); margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
h2 { font-size: clamp(1.2rem, 2.6vw, 1.5rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code, kbd, pre { font-family: var(--font-mono); font-size: .92em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #000; padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--muted); margin-bottom: .4rem; }
.eyebrow a { color: inherit; text-decoration: none; }
.lead { font-size: 1.08rem; color: var(--ink-2); max-width: 70ch; }

/* ---------- Header ---------- */
.site-header { background: var(--brand); color: var(--brand-ink); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
:root[data-theme="dark"] .site-header { background: #0e2a31; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-header { background: #0e2a31; } }
.header-inner { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; flex-shrink: 0; }
.brand:hover { color: #fff; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #10262c; font: 800 15px/1 var(--font); letter-spacing: .02em; }
.brand-text { font: 600 1.2rem/1 var(--font-display); }
.brand-text b { color: var(--accent); font-weight: 700; }
.site-header .search { flex: 1; min-width: 0; }
.icon-btn { background: transparent; border: 0; color: #fff; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.icon-btn:hover { background: rgba(255,255,255,.12); }
.site-nav { background: rgba(0,0,0,.14); }
.site-nav ul { list-style: none; display: flex; gap: 2px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav a { display: block; padding: 9px 12px; color: rgba(255,255,255,.88); text-decoration: none; font-size: .95rem; white-space: nowrap; border-bottom: 3px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--accent); }
.menu-toggle { display: none; }
@media (max-width: 640px) {
  .brand-text { display: none; }
  .site-nav { display: none; }
  .site-nav.open { display: block; }
  .site-nav.open ul { flex-direction: column; padding-bottom: 6px; }
  .site-nav.open a { border-bottom: 0; border-left: 3px solid transparent; }
  .site-nav.open a[aria-current="page"] { border-left-color: var(--accent); }
  .menu-toggle { display: grid; }
}

/* ---------- Search ---------- */
.search { position: relative; display: flex; background: var(--surface); border-radius: 12px; border: 1px solid var(--line); }
.site-header .search { border: 0; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; padding: 10px 12px; border-radius: 12px; outline: 0; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search button { border: 0; background: transparent; color: var(--brand); padding: 0 12px; cursor: pointer; border-radius: 0 12px 12px 0; font: 600 1rem var(--font); }
.search:focus-within { box-shadow: 0 0 0 3px var(--focus); }
.search-hero { max-width: 640px; margin: 0 auto 12px; box-shadow: var(--shadow); }
.search-hero input { padding: 14px 16px; font-size: 1.08rem; }
.search-hero button { background: var(--brand); color: var(--brand-ink); padding: 0 22px; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 60; max-height: 70vh; overflow: auto; text-align: left; }
.suggest a { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.suggest a:hover, .suggest [aria-selected="true"] a { background: var(--surface-2); }
.suggest b { font-family: var(--font-mono); color: var(--brand); min-width: 4.5em; }
.suggest span { color: var(--muted); font-size: .92rem; }

/* ---------- Layout ---------- */
.main { padding-top: 18px; padding-bottom: 40px; min-height: 60vh; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 14px; font-size: .88rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: 4px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
.section { margin: 28px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head h2 { margin: 0; }
.grid-2 { display: grid; gap: 18px; grid-template-columns: 1fr; }
.grid-2 > .card { margin-bottom: 0; }
@media (min-width: 820px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.page-head { margin: 6px 0 18px; }
.prose { max-width: 75ch; }
.prose h2 { margin-top: 1.4em; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.ad, .ad-gpt { margin: 22px auto; text-align: center; min-height: 90px; }
.ad-gpt { min-height: 50px; width: 320px; max-width: 100%; margin: 0 auto 14px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); padding: 9px 16px; border-radius: 10px; font: 600 .95rem/1.2 var(--font); cursor: pointer; text-decoration: none; transition: transform .06s ease, background .15s ease; }
.btn:hover { background: var(--brand-2); border-color: var(--brand-2); color: var(--brand-ink); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--surface-2); color: var(--brand); }
.btn-small { padding: 6px 12px; font-size: .88rem; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn[disabled], .btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 26px 0 8px; }
.hero h1 { margin-bottom: .3em; }
.hero .lead { margin: 0 auto 18px; }
.hero-chips { font-size: .92rem; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; }
.hero-chips a { font-family: var(--font-mono); font-weight: 600; }

/* ---------- Chips & cards ---------- */
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a, .chips .current { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font: 600 .92rem var(--font-mono); color: var(--brand); }
.chips a:hover { border-color: var(--brand); background: var(--surface-2); }
.chips .current { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.word-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.word-cards a { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .1s; }
.word-cards a:hover { border-color: var(--brand); transform: translateY(-1px); }
.word-cards .abbr { font: 700 1.05rem var(--font-mono); color: var(--brand); }
.word-cards .meaning { font-size: .92rem; color: var(--ink-2); }
.word-cards .more { font-size: .78rem; color: var(--muted); margin-top: auto; }
.letter-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.letter-grid a { display: flex; flex-direction: column; align-items: center; padding: 8px 2px; border-radius: 10px; background: var(--surface-2); text-decoration: none; color: var(--ink); }
.letter-grid a:hover { background: var(--brand); color: var(--brand-ink); }
.letter-grid b { font: 700 1.15rem var(--font-display); }
.letter-grid small { font-size: .7rem; color: inherit; opacity: .7; }
.az ul { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-wrap: wrap; gap: 4px; }
.az a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 700; color: var(--ink); }
.az a:hover, .az a.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.subprefix ul { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.subprefix a { display: inline-block; padding: 4px 10px; border-radius: 8px; background: var(--surface-2); text-decoration: none; font: 600 .9rem var(--font-mono); }
.subprefix a[aria-current="page"] { background: var(--brand); color: var(--brand-ink); }
.subprefix small { font-family: var(--font); font-weight: 400; color: var(--muted); }
.subprefix a[aria-current="page"] small { color: inherit; }
.tool-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.tool-grid a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.tool-grid a:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.tool-name { font-weight: 700; color: var(--brand); }
.tool-desc { font-size: .88rem; color: var(--muted); }
.result-list { list-style: none; padding: 0; margin: 0; }
.result-list a { display: flex; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.result-list a:hover { background: var(--surface-2); }
.result-list .abbr { font: 700 1rem var(--font-mono); color: var(--brand); min-width: 5.5em; }

/* ---------- Pager ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 22px 0; }
.pager ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.pager a, .pager span { display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.pager span[aria-current] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 700; }
.pager .gap { display: grid; place-items: center; padding: 0 4px; color: var(--muted); }

/* ---------- Word page ---------- */
.word-head { margin: 4px 0 16px; }
.word-head h1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.abbr-big { font-family: var(--font-mono); font-weight: 800; letter-spacing: .02em; color: var(--brand); font-size: clamp(2.2rem, 8vw, 3.6rem); }
.h1-sub { font-size: clamp(1rem, 2.5vw, 1.25rem); color: var(--muted); font-weight: 400; }
.abbr-inline { font-family: var(--font-mono); color: var(--brand); }
.word-actions { display: flex; flex-wrap: wrap; gap: 8px; }
[data-fav][aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #10262c; }
.meaning-list { padding-left: 1.6em; margin: 0 0 8px; }
.meaning-list li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 1.08rem; }
.meaning-list li:last-child { border-bottom: 0; }
.meaning-list li::marker { color: var(--muted); font-weight: 700; }
.meaning-list li { display: list-item; }
.meaning-text { margin-right: 8px; }
.copy-mini { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 6px; font-size: .75rem; padding: 2px 8px; cursor: pointer; vertical-align: middle; }
.copy-mini:hover { color: var(--brand); border-color: var(--brand); }
.note { font-size: .85rem; color: var(--muted); background: var(--accent-soft); padding: 8px 12px; border-radius: 8px; margin: 12px 0 0; }
.meaning-mini { padding-left: 1.3em; margin: 0 0 6px; }
.nato { display: flex; flex-wrap: wrap; gap: 6px; }
.nato span { padding: 4px 10px; border-radius: 8px; background: var(--surface-2); font-weight: 600; }
.formats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 12px 0; }
.formats div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.formats dt { font-size: .75rem; color: var(--muted); }
.formats dd { margin: 0; }
.daily h2 { font: 800 2rem var(--font-mono); margin: 0 0 .3em; }
.daily h2 a { text-decoration: none; }
.cta-tools { background: linear-gradient(135deg, var(--accent-soft), var(--surface)); }

/* ---------- Tabs, filter ---------- */
.tab-list { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab-list button { border: 0; background: transparent; padding: 10px 14px; font: 600 .95rem var(--font); color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab-list button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tool-filter input { width: 100%; max-width: 520px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.cat-nav ul { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.cat-nav a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); text-decoration: none; font-size: .9rem; }
.tool-cat { scroll-margin-top: 120px; }

/* ---------- Tool UI ---------- */
.tool-app { min-height: 240px; }
.tool-loading { margin: 0; }
.tool-app label, .tool-app .field-label { display: block; font-weight: 600; font-size: .92rem; margin: 0 0 4px; }
.field { margin-bottom: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row > .field { flex: 1 1 160px; }
.tool-app input[type="text"], .tool-app input[type="number"], .tool-app input[type="date"], .tool-app input[type="search"], .tool-app input[type="password"], .tool-app input[type="url"], .tool-app select, .tool-app textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }
.tool-app textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.tool-app textarea.mono, .tool-app .mono { font-family: var(--font-mono); }
.tool-app input:focus, .tool-app select:focus, .tool-app textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.tool-app input[type="color"] { width: 52px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; }
.tool-app input[type="range"] { width: 100%; accent-color: var(--brand); }
.check { display: inline-flex !important; align-items: center; gap: 8px; font-weight: 400 !important; margin: 0 16px 8px 0 !important; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.output { position: relative; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin: 10px 0; white-space: pre-wrap; word-break: break-word; min-height: 46px; }
.output.big { font: 700 clamp(1.4rem, 5vw, 2.2rem) var(--font-mono); color: var(--brand); text-align: center; padding: 18px; }
.out-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.out-head .field-label { margin: 0; }
.result-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); margin: 10px 0; }
.result-item { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.result-item .label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.result-item .value { font: 600 1.05rem var(--font-mono); word-break: break-all; }
.result-item .value.text { font-family: var(--font); font-weight: 600; word-break: normal; }
.result-item button { align-self: flex-start; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 10px 0; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 12px; text-align: center; }
.stat b { display: block; font: 700 1.5rem var(--font-display); color: var(--brand); }
.stat span { font-size: .82rem; color: var(--muted); }
.table-wrap { overflow-x: auto; margin: 10px 0; border: 1px solid var(--line); border-radius: 10px; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table-wrap th, .table-wrap td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap th { background: var(--surface-2); font-weight: 700; position: sticky; top: 0; }
.table-wrap tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--ink-2); }
.badge.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge.warn { background: var(--accent-soft); color: #8a5a00; }
:root[data-theme="dark"] .badge.warn { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.warn { color: var(--accent); } }
.badge.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.meter { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width .2s; }
.hl { background: var(--accent-soft); border-bottom: 2px solid var(--accent); border-radius: 3px; padding: 0 1px; }
.hl.def { background: color-mix(in srgb, var(--ok) 18%, transparent); border-bottom-color: var(--ok); }
.preview-box { border: 1px dashed var(--line); border-radius: 10px; padding: 10px; text-align: center; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 20px 20px; }
.preview-box canvas, .preview-box img, .preview-box svg { max-width: 100%; height: auto; display: inline-block; }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; }
.dropzone.drag { border-color: var(--brand); background: var(--surface-2); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 64px; text-align: center; font: .72rem var(--font-mono); cursor: pointer; border: 0; background: transparent; color: var(--ink); padding: 0; }
.swatch i { display: block; height: 44px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 3px; }
.word-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.word-chips button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 4px 12px; cursor: pointer; font: inherit; font-size: .92rem; }
.word-chips button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.cand-list { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.cand { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.cand .code { font: 800 1.25rem var(--font-mono); color: var(--brand); }
.cand .why { grid-column: 1 / -1; font-size: .82rem; color: var(--muted); }
.cand .score { font-weight: 700; }
.cand .meter { grid-column: 1 / -1; height: 6px; }

/* Quiz / flashcard / memory */
.quiz-q { font: 700 clamp(1.3rem, 4vw, 1.8rem) var(--font-display); margin: 6px 0 14px; }
.quiz-q.mono { font-family: var(--font-mono); color: var(--brand); }
.choices { display: grid; gap: 8px; }
.choices button { text-align: left; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.choices button:hover:not(:disabled) { border-color: var(--brand); }
.choices button.correct { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
.choices button.wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.progress-line { display: flex; justify-content: space-between; font-size: .88rem; color: var(--muted); margin-bottom: 6px; }
.flashcard { perspective: 1000px; height: 240px; margin: 12px 0; cursor: pointer; }
.flashcard-inner { position: relative; width: 100%; height: 100%; transition: transform .45s; transform-style: preserve-3d; }
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face { position: absolute; inset: 0; backface-visibility: hidden; display: grid; place-items: center; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-align: center; font-size: 1.3rem; box-shadow: var(--shadow); }
.flashcard-face.back { transform: rotateY(180deg); background: var(--surface-2); }
.flashcard-face .mono { font: 800 2.4rem var(--font-mono); color: var(--brand); }
.memory-grid { display: grid; gap: 8px; grid-template-columns: repeat(4, 1fr); margin: 12px 0; }
@media (max-width: 520px) { .memory-grid { grid-template-columns: repeat(3, 1fr); } }
.memory-card { aspect-ratio: 3 / 4; border-radius: 10px; border: 1px solid var(--line); background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; padding: 6px; font-size: .82rem; text-align: center; cursor: pointer; user-select: none; line-height: 1.25; word-break: break-word; }
.memory-card.open, .memory-card.done { background: var(--surface); color: var(--ink); }
.memory-card.done { border-color: var(--ok); opacity: .7; cursor: default; }
.memory-card .mono { font: 800 1.1rem var(--font-mono); color: var(--brand); }
.share-box { font-family: var(--font-mono); white-space: pre; }

/* ---------- Toast & footer ---------- */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; z-index: 100; font-size: .92rem; box-shadow: var(--shadow); }
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 10px 0 24px; margin-top: 30px; font-size: .92rem; }
.footer-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 16px 0; }
.footer-grid h2 { font: 700 .95rem var(--font); margin-bottom: 6px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 4px 0; }
.footer-brand { font: 600 1.3rem var(--font-display); margin-bottom: 4px; }
.footer-brand b { color: var(--accent); }
.copyright { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); padding-top: 12px; }
details { border-bottom: 1px solid var(--line); padding: 10px 0; }
details summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; color: var(--ink-2); }

/* Embed */
body.is-embed { background: var(--surface); }
body.is-embed .main { padding: 10px; min-height: 0; }
body.is-embed .tool-app { box-shadow: none; border: 0; padding: 4px; }
.embed-title { font-size: 1.1rem; margin: 0 0 6px; }
.embed-credit { text-align: center; font-size: .78rem; color: var(--muted); margin: 4px 0 8px; }

@media print {
  .site-header, .site-footer, .ad, .ad-gpt, .word-actions, .actions, .breadcrumbs { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
