/* =========================================================================
 * Mutua Home Console — component styles (over Tabler, brand token layer).
 * ========================================================================= */

* { box-sizing: border-box; }
/* The UA rule behind [hidden] is display:none at the lowest specificity, so any
   component that sets its own display — .btn-link is inline-flex — outranks it
   and stays on screen after the script has hidden it. Scripts here hide things
   that must not be actionable (the delete control on a case that does not exist
   yet), so the attribute wins outright rather than per component. */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--brand-blue-text);
  background: var(--brand-background);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
a { color: var(--brand-accent); text-decoration: none; }
a:hover { color: var(--brand-accent-hover); }
.mono { font-family: var(--font-mono); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--brand-grey); border-radius: 6px; border: 2px solid var(--brand-background); }

@keyframes mhc-fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes mhc-toast { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes mhc-shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }

/* ---- Layout shell ---- */
.app-shell { display: flex; height: 100vh; overflow: hidden; position: relative; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.app-content { flex: 1; min-height: 0; overflow: auto; position: relative; }

/* ---- Sidebar ---- */
.app-sidebar {
  background: var(--brand-accent); width: 236px; flex-shrink: 0;
  display: flex; flex-direction: column; box-shadow: var(--brand-shadow-sidebar);
  position: relative; z-index: 3;
}
.app-sidebar__brand { padding: 16px 12px 12px; }
.app-sidebar__brand-card {
  height: 48px; display: flex; align-items: center; justify-content: center;
}
.app-sidebar__brand-card img {
  display: block; width: 100%; height: 100%; object-fit: contain;
}
.app-sidebar__product { position: relative; margin: 13px 0 0; padding: 14px 0 0 7px; line-height: 1.15; text-align: left; }
.app-sidebar__product::before { content: ''; position: absolute; top: 0; left: -3rem; right: -3rem; height: 1px; background: var(--brand-sidebar-border); }
.app-sidebar__brand-name { color: #fff; font-weight: 600; font-size: 18px; letter-spacing: -0.02em; white-space: nowrap; }
.app-sidebar__brand-sub { margin-top: 7px; color: var(--brand-accent-variant); font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .11em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.app-sidebar__nav { flex: 1; padding: 6px 12px; overflow-y: auto; }
.app-sidebar__section { color: var(--brand-sidebar-text-dim); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin: 14px 12px 8px; }
.app-nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px; margin-bottom: 2px;
  border: none; cursor: pointer; border-radius: var(--radius-md); text-align: left;
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 500;
  color: var(--brand-sidebar-text); background: transparent; transition: background var(--transition-fast);
}
.app-nav-item:hover { background: var(--brand-sidebar-hover-bg); color: #fff; }
.app-nav-item.is-active { color: #fff; font-weight: 600; background: var(--brand-sidebar-active-bg); }
.app-nav-item i { font-size: 17px; width: 18px; }
.app-sidebar__credit { padding: 10px 20px 13px; }
.app-sidebar__credit-label {
  display: block; margin-bottom: 7px; color: var(--brand-sidebar-text-dim);
  font-size: 9.5px; font-weight: 500; letter-spacing: .09em; text-transform: uppercase;
}
.app-sidebar__credit-card {
  height: 34px; display: flex; align-items: center;
}
.app-sidebar__credit-card img {
  display: block; width: auto; max-width: 156px; height: 100%; object-fit: contain;
  opacity: .92;
}
.app-sidebar__user { padding: 12px; border-top: 1px solid var(--brand-sidebar-border); display: flex; align-items: center; gap: 10px; }
.app-sidebar__avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.app-sidebar__user-name { color: #fff; font-size: 12px; font-weight: 600; }
.app-sidebar__user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-sidebar__user-role { color: var(--brand-sidebar-text-dim); font-size: 10.5px; }
.app-sidebar__signout {
  display: inline-flex; align-items: center; justify-content: center; padding: 5px;
  border: none; border-radius: var(--radius-md); background: transparent; cursor: pointer;
  color: var(--brand-sidebar-text-dim); font-size: 16px; transition: background var(--transition-fast);
}
.app-sidebar__signout:hover { background: var(--brand-sidebar-hover-bg); color: #fff; }

/* ---- Topbar ---- */
.app-topbar {
  flex-shrink: 0; height: 56px; background: #fff; border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; gap: 12px; padding: 0 16px; z-index: 2;
}
.app-topbar__title { font-size: 15px; font-weight: 600; color: var(--brand-black); }
.app-topbar__note { font-size: 12px; color: var(--brand-grey-text); }
@media (max-width: 720px) { .app-topbar__note { display: none; } }
.app-topbar__meta { margin-left: auto; display: flex; align-items: center; gap: 14px; color: var(--brand-grey-text); font-size: 12px; }
.app-topbar__meta i { font-size: 17px; cursor: pointer; }
/* The watch switch is the last thing on the bar, so it is in the same corner on
   every screen that has one — and nowhere near the row where a page's own
   buttons live. */
.app-topbar .live { flex-shrink: 0; }
/* Everything on the bar gives way before the switch does: the title truncates,
   then the timezone goes. A control pushed off the right edge of the bar cannot
   be reached at all, and the bar does not scroll. */
@media (max-width: 720px) {
  .app-topbar__title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app-topbar__meta { display: none; }
  .app-topbar .live { margin-left: auto; }
}
.env-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: var(--radius-md);
  background: var(--tint-accent); color: var(--brand-accent); font-size: 11px; font-weight: 600; letter-spacing: .03em;
}
.env-badge.is-prod { background: var(--tint-danger); color: var(--brand-danger); }
.env-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.icon-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--brand-grey); border-radius: var(--radius-md); color: var(--brand-blue-text); cursor: pointer; }
.sidebar-toggle { display: none; }

/* ---- Badges / tints ---- */
.mhc-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; line-height: 1.4; padding: 2px 8px; border-radius: var(--radius-md); white-space: nowrap; }
.tint-neutral { background: var(--brand-grey-light); color: var(--brand-grey-text); }
.tint-accent { background: var(--tint-accent); color: var(--brand-accent); }
.tint-success { background: var(--tint-success); color: var(--brand-success); }
.tint-success-strong { background: var(--tint-success-strong); color: var(--brand-success); }
.tint-warning { background: var(--tint-warning); color: var(--brand-warning); }
.tint-danger { background: var(--tint-danger); color: var(--brand-danger); }
.tint-milestone { background: var(--tint-milestone); color: var(--brand-milestone); }
/* Squarer, tighter variant — used where the badge is a type marker on a row. */

/* ---- Buttons ---- */
.btn-primary, .btn-ghost, .btn-danger {
  display: inline-flex; align-items: center; gap: 7px; border-radius: var(--radius-md);
  padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font-sans);
}
.btn-primary { background: var(--brand-accent); color: #fff; border: 1px solid var(--brand-accent); box-shadow: var(--brand-shadow-btn); }
.btn-primary:hover { background: var(--brand-accent-hover); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--brand-grey); color: var(--brand-blue-text); }
.btn-ghost:hover { background: var(--brand-grey-light); }
/* Only ever the confirming button of a destructive dialog, never a row action:
   the weight is what makes the dialog read as the point of no return. */
.btn-danger { background: var(--brand-danger); color: #fff; border: 1px solid var(--brand-danger); }
.btn-danger:hover { filter: brightness(0.93); color: #fff; }
.btn-link { background: none; border: none; color: var(--brand-accent); font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: var(--font-sans); display: inline-flex; align-items: center; gap: 5px; }

/* An identifier that is also the way into the thing it names. No underline: the
   key is read as data first, so the rule would sit under a value; the accent and
   the hover are the affordance. */
.key-link { color: var(--brand-accent); text-decoration: none; font-weight: 600; }
.key-link:hover { filter: brightness(0.85); }

/* ---- Page heading ---- */
.page-head { padding: 22px 28px 14px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 500; color: var(--brand-black); line-height: 1.15; }
.page-head p { margin: 6px 0 0; font-size: 13px; color: var(--brand-grey-text); max-width: 640px; }
.page-body { padding: 0 28px 28px; }
/* The title and the way out of the page sit on one line: the walk through a list
   belongs beside what is being walked, not below the description of it. */
/* Title on the left, the arrows that walk the list on the right, on one line at
   every width: the row never wraps, so the arrows never end up under the title.
   A long title breaks inside itself instead — `min-width: 0` is what lets it,
   since a flex item refuses to shrink past its longest word without it. */
.page-head__line { display: flex; align-items: center; gap: 16px; flex-wrap: nowrap; }
.page-head__line h1 { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.page-head__line > .step-nav { flex-shrink: 0; margin-left: auto; }
/* What the title is qualified by, and the one way on from it, under the title on a
   baseline of their own: a button set in a sentence of prose reads as neither. */
.page-head__aside { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--brand-grey-text); }

/* A title that can be renamed in place. The pencil sits against the end of the
   title rather than at the end of the line — it belongs to the words, not to the
   header — and it stays visible, so the offer to rename does not have to be found
   by hovering. The field it opens is set in the heading's own face and size, so
   renaming looks like typing over the title rather than filling in a form about it. */
.title-edit { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
/* Sized by the text, not by the line, so the pencil follows the last word. */
.page-head__line .title-edit h1 { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
.icon-btn--bare { width: 28px; height: 28px; border: none; background: none; color: var(--brand-grey-text); flex-shrink: 0; }
.icon-btn--bare i { font-size: 17px; }
.icon-btn--bare:hover { color: var(--brand-accent); background: var(--brand-grey-light); }
.title-edit__input { flex: 1 1 auto; min-width: 0; font-family: var(--font-sans); font-size: 26px; font-weight: 500; color: var(--brand-black); line-height: 1.15; padding: 2px 8px; border: 1px solid var(--brand-grey); border-radius: var(--radius-md); background: #fff; }
.title-edit__input:focus { outline: none; border-color: var(--brand-accent); }
.title-edit [hidden] { display: none; }

/* ---- Nested-page navigation ---- */
.crumbs { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12.5px; }
.crumbs__link { color: var(--brand-accent); font-weight: 600; text-decoration: none; }
.crumbs__link:hover { text-decoration: underline; }
.crumbs__sep { font-size: 13px; color: var(--brand-grey-text); }
.crumbs__here { color: var(--brand-grey-text); font-weight: 500; }
/* The stacked chevrons the task detail is walked with, so every nested screen in
   the console moves the same way. The count carries the words: two arrows cannot
   say what they are walking. Kept in place rather than hidden at the ends of the
   list — a control that disappears moves the one next to it under the pointer. */
.step-nav { display: flex; align-items: center; gap: 6px; }
.step-nav__btn { width: 32px; height: 32px; text-decoration: none; }
.step-nav__count { font-size: 12px; color: var(--brand-grey-text); white-space: nowrap; margin-right: 4px; }
/* Below a wide screen the words go and the arrows stay: the position in the list
   is context, and the title it would be taking room from is the point. */
@media (max-width: 1100px) { .step-nav__count { display: none; } }

/* ---- Toolbar / filters ---- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.search-box { position: relative; display: flex; align-items: center; flex: 1; max-width: 340px; }
.search-box i { position: absolute; left: 11px; color: var(--brand-grey-text); font-size: 16px; pointer-events: none; }
.search-box input, .search-box input[type=text] { width: 100%; font-family: var(--font-sans); font-size: 13px; color: var(--brand-blue-text); background: #fff; border: 1px solid var(--brand-grey); border-radius: var(--radius-md); padding: 8px 12px 8px 34px; outline: none; }
.filter-panel { margin-top: 12px; padding: 16px; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius-lg); animation: mhc-fadein .2s ease; }
.filter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field[hidden], [data-show-when][hidden] { display: none; }
.field > span, .field > label { font-size: 11px; font-weight: 600; color: var(--brand-grey-text); text-transform: uppercase; letter-spacing: .04em; }
/* Which fields block the save, marked on the label rather than left to be
   discovered by pressing Save and watching nothing happen. */
.field:has(> [required]) > span:first-child::after { content: " *"; color: var(--brand-danger); }
.filter-toggles { display: flex; gap: 20px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-color); flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--brand-blue-text); }

input[type=text], input[type=time], input[type=number], input[type=datetime-local], input[type=tel], select, textarea {
  font-family: var(--font-sans); font-size: 13px; color: var(--brand-blue-text); background: #fff;
  border: 1px solid var(--brand-grey); border-radius: var(--radius-md); padding: 7px 10px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-accent); box-shadow: 0 0 0 3px var(--brand-accent-ring); }
textarea { font-family: var(--font-sans); resize: vertical; }

/* The native control packs its arrow against the border and sizes itself from
 * the longest option, which reads as cramped next to the text inputs. Drawn
 * here instead: an inline chevron with room around it, and a right padding that
 * keeps the longest option clear of it. The SVG is inlined because the CSP
 * allows no external requests. */
select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding: 7px 32px 7px 11px; line-height: 1.4;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a5c88' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
select:hover { border-color: var(--brand-accent-border-soft); }
select:disabled { background-color: var(--brand-grey-light); color: var(--brand-grey-text); cursor: not-allowed; }

/* ---- Table ---- */
/* .table-scroll is BOTH the horizontal scroll port and the vertical one, so the
 * sticky header stays put during infinite scroll and columns keep their widths.
 * max-height lets short tables render fully while long ones scroll internally;
 * inside a flex column (.page--table) it flexes to fill the viewport instead. */
.table-scroll { border: 1px solid var(--border-color); border-radius: var(--radius-xl); background: #fff; overflow: auto; max-height: 100%; }
.page--table .table-scroll { flex: 1 1 auto; min-height: 0; max-height: none; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 1040px; }
.data-table--config { min-width: 760px; }
.data-table th { text-align: left; background: var(--brand-grey-light); color: var(--brand-blue-text); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; font-weight: 600; padding: 9px 16px; white-space: nowrap; position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--border-strong); }
.data-table td { padding: 11px 16px; border-bottom: 1px solid var(--border-color); font-size: 13px; vertical-align: top; }
.data-table tbody tr { cursor: pointer; transition: background .12s; }
.data-table tbody tr:hover { background: var(--brand-grey-light); }
.data-table tbody tr.is-inactive td { color: var(--brand-grey-text); }
.data-table tbody tr.is-inactive td:first-child { opacity: .75; }
.data-table tr:last-child td { border-bottom: none; }
.data-table td.nowrap { white-space: nowrap; }
.td-sub { font-size: 11px; color: var(--brand-grey-text); }
.td-strong { font-weight: 500; color: var(--brand-black); }
.tbl-check { color: var(--brand-success); font-size: 16px; }
.tbl-dash { color: var(--brand-grey); }

/* ---- Page as a full-height table shell ---- */
.page--table { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.page--table .page-head { flex-shrink: 0; }
.page--table .page-body { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }

/* A detail page whose body is cards and sections rather than one table: it does
 * its own vertical scrolling, where .page--table hands a fixed height to the
 * table viewport inside it. */
.page--scroll { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.page--scroll .page-head { flex-shrink: 0; }
.page--scroll .page-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
/* The body scrolls, so its sections must keep their own height instead of being
 * squeezed to fit it — a section expanded by the reader has to push the page
 * down, not compress the ones above it. */
.page--scroll .page-body > * { flex-shrink: 0; }

/* A scrolling form page (General) with a sticky action footer. */
.page--form { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.page--form .page-head { flex-shrink: 0; }
.page--form .page-body { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; padding-bottom: 0; }

/* ---- Infinite-scroll feedback row ---- */
.load-more { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; font-size: 12.5px; color: var(--brand-grey-text); }
.load-more[hidden] { display: none; }
.load-more.is-error { color: var(--brand-danger); }
.load-more__spin { width: 15px; height: 15px; border: 2px solid var(--brand-grey); border-top-color: var(--brand-accent); border-radius: 50%; animation: mhc-spin .7s linear infinite; }
.load-more .btn-link { color: var(--brand-danger); }
.btn-block { width: 100%; justify-content: center; }
.btn-spin { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: mhc-spin .7s linear infinite; }
.btn-spin[hidden] { display: none; }
@keyframes mhc-spin { to { transform: rotate(360deg); } }

/* ---- Empty / error / skeleton ---- */
.state-card { border: 1px dashed var(--brand-grey); border-radius: var(--radius-xl); background: #fff; padding: 64px 24px; text-align: center; }
.state-card.is-error { border-color: var(--tint-danger); border-style: solid; }
.state-card__icon { width: 48px; height: 48px; border-radius: 12px; background: var(--tint-accent); color: var(--brand-accent); display: inline-flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 14px; }
.state-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--brand-black); }
.state-card p { margin: 0; font-size: 13px; color: var(--brand-grey-text); }
.skeleton-row { height: 46px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; padding: 0 16px; gap: 16px; }
.skeleton-bar { height: 12px; border-radius: 4px; background: linear-gradient(90deg,#eef0fb 25%,#e2e5f6 37%,#eef0fb 63%); background-size: 800px 100%; animation: mhc-shimmer 1.4s infinite linear; }

/* ---- Split view ---- */
.split { position: absolute; inset: 0; display: flex; overflow: hidden; }
.split__list { width: 288px; flex-shrink: 0; border-right: 1px solid var(--border-color); background: #fff; display: flex; flex-direction: column; overflow: hidden; }
.split__list-head { flex-shrink: 0; padding: 12px 14px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 8px; }
.split__list-body { flex: 1; min-height: 0; overflow-y: auto; }
.split-item { padding: 12px 14px; border-bottom: 1px solid var(--border-color); cursor: pointer; border-left: 3px solid transparent; display: block; }
.split-item.is-active { border-left-color: var(--brand-accent); background: var(--tint-accent); }
.split-item__id { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--brand-black); }
.split-item__service { font-size: 12.5px; color: var(--brand-blue-text); margin-top: 5px; line-height: 1.3; }
.split-item__meta { font-size: 11.5px; color: var(--brand-grey-text); }
.split__detail { flex: 1; min-width: 0; overflow-y: auto; transition: opacity var(--transition-fast); }
/* In-flight pane swap: dim rather than spin — the fetch usually lands in well
   under a second, so a spinner would only flicker. */
.split__detail.is-loading { opacity: .5; }
.icon-btn[data-disabled] { opacity: .5; pointer-events: none; }

/* ---- Detail ---- */
.detail-head { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--border-color); padding: 16px 28px; }
.detail-head__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-head__id { font-family: var(--font-mono); font-size: 19px; font-weight: 600; color: var(--brand-black); }
.detail-body { padding: 22px 28px 60px; max-width: 1080px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 12px; }
.info-card { border: 1px solid var(--border-color); border-radius: var(--radius-xl); background: #fff; padding: 16px 18px; }
.info-card__title { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-accent); margin-bottom: 12px; }
.info-row { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: 13px; }
.info-row__k { color: var(--brand-grey-text); }
.info-row__v { color: var(--brand-blue-text); text-align: right; max-width: 62%; }
.identity-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius-lg); }

/* ---- Timeline ---- */
.timeline { margin-top: 24px; }
.timeline__node { display: flex; gap: 16px; }
.timeline__rail { display: flex; flex-direction: column; align-items: center; width: 34px; flex-shrink: 0; }
.timeline__circle { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--brand-grey); background: #fff; color: var(--brand-blue-text); font-family: var(--font-mono); font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.timeline__circle.is-active { border-color: var(--brand-accent); background: var(--brand-accent); color: #fff; box-shadow: 0 0 0 4px var(--brand-accent-ring); }
.timeline__line { flex: 1; width: 2px; background: var(--brand-grey); margin: 4px 0; }
.timeline__content { flex: 1; min-width: 0; padding-bottom: 16px; }
.attempt-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: transparent; border: 1px solid transparent; border-radius: var(--radius-md); padding: 8px 12px; cursor: pointer; text-align: left; font-family: var(--font-sans); }
.attempt-head.is-active { background: var(--tint-accent); border-color: var(--brand-accent-border-soft); }

/* ---- Attempt panel ---- */
.attempt-panel { margin-top: 12px; border: 1px solid var(--border-color); border-radius: var(--radius-xl); background: #fff; animation: mhc-fadein .18s ease; overflow: hidden; }
.attempt-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border-color); padding: 0 12px; flex-wrap: wrap; }
.attempt-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 12px; font-size: 12.5px; font-weight: 500; color: var(--brand-grey-text); cursor: pointer; font-family: var(--font-sans); }
.attempt-tab.is-active { color: var(--brand-accent); border-bottom-color: var(--brand-accent); font-weight: 600; }
.attempt-tabpane { padding: 16px 18px; }
.attempt-tabpane[hidden] { display: none; }
.panel-section-title { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-grey-text); margin: 0 0 10px; }
.attempt-tab__badge { margin-left: 6px; font-family: var(--font-mono); font-size: 10px; padding: 1px 5px; border-radius: 8px; background: var(--brand-grey-light); color: var(--brand-grey-text); }
/* Read-only prose set apart from the surrounding key/value grid (call summary). */
.text-block { background: var(--brand-grey-light); border-radius: var(--radius-md); padding: 12px 14px; margin: 0 0 18px; font-size: 13px; line-height: 1.6; color: var(--brand-black); }

