/* RT-CHN-108 — Chinese Reign-Era Converter.
 * Light surfaces throughout: --rt-ink / --rt-ink-soft on --rt-surface; a leap
 * month and the reign reading are marked with --rt-accent. No navy result
 * box, so no --rt-result-* tokens (docs/contrast-conventions.md). */

.ce-form { display: grid; grid-template-columns: 1fr; gap: var(--rt-s-6); min-width: 0; }
@media (min-width: 960px) { .ce-form { grid-template-columns: 1fr 1fr; } .ce-form > :not(.ce-panel) { grid-column: 1 / -1; } }
.ce-panel { display: flex; flex-direction: column; gap: var(--rt-s-3); min-width: 0; }
.ce-panel-title { margin: 0; font-size: 17px; color: var(--rt-ink); }
.ce-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ce-label { font-family: var(--rt-font-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; color: var(--rt-ink-muted); }
.ce-input {
    width: 100%; box-sizing: border-box; padding: 9px 12px;
    border: 1px solid var(--rt-hairline); border-radius: var(--rt-r-button);
    background: var(--rt-surface); color: var(--rt-ink); font-size: 16px; line-height: 1.4;
}
#ce-era { font-size: 20px; }
.ce-input:focus { outline: none; border-color: var(--rt-accent); box-shadow: 0 0 0 3px var(--rt-accent-soft); }
.ce-samples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ce-samples-label { font-size: 11px; color: var(--rt-ink-soft); margin-right: 2px; }
.ce-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;
}
.ce-chip:hover { border-color: var(--rt-accent); background: var(--rt-surface); }

.ce-date-row { display: grid; grid-template-columns: 70px 1fr 90px 80px; gap: 8px; min-width: 0; }
.ce-hint { margin: 0; font-size: 12.5px; color: var(--rt-ink-soft); }

.ce-out { min-width: 0; }
/* CLS floors for the two default results (宣統三年八月十九日: one card;
   25 April 1644: the day line and two cards). */
.ce-out.ce-reserve-a { min-height: 120px; }
.ce-out.ce-reserve-b { min-height: 230px; }
.ce-result { display: flex; flex-direction: column; gap: var(--rt-s-3); min-width: 0; }

.ce-card { 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); }
.ce-card-p { box-shadow: none; background: var(--rt-surface-2); }
.ce-written { margin: 0 0 4px; font-size: 22px; line-height: 1.35; color: var(--rt-ink); overflow-wrap: anywhere; }
.ce-who { margin: 0 0 6px; font-size: 14px; color: var(--rt-ink-soft); }
.ce-west { margin: 0; font-size: 15px; color: var(--rt-ink); line-height: 1.5; }
.ce-west-date { font-weight: 600; }
.ce-west-meta { color: var(--rt-ink-soft); font-size: 13.5px; }
.ce-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); }
.ce-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--rt-ink-soft); }

.ce-months { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ce-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ce-table th, .ce-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--rt-hairline); vertical-align: top; color: var(--rt-ink); }
.ce-table thead th { font-family: var(--rt-font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--rt-ink-muted); font-weight: 600; }
.ce-month { font-size: 16px; }
.ce-leap td { background: var(--rt-accent-soft); }

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

@media (max-width: 480px) {
    .ce-date-row { grid-template-columns: 64px 1fr; }
    .ce-table th, .ce-table td { padding: 5px 6px; }
}
