/* ══ AGENT HOME ════════════════════════════════════════════════════════════
 * An agent's own page (docs/sprints/prod/PLAN_AGENT_HOME.md; agent-home.js).
 * Lifted from the approved mockup (docs/sprints/prod/mockups/agent-home-mock.html,
 * its "agent-home.css (new)" block). Every colour is a token from app.css;
 * nothing here defines a colour. Motion: one-off transitions of 250 ms or less
 * on --ease-out, press feedback from the base button rule, and only two things
 * that move on their own: the lines strip while calls are live, and the
 * agent's tile while it speaks in an Ask session. Loading blocks hold still
 * (app.css rule 3: no ambient motion). */

@media (min-width: 761px) {
  .agent-subnav { overflow-y: auto; scrollbar-width: none; }
  .agent-subnav button:focus-visible { outline-color: var(--c-on-dark); }
}

/* ── the agent's own row, first in its dark column (A1, A3) ───────────── */
.agent-subnav button.ah-me { gap: 11px; min-height: 64px; padding: 10px; white-space: normal; align-items: center; }
.ah-me .agent-list-icon { flex: 0 0 44px; height: 44px; border-radius: 12px; }
.ah-me-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ah-me-name { font: 600 13px/1.25 var(--sans); letter-spacing: -0.008em; color: var(--c-on-dark);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ah-me-live { font: 400 11.5px/1.2 var(--sans); color: var(--c-on-dark-3); font-variant-numeric: tabular-nums; }
.ah-me-live[data-tone="open"] { color: var(--c-open-on-dark); }
.agent-subnav [role=tablist] > .agent-subnav-label { margin: 14px 10px 10px; }

/* ── the scope bar (B1-B4) ────────────────────────────────────────────── */
.ah-scope { position: sticky; top: -20px; z-index: 6; display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px; margin: -20px -6px 0 -2px; padding: 20px 6px 10px 2px; background: var(--c-paper);
  border-bottom: 1px solid var(--ui-sep); }
.ah-scope .agents-filters { flex: none; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ah-scope .agents-filter { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; white-space: nowrap; }
.ah-n { font-size: 11.5px; color: var(--c-ink-3); font-variant-numeric: tabular-nums; }
.agents-filter[aria-pressed="true"] .ah-n { color: var(--c-ink-2); }
.ah-chev { width: 9px; height: 9px; margin-left: -2px; color: var(--c-ink-3); }
.ah-scope-end { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.ah-scope-note { flex-basis: 100%; margin: 0; font-size: 11.5px; color: var(--c-ink-3); }
.ah-scope-note:empty { display: none; }
button.ah-dl { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; border-radius: var(--ui-r-control); }
button.ah-dl svg { width: 13px; height: 13px; }

/* popovers hung from the scope bar: the brand list's material */
.ah-pop { position: absolute; z-index: 20; min-width: 260px; max-width: calc(100vw - 32px); padding: 6px;
  background: var(--c-surface); border-radius: 12px; box-shadow: var(--ui-float); color: var(--c-ink);
  transform-origin: top left; animation: ah-pop-in 150ms var(--ease-out) both; }
.ah-pop[data-side="end"] { transform-origin: top right; }
@keyframes ah-pop-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
.ah-pop-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; align-items: baseline; width: 100%;
  margin: 0; padding: 8px 10px; border: 0; border-radius: var(--ui-r-control); background: none; color: var(--c-ink);
  font: 500 13px/1.3 var(--sans); text-align: left; }
.ah-pop-row:hover { background: var(--ui-fill-2); }
.ah-pop-row:active { transform: none; background: var(--ui-fill); }
.ah-pop-row small { grid-column: 1 / -1; font: 400 11.5px/1.4 var(--mono); color: var(--c-ink-3); overflow-wrap: anywhere; }
.ah-pop-row[aria-checked="true"]::after { content: '\2713'; grid-column: 2; grid-row: 1; }
.ah-pop-foot { margin: 4px 0 0; padding: 8px 10px 4px; border-top: 1px solid var(--ui-sep);
  font-size: 11.5px; line-height: 1.5; color: var(--c-ink-3); }
.ah-pop-foot + .ah-pop-foot { margin: 0; padding-top: 0; border-top: 0; }
.ah-pop-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px 6px 2px; }
.ah-pop-dates .workspace-field { margin: 0; }
.ah-pop-acts { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 6px 4px; }
.ah-err { margin: 2px 6px 0; font-size: 12px; color: var(--c-alarm-ink); }
.ah-err:empty { display: none; }


/* ── regions ──────────────────────────────────────────────────────────── */
/* The home panel is its own size container: on a phone the Studio's main is
   display: contents and can no longer be one. */
#ah-home { container-type: inline-size; }
.ah-page { display: flex; flex-direction: column; gap: 18px; max-width: 980px; }
.ah-page > .workspace-card { margin: 0; }
.ah-flash { outline: 2px solid var(--c-ink); outline-offset: 4px; }
.ah-quiet { margin: 0; font-size: 12.5px; color: var(--c-ink-3); }
.ah-head-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ah-region-err { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 120px; padding: 16px; border-radius: var(--ui-r-control); background: var(--ui-fill-2);
  font-size: 13px; color: var(--c-ink-2); }
.ah-skel { display: block; border-radius: var(--r-xs); background: var(--c-sunk); }

/* What it says (C1-C4) */
.ah-says { display: flex; align-items: flex-start; gap: 20px; padding: 6px 0 2px; }
.ah-says > .agent-list-icon { flex: 0 0 72px; height: 72px; border-radius: 20px; }
.ah-says-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.ah-ident { margin: 0; font-size: 12.5px; color: var(--c-ink-3); }
.ah-line { margin: 0; max-width: 34em; font: 500 21px/1.38 var(--sans); letter-spacing: -0.018em;
  color: var(--c-ink-2); text-wrap: pretty; }
.ah-line .ah-num { padding: 0; border: 0; background: none; color: var(--c-ink); font: inherit; font-weight: 650;
  font-variant-numeric: tabular-nums; text-decoration: underline; text-decoration-color: var(--c-line-strong);
  text-decoration-thickness: 1.5px; text-underline-offset: 4px; cursor: pointer; }
.ah-line .ah-num:hover { text-decoration-color: var(--c-ink-3); }
.ah-says-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.ah-says-acts button { min-height: 32px; border-radius: var(--ui-r-control); font-size: 12.5px; font-weight: 600; }

/* Its notes for you (E1-E6) */
.ah-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ah-note { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--c-surface);
  border-radius: var(--ui-r-card); box-shadow: var(--ui-card); }