/* Outcome tab: each group (milestones / steps / incidents / requests) reads as its own block. */
.outcome-group { display: flex; flex-direction: column; gap: 4px; padding-left: 10px; border-left: 2px solid var(--border-color); margin-bottom: 18px; }

/* ---- Persistent audio player (top of attempt panel) ---- */
.audio-bar { padding: 12px 16px; border-bottom: 1px solid var(--border-color); background: #fff; }
.audio-note { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: var(--radius-md); font-size: 12.5px; }
.audio-note[hidden] { display: none; }
.audio-note.is-off { background: var(--brand-grey-light); color: var(--brand-grey-text); }
.audio-note.is-processing { background: var(--tint-warning); color: var(--brand-warning); }
.audio-note i { font-size: 17px; }
.audio-player { --audio-time-h: 16px; display: flex; align-items: center; gap: 12px; }
.audio-player__play { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: var(--brand-accent); color: #fff; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: var(--brand-shadow-btn); }
.audio-player__play:hover { background: var(--brand-accent-hover); }
.audio-player__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
/* Empty mirror of the time row. It balances the column so the bar — not the
   bar+time block — sits on the row's centerline, level with the play and speed
   buttons, while the time still reads underneath the bar. */
.audio-player__body::before { content: ''; height: var(--audio-time-h); }
.audio-player__time { height: var(--audio-time-h); font-family: var(--font-mono); font-size: 11.5px; line-height: var(--audio-time-h); color: var(--brand-grey-text); }
.audio-player__track { position: relative; height: 6px; background: var(--brand-grey); border-radius: 3px; cursor: pointer; touch-action: none; }
/* Invisible band around the 6px bar so the thumb is easy to grab; it stops
   short of the time label below so that text stays clickable-through. */
.audio-player__track::after { content: ''; position: absolute; inset: -11px 0 -5px; }
.audio-player__fill { height: 100%; width: 0; background: var(--brand-accent); border-radius: 3px; }
.audio-player__thumb { position: absolute; top: 50%; left: 0; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--brand-accent); border: 2px solid var(--brand-white); box-shadow: var(--brand-shadow-sm); transition: transform var(--transition-fast); }
.audio-player__track:hover .audio-player__thumb,
.audio-player__track.is-dragging .audio-player__thumb { transform: scale(1.2); }
.audio-player__rate { min-width: 42px; flex-shrink: 0; padding: 4px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--brand-white); color: var(--brand-grey-text); font-family: var(--font-mono); font-size: 11.5px; cursor: pointer; }
.audio-player__rate:hover { border-color: var(--brand-accent); color: var(--brand-accent); }

