/* RT-TXT-064 — Hanja ↔ Hangul Converter.
 * Light surfaces throughout: --rt-ink / --rt-ink-soft on --rt-surface, choices
 * marked in --rt-accent. No navy result box on this page, so no --rt-result-*
 * tokens (docs/contrast-conventions.md).
 * Spacing tokens are a 4px scale: --rt-s-3 is 12px, --rt-s-4 is 16px. */

.hh-form { display: flex; flex-direction: column; gap: var(--rt-s-4); min-width: 0; }
.hh-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hh-label { font-family: var(--rt-font-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; color: var(--rt-ink-muted); }
.hh-input {
    width: 100%; box-sizing: border-box; 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: 24px; line-height: 1.4;
}
.hh-input:focus { outline: none; border-color: var(--rt-accent); box-shadow: 0 0 0 3px var(--rt-accent-soft); }
.hh-hint { margin: 0; font-size: 12px; line-height: 1.55; color: var(--rt-ink-soft); }
.hh-samples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hh-samples-label { font-size: 11px; color: var(--rt-ink-soft); margin-right: 2px; }
.hh-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: 14px;
    transition: border-color 140ms ease, background 140ms ease;
}
.hh-chip:hover { border-color: var(--rt-accent); background: var(--rt-surface); }

.hh-out { min-width: 0; }
.hh-loading, .hh-empty { margin: 0; font-size: 14px; color: var(--rt-ink-soft); }

/* ── Hanja → Hangul ─────────────────────────────────────────────────────── */
.hh-reading { display: flex; flex-direction: column; gap: var(--rt-s-3); min-width: 0; }
.hh-cells { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; }
.hh-cell {
    display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 56px;
    padding: 8px 6px 6px; border: 1px solid var(--rt-hairline); border-radius: 10px; background: var(--rt-surface);
}
.hh-cell.is-ambiguous { border-color: var(--rt-accent); border-style: dashed; }
.hh-cell.is-unknown { background: var(--rt-surface-2); }
.hh-cell-plain { justify-content: center; font-size: 22px; color: var(--rt-ink); }
.hh-gap { width: 14px; }
.hh-cell-han { font-size: 30px; line-height: 1.1; color: var(--rt-ink); }
.hh-cell-hangul { font-size: 22px; line-height: 1.3; font-weight: 600; color: var(--rt-ink); }
/* Specific on purpose: the site bundle gives every select max-width: 100%,
   which beats a bare class and stretched the cell to the longest option. */
.hh-cells .hh-cell select.hh-sel {
    width: auto; max-width: 128px; font-size: 18px; font-weight: 600; padding: 2px 4px;
    border: 1px solid var(--rt-hairline); border-radius: 6px; background: var(--rt-surface); color: var(--rt-ink);
}
.hh-rule { font-size: 10.5px; line-height: 1.25; text-align: center; max-width: 92px; color: var(--rt-ink-soft); }