.ah-note-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.ah-fig { display: flex; align-items: flex-end; gap: 8px; padding: 0; border: 0; background: none; color: var(--c-ink);
  text-align: left; cursor: pointer; }
.ah-fig:active { transform: scale(0.97); }
.ah-fig b { font: 650 30px/0.9 var(--sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ah-fig span { font: 600 12.5px/1.25 var(--sans); }
.ah-fig em { display: block; font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--c-ink-3); }
.ah-spark { flex: 0 1 112px; width: 112px; max-width: 45%; height: auto; aspect-ratio: 112 / 38; overflow: visible; }
.ah-note p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--c-ink-2); }
.ah-note-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: auto; }
.ah-note-acts button:not(.linkbtn) { min-height: 30px; border-radius: var(--ui-r-control); font-size: 12px; font-weight: 600; }
.ah-note-acts .linkbtn { padding: 0; }

/* On the phone now (F1-F9) */
.ah-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: -4px -18px 14px;
  border-bottom: 1px solid var(--ui-sep); }
.ah-stats .camp-stat { padding: 4px 18px 14px; }
.ah-stats .camp-stat b small { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--c-ink-3); }
.ah-floor { display: grid; grid-template-columns: minmax(0, 1fr) 216px; gap: 20px; }
.ah-cap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px;
  min-height: 18px; margin-bottom: 4px; }
.ah-key { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 11px; color: var(--c-ink-3); }
.ah-key span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ah-key i { display: inline-block; width: 14px; height: 7px; border-radius: 2px; }
.k-ring { background: repeating-linear-gradient(135deg, var(--c-ink-4) 0 1.5px, transparent 1.5px 4px); }
.k-talk { background: var(--c-ink); }
.k-in { box-shadow: inset 0 0 0 1.5px var(--c-ink); }
.k-other { background: var(--c-line-strong); }
.ah-now-t { display: flex; align-items: center; gap: 5px; font: 600 10.5px/1 var(--mono); white-space: nowrap; color: var(--c-ink); }
.ah-now-t::after { content: ''; border: 4px solid transparent; border-top-color: var(--c-ink); border-bottom: 0; margin-right: -4.75px; }
.ah-roll { position: relative; height: 238px; overflow: hidden; border-right: 1.5px solid var(--c-ink);
  background: repeating-linear-gradient(to bottom, transparent 0 1px, var(--c-sunk) 1px 10px, transparent 10px 11px) top / 100% 220px no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent, var(--c-ink) 48px); mask-image: linear-gradient(90deg, transparent, var(--c-ink) 48px); }