/* ---- Transcript (chat bubbles: client left, voice agent right) ---- */
.transcript { display: flex; flex-direction: column; gap: 12px; }
.turn { display: flex; }
/* align-items keeps the bubble at its own width: without it the body stretches
   to the speaker/timestamp row and short messages render half empty. */
.turn__wrap { max-width: 76%; display: flex; flex-direction: column; align-items: flex-start; }
.turn__meta { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.turn__spk { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.turn__t { font-family: var(--font-mono); font-size: 10.5px; color: var(--brand-grey-text); }
.turn__body { font-size: 13px; line-height: 1.5; padding: 9px 13px; color: var(--brand-blue-text); }
/* Client → left, green label, grey bubble, tail top-left */
.turn--client { justify-content: flex-start; }
.turn--client .turn__spk { color: var(--brand-success); }
.turn--client .turn__body { background: var(--brand-grey-light); border-radius: 3px 12px 12px 12px; }
/* Voice agent → right, indigo label, tinted bubble, tail top-right */
.turn--agent { justify-content: flex-end; }
.turn--agent .turn__wrap { align-items: flex-end; }
.turn--agent .turn__meta { justify-content: flex-end; }
.turn--agent .turn__spk { color: var(--brand-accent); }
.turn--agent .turn__body { background: var(--tint-accent); border-radius: 12px 3px 12px 12px; }
/* System note → centered, italic */
.turn--system { justify-content: center; }
.turn--system .turn__body { background: transparent; color: var(--brand-grey-text); font-style: italic; font-size: 11.5px; padding: 2px 0; text-align: center; }
/* Tool call → full-width dashed card */
.turn--tool { justify-content: stretch; }
.turn--tool .turn__wrap { max-width: 100%; width: 100%; }
.turn--tool .turn__body { background: #fff; border: 1px dashed var(--brand-grey); border-radius: var(--radius-md); font-family: var(--font-mono); font-size: 12px; width: 100%; }
.turn--tool .tool-name { color: var(--brand-accent); font-weight: 600; }
.turn--tool .tool-io { color: var(--brand-grey-text); display: block; margin-top: 3px; word-break: break-all; }

/* ---- Quality ---- */
.quality-dim { margin-bottom: 12px; }
.quality-dim__head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.quality-dim__score { font-family: var(--font-mono); font-weight: 600; }
.quality-bar { height: 6px; border-radius: 3px; background: var(--brand-grey-light); margin: 5px 0; overflow: hidden; }
/* display:block, so the fill is not silently invisible when the bar is written
   with spans (an inline element ignores width and height). */
.quality-bar__fill { display: block; height: 100%; border-radius: 3px; transition: width var(--transition-slow); }
.quality-dim__reason { font-size: 12px; color: var(--brand-grey-text); line-height: 1.4; }

/* ---- Cost / tech tables ---- */
.kv-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.kv-table td, .kv-table th { padding: 6px 10px; border-bottom: 1px solid var(--border-color); text-align: left; }
.kv-table th { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-grey-text); font-weight: 600; }
.kv-table .num { font-family: var(--font-mono); text-align: right; }

/* ---- Config tables ---- */
.config-card { border: 1px solid var(--border-color); border-radius: var(--radius-xl); background: #fff; padding: 20px 22px; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-actions { margin-top: 16px; display: flex; gap: 10px; }
.entity-row { border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: #fff; margin-bottom: 10px; overflow: hidden; }
.entity-row__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; cursor: pointer; }
.entity-row__body { padding: 4px 16px 16px; border-top: 1px solid var(--border-color); }
.entity-row__body[hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--brand-grey-light); color: var(--brand-grey-text); font-size: 11.5px; padding: 2px 8px; border-radius: var(--radius-md); }
/* A trap read as an expectation would invert the row's meaning, so it never
   shares the neutral chip. */
.chip--danger { background: var(--tint-danger); color: var(--brand-danger); }

/* ---- Sandbox ---- */
.sandbox-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.code-block { background: var(--brand-black); color: #e6e8ff; font-family: var(--font-mono); font-size: 12px; border-radius: var(--radius-md); padding: 14px; white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; }
.warn-banner { background: var(--tint-warning); color: var(--brand-warning); font-size: 12.5px; padding: 8px 12px; border-radius: var(--radius-md); margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }

/* ---- Toast ---- */
.toast-stack { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 9px; padding: 10px 16px; background: var(--brand-black); color: #fff; border-radius: var(--radius-lg); box-shadow: var(--brand-shadow-lg); font-size: 13px; animation: mhc-toast .25s ease; }
.toast i { color: var(--brand-accent-variant); font-size: 17px; }
.toast.is-error i { color: var(--brand-danger); }

/* ---- Backdrop (mobile) ---- */
.app-backdrop { position: absolute; inset: 0; background: rgba(0,4,91,0.34); z-index: 20; animation: mhc-fadein .2s ease; display: none; }

/* ---- Segmented tabs (All / Active / Inactive; sandbox endpoint toggles) ---- */
.seg { display: inline-flex; gap: 2px; background: var(--brand-grey-light); border-radius: var(--radius-md); padding: 3px; }
.seg__btn { border: none; background: transparent; color: var(--brand-grey-text); font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; padding: 5px 13px; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg__btn:hover { color: var(--brand-blue-text); }
.seg__btn.is-active { background: #fff; color: var(--brand-accent); font-weight: 600; box-shadow: var(--brand-shadow-sm); }

/* ---- Catalog toolbar (search + tabs + new) ---- */
.catalog-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; margin-bottom: 16px; flex-shrink: 0; }
.catalog-toolbar .search-box { flex: 1 1 220px; max-width: 320px; }
.catalog-toolbar .spacer { margin-left: auto; }

/* ---- Tag facet (case list): several tags picked at once, applied in one submit ---- */
/* The form lays out as if its children were the toolbar's own, so the panel can
   take a row of its own below them: ordered last so the toolbar's trailing
   button is not pushed past it, and never over the table it filters. */
.tag-filter { display: contents; }
.tag-panel { order: 1; flex-basis: 100%; padding: 14px 16px; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius-lg); animation: mhc-fadein .2s ease; }
.tag-panel[hidden] { display: none; }
.tag-panel__opts { display: flex; flex-wrap: wrap; gap: 6px; max-height: 170px; overflow-y: auto; }
.tag-panel__foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-color); }
.tag-panel__note { font-size: 11.5px; color: var(--brand-grey-text); margin-right: auto; }
/* A checkbox wearing the chip the tag is shown as everywhere else. */
.chip-check { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 11.5px; padding: 3px 9px; border-radius: var(--radius-md); border: 1px solid var(--brand-grey); background: #fff; color: var(--brand-grey-text); cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip-check:hover { border-color: var(--brand-accent-border-soft); color: var(--brand-blue-text); }
.chip-check:has(input:checked) { background: var(--tint-accent); border-color: var(--brand-accent); color: var(--brand-accent); font-weight: 600; }
.chip-check:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--brand-accent-ring); }

/* ---- Config: centered column & sections (General form) ---- */
.config-col { max-width: 768px; margin: 0 auto; width: 100%; }
.config-section { border: 1px solid var(--border-color); border-radius: var(--radius-xl); background: #fff; padding: 20px 22px; margin-bottom: 16px; }
.config-section__title { font-size: 14px; font-weight: 600; color: var(--brand-black); margin: 0; }
.config-section__desc { font-size: 12.5px; color: var(--brand-grey-text); margin: 3px 0 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-lbl { font-size: 12px; font-weight: 500; color: var(--brand-blue-text); margin-bottom: 6px; display: block; }
.field-lbl .req { color: var(--brand-danger); margin-left: 2px; }
.field-full { width: 100%; }
.info-note { display: flex; align-items: center; gap: 8px; background: var(--tint-accent); color: var(--brand-accent); font-size: 12.5px; padding: 10px 12px; border-radius: var(--radius-md); margin-top: 16px; }
.info-note i { font-size: 15px; }
.info-note--danger { background: var(--tint-danger); color: var(--brand-danger); }

/* pill toggles (calling days) */
.pill-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.pill-toggle span { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; padding: 7px 13px; border: 1px solid var(--brand-grey); border-radius: var(--radius-md); font-size: 12.5px; font-weight: 500; color: var(--brand-blue-text); background: #fff; cursor: pointer; transition: all var(--transition-fast); }
.pill-toggle span:hover { border-color: var(--brand-accent-border-soft); }
.pill-toggle input:checked + span { background: var(--brand-accent); border-color: var(--brand-accent); color: #fff; }
.pill-toggle input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-accent-ring); }

/* save footer — sticks to the bottom of the scrolling form so the actions stay
   reachable. It floats (raised with a shadow) while content extends below, and
   goes flat once the user scrolls to the end. margin-top:auto keeps it pinned to
   the bottom when content is shorter than the viewport (already flat then). */
.form-footer { position: sticky; bottom: 0; margin: auto -28px 0; padding: 12px 28px; background: rgba(255,255,255,0.02); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--border-color); flex-shrink: 0; transition: box-shadow var(--transition-fast); }
.form-footer.is-floating { box-shadow: 0 -6px 18px -10px rgba(0,4,91,0.22); }
.form-footer__inner { max-width: 768px; margin: 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.form-footer__note { margin-right: auto; font-size: 12px; color: var(--brand-grey-text); }

/* ---- Drawer (right-side panel for edit / new — replaces the modal) ---- */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer[hidden] { display: none; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(0,4,91,0.10); animation: mhc-fadein .16s ease; }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 480px; max-width: 92%;
  background: #fff; box-shadow: var(--brand-shadow-lg); display: flex; flex-direction: column;
  animation: mhc-slidein .22s ease;
}
@keyframes mhc-slidein { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
/* The panel's only child is the <form> holding head/body/foot, so the column
   layout has to continue through it — otherwise the body's overflow-y never has
   a height to overflow and a tall form runs off the bottom of the screen with no
   scrollbar. */
.drawer__panel > form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.drawer__head { flex-shrink: 0; padding: 18px 22px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 10px; }
.drawer__title { font-size: 15px; font-weight: 600; color: var(--brand-black); }
.drawer__sub { font-size: 12px; color: var(--brand-grey-text); margin-top: 2px; }
.drawer__close { margin-left: auto; background: none; border: none; color: var(--brand-grey-text); cursor: pointer; font-size: 22px; display: inline-flex; line-height: 1; }
.drawer__close:hover { color: var(--brand-blue-text); }
.drawer__body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px; }
.drawer__body .form-grid { grid-template-columns: 1fr 1fr; }
.drawer__foot { flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border-color); }
.drawer__foot .form-footer__note { margin-right: auto; }
.drawer__foot .btn-primary, .drawer__foot .btn-ghost { margin-left: 0; }
.drawer__foot .spacer { margin-left: auto; }

/* ---- Confirmation dialog (destructive actions only) ---- */
/* Centered rather than a drawer: it is a question, not a place, and it has to
   interrupt whatever panel asked it. */
.confirm { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 24px; }
.confirm[hidden] { display: none; }
.confirm__backdrop { position: absolute; inset: 0; background: rgba(0,4,91,0.22); animation: mhc-fadein .16s ease; }
.confirm__box { position: relative; width: 420px; max-width: 100%; background: #fff; border-radius: var(--radius-xl); box-shadow: var(--brand-shadow-lg); padding: 20px; display: flex; flex-direction: column; gap: 16px; animation: mhc-fadein .16s ease; }
.confirm__head { display: flex; gap: 12px; }
.confirm__icon { flex-shrink: 0; width: 34px; height: 34px; border-radius: var(--radius-lg); display: inline-flex; align-items: center; justify-content: center; font-size: 17px; background: var(--tint-danger); color: var(--brand-danger); }
.confirm__title { font-size: 14.5px; font-weight: 600; color: var(--brand-black); }
.confirm__text { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--brand-grey-text); }
.confirm__actions { display: flex; justify-content: flex-end; gap: 10px; }

/* Editor body: stacked sections replacing the old form-grid/checkbox rows */
.editor-stack { display: flex; flex-direction: column; gap: 16px; }
.editor-stack .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0; }

