:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #f1ede6;
  --surface-3: #e9e4da;
  --line: #e5dfd4;
  --text: #1c1916;
  --muted: #6e665d;
  --faint: #9a9187;
  --accent: #8e1f3c;        /* songket maroon */
  --accent-ink: #ffffff;
  --accent-soft: #f6e6ea;
  --gold: #b0802a;
  --gold-soft: #f6ecd9;
  --good: #1f8456;
  --ok: #b4761a;
  --bad: #c23f2d;
  --r-a: #8e1f3c; --r-b: #1d63a3; --r-c: #3b7d23; --r-d: #8a5a14; --r-x: #9a9187;
  --shadow: 0 1px 2px rgb(40 30 20 / .04), 0 12px 32px -18px rgb(40 30 20 / .18);
  --radius: 16px;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11100e; --surface: #1a1816; --surface-2: #23201d; --surface-3: #2d2925; --line: #322e29;
    --text: #f2ede6; --muted: #a8a095; --faint: #7a7268;
    --accent: #f08aa3; --accent-ink: #1b0f13; --accent-soft: #3a1f27; --gold: #dcae5e; --gold-soft: #33291a;
    --good: #52c58f; --ok: #e3a84a; --bad: #f2806d;
    --r-a: #f08aa3; --r-b: #7db8ee; --r-c: #9ad57a; --r-d: #e3bf74; --r-x: #7a7268;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 32px -18px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.bar-in { max-width: 1240px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font: 600 17px/1 var(--serif); white-space: nowrap; }
.logo svg { width: 26px; height: 26px; stroke: none; }
.logo .lg-a { fill: var(--accent); } .logo .lg-b { fill: var(--gold); }
.modes { display: flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 999px; }
.modes button { border: 0; background: none; padding: 7px 16px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 14px; white-space: nowrap; }
.modes button:hover { color: var(--text); }
.modes button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); padding: 6px 12px 6px 10px; margin-right: 6px;
  border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status.ok i { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.status.err i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--bad); }
button.icon { width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: none; border-radius: 10px; color: var(--muted); cursor: pointer; }
button.icon:hover { background: var(--surface-2); color: var(--text); }

@media (max-width: 760px) {
  .bar-in { flex-wrap: wrap; padding: 10px 16px 8px; gap: 8px 12px; }
  .modes { order: 3; width: 100%; }
  .modes button { flex: 1; padding: 7px 8px; }
  .status span { display: none; }
  .status { padding: 8px; margin-right: 0; }
}

/* ---------- Layout ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 36px 24px 80px; }
@media (max-width: 760px) { main { padding: 24px 16px 60px; } }
/* credit sits at the bottom edge of the window, below everything */
body { min-height: 100dvh; display: flex; flex-direction: column; }
main { width: 100%; flex: 1; }
.q-note { margin: 8px 0 0; font-size: 13px; color: var(--ok); }
.credit { padding: 0 16px 14px; font-size: 11px; color: var(--faint); text-align: center; opacity: .7; }
.view { display: none; }
.view.active { display: block; animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.title { font: 500 clamp(28px, 3.4vw, 38px)/1.1 var(--serif); letter-spacing: -.015em; margin: 0 0 10px; }
.lede { color: var(--muted); margin: 0 0 24px; max-width: 58ch; font-size: 15.5px; }
.page-head { max-width: 760px; }

.workspace { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: start; }
.composer { position: sticky; top: 92px; }
@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; gap: 28px; }
  .composer { position: static; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; box-shadow: var(--shadow); }
@media (max-width: 560px) { .card { padding: 18px 16px; } }

/* ---------- Buttons & inputs ---------- */
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; background: var(--accent); color: var(--accent-ink);
  padding: 10px 18px; border-radius: 12px; font-weight: 600; cursor: pointer; transition: transform .1s, filter .15s; white-space: nowrap; }