.ah-roll-layer { position: absolute; top: 0; left: 100%; height: 100%; will-change: transform; }
.ah-roll.is-moving .ah-roll-layer { transition: transform 1000ms linear; }
.ah-seg { position: absolute; display: flex; height: 8px; }
.ah-seg i { display: block; flex: none; height: 8px; }
.ah-seg i:first-child { border-radius: 2px 0 0 2px; }
.ah-seg i:last-child { border-radius: 0 2px 2px 0; }
.ah-seg i:only-child { border-radius: 2px; }
.ah-seg .r { background: repeating-linear-gradient(135deg, var(--c-ink-4) 0 1.5px, transparent 1.5px 4px); }
.ah-seg .t { background: var(--c-ink); }
.ah-seg.in .t { background: var(--c-surface); box-shadow: inset 0 0 0 1.5px var(--c-ink); }
.ah-seg.out .t, .ah-seg.out .r { background: var(--c-line-strong); box-shadow: none; }
.ah-seg.success::after { content: ''; flex: none; width: 6px; height: 6px; margin: 1px 0 0 3px; border-radius: 50%; background: var(--c-ink); }
.ah-seg.callback::after { content: ''; flex: none; width: 6px; height: 6px; margin: 1px 0 0 3px; transform: rotate(45deg) scale(0.85); background: var(--c-open); }
.ah-seg.out::after { opacity: 0.35; }
.ah-min { position: absolute; top: 224px; padding-left: 4px; font: 10px/1 var(--mono); color: var(--c-ink-3); white-space: nowrap; }
.ah-min::before { content: ''; position: absolute; left: 0; bottom: -2px; width: 1px; height: 236px; background: var(--ui-sep); }
.ah-queue { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ah-qhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 18px; font-size: 11px; color: var(--c-ink-3); }
.ah-dots { display: grid; grid-template-columns: repeat(auto-fill, 7px); gap: 5px; }
.ah-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-ink); }
.ah-held .ah-dots i { background: var(--c-surface); box-shadow: inset 0 0 0 1.5px var(--c-open); }
.ah-qacts { display: flex; flex-wrap: wrap; gap: 8px; }
.ah-qacts button { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; border-radius: var(--ui-r-control); font-size: 12px; font-weight: 600; }
.ah-qacts svg { width: 10px; height: 10px; }
.ah-held-by { margin: 0; font-size: 12px; line-height: 1.45; color: var(--c-open-ink); }
.ah-held-by b { font-weight: 650; }
.ah-flines { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ui-sep); }
.ah-fline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; font-size: 12.5px; color: var(--c-ink-2); }
.ah-fline .linkbtn { padding: 0; }
.ah-idle { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0; font-size: 13px; color: var(--c-ink-2); }

/* the tooltip shared by the strip, the waveform and the bars */
.ah-tip { position: absolute; z-index: 8; pointer-events: none; padding: 7px 10px; border-radius: 8px; background: var(--c-surface);
  box-shadow: var(--ui-float); font-size: 11.5px; line-height: 1.4; white-space: nowrap; color: var(--c-ink);
  transform: translate(-50%, calc(-100% - 8px)); }
.ah-tip b { font-weight: 650; }
.ah-tip span { color: var(--c-ink-3); }

/* Today (G1-G5) */
.ah-today { position: relative; }
.ah-today canvas { display: block; width: 100%; outline-offset: 4px; border-radius: 2px; }
.ah-cross { position: absolute; top: 0; width: 1px; background: var(--c-ink-3); pointer-events: none; }
.ah-today-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 8px; }
.ah-today-foot .linkbtn { padding: 0; }
.k-wait { background: var(--c-ink-4); }
.k-cb { width: 8px !important; height: 8px !important; transform: rotate(45deg) scale(0.8); background: var(--c-open); }
.k-hours { background: repeating-linear-gradient(135deg, var(--c-line-strong) 0 1px, transparent 1px 4px); box-shadow: inset 0 0 0 1px var(--c-line); }
.k-now { width: 2px !important; height: 12px !important; background: var(--c-ink); border-radius: 0 !important; }
.ah-table-wrap { margin-top: 12px; max-height: 320px; overflow: auto; }

