/* RT-TXT-062 — Korean Romanization Converter.
 * Colour rule (docs/contrast-conventions.md): values inside the navy
 * --rt-result-bg box use --rt-result-ink, labels --rt-result-muted; everything
 * on the light surfaces uses --rt-ink / --rt-ink-soft. Nothing crosses over.
 * Spacing tokens are a 4px scale: --rt-s-3 is 12px, --rt-s-4 is 16px. */

.kr-form { display: flex; flex-direction: column; gap: var(--rt-s-4); min-width: 0; }
.kr-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kr-label { font-family: var(--rt-font-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; color: var(--rt-ink-muted); }
.kr-hint { margin: 0; font-size: 12px; line-height: 1.55; color: var(--rt-ink-soft); }
.kr-muted { color: var(--rt-ink-soft); }

.kr-input {
    width: 100%; box-sizing: border-box; resize: vertical;
    padding: 10px 14px; border: 1px solid var(--rt-hairline); border-radius: var(--rt-r-button);
    background: var(--rt-surface); color: var(--rt-ink);
    font-size: 20px; line-height: 1.5;
}
.kr-input-line { resize: none; font-size: 18px; }
.kr-input:focus { outline: none; border-color: var(--rt-accent); box-shadow: 0 0 0 3px var(--rt-accent-soft); }

.kr-samples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kr-samples-label { font-size: 11px; color: var(--rt-ink-soft); margin-right: 2px; }
.kr-chip {
    padding: 5px 11px; border-radius: var(--rt-r-chip); cursor: pointer;
    border: 1px solid var(--rt-hairline); background: var(--rt-surface-2);
    color: var(--rt-ink); font-size: 13px;
    transition: border-color 140ms ease, background 140ms ease;
}
.kr-chip:hover { border-color: var(--rt-accent); background: var(--rt-surface); }

.kr-options { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.kr-check { font-size: 13px; color: var(--rt-ink); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

/* ── result table (navy) ─────────────────────────────────────────────────── */
.kr-result { background: var(--rt-result-bg); border-radius: var(--rt-r-card); padding: var(--rt-s-3) var(--rt-s-4); min-width: 0; }
.kr-table { width: 100%; border-collapse: collapse; }
.kr-table th, .kr-table td { padding: 9px 6px; border-bottom: 1px solid rgba(246, 244, 239, .12); vertical-align: middle; text-align: left; }
.kr-table tr:last-child th, .kr-table tr:last-child td { border-bottom: 0; }
.kr-table th { width: 42%; font-weight: 400; }
.kr-sys-name { display: block; font-size: 13.5px; font-weight: 600; color: var(--rt-result-ink); }
.kr-sys-basis { display: block; font-size: 11px; line-height: 1.4; color: var(--rt-result-muted); }
.kr-out {
    display: inline-block; font-family: var(--rt-font-mono); font-size: 18px; line-height: 1.35;
    color: var(--rt-result-ink); background: none; overflow-wrap: anywhere; cursor: pointer; border-radius: 6px; padding: 1px 4px;
}
.kr-out:hover, .kr-out:focus { outline: none; box-shadow: 0 0 0 2px rgba(246, 244, 239, .28); }
.kr-out[data-copied]::after { content: ' ✓'; font-family: var(--rt-font-sans); font-size: 12px; color: var(--rt-result-muted); }

@media (max-width: 560px) {
    .kr-table th, .kr-table td { display: block; width: auto; border-bottom: 0; }
    .kr-table td { padding-top: 0; border-bottom: 1px solid rgba(246, 244, 239, .12); }
    .kr-table tr:last-child td { border-bottom: 0; }
}

/* ── notes (light) ───────────────────────────────────────────────────────── */
.kr-notes { display: flex; flex-direction: column; gap: 8px; }
.kr-notes:empty { display: none; }
.kr-note { margin: 0; padding: 9px 12px; border-radius: 8px; font-size: 13px; line-height: 1.55; color: var(--rt-ink); background: var(--rt-surface-2); border-left: 3px solid var(--rt-hairline); }
.kr-note-alt { border-left-color: var(--rt-accent); }
.kr-note-warn { border-left-color: var(--rt-accent); }
.kr-alt-codes code { font-family: var(--rt-font-mono); font-size: 13px; color: var(--rt-ink); background: none; padding: 0; }

/* ── names ───────────────────────────────────────────────────────────────── */
.kr-panel { border: 1px solid var(--rt-hairline); border-radius: var(--rt-r-card); background: var(--rt-surface); min-width: 0; }
.kr-panel-head { padding: var(--rt-s-3) var(--rt-s-4); border-bottom: 1px solid var(--rt-hairline); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.kr-panel-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--rt-ink); }
.kr-panel-note { font-size: 12.5px; color: var(--rt-ink-soft); }
.kr-panel-body { padding: var(--rt-s-4); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kr-name-fields { display: grid; grid-template-columns: 140px 1fr; gap: var(--rt-s-3); }
@media (max-width: 480px) { .kr-name-fields { grid-template-columns: 1fr; } }
.kr-name-out { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.kr-name-out div { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.kr-name-out dt { font-size: 12px; color: var(--rt-ink-soft); min-width: 190px; }
.kr-name-out dd { margin: 0; font-size: 15px; color: var(--rt-ink); }
.kr-name-out code { font-family: var(--rt-font-mono); font-size: 15px; color: var(--rt-ink); background: none; padding: 0; }

.kr-stamp { font-size: 11.5px; color: var(--rt-ink-soft); line-height: 1.6; margin: 0; }

/* CLS floors (docs/cls-conventions.md rule 1). app.js fills the rows and the
   notes after first paint. MEASURED 2026-09-27 on the default input
   ("종로 신라 독립문"): notes 58px at 1280 and 768, 99px at 375; the result box
   grows 434 → 459px at 375 when a row wraps (no change at desktop widths).
   The notes floor is released on the first edit, a user-initiated shift. */
.kr-notes.kr-reserve { min-height: 58px; }
@media (max-width: 560px) {
    .kr-notes.kr-reserve { min-height: 99px; }
    .kr-result { min-height: 459px; box-sizing: border-box; }
}