/* Read-only summary chip (e.g. the fixed attempt-result of a retry policy) */
.editor-summary { display: flex; align-items: center; gap: 10px; padding: 11px 13px; background: var(--brand-grey-light); border-radius: var(--radius-md); }
.editor-summary__k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-grey-text); }
.editor-summary__v { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--brand-black); }
.editor-summary__code { font-family: var(--font-mono); font-size: 11px; color: var(--brand-grey-text); }

/* Toggle switch (drives a hidden checkbox — no JS required to submit) */
.field-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; border-top: 1px solid var(--border-color); }
.field-toggle__label { font-size: 13px; color: var(--brand-blue-text); }
.field-toggle__hint { font-size: 11px; color: var(--brand-grey-text); margin-top: 1px; }
.switch { display: inline-flex; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 38px; height: 22px; border-radius: 11px; background: var(--brand-grey); padding: 2px; display: inline-flex; justify-content: flex-start; transition: background .15s; }
.switch__knob { width: 18px; height: 18px; border-radius: 50%; background: #fff; display: block; transition: transform .15s; }
.switch input:checked + .switch__track { background: var(--brand-accent); }
.switch input:checked + .switch__track .switch__knob { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px var(--brand-accent-ring); }
/* Table-cell size: a switch in a row must not set the row's height. */
.switch--sm .switch__track { width: 32px; height: 18px; border-radius: 9px; }
.switch--sm .switch__knob { width: 14px; height: 14px; }
.switch--sm input:checked + .switch__track .switch__knob { transform: translateX(14px); }

/* Retry delay sequence editor */
.delay-list { display: flex; flex-direction: column; gap: 8px; }
.delay-row { display: flex; align-items: center; gap: 10px; }
.delay-row__label { font-size: 12.5px; color: var(--brand-grey-text); min-width: 130px; }
.delay-row__input { width: 74px; font-family: var(--font-mono); }
.delay-row__unit { font-size: 12px; color: var(--brand-grey-text); }
.delay-row__del { margin-left: auto; background: none; border: none; color: var(--brand-grey-text); cursor: pointer; display: inline-flex; }
.delay-row__del:hover { color: var(--brand-danger); }
.delay-empty { font-size: 12px; color: var(--brand-grey-text); font-style: italic; }
.delay-add { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px dashed var(--brand-grey); color: var(--brand-accent); border-radius: var(--radius-md); padding: 6px 11px; font-size: 12.5px; font-weight: 500; cursor: pointer; font-family: var(--font-sans); }
.delay-add:hover { border-color: var(--brand-accent); background: var(--tint-accent); }
/* A pasted conversation is not in the case until it has been loaded into turns,
   and the two states look identical once the paste box scrolls away. */
.delay-add.is-pending { border-style: solid; border-color: var(--brand-accent); background: var(--tint-accent); }
.phrase-list { display: flex; flex-direction: column; gap: 8px; }
.phrase-row { display: flex; align-items: center; gap: 10px; position: relative; }
.phrase-row__input { flex: 1; }

/* Completions under the row being typed, a few at a time. Floated over what
   follows rather than pushing it down: the field it belongs to must not move
   while someone is typing in it. The row is raised while its list is open, or the
   rows after it — later in the document, so painted above — would cover it. */
.phrase-row:has(.suggest:not([hidden])) { z-index: 6; }
.suggest { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; right: 44px; padding: 4px; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--brand-shadow-lg); display: flex; flex-direction: column; gap: 2px; animation: mhc-fadein .12s ease; }
.suggest__opt { text-align: left; font-family: var(--font-mono); font-size: 12px; color: var(--brand-blue-text); background: none; border: 0; border-radius: var(--radius-md); padding: 6px 9px; cursor: pointer; }
.suggest__opt:hover, .suggest__opt.is-active { background: var(--tint-accent); color: var(--brand-accent); }
.suggest__opt mark { background: none; color: var(--brand-accent); font-weight: 600; }
/* Its own display beats the browser's rule for [hidden], so closing it says so. */
.suggest[hidden] { display: none; }