.primary:hover { filter: brightness(1.08); }
.primary:active { transform: scale(.98); }
.primary:disabled { opacity: .55; cursor: default; filter: none; transform: none; }
.primary.big { padding: 14px 22px; font-size: 16px; border-radius: 14px; }
.primary kbd { font: 500 12px var(--sans); opacity: .7; background: rgb(255 255 255 / .16); padding: 2px 6px; border-radius: 6px; }
@media (hover: none) { .primary kbd { display: none; } }
.ghost { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 500; }
.ghost:hover { background: var(--surface-2); }
.ghost:disabled { opacity: .5; cursor: default; }
.link { border: 0; background: none; padding: 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--line); cursor: pointer; }
.link:hover { color: var(--text); text-decoration-color: currentColor; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); padding: 5px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; color: var(--text); }
.chip-btn:hover { border-color: var(--gold); background: var(--gold-soft); }
.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.examples > span { margin-right: 2px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .sw { width: 34px; height: 20px; border-radius: 999px; background: var(--surface-3); position: relative; flex: none; transition: background .2s; }
.switch .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .2s; }
.switch input:checked + .sw { background: var(--accent); }
.switch input:checked + .sw::after { transform: translateX(14px); }
.switch input:focus-visible + .sw { outline: 2px solid var(--gold); outline-offset: 2px; }
.inline-sel { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.inline-sel.block { display: flex; margin-top: 4px; }
select { padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.row-end { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px 18px; margin-top: 14px; }
.row-end > :first-child { margin-right: auto; }

/* ---------- Editor ---------- */
.editor { --lh: 38px; --pad: 22px; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; overflow: hidden; }
.editor:focus-within { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--gold) 14%, transparent); }
.editor textarea { position: relative; z-index: 1; display: block; width: 100%; min-height: calc(var(--lh) * 5 + var(--pad) * 2); resize: none; overflow-x: auto; overflow-y: hidden;
  border: 0; outline: 0; background: transparent; padding: var(--pad) 104px var(--pad) 50px; font: 400 20px/var(--lh) var(--serif); white-space: pre; tab-size: 2; }
.editor textarea::placeholder { color: var(--faint); }
.backdrop, .gutter { position: absolute; top: var(--pad); left: 0; right: 0; pointer-events: none; }
.b-row { height: var(--lh); display: flex; align-items: center; padding-left: 20px; font: 500 11px var(--sans); color: var(--faint); font-variant-numeric: tabular-nums; }
.b-row.pembayang { color: var(--gold); } .b-row.maksud { color: var(--accent); }
.b-row.split, .b-row.stanza-gap { position: relative; }
.b-row.split::before { content: ""; position: absolute; left: 50px; right: 22px; top: 0; border-top: 1px dashed var(--line); }
.b-row.stanza-gap::after { content: ""; position: absolute; left: 50px; right: 22px; top: 50%; border-top: 1.5px solid var(--line); }
.gutter { left: auto; right: 0; width: 96px; z-index: 2; background: linear-gradient(90deg, transparent, var(--surface) 14px); }
.g-row { height: var(--lh); display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-right: 18px; font: 500 12px var(--sans); }
.g-row .syl { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; }
.g-row .syl.warn { color: var(--bad); font-weight: 600; }
.g-row .rl { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; font-weight: 600; font-size: 12px;
  background: color-mix(in srgb, currentColor 13%, transparent); }