.hh-lines { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.hh-line { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.hh-line dt { min-width: 150px; font-size: 12px; font-family: var(--rt-font-mono); letter-spacing: .03em; text-transform: uppercase; color: var(--rt-ink-muted); }
.hh-line dd { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; min-width: 0; }
.hh-out-text { font-size: 20px; color: var(--rt-ink); background: none; padding: 0; word-break: break-all; }
.hh-copy, .hh-more-btn {
    font-size: 12px; padding: 3px 10px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--rt-hairline); background: var(--rt-surface-2); color: var(--rt-ink);
}
.hh-copy:hover, .hh-more-btn:hover { border-color: var(--rt-accent); }
.hh-more { font-size: 12px; color: var(--rt-ink-soft); }

.hh-notes { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.hh-note { margin: 0; font-size: 13px; line-height: 1.55; color: var(--rt-ink-soft); }
.hh-note-table { padding: 8px 12px; border-left: 3px solid var(--rt-accent); background: var(--rt-surface-2); border-radius: 0 8px 8px 0; color: var(--rt-ink); }

.hh-detail-wrap { overflow-x: auto; border: 1px solid var(--rt-hairline); border-radius: var(--rt-r-card); }
.hh-detail { width: 100%; border-collapse: collapse; font-size: 13px; }
.hh-detail th { text-align: left; font-weight: 600; font-size: 11px; font-family: var(--rt-font-mono); text-transform: uppercase; letter-spacing: .03em; color: var(--rt-ink-muted); padding: 8px 10px; border-bottom: 1px solid var(--rt-hairline); }
.hh-detail td { padding: 8px 10px; vertical-align: top; border-bottom: 1px solid var(--rt-hairline); color: var(--rt-ink); }
.hh-detail tr:last-child td { border-bottom: 0; }
.hh-d-char { white-space: nowrap; }
.hh-d-glyph { display: block; font-size: 30px; line-height: 1.1; }
.hh-d-meta { display: block; font-size: 11px; color: var(--rt-ink-soft); }
.hh-d-reading { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-bottom: 4px; }
.hh-d-syl { font-size: 17px; font-weight: 600; }
.hh-d-via { font-size: 11px; color: var(--rt-ink-soft); }
.hh-d-def { min-width: 160px; line-height: 1.5; }
.hh-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.hh-tag { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--rt-hairline); color: var(--rt-ink); }
.hh-tag-edu, .hh-tag-name { border-color: var(--rt-accent); }
.hh-status { display: block; font-size: 12.5px; line-height: 1.4; }
.hh-status-edu, .hh-status-name, .hh-status-edu-form { font-weight: 600; }
.hh-status-unknown, .hh-status-variant { color: var(--rt-ink-soft); }

/* ── Hangul → Hanja ─────────────────────────────────────────────────────── */
.hh-search { display: flex; flex-direction: column; gap: var(--rt-s-3); min-width: 0; }
.hh-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.hh-tab { font-size: 22px; min-width: 48px; padding: 2px 12px; border-radius: 8px; border: 1px solid var(--rt-hairline); background: var(--rt-surface); color: var(--rt-ink); cursor: pointer; }
.hh-tab.is-on { border-color: var(--rt-accent); box-shadow: inset 0 0 0 1px var(--rt-accent); }
.hh-search-head { display: flex; gap: 12px; align-items: baseline; }
.hh-search-syl { font-size: 40px; line-height: 1; color: var(--rt-ink); }
.hh-search-count { font-size: 14px; color: var(--rt-ink-soft); }
.hh-group { display: flex; flex-direction: column; gap: 6px; }
.hh-group-title { margin: 6px 0 0; font-size: 15px; font-weight: 600; color: var(--rt-ink); }
.hh-group-count { font-weight: 400; font-size: 13px; color: var(--rt-ink-soft); }
.hh-group-note { margin: 0; font-size: 12px; color: var(--rt-ink-soft); }
.hh-hits { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 6px; }
.hh-hit {
    display: flex; gap: 8px; align-items: center; text-align: left; min-width: 0;
    padding: 6px 8px; border-radius: 8px; border: 1px solid var(--rt-hairline); background: var(--rt-surface); color: var(--rt-ink); cursor: pointer;
}
.hh-hit:hover { border-color: var(--rt-accent); }
.hh-hit-char { font-size: 26px; line-height: 1; flex: none; }
.hh-hit-meta { display: flex; flex-direction: column; min-width: 0; }
.hh-hit-via { font-size: 10.5px; color: var(--rt-ink-soft); }
.hh-hit-def { font-size: 12px; line-height: 1.35; color: var(--rt-ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hh-hits .hh-more-btn { justify-self: start; align-self: center; }

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

@media (max-width: 480px) {
    .hh-line dt { min-width: 0; width: 100%; }
    .hh-cell { min-width: 48px; }
    .hh-cell-han { font-size: 26px; }
    .hh-hits { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
}

/* CLS floor for the default input (大韓民國), whose result app.js renders after
   the data file arrives. MEASURED 2026-09-29 through the real Blade render:
   480px at 1280, 501px at 768, 710px at 375 (the details table wraps). Each
   floor sits just under its measurement, and all are released on the first
   edit, a user-initiated shift. */
.hh-out.hh-reserve { min-height: 476px; }
@media (max-width: 900px) { .hh-out.hh-reserve { min-height: 498px; } }
@media (max-width: 480px) { .hh-out.hh-reserve { min-height: 706px; } }
