/* Cadence dashboard prototype: page layout, plus the few pieces the design system does not ship
   (skeleton, account menu, sign-in card). Every colour, font, radius, shadow and space is a token. */

html, body { background: var(--canvas); }
body { color: var(--ink); }

/* ---------- shell: sidebar beside a sticky top bar and the page ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; background: var(--canvas); }
.app-side { position: sticky; top: 0; height: 100vh; height: 100dvh; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: var(--z-topbar); }
.app-page { box-sizing: border-box; width: 100%; max-width: calc(var(--content-max) + 2 * var(--space-8)); padding: 0 var(--space-8) var(--space-12); display: flex; flex-direction: column; gap: var(--space-4); }
.app-skip { position: fixed; top: var(--space-2); left: var(--space-2); z-index: var(--z-toast); transform: translateY(calc(-100% - var(--space-4))); }
.app-skip:focus { transform: none; }
/* Page titles take focus on navigation (for screen readers) without drawing a ring. */
h1[tabindex="-1"]:focus { outline: none; }

/* ---------- grids (guidelines/10-app-shell) ---------- */
.app-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-4); }
.app-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-4); }
.app-grid > * { grid-column: span 12; min-width: 0; }
.app-grid > .app-span-8 { grid-column: span 8; }
.app-grid > .app-span-7 { grid-column: span 7; }
.app-grid > .app-span-6 { grid-column: span 6; }
.app-grid > .app-span-5 { grid-column: span 5; }
.app-grid > .app-span-4 { grid-column: span 4; }
.app-stack { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.app-grow { flex: 1 1 auto; }
.app-foot { margin: 0; color: var(--ink-subtle); }

/* Five tiles never split 4 + 1: three over two until the sidebar folds away, then 2 + 2 + 1 (full width). */
@media (max-width: 1279.98px) {
  .app-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .app-kpis > * { grid-column: span 2; }
  .app-kpis > :nth-child(n+4) { grid-column: span 3; }
}
@media (max-width: 1023.98px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app-kpis > *, .app-kpis > :nth-child(n+4) { grid-column: span 3; }
  .app-kpis > :nth-child(5):last-child { grid-column: span 6; }
  .app-grid > .app-span-8, .app-grid > .app-span-7, .app-grid > .app-span-5, .app-grid > .app-span-4 { grid-column: span 12; }
}
@media (max-width: 639.98px) {
  .app-page { padding: 0 var(--space-4) var(--space-10); }
  .app-kpis > *, .app-kpis > :nth-child(n+4), .app-kpis > :nth-child(5):last-child { grid-column: span 6; }
  .app-grid > .app-span-6 { grid-column: span 12; }
}

/* ---------- cells composed from system components (as in the DataTable preview) ---------- */
.app-graded { display: inline-flex; align-items: center; gap: var(--space-1); }
.app-who { display: inline-flex; align-items: center; gap: 10px; }
.app-who b { display: block; font-weight: 600; color: var(--ink); white-space: nowrap; }
.app-ratio { display: inline-flex; align-items: center; gap: var(--space-2); }
.app-ratio-n { font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.app-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); }

/* ---------- skeletons (guidelines/50-states): surface-sunken blocks in the shape of the content ---------- */
.app-skel { display: block; max-width: 100%; background: var(--surface-sunken); border-radius: var(--radius-sm); animation: app-skel-pulse 1.6s ease-in-out infinite; }
.app-skel.is-round { flex: none; border-radius: var(--radius-full); }
@keyframes app-skel-pulse { 50% { opacity: .55; } }
.app-skel-rows { display: flex; flex-direction: column; }
.app-skel-row { display: flex; align-items: center; gap: var(--space-3); }
.app-skel-rows.is-flush .app-skel-row { padding: 0 var(--space-5); border-bottom: 1px solid var(--line); }
.app-skel-rows.is-flush .app-skel-row:last-child { border-bottom: 0; }
.app-skel-lines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.app-skel-chart { display: flex; align-items: flex-end; gap: var(--space-2); box-sizing: border-box; padding-left: var(--space-8); border-bottom: 1px solid var(--line-strong); }
.app-skel-chart .app-skel { flex: 1 1 0; max-width: 24px; margin: 0 auto; border-radius: var(--radius-xs) var(--radius-xs) 0 0; }
@media (prefers-reduced-motion: reduce) { .app-skel { animation: none; } }