/* What it came to (H1-H4) */
.ah-came-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 20px; }
.ah-rule { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--c-ink-3); }
.ah-rule select { max-width: 220px; }
.ah-came .ah-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 12px -18px 14px; border-top: 1px solid var(--ui-sep); }
.ah-came .ah-stats .camp-stat { padding-top: 14px; }
.ah-came .cmp-bar-track { height: 14px; margin: 0 0 10px; gap: 2px; background: none; border-radius: 3px; }
.ah-came .cmp-seg { margin: 0; padding: 0; border: 0; border-radius: 2px; cursor: pointer; transition: opacity 140ms ease; }
.ah-came .cmp-seg:active { transform: scaleY(0.92); }
.ah-filtered .cmp-seg:not([aria-pressed="true"]) { opacity: 0.28; }
.o-success { background: var(--c-ink); }
.o-callback { background-color: var(--c-open-bg); background-image: repeating-linear-gradient(45deg, var(--c-open) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--c-open-line); }
.o-talked { background: var(--c-ink-3); }
.o-not_reached { background-color: var(--c-sunk); background-image: repeating-linear-gradient(135deg, var(--c-ink-4) 0 1.5px, transparent 1.5px 4px); box-shadow: inset 0 0 0 1px var(--c-line); }
.o-failed_platform { background: var(--c-alarm); }
.ah-olegend { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.ah-olegend button { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 4px 0; border: 0; background: none;
  font: 500 12.5px/1.2 var(--sans); color: var(--c-ink-2); white-space: nowrap; }
.ah-olegend button:hover { color: var(--c-ink); }
.ah-olegend button[aria-pressed="true"] { color: var(--c-ink); text-decoration: underline; text-underline-offset: 4px; }
.ah-olegend i { width: 10px; height: 10px; border-radius: 2px; }
.ah-olegend b { font-weight: 650; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.ah-olegend small { font-size: 11.5px; color: var(--c-ink-3); }

/* Conversations (I1-I7) */
.ah-conv-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ah-search { width: 220px; max-width: 100%; min-height: 32px; padding: 7px 11px; border: 0 !important; border-radius: 9px;
  background: var(--ui-fill); font: 400 13px/1.3 var(--sans); }
.ah-search:focus { outline: none; background: var(--c-surface); box-shadow: 0 0 0 1px var(--ui-edge), var(--ui-ring); }
.ah-filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 9px; border-radius: var(--r-sm);
  background: var(--ui-fill-2); font-size: 12px; color: var(--c-ink-2); }
.ah-filter-chip button { padding: 2px 5px; border: 0; background: none; color: var(--c-ink-3); font-size: 13px; line-height: 1; }
.ah-filter-chip button:hover { color: var(--c-ink); }
.ah-skey { display: flex; gap: 12px; font-size: 11px; color: var(--c-ink-3); }
.ah-skey span { display: inline-flex; align-items: center; gap: 5px; }
.ah-skey i { width: 12px; height: 5px; border-radius: 1px; }
.ah-new { display: block; width: 100%; margin: 0 0 6px; padding: 7px; border: 1px solid var(--c-line-strong); border-radius: var(--ui-r-control);
  background: var(--c-surface); color: var(--c-ink); font: 600 12px/1 var(--sans); }
.ah-conv { list-style: none; margin: 0 -18px; padding: 0; border-top: 1px solid var(--ui-sep); }
.ah-row { border-bottom: 1px solid var(--ui-sep); }
.ah-row-main { display: grid; grid-template-columns: 40px 14px 148px 196px minmax(0, 1fr) 118px 26px;
  grid-template-areas: "t d n s note o p"; align-items: center; gap: 4px 10px; width: 100%; padding: 9px 18px;
  cursor: pointer; transition: background-color 120ms ease; }
@media (hover: hover) and (pointer: fine) { .ah-row-main:hover { background: var(--ui-fill-2); } }
.ah-row[data-open] > .ah-row-main { background: var(--ui-fill-2); }
.ah-row-main:focus-visible { outline-offset: -3px; border-radius: 8px; }
.ah-row time { grid-area: t; font: 11px/1 var(--mono); color: var(--c-ink-3); }
.ah-dir { grid-area: d; width: 14px; height: 14px; color: var(--c-ink-3); }
.ah-dir.in { color: var(--c-ink); }
.ah-who { grid-area: n; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ah-who b { font-weight: 600; letter-spacing: -0.006em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ah-who small { font-size: 11px; color: var(--c-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ah-strip { grid-area: s; position: relative; height: 16px; min-width: 0; }
.ah-strip svg { display: block; height: 16px; max-width: 100%; }
.sa { fill: var(--c-ink); } .sc { fill: var(--c-ink-3); } .sr { fill: var(--c-ink-4); }
.ah-ph { position: absolute; top: -3px; bottom: -3px; left: 0; width: 1.5px; background: var(--c-ink); }
.ah-ph[hidden] { display: none; }
.ah-note-1 { grid-area: note; min-width: 0; font-size: 12.5px; line-height: 1.4; color: var(--c-ink-2); }
.ah-note-1 .ah-len { margin-left: 8px; font: 11px/1 var(--mono); color: var(--c-ink-3); }
.ah-out { grid-area: o; display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1.2 var(--sans); color: var(--c-ink-2); white-space: nowrap; }
.ah-out i { flex: none; width: 9px; height: 9px; border-radius: 2px; }
.ah-out.o-k-success { font-weight: 650; color: var(--c-ink); }
.ah-out.o-k-callback { font-weight: 600; color: var(--c-open-ink); }
.ah-out.o-k-failed_platform { font-weight: 600; color: var(--c-alarm-ink); }
.ah-play { grid-area: p; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 50%;
  border: 1px solid var(--c-line-strong); background: var(--c-surface); color: var(--c-ink); }
.ah-play:hover { border-color: var(--c-ink-4); }
.ah-play svg { width: 9px; height: 9px; }
.ah-open { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px 22px; padding: 4px 18px 18px 82px;
  animation: fade-in 180ms var(--ease-out) both; }
.ah-player { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--ui-r-control); background: var(--c-surface); box-shadow: 0 0 0 1px var(--ui-sep); }
.ah-player > * { grid-area: auto; }
.ah-player .ah-strip { height: 22px; }
.ah-player .ah-strip svg { width: 100%; height: 22px; }
.ah-ptime { font: 11px/1 var(--mono); color: var(--c-ink-3); white-space: nowrap; }
.ah-open h4 { margin: 0 0 6px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; color: var(--c-ink-3); }
.ah-tx { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ah-tx li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; font-size: 12.5px; line-height: 1.45; color: var(--c-ink-2); }
.ah-tx li span { font: 11px/1.5 var(--mono); color: var(--c-ink-3); }
.ah-tools-ran { display: flex; flex-direction: column; gap: 4px; margin: 0 0 14px; padding: 0; list-style: none; font-size: 12px; }
.ah-tools-ran li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.ah-tools-ran code { font: 500 12px/1.4 var(--mono); color: var(--c-ink); }
.ah-tools-ran span { color: var(--c-ink-3); }
.ah-tools-ran .mark-bad { color: var(--c-alarm-ink); }
.ah-dl-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; margin: 0; font-size: 12px; }
.ah-dl-list dt { font: 11.5px/1.5 var(--mono); color: var(--c-ink-3); }
.ah-dl-list dd { margin: 0; color: var(--c-ink); overflow-wrap: anywhere; }
.ah-facts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 16px; padding-top: 10px; border-top: 1px solid var(--ui-sep);
  font-size: 11.5px; color: var(--c-ink-3); }
.ah-facts b { font-weight: 500; color: var(--c-ink-2); }
.ah-facts .linkbtn { margin-left: auto; padding: 0; font-size: 12px; }
.ah-more { display: flex; justify-content: center; padding-top: 12px; }

/* Tools it used (J1-J3) */
#ah-tools td code { font: 500 12px/1.4 var(--mono); color: var(--c-ink); }
#ah-tools td .linkbtn { padding: 0; font-size: 12.5px; }
#ah-tools td.ah-err-cell { max-width: 220px; padding-left: 18px; white-space: normal; color: var(--c-ink-3); }
#ah-tools th.ah-err-h { padding-left: 18px; }
#ah-tools td button.ghost { padding: 5px 9px; font-size: 11.5px; border-radius: var(--ui-r-control); }
#ah-tools tr.ah-missing td { color: var(--c-open-ink); }
#ah-tools .ah-bad { color: var(--c-alarm-ink); font-weight: 600; }

/* Recorded and Promised (K1-K3, K6) */
.ah-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.ah-two > .workspace-card { margin: 0; }
.ah-field + .ah-field { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ui-sep); }
.ah-field h4 { margin: 0 0 6px; font: 600 12.5px/1.3 var(--sans); color: var(--c-ink); }
.ah-val { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; width: 100%; margin: 0; padding: 5px 0; border: 0;
  background: none; color: var(--c-ink-2); font: 500 12.5px/1.3 var(--sans); text-align: left; }
.ah-val:hover { color: var(--c-ink); }
.ah-val:active { transform: none; }
.ah-val b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--c-ink); }
.ah-val i { grid-column: 1 / -1; display: block; height: 5px; border-radius: 2px; background: var(--ui-fill); overflow: hidden; }
.ah-val i::before { content: ''; display: block; width: var(--w); height: 100%; border-radius: 2px; background: var(--c-ink); }
.ah-cbs { list-style: none; margin: 0; padding: 0; }
.ah-cbs li { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 8px 0;
  border-top: 1px solid var(--ui-sep); font-size: 12.5px; }
