/* The Khmer review page (/khmer-review). One stylesheet for every site's sheet; the site's accent comes from sheet.json. */
@font-face { font-family: "Review Khmer"; font-weight: 400; src: url(khmer-400.woff2) format("woff2"); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; font-display: swap; }
@font-face { font-family: "Review Khmer"; font-weight: 600; src: url(khmer-600.woff2) format("woff2"); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; font-display: swap; }

:root {
  --accent: #c2410c;
  --ink: #16141c; --dim: #4f4b5a; --faint: #6b6777; --line: #d8d4e2; --paper: #ffffff; --card: #faf9fd; --soft: #f1eef8;
  --ok: #166534; --ok-bg: #ecfdf3; --warn: #92400e; --warn-bg: #fff7ed;
  color-scheme: light dark;
}
/* dark: the device's choice unless light was chosen here, or dark chosen here (⛔ keep the two blocks identical: selftest) */
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) { --ink: #ece9f4; --dim: #c5c0d2; --faint: #a6a1b3; --line: #3a3646; --paper: #121017; --card: #1a1721; --soft: #24202d;
    --ok: #86efac; --ok-bg: #0f2a1a; --warn: #fdba74; --warn-bg: #2b1a0c; }
}
:root[data-scheme="dark"] { --ink: #ece9f4; --dim: #c5c0d2; --faint: #a6a1b3; --line: #3a3646; --paper: #121017; --card: #1a1721; --soft: #24202d;
    --ok: #86efac; --ok-bg: #0f2a1a; --warn: #fdba74; --warn-bg: #2b1a0c; color-scheme: dark; }
:root[data-scheme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0 auto; max-width: 860px; padding: 20px 16px 48px; background: var(--paper); color: var(--ink);
  font: 16px/1.55 "Review Khmer", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; }
:lang(km) { font-family: "Review Khmer", "Noto Sans Khmer", "Khmer Sangam MN", sans-serif; line-height: 1.9; }

h1 { font-size: 22px; line-height: 1.3; margin: 0 0 4px; }
h1 .bi .en { font-size: 15px; }
h2 { font-size: 15px; margin: 28px 0 10px; padding: 6px 10px; background: var(--soft); border-radius: 8px; color: var(--dim); }
.lede { color: var(--dim); margin: 0 0 12px; }
.how { border-left: 3px solid var(--accent); background: var(--soft); padding: 10px 14px; margin: 12px 0; border-radius: 0 10px 10px 0; }
.how summary { cursor: pointer; font-weight: 600; margin: 0 0 6px; }
.how p { margin: 0 0 8px; } .how p:last-child { margin: 0; }
.how:not([open]) summary { margin: 0; }

.bi { display: inline-flex; flex-direction: column; line-height: 1.35; }
.bi > [lang="km"] { line-height: 1.7; }
.bi .en { font-size: 0.78em; color: var(--faint); }
p > .bi, .banner .bi { display: flex; flex-direction: column; }
.banner .bi .en, .flag .bi .en, .msg .bi .en { display: block; }

.banner { margin: 14px 0 8px; padding: 10px 14px; border-radius: 10px; background: var(--soft); }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: 6px 0 4px; }
.progress { margin: 0; font-weight: 600; }
.filter { display: inline-flex; gap: 6px; flex-wrap: wrap; }