/* ---------- account menu: the InfoTip popover recipe (surface, line, radius-md, shadow-menu) ---------- */
.app-menu { position: fixed; z-index: calc(var(--z-drawer) + 1); box-sizing: border-box; width: 288px; max-width: calc(100vw - 16px); display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-menu); color: var(--ink-secondary); font-family: var(--font-ui); animation: app-pop .2s cubic-bezier(.23, 1, .32, 1); }
@keyframes app-pop { from { opacity: 0; transform: translateY(4px); } }
.app-menu-sec { display: flex; flex-direction: column; gap: var(--space-2); }
.app-menu-label { text-transform: uppercase; color: var(--ink-subtle); }
.app-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--control-md); margin: 0; padding: 0 var(--space-2); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink); font: inherit; font-weight: 500; text-align: left; cursor: pointer; transition: background-color .12s cubic-bezier(.23, 1, .32, 1); }
.app-menu-item:hover { background: var(--surface-sunken); }
.app-menu-item .cd-icon { color: var(--ink-muted); }
.app-menu-item-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-menu-rule { width: 100%; margin: 0; border: 0; border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .app-menu, .app-menu-item { animation: none; transition: none; } }

/* ---------- sign in: a centred card on canvas ---------- */
.app-signin { box-sizing: border-box; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--space-8) var(--space-4); background: var(--canvas); position: relative; isolation: isolate; overflow: hidden; }
.app-signin-card { box-sizing: border-box; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-8); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.app-signin-card > .cd-btn { width: 100%; }
.app-signin-brand { display: flex; align-items: center; gap: 9px; }
/* the wordmark: Instrument Sans 600, -0.06em, brand-ink, sized to the 28px mark (Logos README) */
.app-signin-word { font: 600 28px/1 var(--font-display); letter-spacing: -0.06em; color: var(--brand-ink); padding-bottom: 2px; }
.app-signin-title { margin: 0; color: var(--ink); }
.app-signin-lead { margin: var(--space-1) 0 0; color: var(--ink-muted); }
@media (max-width: 639.98px) { .app-signin-card { padding: var(--space-6) var(--space-5); } }

/* ---------- small text blocks inside panels ---------- */
.app-note { margin: var(--space-4) 0 0; color: var(--ink-secondary); }
.app-trend { gap: var(--space-2); margin-top: var(--space-2); }

/* ======================= steps 2–6 ======================= */

/* ---------- shared blocks ---------- */
.app-stack-tight { gap: var(--space-3); }
.app-muted { color: var(--ink-muted); margin: 0; }
.app-dash { color: var(--ink-faint); }
.app-pad { padding: var(--space-4) var(--space-5); }
.app-drawer-gap { margin-top: var(--space-4); }
.app-tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.app-drawer-gap + .app-tags, .cd-drawer .app-tags { margin-bottom: var(--space-3); }
.app-note-flat { margin: 0; color: var(--ink-secondary); }
.app-cell-text { display: block; min-width: 280px; white-space: normal; color: var(--ink-secondary); }
.app-mask-note { margin-top: calc(-1 * var(--space-2)); }
.app-warn-line { display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--critical); }
.app-kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.app-kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.app-kpis-4 > *, .app-kpis-3 > * { grid-column: auto !important; }
@media (max-width: 1023.98px) { .app-kpis-4, .app-kpis-3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 639.98px) { .app-kpis-4, .app-kpis-3 { grid-template-columns: minmax(0, 1fr) !important; } }

/* a link-styled button for evidence ("01:02 “…”") and inline links */
.app-link { display: inline; margin: 0; padding: 0; border: 0; border-radius: var(--radius-xs); background: none; color: var(--link); font: inherit; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; }
.app-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.app-evidence { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.app-evidence-list { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-2) 0 0; padding: 0; list-style: none; font: 400 13px/18px var(--font-ui); color: var(--ink-secondary); }
.app-evidence-list li { display: flex; gap: var(--space-2); align-items: baseline; }
.app-evidence-list .app-link { flex: none; font-family: var(--font-mono); font-weight: 500; }