.ah-cbs li:first-child { border-top: 0; }
.ah-cbs .ah-when { font: 600 11.5px/1.3 var(--mono); color: var(--c-ink); }
.ah-cbs .ah-cb-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ah-cbs .ah-cb-who small { color: var(--c-ink-3); font-size: 11.5px; }
.ah-cbs .ah-cb-who .linkbtn { padding: 0; font-size: 11.5px; }
.ah-cbs .mark-open { color: var(--c-open-ink); font-weight: 600; font-size: 11.5px; }
.ah-cbs button.ghost { padding: 5px 9px; font-size: 11.5px; border-radius: var(--ui-r-control); }
.ah-cbs li.is-gone { color: var(--c-ink-3); }
.ah-cbs li.is-gone .ah-when { color: var(--c-ink-3); text-decoration: line-through; }
.ah-confirm { display: inline-flex; gap: 6px; align-items: center; }

/* How it works (L1-L4) */
.ah-how { display: flex; flex-direction: column; }
.ah-how-row { display: grid; grid-template-columns: 136px minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; padding: 12px 0;
  border-top: 1px solid var(--ui-sep); }
.ah-how-row:first-child { border-top: 0; padding-top: 2px; }
.ah-how-k { font-size: 12.5px; font-weight: 600; color: var(--c-ink); }
.ah-how-v { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; font-size: 12.5px; color: var(--c-ink-2); }
.ah-how-v b { font-weight: 600; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.ah-how-v small { flex-basis: 100%; font-size: 11.5px; color: var(--c-ink-3); }
.ah-how-row > button:not(.linkbtn) { min-height: 30px; border-radius: var(--ui-r-control); font-size: 12px; font-weight: 600; }
.ah-how-row .linkbtn { padding: 0; font-size: 12px; }
.ah-hours-ed { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--ui-r-control);
  background: var(--ui-fill-2); }