button { font: inherit; font-size: 15px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 14px; min-height: 44px; cursor: pointer; text-align: left; }
button[aria-pressed="true"] { border-color: var(--ink); background: var(--soft); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary .bi .en { color: rgba(255, 255, 255, 0.85); }
button:disabled { opacity: 0.75; cursor: default; }
button:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 0 0 12px; }
.card { content-visibility: auto; contain-intrinsic-size: auto 240px; }   /* a sheet of thousands: cards off screen are not laid out */
.appears { margin: -2px 0 6px; font-size: 13px; color: var(--faint); display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.appears .lbl .bi { flex-direction: row; gap: 4px; }
.appears .lbl::after { content: ":"; }
.card.approved, .card.corrected { border-left: 4px solid var(--ok); }
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 6px; font-size: 13px; color: var(--faint); }
.head .n { font-weight: 700; color: var(--ink); font-size: 15px; }
.badge { padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--dim); }
.card.approved .badge, .card.corrected .badge { background: var(--ok-bg); color: var(--ok); }
.badge .bi { flex-direction: row; gap: 6px; align-items: baseline; }
.key { font: 11px/1.3 ui-monospace, Menlo, monospace; color: var(--faint); margin-left: auto; overflow-wrap: anywhere; }
.en { color: var(--dim); margin: 2px 0 6px; overflow-wrap: anywhere; }
.km { font-size: 20px; overflow-wrap: anywhere; }
.km .none { font-size: 15px; color: var(--faint); }
.long .km, .long .en { white-space: pre-wrap; }
.long .km { font-size: 18px; }
.ph { background: color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 4px; padding: 0 3px; font-family: ui-monospace, Menlo, monospace; font-size: 0.8em; }
.draft { margin: 8px 0 0; color: var(--dim); }
.draft summary { cursor: pointer; font-size: 14px; }
.draft div { font-size: 17px; margin-top: 4px; }
.flag { margin: 8px 0 0; padding: 6px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 14px; }
.notes { margin: 8px 0 0; font-size: 14px; }
.notes .label { margin: 0; font-weight: 600; }
.notes ul { margin: 2px 0 0; padding-left: 18px; }
.notes li { white-space: pre-wrap; overflow-wrap: anywhere; }
.when { font-size: 12px; color: var(--faint); }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.editor { margin-top: 10px; }
.editor label { display: block; font-size: 14px; margin-bottom: 4px; }
textarea { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; resize: vertical; }
textarea.kmbox { font-size: 19px; line-height: 1.9; }
.msg { margin: 8px 0 0; font-size: 14px; color: var(--warn); }
.msg.done { color: var(--ok); }
.msg:empty { display: none; }
.paper { display: none; }
.find { display: flex; flex-direction: column; gap: 4px; flex: 1 1 220px; font-size: 14px; }
.find .bi { flex-direction: row; gap: 8px; align-items: baseline; }
.find input { font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-height: 44px; width: 100%; }
.where-unused { margin: -2px 0 12px; font-size: 14px; color: var(--dim); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.where .links { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.where a { color: var(--accent); text-underline-offset: 3px; min-height: 24px; display: inline-flex; }
.where .note { flex-basis: 100%; font-size: 12px; color: var(--faint); }
.where .note .bi { flex-direction: row; gap: 6px; flex-wrap: wrap; }
.who, .unsent { font-size: 12px; }
.who .bi, .unsent .bi { flex-direction: row; gap: 4px; }
.unsent { padding: 2px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); }
.history { margin: 8px 0 0; color: var(--dim); font-size: 14px; }
.history summary { cursor: pointer; }
.history ol { margin: 4px 0 0; padding-left: 20px; }
.history li { margin: 0 0 6px; }
.history li .when .bi { flex-direction: row; gap: 4px; display: inline-flex; margin-right: 6px; }
.history li div { font-size: 17px; overflow-wrap: anywhere; }
#list > p.none { color: var(--faint); }

/* the UI language: the tool's own words in one language (the entries under review keep both); no script = both */
html[data-ui="km"] .ui-en, html[data-ui="en"] .ui-km { display: none !important; }
html[data-ui="en"] .bi .ui-en { font-size: 1em; color: inherit; }
/* the header row: the link holder's own name at the left, both toggles at the right (founder 2026-11-22) */
.top { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; }
.toggles { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; }
.me { font-weight: 600; font-size: 15px; }
.langs.scheme button { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; padding: 4px 10px; color: var(--ink); }
.langs.scheme button[aria-pressed="true"] { color: var(--paper); }
.langs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; background: var(--paper); }
.langs button { min-height: 36px; padding: 4px 14px; border: 0; border-radius: 999px; background: transparent; font-size: 15px; }
.langs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); font-weight: 600; }

/* the sub-card: the Khmer under review and what acts on it, set apart from the context above it */
.review { margin-top: 10px; padding: 12px 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 8%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); }
.review .km { font-size: 21px; }
.review .acts { margin-top: 12px; }
.review button:not(.primary) { background: var(--paper); }

/* the picture: a window of the screen with a red outline and arrow at the entry's words */
.shot { margin: 8px 0 8px; }
.shot .label { margin: 0 0 4px; font-size: 13px; color: var(--faint); }
.shot .label .bi { flex-direction: row; gap: 6px; }
.shot .frame { position: relative; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.shot img { display: block; width: 100%; height: auto; }
.shot svg.mark { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.shot .box { fill: none; stroke: #dc2626; stroke-width: 3; }
.shot .halo { fill: none; stroke: #fff; stroke-width: 10; stroke-linecap: round; opacity: .92; }
.shot .arrow { fill: none; stroke: #dc2626; stroke-width: 5.5; stroke-linecap: round; }
.shot .head { fill: #dc2626; stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; }
.shot figcaption { margin-top: 4px; font-size: 12px; }
.shot figcaption a { color: var(--accent); text-underline-offset: 3px; display: inline-flex; min-height: 24px; }
.shot figcaption .bi { flex-direction: row; gap: 6px; }

/* the three bouncing dots of a pressed submit button (/build Default 12) */
.dots { display: inline-flex; gap: 5px; align-items: center; height: 1.4em; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: bob 0.9s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; } .dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bob { 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-5px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

footer { margin-top: 32px; color: var(--faint); font-size: 13px; }
footer p { margin: 0 0 6px; }

@media print {
  .review { background: none; border: 1px solid #999; }
  .card { content-visibility: visible; }
  :root { --paper: #fff; --card: #fff; --ink: #000; --dim: #333; --faint: #555; --line: #999; --soft: #eee; }
  body { max-width: none; padding: 0; font-size: 12.5px; }
  .tools, .acts, .editor, .banner, .msg, .where, .unsent, .history { display: none !important; }
  .card { break-inside: avoid; border-radius: 0; padding: 8px 10px; margin-bottom: 6px; }
  .km { font-size: 15px; }
  .paper { display: block; height: 48px; margin-top: 6px; border-top: 1px dashed #999;
    background: repeating-linear-gradient(transparent 0 23px, #ddd 23px 24px); }
  h2 { break-after: avoid; }
  @page { margin: 12mm; }
}