/* rows inside panels: a main block, then badges and actions */
.app-rows { margin: 0; padding: 0; list-style: none; }
.app-row { display: flex; align-items: center; gap: var(--space-3); min-height: var(--row-height); padding: var(--space-2) var(--space-5); border-bottom: 1px solid var(--line); }
.app-row:last-child { border-bottom: 0; }
.app-rows-inset .app-row { padding-left: 0; padding-right: 0; }
.app-row-top { align-items: flex-start; }
.app-row-wrap { flex-wrap: wrap; row-gap: var(--space-2); }
.app-row-main { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; color: var(--ink-secondary); }
.app-row-main b { color: var(--ink); font-weight: 600; }
.app-row-btn { margin: 0; padding: 0; border: 0; border-radius: var(--radius-xs); background: none; font: inherit; text-align: left; cursor: pointer; }
.app-row-btn:hover b { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- forms ---------- */
.app-form { display: flex; flex-direction: column; gap: var(--space-4); }
.app-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.app-form-narrow { max-width: 560px; }
/* The product's Company tab: target tiles in their Overview colours, and the CI score's weights in Edit targets. */
.app-kpis > .cd-kpi.app-tile.app-tile-mint { --tile: var(--tint-mint); }
.app-kpis > .cd-kpi.app-tile.app-tile-violet { --tile: var(--tint-violet); }
.app-kpis > .cd-kpi.app-tile.app-tile-pink { --tile: var(--tint-pink); }
.app-kpis > .cd-kpi.app-tile.app-tile-peach { --tile: var(--tint-peach); }
.app-kpis > .cd-kpi.app-tile.app-tile-aqua { --tile: var(--tint-aqua); }
.app-company-changed { margin: calc(-1 * var(--space-2)) 0 var(--space-4); }
.app-grid-top { align-items: start; }
/* A lone last card in the folder band takes the whole row (India has five cards, the US four). */
@media (min-width: 1280px) { .app-company-grid > :last-child:nth-child(4n+1) { grid-column: 1 / -1; } }
@media (min-width: 640px) and (max-width: 1279.98px) { .app-company-grid > :last-child:nth-child(2n+1) { grid-column: 1 / -1; } }
.app-weights { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.app-weights legend { padding: 0; margin-bottom: var(--space-1); }
.app-weights-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: var(--space-3); }
.app-weights-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 32px; }
@media (max-width: 639.98px) { .app-weights-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); } }
.app-weights-total { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--ink-secondary); }
.app-weights-total.is-ok { color: var(--positive); }
.app-weights-total.is-off { color: var(--critical); font-weight: 600; }
.app-form-invite { grid-template-columns: minmax(0, 1fr) minmax(0, 200px) auto; align-items: end; }
.app-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); }
.app-actions-start { justify-content: flex-start; }
@media (max-width: 639.98px) { .app-form-row, .app-form-invite { grid-template-columns: minmax(0, 1fr); } }

/* file drop: a Field-styled target with a real (visually hidden) file input inside */
.app-drop { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); padding: var(--space-6) var(--space-4); border: 1px dashed var(--line-control); border-radius: var(--radius-md); background: var(--surface-subtle); color: var(--ink-muted); text-align: center; cursor: pointer; transition: background-color .12s cubic-bezier(.23, 1, .32, 1), border-color .12s; }
.app-drop .body-strong { color: var(--ink); }
.app-drop:hover { border-color: var(--ink-muted); }
.app-drop.is-over { background: var(--accent-soft); border-color: var(--accent); }
.app-drop.is-invalid { border-color: var(--critical); }
.app-drop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.app-filelist { margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.app-filelist li { display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-md); border-bottom: 1px solid var(--line); color: var(--ink-secondary); }
.app-filelist .cd-icon { color: var(--ink-muted); }

/* ---------- call drawer extras ---------- */
.app-mood { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-3); }

/* ---------- follow-ups ---------- */
.app-plan { max-width: 760px; }

/* ---------- leads ---------- */
.app-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); }
.app-toolbar > .cd-field { flex: 0 1 150px; min-width: 120px; }
.app-toolbar > .app-toolbar-search { flex: 1 1 240px; }
.app-toolbar-end { margin-left: auto; }
.app-hscroll { display: flex; gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-2); scroll-snap-type: x proximity; }
.app-hscroll-item { flex: 0 0 272px; scroll-snap-align: start; }
.app-queue { margin: 0; padding: 0; list-style: none; }
.app-queue-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--line); }
.app-queue-row:last-child { border-bottom: 0; }
.app-queue-n { color: var(--ink-subtle); text-align: right; }
@media (max-width: 639.98px) { .app-queue-row { grid-template-columns: minmax(0, 1fr); padding: var(--space-3) var(--space-4); } .app-queue-n { display: none; } }
.app-board { display: flex; align-items: flex-start; gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-3); }
.app-board > * { flex: none; }
.app-interest { display: flex; align-items: center; gap: var(--space-5); }
.app-summary-strip { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); padding: 0 var(--space-5) var(--space-3); border-bottom: 1px solid var(--line); font: 400 13px/18px var(--font-ui); color: var(--ink-muted); }
.app-summary-strip b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.app-intent-trend { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--line); }
.app-callcard { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); }
.app-callcard:last-child { border-bottom: 0; }
.app-callcard > .cd-btn { align-self: flex-start; }
.app-callcard-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }

/* ---------- telecaller report, coaching ---------- */
.app-dna { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
.app-dna .app-menu-label { margin: 0 0 var(--space-2); }
.app-list { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font: 400 14px/20px var(--font-ui); color: var(--ink-secondary); }
.app-list li { display: flex; gap: var(--space-2); align-items: flex-start; }
.app-list .cd-icon { margin-top: 2px; color: var(--ink-muted); }
@media (max-width: 639.98px) { .app-dna { grid-template-columns: minmax(0, 1fr); } }
.app-cases { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.app-case { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.app-case:first-child { padding-top: 0; }
.app-case:last-child { border-bottom: 0; padding-bottom: 0; }
.app-case-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.app-stack .app-menu-label, .app-stack-tight .app-menu-label { margin: 0 0 var(--space-1); }
.app-roleplay { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font: 400 13px/18px var(--font-ui); color: var(--ink-secondary); }
.app-roleplay li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: var(--space-2); align-items: start; }

/* ---------- Auto-QA ---------- */
.app-tabs-pad { padding: 0 var(--space-5); }
.app-qa { margin: 0; padding: 0; list-style: none; }
.app-qa-item { border-bottom: 1px solid var(--line); }
.app-qa-item:last-child { border-bottom: 0; }
.app-qa-item > .cd-callrow { border-bottom: 0; }
.app-qa-moment { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: 0; padding: 0 var(--space-5) var(--space-3) calc(var(--space-5) + 44px); font: 400 13px/18px var(--font-ui); color: var(--ink-secondary); }
.app-qa-quote { color: var(--ink); }
@media (max-width: 639.98px) { .app-qa-moment { padding-left: var(--space-4); } .app-tabs-pad { padding: 0 var(--space-4); } }

/* ---------- objections, scorecard ---------- */
.app-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-4); }
.app-obj-stats { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2); color: var(--ink); }
.app-current.is-off { color: var(--critical); }
.app-current.is-on { color: var(--positive); }
.app-calc { display: block; min-width: 220px; white-space: normal; color: var(--ink-muted); font-size: 12px; line-height: 16px; }
.app-calc-block { margin: 0 0 var(--space-3); padding: var(--space-3); border-radius: var(--radius-sm); background: var(--surface-sunken); color: var(--ink); font-size: 13px; line-height: 18px; }
.app-grades { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); margin: 0; padding: 0; list-style: none; }
.app-grades li { display: flex; flex-direction: column; gap: var(--space-1); color: var(--ink); }
@media (max-width: 639.98px) { .app-grades { grid-template-columns: minmax(0, 1fr); } }

/* ---------- industry packs: selector cards ---------- */
.app-packs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-3); }
.app-pack { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); width: 100%; height: 100%; box-sizing: border-box; margin: 0; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .12s cubic-bezier(.23, 1, .32, 1), box-shadow .12s; }
.app-pack:hover { border-color: var(--line-strong); box-shadow: var(--shadow-raised); }
.app-pack.is-selected { background: var(--accent-soft); border-color: var(--accent); }
.app-pack-swatch { width: 28px; height: 28px; border-radius: var(--radius-sm); }
@media (max-width: 1279.98px) { .app-packs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 639.98px) { .app-packs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.app-flow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.app-flow li { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--ink-faint); }

/* ---------- leaderboard: a 2-1-3 podium on the brand pastels, champion cards ---------- */
.app-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: var(--space-3); max-width: 720px; margin: 0 auto; padding: 0; list-style: none; }
.app-podium-step { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-3); min-width: 0; }
.app-podium-who { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); margin: 0; padding: var(--space-2); border: 0; border-radius: var(--radius-md); background: none; color: var(--ink); font: inherit; text-align: center; cursor: pointer; }
.app-podium-who:hover .body-strong { text-decoration: underline; text-underline-offset: 3px; }
.app-podium-block { display: grid; place-items: center; border-radius: var(--radius-md) var(--radius-md) 0 0; color: var(--ink); }
.app-podium-step.is-1 .app-podium-block { height: 96px; }
.app-podium-step.is-2 .app-podium-block { height: 68px; }
.app-podium-step.is-3 .app-podium-block { height: 48px; }
.app-champs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-3); }
.app-champ { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); min-width: 0; margin: 0; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .12s cubic-bezier(.23, 1, .32, 1), box-shadow .12s; }
.app-champ:hover { border-color: var(--line-strong); box-shadow: var(--shadow-raised); }
.app-champ-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--surface-sunken); color: var(--ink); }
@media (max-width: 1279.98px) { .app-champs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 639.98px) { .app-champs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .app-podium { gap: var(--space-2); } }