/* ---- Sandbox (structured request builder) ---- */
.sandbox-head { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; flex-wrap: wrap; }
.http-method { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .04em; color: #fff; background: var(--brand-accent); padding: 4px 9px; border-radius: var(--radius-sm); }
.http-path { font-family: var(--font-mono); font-size: 13.5px; color: var(--brand-black); }
.sandbox-head .btn-primary { margin-left: auto; }
.mini-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.btn-mini { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--brand-grey); border-radius: var(--radius-md); color: var(--brand-blue-text); font-family: var(--font-sans); font-size: 12px; font-weight: 500; padding: 6px 11px; cursor: pointer; }
.btn-mini:hover { background: var(--brand-grey-light); }
.response-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 20px; color: var(--brand-grey-text); }
.response-empty i { font-size: 26px; color: var(--brand-accent); background: var(--tint-accent); width: 52px; height: 52px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.response-empty h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--brand-blue-text); }
.response-empty p { margin: 0; font-size: 12.5px; max-width: 260px; line-height: 1.45; }

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .app-sidebar { position: absolute; top: 0; left: 0; bottom: 0; z-index: 30; transform: translateX(-100%); transition: transform .26s ease; }
  .app-shell.sidebar-open .app-sidebar { transform: translateX(0); }
  .app-shell.sidebar-open .app-backdrop { display: block; }
  .sidebar-toggle { display: inline-flex; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid, .form-grid, .sandbox-grid, .form-row { grid-template-columns: 1fr; }
  .split__list { display: none; }
  .page-head { padding: 18px 16px 12px; }
  .page-body { padding: 0 16px 22px; }
  .form-footer { margin: auto -16px 0; padding: 12px 16px; }
  .response-empty { padding: 28px 16px; }
  .detail-head { padding: 14px 16px; }
  .detail-body { padding: 18px 16px 48px; }
}

