/* Admin B model-comparison and C after-change review series screens (eval_admin/model_bakeoff*.html,
 * before_after*.html). Uses the tokens and components from app.css (cards, tables, steps, seg-tabs, notices)
 * and the record-table helpers from eval-admin.css; only screen-specific rules live here (prefix es-).
 * Counts are shown in ink; severity uses shape + text (▲ unusable, ○ minor), never colour alone.
 */

.es-page .es-section { scroll-margin-top: 16px; }
.es-page .content-inner > * + .es-section,
.es-page .content-inner > .es-section + *,
.es-page .es-series-head { margin-top: 20px; }
.es-page .content-inner > .notice + .notice { margin-top: 8px; }
.es-page .content-inner > .notice { margin-bottom: 0; }

/* Codes and small facts */
.es-code { padding: 1px 5px; border-radius: var(--radius-chip); background: var(--surface-3); color: var(--ink-2); font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; }
.es-meta { color: var(--ink-3); font-size: 12px; font-weight: 400; }
.es-label { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.es-nowrap { white-space: nowrap; }
.es-facts, .es-series-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 6px 0 0; color: var(--ink-2); font-size: 13px; }
.es-purpose { margin: 10px 0 0; color: var(--ink-2); font-size: 13px; }

/* Arms: model ID (B) or before/after + namespace (C) */
.es-side { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; text-transform: none; letter-spacing: 0; }
.es-model { color: var(--ink-1); font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.es-role { color: var(--ink-3); font-size: 12px; font-weight: 500; }
.es-ba {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-chip);
  color: var(--ink-1);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.es-ba-after { border-color: var(--ink-1); }

/* Severity labels (v3): shape + text */
.es-sev { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.es-sev::before { font-size: 10px; line-height: 1; }
.es-sev-unusable { color: var(--danger); }
.es-sev-unusable::before { content: "\25B2"; }
.es-sev-minor { color: var(--sev-minor); }
.es-sev-minor::before { content: "\25CB"; font-size: 11px; }
.es-item { color: var(--ink-1); font-size: 13px; font-weight: 500; }

/* Series list and head */
.es-series-table tbody th { color: var(--ink-1); font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; white-space: normal; }
.es-series-table tbody th a { font-weight: 600; text-decoration: none; }
.es-series-table tbody th a:hover { text-decoration: underline; }
.es-page :is(h2, td, th) > .status-dot, .es-page .es-facts > .status-dot { margin-left: 6px; }
.es-page tr.is-selected > th, .es-page tr.is-selected > td { background: var(--accent-tint); }
.es-series-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; padding-top: 20px; border-top: 1px solid var(--line); }
.es-series-head-text { min-width: 0; }
.es-series-head .eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; }
.es-series-title { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.es-inline-form { display: inline-flex; margin: 0; }

/* Round picker / language filters */
.es-round-tabs, .es-lang-tabs { margin-top: 16px; flex-wrap: wrap; }
.es-lang-tabs { margin: 12px 16px 0; }
.es-tab-status { color: var(--ink-3); font-size: 12px; font-weight: 400; }
.seg-tabs > .is-active .es-tab-status { color: inherit; }

/* Round head, steps, disabled generation */
.es-round-head .card-head { align-items: flex-start; }
.es-round-head .eyebrow { margin-bottom: 4px; }
.es-round-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.es-round-head h3 { margin-top: 18px; }
.es-steps { gap: 10px 26px; }
.es-step-fact { margin-left: 2px; color: var(--ink-3); font-size: 12px; font-weight: 400; }
.es-generate { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-control); background: var(--surface-2); }
.es-generate .field-hint { margin: 0; flex: 1 1 260px; }
.es-round-head > .field-hint { margin: 10px 0 0; }

