/* RT-CHN-109 — Zhuyin Keyboard Decoder.
 * Light surfaces throughout: --rt-ink / --rt-ink-soft on --rt-surface; the
 * chosen candidate is marked with --rt-accent. No navy result box, so no
 * --rt-result-* tokens (docs/contrast-conventions.md). */

.zk-form { display: flex; flex-direction: column; gap: var(--rt-s-4); min-width: 0; }
.zk-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.zk-label { font-family: var(--rt-font-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; color: var(--rt-ink-muted); }
.zk-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-family: var(--rt-font-mono); font-size: 18px; line-height: 1.5;
}
.zk-input-line { font-family: inherit; font-size: 20px; }
.zk-input:focus, .zk-select:focus { outline: none; border-color: var(--rt-accent); box-shadow: 0 0 0 3px var(--rt-accent-soft); }
.zk-samples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.zk-samples-label { font-size: 11px; color: var(--rt-ink-soft); margin-right: 2px; }
.zk-chip {
    padding: 5px 11px; border-radius: var(--rt-r-chip); cursor: pointer; font-family: var(--rt-font-mono);
    border: 1px solid var(--rt-hairline); background: var(--rt-surface-2); color: var(--rt-ink); font-size: 13px;
}
.zk-chip:hover { border-color: var(--rt-accent); background: var(--rt-surface); }

.zk-opts { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.zk-opt { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.zk-select { padding: 8px 10px; border: 1px solid var(--rt-hairline); border-radius: var(--rt-r-button); background: var(--rt-surface); color: var(--rt-ink); font-size: 15px; }

.zk-out { min-width: 0; }
/* CLS floor for the default text (six syllables: the guess and six cards). */
.zk-out.zk-reserve { min-height: 420px; }
.zk-result { display: flex; flex-direction: column; gap: var(--rt-s-3); min-width: 0; }
.zk-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 14px; border: 1px solid var(--rt-hairline); border-radius: var(--rt-r-card); background: var(--rt-surface); box-shadow: inset 3px 0 0 var(--rt-accent); }
.zk-top-label { width: 100%; font-family: var(--rt-font-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; color: var(--rt-ink-muted); }
.zk-guess { margin: 0; flex: 1 1 auto; min-width: 0; font-size: 28px; line-height: 1.35; color: var(--rt-ink); overflow-wrap: anywhere; }
.zk-copy { padding: 4px 12px; border-radius: var(--rt-r-chip); cursor: pointer; font-size: 13px; border: 1px solid var(--rt-hairline); background: var(--rt-surface-2); color: var(--rt-ink); }
.zk-copy:hover { border-color: var(--rt-accent); }
.zk-layout { margin: 0; font-size: 12.5px; color: var(--rt-ink-soft); }
.zk-sub { margin: var(--rt-s-2) 0 0; font-family: var(--rt-font-mono); font-size: 11px; letter-spacing: .03em; text-transform: uppercase; font-weight: 600; color: var(--rt-ink-muted); }
.zk-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--rt-ink-soft); }

.zk-syls { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; min-width: 0; }
.zk-syl { padding: 10px 12px; border: 1px solid var(--rt-hairline); border-radius: var(--rt-r-card); background: var(--rt-surface); min-width: 0; }
.zk-syl-bad { background: var(--rt-surface-2); }
.zk-syl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.zk-syl-zy { font-size: 22px; color: var(--rt-ink); }
.zk-syl-py { font-size: 14px; color: var(--rt-ink-soft); }
.zk-syl-keys { margin-left: auto; font-family: var(--rt-font-mono); font-size: 12px; color: var(--rt-ink-soft); }
.zk-syl-why { margin: 0 0 4px; font-size: 12.5px; line-height: 1.45; color: var(--rt-ink-soft); }
.zk-cands { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.zk-cand { min-width: 34px; padding: 3px 6px; font-size: 20px; line-height: 1.3; cursor: pointer; border: 1px solid var(--rt-hairline); border-radius: 6px; background: var(--rt-surface); color: var(--rt-ink); }
.zk-cand:hover { border-color: var(--rt-accent); }
.zk-cand.is-on { border-color: var(--rt-accent); background: var(--rt-accent-soft); box-shadow: inset 0 0 0 1px var(--rt-accent); }
.zk-cand-sep { color: var(--rt-ink-soft); padding: 0 2px; cursor: help; }
.zk-more { padding: 3px 8px; font-size: 12.5px; cursor: pointer; border: 1px dashed var(--rt-hairline); border-radius: 6px; background: none; color: var(--rt-ink-soft); }

.zk-encode { border: 1px solid var(--rt-hairline); border-radius: var(--rt-r-card); padding: 10px 14px; background: var(--rt-surface); }
.zk-encode summary { cursor: pointer; font-size: 14px; color: var(--rt-ink); }
.zk-encode[open] summary { margin-bottom: 10px; }
.zk-encode-out { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.zk-enc-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.zk-enc-keys { font-family: var(--rt-font-mono); font-size: 20px; color: var(--rt-ink); overflow-wrap: anywhere; }

.zk-ack { font-size: 11.5px; color: var(--rt-ink-soft); line-height: 1.6; margin: 0; }
.zk-ack a { color: inherit; }

@media (max-width: 480px) {
    .zk-syls { grid-template-columns: 1fr; }
    .zk-guess { font-size: 24px; }
}
