/* RT-DEV-098 — Japanese Encoding Lookup & Mojibake Fixer.
 * 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. */

.jenc-form { display: flex; flex-direction: column; gap: var(--rt-s-4); min-width: 0; }

.jenc-panel { border: 1px solid var(--rt-hairline); border-radius: var(--rt-r-card); background: var(--rt-surface); min-width: 0; }
.jenc-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; }
.jenc-panel-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--rt-ink); }
.jenc-panel-note { font-size: 12.5px; color: var(--rt-ink-soft); }
.jenc-panel-body { padding: var(--rt-s-4); display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.jenc-label { font-family: var(--rt-font-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; color: var(--rt-ink-muted); }
.jenc-muted { margin: 0; color: var(--rt-ink-soft); font-size: 13px; }

.jenc-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: 17px; line-height: 1.5;
}
.jenc-input-line { font-size: 20px; }
.jenc-input:focus { outline: none; border-color: var(--rt-accent); box-shadow: 0 0 0 3px var(--rt-accent-soft); }

.jenc-samples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.jenc-samples-label { font-size: 11px; color: var(--rt-ink-soft); margin-right: 2px; }
.jenc-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: 12.5px;
    transition: border-color 140ms ease, background 140ms ease;
}
.jenc-chip:hover { border-color: var(--rt-accent); background: var(--rt-surface); }

/* ── repair result (navy) ────────────────────────────────────────────────
   The floor holds the empty state, so a first paste grows the box instead of
   inserting one (docs/cls-conventions.md rule 1). */
.jenc-repair { background: var(--rt-result-bg); border-radius: var(--rt-r-card); padding: var(--rt-s-3) var(--rt-s-4); min-height: 120px; box-sizing: border-box; min-width: 0; }
.jenc-repair .jenc-muted, .jenc-verdict { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--rt-result-muted); }
.jenc-cands { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.jenc-cand { padding: 8px 10px; border-radius: 8px; border-left: 3px solid rgba(246, 244, 239, .2); background: rgba(246, 244, 239, .05); }
.jenc-cand-top { border-left-color: var(--rt-accent); }
.jenc-cand-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
.jenc-cand-path { font-size: 12px; font-weight: 600; color: var(--rt-result-muted); }
.jenc-cand-loss { font-size: 11.5px; color: var(--rt-result-muted); }
.jenc-cand-text {
    margin: 4px 0 0; font-size: 19px; line-height: 1.45; color: var(--rt-result-ink);
    overflow-wrap: anywhere; cursor: pointer; border-radius: 6px; padding: 1px 4px;
}
.jenc-cand-text:hover, .jenc-cand-text:focus { outline: none; box-shadow: 0 0 0 2px rgba(246, 244, 239, .28); }
.jenc-cand-text[data-copied]::after { content: ' ✓ copied'; font-size: 12px; color: var(--rt-result-muted); }
.jenc-lossnote { margin: 10px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--rt-result-muted); }

/* ── lookup table (light) ────────────────────────────────────────────────── */
.jenc-scroll { overflow-x: auto; min-width: 0; -webkit-overflow-scrolling: touch; }
.jenc-table { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--rt-ink); }
.jenc-table th, .jenc-table td { padding: 7px 8px; border-bottom: 1px solid var(--rt-hairline); text-align: left; vertical-align: top; white-space: nowrap; }
.jenc-table thead th { font-family: var(--rt-font-mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; color: var(--rt-ink-muted); }
.jenc-char { font-size: 22px; font-weight: 400; line-height: 1.2; }
.jenc-mono, .jenc-hex { font-family: var(--rt-font-mono); font-size: 12.5px; }
.jenc-hex { color: var(--rt-ink); background: none; padding: 0; }
.jenc-back { display: block; font-size: 11.5px; color: var(--rt-ink-soft); }
.jenc-none { font-size: 12px; color: var(--rt-ink-soft); font-style: italic; }
.jenc-cls { font-size: 12px; color: var(--rt-ink-soft); white-space: normal; min-width: 110px; }
/* ISO-2022-JP carries its escape sequences, so its cell is the widest by far;
   let it break between bytes rather than push the table into a scroll. */
.jenc-table td.jenc-iso { white-space: normal; min-width: 96px; }
.jenc-table td.jenc-iso .jenc-hex { word-spacing: 0; }

.jenc-notes { display: flex; flex-direction: column; gap: 8px; }
.jenc-notes:empty { display: none; }
.jenc-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-accent); }
.jenc-note-char { font-size: 16px; margin-right: 2px; }

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

/* CLS floor for the default lookup ("髙橋 〜 ¥ ①"), which app.js renders after
   first paint. MEASURED 2026-09-27 as table + notes: see the numbers beside each
   breakpoint. Released by app.js on the first edit, a user-initiated shift. */
.jenc-lookup-out { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.jenc-lookup-out.jenc-reserve { min-height: 680px; }                                  /* 684 at 1280 */
@media (max-width: 1023px) { .jenc-lookup-out.jenc-reserve { min-height: 760px; } }   /* 772 at 768 */
@media (max-width: 560px) { .jenc-lookup-out.jenc-reserve { min-height: 1040px; } }   /* 1054 at 375 */
