/* RT-SEC-010 — Unicode confusables checker.
 * 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. */

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

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

.uc-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.uc-field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.uc-label { font-family: var(--rt-font-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; color: var(--rt-ink-muted); }
.uc-hint { font-size: 11px; color: var(--rt-ink-soft); }

.uc-input {
    width: 100%; box-sizing: border-box; min-height: 62px; resize: vertical;
    padding: 12px 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: 17px; line-height: 1.6;
    /* 17px, not the 14px the rest of the mono type uses: on this page the glyph
       IS the evidence, and Cyrillic а next to Latin a is the thing the reader is
       being asked to fail to distinguish. Smaller type makes the demonstration
       weaker rather than tidier. */
}
.uc-input:focus { outline: none; border-color: var(--rt-accent); box-shadow: 0 0 0 3px var(--rt-accent-soft); }

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

/* ── verdict box (navy) ──────────────────────────────────────────────────── */
.uc-verdict {
    min-width: 0;
    background: var(--rt-result-bg); border-radius: var(--rt-r-card);
    padding: var(--rt-s-16) var(--rt-s-16) var(--rt-s-12);
    /* Reserved so the box can never collapse: the dataset is a 715 KB script at
       the end of <body> and on a slow connection first paint can beat it
       (docs/cls-conventions.md rule 1). These are the MEASURED heights of the
       server-rendered placeholder state, not guesses — 336px at 1280 and 482px
       at 375.

       What is NOT reserved, stated rather than implied: the caveat block, whose
       length depends on the string. Measured on the default example, the fill
       moves the box 7px at 1280 (where it sits above the fold at y≈569) and
       225px at 375×812 — where the box starts at y≈998, below the fold, so the
       movement happens off-screen. Reserving for the caveat would mean holding
       ~150px of blank space open on every mobile view that never gets one. */
    min-height: 336px;
}
@media (max-width: 720px) { .uc-verdict { min-height: 482px; } }

.uc-v-label { font-family: var(--rt-font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--rt-result-muted); }
.uc-skeleton {
    display: block; margin: 6px 0 var(--rt-s-12);
    font-family: var(--rt-font-mono); font-size: 26px; line-height: 1.35;
    color: var(--rt-result-ink); word-break: break-all;
}
.uc-skeleton.uc-skeleton-empty { color: var(--rt-result-muted); font-size: 18px; }

.uc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--rt-s-12); border-top: 1px solid rgba(246, 244, 239, .14); padding-top: var(--rt-s-12); }
@media (max-width: 720px) { .uc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.uc-stat { min-width: 0; border-left: 2px solid transparent; padding-left: 10px; }
.uc-stat .v { display: block; font-family: var(--rt-font-mono); font-size: 15px; font-weight: 600; color: var(--rt-result-ink); overflow-wrap: anywhere; }
.uc-stat .l { display: block; margin-top: 3px; font-size: 11px; color: var(--rt-result-muted); }
/* A flagged stat is marked by its RULE, not by recolouring the number.
   docs/contrast-conventions.md: --rt-accent on the navy result box is 3.0:1 and
   is reserved for one hero number at 64px+, where it passes as large text. These
   are 15px. The value keeps --rt-result-ink; the orange lives on the border. */
.uc-stat.uc-stat-flag { border-left-color: var(--rt-accent); }

.uc-caveat {
    margin: var(--rt-s-12) 0 0; padding: 9px 12px; border-radius: 8px;
    background: rgba(246, 244, 239, .08); border-left: 2px solid var(--rt-accent);
    font-size: 12px; line-height: 1.55; color: var(--rt-result-ink);
}

/* ── panels (light) ──────────────────────────────────────────────────────── */
/* min-width:0 on every flex/grid child that can hold wide content. Without it a
   flex item's default `min-width: auto` refuses to shrink below its content, so
   the 620px character table pushed the whole DOCUMENT to 477px at a 375px
   viewport — the panel's own overflow-x never got the chance to scroll. */
.uc-panel { border: 1px solid var(--rt-hairline); border-radius: var(--rt-r-card); background: var(--rt-surface); overflow: hidden; min-width: 0; }
.uc-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 11px var(--rt-s-16); border-bottom: 1px solid var(--rt-hairline); background: var(--rt-surface-2); }
.uc-panel-title { font-size: 13px; font-weight: 600; color: var(--rt-ink); margin: 0; }
.uc-panel-note { font-size: 11.5px; color: var(--rt-ink-soft); }
.uc-panel-body { padding: var(--rt-s-12) var(--rt-s-16) var(--rt-s-16); }
.uc-scroll { overflow-x: auto; min-width: 0; }