/* ---------- Live Assist ---------- */
.app-livebar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-5); }
.app-livebar-clock { color: var(--ink); font-size: 15px; }
.app-livebar-end { margin-left: auto; }
.app-livebar-who { display: flex; flex-direction: column; min-width: 0; }
.app-livebar-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-left: auto; }
.app-cuelog { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.app-cuelog li { display: grid; grid-template-columns: 36px auto minmax(0, 1fr); align-items: baseline; gap: var(--space-2); font-size: 13px; line-height: 18px; color: var(--ink-secondary); }
.app-cuelog b { font-weight: 600; color: var(--ink); }
.app-marks { margin-top: var(--space-2); }
.app-wrap-src { display: inline-flex; align-items: flex-start; gap: 5px; color: var(--ai); }
.app-wrap-src .cd-icon { flex: none; margin-top: 2px; }
.app-wrap-src.is-edited { color: var(--ink-muted); }
.app-wrapdone { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3) var(--space-4); margin: 0; }
.app-wrapdone > div { min-width: 0; }
.app-wrapdone > .is-wide { grid-column: span 2; }
.app-wrapdone dt { font-size: 12px; color: var(--ink-muted); }
.app-wrapdone dd { margin: 2px 0 0; font-size: 14px; line-height: 20px; color: var(--ink); }
@media (max-width: 639.98px) {
  .app-livebar-ctl { margin-left: 0; width: 100%; }
  .app-wrapdone { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) { .app-drop, .app-pack, .app-champ { transition: none; } }
.app-toolbar > .app-toolbar-sort { flex-basis: 200px; }
.app-para { margin: 0 0 var(--space-3); }

/* Keep everything inside a table's scroll box: the kit's visually hidden labels are absolutely positioned
   and otherwise escape the scroller, which widens the page on phones and pushes fixed layers off-screen. */
.cd-table-scroll { position: relative; }

/* ---------- Inbound calls and the caller card (src/screens/Inbound.tsx, src/shell/CallerCard.tsx) ---------- */
/* the caller card: a Drawer, packed a little tighter than the call analysis */
.app-callercard .cd-drawer-body { gap: var(--space-4); }
.app-cc-eyebrow { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.app-cc-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.app-cc-top .caption { flex-basis: 100%; }
.app-cc-id { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.app-cc-money { font: 400 24px/1.1 var(--font-display); letter-spacing: -0.6px; color: var(--ink); font-variant-numeric: tabular-nums; }
.app-cc-intent { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-muted); }
.app-cc-owner { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); color: var(--ink); }
.app-cc-last { display: flex; flex-direction: column; gap: 2px; }
.app-cc-last b { font-weight: 600; color: var(--ink); }
.app-cc-try { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.app-cc-newlead { display: flex; flex-direction: column; gap: var(--space-2); padding-bottom: var(--space-3); border-bottom: 1px solid var(--line); }

/* the on-call bar: the card, shrunk and pinned under the top bar while the call is on (the site's dark band) */
.app-oncall { position: sticky; top: 66px; z-index: calc(var(--z-topbar) - 1); box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); width: calc(100% - 48px); max-width: var(--content-max); margin: var(--space-2) 24px 0; padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border-radius: var(--radius-lg); background: var(--band); color: var(--band-ink); box-shadow: var(--sh-nav); }
.app-oncall-who { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
.app-oncall-who b { font-weight: 600; color: var(--band-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-oncall-clock { color: var(--band-muted); font-size: 13px; }
.app-oncall-ctx { flex: 1 1 240px; display: flex; flex-wrap: wrap; gap: 2px var(--space-4); min-width: 0; font-size: 13px; line-height: 18px; color: var(--band-muted); }
.app-oncall-act { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); margin-left: auto; }
.app-oncall .cd-btn-secondary { border-color: var(--band-line); color: var(--band-ink); }
.app-oncall .cd-btn-secondary:hover:not(:disabled) { border-color: var(--band-ink); }
.app-oncall .cd-btn-primary { background: var(--band-ink); color: var(--band); border-color: var(--band-ink); }
.app-oncall .cd-badge-outline { color: var(--band-ink); box-shadow: inset 0 0 0 1px var(--band-line); }
@media (max-width: 639.98px) {
  .app-oncall { top: 62px; width: calc(100% - 32px); margin: var(--space-2) 16px 0; padding-left: var(--space-3); }
  .app-oncall-act { margin-left: 0; }
}

/* Inbound page */
.app-pad-chips { padding: var(--space-3) var(--space-4) var(--space-3); border-bottom: 1px solid var(--line); }

/* Overview: the compact inbound strip */
.app-instrip-stats { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-8); margin: 0; padding: 0; list-style: none; }
.app-instrip-stats li { display: inline-flex; align-items: baseline; gap: var(--space-2); min-width: 0; font-size: 13.5px; line-height: 18px; color: var(--ink-secondary); }
.app-instrip-stats b { font: 400 24px/1 var(--font-display); letter-spacing: -0.6px; color: var(--ink); font-variant-numeric: tabular-nums; }
.app-instrip-stats .cd-grade { align-self: center; }

/* Follow-ups: under an overdue row, when the lead called in before anyone called them back */
.app-fu-called { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: 0; padding: 0 var(--space-4) var(--space-3); border-bottom: 1px solid var(--line); background: var(--surface); font-size: 13px; line-height: 18px; color: var(--ink-secondary); }
.app-fu-called:last-child { border-bottom: 0; }
.cd-followup-row:has(+ .app-fu-called) { border-bottom: 0; }

/* phones: a panel head whose title shares a row with a badge and a button wraps, title first (My day) */
@media (max-width: 639.98px) {
  .app-panel-wrap .cd-panel-head { flex-wrap: wrap; }
  .app-panel-wrap .cd-panel-hl { flex: 1 1 100%; }
  .app-panel-wrap .cd-panel-tl { flex-wrap: wrap; }
  .app-panel-wrap .cd-panel-actions { flex: 1 1 100%; flex-wrap: wrap; }
}
/* phones have no keyboard shortcut to show ("Save wrap-up ⌘ ↵", "Upload & analyse ⌘ ↵") */
@media (max-width: 639.98px) { .cd-btn .cd-kbd { display: none; } }
/* the new-caller card: a line-drawn figure under what Cadence will pick up */
.app-cc-fig { align-self: center; width: 96px; margin-top: var(--space-4); }
/* the product's two-week plan: one line per drill, a fixed-width toggle, finished lines muted (live/Coaching.tsx) */
.app-coach-plan { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.app-coach-plan-line { display: flex; align-items: center; gap: var(--space-3); font: 400 14px/20px var(--font-ui); color: var(--ink); }
.app-coach-plan-line .cd-btn { flex: none; min-width: 112px; justify-content: center; }
.app-coach-plan-line.is-done .app-coach-plan-text { color: var(--ink-muted); }
@media (max-width: 639.98px) { .app-coach-plan-line { align-items: flex-start; } .app-coach-plan-line .cd-btn { min-width: 96px; } }

/* ---------- The Cadence console (/console, the product build only) ---------- */
.app-console { min-height: 100vh; min-height: 100dvh; background: var(--canvas); }
/* The console's top bar: the dashboard's floating pill over the canvas (brand.css, .cd-topbar). */
.app-console-bar { position: sticky; top: 10px; z-index: var(--z-topbar); box-sizing: border-box; display: flex; align-items: center; gap: var(--space-4); width: calc(100% - 2 * var(--space-4)); max-width: 1240px; margin: 10px auto 0; padding: 7px 8px 7px 14px; border: 1px solid var(--surface); border-radius: 14px; background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--sh-nav), 0 0 0 1px var(--line); }
:root[data-theme="dark"] .app-console-bar { border-color: #ffffff14; }
.app-console-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.app-console-word { font: 600 22px/1 var(--font-display); letter-spacing: -0.06em; color: var(--brand-ink); padding-bottom: 2px; }
.app-console-nav { display: flex; gap: var(--space-1); margin-left: var(--space-3); }
.app-console-nav a { padding: 6px 10px; border-radius: 8px; color: var(--ink-secondary); text-decoration: none; font-size: 14px; }
.app-console-nav a:hover { background: var(--surface-subtle); color: var(--ink); }
.app-console-nav a[aria-current="page"] { background: var(--surface-subtle); color: var(--ink); font-weight: 500; }
.app-console-who { margin-left: auto; color: var(--ink-secondary); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-console-main { box-sizing: border-box; max-width: 1240px; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-10); display: flex; flex-direction: column; gap: var(--space-4); }
.app-console-card { max-width: 440px; }
.app-console-form { display: flex; flex-direction: column; gap: var(--space-4); }
.app-console-form > .cd-btn { width: 100%; }
.app-console-qr { display: block; width: 176px; height: 176px; margin: 0 auto; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; image-rendering: pixelated; }
.app-console-key, .app-console-link code { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 13px; }
.app-console-link code { word-break: break-all; }
/* The setup key and the backup codes wrap between groups, never inside one. */
.app-console-key { display: inline-flex; flex-wrap: wrap; gap: 0 0.45em; }
.app-console-key > span, .app-console-codes > span { white-space: nowrap; }
.app-console-codes { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: var(--space-2) 0; font-variant-numeric: tabular-nums; font-size: 13px; letter-spacing: 0.04em; }
.app-console-link { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-1); padding: 8px 8px 8px 12px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 10px; }
.app-console-link code { flex: 1; min-width: 0; }
.app-console-empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: var(--space-5) var(--space-4); }
.app-console-empty p { margin: 0; }
.app-console-search { width: 260px; max-width: 100%; }
.app-console-progress { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.app-console-bar-track { position: relative; width: 64px; height: 6px; border-radius: 3px; background: var(--surface-subtle); border: 1px solid var(--line); overflow: hidden; }
.app-console-bar-track > span { position: absolute; inset: 0 auto 0 0; background: var(--positive); }
.app-console-steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-2); }
.app-console-step { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink-secondary); }
.app-console-step.is-done { background: var(--tint-mint); border-color: #1111110d; color: var(--ink); }
.app-console-step.is-coming { border-style: dashed; }
.app-console-step .body-sm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
:root[data-theme="dark"] .app-console-step.is-done { border-color: #ffffff14; }
:root[data-theme="dark"] .app-console-step.is-done .app-console-step-dot { background: #0000004d; }
.app-console-step-dot { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-subtle); font-size: 12px; font-weight: 600; color: var(--ink-secondary); }
.app-console-step.is-done .app-console-step-dot { background: #ffffffc2; color: var(--positive); }
.app-console-tab { display: flex; flex-direction: column; gap: var(--space-4); }
.app-console-gap { margin-top: var(--space-3); }
.app-console-flow { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: var(--space-3); }
/* console analytics: the report's range and download, a tile's "of 12", buttons side by side in a table row */
.app-report-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.app-kpi-of { font-size: 0.5em; font-weight: 500; color: var(--ink-secondary); letter-spacing: 0; }
.app-kpi-text { font-size: 0.62em; letter-spacing: -0.01em; }
.app-row-actions { display: inline-flex; flex-wrap: nowrap; justify-content: flex-end; gap: var(--space-1); }
.app-cost-total { margin: 0 0 var(--space-3); }
.app-cost-total b { font: 400 30px/1.1 var(--font-display); letter-spacing: -0.6px; color: var(--ink); }
.app-console-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.app-console-fact { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; min-width: 0; }
.app-console-fact + .app-console-fact { border-left: 1px solid var(--line); }
.app-console-fact-label { font-size: 13px; color: var(--ink-secondary); }
.app-console-fact-value { font: 400 24px/1.15 var(--font-display); letter-spacing: -0.4px; color: var(--ink); }
.app-console-fact-sub { font-size: 13px; line-height: 1.35; color: var(--ink-secondary); }
@media (max-width: 1023.98px) {
  .app-console-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-console-fact:nth-child(odd) { border-left: 0; }
  .app-console-fact:nth-child(n+3) { border-top: 1px solid var(--line); }
}
.app-console-kv { margin: 0; display: flex; flex-direction: column; }
.app-console-kv-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); padding: 10px 0; border-top: 1px solid var(--line); }
.app-console-kv-row:first-child { border-top: 0; padding-top: 0; }
.app-console-kv dt { color: var(--ink-secondary); font-size: 14px; }
.app-console-kv dd { margin: 0; color: var(--ink); font-size: 14px; font-weight: 500; text-align: right; }
/* Row actions: beside the row on wide screens; under the name on a phone, where the table scrolls sideways. */
.app-row-actions-under { display: none; }
@media (max-width: 639.98px) {
  .app-row-actions-under { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2); }
  .app-row-actions-beside { display: none; }
}
.app-form-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.app-nowrap { white-space: nowrap; }
@media (max-width: 1023.98px) { .app-console-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* The company page's tab strip scrolls on a phone (the chosen tab is kept in view). */
.app-console-tabs { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.app-console-tabs::-webkit-scrollbar { display: none; }
.app-tile-none { font-size: 15px; letter-spacing: 0; }
/* "Continue with Google", then "or" before the email and password. */
.app-google { gap: 10px; }
.app-google-mark { flex: none; }
.app-or { display: flex; align-items: center; gap: var(--space-3); margin: 0; color: var(--ink-muted); font-size: 13px; }
.app-or::before, .app-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
@media (max-width: 639.98px) {
  /* Phone top bar: the mark and Sign out on one row, the pages under them; the name stays in the tooltip. */
  .app-console-bar { flex-wrap: wrap; gap: var(--space-2) var(--space-3); padding-top: 8px; padding-bottom: 6px; }
  .app-console-who { display: none; }
  .app-console-out { margin-left: auto; }
  .app-console-out .app-console-out-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .app-console-nav { order: 3; width: 100%; margin-left: 0; }
  .app-panel-wrap .app-console-search { width: 100%; }
  .app-console-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-form-row-3 { grid-template-columns: minmax(0, 1fr); }
  .app-console-main { padding-top: var(--space-4); }
}

/* ---------- The company questionnaire (/q#<token>, the product build only) ---------- */
.app-q { min-height: 100vh; min-height: 100dvh; background: var(--canvas); }
.app-q-page { box-sizing: border-box; max-width: 820px; margin: 0 auto; padding: var(--space-8) var(--space-4) var(--space-12); display: flex; flex-direction: column; gap: var(--space-4); }
.app-q-brand { display: flex; align-items: center; gap: 9px; }
.app-q-head { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-4) 0 var(--space-2); }
.app-q-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-2); }
.app-q { position: relative; isolation: isolate; }
/* The sticky footer never covers the field being typed in, and sits above an iPhone's home bar. */
html:has(.app-q) { scroll-padding-bottom: 96px; }
.app-q-foot { position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.app-q-foot [role="status"], .app-q-foot [role="alert"] { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.app-q-fail { color: var(--critical); }
.app-q-sent:focus { outline: none; }
.app-q-sent:focus-visible > * { outline: 2px solid var(--focus, var(--ink)); outline-offset: 2px; }
/* A caller's or a login's row ends in its remove button. */
.app-q-row { align-items: end; }
.app-form-row.app-q-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
.app-form-row-3.app-q-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.6fr) auto; }
@media (max-width: 639.98px) {
  .app-q-page { padding-top: var(--space-5); }
  .app-q-foot { flex-direction: column; align-items: stretch; }
  html:has(.app-q) { scroll-padding-bottom: 132px; }
  /* 16px fields: iPhones zoom into anything smaller. */
  .app-q .cd-field-input { font-size: 16px; }
  .app-form-row.app-q-row, .app-form-row-3.app-q-row { grid-template-columns: minmax(0, 1fr); }
}