/* ==========================================================================
   Evals — test cases and test runs
   ========================================================================== */

/* The case editor holds ~40 fields plus a transcript, so its panel is wider
   than the catalog drawers (which carry seven fields in one column). */
.drawer--wide .drawer__panel { width: 720px; }
.drawer--wide .drawer__body .form-grid { grid-template-columns: 1fr 1fr; }

/* Field hint: the eval domain is full of tri-states ("empty = not graded")
   that have to be on screen, not in a wiki. Selected through .field, because a
   hint is also a direct span child there and would otherwise inherit the
   uppercase label styling and read as one. */
.form-hint, .field > .form-hint { font-size: 11.5px; font-weight: 400; line-height: 1.45; color: var(--brand-grey-text); text-transform: none; letter-spacing: 0; }
.form-hint code { font-family: var(--font-mono); font-size: 11px; background: var(--brand-grey-light); padding: 1px 4px; border-radius: var(--radius-sm); }
textarea.field-grow { min-height: 76px; resize: vertical; line-height: 1.5; }

/* Collapsible editor sections. The icon tile is what makes "Forbidden" read as
   different in kind from "Expected" at a glance. */
.eval-section { border: 1px solid var(--border-color); border-radius: var(--radius-xl); background: #fff; overflow: hidden; }
.eval-section__head { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 14px 16px; background: none; border: none; cursor: pointer; text-align: left; font-family: var(--font-sans); }
.eval-section__head:hover { background: var(--brand-background); }
.eval-section__icon { flex-shrink: 0; width: 34px; height: 34px; border-radius: var(--radius-lg); display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.eval-section__icon.tint-accent { background: var(--tint-accent); color: var(--brand-accent); }
.eval-section__icon.tint-neutral { background: var(--brand-grey-light); color: var(--brand-grey-text); }
.eval-section__icon.tint-success { background: var(--tint-success); color: var(--brand-success); }
.eval-section__icon.tint-warning { background: var(--tint-warning); color: var(--brand-warning); }
.eval-section__icon.tint-danger { background: var(--tint-danger); color: var(--brand-danger); }
.eval-section__icon.tint-milestone { background: var(--tint-milestone); color: var(--brand-milestone); }
.eval-section__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.eval-section__text .config-section__desc { margin: 0; }
.eval-section__chevron { flex-shrink: 0; color: var(--brand-grey-text); font-size: 16px; margin-top: 8px; transition: transform var(--transition-base); }
.eval-section.is-open .eval-section__chevron { transform: rotate(180deg); }
.eval-section__body { display: none; flex-direction: column; gap: 16px; padding: 4px 16px 18px; }
.eval-section.is-open .eval-section__body { display: flex; }

/* Multi-select over a catalog. Off by default so the selected codes read as a
   short list rather than a wall of muted chips. */
.chip-select { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-select__opt { font-family: var(--font-mono); font-size: 11.5px; padding: 3px 9px; border-radius: var(--radius-md); border: 1px solid var(--brand-grey); background: #fff; color: var(--brand-grey-text); cursor: pointer; }
.chip-select__opt:hover { border-color: var(--brand-accent-border-soft); color: var(--brand-blue-text); }
.chip-select__opt.is-on { background: var(--tint-accent); border-color: var(--brand-accent); color: var(--brand-accent); font-weight: 600; }
.chip-select--danger .chip-select__opt.is-on { background: var(--tint-danger); border-color: var(--brand-danger); color: var(--brand-danger); }

/* The accepted paste format, stated next to the box that accepts it. */
.paste-format { border: 1px dashed var(--border-color); border-radius: var(--radius-lg); padding: 10px 12px; background: var(--brand-background); }
.paste-format__title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-grey-text); margin-bottom: 6px; }
.paste-format ul { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; }
.paste-format li { font-size: 11.5px; line-height: 1.45; color: var(--brand-grey-text); }
.paste-format code { font-family: var(--font-mono); font-size: 11px; background: var(--brand-grey-light); padding: 1px 4px; border-radius: var(--radius-sm); }

/* Transcript turn editor. */
.turn-editor { display: flex; flex-direction: column; gap: 10px; }
.turn-row { border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--brand-background); }
.turn-row__head { display: flex; align-items: center; gap: 8px; }
.turn-row__head select { min-width: 132px; }
.turn-row__head .delay-row__del { margin-left: auto; }
.turn-row textarea { width: 100%; resize: vertical; }
.tool-list { display: flex; flex-direction: column; gap: 6px; }
.tool-row { display: flex; align-items: center; gap: 8px; }
.tool-row select { min-width: 168px; }
.tool-row input { flex: 1; min-width: 0; }

/* The case list: without widths the title collapses into a five-line stack while
   the tag column takes the room, and the verdict falls off the right edge.
   Column order is case, evaluate, tags, verdict, updated by, last run. */
/* The identity column takes the room it needs first: left to the browser's
   content distribution the key breaks mid-word while the chips spread out. */
.data-table--cases th:first-child, .data-table--cases td:first-child { min-width: 280px; }
.data-table--cases th:nth-child(2), .data-table--cases td:nth-child(2) { width: 78px; }
/* The tag column needs a max as well as a min: a case carrying six of them would
   otherwise push the columns after it off the right edge. */
.data-table--cases td:nth-child(3) { min-width: 110px; max-width: 160px; }
/* The dimmed cell of a skipped row is its switch, which here is not the first. */
.data-table--cases tbody tr.is-inactive td:first-child { opacity: 1; }
.data-table--cases tbody tr.is-inactive td:nth-child(2) { opacity: .75; }

/* The row opens the editor, so it highlights on hover like every other list here.
   Two of its cells go somewhere else, though — the verdict to the result that
   disagreed, the date to the run that produced it — and so does the switch, which
   acts on the row without opening it. Over any of those the row highlight drops
   and the control takes the emphasis instead: what the pointer is on is what the
   click will do. */
.data-table--cases tbody tr:hover:has(a[href]:hover, [data-row-toggle]:hover) { background: none; }
.data-table--cases td a.btn-link:hover { text-decoration: underline; }
/* A pill cannot be underlined without reading as damaged, so the link affordance
   is a ring in the verdict's own colour. */
.data-table--cases a.verdict-line:hover .badge-verdict { box-shadow: 0 0 0 1.5px currentColor; }

/* Key over title: one identity in one cell. The key is monospaced and exact, the
   title is what you actually read. */
.case-id { font-size: 11.5px; font-weight: 600; color: var(--brand-black); white-space: nowrap; }
.case-id__title { font-size: 12.5px; color: var(--brand-blue-text); line-height: 1.4; margin-top: 2px; max-width: 260px; }

/* One verdict per case, linking to whichever half of the pipeline disagreed. */
.verdict-line { display: flex; align-items: center; gap: 8px; padding: 1px 0; }

/* Fixed-width verdict badge, so a column of them aligns. */
.badge-verdict { min-width: 64px; justify-content: center; font-family: var(--font-mono); }

/* Run list result cell: bar, percentage and verdict on one line. The bar comes
   first so every row's bar starts at the same x and the column can be compared
   down; the number reads it out. Left-aligned in a fixed box, so 0% and 100% both
   begin at the same place instead of the figure sliding with its own width. */
.pass-rate-inline { display: flex; align-items: center; gap: 10px; }
.pass-rate-inline .quality-bar { margin: 0; flex-shrink: 0; }
.rate-figure { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand-black); width: 42px; text-align: left; flex-shrink: 0; }
.rate-figure.is-passed { color: var(--brand-success); }
.rate-figure.is-failed { color: var(--brand-danger); }

/* Passed, failed and not-yet in one bar: the gap at the end is the run's
   remaining work, so a sweep in progress reads as unfinished rather than poor. */
.split-bar { display: flex; height: 6px; border-radius: 3px; background: var(--brand-grey-light); overflow: hidden; flex-shrink: 0; }
/* Under the figure it breaks down rather than across the card: at this size it
   reads as the percentage's underline, not as a second statement of it. */
