/* RT-CNV-101 — Japanese era 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. */

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

.jec-fields { display: grid; grid-template-columns: 3fr 2fr; gap: var(--rt-s-3); }
@media (max-width: 720px) { .jec-fields { grid-template-columns: 1fr; } }

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

.jec-input {
    width: 100%; box-sizing: border-box; min-height: 48px;
    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.4;
}
.jec-input:focus { outline: none; border-color: var(--rt-accent); box-shadow: 0 0 0 3px var(--rt-accent-soft); }

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

/* ── result box (navy) ───────────────────────────────────────────────────── */
.jec-result {
    display: flex; flex-direction: column; gap: 6px; min-width: 0;
    background: var(--rt-result-bg); border-radius: var(--rt-r-card);
    padding: var(--rt-s-4);
    border-left: 3px solid transparent;
    /* Reserved: the box is filled by app.js after first paint, and the
       refusal states (beyond-era, lunisolar) carry a note that makes it taller
       than the plain answer. The floor holds the no-note state so the common
       case never moves the page (docs/cls-conventions.md rule 1). MEASURED on
       2026-09-27: the default input (H31.4.30) fills to exactly 150px at both
       1280 and 375. A refusal with its note grows to 271-297px at 375 — that
       happens only on user input, which CLS does not count. */
    min-height: 150px;
}
.jec-result[data-tone="warn"] { border-left-color: var(--rt-accent); }
.jec-result[data-tone="error"] { border-left-color: var(--rt-danger); }

.jec-r-label { font-family: var(--rt-font-mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--rt-result-muted); }
.jec-r-main { font-size: 30px; line-height: 1.3; font-weight: 600; color: var(--rt-result-ink); overflow-wrap: anywhere; }
.jec-r-sub { font-size: 14px; color: var(--rt-result-muted); overflow-wrap: anywhere; }
.jec-r-note {
    margin-top: 6px; padding: 9px 12px; border-radius: 8px;
    background: rgba(246, 244, 239, .08); border-left: 2px solid var(--rt-accent);
    font-size: 13px; line-height: 1.55; color: var(--rt-result-ink);
}

/* ── panels (light) ──────────────────────────────────────────────────────── */
.jec-panel { border: 1px solid var(--rt-hairline); border-radius: var(--rt-r-card); background: var(--rt-surface); overflow: hidden; min-width: 0; }
.jec-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 11px var(--rt-s-4); border-bottom: 1px solid var(--rt-hairline); background: var(--rt-surface-2); }
.jec-panel-title { font-size: 13px; font-weight: 600; color: var(--rt-ink); margin: 0; }
.jec-panel-note { font-size: 11.5px; color: var(--rt-ink-soft); }
.jec-panel-body { padding: var(--rt-s-3) var(--rt-s-4) var(--rt-s-4); }
.jec-scroll { overflow-x: auto; max-height: 420px; overflow-y: auto; min-width: 0; }

.jec-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px var(--rt-s-4); align-items: baseline; margin: 0; }
.jec-kv dt { font-family: var(--rt-font-mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--rt-ink-muted); white-space: nowrap; }
.jec-kv dd { margin: 0; min-width: 0; }
.jec-muted { color: var(--rt-ink-soft); font-size: 13px; }
.jec-copy {
    font-family: var(--rt-font-mono); font-size: 15px; color: var(--rt-ink);
    padding: 2px 6px; border-radius: 6px; background: var(--rt-bg-inset);
    cursor: pointer; overflow-wrap: anywhere;
}
.jec-copy:hover, .jec-copy:focus { outline: none; box-shadow: 0 0 0 2px var(--rt-accent-soft); }
.jec-copy[data-copied]::after { content: ' ✓ copied'; font-family: var(--rt-font-sans); font-size: 11px; color: var(--rt-ink-soft); }

/* ── year table ──────────────────────────────────────────────────────────── */
.jec-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.jec-table th, .jec-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--rt-hairline); color: var(--rt-ink); vertical-align: top; }
.jec-table thead th { position: sticky; top: 0; background: var(--rt-surface-2); font-family: var(--rt-font-mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--rt-ink-muted); font-weight: 600; white-space: nowrap; }
.jec-table tbody th { font-family: var(--rt-font-mono); font-weight: 600; white-space: nowrap; }
.jec-table tr.jec-change td, .jec-table tr.jec-change th { background: var(--rt-accent-soft); }
.jec-table tr.jec-lunisolar td, .jec-table tr.jec-lunisolar th { color: var(--rt-ink-soft); font-style: italic; }
.jec-table tr.jec-current th, .jec-table tr.jec-current td { box-shadow: inset 3px 0 0 var(--rt-accent); }

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