/* Ask AI in the product: the calls an answer rests on, each opening in the call drawer (live/AskAi.tsx). */
.app-ask-sources { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.app-ask-sources p { margin: 0 0 var(--space-1); }
.app-ask-sources ul { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.app-ask-sources li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-2); font: 400 13px/18px var(--font-ui); }
.app-ask-sources .app-link { font-weight: 600; text-align: left; }
/* Ask AI: the answer reads text, figures, then the calls behind it, then the footnote (the demo's order). */
.cd-askai-a > .app-ask-sources { order: 1; }
.cd-askai-a > .cd-askai-src { order: 2; }

/* Auto-QA: timestamps that open the recording, in mono like the transcript (live/AutoQa.tsx, live/CallQa.tsx). */
.app-link.app-qa-ts { font-family: var(--font-mono); font-weight: 500; }
/* The call drawer's checklist: the line in ink, its result beside it, then the moment and why. */
.app-qa-lines { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.app-qa-lines li { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.app-qa-lines li:last-child { border-bottom: 0; }
.app-qa-line-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.app-qa-line-label { font: 500 13px/18px var(--font-ui); color: var(--ink); }
.app-qa-line-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-2); margin: 0; font: 400 13px/18px var(--font-ui); color: var(--ink-secondary); }
.app-qa-line-quote { color: var(--ink); }