.split-bar--slim { height: 4px; border-radius: 2px; margin-top: 10px; }
.split-bar__pass { background: var(--brand-success); transition: width var(--transition-slow); }
.split-bar__fail { background: var(--brand-danger); transition: width var(--transition-slow); }

/* Run detail headline, split by what each half answers: how the run was produced
   on the left, how it went on the right. A run is opened to ask one question — how
   did it go — and the answer is a percentage, so the percentage is the size of the
   question, set in the mono face every other number in the console is set in (the
   sans one bent the digits out of the family the rest of the numbers are in).
   Everything that qualifies the answer — the bar, the counts, what is still owed —
   is in that same right-hand column, so the two halves are read once each instead
   of the eye crossing the card for every number. */
.run-hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius-xl); padding: 18px 24px; }
/* The verdict edge is on the side the percentage is on: the colour and the number
   it belongs to are then read as one thing rather than as the two ends of a card. */
.run-hero.is-passed { border-right: 4px solid var(--brand-success); }
.run-hero.is-failed { border-right: 4px solid var(--brand-danger); }
.run-hero__rate { border-left: 1px solid var(--border-color); padding-left: 24px; text-align: right; min-width: 210px; }
.run-hero__value { font-family: var(--font-mono); font-size: 52px; font-weight: 400; line-height: 1; letter-spacing: -.02em; color: var(--brand-black); font-variant-numeric: tabular-nums; }
.run-hero.is-passed .run-hero__value { color: var(--brand-success); }
.run-hero.is-failed .run-hero__value { color: var(--brand-danger); }
.run-hero__pct { font-family: var(--font-mono); font-size: 22px; font-weight: 400; margin-left: 2px; }
.run-hero__label { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--brand-grey-text); margin-top: 5px; }
.run-hero__note { font-size: 12px; color: var(--brand-grey-text); margin-top: 6px; }
/* The phase leads the column when there is one, small: what state the run is in
   qualifies the percentage under it rather than announcing itself. */
.run-hero__rate .phase { margin-bottom: 8px; }
/* How the run was produced: the clock, the models and the operator, as a grid that
   fills the width the percentage does not need. */
.run-hero__meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 18px; min-width: 0; }
.run-hero__meta .field > div { font-size: 13px; }

/* The counts behind the percentage, each one countable at a glance. Beside the
   figure they are its breakdown, so they are set smaller than it and right-aligned
   with it: at the size they had as the card's own headline they competed with it. */
.tallies { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-right: auto; }
.tally { font-size: 13px; color: var(--brand-grey-text); display: inline-flex; align-items: baseline; gap: 6px; }
.tally b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand-black); }
.tally--pass b { color: var(--brand-success); }
.tally--fail b { color: var(--brand-danger); }
.tally--wait b { color: var(--brand-accent); }
.run-hero__rate .tallies { justify-content: flex-end; gap: 14px; margin: 10px 0 0; }
.run-hero__rate .tally { font-size: 12px; gap: 5px; }
.run-hero__rate .tally b { font-size: 16px; }
@media (max-width: 900px) {
  .run-hero { grid-template-columns: 1fr; gap: 14px; }
  /* Stacked, the figure leads again: side by side it is the right-hand column, but
     above the fields it would be a right-aligned number over a left-aligned body. */
  .run-hero__rate { order: -1; border-left: none; border-bottom: 1px solid var(--border-color); padding-left: 0; padding-bottom: 12px; text-align: left; }
  .run-hero__rate .tallies { justify-content: flex-start; }
}

/* ---- A run in flight ---- */
/* Reserved before the models answer, so the console can watch a sweep instead of
   waiting for it. Rows without a verdict yet are dimmed, not greyed out: they are
   still the run's rows, just not answers. */
.phase { gap: 6px; }
.phase__pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
tr.is-waiting td { opacity: .72; }

/* Waiting for this row's own verdict: the page says what it is waiting for
   rather than laying out sections that read as "nothing disagreed". */
.waiting { display: flex; align-items: flex-start; gap: 13px; }
.waiting__spin { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--brand-grey-light); border-top-color: var(--brand-accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Refreshes itself so nobody has to. Off unless something is actually running:
   polling a history nobody is adding to is noise. */
/* A switch, so it looks like one: play to turn watching on, pause to turn it off,
   and a pulsing "Live" that is only there while it is on — the state belongs beside
   the control, not inside its label. */
.live { display: inline-flex; align-items: center; gap: 8px; }
.live__btn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: var(--radius-md); border: 1px solid var(--brand-grey); background: #fff; color: var(--brand-grey-text); font-size: 12.5px; font-weight: 600; font-family: var(--font-sans); cursor: pointer; }
.live__btn i { font-size: 14px; }
.live__btn.is-on { border-color: var(--brand-success); color: var(--brand-success); background: var(--tint-success); }
.live__pill { display: none; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--brand-success); }
.live.is-on .live__pill { display: inline-flex; }
.live__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-success); animation: pulse 1.4s ease-in-out infinite; }

/* The part of a live screen that is replaced on each refresh. It must not become
   a box of its own — the page's layout is a flex column and these are its items. */
[data-live-region] { display: contents; }
/* `display: contents` hides the wrapper from layout but not from the selectors, so
   the rules about the body's own items have to be repeated one level in. Only the
   scrolling body's: on `.page--table` the table viewport is what scrolls, and
   pinning its height stopped it from ever doing so. */
.page--scroll .page-body > [data-live-region] > * { flex-shrink: 0; }

/* Sized for a tag, which is a word or two, not a single letter. */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.category-cell__head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }

/* Case detail: the verdict is the headline, the run's metadata is beside it. */
.case-verdict { display: grid; grid-template-columns: 200px 1fr; gap: 16px; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius-xl); padding: 16px; }
.case-verdict__result { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; justify-content: center; border-right: 1px solid var(--border-color); }
.case-verdict__result .badge-verdict { font-size: 13px; padding: 5px 12px; min-width: 88px; }
.case-verdict__meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; }
@media (max-width: 900px) {
  .case-verdict { grid-template-columns: 1fr; }
  .case-verdict__result { border-right: none; border-bottom: 1px solid var(--border-color); padding-bottom: 12px; }
}

/* One disagreement, stated. Every card on the screen is a failure, so the danger
   tint is the card rather than a variant of it — nothing here needs a legend. */
.findings { display: flex; flex-direction: column; gap: 10px; }
.finding { border: 1px solid var(--brand-danger); border-left-width: 3px; border-radius: var(--radius-lg); background: var(--tint-danger); padding: 11px 14px; }
.finding__label { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; font-weight: 600; color: var(--brand-black); line-height: 1.4; }
.finding__label i { color: var(--brand-danger); font-size: 17px; flex-shrink: 0; }
/* A rule is a sentence, not a field name, so it reads at body weight. */
.finding--rule .finding__label, .finding--dim .finding__label { font-weight: 500; }
.finding__sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 9px 0 0 25px; }
.finding__sides:only-child, .finding__sides:has(> :only-child) { grid-template-columns: 1fr; }
.finding__side { background: #fff; border-radius: var(--radius-md); padding: 8px 10px; font-size: 12.5px; line-height: 1.5; color: var(--brand-grey-text); word-break: break-word; }
.finding__side--got { color: var(--brand-black); }
.finding__key { display: block; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--brand-grey-text); margin-bottom: 3px; }
.finding__side--got .finding__key { color: var(--brand-danger); }
@media (max-width: 760px) { .finding__sides { grid-template-columns: 1fr; margin-left: 0; } }

/* Nothing to report, said as plainly as a failure would be. */
.all-clear { display: flex; align-items: flex-start; gap: 11px; border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: var(--tint-success); padding: 13px 15px; }
.all-clear i { color: var(--brand-success); font-size: 20px; flex-shrink: 0; }
.all-clear__title { font-size: 13px; font-weight: 600; color: var(--brand-black); }
.all-clear__text { font-size: 12.5px; color: var(--brand-grey-text); line-height: 1.5; margin: 3px 0 0; }

/* The quality radar beside the dimensions worth reading about. Five scores
   against one shared bar is a shape question: which way the call dips is read
   before any number is, and the dotted ring is the bar itself. */
