:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f1f3f6;
  --border: #e3e6eb;
  --border-strong: #cfd4dc;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #6b7280;
  --accent: #1f4fd8;
  --accent-hover: #1a43b8;
  --accent-soft: #eaf0fe;
  --accent-text: #1a43b8;
  --success: #15803d;
  --success-soft: #e8f6ee;
  --warning: #a16207;
  --warning-soft: #fdf6e3;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --info-soft: #eef4ff;
  --focus: 0 0 0 3px rgba(31, 79, 216, 0.28);
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.12);
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --topbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --surface: #161a22;
    --surface-2: #1b2029;
    --surface-3: #212733;
    --border: #2a303c;
    --border-strong: #3a4250;
    --text: #e8ebf0;
    --text-2: #b4bcc8;
    --text-3: #8b94a3;
    --accent: #6d93ff;
    --accent-hover: #87a6ff;
    --accent-soft: #1c2742;
    --accent-text: #9db6ff;
    --success: #4ade80;
    --success-soft: #13291d;
    --warning: #fbbf24;
    --warning-soft: #2c2412;
    --danger: #f87171;
    --danger-soft: #2f1717;
    --info-soft: #18213a;
    --shadow: none;
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0; }
a { color: var(--accent-text); }
code, pre, .mono { font-family: var(--mono); }
:focus-visible { outline: none; box-shadow: var(--focus); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { left: 8px; }
[hidden] { display: none !important; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 36px; height: 36px; flex: none; border-radius: 9px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #fb923c, #ea580c); box-shadow: 0 3px 8px rgba(234, 88, 12, 0.25);
}
.brand-title { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.brand-sub { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex: none; }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: 12.5px; font-weight: 550; color: var(--text-2); cursor: pointer;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.status-pill[data-state="ok"] .dot { background: var(--success); }
.status-pill[data-state="warn"] .dot { background: var(--warning); }
.status-pill[data-state="error"] .dot { background: var(--danger); }
.status-pill[data-state="error"] { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-weight: 550; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background-color .12s, border-color .12s;
}
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14.5px; }
.btn-icon { width: 36px; padding: 0; }
.nav-toggle { display: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.sidebar {
  position: sticky; top: var(--topbar-h); align-self: start;
  height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 20px 14px; border-right: 1px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; gap: 4px;
}
.nav-heading { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 6px 10px; }
.nav-heading:not(:first-child) { margin-top: 14px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: var(--radius-sm); border: 0; background: transparent;
  text-align: left; cursor: pointer; color: var(--text-2); font-weight: 550;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.nav-item svg { flex: none; }
.nav-item .count { margin-left: auto; font-size: 11.5px; color: var(--text-3); background: var(--surface-3); border-radius: 999px; padding: 1px 8px; }
.nav-item[aria-current="page"] .count { background: var(--surface); }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border); }

.main { padding: 28px 32px 64px; min-width: 0; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 650; letter-spacing: -0.015em; }
.page-sub { color: var(--text-3); margin-top: 4px; max-width: 760px; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panel-title { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.panel-title .step { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; background: var(--accent-soft); color: var(--accent-text); }
.panel-desc { color: var(--text-3); font-size: 13px; }
.panel-body { padding: 18px 20px; }
.panel-body > * + * { margin-top: 14px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* ---------- prompt variants ---------- */
.variant-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.variant {
  position: relative; display: block; padding: 12px 14px 12px 40px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
}
.variant:hover { border-color: var(--border-strong); }
.variant input { position: absolute; left: 14px; top: 15px; accent-color: var(--accent); }
.variant:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.variant:has(input:focus-visible) { box-shadow: var(--focus); }
.variant-name { font-weight: 600; font-size: 13.5px; }
.variant-desc { color: var(--text-3); font-size: 12.5px; margin-top: 3px; }

.source-line { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-3); }
.source-line strong { color: var(--text-2); font-weight: 600; }

/* ---------- form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 13px; }
.field-hint { color: var(--text-3); font-size: 12.5px; font-weight: 400; }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); padding: 8px 11px; font-size: 13.5px;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.textarea.code { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; background: var(--surface-2); }
.textarea.tall { min-height: 320px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.meta-text { font-size: 12px; color: var(--text-3); }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

details.disclosure { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
details.disclosure > summary { cursor: pointer; padding: 9px 12px; font-weight: 600; font-size: 13px; list-style: none; display: flex; align-items: center; gap: 8px; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before { content: ""; width: 6px; height: 6px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
details.disclosure[open] > summary::before { transform: rotate(45deg); }
details.disclosure > .disclosure-body { padding: 4px 14px 14px; font-size: 13px; color: var(--text-2); }
.disclosure-body ul { margin: 6px 0; padding-left: 18px; }
.disclosure-body li + li { margin-top: 4px; }
.pre-block { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12px; line-height: 1.55; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; max-height: 360px; overflow: auto; margin: 6px 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: 12.5px; }
.chip button { border: 0; background: transparent; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); }
.chip button:hover { background: var(--surface-3); color: var(--text); }
.chip-example { padding: 0 10px; cursor: pointer; max-width: 100%; }
.chip-example span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-example:hover { border-color: var(--accent); color: var(--accent-text); }

/* ---------- model picker ---------- */
.model-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.model-tools .input { flex: 1 1 240px; }
.model-list { border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 340px; overflow-y: auto; background: var(--surface); }
.model-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.model-row:last-child { border-bottom: 0; }
.model-row:hover { background: var(--surface-2); }
.model-row input { accent-color: var(--accent); width: 16px; height: 16px; }
.model-row.selected { background: var(--accent-soft); }
.model-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-id { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-facts { text-align: right; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.model-empty { padding: 24px; text-align: center; color: var(--text-3); }
.settings-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

/* ---------- run bar ---------- */
.runbar {
  position: sticky; bottom: 16px; z-index: 10;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.runbar .issues { flex: 1; min-width: 200px; font-size: 13px; color: var(--text-3); }
.runbar .issues.has-issues { color: var(--warning); }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; width: 160px; }
.progress > span { display: block; height: 100%; background: var(--accent); transition: width .25s; }

/* ---------- alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.alert strong { color: var(--text); }
.alert-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--accent) 22%, var(--border)); }
.alert-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, var(--border)); }
.alert-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); color: var(--text); }
.alert svg { flex: none; margin-top: 1px; }
.alert code { font-size: 12px; background: var(--surface); padding: 1px 5px; border-radius: 4px; }

/* ---------- results ---------- */
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.results-title { font-size: 18px; font-weight: 650; }
.run-meta { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.stat { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); min-width: 0; }
.stat-label { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.stat-value { font-size: 15px; font-weight: 650; margin-top: 4px; overflow-wrap: anywhere; }
.stat-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
table.data th { font-weight: 600; color: var(--text-3); background: var(--surface-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.wrap { white-space: normal; min-width: 220px; }

.cards {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(360px, 1fr);
  gap: 16px; overflow-x: auto; padding-bottom: 6px; align-items: start;
  scroll-snap-type: x proximity;
}
.card { scroll-snap-align: start; display: flex; flex-direction: column; min-width: 0; }
.card-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-title { font-size: 14.5px; font-weight: 650; overflow-wrap: anywhere; }
.card-id { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); overflow-wrap: anywhere; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.metric { padding: 9px 12px; border-right: 1px solid var(--border); min-width: 0; }
.metric:last-child { border-right: 0; }
.metric-label { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.metric-value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-value.unavailable { color: var(--text-3); font-weight: 500; font-size: 12px; }
.metric-sub { font-size: 11px; color: var(--text-3); }

.card-section { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.card-section:last-child { border-bottom: 0; }
.checks { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.checks li { display: flex; gap: 7px; align-items: flex-start; }
.checks .mark { flex: none; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; margin-top: 1px; }
.checks .pass .mark { background: var(--success-soft); color: var(--success); }
.checks .fail .mark { background: var(--danger-soft); color: var(--danger); }
.checks .na .mark { background: var(--surface-3); color: var(--text-3); }
.checks .detail { color: var(--text-3); }

.response-tools { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.response-tools .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: 0; background: var(--surface); height: 28px; padding: 0 10px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }

.response { position: relative; padding: 14px 16px; overflow: hidden; max-height: 520px; }
.response.expanded { max-height: none; }
.response.clipped::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 64px; background: linear-gradient(transparent, var(--surface)); pointer-events: none; }
.response-raw { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12px; line-height: 1.6; margin: 0; }
.expand-row { padding: 8px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: center; }

.md { font-size: 13.5px; line-height: 1.6; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.1em 0 .4em; font-size: 1.05em; }
.md h1 { font-size: 1.2em; } .md h2 { font-size: 1.12em; }
.md p { margin: .55em 0; }
.md ul, .md ol { margin: .5em 0; padding-left: 1.4em; }
.md li + li { margin-top: .2em; }
.md code { font-size: .88em; background: var(--surface-3); padding: .1em .35em; border-radius: 4px; }
.md pre { background: var(--surface-3); padding: 10px 12px; border-radius: var(--radius-sm); overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; margin: .6em 0; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 5px 8px; }
.md blockquote { margin: .6em 0; padding-left: 12px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.md-img-placeholder { color: var(--text-3); font-style: italic; }

.error-box { padding: 16px; }
.error-box .alert { margin-top: 0; }
.placeholder { padding: 32px 16px; text-align: center; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 10px; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.sm { width: 12px; height: 12px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* ratings */
.rating-grid { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.rating-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.rating-label { font-size: 12.5px; font-weight: 550; }
.rating-label small { display: block; color: var(--text-3); font-weight: 400; font-size: 11.5px; line-height: 1.35; }
.scale { display: inline-flex; gap: 3px; }
.scale button { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 12px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.scale button:hover { border-color: var(--accent); }
.scale button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.overall { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.overall strong { font-size: 18px; font-variant-numeric: tabular-nums; }

/* AI evaluation */
.eval-result { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; background: var(--surface-2); }
.eval-result + .eval-result { margin-top: 12px; }
.eval-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.eval-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; font-size: 13px; }
.eval-card h4 { font-size: 13.5px; display: flex; justify-content: space-between; gap: 8px; }
.eval-card ul { margin: 4px 0 0; padding-left: 18px; }
.criteria-picks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.criteria-picks label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }

/* history */
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 16px; }
.history-item h3 { font-size: 14px; font-weight: 650; }
.history-preview { color: var(--text-3); font-size: 12.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-actions { display: flex; gap: 6px; }

.empty-state { padding: 48px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-3); }
.empty-state h3 { color: var(--text); font-size: 15px; }
.empty-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); }

.loading-page { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 96px 16px; color: var(--text-3); }

.toast-region { position: fixed; right: 20px; bottom: 96px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--text); color: var(--surface); padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 13px; max-width: 360px; }
.toast.error { background: var(--danger); color: #fff; }
.noscript { padding: 24px; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; width: 272px; height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h)); z-index: 40;
    transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 20px 16px 48px; }
  .brand-sub { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .brand-title { font-size: 14px; }
  .brand-mark { width: 32px; height: 32px; }
  #new-comparison .label-long { display: none; }
  .status-pill .status-text { display: none; }
  .status-pill { padding: 0 10px; }
  .cards { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); overflow-x: visible; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .history-item { grid-template-columns: minmax(0, 1fr); }
  .runbar { bottom: 8px; }
  .progress { width: 100%; }
  .rating-row { grid-template-columns: minmax(0, 1fr); }
  .page-title { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .btn, .progress > span { transition: none; }
}

/* ---------- model bar + searchable model dropdown ---------- */
.modelbar { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 15; }
.modelbar-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.mdd { position: relative; }
.mdd-control {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 46px; padding: 6px 6px 6px 8px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
}
.mdd.open .mdd-control, .mdd-control:hover { border-color: var(--accent); }
.mdd.open .mdd-control { box-shadow: var(--focus); }
.mdd-control .chip { cursor: default; background: var(--accent-soft); border-color: transparent; color: var(--accent-text); font-weight: 550; }
.mdd-control .chip-label { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mdd-placeholder { color: var(--text-3); padding: 0 4px; }
.mdd-trigger {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2);
  font-weight: 600; font-size: 13px; color: var(--text-2); cursor: pointer; max-width: 100%;
}
.mdd-trigger:hover { background: var(--surface-3); color: var(--text); }
.mdd-trigger svg { transition: transform .15s; flex: none; }
.mdd.open .mdd-trigger svg { transform: rotate(180deg); }
.mdd:not(.mdd-multi) .mdd-trigger { margin-left: 0; width: 100%; justify-content: space-between; border: 0; background: transparent; padding: 0 4px; }
.mdd-single { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; text-align: left; }
.mdd-single-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.mdd-single-id { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.mdd-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
}
.mdd-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.mdd-input { flex: 1; border: 0; background: transparent; font-size: 14px; padding: 4px 0; min-width: 0; color: var(--text); }
.mdd-input:focus { outline: none; box-shadow: none; }
.mdd-list { max-height: min(420px, 55vh); overflow-y: auto; }
.mdd-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 9px 14px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.mdd-row:last-child { border-bottom: 0; }
.mdd-row:hover, .mdd-row:focus-within { background: var(--surface-2); }
.mdd-row.selected { background: var(--accent-soft); }
.mdd-row input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.mdd-row-main { display: flex; flex-direction: column; min-width: 0; }
.mdd-row .model-facts { display: flex; flex-direction: column; align-items: flex-end; }
.mdd-custom { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--border); background: var(--warning-soft); cursor: pointer; font-weight: 600; }
.mdd-custom:hover, .mdd-custom:focus-visible { filter: brightness(0.97); }
.mdd-note { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.mdd-foot { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.mdd-foot .spacer { flex: 1; }

.settings-pop { position: relative; }
.settings-pop > summary { list-style: none; }
.settings-pop > summary::-webkit-details-marker { display: none; }
.settings-pop[open] > summary { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }
.settings-pop-body {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 55; width: 300px;
  display: flex; flex-direction: column; gap: 12px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}

/* ---------- collapsible system prompt ---------- */
.system-disclosure > summary { flex-wrap: wrap; padding: 12px 14px; font-size: 13.5px; }
.system-disclosure > summary .summary-hint { margin-left: auto; font-weight: 500; font-size: 12.5px; color: var(--accent-text); }
.system-disclosure .when-open { display: none; }
.system-disclosure[open] .when-open { display: inline; }
.system-disclosure[open] .when-closed { display: none; }
.system-disclosure > .disclosure-body { display: flex; flex-direction: column; gap: 10px; }
.system-disclosure .toolbar .field-hint { flex: 1 1 260px; }

@media (max-width: 640px) {
  .modelbar { padding: 14px; }
  .mdd-control .chip-label { max-width: 180px; }
  .mdd-row { grid-template-columns: auto minmax(0, 1fr); }
  .mdd-row .model-facts { grid-column: 2; align-items: flex-start; }
  .settings-pop-body { position: fixed; left: 16px; right: 16px; top: auto; width: auto; margin-top: 6px; }
  .system-disclosure > summary .summary-hint { margin-left: 0; width: 100%; }
}

/* ---------- prompt dropdown ---------- */
.odd { position: relative; }
.odd-trigger {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer;
}
.odd-trigger:hover { border-color: var(--accent); }
.odd.open .odd-trigger { border-color: var(--accent); box-shadow: var(--focus); }
.odd-trigger.single { cursor: default; background: var(--surface-2); }
.odd-trigger.single:hover { border-color: var(--border-strong); }
.odd-trigger:disabled { opacity: 1; color: inherit; }
.odd-trigger svg { flex: none; color: var(--text-3); transition: transform .15s; }
.odd.open .odd-trigger svg { transform: rotate(180deg); }
.odd-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.odd-value { font-weight: 650; font-size: 14.5px; color: var(--text); }
.odd-option-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.odd-option-desc { font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.odd-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 45; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); max-height: min(420px, 60vh); overflow-y: auto; outline: none;
}
.odd-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.odd-option.active { background: var(--surface-3); }
.odd-option[aria-selected="true"] { background: var(--accent-soft); }
.odd-option[aria-selected="true"] .odd-option-name { color: var(--accent-text); }
.odd-check { width: 16px; flex: none; color: var(--accent-text); margin-top: 1px; }

/* ---------- run settings in the sidebar ---------- */
.sidebar-settings { margin-top: 18px; padding: 14px 10px 4px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.sidebar-settings .nav-heading { padding: 0; margin: 0; }
.sidebar-settings .field { gap: 4px; }
.sidebar-settings .input { height: 34px; padding: 6px 10px; }

/* ---------- sliders ---------- */
.slider-field { gap: 6px; }
.slider-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.slider-value { font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--accent-text); background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; }
.slider-field.is-default .slider-value { color: var(--text-3); background: var(--surface-3); }
.slider {
  --fill: 50%;
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer;
}
.slider::-webkit-slider-runnable-track {
  height: 4px; border-radius: 999px;
  background: linear-gradient(to right, var(--accent) 0 var(--fill), var(--border-strong) var(--fill) 100%);
}
.slider::-moz-range-track { height: 4px; border-radius: 999px; background: var(--border-strong); }
.slider::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--accent); }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow);
}
.slider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.slider:focus-visible { box-shadow: none; }
.slider:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus); }
.slider:focus-visible::-moz-range-thumb { box-shadow: var(--focus); }
.slider-field.is-default .slider::-webkit-slider-thumb { border-color: var(--border-strong); }
.slider-field.is-default .slider::-moz-range-thumb { border-color: var(--border-strong); }
.slider-field.is-default .slider::-moz-range-progress { background: transparent; }
.slider-ticks { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text-3); }
.slider-default { border: 0; background: transparent; color: var(--accent-text); font-size: 11.5px; font-weight: 600; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.slider-default:hover:not(:disabled) { background: var(--accent-soft); }
.slider-default:disabled { color: var(--text-3); cursor: default; font-weight: 500; }

/* =====================================================================
   REDESIGN: layout and components matching the approved mockup.
   Later rules intentionally override the earlier base styles.
   ===================================================================== */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --surface-3: #eef2f8;
  --border: #e5e9f1;
  --border-strong: #d3d9e4;
  --text: #0f172a;
  --text-2: #475467;
  --text-3: #667085;
  --accent: #1d5bdc;
  --accent-hover: #174bb8;
  --accent-soft: #ebf2ff;
  --accent-text: #1d5bdc;
  --success: #12a150;
  --success-soft: #e7f7ee;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.03);
  --topbar-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #151a23;
    --surface-2: #1a202b;
    --surface-3: #222a37;
    --border: #283142;
    --border-strong: #364156;
    --text: #e7ebf2;
    --text-2: #b3bccb;
    --text-3: #8a94a6;
    --accent: #5b8cff;
    --accent-hover: #7aa2ff;
    --accent-soft: #1b2745;
    --accent-text: #8fb0ff;
    --success: #3ddc84;
    --success-soft: #11291c;
  }
}

/* ---------- header ---------- */
.topbar { padding: 0 28px 0 24px; height: var(--topbar-h); }
.brand { gap: 14px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #fb923c, #ea580c);
  box-shadow: 0 4px 10px rgba(234, 88, 12, 0.28);
}
.brand-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { font-size: 13px; color: var(--text-3); }
.topbar-actions { gap: 14px; }
.nav-toggle { display: none; border: 0; background: transparent; color: var(--text-2); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; }
.status-pill { height: 34px; padding: 0 14px; border: 0; background: var(--success-soft); color: var(--success); font-weight: 600; }
.status-pill .dot { background: var(--success); }
.status-pill[data-state="loading"] { background: var(--surface-3); color: var(--text-3); }
.status-pill[data-state="loading"] .dot { background: var(--text-3); }
.status-pill[data-state="warn"] { background: var(--warning-soft); color: var(--warning); }
.status-pill[data-state="warn"] .dot { background: var(--warning); }
.status-pill[data-state="error"] { background: var(--danger-soft); color: var(--danger); border: 0; }
.status-pill[data-state="error"] .dot { background: var(--danger); }
.round-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); display: grid; place-items: center; cursor: pointer;
}
.round-btn:hover, .round-btn[aria-expanded="true"] { background: var(--surface-3); color: var(--text); }
.user-btn {
  display: inline-flex; align-items: center; gap: 10px; border: 0; background: transparent; cursor: pointer;
  padding: 4px 6px 4px 4px; border-radius: 999px; color: var(--text); font-weight: 600;
}
.user-btn:hover, .user-btn[aria-expanded="true"] { background: var(--surface-3); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .02em;
}
.user-name { font-size: 14px; }
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 250px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.menu-section { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.menu-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 2px; }
.menu-name { font-weight: 650; }
.menu-text { font-size: 12.5px; color: var(--text-2); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: transparent;
  border-radius: 8px; cursor: pointer; text-align: left; font-size: 13.5px; color: var(--text);
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-3); }
.menu-item svg { color: var(--text-3); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger svg { color: var(--danger); }

/* ---------- shell + sidebar ---------- */
.shell { grid-template-columns: 268px minmax(0, 1fr); }
.sidebar { padding: 22px 14px 18px; gap: 0; justify-content: space-between; }
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-heading { font-size: 11.5px; letter-spacing: .07em; padding: 16px 12px 6px; }
.nav-heading:not(:first-child) { margin-top: 0; }
.nav-item { padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 550; color: var(--text-2); gap: 12px; white-space: nowrap; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.nav-item svg { color: var(--text-2); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 650; }
.nav-item[aria-current="page"] svg { color: var(--accent-text); }
.nav-item .count { min-width: 22px; text-align: center; padding: 1px 7px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.nav-item[aria-current="page"] .count { background: var(--surface); color: var(--accent-text); }
.promo {
  position: relative; overflow: hidden; margin: 24px 6px 0; padding: 18px 16px 44px; border-radius: 14px;
  background: linear-gradient(180deg, #f2f6ff 0%, #eaf1ff 100%); border: 1px solid #e1e9fb;
}
.promo::after {
  content: ""; position: absolute; left: -30%; right: -30%; bottom: -70px; height: 120px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(29, 91, 220, 0.10), transparent);
}
.promo-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #dde8ff; color: var(--accent); margin-bottom: 14px; }
.promo-title { font-weight: 700; font-size: 14.5px; line-height: 1.35; color: var(--text); }
.promo-text { margin-top: 8px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
@media (prefers-color-scheme: dark) {
  .promo { background: linear-gradient(180deg, #172036, #141c30); border-color: #24304d; }
  .promo-icon { background: #22305a; }
}

/* ---------- main + cards ---------- */
.main { padding: 18px 20px 40px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 18px 20px; }
.page-stack { display: flex; flex-direction: column; gap: 20px; max-width: 1240px; }
.ws-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.ws-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.ws-aside { display: flex; flex-direction: column; gap: 18px; position: sticky; top: calc(var(--topbar-h) + 18px); }

.page-header { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.page-header-text { flex: 1; min-width: 200px; }
.page-title { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.page-sub { color: var(--text-2); margin-top: 3px; font-size: 14px; }
.page-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.page-icon {
  width: 46px; height: 46px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}
.page-icon.sm { width: 42px; height: 42px; border-radius: 11px; box-shadow: none; }
.grad-purple { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.grad-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.grad-orange { background: linear-gradient(135deg, #fb923c, #f43f5e); }
.btn { border-radius: 10px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 14.5px; font-weight: 600; }
.btn-xl { height: 46px; padding: 0 30px; font-size: 15px; font-weight: 650; border-radius: 11px; gap: 10px; }
.btn-primary { box-shadow: 0 2px 6px rgba(29, 91, 220, 0.25); }
.link-btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; cursor: pointer;
  color: var(--accent-text); font-weight: 600; font-size: 14px; padding: 6px 4px; border-radius: 8px;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn.sm { font-size: 13px; gap: 5px; padding: 2px 4px; }
.icon-btn {
  width: 32px; height: 32px; flex: none; border: 0; background: transparent; color: var(--text-3); border-radius: 8px;
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e3ecff; color: var(--accent-text); white-space: nowrap; }
.tag-warn { background: var(--warning-soft); color: var(--warning); }
@media (prefers-color-scheme: dark) { .tag { background: #20305a; } .tag-warn { background: var(--warning-soft); } }
.section-title { font-size: 16px; font-weight: 700; }
.section-sub { color: var(--text-3); font-size: 13.5px; margin-top: 3px; }
.section-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.empty-line { color: var(--text-3); font-size: 13.5px; padding: 6px 0; }

/* ---------- select models ---------- */
.models-section { padding: 16px 20px 18px; }
.mdd-multi { margin-top: 12px; }
.mdd-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mdd-chips { display: flex; flex-wrap: wrap; gap: 10px; flex: 1 1 360px; min-width: 0; }
.model-chip {
  height: 36px; padding: 0 8px 0 6px; gap: 10px; border-radius: 999px; border: 0;
  background: var(--accent-soft); color: var(--text); font-weight: 550; font-size: 13.5px;
}
.model-chip .chip-label { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-chip button { width: 24px; height: 24px; color: var(--text-3); }
.mdd-placeholder { color: var(--text-3); font-size: 13.5px; padding: 10px 2px; }
.mdd-tools { display: flex; align-items: center; gap: 10px; flex: 0 1 auto; }
.mdd-searchbox {
  display: flex; align-items: center; gap: 8px; height: 38px; width: 220px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text-3); cursor: text;
}
.mdd-searchbox:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.mdd-inline-input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 13.5px; color: var(--text); padding: 0; }
.mdd-inline-input:focus { outline: none; box-shadow: none; }
.mdd-count {
  display: inline-flex; align-items: center; gap: 14px; height: 38px; padding: 0 12px 0 14px; white-space: nowrap;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); font-size: 13.5px; color: var(--text-2); cursor: pointer;
}
.mdd-count:hover, .mdd-multi.open .mdd-count { border-color: var(--accent); color: var(--text); }
.mdd-count svg { transition: transform .15s; }
.mdd-multi.open .mdd-count svg { transform: rotate(180deg); }
.mdd-multi .mdd-pop { left: auto; right: 0; width: min(620px, 100%); }
.mdd-row { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.mdd:not(.mdd-multi) .mdd-trigger { gap: 10px; }

/* provider badges */
.pbadge {
  --pb-bg: #475569; --pb-fg: #fff;
  display: inline-grid; place-items: center; flex: none; border-radius: 50%;
  background: var(--pb-bg); color: var(--pb-fg); font-weight: 800; font-family: var(--sans); line-height: 1;
}
.pbadge-sm { width: 26px; height: 26px; font-size: 12.5px; }
.pbadge-lg { width: 44px; height: 44px; font-size: 19px; border-radius: 12px; }
.pbadge.ring { box-shadow: inset 0 0 0 1px var(--border-strong); }

/* ---------- step sections ---------- */
.step-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.step-num {
  width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 14.5px;
}
.prompt-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.prompt-row .odd { flex: 0 1 540px; min-width: 260px; }
.odd-trigger { padding: 0 14px; height: 38px; gap: 12px; border-radius: 10px; }
.odd-trigger > svg:first-child { color: var(--accent-text); }
.odd-value { flex: 1; font-size: 14px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.odd-option.custom { border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); margin-top: 4px; padding-top: 12px; }

/* ---------- configure ---------- */
.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.io-card { border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; min-width: 0; background: var(--surface); }
.io-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.io-head > svg { color: var(--text-2); flex: none; }
.io-title { font-weight: 650; font-size: 14px; }
.io-head .spacer { flex: 1; }
.mini-btn {
  height: 28px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--accent-text); cursor: pointer;
}
.mini-btn:hover { background: var(--accent-soft); }
.mini-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.io-area {
  margin: 0 12px; min-height: 110px; height: 126px; resize: vertical; border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 10px 12px; font-size: 13.5px; line-height: 1.55; background: var(--surface); color: var(--text);
}
.io-area.code { font-family: var(--mono); font-size: 12.5px; }
.io-area.readonly { background: var(--surface-2); color: var(--text-2); cursor: default; }
.io-area:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.io-body { display: flex; flex-direction: column; gap: 10px; }
.io-fields { display: flex; flex-direction: column; gap: 10px; padding: 0 14px; }
.io-field { display: flex; flex-direction: column; gap: 4px; }
.io-field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.io-field-hint { font-size: 11.5px; color: var(--text-3); }
.io-foot { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 4px 12px; margin-top: auto; }
.char-count { font-size: 12px; color: var(--text-3); }

.run-row { display: flex; align-items: flex-start; gap: 18px; margin-top: 16px; }
.adv { flex: 1; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); min-width: 0; }
.adv > summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 9px 16px; cursor: pointer; border-radius: 12px; }
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary > svg:first-child { color: var(--text-2); }
.adv > summary > svg:last-child { color: var(--text-3); transition: transform .15s; margin-left: auto; }
.adv[open] > summary > svg:last-child { transform: rotate(180deg); }
.adv-text { display: flex; flex-direction: column; }
.adv-title { font-weight: 650; font-size: 14px; }
.adv-sub { font-size: 12.5px; color: var(--text-3); }
.adv-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; padding: 14px 18px 16px; border-top: 1px solid var(--border); }
.adv-note { grid-column: 1 / -1; }
.run-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.run-issues { margin-top: 6px; font-size: 12.5px; color: var(--text-3); min-height: 18px; text-align: right; }
.run-issues.has-issues { color: var(--warning); }
.scope-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; padding: 9px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45; color: var(--text); background: color-mix(in srgb, var(--warning) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent); }
.scope-note svg { flex: none; margin-top: 2px; color: var(--warning); }

/* ---------- right column ---------- */
.aside-card { padding: 16px; }
.aside-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.aside-icon { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.aside-title { font-size: 15.5px; font-weight: 700; }
.aside-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat-tile { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface); min-width: 0; }
.stat-tile-value { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-tile-label { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.model-info-list { display: flex; flex-direction: column; gap: 10px; }
.model-info { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.model-info-main { flex: 1; min-width: 0; }
.model-info-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.model-info-name { font-weight: 650; font-size: 13.5px; overflow-wrap: anywhere; }
.avail { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.avail::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.avail.ok { color: var(--success); }
.avail.ok::before { background: var(--success); }
.avail.warn { color: var(--warning); }
.avail.warn::before { background: var(--warning); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pill { height: 24px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--surface-3); font-size: 12px; font-weight: 550; color: var(--text-2); }

/* ---------- dashboard ---------- */
.dash-hero { display: flex; align-items: center; gap: 16px; padding: 22px 24px; flex-wrap: wrap; }
.dash-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dash-agents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.agent-tile {
  display: flex; align-items: center; gap: 14px; padding: 16px; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text);
}
.agent-tile:hover { border-color: var(--accent); background: var(--surface-2); }
.agent-tile > svg { color: var(--text-3); margin-left: auto; flex: none; }
.agent-tile-text { display: flex; flex-direction: column; min-width: 0; }
.agent-tile-name { font-weight: 650; }
.agent-tile-sub { font-size: 12.5px; color: var(--text-3); }
.recent-list { display: flex; flex-direction: column; margin-top: 12px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.recent-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; text-align: left; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text); }
.recent-item:last-child { border-bottom: 0; }
.recent-item:hover { background: var(--surface-2); }
.recent-main { display: flex; flex-direction: column; min-width: 0; }
.recent-name { font-weight: 600; font-size: 13.5px; }
.recent-sub { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-meta { font-size: 12px; color: var(--text-3); white-space: nowrap; }

.main[data-view="history"] > .stack, .main[data-view="record"] > .stack { max-width: 1240px; }

/* ---------- modal ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(15, 23, 42, 0.45); display: grid; place-items: center; padding: 20px; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); outline: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 8px; }
.modal-lead { color: var(--text-2); font-size: 14px; }
.modal-h { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-top: 12px; }
.modal-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.modal-examples { display: flex; flex-direction: column; gap: 8px; }
.example-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); cursor: pointer; font-size: 13.5px; color: var(--text); }
.example-btn:hover { border-color: var(--accent); }
.example-use { color: var(--accent-text); font-weight: 600; font-size: 12.5px; flex: none; }

/* ---------- results inside the narrower column ---------- */
#results:empty { display: none; }
.cards { grid-auto-columns: minmax(330px, 1fr); }

/* ---------- responsive ---------- */
@media (max-width: 1320px) {
  .ws-grid { grid-template-columns: minmax(0, 1fr); }
  .ws-aside { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 1100px) {
  .config-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-agents { grid-template-columns: minmax(0, 1fr); }
  .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .nav-toggle { display: grid; place-items: center; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { justify-content: flex-start; }
  .main { padding: 16px 14px 40px; }
  .user-name { display: none; }
  .brand-sub { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 10px; gap: 6px; }
  .brand { gap: 8px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-title { font-size: 15px; }
  .topbar-actions { gap: 6px; }
  .status-pill { padding: 0 10px; }
  .page-header, .models-section, .card-pad { padding-left: 16px; padding-right: 16px; }
  .page-actions { width: 100%; justify-content: space-between; }
  .mdd-tools { width: 100%; }
  .mdd-searchbox { flex: 1; width: auto; }
  .run-row { flex-direction: column; align-items: stretch; }
  .run-actions { justify-content: flex-end; }
  .run-actions .btn-xl { flex: 1; }
  .adv-body { grid-template-columns: minmax(0, 1fr); }
  .ws-aside { grid-template-columns: minmax(0, 1fr); }
  .run-issues { text-align: left; }
  .menu { right: -8px; }
}

/* fixes after visual review */
.metric-value.unavailable { overflow-wrap: normal; word-break: keep-all; font-size: 11px; }
.mdd:not(.mdd-multi) .mdd-trigger { justify-content: flex-start; }
.mdd:not(.mdd-multi) .mdd-trigger .mdd-single { flex: 1; align-items: flex-start; text-align: left; }

/* Long, unbroken text (URLs, ids) in alerts must wrap inside the card. */
.alert-body { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.alert-body a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }


/* ---------- collapsible panels ---------- */
.nav-toggle { display: grid; place-items: center; }
.nav-toggle:hover { background: var(--surface-3); color: var(--text); }
@media (min-width: 901px) {
  body.nav-collapsed .shell { grid-template-columns: minmax(0, 1fr); }
  body.nav-collapsed .sidebar { display: none; }
}
.ws-grid.aside-hidden { grid-template-columns: minmax(0, 1fr); }
#aside-toggle[aria-pressed="true"] { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }

.grad-teal { background: linear-gradient(135deg, #14b8a6, #0e7490); }
.grad-green { background: linear-gradient(135deg, #22c55e, #15803d); }
.grad-pink { background: linear-gradient(135deg, #ec4899, #be185d); }

/* step headers without a subtitle: centre the number with the title */
.step-head { align-items: center; }

/* reference date row (calendar prompt) */
.date-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: 0 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.date-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.date-label svg { color: var(--accent-text); }
.date-input { width: auto; height: 34px; padding: 4px 10px; }
.weekday-pill { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 12.5px; font-weight: 650; }
.date-hint { flex-basis: 100%; font-size: 12px; color: var(--text-3); }

/* =====================================================================
   REDESIGN v2 — tabbed workspace, large system prompt, motion.
   ===================================================================== */
@font-face {
  font-family: 'Manrope';
  src: url('/vendor/fonts/manrope.woff2') format('woff2');
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/vendor/fonts/jetbrains-mono.woff2') format('woff2');
  font-weight: 100 800; font-style: normal; font-display: swap;
}
:root {
  --sans: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --bg: #F4F6FB;
  --text: #0F172A;
  --text-2: #475467;
  --text-3: #5B6478;
  --accent: #1D5BDC;
  --accent-soft: #EAF1FF;
  --orange: #C2560F;
  --orange-soft: #FFF1E6;
}
@media (prefers-color-scheme: dark) {
  :root { --orange: #F59E5B; --orange-soft: #2E2013; }
}

/* motion */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes shimmer { 0% { background-position: -500px 0; } 100% { background-position: 500px 0; } }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes shine { 0% { left: -45%; } 55%, 100% { left: 125%; } }
@keyframes popIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

/* page frame */
.ws-page { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.ws-head { overflow: visible; }
.ws-head .page-header { border-bottom: 0; padding-bottom: 6px; }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--accent-text); }
.btn-outline:hover { background: var(--accent-soft); }

/* tabs */
.tabbar { display: flex; flex-wrap: wrap; gap: 0 28px; padding: 0 22px; border-bottom: 1px solid var(--border); }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 2px;
  border: 0; background: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--text-3); cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab-active { color: var(--accent-text); }
.tab-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0;
  background: var(--accent); transform-origin: left; animation: growX .28s ease both;
}
.tab-count { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.tab-panel { display: flex; flex-direction: column; gap: 18px; animation: fadeUp .35s ease both; }
.tab-panel > *:nth-child(2) { animation: fadeUp .4s .05s ease both; }
.tab-panel > *:nth-child(3) { animation: fadeUp .45s .1s ease both; }
.tab-panel > *:nth-child(4) { animation: fadeUp .5s .15s ease both; }
.tab-stack { display: flex; flex-direction: column; gap: 18px; }

/* setup: models + prompt */
.setup-top { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.setup-top .models-section { padding: 0; }
.setup-divider { height: 1px; background: var(--border); }
.setup-top .prompt-row { gap: 14px; justify-content: flex-start; }
.setup-top .prompt-row .odd { flex: 1 1 360px; }
.model-chip { animation: popIn .25s ease both; }

/* section heads */
.sys-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.sys-head .spacer { flex: 1; }
.head-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.head-icon.blue { background: var(--accent-soft); color: var(--accent-text); }
.head-icon.orange { background: var(--orange-soft); color: var(--orange); }
.tag-muted { background: var(--surface-3); color: var(--text-2); }
.tag-orange { background: var(--orange-soft); color: var(--orange); }
.pop { animation: popIn .25s ease both; }
.icon-btn.bordered { width: 38px; height: 38px; border: 1px solid var(--border); background: var(--surface); }
.edit-btn {
  min-height: 38px; padding: 0 18px; border-radius: 10px; border: 1px solid #C9D5EE; background: var(--surface);
  color: var(--accent-text); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; transition: background-color .15s;
}
.edit-btn:hover { background: var(--accent-soft); }
.edit-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* the system prompt — large */
.sys-card { overflow: hidden; }
.sys-view, .sys-edit {
  display: block; width: 100%; box-sizing: border-box; height: 460px; margin: 0;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.75;
}
.sys-card.expanded .sys-view, .sys-card.expanded .sys-edit { height: min(78vh, 900px); }
.sys-view { overflow-y: auto; padding: 14px 0; background: var(--surface-2); color: #1E293B; outline: none; }
.sys-view:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.sys-line { display: flex; }
.sys-line .ln { flex: 0 0 56px; text-align: right; padding-right: 16px; color: #A3ACBD; user-select: none; }
.sys-line .lt { flex: 1; min-width: 0; padding-right: 22px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sys-line.heading .lt { color: var(--accent-text); font-weight: 600; }
.sys-edit { border: 0; resize: vertical; padding: 16px 22px; background: #FFFDF9; color: var(--text); outline: none; }
.sys-edit:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.sys-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3); }
@media (prefers-color-scheme: dark) {
  .sys-view { color: #D3DAE6; }
  .sys-edit { background: #191F2A; }
  .sys-line .ln { color: #5E6B80; }
}

/* user input */
.user-card { overflow: hidden; }
.user-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.user-input {
  width: 100%; box-sizing: border-box; height: 128px; resize: vertical; border: 1px solid var(--border-strong); border-radius: 12px;
  padding: 14px 16px; font: inherit; font-size: 15px; line-height: 1.55; background: var(--surface); color: var(--text);
}
.user-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.user-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-3); }
.user-body .date-row, .user-body .io-fields { margin: 0; padding-left: 0; padding-right: 0; }
.user-body .date-row { padding: 10px 12px; }
.ex-head { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.ex-head svg { color: #E8742C; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.ex-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface); font: inherit; color: var(--text); cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.ex-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15, 23, 42, .08); border-color: var(--accent); }
.ex-card.picked { border: 1.5px solid var(--accent); background: var(--accent-soft); }
.ex-tag { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--orange); }
.ex-card.picked .ex-tag { color: var(--accent-text); }
.ex-text { font-size: 14px; font-weight: 600; line-height: 1.45; }
.ex-cta { font-size: 13px; font-weight: 700; color: var(--accent-text); }

/* run row */
.run-block { display: flex; flex-direction: column; }
.run-block .run-row { margin-top: 0; align-items: stretch; }
.run-block .adv { background: var(--surface); }
.run-block .adv > summary { min-height: 56px; box-sizing: border-box; }
.run-actions .btn-xl { min-height: 56px; height: auto; border-radius: 14px; padding: 0 32px; font-size: 16px; font-weight: 800; }
.run-shine { position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.run-shine:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(29, 91, 220, .35); }
.run-shine::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 35%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .32), transparent); animation: shine 3.2s ease-in-out infinite;
}
.run-shine.busy::after { animation-duration: 1.2s; }

/* results tab */
.overview { display: flex; flex-wrap: wrap; gap: 14px; }
.overview-stats { flex: 1 1 480px; }
.overview-stats .stat-tile { padding: 16px 18px; border-radius: 14px; }
.overview-stats .stat-tile-value { font-size: 24px; font-weight: 800; }
.rt-chart { flex: 1 1 380px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.rt-rows { display: flex; flex-direction: column; gap: 12px; }
.rt-row { display: flex; flex-direction: column; gap: 6px; }
.rt-label { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; }
.rt-track { height: 10px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.rt-fill {
  --w: 50%; --d: 0s;
  height: 100%; width: var(--w); border-radius: 6px; background: var(--accent);
  transform-origin: left; animation: growX 1.1s cubic-bezier(.2, .8, .2, 1) var(--d) both;
}
.rt-fill.fastest { background: #12A150; }
.skeleton-block { padding: 0 0 16px; display: flex; flex-direction: column; gap: 12px; }
.skeleton-block .skeleton { --sw: 80%; height: 14px; width: var(--sw); margin: 0 16px; }
.skeleton {
  background: linear-gradient(90deg, #EDF1F8 0px, #F9FAFD 220px, #EDF1F8 440px);
  background-size: 1000px 100%; animation: shimmer 1.5s linear infinite; border-radius: 6px;
}
@media (prefers-color-scheme: dark) {
  .skeleton { background: linear-gradient(90deg, #212836 0px, #2A3243 220px, #212836 440px); background-size: 1000px 100%; }
}
.run-progress { height: 4px; background: var(--surface-3); overflow: hidden; margin-bottom: 6px; }
.run-progress span { display: block; width: 40%; height: 100%; background: var(--accent); animation: indeterminate 1.4s ease-in-out infinite; }
.badge-accent .spinner { display: none; }
.badge-accent:has(.spinner)::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.2s ease-in-out infinite; }
.cards { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); overflow-x: visible; }
article.card { animation: fadeUp .4s ease both; }

/* evaluate tab */
.rate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.rate-card { padding: 4px 0 0; }
.rate-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 4px; font-weight: 800; font-size: 15px; }
.rate-card .card-section { border-bottom: 0; }

@media (max-width: 640px) {
  .tabbar { padding: 0 14px; gap: 0 20px; overflow-x: auto; flex-wrap: nowrap; }
  .setup-top { padding: 14px 16px; }
  .sys-view, .sys-edit { height: 320px; font-size: 12.5px; }
  .sys-line .ln { flex-basis: 40px; padding-right: 10px; }
  .user-body { padding: 14px; }
  .run-actions .btn-xl { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.shell { grid-template-columns: 284px minmax(0, 1fr); }
@media (max-width: 900px) { .shell { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .mdd-tools { width: 100%; min-width: 0; }
  .mdd-searchbox { flex: 1 1 0; min-width: 0; }
  .mdd-count { flex: none; }
}


/* header: Sign in link */
.signin-link {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--accent-text);
  font-size: 14px; font-weight: 700; text-decoration: none; transition: background-color .15s, border-color .15s;
}
.signin-link:hover { background: var(--accent-soft); border-color: #C9D5EE; }
.signin-link:focus-visible { outline: none; box-shadow: var(--focus); }
@media (max-width: 640px) {
  .signin-link { width: 38px; padding: 0; justify-content: center; }
  .signin-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 640px) {
  .topbar .brand { min-width: 0; flex: 1 1 auto; }
  .topbar .brand-text { min-width: 0; }
  .topbar .brand-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 359px) {
  .topbar .brand-text { display: none; }
}

/* ---------- system prompt versions ---------- */
.sys-versions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 18px;
  border-bottom: 1px solid var(--border); background: var(--surface-2, var(--surface));
}
.sys-versions .spacer { flex: 1; }
.sys-versions-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.sys-version-select {
  height: 34px; min-width: 0; max-width: 240px; padding: 0 28px 0 10px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.sys-version-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sys-versions-note { font-size: 12px; color: var(--text-3); }
.sys-ver-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; }
.sys-ver-btn:disabled { opacity: .5; cursor: not-allowed; background: var(--surface); }
.sys-ver-btn.danger { color: var(--danger); }
.sys-ver-btn.danger:hover { background: var(--danger-soft); }
@media (max-width: 640px) {
  .sys-versions { padding: 10px 12px; }
  .sys-version-select { min-width: 0; flex: 1; }
  .sys-versions .spacer { display: none; }
}

/* ---------- live token streaming ---------- */
.stream-note { display: flex; align-items: center; gap: 8px; padding: 0 16px 6px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; animation: pulse 1.2s ease-in-out infinite; }
.response.streaming { max-height: 420px; overflow: auto; }
.stream-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.stream-text::after {
  content: ""; display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em;
  background: var(--accent); animation: caretBlink 1s steps(1) infinite;
}
@keyframes caretBlink { 0%, 45% { opacity: 1; } 50%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .stream-text::after, .live-dot { animation: none; } }

/* ---------- "Reuse identical results" ---------- */
.adv-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); cursor: pointer; }
.adv-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.adv-check strong { display: block; font-size: 13.5px; color: var(--text); }
.adv-check .field-hint { display: block; margin-top: 2px; }

.signin-link[hidden] { display: none; }

/* normal users: streamed reply rendered as Markdown */
.stream-md > :last-child::after {
  content: ""; display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em;
  background: var(--accent); animation: caretBlink 1s steps(1) infinite;
}
.stream-pending { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; }
.stream-pending[hidden] { display: none; }

.sys-head .char-count { white-space: nowrap; }
.char-count[hidden] { display: none; }

/* system prompt header: version dropdown + icon buttons */
.icon-btn:disabled { opacity: .45; cursor: not-allowed; background: var(--surface); }
.sys-ver-delete { width: 34px; height: 34px; color: var(--danger); }
.sys-ver-delete:hover { background: var(--danger-soft); color: var(--danger); }
.sys-head .sys-version-select { flex: 0 1 auto; min-width: 150px; }
@media (max-width: 640px) {
  .sys-head .sys-version-select { order: 10; flex: 1 1 100%; max-width: none; }
}

/* ---------- sidebar edge arrow (desktop) ---------- */
:root { --nav-w: 284px; }
.nav-edge { display: none; }
@media (min-width: 901px) {
  .nav-toggle { display: none !important; } /* the edge arrow replaces ☰ on desktop */
  .nav-edge {
    display: grid; place-items: center; position: fixed; z-index: 30;
    top: calc(var(--topbar-h) + 22px); left: calc(var(--nav-w) - 14px);
    width: 28px; height: 28px; padding: 0; border-radius: 50%;
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
    box-shadow: 0 2px 6px rgba(16, 24, 40, .12); cursor: pointer;
    transition: left .2s ease, background-color .15s, color .15s, transform .2s ease;
  }
  .nav-edge:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
  .nav-edge:focus-visible { outline: none; box-shadow: var(--focus); }
  .nav-edge svg { transition: transform .2s ease; }
  body.nav-collapsed .nav-edge { left: 8px; }
  body.nav-collapsed .nav-edge svg { transform: rotate(180deg); }
}
@media (prefers-reduced-motion: reduce) { .nav-edge, .nav-edge svg { transition: none; } }

/* ---------- Formatted view: clean and neutral ---------- */
.fx { display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 1.6; color: var(--text); }
.fx p { margin: 0; }
.fx .md > :first-child { margin-top: 0; }
.fx .md > :last-child { margin-bottom: 0; }
.fx-intro, .fx-outro { color: var(--text-2); }
.fx-root { display: flex; flex-direction: column; gap: 4px; }
.fx-heading { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.fx-meta { font-size: 13px; color: var(--text-3); }
.fx-text { margin-top: 4px !important; }
.fx-group { margin-top: 8px; }
.fx-group-label { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.fx-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.fx-item { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.fx-item:last-child { border-bottom: 0; padding-bottom: 0; }
.fx-title { margin: 0; font-size: 14.5px; font-weight: 650; }
.fx-num { display: inline-block; min-width: 22px; color: var(--text-3); font-weight: 600; }
.fx-item > .fx-meta, .fx-item > .fx-text, .fx-item > .fx-facts, .fx-item > .fx-group { margin-left: 22px; }
.fx-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 14px; margin: 6px 0 0; font-size: 13.5px; }
.fx-facts dt { color: var(--text-3); font-weight: 600; }
.fx-facts dd { margin: 0; overflow-wrap: anywhere; }
.fx-values { margin: 0; padding-left: 18px; }
@media (max-width: 640px) {
  .fx-facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .fx-facts dd { margin-bottom: 4px; }
  .fx-item > .fx-meta, .fx-item > .fx-text, .fx-item > .fx-facts, .fx-item > .fx-group { margin-left: 0; }
}

/* Ballogy chatbot card note and expiry warning */
.chatbot-note { margin-top: 2px; font-size: 12px; }
.warn-text { color: var(--warning); font-weight: 600; }

/* link check under each response */
.link-check { margin: 0 16px 12px; font-size: 13px; color: var(--text-2); }
.link-check > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; list-style: none; }
.link-check > summary::-webkit-details-marker { display: none; }
.link-check-label { font-weight: 700; color: var(--text); }
.link-check.has-dead > summary { color: var(--danger); }
div.link-check { display: flex; align-items: center; gap: 8px; }
.link-list { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.link-list li { display: flex; gap: 8px; align-items: baseline; overflow-wrap: anywhere; }
.link-mark { flex: none; width: 14px; font-weight: 700; }
.link-ok .link-mark { color: var(--success); }
.link-dead .link-mark { color: var(--danger); }
.link-unknown .link-mark { color: var(--text-3); }
td.na { color: var(--text-3); }

/* judge panel */
.eval-passes { margin-top: 10px; padding-top: 0; border-top: 0; }
.panel-eval > .meta-text { margin: 0; }
.panel-who { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
td.strong { font-weight: 700; }
.judge-detail > summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* notes for the judges */
.guidance-field { margin-top: 4px; }
.guidance-field .field-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.guidance-field .spacer { flex: 1; }
.guidance-area { margin: 0; width: 100%; box-sizing: border-box; min-height: 76px; height: 84px; }
.guidance-used { font-size: 13px; padding: 8px 12px; border-left: 3px solid var(--border-strong); background: var(--surface-2); border-radius: 0 8px 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.tie-note { margin: 2px 0 0; font-size: 13.5px; }

/* judge notes per pass */
.judge-pass { display: flex; flex-direction: column; gap: 8px; }
.judge-pass + .judge-pass { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.judge-pass-title { margin: 0; font-size: 13.5px; font-weight: 700; }

/* ---------- Evaluate tab: three steps and one action bar ---------- */
.eval-body { display: flex; flex-direction: column; gap: 0; padding-top: 6px; padding-bottom: 6px; }
.eval-body > * + * { margin-top: 0; }
.eval-step { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; }
.eval-step + .eval-step { border-top: 1px solid var(--border); }
.eval-step-head { display: flex; align-items: flex-start; gap: 10px; }
.eval-step-num {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; background: var(--accent-soft); color: var(--accent-text);
}
.eval-step-title { margin: 0; font-size: 14.5px; font-weight: 700; }
.eval-step-sub { margin: 2px 0 0; font-size: 13px; color: var(--text-3); }
.eval-step-body { display: flex; flex-direction: column; gap: 10px; padding-left: 34px; min-width: 0; }
.eval-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.eval-suggest:empty { display: none; }
.eval-suggest-label { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.eval-suggest-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 4px; border-radius: 999px;
  border: 1px dashed var(--border-strong); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.eval-suggest-chip:hover { border-style: solid; border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.eval-suggest-chip .provider-badge, .eval-suggest-chip .pbadge { transform: scale(.85); }
.eval-judge-note:empty { display: none; }
.eval-inline-note { margin: 0; display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--text-2); }
.eval-inline-note svg { flex: none; margin-top: 3px; color: var(--accent-text); }
.eval-inline-note.warn, .eval-inline-note.warn svg { color: var(--warning); }
.eval-criteria { display: flex; flex-wrap: wrap; gap: 8px; }
.eval-criterion {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer;
}
.eval-criterion input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.eval-criterion:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.eval-criterion:focus-within { box-shadow: var(--focus); }
.eval-add-notes { align-self: flex-start; }
.guidance-foot { display: flex; align-items: flex-start; gap: 10px; }
.guidance-foot .field-hint { flex: 1; margin: 0; }
.eval-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 20px;
  border-top: 1px solid var(--border); background: var(--surface-2);
}
.eval-summary { font-size: 13px; color: var(--text-2); font-weight: 600; }
.eval-results:empty { display: none; }
.eval-results { border-top: 1px solid var(--border); }
.eval-how { margin-top: 4px; }
@media (max-width: 640px) { .eval-step-body { padding-left: 0; } }

/* ---------- evaluation result ---------- */
.res { display: flex; flex-direction: column; gap: 14px; }
.res-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.res-head-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.res-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.res-title { margin: 0; font-size: 16px; font-weight: 750; }
.res-when { font-size: 12.5px; color: var(--text-3); }
.res-verdict { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); }
.res-verdict-label { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.res-verdict-text { margin: 0; font-size: 15px; }
.res-verdict-gap { color: var(--text-2); }
.res-verdict .tie-note { margin: 0; color: var(--text-2); font-size: 13.5px; }
.res-verdict .tie-note strong { display: none; } /* the verdict line already says who tied */
.res-section-title { margin: 4px 0 -4px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.res-quotes { display: flex; flex-direction: column; gap: 8px; }
.res-quote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--border-strong); background: var(--surface-2); border-radius: 0 10px 10px 0; font-size: 14px; color: var(--text); }
.res-quote p { margin: 0; }
.res-quote cite { display: block; margin-top: 4px; font-style: normal; font-size: 12.5px; color: var(--text-3); }
.res-board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.res-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--surface); display: flex; flex-direction: column; gap: 12px; }
.res-item.best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.res-item-head { display: flex; align-items: center; gap: 10px; }
.res-rank { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--surface-3); color: var(--text-2); }
.res-item.best .res-rank { background: var(--accent); color: #fff; }
.res-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.res-name strong { font-size: 14.5px; overflow-wrap: anywhere; }
.res-label { font-size: 12px; color: var(--text-3); }
.res-overall { display: flex; align-items: baseline; gap: 4px; flex: none; }
.res-overall-num { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.res-overall-of { font-size: 12.5px; color: var(--text-3); }
.res-crit { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; }
.res-crit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label label" "bar num"; align-items: center; gap: 4px 10px; font-size: 13px; }
.res-crit-row .res-crit-label { grid-area: label; color: var(--text-2); }
.res-crit-row .res-bar { grid-area: bar; }
.res-crit-row .res-crit-num { grid-area: num; min-width: 26px; }
.res-crit-num { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.res-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.res-bar-fill { --w: 0%; display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--accent); }
.res-self { margin: 0; display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text-3); }
.res-why > summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--accent-text); }
.res-why[open] > summary { margin-bottom: 8px; }
.res-why-judge + .res-why-judge { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.res-why-by { margin: 0 0 4px; font-size: 13px; font-weight: 700; }
.res-why-by span { font-weight: 500; color: var(--text-3); }
.res-why-text { margin: 0 0 8px; font-size: 13.5px; }
.res-pros-cons { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 20px; }
.res-pros-cons ul { margin: 0; padding-left: 18px; font-size: 13.5px; }
.res-list-title { margin: 0 0 4px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.res-list-title.good { color: var(--success); }
.res-list-title.bad { color: var(--danger); }
.res-small { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--text-3); }
.res-small p { margin: 0; }
@media (max-width: 640px) {
  .res-item-head { flex-wrap: wrap; }
  .res-crit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Judge instructions (evaluation step 4) */
.judge-instr { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.judge-instr-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.judge-instr-head .spacer { flex: 1; }
.judge-instr-view { max-height: 180px; overflow: auto; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.judge-instr-text { width: 100%; min-height: 160px; font-family: var(--font-mono, ui-monospace, monospace); font-size: 12.5px; line-height: 1.5; }
.judge-instr-used { white-space: normal; padding: 0; }
.judge-instr-used .pre-block { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Dashboard (home) ---------- */
.dash { gap: 18px; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 4px 2px 0; }
.dash-head-text { min-width: 0; }
.dash-title { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; }
.dash-sub { color: var(--text-2); font-size: 14.5px; margin-top: 4px; }
.dash-facts { color: var(--text-3); font-size: 12.5px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.dash-bottom { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dash-panel { display: flex; flex-direction: column; gap: 14px; }
.dash-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dash .dash-agents { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 0; }
.dash .agent-tile { padding: 12px 14px; border-radius: 12px; gap: 12px; transition: border-color .15s, background .15s, transform .15s; }
.dash .agent-tile:hover { transform: translateY(-1px); }
.dash .page-icon.sm { width: 36px; height: 36px; border-radius: 10px; }
.dash .recent-list { margin-top: 0; }
.dash .recent-item { padding: 11px 14px; align-items: flex-start; }
.dash .recent-meta { text-align: right; line-height: 1.5; }
.dash-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 12px; color: var(--text-3); text-align: center; font-size: 13.5px; border: 1px dashed var(--border-strong); border-radius: 12px; }

/* ---------- Coach panel ---------- */
.coach-section { overflow: hidden; }
.coach-pad { padding: 18px 22px 22px; }
.coach-hint { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text-3); font-size: 13px; }

/* picking a coach */
.coach-pick { display: flex; flex-direction: column; gap: 16px; padding: 22px 24px 24px;
  background: radial-gradient(1200px 160px at 0% 0%, var(--accent-soft), transparent 70%); }
.coach-pick-intro { display: flex; align-items: flex-start; gap: 14px; }
.coach-pick-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #3b82f6, #1f4fd8); box-shadow: 0 6px 14px rgba(31, 79, 216, .25); }
.coach-pick-title { font-size: 18px; font-weight: 750; letter-spacing: -0.01em; }
.coach-pick-sub { color: var(--text-2); font-size: 13.5px; margin-top: 3px; max-width: 70ch; }
.coach-picker { display: flex; flex-direction: column; gap: 10px; }
.coach-search-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border-strong); border-radius: 14px; padding: 0 14px; background: var(--surface); box-shadow: var(--shadow); color: var(--text-3); }
.coach-search-row:focus-within { box-shadow: var(--focus); border-color: var(--accent); color: var(--accent); }
.coach-search-input { flex: 1; min-width: 0; border: 0 !important; outline: 0; background: transparent !important; height: 50px; font-size: 15.5px; color: var(--text); box-shadow: none !important; padding: 0 !important; }
.coach-results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 8px; }
.coach-result { width: 100%; height: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: left; color: var(--text); transition: border-color .15s, background .15s, box-shadow .15s; }
.coach-result:hover, .coach-result:focus-visible { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow); }
.coach-result > svg { color: var(--text-3); flex: none; }
.coach-result-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.coach-result-name { font-weight: 700; overflow-wrap: anywhere; }
.coach-result-sub { font-size: 12.5px; color: var(--text-3); overflow-wrap: anywhere; }
.coach-handle { font-weight: 500; color: var(--text-3); margin-left: 6px; font-size: .82em; }

/* avatar */
.coach-avatar { width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, #3b82f6, #6366f1); }
.coach-avatar.xl { width: 58px; height: 58px; font-size: 19px; box-shadow: 0 0 0 4px var(--surface), 0 8px 18px rgba(31, 79, 216, .25); }

/* banner */
.coach-banner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 22px;
  background: linear-gradient(120deg, var(--accent-soft), transparent 75%); border-bottom: 1px solid var(--border); }
.coach-head-main { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 3px; }
.coach-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.coach-name { margin: 0; font-size: 21px; font-weight: 750; letter-spacing: -0.015em; }
.coach-sub { margin: 0; font-size: 13px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.coach-ids { color: var(--text-3); }
.coach-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.coach-home { display: flex; flex-direction: column; gap: 16px; padding: 18px 22px 20px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); min-width: 0; }
.kpi-top { display: flex; align-items: center; gap: 8px; }
.kpi-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.kpi-label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.kpi-value { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--text-3); }
.skeleton-kpi { height: 104px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton-kpi { animation: none; } }

.meter { display: block; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter-fill { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: linear-gradient(90deg, #3b82f6, #1f4fd8); transition: width .4s ease; }
.meter-sm { width: 90px; height: 5px; flex: none; }

.coach-about { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.chip-soft { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-weight: 600; font-size: 12.5px; }
.coach-goals { display: inline-flex; gap: 8px; align-items: center; color: var(--text-2); }
.coach-goals strong { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }

/* sections */
.coach-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.coach-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.span-full { grid-column: 1 / -1; }
.coach-block { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); min-width: 0; overflow: hidden; }
.coach-block-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.coach-block-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.coach-block-title { font-size: 14px; font-weight: 700; flex: 1; }
.coach-count { min-width: 24px; height: 22px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.coach-block-body { padding: 4px 0; }
.coach-block-body > .coach-list, .coach-block-body > .coach-empty, .coach-block-body > .coach-block-error { padding: 8px 14px 10px; }
.coach-empty { color: var(--text-3); font-size: 13px; padding: 14px; }
.coach-block-error { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

.coach-table-wrap { border: 0; border-radius: 0; max-height: 440px; overflow: auto; }
.coach-table { font-size: 13px; }
.coach-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.coach-table td, .coach-table th { white-space: nowrap; padding: 9px 14px; }
.coach-table td:first-child { white-space: normal; }
.coach-table tbody tr:hover { background: var(--surface-2); }
.coach-table .muted { color: var(--text-3); }
.player { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.player-dot { width: 24px; height: 24px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: 10px; font-weight: 700; }
.mini-tag { display: inline-flex; margin-left: 8px; height: 19px; padding: 0 7px; align-items: center; border-radius: 999px; font-size: 10.5px; font-weight: 700; background: var(--warning-soft); color: var(--warning); vertical-align: middle; }
.progress-cell { display: flex; align-items: center; gap: 10px; }

.coach-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.coach-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.coach-list li:last-child { border-bottom: 0; }
.coach-list-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.coach-list-main strong { font-size: 13.5px; overflow-wrap: anywhere; }
.coach-list-num { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.coach-list-num small { font-weight: 500; color: var(--text-3); font-size: 12px; }

.coach-context .pre-block { max-height: 320px; overflow: auto; white-space: pre-wrap; }
.coach-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }

.coach-run-chip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 10px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; }
.history-coach { display: flex; align-items: center; gap: 4px; margin: 0 0 4px; }

@media (max-width: 1180px) {
  .dash-bottom, .coach-layout { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .dash .dash-agents { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 20px; }
  .kpi-label { font-size: 12px; }
  .coach-banner, .coach-home, .coach-pick { padding-left: 16px; padding-right: 16px; }
  .dash-title { font-size: 21px; }
}

/* Live-data agent (Coach Chat) */
.live-card { display: flex; flex-direction: column; }
.live-body { display: flex; flex-direction: column; gap: 12px; padding: 0 20px 18px; color: var(--text-2); font-size: 14px; }
.live-empty { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: 12px; }
.live-empty p { margin: 0; }
.live-preview { display: flex; flex-direction: column; gap: 10px; }
.live-pre { max-height: 420px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; }
.live-summary { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.live-summary p { margin: 0; }

/* ================= Coach Profile screen ================= */
.cp-page { --cp-orange: #f97316; --cp-teal: #0ea5a4; --cp-green: #16a34a; --cp-ink: #0b1530;
  display: flex; flex-direction: column; gap: 0; max-width: 1280px; animation: cp-fade .35s ease both; }
@keyframes cp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cp-rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes cp-grow { from { width: 0; } }
@keyframes cp-draw { from { stroke-dashoffset: var(--c); } to { stroke-dashoffset: var(--off); } }
@keyframes cp-seg { from { opacity: 0; } to { opacity: 1; } }
@keyframes cp-spin { to { transform: rotate(360deg); } }
@keyframes cp-drift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes cp-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes cp-pulse { 0%, 100% { opacity: .55; } 50% { opacity: .9; } }

/* hero */
.cp-hero { position: relative; overflow: hidden; border-radius: 22px; color: #fff; isolation: isolate;
  background: linear-gradient(120deg, #0b1530 0%, #12307a 38%, #1f4fd8 66%, #7c3aed 100%);
  background-size: 220% 220%; animation: cp-drift 18s ease-in-out infinite;
  box-shadow: 0 18px 50px -18px rgba(31, 79, 216, .55); }
.cp-hero-art { position: absolute; inset: 0; color: rgba(255, 255, 255, .13); z-index: -1; }
.cp-hero-art svg { width: 100%; height: 100%; }
.cp-hero-glow { position: absolute; width: 420px; height: 420px; right: -80px; top: -160px; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 115, 22, .55), transparent 65%); filter: blur(10px); animation: cp-pulse 6s ease-in-out infinite; }
.cp-hero-inner { position: relative; padding: 22px 28px 50px; display: flex; flex-direction: column; gap: 16px; }
.cp-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08); color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px); transition: background .2s; }
.cp-back:hover { background: rgba(255, 255, 255, .18); }
.cp-hero-main { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.cp-avatar-wrap { position: relative; width: 96px; height: 96px; flex: none; display: grid; place-items: center; }
.cp-avatar-wrap::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, #f97316, #facc15, #22d3ee, #a78bfa, #f97316); animation: cp-spin 8s linear infinite; }
.cp-avatar { position: relative; width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 800; letter-spacing: .02em;
  background: linear-gradient(145deg, #1e3a8a, #0b1530); border: 4px solid rgba(255, 255, 255, .9); color: #fff; animation: cp-rise .5s .05s ease both; }
.cp-id { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; animation: cp-rise .5s .1s ease both; }
.cp-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.cp-name { margin: 0; font-size: clamp(24px, 3.2vw, 34px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: #fff; }
.cp-handle { margin-left: 10px; font-size: .55em; font-weight: 600; color: rgba(255, 255, 255, .7); }
.cp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-chip { padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(4px); animation: cp-rise .45s calc(.15s + var(--i, 0) * 50ms) ease both; }
.cp-ids { margin: 0; font-size: 12.5px; color: rgba(255, 255, 255, .7); }
.cp-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; animation: cp-rise .5s .2s ease both; }
.cp-actions-row { display: flex; gap: 8px; }
.cp-btn-primary { background: linear-gradient(135deg, #f97316, #fb923c); color: #fff; border: 0; font-weight: 700; height: 42px; padding: 0 18px;
  box-shadow: 0 10px 24px -8px rgba(249, 115, 22, .7); transition: transform .2s, box-shadow .2s; }
.cp-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(249, 115, 22, .8); background: linear-gradient(135deg, #ea580c, #f97316); }
.cp-btn-ghost { flex: 1; background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .25); }
.cp-btn-ghost:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.cp-goals { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .15); }
.cp-goals-label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .7); margin-right: 4px; }
.cp-goal { padding: 4px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; background: rgba(250, 204, 21, .18); border: 1px solid rgba(250, 204, 21, .35); color: #fef3c7;
  animation: cp-rise .45s calc(.25s + var(--i, 0) * 60ms) ease both; }

/* body */
.cp-body { display: flex; flex-direction: column; gap: 18px; margin-top: -26px; padding: 0 10px; position: relative; z-index: 1; }
.cp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cp-kpi { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: 18px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: 0 10px 30px -18px rgba(15, 23, 42, .35); animation: cp-rise .55s calc(.1s + var(--i, 0) * 80ms) cubic-bezier(.2, .8, .2, 1) both;
  transition: transform .25s, box-shadow .25s; }
.cp-kpi:hover { transform: translateY(-3px); box-shadow: 0 16px 36px -18px rgba(15, 23, 42, .45); }
.cp-kpi::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, var(--kpi-glow, rgba(31, 79, 216, .12)), transparent 70%); }
.cp-kpi.tone-teal { --kpi-glow: rgba(14, 165, 164, .16); }
.cp-kpi.tone-green { --kpi-glow: rgba(22, 163, 74, .16); }
.cp-kpi.tone-orange { --kpi-glow: rgba(249, 115, 22, .18); }
.cp-kpi-top { display: flex; align-items: center; gap: 9px; }
.cp-kpi-icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #3b82f6, #1f4fd8); }
.tone-teal .cp-kpi-icon { background: linear-gradient(135deg, #2dd4bf, #0e7490); }
.tone-green .cp-kpi-icon { background: linear-gradient(135deg, #4ade80, #15803d); }
.tone-orange .cp-kpi-icon { background: linear-gradient(135deg, #fb923c, #ea580c); }
.cp-kpi-label { font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.cp-kpi-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 64px; }
.cp-kpi-value { font-size: 32px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.cp-kpi-sub { font-size: 12px; color: var(--text-3); position: relative; z-index: 1; }

.cp-ring { width: 64px; height: 64px; flex: none; }
.cp-ring-track { stroke: var(--surface-3); }
.cp-ring-bar { stroke: #1f4fd8; stroke-dashoffset: var(--off); animation: cp-draw 1.1s .35s cubic-bezier(.2, .8, .2, 1) both; }
.cp-ring.tone-green .cp-ring-bar { stroke: #16a34a; }
.cp-ring.tone-orange .cp-ring-bar { stroke: #f97316; }

/* tabs */
.cp-tabs { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 5; display: flex; gap: 4px; padding: 5px; border-radius: 16px; overflow-x: auto; scrollbar-width: none;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--border); box-shadow: 0 8px 24px -16px rgba(15, 23, 42, .35);
  animation: cp-rise .5s .3s ease both; }
.cp-tabs::-webkit-scrollbar { display: none; }
.cp-tab { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border: 0; border-radius: 12px; background: transparent; color: var(--text-2);
  font-weight: 650; font-size: 13.5px; cursor: pointer; transition: background .2s, color .2s; }
.cp-tab:hover { background: var(--surface-3); color: var(--text); }
.cp-tab.on { background: linear-gradient(135deg, #1f4fd8, #3b82f6); color: #fff; box-shadow: 0 8px 18px -8px rgba(31, 79, 216, .7); }
.cp-tab-count { min-width: 22px; height: 20px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 999px; font-size: 11.5px; background: var(--surface-3); color: var(--text-2); }
.cp-tab.on .cp-tab-count { background: rgba(255, 255, 255, .22); color: #fff; }
.cp-panel { animation: cp-fade .3s ease both; }

/* cards */
.cp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cp-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cp-card { display: flex; flex-direction: column; min-width: 0; border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 10px 30px -22px rgba(15, 23, 42, .4); animation: cp-rise .55s calc(.05s + var(--i, 0) * 90ms) cubic-bezier(.2, .8, .2, 1) both; overflow: hidden; }
.cp-card.span-2 { grid-column: span 2; }
.cp-card.span-3 { grid-column: 1 / -1; }
.cp-card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.cp-card-icon { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: var(--accent-text); background: var(--accent-soft); }
.cp-card-title { margin: 0; font-size: 15px; font-weight: 750; flex: 1; }
.cp-pill { min-width: 26px; height: 22px; padding: 0 9px; display: inline-grid; place-items: center; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.cp-card-body { padding: 16px 18px; }
.cp-muted { color: var(--text-3); font-size: 12.5px; }
.cp-empty { padding: 26px 12px; text-align: center; color: var(--text-3); font-size: 13.5px; border: 1px dashed var(--border-strong); border-radius: 14px; }

/* bars */
.cp-bars { display: flex; flex-direction: column; gap: 11px; }
.cp-bar-row { display: grid; grid-template-columns: minmax(80px, 34%) minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 13px; }
.cp-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cp-bar-value { font-weight: 750; font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.cp-bar-track { display: block; height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.cp-bar-track.sm { height: 6px; }
.cp-bar-fill { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: linear-gradient(90deg, #3b82f6, #7c3aed);
  animation: cp-grow 1s .3s cubic-bezier(.2, .8, .2, 1) both; }
.cp-bar-row.muted .cp-bar-fill { background: var(--border-strong); }

/* donut */
.cp-donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.cp-donut-box { position: relative; width: 150px; height: 150px; }
.cp-donut { width: 100%; height: 100%; }
.cp-donut-seg { animation: cp-seg .5s calc(.35s + var(--i, 0) * 120ms) ease both; }
.seg-0 { stroke: #3b82f6; background: #3b82f6; } .seg-1 { stroke: #8b5cf6; background: #8b5cf6; } .seg-2 { stroke: #f97316; background: #f97316; }
.seg-3 { stroke: #14b8a6; background: #14b8a6; } .seg-4 { stroke: #94a3b8; background: #94a3b8; }
.cp-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cp-donut-center strong, .cp-donut-center strong span { font-size: 28px; font-weight: 800; line-height: 1; color: var(--text); }
.cp-donut-center span { font-size: 11.5px; color: var(--text-3); }
.cp-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; min-width: 120px; }
.cp-legend li { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; }
.cp-swatch { width: 12px; height: 12px; border-radius: 4px; }

/* progress list + timeline */
.cp-progress-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.cp-progress-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.cp-progress-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-progress-list .cp-bar-fill { background: linear-gradient(90deg, #22c55e, #16a34a); }
.cp-timeline { list-style: none; margin: 0; padding: 0 0 0 6px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.cp-timeline::before { content: ""; position: absolute; left: 10px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), transparent); border-radius: 2px; }
.cp-timeline li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; }
.cp-tl-dot { width: 10px; height: 10px; margin-left: 0; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.cp-timeline li > div, .cp-tl-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cp-tl-num { display: flex; align-items: baseline; gap: 3px; font-variant-numeric: tabular-nums; }
.cp-tl-num strong { font-size: 18px; font-weight: 800; }
.cp-tl-num small { color: var(--text-3); }

/* roster */
.cp-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cp-search { flex: 1 1 220px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-3); }
.cp-search:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.cp-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
.cp-select { height: 40px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); padding: 0 10px; max-width: 220px; }
.cp-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-3); gap: 2px; flex-wrap: wrap; }
.cp-seg-btn { height: 32px; padding: 0 11px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-weight: 650; font-size: 12.5px; cursor: pointer; transition: background .2s, color .2s; }
.cp-seg-btn.on { background: var(--surface); color: var(--accent-text); box-shadow: 0 2px 8px -2px rgba(15, 23, 42, .2); }
.cp-result-count { margin-left: auto; }
.cp-table-wrap { overflow: auto; max-height: 620px; border-radius: 14px; border: 1px solid var(--border); }
.cp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.cp-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; padding: 10px 14px; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--border); white-space: nowrap; }
.cp-table th.num, .cp-table td.num { text-align: right; }
.cp-table td { padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cp-table tbody tr:last-child td { border-bottom: 0; }
.cp-row { animation: cp-rise .4s calc(var(--i, 0) * 18ms) ease both; transition: background .15s; }
.cp-row:hover { background: var(--accent-soft); }
.cp-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.cp-sort.on { color: var(--accent-text); }
.cp-player { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cp-player-name { font-weight: 650; }
.cp-dot, .cp-team-dot, .cp-drill-dot { width: 30px; height: 30px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h, 220) 70% 58%), hsl(calc(var(--h, 220) + 40) 70% 46%)); }
.cp-tag-warn { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 10.5px; font-weight: 750; background: var(--warning-soft); color: var(--warning); }
.cp-pos { font-weight: 650; font-size: 12px; color: var(--text-2); }
.cp-age { display: inline-flex; height: 22px; align-items: center; padding: 0 8px; border-radius: 7px; background: var(--surface-3); font-size: 12px; font-weight: 650; }
.cp-team-cell { max-width: 260px; }
.cp-mini { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.cp-mini .cp-bar-track { width: 60px; }
.cp-mini .cp-bar-fill { background: linear-gradient(90deg, #22c55e, #16a34a); }
.cp-more { display: flex; justify-content: center; padding-top: 14px; }

/* teams */
.cp-team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cp-team { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface-2); animation: cp-rise .45s calc(var(--i, 0) * 50ms) ease both; transition: transform .2s, box-shadow .2s, border-color .2s; }
.cp-team:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 24px -16px rgba(31, 79, 216, .5); }
.cp-team.empty { opacity: .7; }
.cp-team-dot { width: 40px; height: 40px; border-radius: 12px; font-size: 13px; }
.cp-team-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cp-team-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-team-count { text-align: right; display: flex; flex-direction: column; }
.cp-team-count strong { font-size: 22px; font-weight: 800; line-height: 1; }
.cp-team-count span { font-size: 11px; color: var(--text-3); }
.cp-empty-groups { margin-top: 14px; }
.cp-empty-groups > summary { cursor: pointer; color: var(--text-2); font-weight: 650; font-size: 13px; margin-bottom: 12px; }

/* workouts */
.cp-workout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cp-workout { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2);
  animation: cp-rise .45s calc(var(--i, 0) * 40ms) ease both; transition: transform .2s, box-shadow .2s, border-color .2s; }
.cp-workout:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 12px 26px -16px rgba(31, 79, 216, .5); }
.cp-workout-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.cp-workout-group { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-workout-title { margin: 0; font-size: 15px; font-weight: 750; line-height: 1.3; }
.cp-workout-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.cp-workout-ring { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }
.cp-workout-ring .cp-ring { width: 40px; height: 40px; }
.cp-level { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 750; text-transform: capitalize; background: var(--surface-3); color: var(--text-2); }
.cp-level.lv-beginner { background: #dcfce7; color: #166534; }
.cp-level.lv-intermediate { background: #dbeafe; color: #1e40af; }
.cp-level.lv-advanced { background: #ffedd5; color: #9a3412; }

/* drills */
.cp-drills { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cp-drills li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; animation: cp-rise .4s calc(var(--i, 0) * 40ms) ease both; transition: background .15s; }
.cp-drills li:hover { background: var(--surface-2); }
.cp-drills li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cp-drill-dot { width: 34px; height: 34px; border-radius: 10px; }

/* skeletons + footer */
.cp-skel { min-height: 118px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: cp-shimmer 1.2s linear infinite; }
.cp-skel.tall { min-height: 240px; }
.cp-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 0; color: var(--text-3); font-size: 12.5px; }

/* dashboard: compact active-coach summary */
.coach-summary { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; padding: 16px 22px 20px; }
.coach-mini { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; color: var(--text); transition: transform .2s, border-color .2s; }
.coach-mini:hover { transform: translateY(-2px); border-color: var(--accent); }
.coach-mini strong { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.coach-mini span { font-size: 12px; color: var(--text-3); }
.coach-summary-open { margin-left: auto; align-self: center; }

@media (prefers-color-scheme: dark) {
  .cp-level.lv-beginner { background: #12341f; color: #86efac; }
  .cp-level.lv-intermediate { background: #172554; color: #93c5fd; }
  .cp-level.lv-advanced { background: #3b1d0b; color: #fdba74; }
}
@media (max-width: 1100px) {
  .cp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-grid, .cp-grid.two { grid-template-columns: minmax(0, 1fr); }
  .cp-card.span-2 { grid-column: auto; }
}
@media (max-width: 640px) {
  .cp-hero { border-radius: 16px; }
  .cp-hero-inner { padding: 16px 16px 34px; }
  .cp-avatar-wrap { width: 76px; height: 76px; }
  .cp-avatar { width: 68px; height: 68px; font-size: 24px; }
  .cp-actions { width: 100%; }
  .cp-body { padding: 0; margin-top: -22px; }
  .cp-kpis { gap: 10px; }
  .cp-kpi { padding: 12px; }
  .cp-kpi-value { font-size: 24px; }
  .cp-ring { width: 46px; height: 46px; }
  .cp-bar-row { grid-template-columns: minmax(70px, 38%) minmax(0, 1fr) auto; }
  .cp-team-cell { max-width: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  .cp-page *, .cp-page *::before, .cp-page { animation: none !important; transition: none !important; }
  .cp-ring-bar { stroke-dashoffset: var(--off); }
}

/* ---------- Coach Profile: polish (spotlight, beam, shimmer, orbs, highlights) ---------- */
@property --cp-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes cp-beam-spin { to { --cp-angle: 360deg; } }
@keyframes cp-shine { from { background-position: 0% 50%; } to { background-position: 200% 50%; } }
@keyframes cp-float-a { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-24px, 18px); } }
@keyframes cp-float-b { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, -16px); } }
@keyframes cp-glow-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, .0), 0 10px 30px -10px rgba(0, 0, 0, .45); } 50% { box-shadow: 0 0 0 10px rgba(249, 115, 22, .12), 0 10px 30px -10px rgba(0, 0, 0, .45); } }

/* hero: texture, floating orbs, beam, shimmering name */
.cp-hero-dots { position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%, #000 70%, transparent); mask-image: linear-gradient(90deg, transparent, #000 40%, #000 70%, transparent); }
.cp-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .18; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E"); }
.cp-orb { position: absolute; border-radius: 50%; filter: blur(28px); z-index: -1; pointer-events: none; }
.cp-orb.o1 { width: 180px; height: 180px; left: 8%; bottom: -70px; background: rgba(56, 189, 248, .35); animation: cp-float-a 12s ease-in-out infinite; }
.cp-orb.o2 { width: 120px; height: 120px; left: 46%; top: -40px; background: rgba(167, 139, 250, .4); animation: cp-float-b 14s ease-in-out infinite; }
.cp-orb.o3 { width: 90px; height: 90px; right: 24%; bottom: 10px; background: rgba(250, 204, 21, .25); animation: cp-float-a 10s ease-in-out infinite reverse; }
.cp-beam { position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 0;
  background: conic-gradient(from var(--cp-angle), transparent 0 70%, rgba(251, 146, 60, .95) 80%, rgba(250, 204, 21, .9) 86%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: cp-beam-spin 7s linear infinite; }
.cp-name-text { background: linear-gradient(90deg, #ffffff 0%, #c7d2fe 25%, #fde68a 50%, #c7d2fe 75%, #ffffff 100%); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: cp-shine 6s linear infinite; }
.cp-avatar { animation: cp-rise .5s .05s ease both, cp-glow-pulse 3.5s 1s ease-in-out infinite; }
.cp-chip { transition: background .2s, transform .2s; }
.cp-chip:hover { background: rgba(255, 255, 255, .24); transform: translateY(-1px); }

/* spotlight: a soft light that follows the pointer over a card */
.spot { position: relative; isolation: isolate; }
.spot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(59, 130, 246, .11), transparent 45%); }
.spot:hover::before { opacity: 1; }
.spot > * { position: relative; z-index: 1; }
.cp-kpi.tone-orange.spot::before { background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(249, 115, 22, .12), transparent 45%); }
.cp-kpi.tone-green.spot::before { background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(22, 163, 74, .12), transparent 45%); }

/* shadcn-style card finish: hairline top highlight, gradient icon chips */
.cp-card, .cp-kpi { background-image: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 60%, transparent), transparent 90px); }
.cp-kpi { border-top: 1px solid color-mix(in srgb, var(--border) 60%, #fff); }
.cp-card-icon { color: #fff; background: linear-gradient(135deg, #3b82f6, #6366f1); box-shadow: 0 6px 14px -6px rgba(59, 130, 246, .7); }
.cp-card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.cp-card { transition: border-color .25s, box-shadow .25s; }
.cp-card:hover { box-shadow: 0 16px 40px -24px rgba(31, 79, 216, .45); }
.cp-kpi-value { background: linear-gradient(180deg, var(--text), color-mix(in srgb, var(--text) 70%, var(--accent))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cp-tab:focus-visible, .cp-seg-btn:focus-visible, .cp-sort:focus-visible, .cp-back:focus-visible { outline: none; box-shadow: var(--focus); }

/* highlights strip */
.cp-insights { display: flex; flex-direction: column; gap: 10px; animation: cp-rise .55s .25s cubic-bezier(.2, .8, .2, 1) both; }
.cp-insights-title { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding-left: 4px; }
.cp-insights-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.cp-insight { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface);
  animation: cp-rise .5s calc(.3s + var(--i, 0) * 70ms) ease both; transition: transform .2s, border-color .2s; overflow: hidden; }
.cp-insight:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.cp-insight-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; color: #fff; }
.cp-insight.tone-blue .cp-insight-icon { background: linear-gradient(135deg, #60a5fa, #1d4ed8); }
.cp-insight.tone-violet .cp-insight-icon { background: linear-gradient(135deg, #c084fc, #7c3aed); }
.cp-insight.tone-teal .cp-insight-icon { background: linear-gradient(135deg, #2dd4bf, #0f766e); }
.cp-insight.tone-orange .cp-insight-icon { background: linear-gradient(135deg, #fdba74, #ea580c); }
.cp-insight.tone-green .cp-insight-icon { background: linear-gradient(135deg, #86efac, #15803d); }
.cp-insight-text { display: flex; flex-direction: column; min-width: 0; }
.cp-insight-label { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.cp-insight-value { font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-insight-sub { font-size: 12px; color: var(--text-2); }

/* tabs: smoother active pill, table header glass */
.cp-tab { position: relative; }
.cp-tab.on { animation: cp-tab-in .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes cp-tab-in { from { transform: scale(.94); opacity: .6; } to { transform: none; opacity: 1; } }
.cp-table thead th { background: color-mix(in srgb, var(--surface-2) 88%, transparent); backdrop-filter: blur(8px); }
.cp-row td:first-child { border-left: 3px solid transparent; transition: border-color .15s; }
.cp-row:hover td:first-child { border-left-color: var(--accent); }

/* view transitions for tab switches (Chrome/Edge): a gentle cross-fade + rise */
::view-transition-old(root) { animation: cp-vt-out .18s ease both; }
::view-transition-new(root) { animation: cp-vt-in .28s ease both; }
@keyframes cp-vt-out { to { opacity: 0; } }
@keyframes cp-vt-in { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  .cp-beam, .cp-orb, .cp-name-text, .cp-avatar { animation: none !important; }
  .cp-name-text { color: #fff; background: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}

/* Hero basketball (replaces the court circles) */
@keyframes cp-ball-spin { to { transform: rotate(360deg); } }
@keyframes cp-ball-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes cp-ball-shadow { 0%, 100% { transform: scaleX(1); opacity: .45; } 50% { transform: scaleX(.86); opacity: .3; } }
.cp-hero-art { color: inherit; }
.cp-ball-scene { position: absolute; left: clamp(160px, 36%, 520px); top: -34px; width: 330px; height: 330px;
  animation: cp-ball-bob 6s ease-in-out infinite; pointer-events: none; }
.cp-ball { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .34; filter: drop-shadow(0 0 40px rgba(249, 115, 22, .45)) saturate(1.1);
  animation: cp-ball-spin 60s linear infinite; }
.cp-ball-trail { position: absolute; width: 300px; height: 300px; left: -200px; top: 60px; color: #fdba74; opacity: .45; }
.cp-ball-shadow { position: absolute; left: 22%; right: 22%; bottom: -26px; height: 18px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .45), transparent);
  animation: cp-ball-shadow 6s ease-in-out infinite; }
@media (max-width: 900px) { .cp-ball-scene { left: auto; right: -70px; top: 20px; width: 240px; height: 240px; } .cp-ball-trail { display: none; } }
@media (prefers-reduced-motion: reduce) { .cp-ball-scene, .cp-ball, .cp-ball-shadow { animation: none !important; } }

/* Group picker (after choosing a coach), group switcher, Ballogy session badge */
.gp-page { display: flex; flex-direction: column; gap: 22px; max-width: 1200px; }
.gp-hero { position: relative; overflow: hidden; isolation: isolate; border-radius: 22px; color: #fff;
  background: linear-gradient(120deg, #0b1530 0%, #12307a 40%, #1f4fd8 70%, #7c3aed 100%); background-size: 220% 220%; animation: cp-drift 18s ease-in-out infinite;
  box-shadow: 0 18px 50px -18px rgba(31, 79, 216, .55); }
.gp-hero .cp-ball-scene { left: auto; right: 6%; top: -30px; }
.gp-hero-inner { position: relative; padding: 22px 28px 28px; display: flex; flex-direction: column; gap: 16px; }
.gp-hero-main { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cp-avatar-wrap.sm { width: 76px; height: 76px; }
.cp-avatar-wrap.sm .cp-avatar { width: 68px; height: 68px; font-size: 24px; }
.gp-title { margin: 4px 0 2px; font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.02em; }
.gp-sub { margin: 0 0 10px; color: rgba(255, 255, 255, .78); max-width: 62ch; font-size: 14px; }
.gp-body { display: flex; flex-direction: column; gap: 12px; padding: 0 4px; }
.gp-section { margin: 6px 0 0; font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.gp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.gp-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px; text-align: left; cursor: pointer;
  border-radius: 18px; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: 0 10px 28px -22px rgba(15, 23, 42, .45);
  animation: cp-rise .5s calc(.05s + var(--i, 0) * 55ms) cubic-bezier(.2, .8, .2, 1) both; transition: transform .25s, box-shadow .25s, border-color .25s, opacity .3s; }
.gp-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: 0 18px 36px -20px rgba(31, 79, 216, .55); }
.gp-card:focus-visible { outline: none; box-shadow: var(--focus); }
.gp-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 18px 36px -20px rgba(31, 79, 216, .55); }
.gp-card.empty { opacity: .75; }
.gp-card.picked { transform: scale(1.03); border-color: #16a34a; box-shadow: 0 0 0 4px rgba(22, 163, 74, .2), 0 22px 40px -20px rgba(22, 163, 74, .5); }
.gp-card.fading { opacity: .35; transform: scale(.98); }
.gp-dot { width: 46px; height: 46px; border-radius: 14px; font-size: 15px; display: inline-grid; place-items: center; color: #fff; font-weight: 800;
  background: linear-gradient(135deg, hsl(var(--h, 220) 70% 58%), hsl(calc(var(--h, 220) + 40) 70% 46%)); }
.gp-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.gp-name { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-meta { font-size: 12.5px; color: var(--text-3); }
.gp-count { display: flex; flex-direction: column; align-items: flex-end; }
.gp-count strong { font-size: 24px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.gp-count span { font-size: 11px; color: var(--text-3); }
.gp-check { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #16a34a;
  transform: scale(0); transition: transform .3s cubic-bezier(.2, 1.4, .4, 1); }
.gp-card.on .gp-check, .gp-card.picked .gp-check { transform: scale(1); }
.gp-skel { min-height: 92px; cursor: default; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: cp-shimmer 1.2s linear infinite; }

.cp-hero-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.gs-wrap { position: relative; }
.gs-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 999px; cursor: pointer; font-size: 13px; transition: background .2s, border-color .2s; }
.gs-btn .gs-label { font-weight: 600; opacity: .75; }
.gs-dark .gs-btn { color: #fff; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); backdrop-filter: blur(6px); }
.gs-dark .gs-btn:hover { background: rgba(255, 255, 255, .24); }
.gs-light .gs-btn { color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); }
.gs-light .gs-btn:hover { border-color: var(--accent); }
.gs-menu { position: fixed; z-index: 1000; min-width: 280px; max-height: 340px; overflow: auto; padding: 6px; border-radius: 16px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 24px 50px -20px rgba(15, 23, 42, .45); animation: cp-rise .25s ease both; }
.gs-opt { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 12px;
  background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.gs-opt:hover, .gs-opt.on { background: var(--accent-soft); }
.gs-opt-main { display: flex; flex-direction: column; min-width: 0; }
.gs-opt-main span { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-opt-main small { color: var(--text-3); }
.gs-opt:not(.on) { grid-template-columns: auto minmax(0, 1fr) auto; }
/* The player count is the thing people compare between teams, so it stands out as a pill. */
.gs-count { display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.gs-count strong { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.gs-count small { font-size: 11px; font-weight: 600; opacity: .85; }
.gs-opt:hover .gs-count, .gs-opt.on .gs-count { background: var(--accent); color: #fff; }
.gs-count.zero { background: var(--surface-2, rgba(127, 127, 127, .12)); color: var(--text-3); }
.gs-btn-count { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.gs-dark .gs-btn-count { background: rgba(255, 255, 255, .22); }
.gs-light .gs-btn-count { background: var(--accent-soft); color: var(--accent); }
.gs-dot { width: 30px; height: 30px; border-radius: 9px; font-size: 11px; display: inline-grid; place-items: center; color: #fff; font-weight: 800;
  background: linear-gradient(135deg, hsl(var(--h, 220) 70% 58%), hsl(calc(var(--h, 220) + 40) 70% 46%)); }
.gs-empty { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px; color: var(--text-3); font-size: 13px; }

.cp-session { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.gp-hero .cp-session, .cp-hero .cp-session { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); color: #fff; }
.coach-banner .cp-session { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.cp-session.st-ok svg { color: #4ade80; }
.cp-session.st-error svg { color: #fca5a5; }
.coach-banner .cp-session.st-ok svg { color: var(--success); }
.coach-banner .cp-session.st-error svg { color: var(--danger); }
.cp-session-retry { margin-left: 4px; border: 0; background: rgba(255, 255, 255, .2); color: inherit; border-radius: 999px; padding: 2px 8px; font-size: 12px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .gp-page, .gp-card, .gp-hero, .gs-menu { animation: none !important; transition: none !important; } }

/* Workspace: coach context banner (who the comparison is for) */
.ccb { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); background: linear-gradient(120deg, var(--accent-soft), var(--surface) 70%);
  box-shadow: 0 10px 26px -20px rgba(31, 79, 216, .5); animation: cp-rise .4s ease both; }
.cp-avatar-wrap.xs { width: 44px; height: 44px; }
.cp-avatar-wrap.xs .cp-avatar { width: 38px; height: 38px; font-size: 13px; border-width: 2px; }
.ccb-items { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 18px; }
.ccb-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ccb-label { font-size: 11px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.ccb-value { font-size: 14.5px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccb-sub { font-size: 12px; color: var(--text-3); }
.ccb .gs-btn { height: 30px; align-self: flex-start; }
.ccb-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ccb .cp-session { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.ccb .cp-session.st-ok svg { color: var(--success); }
@media (max-width: 900px) { .ccb-items { grid-template-columns: minmax(0, 1fr); } }

/* Agents: combined system prompt (one box, every step), the step that runs, the use-case card */
.sys-line.sec-head { margin-top: 12px; padding: 7px 0; cursor: pointer; border-radius: 10px; font-weight: 800; letter-spacing: .02em; color: var(--accent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 14%, transparent), color-mix(in srgb, var(--accent) 4%, transparent));
  transition: background .2s ease, transform .2s ease; }
.sys-line.sec-head:first-child { margin-top: 0; }
.sys-line.sec-head:hover { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 8%, transparent)); }
.sys-line.sec-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sys-line.in-step { box-shadow: inset 3px 0 0 var(--accent); }
.sys-line.sec-head.in-step { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 26%, transparent), color-mix(in srgb, var(--accent) 10%, transparent)); }
.sec-run-tag { margin: 0 14px 0 8px; padding: 1px 10px; border-radius: 999px; background: linear-gradient(135deg, var(--accent), #7c5cff); color: #fff; font-size: 11px; font-weight: 750; align-self: center; white-space: nowrap;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--accent) 70%, transparent); animation: popIn .3s ease both; }
.step-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); background: var(--accent-soft); font-size: 13.5px; color: var(--text-2); }
.step-note svg { flex: none; margin-top: 2px; color: var(--accent); }

.card.agent-about { position: relative; overflow: hidden; display: flex; flex-direction: row; align-items: center; gap: 16px; padding: 16px 20px;
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 9%, var(--surface)) 0%, var(--surface) 55%); }
.card.agent-about::after { content: ''; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); animation: sfFloat 7s ease-in-out infinite; pointer-events: none; }
.agent-about-icon { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; box-shadow: 0 10px 22px -10px rgba(31, 79, 216, .6); animation: popIn .45s ease both; }
.agent-about-body { position: relative; z-index: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.agent-about-title { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.agent-about-what { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Setup tab: progress strip, livelier cards */
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
  color: var(--text-3); background: var(--surface-2); border: 1.5px solid var(--border); transition: all .3s cubic-bezier(.2, .9, .3, 1.3); }

.tab-panel[data-tab="setup"] > .card { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.tab-panel[data-tab="setup"] > .card:hover { box-shadow: 0 18px 40px -26px rgba(15, 23, 42, .35); }
.tab-panel[data-tab="setup"] > .card:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent), 0 18px 40px -26px rgba(15, 23, 42, .35); }
.tab-panel[data-tab="setup"] > *:nth-child(5) { animation: fadeUp .55s .2s ease both; }
.tab-panel[data-tab="setup"] > *:nth-child(6) { animation: fadeUp .6s .25s ease both; }
.tab-panel[data-tab="setup"] .sys-head, .tab-panel[data-tab="setup"] .user-card > :first-child {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 4%, var(--surface)), var(--surface)); }
.tab-panel[data-tab="setup"] .sys-head .head-icon, .tab-panel[data-tab="setup"] .user-card .head-icon { transition: transform .3s ease; }
.tab-panel[data-tab="setup"] .card:hover .head-icon { transform: rotate(-8deg) scale(1.08); }
.tab-panel[data-tab="setup"] .user-input { transition: border-color .2s ease, box-shadow .25s ease, background .25s ease; }
.tab-panel[data-tab="setup"] .user-input:focus { background: color-mix(in srgb, var(--accent) 3%, var(--surface)); }
.tab-panel[data-tab="setup"] .ex-card { position: relative; overflow: hidden; }
.tab-panel[data-tab="setup"] .ex-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(180deg, var(--accent), #7c5cff); transform: scaleY(0); transform-origin: top; transition: transform .25s ease; }
.tab-panel[data-tab="setup"] .ex-card:hover::before, .tab-panel[data-tab="setup"] .ex-card.picked::before { transform: scaleY(1); }
.tab-panel[data-tab="setup"] .ex-grid > .ex-card { animation: fadeUp .45s ease both; }
.tab-panel[data-tab="setup"] .ex-grid > .ex-card:nth-child(2) { animation-delay: .06s; }
.tab-panel[data-tab="setup"] .ex-grid > .ex-card:nth-child(3) { animation-delay: .12s; }
.tab-panel[data-tab="setup"] .ex-grid > .ex-card:nth-child(4) { animation-delay: .18s; }
.tab-panel[data-tab="setup"] .run-shine:not(:disabled) { background: linear-gradient(120deg, var(--accent), #5b5cf0 55%, #7c5cff); background-size: 200% 100%; animation: sfGradient 6s ease infinite; box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--accent) 85%, transparent); }
.tab-panel[data-tab="setup"] .run-shine:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 18px 36px -14px color-mix(in srgb, var(--accent) 90%, transparent); }

@keyframes sfFloat { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-18px, 14px) scale(1.12); } }
@keyframes sfGradient { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@media (prefers-reduced-motion: reduce) {
  .card.agent-about::after, .tab-panel[data-tab="setup"] .run-shine { animation: none !important; }
  .tab-panel[data-tab="setup"] > .card { transition: none; }
}

/* "Select a coach first": the dashboard's coach search is highlighted */
.coach-section.attn { animation: coachAttn 1.6s ease both; }
@keyframes coachAttn {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); border-color: var(--accent); }
  40% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 0%, transparent); border-color: var(--accent); }
  70% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 35%, transparent); }
  100% { box-shadow: var(--shadow); }
}
@media (prefers-reduced-motion: reduce) { .coach-section.attn { animation: none; border-color: var(--accent); } }

/* Dashboard: the active coach card (same look as the Coach Profile hero, compact) */
.coach-section.has-coach { border: 0; background: transparent; box-shadow: none; overflow: visible; }
.cc-hero { position: relative; overflow: hidden; isolation: isolate; border-radius: 22px; color: #fff;
  background: linear-gradient(120deg, #0b1530 0%, #12307a 38%, #1f4fd8 66%, #7c3aed 100%);
  background-size: 220% 220%; animation: cp-drift 18s ease-in-out infinite, cp-rise .45s ease both;
  box-shadow: 0 22px 50px -22px rgba(31, 79, 216, .6); }
.cc-hero .cp-ball-scene { left: auto; right: -70px; top: -80px; width: 280px; height: 280px; }
.cc-hero .cp-hero-glow { right: -120px; top: -200px; }
.cc-inner { position: relative; padding: 22px 24px 20px; display: flex; flex-direction: column; gap: 14px; }
.cc-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cc-avatar { width: 76px; height: 76px; }
.cc-avatar .cp-avatar { width: 68px; height: 68px; font-size: 24px; border-width: 3px; }
.cc-online { position: absolute; right: 4px; bottom: 6px; width: 15px; height: 15px; border-radius: 50%; background: #22c55e; border: 3px solid #12307a;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: ccOnline 2.4s ease-out infinite; }
.cc-id { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; animation: cp-rise .5s .08s ease both; }
.cc-name { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.cc-name-text { background: linear-gradient(90deg, #fff, #dbe7ff 60%, #fde68a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cc-handle { font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, .7); }
.cc-ids { margin: 0; font-size: 12.5px; color: rgba(255, 255, 255, .7); letter-spacing: .01em; }
.cc-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; animation: cp-rise .5s .14s ease both; }
.cc-actions-row { display: flex; gap: 8px; }
.cc-actions-row .btn { flex: 1; justify-content: center; }
.cc-cta { position: relative; overflow: hidden; }
.cc-cta::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -45%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-18deg); animation: shine 3.6s ease-in-out infinite; }
.cc-icon-btn { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; cursor: pointer; color: #fff;
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); backdrop-filter: blur(6px); transition: background .2s, transform .2s; }
.cc-icon-btn:hover { background: rgba(255, 255, 255, .22); transform: translateY(-1px); }
.cc-icon-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cc-hero .cp-session { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); color: #fff; }
.cc-hero .cp-session.st-ok svg { color: #4ade80; }
.cc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.cc-stat { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px 16px; border-radius: 16px; text-align: left; cursor: pointer; color: #fff; font: inherit;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(10px);
  transition: transform .25s cubic-bezier(.2, .9, .3, 1.2), background .25s, border-color .25s, box-shadow .25s; }
.cc-stat:hover { transform: translateY(-4px); background: rgba(255, 255, 255, .17); border-color: rgba(255, 255, 255, .35); box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .6); }
.cc-stat:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cc-stat-icon { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #fff; box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .5); }
.cc-stat.tone-blue .cc-stat-icon { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.cc-stat.tone-teal .cc-stat-icon { background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.cc-stat.tone-green .cc-stat-icon { background: linear-gradient(135deg, #4ade80, #16a34a); }
.cc-stat.tone-orange .cc-stat-icon { background: linear-gradient(135deg, #fdba74, #ea580c); }
.cc-stat-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cc-stat-value { font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.cc-stat-label { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .9); }
.cc-stat-sub { font-size: 11.5px; color: rgba(255, 255, 255, .65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-stat .cp-ring { width: 46px; height: 46px; }
.cc-stat .cp-ring-track { stroke: rgba(255, 255, 255, .18); }
.cc-stat .cp-ring.tone-green .cp-ring-bar { stroke: #4ade80; }
.cc-stat-go { position: absolute; top: 10px; right: 10px; opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .2s; color: rgba(255, 255, 255, .85); }
.cc-stat:hover .cc-stat-go, .cc-stat:focus-visible .cc-stat-go { opacity: 1; transform: none; }
.cc-skel { min-height: 76px; cursor: default; background: linear-gradient(90deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .18), rgba(255, 255, 255, .08)); background-size: 200% 100%; animation: cp-shimmer 1.4s linear infinite; }
.cc-skel:hover { transform: none; box-shadow: none; }
.cc-error { border-radius: 14px; background: var(--surface); color: var(--text); }
.cc-error .coach-pad { padding: 14px; }
@keyframes ccOnline { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); } 70%, 100% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); } }
@media (max-width: 1100px) { .cc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .cc-inner { padding: 18px 16px; }
  .cc-actions { width: 100%; }
  .cc-stats { grid-template-columns: minmax(0, 1fr); }
  .cc-hero .cp-ball-scene { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cc-hero, .cc-online, .cc-cta::after, .cc-skel { animation: none !important; }
  .cc-stat { transition: none; }
}
.cc-stat:not(.cc-skel) { animation: cp-rise .5s calc(.12s + var(--i, 0) * .07s) ease both; }
@media (prefers-reduced-motion: reduce) { .cc-stat:not(.cc-skel) { animation: none; } }

/* Setup: the Models card (and its open dropdown) stays above the cards after it, which are
   animated and so each paint as their own layer. */
.tab-panel[data-tab="setup"] > .setup-top { position: relative; z-index: 30; }
.tab-panel[data-tab="setup"] > .setup-top:focus-within, .tab-panel[data-tab="setup"] > .setup-top:has(.mdd.open) { z-index: 60; }
.tab-panel[data-tab="setup"] > .setup-top:hover { transform: none; }
/* No model chosen yet: the Models card asks for one; Run stays disabled. */
.setup-top.needs-models { border-color: color-mix(in srgb, var(--warning, #d97706) 55%, var(--border)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning, #d97706) 12%, transparent); }
#run-button:disabled { cursor: not-allowed; filter: grayscale(.35); opacity: .65; box-shadow: none; animation: none; }

/* Coach Profile with a group selected: the team's name as the first figure, and its glance card */
.cp-kpi-text { display: block; max-width: 100%; font-size: 21px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-glance { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cp-glance-tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border); animation: cp-rise .45s calc(var(--i, 0) * .06s) ease both; transition: transform .2s, border-color .2s; }
.cp-glance-tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.cp-glance-icon { grid-row: 1 / span 3; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), #7c5cff); }
.cp-glance-value { font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cp-glance-label { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.cp-glance-sub { font-size: 12px; color: var(--text-3); }
@media (max-width: 640px) { .cp-glance { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .cp-glance-tile { animation: none; } }

/* Step headings: name beside the heading, a button to choose the step, the input part marked */
.sys-line.sec-head { cursor: default; }
.sec-run-btn { margin: 0 12px 0 8px; align-self: center; flex: none; height: 24px; padding: 0 10px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 700;
  color: var(--accent); background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); opacity: .55; transition: opacity .15s, background .15s, color .15s; }
.sys-line.sec-head:hover .sec-run-btn, .sec-run-btn:focus-visible { opacity: 1; }
.sec-run-btn:hover { background: var(--accent); color: #fff; }
.sys-line.sec-input .lt { font-style: italic; font-weight: 700; color: var(--text-3); }
.sys-line.sec-input { background: color-mix(in srgb, var(--text-3) 7%, transparent); }
.step-warn { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 12px; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; color: var(--text-2);
  border: 1px solid color-mix(in srgb, var(--warning, #d97706) 45%, var(--border)); background: color-mix(in srgb, var(--warning, #d97706) 9%, var(--surface)); }
.step-warn > svg { flex: none; margin-top: 2px; color: var(--warning, #d97706); }
.step-warn > span { flex: 1; min-width: 220px; }

/* A model's reply shown as the coach sees it (Ballogy's own formatting), raw output on demand */
.presented-note { margin: 0 16px 12px; font-size: 12.5px; color: var(--text-3); }
.presented-note > summary { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; cursor: pointer; }
.presented-open { margin-left: auto; color: var(--accent); font-weight: 650; }
.presented-note .response-raw { max-height: 320px; overflow: auto; }

/* No navigation until a coach and their group are chosen (super users with coach data) */
body.nav-locked .shell { grid-template-columns: minmax(0, 1fr) !important; }
body.nav-locked .sidebar, body.nav-locked .nav-edge, body.nav-locked .nav-toggle { display: none !important; }
/* …and the page sits centred in the full width meanwhile */
body.nav-locked .main > * { margin-left: auto; margin-right: auto; width: 100%; }

/* History page: back to the dashboard */
.back-home { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 650; color: var(--accent-text, var(--accent)); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  transition: background .2s, color .2s, transform .2s; }
.back-home:hover { background: var(--accent); color: #fff; transform: translateX(-2px); }
.back-home:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Library check on a result card (display only) */
.lib-check { margin: 10px 16px 0; align-self: flex-start; font-size: 12.5px; }
.lib-check > summary { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px; cursor: pointer; list-style: none; font-weight: 650; }
.lib-check > summary::-webkit-details-marker { display: none; }
.lib-check.ok > summary { color: #15803d; background: color-mix(in srgb, #16a34a 12%, var(--surface)); border: 1px solid color-mix(in srgb, #16a34a 35%, var(--border)); }
.lib-check.warn > summary { color: #b45309; background: color-mix(in srgb, #d97706 12%, var(--surface)); border: 1px solid color-mix(in srgb, #d97706 40%, var(--border)); }
.lib-check-body { margin-top: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); }
.lib-check-body p { margin: 0 0 6px; }
.lib-check-body ul { margin: 0 0 6px; padding-left: 18px; }
.lib-check-body .meta-text { margin: 0; }

/* ---- choose a coach: animated hero + featured coaches ---- */
.coach-section.coach-landing { background: transparent; border: 0; box-shadow: none; overflow: visible; display: flex; flex-direction: column; gap: 22px; }
.cl-hero { position: relative; overflow: hidden; isolation: isolate; border-radius: 26px; color: #fff;
  background: linear-gradient(120deg, #0b1530 0%, #12307a 36%, #1f4fd8 64%, #7c3aed 100%);
  background-size: 240% 240%; animation: cp-drift 16s ease-in-out infinite, cp-rise .5s ease both;
  box-shadow: 0 30px 70px -30px rgba(31, 79, 216, .7); }
.cl-hero .cp-ball-scene { left: auto; right: -50px; top: -60px; width: 320px; height: 320px; }
.cl-hero .cp-hero-glow { right: -120px; top: -200px; }
.cl-inner { position: relative; padding: 34px 34px 30px; display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.cl-title { font-size: clamp(28px, 4vw, 40px); font-weight: 820; letter-spacing: -0.025em; line-height: 1.1; margin: 4px 0 0; animation: cp-rise .55s .08s ease both; }
.cl-title-accent { background: linear-gradient(90deg, #fde68a, #fb923c, #f472b6, #fde68a); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: cp-shine 5s linear infinite; }
.cl-sub { color: rgba(255, 255, 255, .82); font-size: 15px; line-height: 1.55; max-width: 62ch; margin: 0 0 8px; animation: cp-rise .55s .14s ease both; }
.cl-hero .coach-picker { animation: cp-rise .55s .2s ease both; }
.cl-hero .coach-search-row { border: 0; border-radius: 16px; padding: 4px 16px; box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .55); transition: transform .2s, box-shadow .2s; }
.cl-hero .coach-search-row:focus-within { transform: translateY(-1px); box-shadow: 0 0 0 4px rgba(255, 255, 255, .28), 0 18px 40px -16px rgba(0, 0, 0, .6); }
.cl-hero .coach-search-input { font-size: 15.5px; padding-block: 12px; }
.cl-hero .coach-hint { color: rgba(255, 255, 255, .85); }
.cl-hero .coach-results { margin-top: 2px; }
.cl-hero .coach-result { box-shadow: 0 8px 22px -14px rgba(0, 0, 0, .5); animation: cp-rise .3s ease both; }

.cl-featured { display: flex; flex-direction: column; gap: 14px; }
.cl-featured-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 0 4px; }
.cl-featured-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; font-weight: 760; letter-spacing: -0.01em; }
.cl-featured-title svg { color: var(--accent); }
.cl-featured-sub { margin: 3px 0 0; color: var(--text-3); font-size: 13px; }
.fc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.fc-card { --hue: 220; position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; gap: 10px; padding: 16px; text-align: left; cursor: pointer;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
  animation: cp-rise .5s calc(var(--i, 0) * 60ms + .15s) ease both; transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s, border-color .22s; }
.fc-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; z-index: -1;
  background: linear-gradient(90deg, hsl(var(--hue) 85% 58%), hsl(calc(var(--hue) + 50) 85% 60%)); }
.fc-card:hover, .fc-card:focus-visible { transform: translateY(-4px); border-color: hsl(var(--hue) 70% 60% / .55);
  box-shadow: 0 18px 38px -18px hsl(var(--hue) 70% 40% / .55); }
.fc-shine { position: absolute; top: 0; bottom: 0; left: -45%; width: 40%; z-index: -1; pointer-events: none; transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, hsl(var(--hue) 90% 70% / .16), transparent); }
.fc-card:hover .fc-shine { animation: shine 1.1s ease; }
.fc-top { display: flex; align-items: center; gap: 11px; }
.fc-avatar { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px; color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .02em;
  background: linear-gradient(135deg, hsl(var(--hue) 80% 55%), hsl(calc(var(--hue) + 45) 80% 45%)); box-shadow: 0 8px 18px -8px hsl(var(--hue) 80% 40% / .7);
  transition: transform .25s; }
.fc-card:hover .fc-avatar { transform: rotate(-6deg) scale(1.06); }
.fc-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fc-name { font-weight: 750; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-handle { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-go { color: var(--text-3); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); transition: transform .2s, background .2s, color .2s; }
.fc-card:hover .fc-go { transform: translateX(3px); background: hsl(var(--hue) 80% 55%); color: #fff; }
.fc-where { margin: 0; color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.fc-stat { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); }
.fc-stat svg { color: hsl(var(--hue) 70% 50%); }
.fc-stat strong { color: var(--text); font-variant-numeric: tabular-nums; }
.fc-skel { min-height: 128px; cursor: default; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 400% 100%; animation: cp-shimmer 1.4s linear infinite; }
.fc-skel::before { display: none; }

/* ---- the coach whose data a run used (record page, live preview) ---- */
.rc-coach { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); animation: cp-rise .4s ease both; }
.rc-avatar { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; color: #fff; font-weight: 800; font-size: 13px;
  background: linear-gradient(135deg, #3b82f6, #7c3aed); box-shadow: 0 6px 14px -6px rgba(59, 130, 246, .7); }
.rc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.rc-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.rc-name { font-weight: 750; font-size: 14.5px; }
.rc-group, .rc-as { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.rc-group { color: var(--accent-text); background: var(--accent-soft); }
.rc-as { color: #7c3aed; background: color-mix(in srgb, #7c3aed 12%, transparent); }
.rc-parts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rc-part { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 8px; font-size: 12px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border);
  animation: cp-rise .35s calc(var(--i, 0) * 50ms + .1s) ease both; }
.rc-part svg { color: var(--success); }
.rc-part.none { color: var(--text-3); }
.rc-when { font-size: 12px; color: var(--text-3); margin-left: 4px; }

/* ---- History: one comparison ---- */
.rec-hero { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); animation: cp-rise .4s ease both; }
.rec-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rec-back { margin-left: -8px; }
.rec-head { display: flex; align-items: center; gap: 14px; }
.rec-head-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rec-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.rec-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.rec-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-3); font-size: 13px; }
.rec-meta span { display: inline-flex; align-items: center; gap: 5px; }
.rec-io { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; align-items: start; }
.rec-box > summary { display: flex; align-items: center; gap: 8px; }
.rec-box > summary svg { color: var(--text-3); }

@media (max-width: 640px) {
  .cl-inner { padding: 26px 20px 22px; }
  .cl-hero .cp-ball-scene { opacity: .5; }
  .rec-top { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .cl-hero, .cl-title, .cl-sub, .cl-hero .coach-picker, .fc-card, .rc-coach, .rc-part, .rec-hero, .cl-title-accent { animation: none !important; }
  .fc-card, .fc-avatar, .fc-go { transition: none; }
}

/* ---- History: saved evaluations (read-only) ---- */
.saved-eval { display: flex; flex-direction: column; gap: 14px; }
.saved-eval-head { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.saved-eval-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.saved-eval-label { min-width: 92px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.saved-eval-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface); border: 1px solid var(--border); }
.saved-eval-when { margin-left: auto; }
.saved-evals .empty-state p { margin: 6px 0 0; }

/* =====================================================================
   Evaluate tab: "Your Feedback Matters" card beside the AI evaluation.
   ===================================================================== */
.eval-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .eval-layout { grid-template-columns: minmax(0, 1fr); } }
.fb-card { position: sticky; top: calc(var(--topbar-h) + 16px); overflow: hidden; }
@media (max-width: 1100px) { .fb-card { position: static; } }
.fb-head { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.fb-head-icon { width: 44px; height: 44px; flex: none; border-radius: 12px; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.fb-head-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.fb-title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.fb-title-row .panel-title { font-size: 16px; font-weight: 800; margin: 0; }
.fb-head .panel-desc { margin: 0; line-height: 1.5; }
.fb-about { margin: 0; padding: 10px 20px; font-size: 12.5px; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.fb-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 20px; }
.fb-section { display: flex; flex-direction: column; gap: 8px; }
.fb-label { margin: 0; font-weight: 800; font-size: 14px; }
.fb-req { color: var(--danger); }
.fb-optional { font-weight: 500; color: var(--text-3); }
.fb-hint { margin: 0; font-size: 13px; color: var(--text-2); }
.fb-hint.center { text-align: center; font-size: 12.5px; color: var(--text-3); }

.fb-stars { display: flex; gap: 6px; }
.fb-stars-sm { gap: 0; }
.fb-star { display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; width: 44px; height: 44px; color: var(--border-strong); cursor: pointer; transition: transform .12s ease, color .12s ease; }
.fb-stars-sm .fb-star { width: 32px; height: 32px; border: 0; background: none; border-radius: 6px; }
.fb-star.on { color: #f5a524; }
.fb-star:hover { transform: scale(1.1); color: #f5a524; }
.fb-star:focus-visible { outline: none; box-shadow: var(--focus); }

.fb-opinions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fb-op { --c: var(--success); --c-soft: var(--success-soft); min-height: 44px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--c); font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.fb-op-partly { --c: var(--warning, #a16207); --c-soft: var(--warning-soft, #fdf6e3); }
.fb-op-disagree { --c: var(--danger); --c-soft: var(--danger-soft); }
.fb-op:hover { border-color: var(--c); }
.fb-op.on { border: 2px solid var(--c); background: var(--c-soft); }
.fb-op:focus-visible { outline: none; box-shadow: var(--focus); }

.fb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-chip { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.fb-chip.on { border: 2px solid var(--danger); background: var(--danger-soft); color: var(--danger); }
.fb-chip:focus-visible { outline: none; box-shadow: var(--focus); }

.fb-model { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.fb-model-row { display: flex; align-items: center; gap: 10px; }
.fb-model-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.fb-model-name { font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.fb-ballogy { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: var(--warning-soft, #fdf6e3); color: var(--warning, #a16207); }
.fb-note { height: 40px; font-size: 13px; }
.fb-winner { margin: 0; padding: 10px 12px; border-radius: 9px; font-size: 13px; line-height: 1.5; }
.fb-winner.same { background: var(--success-soft); color: var(--success); }
.fb-winner.differs { background: var(--warning-soft, #fdf6e3); color: var(--warning, #a16207); }

.fb-comment { min-height: 80px; }
.fb-count { align-self: flex-end; font-size: 12px; color: var(--text-3); }
.fb-actions { display: flex; gap: 8px; }
.fb-submit { flex: 1; min-height: 46px; justify-content: center; font-weight: 800; }
.fb-submit:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.fb-done { align-items: center; text-align: center; gap: 12px; }
.fb-done-icon { width: 56px; height: 56px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--success-soft); color: var(--success); animation: fb-pop .45s ease-out both; }
.fb-done-title { margin: 0; font-size: 16px; font-weight: 800; }
.fb-done-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.fb-done-comment { margin: 0; padding: 4px 0 4px 12px; border-left: 3px solid var(--border-strong); color: var(--text-2); text-align: left; align-self: stretch; overflow-wrap: anywhere; }

.fb-others { margin: 0 20px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.fb-others summary { padding: 10px 12px; cursor: pointer; font-weight: 700; }
.fb-others ul { margin: 0; padding: 0 12px 12px 28px; display: flex; flex-direction: column; gap: 6px; }
.fb-others-comment { display: block; color: var(--text-2); overflow-wrap: anywhere; }

@keyframes fb-pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .fb-done-icon { animation: none; }
  .fb-star { transition: none; }
}

/* =====================================================================
   History: review filters (Phase 2) and the Judge Trust page (Phase 3).
   ===================================================================== */
.hf-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.hf-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.hf-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: inherit; font-weight: 700; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.hf-tab:hover { border-color: var(--accent); }
.hf-tab.on { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.hf-tab:focus-visible { outline: none; box-shadow: var(--focus); }
.hf-count { font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-variant-numeric: tabular-nums; }
.hf-tab.on .hf-count { background: var(--accent); color: #fff; }
.hf-selects { display: flex; flex-wrap: wrap; gap: 8px; }
.hf-selects .select, .jt-filters .select { min-height: 40px; width: auto; min-width: 150px; }

.jt-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.jt-kpis { margin-bottom: 4px; }
@media (max-width: 900px) { .jt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .jt-kpis { grid-template-columns: minmax(0, 1fr); } }
.jt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.jt-panel { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.jt-panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px; }
.jt-panel-head .panel-title { margin: 0; font-size: 16px; font-weight: 800; }
.jt-panel-head .panel-desc { margin: 2px 0 0; }
.jt-legend { display: flex; gap: 12px; font-size: 12.5px; color: var(--text-2); }
.jt-legend span { display: inline-flex; align-items: center; gap: 5px; }
.jt-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.jt-dot.agree, .jt-seg.agree { background: var(--success); }
.jt-dot.partly, .jt-seg.partly { background: #e0a526; }
.jt-dot.disagree, .jt-seg.disagree { background: var(--danger); }
.jt-rows { display: flex; flex-direction: column; gap: 14px; }
.jt-judge { display: flex; flex-direction: column; gap: 6px; animation: jt-rise .45s ease-out both; animation-delay: calc(var(--i, 0) * 70ms); }
.jt-judge-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.jt-judge-name { font-weight: 700; }
.jt-judge-num { margin-left: auto; font-size: 13px; color: var(--text-2); }
.jt-judge-num strong { color: var(--text); }
.jt-stack { display: flex; gap: 2px; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.jt-seg { width: var(--w); transform-origin: left center; animation: jt-grow .9s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms + 120ms); }
.jt-seg[style*="--w: 0%"] { display: none; }
.jt-issue { display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr) 28px; gap: 12px; align-items: center; font-size: 13.5px; animation: jt-rise .45s ease-out both; animation-delay: calc(var(--i, 0) * 60ms); }
.jt-issue strong { text-align: right; font-variant-numeric: tabular-nums; }
.jt-bar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.jt-bar-fill { display: block; height: 100%; width: var(--w); border-radius: 999px; background: #c2410c; transform-origin: left center; animation: jt-grow .9s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 60ms + 120ms); }
.jt-none { margin: 0; }
.jt-table td.wrap { max-width: 320px; color: var(--text-2); }
.jt-stars { color: #f5a524; letter-spacing: 1px; }
.jt-stars-off { color: var(--border-strong); }
@keyframes jt-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes jt-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .jt-judge, .jt-seg, .jt-issue, .jt-bar-fill { animation: none; }
  .hf-tab { transition: none; }
}
@media (max-width: 560px) {
  .jt-issue { grid-template-columns: minmax(0, 1fr) 28px; }
  .jt-issue .jt-bar { grid-column: 1 / -1; grid-row: 2; }
}

/* =====================================================================
   Reports: tabs, Ballogy vs Models (Phase 4), Improve Ballogy (Phase 5).
   ===================================================================== */
.rp-nav { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); }
.rp-tab { min-height: 44px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-2); font: inherit; font-weight: 700; cursor: pointer; }
.rp-tab:hover { color: var(--text); }
.rp-tab.on { color: var(--accent-text); border-bottom-color: var(--accent); }
.rp-tab:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.jt-dot.win, .jt-seg.win, .bv-key.ballogy, .jt-bar-fill.ballogy { background: var(--accent); }
.jt-dot.tie, .jt-seg.tie { background: var(--border-strong); }
.jt-dot.loss, .jt-seg.loss, .jt-bar-fill.loss { background: #e8730c; }
.bv-key.other, .jt-bar-fill.other { background: #98a2b3; }
.bv-key { width: 18px; height: 4px; border-radius: 2px; display: inline-block; }
.bv-pos { color: var(--success); font-weight: 700; }
.bv-neg { color: var(--danger); font-weight: 700; }

.bv-source { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bv-source-label { font-weight: 700; color: var(--text-2); }
.bv-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-3); }
.bv-seg-btn { min-height: 36px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font: inherit; font-weight: 700; cursor: pointer; }
.bv-seg-btn.on { background: var(--surface); color: var(--accent-text); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.bv-seg-btn:focus-visible { outline: none; box-shadow: var(--focus); }

.bv-kpis { grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .bv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .bv-kpis { grid-template-columns: minmax(0, 1fr); } }
.bv-win { flex-direction: row; align-items: center; gap: 16px; }
.bv-ring { position: relative; width: 96px; height: 96px; flex: none; }
.bv-ring svg { width: 96px; height: 96px; }
.bv-ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }

.bv-trend { width: 100%; height: auto; display: block; overflow: visible; }
.bv-grid { stroke: var(--border); stroke-width: 1; }
.bv-axis { fill: var(--text-3); font-size: 10px; font-family: inherit; }
.bv-line { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: bv-draw 1.4s cubic-bezier(.3, .6, .2, 1) .15s forwards; }
.bv-line.ballogy { stroke: var(--accent); }
.bv-line.other { stroke: #98a2b3; stroke-width: 3; }
.bv-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; animation: bv-fade .4s ease-out 1.1s both; }
@keyframes bv-fade { from { opacity: 0; } to { opacity: 1; } }
.bv-marker { stroke: var(--border-strong); stroke-width: 1.5; stroke-dasharray: 4 4; }
.bv-marker-label { fill: var(--success); font-size: 10px; font-weight: 700; font-family: inherit; }
@keyframes bv-draw { to { stroke-dashoffset: 0; } }

.bv-crit, .bv-agent { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13.5px; }
.bv-crit-bars { display: flex; flex-direction: column; gap: 4px; }
.bv-crit strong { min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.bv-agent-num { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; white-space: nowrap; color: var(--text-2); }
.bv-agent-num strong { color: var(--text); }
.bv-agent, .bv-crit { animation: jt-rise .45s ease-out both; animation-delay: calc(var(--i, 0) * 60ms); }
.bv-coach { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.bv-coach-av { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; font-size: 12px; }
.bv-coach-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.bv-coach-avg { color: var(--text-2); white-space: nowrap; }
.bv-coach-avg strong { color: var(--text); font-size: 16px; }
.bv-voice-title { margin: 0 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.bv-voice-title.good { color: var(--success); }
.bv-voice-title.bad { color: var(--danger); }
.bv-quotes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bv-quote { padding: 10px 12px; border-left: 3px solid var(--border-strong); background: var(--surface-2); border-radius: 0 9px 9px 0; display: flex; flex-direction: column; gap: 4px; }
.bv-quote p { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.bv-quote .link-btn { align-self: flex-start; }
@media (max-width: 560px) {
  .bv-crit, .bv-agent { grid-template-columns: minmax(0, 1fr) auto; }
  .bv-crit > :nth-child(2), .bv-agent > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
}

.im-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.im-steps li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; line-height: 1.35; }
.im-step-num { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; font-size: 13px; }
.im-feedback { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.im-feedback li { padding: 12px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.im-feedback li:first-child { border-top: 0; padding-top: 0; }
.im-feedback p { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.im-fb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.im-fb-stars { font-weight: 700; font-size: 13px; }
.im-fb-comment { color: var(--text-2); }
.im-theme-run { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.im-theme-run .mdd { min-width: 260px; }
.im-draft { display: flex; flex-direction: column; gap: 10px; }
.im-theme, .im-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.im-theme p, .im-item p { margin: 0; line-height: 1.5; }
.im-theme-head, .im-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.im-item-title { font-size: 15px; }
.im-status { margin-left: auto; }
.im-status .select { min-height: 36px; width: auto; }
.im-rule-wrap { display: flex; gap: 8px; align-items: flex-start; }
.im-rule { margin: 0; flex: 1; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.im-evidence { color: var(--text-2); font-style: italic; }
.im-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.im-list { display: flex; flex-direction: column; gap: 10px; }
.im-ba table.data td, .im-ba table.data th { white-space: nowrap; }
.im-retest { font-size: 13px; }
.im-retest summary { cursor: pointer; font-weight: 700; color: var(--accent-text); }
.im-retest ul { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.im-retest li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.im-retest-actions { display: inline-flex; gap: 4px; }
.im-item-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.im-delete { color: var(--danger); }
.im-add { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px dashed var(--border-strong); border-radius: 12px; }
.im-add label { font-weight: 700; font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  .bv-line { animation: none; stroke-dashoffset: 0; }
  .bv-dot, .bv-agent, .bv-crit { animation: none; }
}
.im-ba table.data tbody th { text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--text); background: none; }

/* =====================================================================
   Evaluate tab redesign: stepper, toggle chips, live status, skeletons,
   winner card, ripples, and the locked → unlocked feedback card.
   (shadcn / Material patterns, built on this app's tokens.)
   ===================================================================== */
.eval-panel { overflow: hidden; position: relative; }
.eval-panel::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), #7c3aed, #0ea5e9, var(--accent)); background-size: 300% 100%;
  animation: ev-flow 8s linear infinite;
}
@keyframes ev-flow { to { background-position: 300% 0; } }

/* Head: icon tile, title, live status pill */
.ev-head { flex-wrap: nowrap; align-items: center; gap: 14px; }
.ev-head-icon {
  width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), #7c3aed); box-shadow: 0 6px 16px rgba(29, 91, 220, .28);
}
.ev-head-text { flex: 1; min-width: 0; }
.ev-head .panel-title { font-size: 16px; font-weight: 800; margin: 0; }
.ev-head .panel-desc { margin: 2px 0 0; }
.ev-status {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.ev-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.ev-status.running { background: var(--accent-soft); color: var(--accent-text); }
.ev-status.running i { background: var(--accent); animation: ev-ping 1.2s ease-out infinite; }
.ev-status.done { background: var(--success-soft); color: var(--success); }
.ev-status.done i { background: var(--success); }
@keyframes ev-ping { 0% { box-shadow: 0 0 0 0 rgba(29, 91, 220, .55); } 100% { box-shadow: 0 0 0 8px rgba(29, 91, 220, 0); } }
@media (max-width: 560px) { .ev-head { flex-wrap: wrap; } }

/* Stepper: a line joins the steps; a finished step turns into a check */
.eval-body .eval-step { position: relative; }
.eval-body .eval-step:not(:last-child)::after {
  content: ""; position: absolute; left: 12px; top: 42px; bottom: -14px; width: 2px; border-radius: 2px;
  background: var(--border); transition: background .3s ease;
}
.eval-body .eval-step.done:not(:last-child)::after { background: linear-gradient(var(--accent), var(--border)); }
.eval-step + .eval-step { border-top: 0; }
.eval-step-num { position: relative; z-index: 1; width: 26px; height: 26px; border: 2px solid var(--accent-soft); transition: background .25s ease, color .25s ease, transform .25s ease; }
.eval-step-num svg { display: none; }
.eval-step.done .eval-step-num { background: var(--accent); color: #fff; border-color: var(--accent); }
.eval-step.done .eval-step-num .n { display: none; }
.eval-step.done .eval-step-num svg { display: block; animation: fb-pop .35s ease-out both; }
.eval-step-body { padding-left: 36px; }

/* Criteria: toggle chips with a drawn check (the checkbox stays the real control) */
.eval-criterion { height: 36px; transition: background .15s ease, border-color .15s ease, transform .1s ease; user-select: none; }
.eval-criterion:hover { border-color: var(--accent); }
.eval-criterion:active { transform: scale(.97); }
.eval-criterion input {
  appearance: none; -webkit-appearance: none; width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border-strong);
  background: var(--surface); display: grid; place-items: center; cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.eval-criterion input::after { content: ""; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); margin-top: -2px; transition: transform .15s ease; }
.eval-criterion input:checked { background: var(--accent); border-color: var(--accent); }
.eval-criterion input:checked::after { transform: rotate(45deg) scale(1); }
.eval-criterion input:focus-visible { outline: none; }

/* Evaluate button: gradient, lift, shimmer while scoring; an indeterminate bar under the action row */
.eval-actions { position: relative; }
.eval-go { min-height: 44px; padding: 0 20px; font-weight: 800; border: 0; background: linear-gradient(135deg, var(--accent), #6d28d9); transition: transform .15s ease, box-shadow .15s ease, filter .15s ease; }
.eval-go:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(29, 91, 220, .32); filter: brightness(1.05); }
.eval-go:active:not(:disabled) { transform: translateY(0); }
.eval-go.running { background: linear-gradient(110deg, var(--accent) 30%, #8b5cf6 50%, var(--accent) 70%); background-size: 250% 100%; animation: ev-shine 1.4s linear infinite; opacity: 1; }
@keyframes ev-shine { to { background-position: -250% 0; } }
.eval-actions.running::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 40% 100%; background-repeat: no-repeat;
  animation: ev-indet 1.2s ease-in-out infinite;
}
@keyframes ev-indet { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* Ripple (Material state layer) */
.ripple { position: relative; overflow: hidden; isolation: isolate; }
.ripple-dot {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); border-radius: 50%;
  background: currentColor; opacity: .22; transform: scale(0); pointer-events: none; z-index: -1; animation: ev-ripple .6s ease-out forwards;
}
.btn-primary .ripple-dot, .btn-primary.ripple .ripple-dot { background: #fff; }
@keyframes ev-ripple { to { transform: scale(1); opacity: 0; } }

/* Skeleton while the judges score */
.shimmer { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: ev-shimmer 1.4s ease infinite; }
@keyframes ev-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.ev-skel { display: flex; flex-direction: column; gap: 12px; padding: 4px 0 8px; }
.ev-skel-head { display: flex; align-items: center; gap: 12px; }
.ev-skel-head p { margin: 0; }
.ev-skel-title { font-weight: 700; }
.ev-orb {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff;
  background: conic-gradient(from 0deg, var(--accent), #8b5cf6, #0ea5e9, var(--accent)); animation: ev-spin 2.4s linear infinite;
}
.ev-orb svg { animation: ev-spin 2.4s linear infinite reverse; }
@keyframes ev-spin { to { transform: rotate(360deg); } }
.ev-dots { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
.ev-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: ev-dot 1.2s ease-in-out infinite; }
.ev-dots i:nth-child(2) { animation-delay: .15s; }
.ev-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ev-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ev-skel-verdict { height: 64px; border-radius: 14px; }
.ev-skel-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; animation: jt-rise .4s ease-out both; animation-delay: calc(var(--i, 0) * 90ms); }
.ev-skel-row { display: flex; align-items: center; gap: 10px; }
.ev-skel-name { font-weight: 700; flex: 1; min-width: 0; }
.ev-skel-pill { width: 64px; height: 24px; border-radius: 8px; }
.ev-skel-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; }
.ev-skel-bars span { height: 8px; border-radius: 999px; }

/* Results: winner hero, stagger, hover lift, bars that grow */
.res { animation: jt-rise .45s ease-out both; }
.res-hero {
  flex-direction: row; align-items: center; gap: 14px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 60%, #f3e8ff));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.res-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%); background-size: 250% 100%;
  animation: ev-sheen 2.2s ease .4s 1 both;
}
@keyframes ev-sheen { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.res-trophy {
  width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #f5a524, #e8730c); box-shadow: 0 6px 16px rgba(232, 115, 12, .3); animation: fb-pop .5s ease-out .15s both;
}
.res-hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.res-hero-score { flex: none; font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--accent-text); }
.res-hero-score small { font-size: 13px; font-weight: 600; color: var(--text-3); margin-left: 3px; }
@media (max-width: 560px) { .res-hero { flex-wrap: wrap; } .res-hero-score { font-size: 24px; } }
.res-item { animation: jt-rise .45s ease-out both; animation-delay: calc(var(--i, 0) * 90ms + 120ms); transition: transform .18s ease, box-shadow .18s ease; }
.res-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.res-item.best { background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 55%, var(--surface)), var(--surface) 60%); }
.res-best-tag {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; height: 20px; padding: 0 8px; border-radius: 999px; vertical-align: 2px;
  font-size: 11px; font-weight: 800; letter-spacing: .02em; color: #9a3412; background: #fff1e6;
}
.res-bar-fill { transform-origin: left center; animation: jt-grow .9s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 90ms + 250ms); }

/* Feedback card: locked until the judge answers, then unlocks with a glow */
.fb-card.locked .fb-body { opacity: .55; filter: grayscale(.35); transition: opacity .3s ease; }
.fb-body { border: 0; margin: 0; min-width: 0; }
.fb-body:disabled .fb-star, .fb-body:disabled .fb-op, .fb-body:disabled .fb-chip, .fb-body:disabled .link-btn { cursor: not-allowed; }
.fb-body:disabled .fb-star:hover { transform: none; color: var(--border-strong); }
.fb-lock {
  display: flex; gap: 12px; align-items: flex-start; margin: 14px 20px 0; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
}
.fb-lock.running { border-style: solid; border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }
.fb-lock-icon { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--text-2); border: 1px solid var(--border); }
.fb-lock.running .fb-lock-icon { color: var(--accent-text); }
.fb-lock p { margin: 0; }
.fb-lock-title { font-weight: 800; font-size: 13.5px; }
.fb-lock-text { font-size: 12.5px; color: var(--text-2); margin-top: 2px !important; }
.fb-card.unlocking { animation: fb-glow 1.6s ease-out 1; }
@keyframes fb-glow {
  0% { box-shadow: 0 0 0 0 rgba(29, 91, 220, .5); }
  40% { box-shadow: 0 0 0 8px rgba(29, 91, 220, .18); }
  100% { box-shadow: var(--shadow); }
}
.fb-unlocked-note {
  display: flex; align-items: center; gap: 6px; margin: 12px 20px 0; padding: 8px 12px; border-radius: 9px;
  background: var(--success-soft); color: var(--success); font-size: 13px; font-weight: 700; animation: jt-rise .4s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  .eval-panel::before, .ev-status.running i, .eval-go.running, .eval-actions.running::after, .ripple-dot, .shimmer, .ev-orb, .ev-orb svg, .ev-dots i,
  .ev-skel-card, .res, .res-hero::after, .res-trophy, .res-item, .res-bar-fill, .eval-step.done .eval-step-num svg, .fb-card.unlocking, .fb-unlocked-note { animation: none; }
  .res-item:hover, .eval-go:hover:not(:disabled) { transform: none; }
}

/* ---- Evaluate: judges on one line; judge instructions as a disclosure ---- */
.eval-step .mdd-multi { margin-top: 0; }
.eval-step .mdd-bar { flex-wrap: nowrap; gap: 10px; }
.eval-step .mdd-chips { flex: 0 1 auto; gap: 8px; }
.eval-step .mdd-chips:empty { display: none; }
.eval-step .mdd-tools { flex: 1 1 auto; justify-content: flex-start; min-width: 0; }
.eval-step .mdd-searchbox { width: auto; flex: 1 1 160px; min-width: 120px; max-width: 240px; }
@media (max-width: 640px) { .eval-step .mdd-bar { flex-wrap: wrap; } }
.eval-instr { margin: 6px 0 12px; }
.eval-instr > summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eval-instr-title { font-weight: 700; }
.eval-instr-sub { margin-left: auto; font-size: 12.5px; }
@media (max-width: 640px) { .eval-instr-sub { display: none; } }
.eval-instr[open] > summary { border-bottom: 1px solid var(--border); }
.eval-instr .disclosure-body { animation: jt-rise .3s ease-out both; }

/* ---- Sidebar: the Agents group ---- */
.nav-group-toggle .nav-chevron { display: inline-flex; color: var(--text-3); transition: transform .2s ease; }
.nav-group-toggle .count { margin-left: auto; }
.nav-group-toggle[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }
.nav-group-toggle.has-active { color: var(--accent-text); }
.nav-sub { display: flex; flex-direction: column; gap: 4px; padding-left: 14px; margin-left: 10px; border-left: 1px solid var(--border); }
.nav-sub[hidden] { display: none; }
.nav-sub.open { animation: jt-rise .25s ease-out both; }
.nav-sub .nav-item { padding-left: 10px; }
@media (prefers-reduced-motion: reduce) { .nav-group-toggle .nav-chevron { transition: none; } .nav-sub.open, .eval-instr .disclosure-body { animation: none; } }

/* ---- Score split: one line with each answer's share of the judges' total score ---- */
.score-split { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); animation: jt-rise .45s ease-out .3s both; }
.ss-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.ss-tag { padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); letter-spacing: .02em; }
.ss-bar { display: flex; gap: 3px; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.ss-seg { flex: 0 0 calc(var(--share) - 2px); background: var(--dot); animation: ss-grow .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 60ms + 350ms); }
@keyframes ss-grow { from { flex-basis: calc(var(--even) - 2px); opacity: .35; } to { flex-basis: calc(var(--share) - 2px); opacity: 1; } }
.ss-legend { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }
.ss-legend > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ss-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--dot); flex: none; }
.ss-legend b { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ss-legend small { font-size: 10.5px; color: var(--text-3); }
.ss-legend .lead b { color: var(--accent-text); }
@media (prefers-reduced-motion: reduce) { .score-split, .ss-seg { animation: none; } }

/* =====================================================================
   Judge Trust (redesign): report card for everyone — hero with gauge,
   headline cards, donut, trend, leaderboard, issues, review cards.
   Built on the coach profile's look (cp-hero, cp-kpi, cp-card, spot).
   ===================================================================== */
.jt2-page { gap: 18px; }
.jt2-hero { margin-top: 2px; }
.jt2-hero-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 26px 30px 70px; }
@media (max-width: 860px) { .jt2-hero-inner { grid-template-columns: minmax(0, 1fr); padding: 22px 20px 66px; } }
.jt2-hero-text { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.jt2-title { margin: 0; font-size: clamp(26px, 3.2vw, 38px); font-weight: 800; letter-spacing: -.025em; line-height: 1.1;
  background: linear-gradient(90deg, #ffffff 0%, #c7d2fe 30%, #fde68a 55%, #c7d2fe 80%, #ffffff 100%); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: cp-shine 7s linear infinite, cp-rise .5s ease both; }
.jt2-answer { margin: 0; font-size: 17px; line-height: 1.5; color: rgba(255, 255, 255, .92); max-width: 620px; animation: cp-rise .5s .08s ease both; }
.jt2-answer strong { color: #fff; }
.jt2-explain { margin: 0; font-size: 13.5px; line-height: 1.55; color: rgba(255, 255, 255, .72); max-width: 600px; animation: cp-rise .5s .14s ease both; }
.jt2-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; animation: cp-rise .5s .2s ease both; }
.jt2-filter select {
  appearance: none; -webkit-appearance: none; min-height: 38px; padding: 0 34px 0 14px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  color: #fff; background: rgba(255, 255, 255, .12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(6px); transition: background-color .2s, border-color .2s;
}
.jt2-filter select:hover { background-color: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .5); }
.jt2-filter select:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .45); }
.jt2-filter option { color: #0f172a; }

/* Gauge in a glass panel */
.jt2-gauge-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px 22px 16px; border-radius: 20px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(10px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
  animation: cp-rise .55s .15s cubic-bezier(.2, .8, .2, 1) both; }
.jt2-gauge { width: 240px; height: auto; overflow: visible; }
.jt2-gauge-track, .jt2-gauge-val { fill: none; stroke-width: 16; stroke-linecap: round; }
.jt2-gauge-track { stroke: rgba(255, 255, 255, .16); }
.jt2-gauge-val { stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--v)); animation: jt2-arc 1.3s .3s cubic-bezier(.2, .8, .2, 1) both; filter: drop-shadow(0 0 8px rgba(255, 255, 255, .25)); }
@keyframes jt2-arc { from { stroke-dashoffset: 1; } }
.jt2-needle { transform-box: view-box; transform-origin: 120px 120px; transform: rotate(var(--deg)); animation: jt2-needle 1.5s .3s cubic-bezier(.3, 1.4, .4, 1) both; }
.jt2-needle line { stroke: #fff; stroke-width: 4; stroke-linecap: round; }
.jt2-needle circle { fill: #fff; stroke: rgba(15, 23, 42, .35); stroke-width: 3; }
@keyframes jt2-needle { from { transform: rotate(-90deg); } }
.jt2-gauge-tick { fill: rgba(255, 255, 255, .6); font-size: 10px; font-weight: 700; font-family: inherit; }
.jt2-gauge-num { margin-top: -6px; font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.jt2-gauge-label { font-size: 12.5px; color: rgba(255, 255, 255, .75); }
.jt2-level { margin-top: 8px; display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 800; color: #fff; background: rgba(255, 255, 255, .16); }
.jt2-level i { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.jt2-level.tone-high { background: rgba(34, 197, 94, .25); } .jt2-level.tone-high i { background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, .25); }
.jt2-level.tone-mixed { background: rgba(245, 158, 11, .25); } .jt2-level.tone-mixed i { background: #fbbf24; box-shadow: 0 0 0 4px rgba(251, 191, 36, .25); }
.jt2-level.tone-low { background: rgba(239, 68, 68, .25); } .jt2-level.tone-low i { background: #f87171; box-shadow: 0 0 0 4px rgba(248, 113, 113, .25); }

/* Headline cards float over the hero's lower edge */
.jt2-kpis { margin-top: -58px; padding: 0 14px; position: relative; z-index: 2; }
@media (max-width: 1000px) { .jt2-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .jt2-kpis { grid-template-columns: minmax(0, 1fr); padding: 0 8px; } }
.jt2-of { font-size: 15px; font-weight: 700; color: var(--text-3); letter-spacing: 0; }
.jt2-stars { position: relative; display: inline-block; font-size: 22px; letter-spacing: 2px; line-height: 1; flex: none; }
.jt2-stars-base { color: var(--surface-3); }
.jt2-stars-fill { position: absolute; inset: 0 auto 0 0; width: var(--w); overflow: hidden; white-space: nowrap; color: #f5a524; animation: jt2-fill 1.1s .4s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes jt2-fill { from { width: 0; } }

/* Card grid */
.jt2-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.jt2-grid .span-2 { grid-column: span 2; }
@media (max-width: 1000px) { .jt2-grid { grid-template-columns: minmax(0, 1fr); } .jt2-grid .span-2 { grid-column: auto; } }
.jt2-card .cp-card-head { align-items: flex-start; }
.jt2-card-titles { min-width: 0; }
.jt2-card-title { margin: 0; font-size: 15px; font-weight: 800; }
.jt2-card-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.jt2-card-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }

/* Donut */
.jt2-donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.jt2-donut { position: relative; width: 176px; height: 176px; }
.jt2-donut-svg { width: 100%; height: 100%; }
.jt2-donut-track { fill: none; stroke: var(--surface-3); stroke-width: 15; }
.jt2-donut-seg { fill: none; stroke-width: 15; stroke-linecap: butt; stroke-dasharray: var(--len) var(--C);
  animation: jt2-donut .9s calc(.25s + var(--i, 0) * .35s) cubic-bezier(.2, .8, .2, 1) both; }
@keyframes jt2-donut { from { stroke-dasharray: 0 var(--C); } }
.jt2-donut-seg.op-agree, .jt2-legend .op-agree i, .jt2-review.op-agree::before { stroke: #16a34a; background: #16a34a; }
.jt2-donut-seg.op-partly, .jt2-legend .op-partly i, .jt2-review.op-partly::before { stroke: #f59e0b; background: #f59e0b; }
.jt2-donut-seg.op-disagree, .jt2-legend .op-disagree i, .jt2-review.op-disagree::before { stroke: #dc2626; background: #dc2626; }
.jt2-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.jt2-donut-center strong { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.jt2-donut-center > span { font-size: 12px; color: var(--text-3); }
.jt2-legend { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.jt2-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.jt2-legend i { width: 12px; height: 12px; border-radius: 4px; }
.jt2-legend div { display: flex; flex-direction: column; min-width: 0; }
.jt2-legend strong { font-size: 13px; }
.jt2-legend div span { font-size: 11.5px; color: var(--text-3); }
.jt2-legend b { font-size: 15px; font-variant-numeric: tabular-nums; }
.jt2-legend small { font-size: 11.5px; font-weight: 600; color: var(--text-3); }

/* Trend */
.jt2-trend-wrap { display: flex; flex-direction: column; gap: 6px; justify-content: center; flex: 1; }
.jt2-trend { width: 100%; height: auto; overflow: visible; }
.jt2-goal { stroke: #16a34a; stroke-dasharray: 5 5; opacity: .55; }
.jt2-goal-label { fill: #16a34a; font-size: 10.5px; font-weight: 700; font-family: inherit; }
.jt2-area { animation: bv-fade .8s .9s ease both; }
.jt2-line { fill: none; stroke: #16a34a; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: bv-draw 1.3s .3s cubic-bezier(.3, .6, .2, 1) forwards; }
.jt2-dot { fill: #16a34a; stroke: var(--surface); stroke-width: 2.5; animation: bv-fade .4s 1s ease both; cursor: help; }
.jt2-count { fill: var(--text-3); font-size: 9.5px; font-family: inherit; }
.jt2-trend-note { margin: 0; text-align: center; }

/* Leaderboard */
.jt2-legend-row { margin-bottom: 12px; }
.jt2-board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.jt2-judge { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  animation: cp-rise .5s calc(.15s + var(--i, 0) * 90ms) cubic-bezier(.2, .8, .2, 1) both; transition: transform .2s, box-shadow .2s; }
.jt2-judge:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -18px rgba(15, 23, 42, .45); }
.jt2-judge.recommended { border-color: color-mix(in srgb, #f59e0b 55%, transparent); background: linear-gradient(90deg, color-mix(in srgb, #fef3c7 70%, var(--surface)), var(--surface) 55%); }
.jt2-rank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--text-2); background: var(--surface-3); }
.jt2-rank.r1 { color: #713f12; background: linear-gradient(135deg, #fde68a, #f59e0b); box-shadow: 0 4px 12px rgba(245, 158, 11, .35); }
.jt2-rank.r2 { color: #334155; background: linear-gradient(135deg, #f1f5f9, #94a3b8); }
.jt2-rank.r3 { color: #7c2d12; background: linear-gradient(135deg, #fed7aa, #c2410c); }
.jt2-judge-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.jt2-judge-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.jt2-judge-head strong { font-size: 14.5px; }
.jt2-judge-meta { font-size: 12px; color: var(--text-3); }
.jt2-judge-score { display: flex; flex-direction: column; align-items: flex-end; }
.jt2-judge-score strong { font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.jt2-judge-score span { font-size: 11.5px; color: var(--text-3); }
.jt2-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: var(--surface-3); color: var(--text-2); }
.jt2-chip.tone-high { background: var(--success-soft); color: var(--success); }
.jt2-chip.tone-mixed { background: var(--warning-soft); color: var(--warning); }
.jt2-chip.tone-low { background: var(--danger-soft); color: var(--danger); }
.jt2-chip.tone-best { background: #fef3c7; color: #92400e; }
@media (max-width: 560px) { .jt2-judge { grid-template-columns: auto minmax(0, 1fr) auto; } .jt2-judge .pbadge { display: none; } }

/* Issues */
.jt2-issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.jt2-issues li { display: flex; flex-direction: column; gap: 6px; animation: cp-rise .5s calc(.2s + var(--i, 0) * 80ms) ease both; }
.jt2-issue-text { display: flex; flex-direction: column; }
.jt2-issue-text strong { font-size: 13.5px; }
.jt2-issue-text span { font-size: 12px; color: var(--text-3); }
.jt2-issue-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.jt2-issue-bar .jt-bar-fill { background: linear-gradient(90deg, #fb923c, #dc2626); }
.jt2-issue-bar b { font-variant-numeric: tabular-nums; }
.jt2-allgood { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--success-soft); color: var(--success); }
.jt2-allgood p { margin: 0; color: var(--text-2); line-height: 1.5; font-size: 13.5px; }
.jt2-allgood strong { color: var(--success); }

/* Latest reviews */
.jt2-latest { grid-column: 1 / -1; }
.jt2-reviews { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.jt2-review { position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: flex-start; padding: 14px 14px 14px 18px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  animation: cp-rise .45s calc(.1s + var(--i, 0) * 60ms) ease both; transition: transform .2s, box-shadow .2s; }
.jt2-review::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.jt2-review:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -18px rgba(15, 23, 42, .45); }
.jt2-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #3b82f6, #7c3aed); }
.jt2-review-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.jt2-review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.jt2-op { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; }
.jt2-op.op-agree { background: var(--success-soft); color: var(--success); }
.jt2-op.op-partly { background: var(--warning-soft); color: var(--warning); }
.jt2-op.op-disagree { background: var(--danger-soft); color: var(--danger); }
.jt2-review-stars { color: #f5a524; letter-spacing: 1px; font-size: 13px; }
.jt2-review-stars span { color: var(--border-strong); }
.jt2-review-comment { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.jt2-review-meta { margin: 0; font-size: 12px; color: var(--text-3); }
.jt2-open { align-self: center; }

.jt2-howto { border-radius: 14px; }
.jt2-howto ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; font-size: 13.5px; }
.jt2-empty .empty-state { padding: 40px 20px; }

@media (prefers-reduced-motion: reduce) {
  .jt2-title, .jt2-answer, .jt2-explain, .jt2-filters, .jt2-gauge-box, .jt2-gauge-val, .jt2-needle, .jt2-stars-fill, .jt2-donut-seg, .jt2-area, .jt2-line, .jt2-dot,
  .jt2-judge, .jt2-issues li, .jt2-review { animation: none; }
  .jt2-line { stroke-dashoffset: 0; }
  .jt2-judge:hover, .jt2-review:hover { transform: none; }
}

/* ---- Judge Trust: week-by-week stacked bars ---- */
.jt2-bars { width: 100%; height: auto; overflow: visible; }
.jt2-bar { transform-box: fill-box; transform-origin: 50% 100%; animation: jt2-rise-bar .8s calc(.25s + var(--i, 0) * 70ms) cubic-bezier(.2, .8, .2, 1) both; }
@keyframes jt2-rise-bar { from { transform: scaleY(0); } }
.jt2-bar-seg.op-agree { fill: #16a34a; }
.jt2-bar-seg.op-partly { fill: #f59e0b; }
.jt2-bar-seg.op-disagree { fill: #dc2626; }
.jt2-bar-seg { transition: opacity .2s; cursor: help; }
.jt2-bar:hover .jt2-bar-seg { opacity: .85; }
.jt2-bar-empty { fill: var(--surface-3); }
.jt2-bar-pct { fill: var(--text-2); font-size: 12px; font-weight: 800; font-family: inherit; animation: bv-fade .4s calc(.8s + var(--i, 0) * 70ms) ease both; }
.jt2-bar-pct.good { fill: #16a34a; }
.jt2-bar-pct.bad { fill: #dc2626; }
.jt2-bars-unit { fill: var(--text-3); font-size: 10px; font-family: inherit; }
@media (prefers-reduced-motion: reduce) { .jt2-bar, .jt2-bar-pct { animation: none; } }

/* =====================================================================
   Ballogy vs Models (redesign): a sports-style report card. Ballogy is
   orange throughout; wins green, ties grey, losses red.
   ===================================================================== */
.bv2-hero { background: linear-gradient(120deg, #0b1530 0%, #1e1b4b 34%, #9a3412 72%, #f97316 100%); background-size: 220% 220%; box-shadow: 0 18px 50px -18px rgba(234, 88, 12, .5); }
.bv2-source { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; animation: cp-rise .5s .18s ease both; }
.bv2-source-label { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .8); }
.bv2-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(6px); }
.bv2-seg-btn { min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: rgba(255, 255, 255, .85); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .2s, color .2s; }
.bv2-seg-btn:hover { color: #fff; }
.bv2-seg-btn.on { background: #fff; color: #9a3412; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
.bv2-seg-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .5); }

/* Scoreboard */
.bv2-board { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 22px; border-radius: 20px; min-width: 250px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(10px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
  animation: cp-rise .55s .15s cubic-bezier(.2, .8, .2, 1) both; }
.bv2-board-title { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.bv2-ring { position: relative; width: 132px; height: 132px; }
.bv2-ring svg { width: 132px; height: 132px; }
.bv2-ring .cp-ring-track { stroke: rgba(255, 255, 255, .16); }
.bv2-ring .cp-ring-bar { stroke: #fb923c; filter: drop-shadow(0 0 6px rgba(251, 146, 60, .6)); }
.bv2-ring-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 34px; font-weight: 800; letter-spacing: -.03em; color: #fff; line-height: 1; }
.bv2-ring-num span:last-child { font-size: 12px; font-weight: 600; letter-spacing: 0; color: rgba(255, 255, 255, .72); margin-top: 4px; }
.bv2-record { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.bv2-rec { display: flex; flex-direction: column; align-items: center; padding: 8px 6px; border-radius: 12px; background: rgba(255, 255, 255, .1); }
.bv2-rec strong { font-size: 22px; font-weight: 800; color: #fff; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bv2-rec > span { font-size: 11.5px; font-weight: 700; color: rgba(255, 255, 255, .75); }
.bv2-rec.win { box-shadow: inset 0 -3px 0 #4ade80; }
.bv2-rec.tie { box-shadow: inset 0 -3px 0 #cbd5e1; }
.bv2-rec.loss { box-shadow: inset 0 -3px 0 #f87171; }

/* Colors on this page */
.bv2-page .jt-dot.win, .bv2-page .jt-seg.win { background: #16a34a; }
.bv2-page .jt-dot.tie, .bv2-page .jt-seg.tie { background: #94a3b8; }
.bv2-page .jt-dot.loss, .bv2-page .jt-seg.loss { background: #dc2626; }
.jt-bar-fill.ballogy-o { background: linear-gradient(90deg, #fb923c, #ea580c); }
.bv2-key { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.bv2-key.ballogy, .bv2-bar.ballogy { background: #f97316; fill: #f97316; }
.bv2-key.other, .bv2-bar.other { background: #94a3b8; fill: #94a3b8; }
.bv2-bar { cursor: help; }
.bv2-bar-val { fill: #c2410c; font-size: 11.5px; font-weight: 800; font-family: inherit; animation: bv-fade .4s calc(.8s + var(--i, 0) * 70ms) ease both; }

/* Versus rows */
.bv2-versus { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bv2-vs { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  animation: cp-rise .5s calc(.15s + var(--i, 0) * 90ms) cubic-bezier(.2, .8, .2, 1) both; transition: transform .2s, box-shadow .2s; }
.bv2-vs:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -18px rgba(15, 23, 42, .45); }
.bv2-vs-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.bv2-vs-side { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bv2-vs-side.other { justify-content: flex-end; }
.bv2-ball { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: radial-gradient(circle at 30% 30%, #fdba74, #ea580c); box-shadow: 0 3px 8px rgba(234, 88, 12, .35); }
.bv2-vs-score { display: inline-flex; align-items: baseline; gap: 6px; padding: 2px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.bv2-vs-score strong { font-size: 20px; font-weight: 800; }
.bv2-vs-score strong:first-child { color: #c2410c; }
.bv2-vs-score i { font-style: normal; color: var(--text-3); }
.bv2-vs-bar { height: 10px; }
.bv2-vs-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.bv2-verdict.ahead { background: var(--success-soft); color: var(--success); }
.bv2-verdict.behind { background: var(--danger-soft); color: var(--danger); }
.bv2-verdict.even { background: var(--surface-3); color: var(--text-2); }

/* Strong and weak points: a centre line, better to the right, worse to the left */
.bv2-diverge { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.bv2-diverge li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 92px; gap: 14px; align-items: center; animation: cp-rise .5s calc(.2s + var(--i, 0) * 80ms) ease both; }
.bv2-div-text { display: flex; flex-direction: column; min-width: 0; }
.bv2-div-text strong { font-size: 13.5px; }
.bv2-div-text span { font-size: 12px; color: var(--text-3); line-height: 1.4; }
.bv2-div-track { position: relative; height: 14px; border-radius: 999px; background: var(--surface-3); }
.bv2-div-mid { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; background: var(--border-strong); }
.bv2-div-bar { position: absolute; top: 0; bottom: 0; width: var(--w); border-radius: 999px; animation: jt-grow .9s .3s cubic-bezier(.2, .8, .2, 1) both; }
.bv2-div-bar.pos { left: 50%; background: linear-gradient(90deg, #4ade80, #16a34a); transform-origin: left center; }
.bv2-div-bar.neg { right: 50%; background: linear-gradient(270deg, #f87171, #dc2626); transform-origin: right center; }
.bv2-diverge b { text-align: right; font-size: 13px; white-space: nowrap; }
@media (max-width: 640px) { .bv2-diverge li { grid-template-columns: minmax(0, 1fr) auto; } .bv2-div-track { grid-column: 1 / -1; grid-row: 2; } }

/* By task */
.bv2-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.bv2-tasks li { display: flex; flex-direction: column; gap: 6px; animation: cp-rise .5s calc(.2s + var(--i, 0) * 80ms) ease both; }
.bv2-task-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bv2-task-head strong { font-size: 13.5px; }

/* Coaches */
.bv2-coaches { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bv2-coaches li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2);
  animation: cp-rise .5s calc(.2s + var(--i, 0) * 70ms) ease both; }
.bv2-coach-main { display: flex; flex-direction: column; min-width: 0; }
.bv2-coach-main strong { font-size: 13.5px; }
.bv2-coach-main span { font-size: 12px; color: var(--text-3); }
.bv2-coach-score { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.bv2-coach-score .jt2-stars { font-size: 15px; }
.bv2-coach-score > span:last-child { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* What coaches say */
.bv2-voice-head { flex-wrap: wrap; }
.bv2-cta { margin-left: auto; }
.bv2-voices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .bv2-voices { grid-template-columns: minmax(0, 1fr); } }
.bv2-voice { border-radius: 14px; padding: 12px; }
.bv2-voice.good { background: color-mix(in srgb, var(--success-soft) 70%, var(--surface)); }
.bv2-voice.bad { background: color-mix(in srgb, var(--danger-soft) 70%, var(--surface)); }
.bv2-voice-title { margin: 0 0 10px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.bv2-voice.good .bv2-voice-title { color: var(--success); }
.bv2-voice.bad .bv2-voice-title { color: var(--danger); }
.bv2-voice ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bv2-quote { padding: 10px 12px; border-radius: 10px; background: var(--surface); box-shadow: 0 4px 14px -10px rgba(15, 23, 42, .35); display: flex; flex-direction: column; gap: 6px; }
.bv2-quote p { margin: 0; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.bv2-quote-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }

@media (prefers-reduced-motion: reduce) {
  .bv2-source, .bv2-board, .bv2-vs, .bv2-diverge li, .bv2-div-bar, .bv2-tasks li, .bv2-coaches li, .bv2-bar-val { animation: none; }
  .bv2-vs:hover { transform: none; }
}

/* ---- Ballogy vs Models: pager, chart at the top of its card, full rival names ---- */
.bv2-page .jt2-trend-wrap { justify-content: flex-start; }
.bv2-vs-side.other { overflow: visible; }
.bv2-vs-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bv2-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.bv2-pager-text { font-size: 12.5px; font-weight: 700; color: var(--text-3); }
.cp-insights-row.n1 { grid-template-columns: minmax(0, 1fr); }
.cp-insights-row.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .cp-insights-row.n2 { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================
   Improve Ballogy (redesign): plain-English plan — hero, three steps,
   coach quotes, AI to-do suggestions, and a to-do board.
   ===================================================================== */
.im2-hero { background: linear-gradient(120deg, #052e2b 0%, #0f3d4a 34%, #1e3a8a 70%, #4338ca 100%); background-size: 220% 220%; box-shadow: 0 18px 50px -18px rgba(13, 148, 136, .5); }
.im2-board .cp-ring-bar { stroke: #34d399; filter: drop-shadow(0 0 6px rgba(52, 211, 153, .6)); }
.im2-board .bv2-ring-num > span:first-child small { font-size: 18px; font-weight: 700; color: rgba(255, 255, 255, .6); }
.im2-rec.slate { box-shadow: inset 0 -3px 0 #cbd5e1; }
.im2-rec.blue { box-shadow: inset 0 -3px 0 #93c5fd; }
.im2-rec.green { box-shadow: inset 0 -3px 0 #4ade80; }

/* three steps */
.im2-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .im2-steps { grid-template-columns: minmax(0, 1fr); } }
.im2-steps li { animation: cp-rise .5s calc(.1s + var(--i, 0) * 90ms) cubic-bezier(.2, .8, .2, 1) both; }
.im2-step {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 30px -22px rgba(15, 23, 42, .4); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.im2-step:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -20px rgba(15, 23, 42, .45); border-color: var(--accent); }
.im2-step:focus-visible { outline: none; box-shadow: var(--focus); }
.im2-step-num { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--accent-text); background: var(--accent-soft); }
.im2-step.done .im2-step-num { color: #fff; background: linear-gradient(135deg, #34d399, #059669); }
.im2-step-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.im2-step-text strong { font-size: 14px; }
.im2-step-text small { font-size: 12.5px; color: var(--text-3); }
.im2-step-icon { color: var(--text-3); }

/* cards */
.im2-card { scroll-margin-top: calc(var(--topbar-h) + 12px); }
.im2-card .cp-card-head { align-items: flex-start; }
.im2-card .cp-card-head > .btn, .im2-csv { margin-left: auto; flex: none; }
.im2-csv { align-self: center; }

/* 1 · quotes */
.im2-quotes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.im2-quote { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 12px 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border);
  animation: cp-rise .45s calc(.05s + var(--i, 0) * 50ms) ease both; overflow: hidden; }
.im2-quote::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #94a3b8; }
.im2-quote.loss::before { background: #f97316; }
.im2-quote.win::before { background: #16a34a; }
.im2-quote-text { margin: 0; font-size: 14.5px; line-height: 1.5; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.im2-quote-extra { margin: 0; font-size: 13px; color: var(--text-2); }
.im2-quote-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: auto; }
.im2-outcome { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: var(--surface-3); color: var(--text-2); }
.im2-outcome.loss { background: #fff1e6; color: #9a3412; }
.im2-outcome.win { background: var(--success-soft); color: var(--success); }
.im2-quote-meta { font-size: 12px; color: var(--text-3); flex: 1; min-width: 160px; }
.im2-more { margin-top: 12px; }
.im2-empty { background: var(--surface-2); color: var(--accent-text); }

/* 2 · AI to-do suggestions */
.im2-ai { display: flex; flex-direction: column; gap: 10px; }
.im2-ai-run { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.im2-ai-field { display: flex; flex-direction: column; gap: 6px; min-width: 260px; flex: 0 1 340px; }
.im2-ai-label { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.im2-go { min-height: 46px; }
.im2-draft { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 12px; margin-top: 6px; }
.im2-sugg { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 60%, var(--surface)), var(--surface) 70%);
  animation: cp-rise .45s calc(.05s + var(--i, 0) * 70ms) ease both; }
.im2-sugg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.im2-sugg-head strong { font-size: 15px; flex-basis: 100%; }
.im2-sugg-problem { margin: 0; color: var(--text-2); line-height: 1.5; }
.im2-sugg-quote { margin: 0; font-size: 13px; font-style: italic; color: var(--text-3); }
.im2-sugg-quote span { font-style: normal; }
.im2-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: var(--accent-soft); color: var(--accent-text); }
.im2-chip.soft { background: var(--surface-3); color: var(--text-2); font-weight: 700; }
.im2-fix { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; background: #fefce8; border: 1px solid #fde68a; }
.im2-fix p { margin: 0; font-size: 13.5px; line-height: 1.5; color: #422006; white-space: pre-wrap; overflow-wrap: anywhere; }
.im2-fix-label { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #a16207; }
.im2-fix .btn { align-self: flex-start; }

/* 3 · to-do board */
.im2-board-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 1000px) { .im2-board-cols { grid-template-columns: minmax(0, 1fr); } }
.im2-col { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); min-height: 120px; }
.im2-col > header { display: flex; align-items: center; gap: 8px; padding: 2px 2px 4px; }
.im2-col > header strong { font-size: 13.5px; }
.im2-col-icon { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: #64748b; }
.im2-col.blue .im2-col-icon { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.im2-col.green .im2-col-icon { background: linear-gradient(135deg, #34d399, #059669); }
.im2-col-count { margin-left: auto; font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.im2-col-empty { margin: 0; padding: 14px 8px; font-size: 12.5px; color: var(--text-3); text-align: center; border: 1px dashed var(--border-strong); border-radius: 12px; }
.im2-todo { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 8px 22px -18px rgba(15, 23, 42, .5); animation: cp-rise .4s calc(.05s + var(--i, 0) * 60ms) ease both; }
.im2-todo.fixed { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); }
.im2-todo-title { font-size: 14px; line-height: 1.35; padding-right: 30px; }
.im2-todo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.im2-todo-chips:empty { display: none; }
.im2-todo-problem { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.im2-todo-fix { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.im2-todo-fix .im2-fix { align-self: stretch; }
.im2-todo-date { font-size: 12px; color: var(--text-3); }
.im2-todo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.im2-more-menu { position: absolute; top: 8px; right: 8px; }
.im2-more-menu > summary { list-style: none; cursor: pointer; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; letter-spacing: 1px; color: var(--text-3); }
.im2-more-menu > summary::-webkit-details-marker { display: none; }
.im2-more-menu > summary:hover, .im2-more-menu[open] > summary { background: var(--surface-3); color: var(--text); }
.im2-more-menu > div { position: absolute; right: 0; top: 32px; z-index: 5; min-width: 170px; display: flex; flex-direction: column; padding: 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.im2-more-menu button { text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; }
.im2-more-menu button:hover { background: var(--surface-3); }
.im2-more-menu button.danger { color: var(--danger); }
.im2-verdict { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.im2-verdict strong { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.im2-verdict p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.im2-verdict.good { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.im2-verdict.good strong { color: var(--success); }
.im2-verdict.bad { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.im2-verdict.bad strong { color: var(--danger); }
.im2-verdict.wait strong { color: var(--text-2); }
.im2-ba { display: flex; flex-direction: column; gap: 4px; }
.im2-ba-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) 36px; gap: 8px; align-items: center; font-size: 11.5px; color: var(--text-3); }
.im2-ba-row b { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.im2-ba-bar { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--surface-3) 80%, #fff); overflow: hidden; }
.im2-ba-bar span { display: block; height: 100%; width: var(--w); border-radius: inherit; background: #94a3b8; transform-origin: left center; animation: jt-grow .9s .2s cubic-bezier(.2, .8, .2, 1) both; }
.im2-ba-row.after .im2-ba-bar span { background: linear-gradient(90deg, #34d399, #059669); }
.im2-notdoing { margin-top: 12px; }
.im2-notdoing > summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-3); }
.im2-notdoing-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; margin-top: 10px; opacity: .8; }
@media (prefers-reduced-motion: reduce) {
  .im2-steps li, .im2-quote, .im2-sugg, .im2-todo, .im2-ba-bar span { animation: none; }
  .im2-step:hover { transform: none; }
}
.bv2-page .jt2-grid { align-items: start; }
.im2-quote-meta { flex-basis: 100%; min-width: 0; }
.im2-quote-foot .link-btn { margin-left: auto; }
/* Improve Ballogy after the first paint: no entrance animations on re-render (the hero's slow drift keeps going). */
.im2-page.settled :is(.cp-card, .im2-steps li, .im2-quote, .im2-sugg, .im2-todo, .im2-ba-bar span, .jt2-title, .jt2-answer, .jt2-explain, .jt2-filters, .bv2-board, .cp-ring-bar) { animation-name: none; }
.im2-page.settled .jt2-title { animation: cp-shine 7s linear infinite; }

/* =====================================================================
   Ballogy vs Models (simplified): match cards, 3 at a time.
   ===================================================================== */
.bv3-board-note { font-size: 11.5px; color: rgba(255, 255, 255, .7); text-align: center; }
.bv3-page .jt2-hero-inner { padding-bottom: 30px; }
.bv3-page .cp-card-head { align-items: flex-start; }
.bv3-page .cp-card-head > .btn { margin-left: auto; flex: none; }
.bv3-matches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .bv3-matches { grid-template-columns: minmax(0, 1fr); } }
.bv3-match { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface);
  box-shadow: 0 12px 30px -22px rgba(15, 23, 42, .5); animation: cp-rise .5s calc(.1s + var(--i, 0) * 90ms) cubic-bezier(.2, .8, .2, 1) both; transition: transform .2s, box-shadow .2s; }
.bv3-match:hover { transform: translateY(-3px); box-shadow: 0 18px 38px -20px rgba(15, 23, 42, .5); }
.bv3-match.ahead { border-top: 4px solid #16a34a; }
.bv3-match.behind { border-top: 4px solid #dc2626; }
.bv3-match.even { border-top: 4px solid #94a3b8; }
.bv3-match-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.bv3-side { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; text-align: center; }
.bv3-side strong { font-size: 13px; line-height: 1.25; }
.bv3-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
.bv3-side .bv2-ball { width: 34px; height: 34px; font-size: 14px; }
.bv3-side .pbadge { width: 34px; height: 34px; }
.bv3-score { display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.bv3-score strong { font-size: 30px; font-weight: 800; line-height: 1; }
.bv3-score strong.b { color: #ea580c; }
.bv3-score i { font-style: normal; font-size: 20px; color: var(--text-3); }
.bv3-sentence { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--text); text-align: center; }
.bv3-avgs { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.bv3-avg { padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-weight: 700; }
.bv3-avg.b { background: #fff1e6; color: #9a3412; }
.bv3-match .bv2-verdict { align-self: center; }
.bv3-page .bv2-pager { margin-top: 16px; }

.bv3-gw { display: flex; flex-direction: column; gap: 16px; }
.bv3-gw-title { margin: 0 0 8px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.bv3-gw-title.good { color: var(--success); }
.bv3-gw-title.work { color: #c2410c; }
.bv3-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bv3-list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); animation: cp-rise .45s calc(.15s + var(--i, 0) * 60ms) ease both; }
.bv3-list li > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.bv3-list strong { font-size: 13px; }
.bv3-list small { font-size: 12px; color: var(--text-3); }
.bv3-dot { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #16a34a; }
.bv3-list.work .bv3-dot { background: #ea580c; }
.bv3-none { margin: 0; }
@media (prefers-reduced-motion: reduce) { .bv3-match, .bv3-list li { animation: none; } .bv3-match:hover { transform: none; } }

/* ---- Ballogy vs Models: search any model (glass, in the hero) ---- */
.bv4-search { position: relative; max-width: 460px; animation: cp-rise .5s .16s ease both; z-index: 5; }
.bv4-search-icon { position: absolute; z-index: 1; left: 14px; top: 50%; transform: translateY(-50%); color: rgba(255, 255, 255, .7); pointer-events: none; display: inline-flex; }
.bv4-search-input {
  width: 100%; min-height: 44px; padding: 0 16px 0 40px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; color: #fff;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .3); backdrop-filter: blur(6px);
}
.bv4-search-input::placeholder { color: rgba(255, 255, 255, .65); font-weight: 500; }
.bv4-search-input:focus { outline: none; background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .6); box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.bv4-search-list {
  position: fixed; left: var(--left); top: var(--top); width: var(--w); z-index: 80; margin: 0; padding: 6px; list-style: none; max-height: 340px; overflow: auto;
  border-radius: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 24px 50px -20px rgba(2, 6, 23, .6);
}
.bv4-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.bv4-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.bv4-opt:hover, .bv4-opt.active { background: var(--accent-soft); }
.bv4-opt-text { display: flex; flex-direction: column; min-width: 0; }
.bv4-opt-text strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bv4-opt-text small { font-size: 12px; color: var(--text-3); }
.bv4-none { padding: 12px 10px; font-size: 13px; color: var(--text-3); }
.bv4-chip { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; padding: 6px 6px 6px 8px; border-radius: 999px; color: #fff; font-size: 14px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); animation: authPop .35s ease both; }
.bv4-chip-x { width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .18); }
.bv4-chip-x:hover { background: rgba(255, 255, 255, .32); }
.bv4-chip-x:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .5); }

/* ---- "Who picked the winner?" carousel (glass, in the hero) ---- */
.bv4-carousel { max-width: 560px; padding: 12px 14px 10px; border-radius: 18px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: cp-rise .5s .2s ease both; touch-action: pan-y; }
.bv4-carousel:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .45); }
.bv4-carousel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.bv4-arrows { display: flex; gap: 6px; }
.bv4-arrow { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); transition: background .2s, transform .2s; }
.bv4-arrow:hover { background: rgba(255, 255, 255, .26); transform: scale(1.06); }
.bv4-arrow:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .45); }
.bv4-viewport { overflow: hidden; border-radius: 12px; }
.bv4-track { display: flex; transform: translateX(calc(var(--x, 0) * -100%)); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.bv4-slide { flex: 0 0 100%; display: flex; gap: 12px; align-items: flex-start; padding: 4px 2px; min-width: 0; }
.bv4-slide-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.bv4-slide-icon.people { background: linear-gradient(135deg, #fb923c, #ea580c); box-shadow: 0 6px 16px -6px rgba(234, 88, 12, .7); }
.bv4-slide-icon.judge { background: linear-gradient(135deg, #818cf8, #7c3aed); box-shadow: 0 6px 16px -6px rgba(124, 58, 237, .7); }
.bv4-slide-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; color: #fff; }
.bv4-slide-text strong { font-size: 15px; }
.bv4-slide-text p { margin: 0; font-size: 12.5px; line-height: 1.45; color: rgba(255, 255, 255, .78); }
.bv4-slide-stat { align-self: flex-start; margin-top: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #fff; background: rgba(255, 255, 255, .16); }
.bv4-dots { display: flex; gap: 6px; margin-top: 10px; }
.bv4-dot { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700;
  color: rgba(255, 255, 255, .75); background: transparent; border: 1px solid rgba(255, 255, 255, .25); transition: background .2s, color .2s; }
.bv4-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .45); transition: background .2s, transform .2s; }
.bv4-dot.on { color: #9a3412; background: #fff; border-color: #fff; }
.bv4-dot.on::before { background: #ea580c; transform: scale(1.2); }
.bv4-dot:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .45); }
.bv4-empty-actions { justify-content: center; }
@media (prefers-reduced-motion: reduce) { .bv4-track { transition: none; } .bv4-search, .bv4-carousel, .bv4-chip { animation: none; } }
/* Ballogy vs Models after the first paint: no entrance animations on re-render (charts still grow; the carousel still slides). */
.bv3-page.settled :is(.cp-card, .bv3-match, .bv3-list li, .jt2-answer, .jt2-explain, .jt2-filters, .bv2-board, .bv4-search, .bv4-carousel, .bv4-chip, .bv2-quote) { animation-name: none; }
.bv3-page.settled .jt2-title { animation: cp-shine 7s linear infinite; }

/* =====================================================================
   Ballogy vs Models: compact hero + sliding match carousel.
   ===================================================================== */
.bv5-hero .jt2-hero-inner { padding: 20px 26px 22px; gap: 20px; }
.bv5-hero .jt2-hero-text { gap: 10px; }
.bv5-hero .jt2-title { font-size: clamp(24px, 2.4vw, 32px); }
.bv5-hero .jt2-answer { font-size: 15px; }
.bv5-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bv5-controls .bv4-search { flex: 1 1 260px; max-width: 360px; animation: none; }
.bv5-controls .bv4-search-input { min-height: 40px; }
.bv5-source { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); }
.bv5-source-label { padding: 0 6px 0 8px; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .78); }
.bv5-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 700;
  color: rgba(255, 255, 255, .85); background: transparent; transition: background .2s, color .2s, box-shadow .2s; }
.bv5-pill:hover { background: rgba(255, 255, 255, .14); }
.bv5-pill.on { color: #9a3412; background: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.bv5-pill.judge.on { color: #5b21b6; }
.bv5-pill:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .5); }
.bv5-pill-stat { padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; background: rgba(255, 255, 255, .16); }
.bv5-pill.on .bv5-pill-stat { background: #fff1e6; color: #9a3412; }
.bv5-pill.judge.on .bv5-pill-stat { background: #ede9fe; color: #5b21b6; }
.bv5-info { position: relative; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; color: rgba(255, 255, 255, .8); cursor: help; }
.bv5-info:hover, .bv5-info:focus-visible { outline: none; background: rgba(255, 255, 255, .16); color: #fff; }
.bv5-tip { position: absolute; z-index: 20; top: calc(100% + 8px); right: -8px; width: 300px; padding: 10px 12px; border-radius: 12px; font-size: 12.5px; line-height: 1.5; font-weight: 500;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .15s, transform .15s; }
.bv5-info:hover .bv5-tip, .bv5-info:focus-visible .bv5-tip { opacity: 1; transform: none; }
.bv5-hero .bv2-board { padding: 14px 18px; gap: 8px; min-width: 220px; }
.bv5-hero .bv2-ring, .bv5-hero .bv2-ring svg { width: 104px; height: 104px; }
.bv5-hero .bv2-ring-num { font-size: 26px; }
.bv5-hero .bv2-rec { padding: 6px 4px; }
.bv5-hero .bv2-rec strong { font-size: 18px; }
@media (max-width: 860px) { .bv5-hero .bv2-board { flex-direction: row; flex-wrap: wrap; justify-content: center; } }

/* the sliding match carousel */
.bv5-carousel { display: flex; flex-direction: column; gap: 14px; }
.bv5-viewport { overflow: hidden; margin: -10px -6px; padding: 10px 6px; border-radius: 18px; touch-action: pan-y; }
.bv5-viewport:focus-visible { outline: none; box-shadow: var(--focus); }
.bv5-track { --gap: 14px; display: flex; gap: var(--gap); transition: transform .55s cubic-bezier(.2, .8, .2, 1);
  transform: translateX(calc(var(--page, 0) * -1 * (100% + var(--gap)))); }
.bv5-track > .bv3-match { flex: 0 0 calc((100% - (var(--per, 3) - 1) * var(--gap)) / var(--per, 3)); min-width: 0; }
.bv5-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bv5-nav-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bv5-arrow { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: 0 6px 16px -10px rgba(15, 23, 42, .5); transition: transform .2s, background .2s, border-color .2s; }
.bv5-arrow:hover:not(:disabled) { transform: scale(1.06); border-color: var(--accent); color: var(--accent-text); }
.bv5-arrow:disabled { opacity: .35; cursor: default; }
.bv5-arrow:focus-visible { outline: none; box-shadow: var(--focus); }
.bv5-dots { display: flex; gap: 6px; }
.bv5-dot { width: 8px; height: 8px; padding: 0; border-radius: 999px; border: 0; cursor: pointer; background: var(--border-strong); transition: width .3s, background .3s; }
.bv5-dot.on { width: 22px; background: linear-gradient(90deg, #fb923c, #ea580c); }
.bv5-dot:focus-visible { outline: none; box-shadow: var(--focus); }
@media (prefers-reduced-motion: reduce) { .bv5-track { transition: none; } }

/* Shooting card: the period menu in the card's top row */
.shoot-range { margin-left: auto; min-height: 28px; padding: 0 26px 0 10px; border-radius: 999px; border: 1px solid var(--border-strong); background-color: var(--surface);
  font: inherit; font-size: 12px; font-weight: 700; color: var(--text-2); cursor: pointer; position: relative; z-index: 2; }
.shoot-range:hover { border-color: var(--accent); color: var(--text); }
.shoot-range:focus-visible { outline: none; box-shadow: var(--focus); }
.cp-kpi-top, .kpi-top { flex-wrap: wrap; }

/* Team picker: the way back to choosing a coach is always in plain sight. */
.gp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gp-steps { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; flex-wrap: wrap; }
.gp-step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; font-size: 12.5px; color: #fff;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); }
.gp-step strong { font-weight: 750; }
button.gp-step { cursor: pointer; transition: background .2s, border-color .2s; }
button.gp-step:hover { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .5); }
button.gp-step:focus-visible, .gp-change-coach:focus-visible, .gp-foot-link:focus-visible { outline: none; box-shadow: var(--focus); }
.gp-step-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.gp-step.done .gp-step-num { background: #22c55e; color: #fff; }
.gp-step.now { background: #fff; color: #0f172a; border-color: #fff; font-weight: 700; }
.gp-step.now .gp-step-num { background: var(--accent); color: #fff; }
.gp-step-line { width: 24px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .35); }
.gp-change-coach { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px;
  color: #0f172a; background: #fff; border: 0; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); transition: transform .2s, box-shadow .2s; }
.gp-change-coach:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(0, 0, 0, .24); }
.gp-foot { margin: 18px 0 0; text-align: center; color: var(--text-3); font-size: 13px; }
.gp-foot-link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) { .gp-change-coach { margin-left: 0; width: 100%; justify-content: center; } .gp-step-line { display: none; } }

/* A coach found through one of their teams: say which team matched. */
.coach-result-team { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; padding: 2px 9px; border-radius: 999px; align-self: flex-start;
  font-size: 12px; background: var(--accent-soft); color: var(--accent); }
.coach-result-team strong { font-weight: 750; }

/* "Select a coach first": a clear, dismissible note above the coach search. */
.coach-required { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; padding: 10px 12px; border-radius: 14px;
  background: #fff1f2; color: #881337; border: 1px solid #fecdd3; box-shadow: 0 10px 26px -14px rgba(0, 0, 0, .45); animation: cp-rise .3s ease both; }
.coach-required-icon { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #e11d48; color: #fff; }
.coach-required-text { flex: 1; display: flex; flex-direction: column; gap: 1px; font-size: 13px; line-height: 1.4; }
.coach-required-text strong { font-size: 14px; }
.coach-required-x { flex: none; padding: 4px; border: 0; border-radius: 8px; background: none; color: inherit; cursor: pointer; opacity: .7; }
.coach-required-x:hover { opacity: 1; background: rgba(225, 29, 72, .1); }

/* Coach search results: compact rows, three across on a wide screen. */
.coach-results { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 6px; }
.coach-result { gap: 10px; padding: 7px 10px; border-radius: 11px; }
.cl-hero .coach-result { box-shadow: 0 6px 16px -12px rgba(0, 0, 0, .5); }
.coach-result .coach-avatar { width: 30px; height: 30px; font-size: 11.5px; background: hsl(var(--hue, 220) 62% 48%); }
.coach-result-main { gap: 1px; }
.coach-result-name { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 13.5px; line-height: 1.3; }
.coach-result-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 0; }
.coach-result .coach-handle { margin-left: 0; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.coach-result-sub { font-size: 11.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.coach-result .coach-result-team { margin-top: 1px; padding: 1px 7px; font-size: 11px; max-width: 100%; overflow: hidden; }
.coach-result .coach-result-team strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coach-result-go { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--text-3); transition: background .15s, color .15s, transform .15s; }
.coach-result:hover .coach-result-go, .coach-result:focus-visible .coach-result-go { background: var(--accent); color: #fff; transform: translateX(2px); }

/* Choose-a-coach page: how it works, in three steps. */
.cl-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: none; }
.cl-step { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.cl-step.now { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cl-step-num { position: absolute; top: 10px; right: 12px; font-size: 22px; font-weight: 850; line-height: 1; color: var(--text-3); opacity: .35; }
.cl-step.now .cl-step-num { color: var(--accent); opacity: .6; }
.cl-step-icon { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.cl-step.now .cl-step-icon { background: var(--accent); color: #fff; }
.cl-step-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-right: 18px; font-size: 12.5px; color: var(--text-3); line-height: 1.4; }
.cl-step-text strong { font-size: 14px; color: var(--text); }
@media (max-width: 760px) { .cl-steps { grid-template-columns: 1fr; } }

/* Report pages: what the figures cover ("Overall · 1,240 comparisons · 85 coaches · 9 users"). */
.rp-overall { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 0 0; font-size: 12.5px; color: rgba(255, 255, 255, .9); }
.rp-overall-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-weight: 750; font-size: 11.5px; letter-spacing: .03em; text-transform: uppercase;
  background: rgba(34, 197, 94, .22); border: 1px solid rgba(34, 197, 94, .5); color: #fff; }
.rp-overall-tag.narrowed { background: rgba(250, 204, 21, .2); border-color: rgba(250, 204, 21, .5); }
.rp-overall-note { opacity: .8; font-style: italic; }

/* Choose-a-coach page: the overall reports, one click away. */
.cl-reports { display: flex; flex-direction: column; gap: 12px; }
.cl-report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cl-report { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.cl-report:hover, .cl-report:focus-visible { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); outline: none; }
.cl-report-icon { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.cl-report-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 12px; color: var(--text-3); }
.cl-report-text strong { font-size: 13.5px; color: var(--text); }
.cl-report-go { flex: none; color: var(--text-3); }
.cl-report:hover .cl-report-go { color: var(--accent); }
@media (max-width: 760px) { .cl-report-grid { grid-template-columns: 1fr; } }

/* Agents → Coach Agents / Player Agents: a smaller toggle, its agents indented under it. */
.nav-subgroup-toggle { font-size: 13px; font-weight: 650; }
.nav-subgroup-toggle .nav-chevron { display: inline-flex; color: var(--text-3); transition: transform .2s ease; }
.nav-subgroup-toggle .count { margin-left: auto; }
.nav-subgroup-toggle[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }
.nav-subgroup-toggle.has-active { color: var(--accent-text); }
.nav-sub-inner { margin-left: 8px; padding-left: 10px; }