.ah-days { display: flex; flex-wrap: wrap; gap: 4px; }
.ah-days .chip[aria-pressed="true"] { background: var(--c-ink); border-color: var(--c-ink); color: var(--c-paper); }
.ah-hours-times { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.ah-hours-times .workspace-field { margin: 0; width: 120px; }
.ah-hours-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ah-hours-acts button { border-radius: var(--ui-r-control); }

/* New agent (O1) */
.ah-start { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 18px; }
.ah-start .workspace-card { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ah-start p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--c-ink-2); }
.ah-code { margin: 0; padding: 12px 14px; border-radius: var(--ui-r-control); background: var(--c-dark); color: var(--c-on-dark-2);
  font: 12px/1.65 var(--mono); white-space: pre; overflow-x: auto; }
.ah-start button { align-self: flex-start; border-radius: var(--ui-r-control); }

/* Company (M1-M4) */
.ah-count { font-weight: 400; color: var(--c-ink-3); font-variant-numeric: tabular-nums; }
.ah-company-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ah-company-foot button { border-radius: var(--ui-r-control); }
.ah-placeholder { padding: 28px 18px; text-align: center; font-size: 13px; color: var(--c-ink-3); }


/* Before the gate answers, the rows are the console's own. */
.ah-me[hidden], .ah-studio-label[hidden], .ah-outer-label[hidden] { display: none !important; }
/* The console has no global [hidden] rule: inside the page, hidden means hidden
   whatever display a region's own rule gives it. */