/* Two arms side by side */
.es-arm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.es-arm-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.card .es-arm-card { background: var(--surface-2); }
section.es-arm-card { padding: 20px; }
.es-arm-role { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 4px; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.es-arm-model { margin: 0 0 12px; color: var(--ink-1); font-family: var(--font-mono); font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.es-arm-card h3 { margin: 12px 0 8px; font-size: 13px; }
.es-same-prompt { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.es-same-prompt p { margin: 0; }
.es-same-prompt p + p { margin-top: 6px; }

/* Counts in a row (grades, system, metrics): plain numbers, no colour verdict */
.es-grade-row, .es-system, .es-metrics { display: grid; gap: 10px; margin: 0; }
.es-grade-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.es-system { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.es-metrics { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-top: 14px; }
.es-count, .es-system > div, .es-metrics > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.es-count span, .es-system dt, .es-metrics span { color: var(--ink-3); font-size: 12px; font-weight: 500; }
.es-count strong, .es-system dd, .es-metrics strong { margin: 0; color: var(--ink-1); font-family: var(--font-mono); font-size: 22px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.es-metrics small { color: var(--ink-3); font-size: 11px; line-height: 1.4; }
.es-arm-card .ea-kv { margin-top: 12px; }

/* Tables */
.es-table tbody th, .es-table tfoot th { color: var(--ink-1); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; white-space: normal; }
/* keep-all: Korean headers break between words, not syllables (390: '리/뷰/어' stacked one per line). */
.es-table thead th { white-space: normal; word-break: keep-all; letter-spacing: 0; text-transform: none; line-height: 1.3; }
.es-table .es-code { font-size: 11.5px; overflow-wrap: normal; white-space: nowrap; }
/* Wide tables scroll inside their .table-scroll instead of squeezing columns on narrow screens. */
.es-table, .es-series-table { min-width: 680px; }
.es-compact-table { min-width: 520px; }
.es-table .ea-lang-row > td.muted { font-weight: 400; }
.es-item-table { min-width: 560px; }
.es-cross-table th[scope="rowgroup"] { vertical-align: top; min-width: 190px; }
.es-cross-table tbody + tbody { border-top: 1px solid var(--line-strong); }
.es-links { font-size: 13px; white-space: nowrap; }
.es-links a + a { margin-left: 12px; }
.es-subhead { margin: 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; }
.es-planned-row > th, .es-planned-row > td { color: var(--ink-3); background: var(--surface-2); }

/* Due date fact (C): text first; the overdue look adds a border, not only colour */
.es-due { display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; border-radius: var(--radius-chip); background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.es-due.is-overdue { box-shadow: inset 0 0 0 1px var(--warn); background: var(--warn-tint); color: var(--warn); }

/* Settings blocks (C) */
.es-setting-block + .es-setting-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.es-setting-block > .card-head { margin-bottom: 10px; }
.es-setting-block h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.es-setting-block h4 { margin: 0 0 10px; }
.es-setting-block > .field-hint { margin: 8px 0 0; }
.es-lang-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; }

/* Two cards side by side on wide screens */
.es-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; align-items: start; }
.es-two > .es-section { margin-top: 0; }

/* Ordered procedure (new model, how to apply, what 'next round' does) */
.es-procedure { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; padding-left: 20px; font-size: 13px; line-height: 1.55; }
.es-who { display: inline-block; min-width: 64px; margin-right: 6px; color: var(--ink-3); font-size: 12px; font-weight: 600; }

/* Series form */
.es-form { display: flex; flex-direction: column; gap: 0; max-width: 960px; }
.es-form-section + .es-form-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.es-form-section > h2 { margin: 0 0 12px; font-size: 15px; }
.es-form-section > .field-hint { margin: 8px 0 0; }
.es-radio-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; border: 0; }
.es-radio { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-control); cursor: pointer; }
.es-radio:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.es-radio > span { display: flex; flex-direction: column; gap: 2px; }
.es-radio input { margin-top: 3px; }
.es-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.es-check.is-disabled { color: var(--ink-3); cursor: not-allowed; }
.es-input-unit { display: inline-flex; align-items: center; gap: 8px; }
.es-input-unit input { width: 120px; }
.es-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.es-form > .field-hint { margin: 8px 0 0; text-align: right; }

@media (max-width: 960px) {
  .es-arm-grid, .es-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 719px) {
  .es-series-head { align-items: flex-start; }
  .es-series-head .page-actions { width: 100%; }
  .es-grade-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .es-count strong, .es-system dd, .es-metrics strong { font-size: 18px; }
  .es-lang-tabs { margin: 12px 12px 0; }
  .es-form-actions { justify-content: stretch; }
  .es-form-actions > * { flex: 1 1 auto; }
}

/* A cancelled series round stays in the history tables as 'cancelled' only (no number, no round link). */
.es-cancelled-row > th, .es-cancelled-row > td { color: var(--ink-3); }
.es-cancelled { font-weight: 500; }
