/* Text compare (army #11). Site tokens only, so light/dark follow. */

.tc-inputs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
@media (min-width: 900px) {
    .tc-inputs { grid-template-columns: 1fr 1fr; }
}
.tc-side { min-width: 0; }
.tc-side__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.tc-side__label {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 15px;
}
.tc-side__head .army-label { margin-inline-end: auto; }
.tc-file { position: relative; cursor: pointer; }
.tc-file__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    cursor: pointer;
}
.tc-file:focus-within { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.tc-ta {
    min-height: 150px;
    font-family: var(--cine-mono, ui-monospace, monospace);
    font-size: 13px;
}
@media (max-width: 640px) {
    .tc-ta { min-height: 110px; height: 130px; }
}
.tc-ta.tc-drop { border-color: var(--color-accent); background: var(--color-accent-subtle); }

.tc-actions { margin-top: 14px; }

.tc-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    margin-top: 14px;
    align-items: flex-end;
}
.tc-options fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.tc-options legend { margin-bottom: 6px; }

/* Segmented radio control */
.tc-seg { display: inline-flex; flex-wrap: wrap; gap: 0; border: 0; padding: 0; margin: 0; }
.tc-seg legend { width: 100%; }
.tc-seg label { position: relative; cursor: pointer; }
.tc-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tc-seg span {
    display: inline-block;
    padding: 7px 14px;
    font-size: 14px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-elevated);
    color: var(--color-text-secondary);
    transition: background-color 160ms var(--ease-out, ease), color 160ms ease;
}
.tc-seg label:first-of-type span { border-start-start-radius: 8px; border-end-start-radius: 8px; }
.tc-seg label:last-of-type span { border-start-end-radius: 8px; border-end-end-radius: 8px; }
.tc-seg label + label span { border-inline-start-width: 0; }
.tc-seg input:checked + span {
    background: var(--color-text-primary);
    color: var(--color-bg-primary);
    border-color: var(--color-text-primary);
}
.tc-seg input:focus-visible + span { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.tc-seg--small span { padding: 5px 11px; font-size: 13px; }

.tc-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.tc-checks legend { width: 100%; }
.tc-checks label, .tc-only {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--color-text-secondary);
    cursor: pointer;
}
.tc-checks input, .tc-only input { accent-color: var(--color-accent); width: 16px; height: 16px; }

/* Result */
.tc-result { margin-top: 20px; }
.tc-result__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tc-stats { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tc-unit {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-inline-end: 2px;
}
.tc-chip {
    font-size: 14px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-elevated);
    color: var(--color-text-secondary);
    font-variant-numeric: tabular-nums;
}
.tc-chip--ins { border-color: color-mix(in srgb, #16a34a 45%, var(--color-border)); }
.tc-chip--del { border-color: color-mix(in srgb, #dc2626 45%, var(--color-border)); }
.tc-chip--chg { border-color: color-mix(in srgb, #d97706 45%, var(--color-border)); }
.tc-viewbar { margin-top: 12px; }
.tc-spacer { flex: 1 1 auto; }

.tc-out { margin-top: 12px; }
.tc-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
@media (min-width: 900px) {
    .tc-split { grid-template-columns: 1fr 1fr; }
}
.tc-pane {
    min-width: 0;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 12px 14px;
    font-family: var(--cine-mono, ui-monospace, monospace);
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--color-text-secondary);
    max-height: 560px;
    overflow: auto;
}
.tc-del, .tc-ins { border-radius: 3px; padding: 0 1px; }
.tc-del {
    background: color-mix(in srgb, #ef4444 22%, transparent);
    color: var(--color-text-primary);
    text-decoration: line-through;
    text-decoration-color: color-mix(in srgb, #ef4444 70%, transparent);
}
.tc-ins {
    background: color-mix(in srgb, #22c55e 24%, transparent);
    color: var(--color-text-primary);
}
.tc-nl { opacity: 0.55; font-size: 0.85em; }
.tc-gap {
    display: inline-block;
    margin: 2px 4px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--color-text-muted);
    background: var(--color-bg-tertiary);
    border: 1px dashed var(--color-border);
}

/* Line view */
.tc-lines {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-family: var(--cine-mono, ui-monospace, monospace);
    font-size: 13px;
    line-height: 1.6;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
}
.tc-out { max-height: 640px; overflow: auto; border-radius: 10px; }
.tc-lines td { vertical-align: top; padding: 1px 8px; }
.tc-ln {
    width: 3.2em;
    text-align: end;
    color: var(--color-text-subtle);
    user-select: none;
    font-variant-numeric: tabular-nums;
    border-inline-end: 1px solid var(--color-border);
}
.tc-sign { width: 1.4em; text-align: center; color: var(--color-text-muted); user-select: none; }
.tc-code { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--color-text-secondary); }
.tc-cell-del, .tc-row-del td.tc-code { background: color-mix(in srgb, #ef4444 9%, transparent); }
.tc-cell-ins, .tc-row-ins td.tc-code { background: color-mix(in srgb, #22c55e 10%, transparent); }
.tc-cell-empty { background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--color-border) 45%, transparent) 6px 7px); }
.tc-lines .tc-del { text-decoration: none; }
.tc-row-gap td {
    text-align: center;
    font-size: 12px;
    color: var(--color-text-muted);
    background: var(--color-bg-tertiary);
    padding: 3px;
}
@media (max-width: 640px) {
    .tc-lines:not(.tc-lines--inline) .tc-ln { width: 2.2em; padding: 1px 4px; }
    .tc-lines { font-size: 12px; }
}

.tc-legend { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tc-legend .tc-del, .tc-legend .tc-ins { padding: 0 6px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* The HTML minifier drops the space between the sentence and the link in
   sozai_army_next_step(); keep them apart here until army-core.css does. */
.tc .army-next > a { margin-inline-start: 0.3em; }