/* ── character table ─────────────────────────────────────────────────────── */
.uc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 620px; }
.uc-table th { text-align: left; font-family: var(--rt-font-mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--rt-ink-muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--rt-hairline); white-space: nowrap; }
.uc-table td { padding: 8px 10px; border-bottom: 1px solid var(--rt-hairline); color: var(--rt-ink); vertical-align: top; }
.uc-table tr:last-child td { border-bottom: 0; }
.uc-table tr.uc-row-flag { background: var(--rt-accent-soft); }
.uc-glyph { font-family: var(--rt-font-mono); font-size: 19px; line-height: 1.2; }
.uc-glyph-none { font-size: 11px; color: var(--rt-ink-soft); font-style: italic; }
.uc-cp { font-family: var(--rt-font-mono); white-space: nowrap; color: var(--rt-ink-soft); }
.uc-name { font-size: 12px; }
.uc-name small { display: block; color: var(--rt-ink-soft); font-size: 11px; }
.uc-proto { font-family: var(--rt-font-mono); font-size: 15px; }
.uc-proto-same { color: var(--rt-ink-soft); font-size: 12px; font-family: var(--rt-font-sans); }

.uc-pill { display: inline-block; padding: 2px 8px; border-radius: var(--rt-r-chip); font-size: 10.5px; font-family: var(--rt-font-mono); letter-spacing: .03em; white-space: nowrap; }
.uc-pill-allowed { background: var(--rt-success-soft); color: var(--rt-success); }
.uc-pill-restricted { background: var(--rt-danger-soft); color: var(--rt-danger); }
.uc-pill-script { background: var(--rt-bg-inset); color: var(--rt-ink-soft); }

/* ── comparison ──────────────────────────────────────────────────────────── */
.uc-cmp-verdict { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: var(--rt-s-12); }
.uc-cmp-badge { padding: 5px 12px; border-radius: var(--rt-r-chip); font-size: 12.5px; font-weight: 600; }
.uc-cmp-yes { background: var(--rt-danger-soft); color: var(--rt-danger); }
.uc-cmp-no { background: var(--rt-success-soft); color: var(--rt-success); }
.uc-cmp-fold { background: var(--rt-accent-soft); color: var(--rt-accent-text); }

.uc-align { display: flex; flex-wrap: wrap; gap: 4px; }
.uc-cell { border: 1px solid var(--rt-hairline); border-radius: 7px; padding: 5px 7px; min-width: 40px; text-align: center; background: var(--rt-surface-2); }
.uc-cell.uc-cell-diff { border-color: var(--rt-accent); background: var(--rt-accent-soft); }
.uc-cell b { display: block; font-family: var(--rt-font-mono); font-size: 17px; font-weight: 500; color: var(--rt-ink); line-height: 1.3; }
.uc-cell b.uc-cell-b { color: var(--rt-accent-text); }
.uc-cell i { display: block; font-style: normal; font-family: var(--rt-font-mono); font-size: 9.5px; color: var(--rt-ink-soft); margin-top: 2px; }
.uc-cell-gap b { color: var(--rt-ink-soft); }

/* ── punycode + gap lists ────────────────────────────────────────────────── */
.uc-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px var(--rt-s-12); font-size: 12.5px; align-items: baseline; }
.uc-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; }
.uc-kv dd { margin: 0; font-family: var(--rt-font-mono); color: var(--rt-ink); overflow-wrap: anywhere; }
.uc-kv dd.uc-plain { font-family: var(--rt-font-sans); color: var(--rt-ink-soft); }

.uc-gap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--rt-s-12); }
@media (max-width: 720px) { .uc-gap { grid-template-columns: 1fr; } }
.uc-gap-col { border: 1px solid var(--rt-hairline); border-radius: 8px; padding: 10px 12px; background: var(--rt-surface-2); }
.uc-gap-col h4 { margin: 0 0 3px; font-size: 12px; color: var(--rt-ink); }
.uc-gap-col p { margin: 0 0 7px; font-size: 11px; color: var(--rt-ink-soft); line-height: 1.45; }
.uc-gap-chars { font-family: var(--rt-font-mono); font-size: 16px; color: var(--rt-ink); word-break: break-all; min-height: 20px; }
.uc-gap-chars:empty::after { content: 'none'; font-family: var(--rt-font-sans); font-size: 11px; color: var(--rt-ink-soft); font-style: italic; }

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