@media (max-width: 560px) {
  .editor { --lh: 34px; --pad: 16px; border-radius: 16px; }
  .editor textarea { font-size: 16.5px; padding-left: 32px; padding-right: 62px; }
  .b-row { padding-left: 12px; }
  .b-row.split::before, .b-row.stanza-gap::after { left: 32px; right: 12px; }
  .gutter { width: 60px; }
  .g-row { padding-right: 9px; gap: 4px; font-size: 11.5px; }
  .g-row .syl { min-width: 16px; }
  .g-row .rl { width: 20px; height: 20px; font-size: 11px; }
}
.legend { display: flex; gap: 14px; margin: 10px 4px 0; font-size: 12px; color: var(--muted); }
.legend .legend-r { margin-left: auto; color: var(--faint); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.pb { background: var(--gold); } .dot.mk { background: var(--accent); }
.live { min-height: 26px; margin: 14px 4px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.live .pill { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.live .pill b { color: var(--text); font-weight: 600; }
.live .issues { width: 100%; list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 3px; }
.live .issues li { color: var(--bad); padding-left: 16px; position: relative; }
.live .issues li::before { content: ""; position: absolute; left: 3px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.composer-actions { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; margin-top: 20px; }

/* ---------- Report ---------- */
.report:empty { display: none; }
.intro { padding: 28px; }
.intro h2 { font: 500 22px/1.25 var(--serif); margin: 0 0 18px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; }
.steps .n { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font: 600 15px var(--serif); background: var(--gold-soft); color: var(--gold); }
.steps b { display: block; font-weight: 600; margin-bottom: 2px; }
.steps p { margin: 0; color: var(--muted); font-size: 14px; }
.intro .note { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

.verdict { padding: 26px; }
.v-top { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.v-score { display: flex; align-items: baseline; gap: 4px; color: var(--c, var(--text)); }
.v-score b { font: 500 64px/.9 var(--serif); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.v-score span { color: var(--muted); font-size: 15px; }
.v-meta { flex: 1; min-width: 160px; padding-top: 4px; }
.v-grade { font: 500 26px/1.15 var(--serif); }
.v-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.v-top .link { padding-top: 8px; }
.scale { margin: 22px 0 6px; position: relative; }
.scale .segs { display: flex; gap: 3px; height: 8px; }
.scale .segs i { border-radius: 4px; background: var(--surface-3); }
.scale .segs i.on { background: var(--c); }
.scale .marker { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 2px; background: var(--text); transform: translateX(-50%);
  box-shadow: 0 0 0 3px var(--surface); transition: left .5s cubic-bezier(.2, .8, .2, 1); }
.scale .labels { display: flex; gap: 3px; margin-top: 7px; font-size: 11.5px; color: var(--faint); }
.scale .labels span.on { color: var(--text); font-weight: 600; }
.v-summary { margin: 18px 0 0; font-size: 15px; line-height: 1.65; }
.notes { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--bad) 9%, transparent); color: var(--bad); font-size: 14px; list-style: none; }
.notes li + li { margin-top: 4px; }
.dims { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
@media (max-width: 560px) { .dims { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dim { background: var(--surface-2); border-radius: 12px; padding: 12px 12px 14px; }
.dim-l { font-size: 12px; color: var(--muted); line-height: 1.3; min-height: 2.6em; }
.dim-l b { color: var(--text); font-weight: 600; margin-right: 4px; }
.dim-v { font: 500 26px/1 var(--serif); margin: 6px 0 10px; font-variant-numeric: tabular-nums; }
.dim-v.na { color: var(--faint); font-size: 18px; line-height: 26px; }
.meter { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }

.shimmer { position: relative; overflow: hidden; color: transparent !important; background: var(--surface-3); border-radius: 6px; }
.shimmer::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 60%, transparent), transparent); animation: shim 1.4s infinite; }
@keyframes shim { to { transform: translateX(100%); } }
.sk-line { height: 12px; margin-top: 10px; }

.thinking { display: flex; align-items: center; gap: 16px; padding: 18px 22px; }
.thinking b { font-weight: 600; display: block; }
.thinking p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.thinking .el { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--faint); font-size: 13px; }
.orb { width: 34px; height: 34px; border-radius: 50%; flex: none; background: conic-gradient(from 0deg, var(--accent), var(--gold), var(--accent));
  -webkit-mask: radial-gradient(circle, transparent 10px, #000 11px); mask: radial-gradient(circle, transparent 10px, #000 11px); animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* The AI's reply as it is written (Nilai). */
.think-card { padding: 0; }
.reply { border-top: 1px solid var(--line); padding: 4px 22px 16px; }
.reply-row { padding: 12px 0; border-top: 1px solid var(--line); animation: rise .25s ease-out; }
.reply-row:first-child { border-top: 0; }
.reply-row .fix-h b { flex: 1; min-width: 140px; }
.reply-row p, .reply-row ul { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.reply-row ul { padding-left: 18px; }
.reply-row p.revision { white-space: pre-line; color: var(--text); }
.reply-row.active p:last-child::after, .reply-row.active li:last-child::after { content: ""; display: inline-block; width: 7px; height: 1em;
  margin-left: 3px; vertical-align: -2px; background: var(--accent); border-radius: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.sec { font: 500 19px/1.3 var(--serif); margin: 0 0 14px; display: flex; align-items: baseline; gap: 10px; }
.sec .count { font: 500 13px var(--sans); color: var(--muted); }
.sub-h { font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 22px 0 10px; }

.fix { padding: 14px 0; border-top: 1px solid var(--line); }
.fix:first-of-type { border-top: 0; padding-top: 2px; }
.fix-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fix-h b { font-weight: 600; flex: 1; min-width: 140px; }
.fix p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.code { font: 600 11px var(--sans); color: var(--muted); background: var(--surface-2); padding: 3px 7px; border-radius: 6px; letter-spacing: .03em; }
.lost { font: 600 13px var(--sans); color: var(--bad); font-variant-numeric: tabular-nums; }
.lvl { font: 600 11px var(--sans); padding: 3px 9px; border-radius: 999px; letter-spacing: .02em; white-space: nowrap; }
.lvl.cemerlang { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.lvl.sederhana { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.lvl.lemah { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.lvl.none { background: var(--surface-2); color: var(--muted); }
.all-good { display: flex; gap: 12px; align-items: center; color: var(--good); font-weight: 500; }
.tips { margin: 0; padding: 0; list-style: none; counter-reset: t; display: grid; gap: 10px; }
.tips li { counter-increment: t; display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: 14.5px; line-height: 1.6; }
.tips li::before { content: counter(t); width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font: 600 12px var(--sans);
  background: var(--accent-soft); color: var(--accent); margin-top: 1px; }
.goods { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.goods li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: 14.5px; line-height: 1.6; }
.goods li::before { content: "✓"; color: var(--good); font-weight: 700; }

.revision { font: 400 19px/1.75 var(--serif); white-space: pre-line; padding: 16px 20px; border-radius: 12px; background: var(--gold-soft);
  border-left: 3px solid var(--gold); margin: 0; }
.rev-edit { display: block; width: 100%; resize: vertical; color: var(--text); border-top: 0; border-right: 0; border-bottom: 0; field-sizing: content; min-height: 7.5em; }
.rev-edit:focus { outline: 0; box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 18%, transparent); }
.rev-edit[hidden], .actions[hidden] { display: none; }
.rev-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* Accordions */
.acc { border-top: 1px solid var(--line); }
.acc:first-child { border-top: 0; }
.acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 16px 0; font-weight: 600; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary .hint { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: auto; text-align: right; }
.acc > summary::after { content: ""; width: 8px; height: 8px; border-right: 1.7px solid var(--muted); border-bottom: 1.7px solid var(--muted);
  transform: rotate(45deg) translateY(-3px); transition: transform .2s; flex: none; margin-left: 6px; }
.acc > summary:not(:has(.hint))::after { margin-left: auto; }
.acc[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.acc .acc-body { padding: 0 0 18px; }
.acc.flat { border-top: 1px solid var(--line); margin-top: 18px; }
.acc.flat > summary { font-weight: 500; color: var(--muted); font-size: 14px; padding: 14px 0 0; }
.acc.flat[open] > summary { padding-bottom: 12px; }
.details-card { padding-top: 6px; padding-bottom: 6px; }

.crit { padding: 12px 0; border-top: 1px solid var(--line); }
.crit:first-child { border-top: 0; }
.crit .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crit .name { font-weight: 500; flex: 1; min-width: 140px; }
.crit .pts { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.crit p { margin: 5px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.dim-h { font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--gold); margin: 18px 0 2px; display: flex; justify-content: space-between; }
.dim-h:first-child { margin-top: 0; }

.pantun { font: 400 19px/1.7 var(--serif); }
.pline { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; padding: 3px 0; }
.pline.pembayang .t { color: var(--muted); }
.pline .meta { font: 12px var(--sans); color: var(--muted); white-space: nowrap; }
.pline .meta .warn { color: var(--bad); font-weight: 600; }
.role { font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--gold); margin: 10px 0 0; }
.role:first-child { margin-top: 0; }
.rw { font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.rA { color: var(--r-a); } .rB { color: var(--r-b); } .rC { color: var(--r-c); } .rD { color: var(--r-d); } .rX { color: var(--r-x); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.chip.strong { background: var(--accent-soft); color: var(--accent); }
.chip.gold { background: var(--gold-soft); color: var(--gold); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.checks li { display: grid; grid-template-columns: 20px 1fr; gap: 8px; }
.checks .ok { color: var(--good); font-weight: 700; } .checks .mid { color: var(--ok); font-weight: 700; } .checks .no { color: var(--bad); font-weight: 700; }

/* Additive contribution chart */
.contrib { display: grid; gap: 7px; }
.crow { display: grid; grid-template-columns: minmax(110px, 190px) 1fr 46px; gap: 12px; align-items: center; font-size: 13px; }
.crow .track { position: relative; height: 12px; background: var(--surface-2); border-radius: 4px; }
.crow .mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--faint); }
.crow .fill { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; }
.crow .fill.pos { background: var(--good); } .crow .fill.neg { background: var(--bad); }
.crow .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.crow .v.pos { color: var(--good); } .crow .v.neg { color: var(--bad); }
.crow.off { opacity: .4; }
.basis { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

.error-card { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); color: var(--bad); }

/* Berkait chain */
.stanza { position: relative; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); }
.stanza-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.stanza-h b { color: var(--text); font-weight: 600; }
.stanza-h .ghost { margin-left: auto; padding: 5px 11px; font-size: 13px; }
.stanza .sl { font: 17px/1.65 var(--serif); }
.stanza .sl.inh { color: var(--muted); }
.stanza .sl .tag { font: 600 10px var(--sans); text-transform: uppercase; letter-spacing: .05em; color: var(--gold); margin-left: 8px; }
.link-row { display: flex; gap: 8px; align-items: center; padding: 8px 16px; font-size: 13px; }
.link-row::before { content: ""; width: 2px; height: 18px; border-radius: 1px; background: currentColor; opacity: .5; }
.link-row.ok { color: var(--good); } .link-row.no { color: var(--bad); }

/* ---------- Pembayang ---------- */

.pb-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .pb-inputs { grid-template-columns: 1fr; } }
.field-l { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.line-input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font: 19px/1.4 var(--serif); }
.line-input:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 14%, transparent); }
.pb-row { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; justify-content: space-between; margin-top: 16px; }
.pb-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.pb-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin: 26px 0 14px; }
.pb-summary .kv { font-size: 14px; color: var(--muted); }
.pb-summary .kv b { color: var(--text); }
.seg { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 10px; margin-left: auto; max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
.cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 16px; }
.cand { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.cand-h { display: flex; align-items: center; gap: 10px; }
.rank { font: 600 12px var(--sans); color: var(--muted); }
.src { font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--gold); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src.ai { color: var(--accent); }
.src.ai.lora { color: var(--good); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.compare-col { display: grid; gap: 16px; }
.compare-h { font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.compare-h.lora { color: var(--good); }
.compare-h span { color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }
@media (max-width: 760px) { .compare { grid-template-columns: 1fr; } }
.cand-score { font: 500 30px/1 var(--serif); font-variant-numeric: tabular-nums; }
.cand .pantun { font-size: 18px; }
.cand .maksud-l { color: var(--faint); }
.cand .pb-edit { font-size: 17px; padding: 12px 16px; }
.cand .pb-edit + .muted { margin: -6px 0 0; }
.cand hr { border: 0; border-top: 1px dashed var(--line); margin: 4px 0; }
.minis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mini { font-size: 11.5px; color: var(--muted); }
.mini .meter { margin-top: 5px; height: 4px; }
.cand .chips { margin-top: 0; }
.cand .acc { border-top: 1px solid var(--line); }
.cand .acc > summary { padding: 12px 0 0; font-weight: 500; font-size: 13px; color: var(--muted); }
.cand .acc[open] > summary { padding-bottom: 12px; }
.cand .actions { margin-top: auto; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* ---------- Batch ---------- */
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; border: 1.5px dashed var(--line); border-radius: 14px;
  cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--gold); background: var(--gold-soft); }
.drop svg { width: 26px; height: 26px; color: var(--gold); margin-bottom: 4px; }
.drop small { color: var(--muted); font-size: 12.5px; }
.batch-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1000px) { .batch-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.batch-input .area { min-height: 220px; }
.fmt-link { all: unset; color: var(--gold); text-decoration: underline; cursor: pointer; }
.formats { scroll-margin-top: 140px; }
.formats .sec { margin-bottom: 4px; }
.fmt-lede { margin: 0 0 6px; }
.fmt-item { padding: 16px 0 0; }
.fmt-item + .fmt-item { margin-top: 16px; border-top: 1px solid var(--line); }
.fmt-h { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; margin-bottom: 10px; }
.fmt-h b { font-size: 14.5px; }
.fmt-h p { margin: 2px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.fmt-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 600 13px var(--sans); background: var(--gold-soft); color: var(--gold); }
.dl { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
  color: var(--accent-ink); background: var(--accent); transition: filter .15s; }
.dl:hover { filter: brightness(1.08); }
.dl svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.xl-sheet { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.xl-sheet table { font-size: 12.5px; }
.xl-sheet table.wide { table-layout: fixed; min-width: 420px; }
.xl-sheet table.wide .rn { width: 26px; }
.xl-sheet table.wide td:not(.rn) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xl-sheet th, .xl-sheet td { padding: 5px 9px; border: 1px solid var(--line); vertical-align: top; }
.xl-sheet th { background: var(--surface-2); text-align: center; font-size: 11px; padding: 3px 9px; }
.xl-sheet th:first-child, .xl-sheet td:first-child { padding-left: 9px; }
.xl-sheet tr > :first-child { border-left: 0; } .xl-sheet tr > :last-child { border-right: 0; }
.xl-sheet thead th { border-top: 0; } .xl-sheet tbody tr:last-child td { border-bottom: 0; }
.xl-sheet .rn { width: 26px; text-align: center; color: var(--faint); background: var(--surface-2); font-size: 11px; }
.xl-sheet .hdr td:not(.rn) { font-weight: 600; background: var(--gold-soft); }
.xl-sheet td:not(.rn) { font-family: var(--serif); font-size: 13.5px; line-height: 1.45; }
.xl-sheet .gap td { height: 22px; background: color-mix(in srgb, var(--gold-soft) 45%, transparent); }
.xl-sheet .more td { color: var(--faint); padding-top: 0; padding-bottom: 2px; }
.fmt-tip { margin: 10px 0 0; }
.fmt-tip kbd { font: 500 11.5px var(--sans); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.area { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font: 16px/1.6 var(--serif); resize: vertical; }
.area:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 14%, transparent); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 14px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat b { display: block; font: 500 26px/1.1 var(--serif); margin-top: 4px; }
.dist { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin: 4px 0 8px; }
.dist-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.table-wrap { overflow-x: auto; margin: 0 -22px -22px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; border-top: 0; }
th:first-child, td:first-child { padding-left: 22px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.first { font-family: var(--serif); font-size: 15px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.score-pill { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 10px; border-radius: 999px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); white-space: nowrap; }
.score-pill small { font-weight: 500; font-size: 11.5px; }

/* ---------- Sheets ---------- */
dialog.sheet { position: fixed; inset: 0 0 0 auto; margin: 0; height: 100%; max-height: 100%; width: min(440px, 100%); max-width: 100%;
  border: 0; padding: 0; background: var(--surface); color: var(--text); box-shadow: -20px 0 60px -20px rgb(0 0 0 / .35); display: none; flex-direction: column; }
dialog.sheet.wide { width: min(760px, 100%); }
dialog.sheet[open] { display: flex; animation: slide .28s cubic-bezier(.2, .8, .2, 1); }
dialog.sheet::backdrop { background: rgb(20 14 10 / .35); backdrop-filter: blur(2px); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.sheet > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 14px 24px; border-bottom: 1px solid var(--line); }
.sheet > header h2 { font: 500 21px/1.2 var(--serif); margin: 0; }
.sheet-body { padding: 20px 24px 40px; overflow-y: auto; flex: 1; }
.set { display: grid; gap: 14px; padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.set:last-child { border-bottom: 0; }
.set h3 { margin: 0; font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.set p { margin: 0; }
.set .ghost { justify-self: start; }
.sliders { display: grid; gap: 12px 24px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.sheet .sliders { grid-template-columns: 1fr; }
.sl-group { grid-column: 1 / -1; font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--gold); margin-top: 6px; }
.slider { display: grid; grid-template-columns: 1fr 44px; gap: 4px 10px; align-items: center; font-size: 13.5px; }
.slider input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); margin: 0; }
.slider .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.h-item { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px; margin: 0 -12px; border-radius: 12px; cursor: pointer; }
.h-item:hover { background: var(--surface-2); }
.h-item .t { font: 16px/1.4 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-item .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.h-item .icon { width: 30px; height: 30px; }
.h-item .icon svg { width: 16px; height: 16px; }

.prose { font-size: 14.5px; line-height: 1.65; }
.prose h3 { font: 500 18px/1.3 var(--serif); margin: 28px 0 10px; }
.prose h3:first-child { margin-top: 0; }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 12px; padding-left: 20px; }
.rub-dim { margin: 18px 0 8px; font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--gold); display: flex; justify-content: space-between; }
.rub { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.rub-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rub-h b { flex: 1; font-weight: 600; }
.rub-h .w { font-variant-numeric: tabular-nums; font-weight: 600; }
.rub-h .w small { color: var(--muted); font-weight: 500; }
.rub-lv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.rub-lv div > span { display: block; margin-bottom: 4px; }
@media (max-width: 560px) { .rub-lv { grid-template-columns: 1fr; } }
.band-row { display: flex; flex-wrap: wrap; gap: 8px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Rhyme-scheme hints */
.scheme, .scheme-h { cursor: help; border-bottom: 1px dotted currentColor; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.scheme.ok { color: var(--good); }
.scheme.off { color: var(--ok); }
.scheme:focus-visible, .scheme-h:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 3px; }
.tip { position: fixed; z-index: 100; max-width: min(340px, calc(100vw - 16px)); padding: 10px 12px; border-radius: 10px; pointer-events: none;
  background: var(--text); color: var(--bg); font: 13px/1.5 var(--sans); white-space: pre-line; text-transform: none; letter-spacing: 0; font-weight: 400;
  box-shadow: var(--shadow); opacity: 0; transition: opacity .12s; left: -999px; top: 0; }
.tip.on { opacity: 1; }

/* Sortable batch table */
th.sort button { all: unset; cursor: pointer; display: inline-flex; white-space: nowrap; align-items: center; gap: 4px; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; }
th.sort button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 3px; }
th.sort .arr { font-size: 11px; opacity: .45; }
th.sort.on { color: var(--text); }
th.sort.on .arr { opacity: 1; color: var(--gold); }
th.sort:hover .arr { opacity: .9; }
th.num.sort button { justify-content: flex-end; }


/* ---------- User study (#kajian), result ratings, results (#keputusan) ---------- */
.study { max-width: 720px; margin: 0 auto; }
.study-progress { margin: 0 0 18px; }
.study-card { padding: 30px 32px; }
@media (max-width: 560px) { .study-card { padding: 22px 16px; } }
.study-card.narrow { max-width: 440px; margin: 0 auto; }
.study-card .lede { margin-bottom: 18px; }
.study-card .note { padding: 10px 14px; border-radius: 10px; background: var(--gold-soft); font-size: 14px; margin: 14px 0; }
.study-card .warn-note { background: color-mix(in srgb, var(--bad) 10%, transparent); color: var(--bad); }
.label-sm { font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--gold); margin-bottom: 8px; }
.study-facts { margin: 0 0 8px; padding-left: 20px; color: var(--muted); }
.study-facts li + li { margin-top: 4px; }
.q { margin-top: 24px; }
.q-h { font-weight: 600; margin-bottom: 10px; display: flex; gap: 10px; align-items: baseline; }
.q-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font: 600 12px var(--sans); background: var(--gold-soft); color: var(--gold); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { display: inline-block; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 10px; font-size: 14px; transition: background .15s, border-color .15s; }
.opt:hover span { border-color: var(--gold); }
.opt input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.opt input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.opts.scale { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.opts.scale .opt span { display: block; text-align: center; padding: 10px 0; }
.scale-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.area.plain { font: 15px/1.5 var(--sans); padding: 10px 12px; }
select.full { width: 100%; padding: 10px 12px; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 24px; font-size: 14px; cursor: pointer; }
.consent input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.form-err { color: var(--bad); font-size: 14px; margin: 14px 0 0; }
a.primary { text-decoration: none; }

.study-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 2px solid var(--accent); box-shadow: 0 -8px 24px -12px rgb(0 0 0 / .25); }
.sb-in { max-width: 1240px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 18px; }
.sb-t { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.sb-n { font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--accent); }
.sb-goal { flex-basis: 100%; font-size: 13.5px; color: var(--muted); }
.sb-time { font: 500 20px var(--serif); font-variant-numeric: tabular-nums; }
.sb-act { display: flex; gap: 8px; }
body.studying main { padding-bottom: 150px; }
@media (max-width: 640px) {
  .sb-in { padding: 10px 16px; flex-wrap: wrap; gap: 8px 12px; }
  .sb-t { flex-basis: 100%; }
  .sb-goal { font-size: 12.5px; }
  .sb-act { margin-left: auto; }
}

.fb-lede { margin: -6px 0 14px; }
.fb-verdict { display: flex; gap: 8px; }
.fb-verdict button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fb-more { margin-top: 16px; }
.fb-rows { margin: 10px 0 14px; border-top: 1px solid var(--line); }
.fb-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.fb-row .code, .ag-row .code, .quotes .code { font: 600 12px var(--sans); color: var(--muted); }
.fb-tg { display: inline-flex; gap: 4px; }
.fb-tg button { width: 34px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14px; color: var(--muted); }
.fb-tg button[data-v="setuju"][aria-pressed="true"] { background: var(--good); border-color: var(--good); color: #fff; }
.fb-tg button[data-v="tidak"][aria-pressed="true"] { background: var(--bad); border-color: var(--bad); color: #fff; }
.fb-thanks { margin: 0; color: var(--good); font-weight: 500; }
.fb-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }

.results { max-width: 1000px; margin: 0 auto; }
.res-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
.res-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 24px; }
.share { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.share code { font-size: 14px; padding: 8px 12px; overflow-wrap: anywhere; }
.key-form { display: flex; gap: 10px; }
.agree { border-top: 1px solid var(--line); margin-top: 10px; }
.ag-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(80px, 160px) 90px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ag-row .num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .ag-row { grid-template-columns: 30px minmax(0, 1fr) 80px; } .ag-row .ag-m { display: none; } }
.quotes { list-style: none; margin: 0; padding: 0; }
.quotes li { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.q-src { flex-basis: 100%; }
.iv + .iv { margin-top: 18px; }
.ok-t { color: var(--good); font-weight: 600; } .bad-t { color: var(--bad); font-weight: 600; }
.table-wrap + .sub-h { margin-top: 34px; }
.fb-fix { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.fb-fix .chip-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ag-dir { grid-column: 2 / -1; font-size: 12.5px; color: var(--ok); margin-top: -4px; }

/* ---------- Formative feedback (Nilai) ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.pill b { color: var(--text); font-weight: 600; }
.g-row .syl.warn::after { content: "!"; margin-left: 1px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.privacy { margin: 14px 0 0; max-width: 62ch; }

.mode-tg { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 999px; margin-right: 6px; }
.mode-tg button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; }
.mode-tg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
body.pupil [data-teacher], body.pupil #ai-reply { display: none !important; }
.size-seg { margin: 0 0 10px; }
html[data-size="1"] main, html[data-size="1"] .sheet-body { zoom: 1.12; }
html[data-size="2"] main, html[data-size="2"] .sheet-body { zoom: 1.25; }

.draft-bar { border: 1px solid var(--gold); background: var(--gold-soft); border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; }
.draft-bar .db-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 14px; }
.draft-bar .db-h span { flex: 1; color: var(--muted); }
.draft-bar .area { background: var(--surface); }

.fcard .f-top { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.fcard .f-top > div:first-child { flex: 1; min-width: 200px; }
.f-tools { display: flex; align-items: center; gap: 12px; }
.f-sum { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }
.fpantun { margin: 14px 0 6px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); font: 17px/1.5 var(--serif); }
.fl { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: baseline; padding: 4px 6px; margin: 0 -6px; border-radius: 8px; transition: background .15s; }
.fl.hl { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold); }
.fl-n { font: 600 12px var(--sans); color: var(--faint); font-variant-numeric: tabular-nums; text-align: right; }
.fl-tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.fl-tag { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 1px 8px; font: 500 11.5px var(--sans); color: var(--ok); cursor: pointer; }
.f-note { font-size: 13px; color: var(--muted); margin: 10px 0 16px; }
.t-comment { border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; margin: 6px 0 14px; }
.t-comment p { margin: 2px 0 0; }
.t-comment-edit { margin-top: 16px; }

.aspects { display: grid; gap: 10px; }
.aspect { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--surface); scroll-margin: 90px; }
.aspect.semak { border-left: 4px solid var(--ok); }
.aspect.baik { border-left: 4px solid var(--good); }
.aspect.tidak_dinilai, .aspect.pending { border-left: 4px solid var(--line); }
.aspect.rejected { opacity: .6; border-style: dashed; }
.aspect:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.a-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.a-h h3 { font: 600 15px var(--sans); margin: 0; flex: 1; min-width: 150px; }
.a-st { font: 600 12px var(--sans); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.a-st.baik { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.a-st.semak { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.a-st.tidak_dinilai, .a-st.wait { background: var(--surface-2); color: var(--muted); }
.a-lines { font: 600 12px var(--sans); color: var(--text); background: var(--gold-soft); padding: 2px 8px; border-radius: 6px; }
.a-nat { font-size: 12px; color: var(--muted); }
.a-p { margin: 10px 0 0; line-height: 1.6; }
.a-cert { font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: 6px; }
.hint { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.hint p { margin: 2px 0 0; }
.hint-l { font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--gold); }
.sounds { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 13px; color: var(--muted); }
.rv { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.rv-l { font-size: 12px; color: var(--muted); margin-right: 4px; }
.rv .chip-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.rv-edit { display: grid; gap: 10px; margin-top: 10px; }
.rv-note { margin: 8px 0 0; font-size: 13px; color: var(--bad); }
.rv-ok { margin: 8px 0 0; font-size: 12px; color: var(--good); font-weight: 600; }
.rv-ok::before { content: "✓ "; }
.a-more { margin-top: 10px; font-size: 13px; }
.a-more summary { cursor: pointer; color: var(--muted); }
.a-more p { margin: 6px 0 0; color: var(--muted); }

.drows { display: grid; gap: 4px; font: 16px/1.5 var(--serif); }
.dr { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: baseline; padding: 4px 6px; border-radius: 8px; }
.dr.changed { background: var(--surface-2); }
.dr del { display: block; color: var(--faint); font-size: 14px; }
.dr mark { background: var(--gold-soft); color: inherit; border-bottom: 2px solid var(--gold); }
.dr-tag { font: 600 11px var(--sans); color: var(--gold); }
.moved { margin: 0; padding-left: 18px; }
.refl { margin: 0; padding: 8px 12px; border-left: 3px solid var(--gold); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.teacher-sec { border-style: dashed; }
.issues-sum { margin-bottom: 6px; }
.print-only { display: none; }

@media print {
  .bar, .composer, .credit, .study-bar, .think-card, .next-card, .teacher-sec, #fb-slot, .rv, .rv-edit, .a-more, .f-tools,
  .fl-tags, .t-comment-edit, .aspect.rejected, dialog { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  main { padding: 0; max-width: none; }
  .workspace { display: block !important; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .aspect { break-inside: avoid; border: 1px solid #999; }
  .print-only { display: block; }
  .print-only .rule { border-bottom: 1px solid #999; height: 30px; }
}