#agent-home-panel [hidden], .ah-scope[hidden] { display: none !important; }
/* A number in the sentence is a word you can press: on a phone the console's
   44 px touch floor for buttons would open the lines apart. */
.ah-line .ah-num { min-height: 0; line-height: inherit; vertical-align: baseline; }
.ah-dl-row { text-decoration: none; }
.ah-dl-row[aria-disabled="true"] { pointer-events: none; opacity: 0.45; }
.ah-region-err .mark-bad { color: var(--c-ink-2); }
.ah-skel-wrap { display: flex; flex-direction: column; gap: 8px; }
.ah-rule .linkbtn { padding: 0; font-size: 12px; }
.ah-rule b { font-weight: 600; color: var(--c-ink-2); }
.ah-open .player { grid-column: 1 / -1; }
.ah-open .player .pl-lyrics { max-height: 260px; }
.ah-open .ah-col { min-width: 0; }

/* ── the panel's one new control and Ask mode (D1-D9) ─────────────────── */
.howrow.ah-askswitch { margin: 0 0 8px; }
.howrow.ah-askswitch[hidden], .ah-askwhy[hidden] { display: none; }
.ah-askwhy { margin: -2px 2px 10px; }
.ah-asks { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.ah-asks[hidden] { display: none; }
.ah-asks .chip:active { transform: scale(0.97); }
.ah-asks .chip:disabled { cursor: not-allowed; }
/* Chat mode keeps its switch: it is the panel's, not a calling control. */
.app.chat-mode .howrow.ah-askswitch:not([hidden]) { display: grid !important; }
/* Asking happens in this browser or as a chat: no phone row while it is on. */
.app.ah-ask .howrow[aria-label="How to call"], .app.ah-ask #dialbody, .app.ah-ask #railshare { display: none !important; }
.app.ah-ask:not(.chat-mode) #cta-web[hidden] { display: flex; }

/* ── wider page: notes, the floor and the two cards stack as it narrows ─ */
#agent-home-panel { container-type: inline-size; }
@container (max-width: 820px) {
  .ah-notes { grid-template-columns: minmax(0, 1fr); }
  .ah-note { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .ah-note-top { flex: 0 0 auto; min-width: 150px; }
  .ah-note p { flex: 1 1 220px; }
  .ah-note-acts { flex-basis: 100%; }
  .ah-row-main { grid-template-columns: 40px 14px minmax(0, 1fr) auto 26px;
    grid-template-areas: "t d n o p" ". . s s s" ". . note note note"; }
  .ah-open { padding-left: 18px; grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 700px) {
  .ah-floor, .ah-two, .ah-start { grid-template-columns: minmax(0, 1fr); }
  .ah-stats, .ah-came .ah-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ah-stats .camp-stat:nth-child(3) { box-shadow: none; }
  .ah-stats .camp-stat:nth-child(n+3) { border-top: 1px solid var(--ui-sep); padding-top: 12px; }
  .ah-how-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ah-how-v { grid-column: 1 / -1; grid-row: 2; }
  .ah-line { font-size: 18px; }
  .ah-says > .agent-list-icon { flex-basis: 52px; height: 52px; border-radius: 15px; }
}

/* ── phone: the agent's row is the section control's first segment ─────── */
@media (max-width: 760px) {
  .agent-subnav button.ah-me { min-height: 30px; padding: 3px 10px 3px 4px; gap: 7px; }
  .ah-me .agent-list-icon { flex-basis: 22px; height: 22px; border-radius: 6px; }
  .ah-me-name { font: 500 12.5px/1 var(--sans); color: inherit; -webkit-line-clamp: 1; }
  .ah-me-live { display: none; }
  .agent-subnav [role=tablist] > .agent-subnav-label { display: none; }
  .ah-scope { position: static; margin: 0; padding: 0 0 10px; }
  .ah-scope-end { margin-left: 0; }
  .ah-page { gap: 14px; }
  .ah-conv { margin: 0 -14px; }
  .ah-row-main { padding: 9px 14px; }
  .ah-open { padding: 4px 14px 16px; }
  .ah-stats, .ah-came .ah-stats { margin-left: -14px; margin-right: -14px; }
  .ah-search { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .ah-roll.is-moving .ah-roll-layer, .ah-came .cmp-seg, .ah-row-main { transition: none; }
  .ah-pop, .ah-open { animation: none; }
}