.quality-panel { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 20px; align-items: center; }
.quality-panel__notes { display: flex; flex-direction: column; gap: 10px; }
.radar { width: 100%; max-width: 360px; }
.radar__ring { fill: none; stroke: var(--border-strong); stroke-width: 1; }
.radar__axis { stroke: var(--border-strong); stroke-width: 1; }
.radar__threshold { fill: none; stroke: var(--brand-grey-text); stroke-width: 1.2; stroke-dasharray: 3 3; }
.radar__shape { fill: rgba(47, 179, 68, 0.18); stroke: var(--brand-success); stroke-width: 2; }
.radar.is-off .radar__shape { fill: rgba(214, 57, 57, 0.14); stroke: var(--brand-danger); }
.radar__dot { fill: var(--brand-success); }
.radar__dot--off { fill: var(--brand-danger); }
.radar__name { font-family: var(--font-sans); font-size: 10.5px; font-weight: 600; fill: var(--brand-grey-text); }
.radar__name--off { fill: var(--brand-danger); }
@media (max-width: 900px) { .quality-panel { grid-template-columns: 1fr; justify-items: center; } }

/* Confirmation, once opened: one line per assertion that agreed. */
.agreed { display: flex; flex-direction: column; }
.agreed__row { display: grid; grid-template-columns: 18px minmax(140px, 240px) 1fr; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--border-color); font-size: 12.5px; }
.agreed__row:last-child { border-bottom: none; }
.agreed__row i { color: var(--brand-success); font-size: 15px; }
.agreed__label { font-weight: 500; color: var(--brand-black); line-height: 1.45; }
.agreed__value { color: var(--brand-grey-text); line-height: 1.5; word-break: break-word; }
@media (max-width: 760px) { .agreed__row { grid-template-columns: 18px 1fr; } .agreed__value { grid-column: 2; } }

/* The whole result as fields: what the model read, and the words it read it from. */
.output-group + .output-group { margin-top: 4px; }
.output-group__label { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--brand-grey-text); padding-bottom: 6px; border-bottom: 1px solid var(--border-color); margin-bottom: 10px; }
.output-item { padding: 0 0 12px; }
.output-item:last-child { padding-bottom: 0; }
.output-item__title { display: flex; align-items: baseline; gap: 9px; font-size: 12.5px; font-weight: 600; color: var(--brand-black); }
.output-item__body { font-size: 12.5px; color: var(--brand-blue-text); line-height: 1.55; margin: 4px 0 0; }
.output-note { font-size: 10.5px; font-weight: 500; color: var(--brand-grey-text); }
/* The verbatim quote the model justified itself with, marked as quoted speech. */
.output-quote { font-size: 12px; font-style: italic; color: var(--brand-grey-text); line-height: 1.5; border-left: 2px solid var(--border-strong); padding-left: 9px; margin: 6px 0 0; }
.fact-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.fact { border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 8px 10px; }
.fact--flagged { border-color: var(--brand-warning); background: var(--tint-warning); }
.fact__label { display: block; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; font-weight: 600; color: var(--brand-grey-text); }
.fact__value { display: block; font-size: 13px; font-weight: 600; color: var(--brand-black); margin-top: 2px; }
.fact--flagged .fact__value { color: var(--brand-warning); }

.table-link-row { cursor: pointer; }
/* Tab reaches these rows, so the focus has to be visible on one — the outline is
   inset because a row is the full width of the table and a ring on its edge is
   clipped by the scroller. */
[data-href]:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }

/* ---- Sign-in ----
   Before the shell exists there is nothing to navigate, so this page carries no
   rail: one centred column on white, the product's own mark, and the two
   organisations as tiles told apart by icon and colour. */
.signin {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 48px 24px;
  /* Still orbs in the brand blues, so the page is not a blank white field --
     but faint, and kept to the margins: what has to draw the eye is the pair of
     tiles, not the wallpaper. Painted as gradients rather than elements, so
     there is nothing to animate and nothing to click, and they scale with the
     viewport instead of being placed in pixels. Sizes, spacing and softness are
     deliberately uneven -- scattered, not arranged, several clipped by the edge
     -- and a white veil on top clears the middle for the card. */
  background:
    radial-gradient(circle 34vmax at 50% 47%, rgba(255, 255, 255, 0.88) 42%, rgba(255, 255, 255, 0) 78%),
    radial-gradient(circle 2.5vmax at 37% 6%, rgba(8, 14, 154, 0.07) 55%, rgba(8, 14, 154, 0) 80%),
    radial-gradient(circle 5vmax at 23% 24%, rgba(108, 196, 255, 0.16) 52%, rgba(108, 196, 255, 0) 82%),
    radial-gradient(circle 21vmax at 2% 7%, rgba(108, 134, 248, 0.13) 66%, rgba(108, 134, 248, 0) 88%),
    radial-gradient(circle 9vmax at 91% 27%, rgba(108, 134, 248, 0.14) 58%, rgba(108, 134, 248, 0) 84%),
    radial-gradient(circle 12vmax at 72% 5%, rgba(108, 196, 255, 0.12) 62%, rgba(108, 196, 255, 0) 90%),
    radial-gradient(circle 3.5vmax at 99% 12%, rgba(8, 14, 154, 0.06) 60%, rgba(8, 14, 154, 0) 84%),
    radial-gradient(circle 7vmax at 61% 99%, rgba(108, 196, 255, 0.14) 54%, rgba(108, 196, 255, 0) 82%),
    radial-gradient(circle 23vmax at 93% 92%, rgba(108, 134, 248, 0.12) 68%, rgba(108, 134, 248, 0) 90%),
    radial-gradient(circle 4vmax at 4% 63%, rgba(8, 14, 154, 0.06) 58%, rgba(8, 14, 154, 0) 84%),
    radial-gradient(circle 15vmax at 14% 99%, rgba(108, 196, 255, 0.11) 62%, rgba(108, 196, 255, 0) 88%),
    var(--brand-white);
}
.signin__card { width: 100%; max-width: 470px; text-align: center; }
.signin__logo { display: block; margin: 0 auto; height: 42px; width: auto; max-width: 100%; object-fit: contain; }
.signin__product { margin: 16px 0 0; font-size: 11.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-grey-text); }
.signin__errors { margin: 26px 0 0; padding: 11px 13px; list-style: none; text-align: left; border: 1px solid var(--brand-danger); border-radius: var(--radius-md); background: var(--tint-danger); color: var(--brand-danger); font-size: 12.5px; line-height: 1.5; }
.signin__errors li + li { margin-top: 6px; }

.signin__choices { margin-top: 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.signin__choices form { display: flex; }
.signin__choice {
  position: relative; flex: 1; width: 100%; display: flex; flex-direction: column;
  align-items: center; gap: 3px; padding: 26px 16px 20px; cursor: pointer;
  font-family: inherit; color: var(--brand-black); background: var(--brand-white);
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  transition: border-color var(--transition-fast), background var(--transition-fast),
              box-shadow var(--transition-fast), transform var(--transition-fast);
}
.signin__choice i { font-size: 27px; margin-bottom: 9px; line-height: 1; }
.signin__choice-name { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.signin__choice-sub { font-size: 11px; line-height: 1.4; color: var(--brand-grey-text); }
.signin__choice:hover { transform: translateY(-1px); box-shadow: var(--brand-shadow-md); }
.signin__choice:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
/* One hue each: the two are distinguishable before either label is read. */
.signin__choice.is-mutua i { color: var(--brand-accent); }
.signin__choice.is-mutua:hover { border-color: var(--brand-accent); background: var(--tint-accent); }
.signin__choice.is-rauda i { color: #6C86F8; } /* Rauda's mark blue */
.signin__choice.is-rauda:hover { border-color: #6C86F8; background: rgba(108, 134, 248, 0.08); }
.signin__foot { margin: 30px auto 0; max-width: 42ch; padding-top: 18px; border-top: 1px solid var(--border-color); font-size: 11.5px; line-height: 1.55; color: var(--brand-grey-text); }
.signin__credit { margin-top: 26px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.signin__credit span { font-size: 9.5px; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: var(--brand-grey-text); }
.signin__credit img { display: block; height: 17px; width: auto; }

/* A phone has no room for two tiles side by side; they stack, shallower. */
@media (max-width: 560px) {
  .signin { min-height: 100dvh; padding: 56px 22px 40px; align-items: flex-start; }
  .signin__choices { grid-template-columns: 1fr; }
  .signin__choice { padding: 18px 16px 15px; }
  .signin__choice i { font-size: 24px; margin-bottom: 7px; }
}
