/* ============================================================
   Radix-Design System Dashboard - layout shell + components
   Radix UI geometry (12-step scales, soft radii, inset borders,
   the 1px-ring shadow) on Skypoint amber + Inter.
   All values derive from tokens.css. Never hardcode colors/sizes.
   ============================================================ */
@import url("./tokens.css");

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-base);
  font-size: var(--fs-2);
  line-height: var(--lh-2);
  letter-spacing: var(--ls-2);
  color: var(--fg-high);
  background: var(--color-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }

/* ---- App shell: header on top, sidebar + content below ---- */
.app-shell {
  display: grid;
  grid-template-rows: auto 56px 1fr;   /* banner row collapses to 0 when empty */
  grid-template-columns: 256px 1fr;
  grid-template-areas:
    "banner banner"
    "header header"
    "sidebar content";
  height: 100vh;
}

/* Announcement banner (thin strip above the header; dismissible) */
.app-banner { grid-area: banner; display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-5); background: var(--accent-3); color: var(--accent-11); font-size: var(--fs-1); }
.app-banner .ab-icon { width: 16px; height: 16px; flex: 0 0 auto; }
.app-banner a { color: var(--accent-11); font-weight: var(--weight-medium); text-decoration: underline; }
.app-banner .ab-spacer { flex: 1; }
.app-banner .ab-close { display: inline-flex; border: 0; background: transparent; color: var(--accent-11); cursor: pointer; padding: 2px; border-radius: var(--radius-2); }
.app-banner .ab-close:hover { background: var(--accent-4); }
.app-banner[hidden] { display: none; }

/* ---- Header (full width, end to end) ---- */
.app-header {
  grid-area: header;
  background: var(--color-panel-solid);
  border-bottom: var(--stroke-thin) solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-5);
  color: var(--fg-high);
}
.app-header .brand { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-3); font-weight: var(--weight-bold); letter-spacing: -0.01em; }
.app-header .header-right { display: flex; align-items: center; gap: var(--space-3); }
.app-header .icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-3);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-low); background: transparent; border: 0; cursor: pointer;
}
.app-header .icon-btn:hover { background: var(--gray-3); }
.app-header .header-user { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-2); color: var(--fg-low); }
.app-header .divider-v { width: 1px; height: 24px; background: var(--border-subtle); }

/* ---- Sidebar (Navigation) - Radix inset rounded pills ---- */
.app-sidebar {
  grid-area: sidebar;
  background: var(--color-page);
  border-right: var(--stroke-thin) solid var(--border-subtle);
  display: flex; flex-direction: column;
  padding: var(--space-3) var(--space-3);
  gap: 2px; overflow-y: auto;
}
.sidebar-toggle {
  width: 32px; height: 32px; border-radius: var(--radius-3);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-low); background: transparent; border: 0; cursor: pointer;
  margin-bottom: var(--space-2);
}
.sidebar-toggle:hover { background: var(--gray-3); }
.nav-section {
  font-size: var(--fs-1); font-weight: var(--weight-medium);
  letter-spacing: .04em; text-transform: uppercase; color: var(--fg-subtle);
  padding: var(--space-3) var(--space-2) var(--space-1);
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 36px; padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-3);
  color: var(--fg-low); background: transparent;
  text-decoration: none; cursor: pointer;
  font-size: var(--fs-2); font-weight: var(--weight-medium);
}
.nav-item .nav-icon { width: 18px; height: 18px; color: var(--fg-subtle); flex: 0 0 auto; }
.nav-item .nav-label { flex: 1; }
.nav-item .nav-chevron { width: 16px; height: 16px; color: var(--fg-subtle); }
.nav-item:hover { background: var(--gray-3); color: var(--fg-high); }
.nav-item:hover .nav-icon { color: var(--fg-low); }
.nav-item[aria-current="page"],
.nav-item.is-active {
  background: var(--accent-9); color: var(--accent-contrast);   /* solid brand amber pill */
}
.nav-item[aria-current="page"] .nav-icon,
.nav-item.is-active .nav-icon { color: var(--accent-contrast); }
.nav-item[aria-current="page"]:hover,
.nav-item.is-active:hover { background: var(--accent-10); color: var(--accent-contrast); }

/* ---- Content area ---- */
.app-content { grid-area: content; background: var(--color-page); display: flex; flex-direction: column; overflow-y: auto; }
.content-body { flex: 1; padding: var(--space-5) var(--space-6) var(--space-6); text-align: left; }

/* Breadcrumbs (always present) */
.breadcrumbs { display: flex; align-items: center; gap: var(--space-1); padding: var(--space-4) var(--space-6); border-bottom: var(--stroke-thin) solid var(--border-subtle); font-size: var(--fs-2); }
.breadcrumbs a { color: var(--fg-low); text-decoration: none; padding: 2px 6px; border-radius: var(--radius-2); }
.breadcrumbs a:hover { background: var(--gray-3); color: var(--fg-high); }
.breadcrumbs .sep { color: var(--fg-subtle); display: inline-flex; }
.breadcrumbs .current { color: var(--fg-high); font-weight: var(--weight-medium); padding: 2px 6px; }

/* Page header */
.page-header { margin-bottom: var(--space-5); }
.page-header h1 { font-size: var(--fs-7); line-height: var(--lh-7); letter-spacing: var(--ls-7); font-weight: var(--weight-bold); }
.page-header p { margin-top: var(--space-2); color: var(--fg-low); font-size: var(--fs-3); line-height: var(--lh-3); }

/* Footer */
.app-footer { padding: var(--space-4) var(--space-6); border-top: var(--stroke-thin) solid var(--border-subtle); color: var(--fg-low); font-size: var(--fs-1); }
.app-footer a { color: var(--accent-11); text-decoration: none; }

/* ============================================================
   BUTTON - Radix variants (solid / soft / surface / outline / ghost)
   Accent solid uses DARK text because amber-9 is high-luminance.
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 32px; padding: 0 var(--space-3);
  border-radius: var(--radius-3);
  font-family: var(--font-base); font-size: var(--fs-2); line-height: var(--lh-2);
  font-weight: var(--weight-medium);
  border: 0; cursor: pointer; white-space: nowrap;
  transition: background-color .12s ease-out, box-shadow .12s ease-out;
}
.btn .btn-icon { width: 16px; height: 16px; flex: 0 0 auto; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--color-page), 0 0 0 4px var(--focus-ring); }
.btn:disabled { background: var(--gray-3); color: var(--fg-disabled); box-shadow: none; cursor: not-allowed; }

/* solid - the primary CTA */
.btn-solid { background: var(--accent-9); color: var(--accent-contrast); }
.btn-solid:hover { background: var(--accent-10); }
/* soft - secondary, tinted */
.btn-soft { background: var(--accent-3); color: var(--accent-11); }
.btn-soft:hover { background: var(--accent-4); }
/* surface - neutral panel button with inset hairline */
.btn-surface { background: var(--color-surface); color: var(--fg-high); box-shadow: inset 0 0 0 1px var(--border-ui); }
.btn-surface:hover { background: var(--gray-2); box-shadow: inset 0 0 0 1px var(--border-strong); }
/* outline - accent hairline */
.btn-outline { background: transparent; color: var(--accent-11); box-shadow: inset 0 0 0 1px var(--accent-8); }
.btn-outline:hover { background: var(--accent-2); }
/* ghost - chromeless */
.btn-ghost { background: transparent; color: var(--fg-low); }
.btn-ghost:hover { background: var(--gray-3); color: var(--fg-high); }

/* destructive modifier (compose with a variant) */
.btn-solid.is-danger { background: var(--red-9); color: #fff; }
.btn-solid.is-danger:hover { background: var(--red-10); }
.btn-soft.is-danger { background: var(--red-3); color: var(--red-11); }
.btn-soft.is-danger:hover { background: var(--red-4); }

/* sizes */
.btn.is-sm { height: 26px; padding: 0 var(--space-2); font-size: var(--fs-1); }
.btn.is-lg { height: 40px; padding: 0 var(--space-4); font-size: var(--fs-3); border-radius: var(--radius-4); }
.btn.is-icon { width: 32px; padding: 0; }

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--color-panel-solid);
  border: var(--stroke-thin) solid var(--border-subtle);
  border-radius: var(--radius-4);
  padding: var(--space-5);
  display: flex; flex-direction: column;
}
.card.is-raised { border-color: transparent; box-shadow: var(--shadow-3); }
.card.is-ghost { background: transparent; border-color: transparent; padding: 0; }

/* Avatar */
.avatar {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  background: var(--gray-9); color: #fff;   /* neutral fallback; assign a .c1-.c8 per person */
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: var(--weight-medium); font-size: var(--fs-1);
  flex: 0 0 auto;
}
.avatar.is-neutral { background: var(--gray-4); color: var(--fg-low); }
/* Per-person color palette (chart hues; amber excluded so it stays brand-only).
   Assign deterministically from the person's initials, white text. */
.avatar.c1 { background: var(--chart-1); color: #fff; }
.avatar.c2 { background: var(--chart-2); color: #fff; }
.avatar.c3 { background: var(--chart-3); color: #fff; }
.avatar.c4 { background: var(--chart-4); color: #fff; }
.avatar.c5 { background: var(--chart-5); color: #fff; }
.avatar.c6 { background: var(--chart-6); color: #fff; }
.avatar.c7 { background: var(--chart-7); color: #fff; }
.avatar.c8 { background: var(--chart-8); color: #fff; }

/* Badge - soft by default (Radix) */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  height: 20px; padding: 0 var(--space-2); border-radius: var(--radius-2);
  background: var(--accent-3); color: var(--accent-11);
  font-size: var(--fs-1); font-weight: var(--weight-medium); line-height: 1;
}
.badge.is-solid { background: var(--accent-9); color: var(--accent-contrast); }
.badge.is-surface { background: transparent; box-shadow: inset 0 0 0 1px var(--accent-7); color: var(--accent-11); }
.badge.is-pill { border-radius: var(--radius-full); }
.badge.is-success { background: var(--success-bg); color: var(--success-text); }
.badge.is-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge.is-danger  { background: var(--danger-bg);  color: var(--danger-text); }
.badge.is-info    { background: var(--info-bg);    color: var(--info-text); }
.badge.is-neutral { background: var(--gray-3);     color: var(--fg-low); }

/* Empty state - the ONLY block allowed to center its contents */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding: var(--space-7) var(--space-6); }
.empty-state .empty-art { width: 88px; height: 88px; border-radius: var(--radius-5); background: var(--accent-3); color: var(--accent-11); display: inline-flex; align-items: center; justify-content: center; position: relative; }
.empty-state h2 { font-size: var(--fs-5); line-height: var(--lh-5); font-weight: var(--weight-bold); }
.empty-state p { color: var(--fg-low); max-width: 420px; font-size: var(--fs-3); }
.empty-state .empty-hint { color: var(--fg-subtle); font-size: var(--fs-1); }

/* ============================================================
   FORM & INPUT - Radix surface fields (inset 1px shadow border)
   ============================================================ */
.field { display: flex; flex-direction: column; gap: var(--space-1); }
.field-label { font-size: var(--fs-2); font-weight: var(--weight-medium); color: var(--fg-high); }
.field-label .req { color: var(--danger-text); margin-left: 2px; }
.field-hint { font-size: var(--fs-1); color: var(--fg-low); }
.field-hint.is-error { color: var(--danger-text); }

.input, .select, .textarea {
  width: 100%; min-height: 32px;
  font-family: var(--font-base); font-size: var(--fs-2); line-height: var(--lh-2);
  color: var(--fg-high);
  background: var(--color-surface);
  border: 0; border-radius: var(--radius-2);
  box-shadow: inset 0 0 0 1px var(--border-ui);
  padding: 0 var(--space-2);
}
.textarea { min-height: 72px; padding: var(--space-2); resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--fg-subtle); }
.input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: inset 0 0 0 1px var(--accent-8), 0 0 0 2px var(--accent-a8, transparent); }
.input:focus, .select:focus, .textarea:focus { box-shadow: inset 0 0 0 1px var(--accent-8); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--gray-2); color: var(--fg-disabled); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.select { appearance: none; padding-right: var(--space-5); }

/* Spin button */
.spin-button { display: inline-flex; align-items: stretch; box-shadow: inset 0 0 0 1px var(--border-ui); border-radius: var(--radius-2); background: var(--color-surface); }
.spin-button .input { box-shadow: none; border-radius: var(--radius-2) 0 0 var(--radius-2); }
.spin-button .steppers { display: flex; flex-direction: column; }
.spin-button .steppers button { flex: 1; width: 24px; border: 0; background: transparent; color: var(--fg-low); cursor: pointer; }
.spin-button .steppers button:hover { background: var(--gray-3); }

/* Checkbox & Radio */
.checkbox, .radio { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; font-size: var(--fs-2); color: var(--fg-high); }
.checkbox input, .radio input { appearance: none; margin: 0; width: 18px; height: 18px; box-shadow: inset 0 0 0 1px var(--border-ui); background: var(--color-surface); cursor: pointer; display: inline-grid; place-content: center; }
.checkbox input { border-radius: 5px; }   /* fixed: a checkbox stays a checkbox even if the radius scale is bumped */
.radio input { border-radius: var(--radius-full); }
.checkbox input:checked, .radio input:checked { background: var(--accent-9); box-shadow: none; }
.checkbox input:checked::after { content: ""; width: 11px; height: 11px; clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); background: var(--accent-contrast); }
.radio input:checked::after { content: ""; width: 7px; height: 7px; border-radius: var(--radius-full); background: var(--accent-contrast); }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.switch input { appearance: none; margin: 0; width: 40px; height: 22px; border-radius: var(--radius-full); background: var(--gray-7); position: relative; cursor: pointer; transition: background .12s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: var(--radius-full); background: #fff; box-shadow: var(--shadow-2); transition: transform .12s; }
.switch input:checked { background: var(--accent-9); }
.switch input:checked::after { transform: translateX(18px); }

/* Slider */
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: var(--radius-full); background: var(--gray-5); outline: none; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: var(--radius-full); background: #fff; box-shadow: var(--shadow-2), inset 0 0 0 1px var(--gray-7); cursor: pointer; }
.slider::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: var(--radius-full); background: #fff; box-shadow: var(--shadow-2), inset 0 0 0 1px var(--gray-7); cursor: pointer; }

/* ============================================================
   DATA & FEEDBACK
   ============================================================ */

/* Tabs */
.tabs { display: flex; gap: var(--space-1); border-bottom: var(--stroke-thin) solid var(--border-subtle); }
.tab { position: relative; padding: var(--space-2) var(--space-3); background: transparent; border: 0; cursor: pointer; font-size: var(--fs-2); font-weight: var(--weight-medium); color: var(--fg-low); }
.tab:hover { color: var(--fg-high); }
.tab.is-active { color: var(--fg-high); }
.tab.is-active::after { content: ""; position: absolute; left: var(--space-3); right: var(--space-3); bottom: -1px; height: 2px; border-radius: var(--radius-full); background: var(--accent-9); }

/* Tag (closable chip) */
.tag { display: inline-flex; align-items: center; gap: var(--space-1); height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-2); background: var(--gray-3); color: var(--fg-low); font-size: var(--fs-1); }
.tag .tag-dismiss { cursor: pointer; color: var(--fg-subtle); display: inline-flex; }

/* Toast */
.toast { display: flex; gap: var(--space-3); padding: var(--space-3); background: var(--color-panel-solid); border-radius: var(--radius-4); box-shadow: var(--shadow-4); max-width: 360px; }
.toast .toast-title { font-size: var(--fs-2); font-weight: var(--weight-medium); }
.toast .toast-body { font-size: var(--fs-1); color: var(--fg-low); }

/* Callout (Radix Callout = soft tinted info/status banner) */
.callout { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius-4); background: var(--gray-3); color: var(--fg-high); font-size: var(--fs-2); }
.callout .co-icon { width: 18px; height: 18px; flex: 0 0 auto; color: var(--fg-low); margin-top: 1px; }
.callout.is-info    { background: var(--info-bg);    color: var(--info-text); }
.callout.is-info .co-icon    { color: var(--info-solid); }
.callout.is-success { background: var(--success-bg); color: var(--success-text); }
.callout.is-success .co-icon { color: var(--success-solid); }
.callout.is-warning { background: var(--warning-bg); color: var(--warning-text); }
.callout.is-warning .co-icon { color: var(--warning-solid); }
.callout.is-danger  { background: var(--danger-bg);  color: var(--danger-text); }
.callout.is-danger .co-icon  { color: var(--danger-solid); }

/* Progress */
.progress { width: 100%; height: 6px; border-radius: var(--radius-full); background: var(--gray-4); overflow: hidden; }
.progress > .progress-fill { height: 100%; background: var(--accent-9); border-radius: var(--radius-full); }

/* Spinner */
.spinner { display: inline-flex; align-items: center; gap: var(--space-2); }
.spinner .spin { width: 20px; height: 20px; border-radius: var(--radius-full); border: 2px solid var(--gray-5); border-top-color: var(--accent-9); animation: rx-spin .8s linear infinite; }
@keyframes rx-spin { to { transform: rotate(360deg); } }

/* Skeleton */
.skeleton { background: var(--gray-3); border-radius: var(--radius-2); position: relative; overflow: hidden; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent); animation: rx-shimmer 1.4s infinite; }
@keyframes rx-shimmer { to { transform: translateX(100%); } }

/* Tooltip - Radix solid inverted */
.tooltip { background: var(--color-inverted); color: var(--fg-on-inverted); border-radius: var(--radius-2); padding: var(--space-1) var(--space-2); box-shadow: var(--shadow-3); font-size: var(--fs-1); max-width: 240px; }

/* Persona */
.persona { display: inline-flex; align-items: center; gap: var(--space-2); }
.persona .persona-text { display: flex; flex-direction: column; }
.persona .persona-name { font-size: var(--fs-3); font-weight: var(--weight-medium); color: var(--fg-high); }
.persona .persona-sub { font-size: var(--fs-1); color: var(--fg-low); }

/* ============================================================
   CONTAINERS & OVERLAYS
   ============================================================ */
.overlay { position: fixed; inset: 0; background: var(--color-overlay); display: flex; align-items: center; justify-content: center; z-index: 1000; }

.dialog { width: min(540px, 92vw); background: var(--color-panel-solid); border-radius: var(--radius-5); box-shadow: var(--shadow-5); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.dialog-title { font-size: var(--fs-5); line-height: var(--lh-5); font-weight: var(--weight-bold); }
.dialog-body { font-size: var(--fs-2); color: var(--fg-low); }
.dialog-footer { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }

.modal { width: min(820px, 94vw); max-height: 90vh; overflow: auto; background: var(--color-panel-solid); border-radius: var(--radius-5); box-shadow: var(--shadow-5); }

.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(560px, 90vw); background: var(--color-panel-solid); box-shadow: var(--shadow-5); padding: var(--space-5); overflow-y: auto; z-index: 1000; }
.drawer.is-left { right: auto; left: 0; }

.popover { background: var(--color-panel-solid); border-radius: var(--radius-4); box-shadow: var(--shadow-4); padding: var(--space-3); }

.accordion-item { border-bottom: var(--stroke-thin) solid var(--border-subtle); }
.accordion-header { display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: var(--space-3) var(--space-2); background: transparent; border: 0; cursor: pointer; font-size: var(--fs-2); font-weight: var(--weight-medium); color: var(--fg-high); text-align: left; }
.accordion-header .acc-chevron { transition: transform .12s; color: var(--fg-subtle); }
.accordion-header[aria-expanded="true"] .acc-chevron { transform: rotate(90deg); }
.accordion-panel { padding: 0 var(--space-2) var(--space-3) calc(var(--space-2) + 18px); font-size: var(--fs-2); color: var(--fg-low); }

/* Separator */
.divider { border: 0; border-top: var(--stroke-thin) solid var(--border-subtle); margin: var(--space-3) 0; }
.divider.is-vertical { border-top: 0; border-left: var(--stroke-thin) solid var(--border-subtle); height: auto; align-self: stretch; margin: 0 var(--space-3); }

/* Link */
.link { color: var(--accent-11); text-decoration: none; font-size: var(--fs-2); }
.link:hover { text-decoration: underline; }

/* Tree */
.tree { display: flex; flex-direction: column; }
.tree-item { display: flex; align-items: center; gap: var(--space-1); min-height: 32px; padding: 0 var(--space-2); border-radius: var(--radius-3); color: var(--fg-low); cursor: pointer; font-size: var(--fs-2); }
.tree-item:hover { background: var(--gray-3); color: var(--fg-high); }
.tree-item .tree-chevron { width: 16px; height: 16px; color: var(--fg-subtle); }
.tree-item.is-selected { background: var(--accent-3); color: var(--accent-11); }
.tree-children { padding-left: var(--space-5); }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: var(--space-1); min-height: 36px; padding: var(--space-1); border-radius: var(--radius-3); background: var(--color-panel-solid); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.toolbar .toolbar-spacer { flex: 1; }

/* Info button */
.info-btn { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: var(--radius-2); color: var(--fg-subtle); cursor: pointer; }
.info-btn:hover { background: var(--gray-3); color: var(--fg-low); }

/* Dropdown menu (Select / Dropdown Menu surface) */
.dropdown { display: inline-flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-width: 180px; height: 32px; padding: 0 var(--space-2) 0 var(--space-3); background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--border-ui); border-radius: var(--radius-2); color: var(--fg-high); font-size: var(--fs-2); cursor: pointer; }
.dropdown:hover { background: var(--gray-2); }
.dropdown:focus-within, .dropdown.is-focus { box-shadow: inset 0 0 0 1px var(--accent-8); outline: none; }
.dropdown .dropdown-chevron { width: 16px; height: 16px; color: var(--fg-subtle); transition: transform .12s; }
.dropdown[aria-expanded="true"] .dropdown-chevron { transform: rotate(180deg); }
.dropdown-menu { background: var(--color-panel-solid); border-radius: var(--radius-3); box-shadow: var(--shadow-4); padding: var(--space-1); display: flex; flex-direction: column; gap: 1px; min-width: 200px; }
.list-item { display: flex; align-items: center; gap: var(--space-2); min-height: 32px; padding: var(--space-1) var(--space-2); border-radius: var(--radius-2); color: var(--fg-high); font-size: var(--fs-2); cursor: pointer; }
.list-item:hover { background: var(--accent-9); color: var(--accent-contrast); }
.list-item:hover .list-check { color: var(--accent-contrast); }
.list-item.is-selected .list-check { color: var(--accent-11); }
.list-item.is-disabled { color: var(--fg-disabled); pointer-events: none; }
.list-item.is-header { font-size: var(--fs-1); font-weight: var(--weight-medium); color: var(--fg-subtle); pointer-events: none; text-transform: uppercase; letter-spacing: .04em; }
.list-item .list-check { width: 16px; height: 16px; }

/* ============================================================
   TABLE - Radix data table
   Header text gray-11 (--fg-low), body gray-12, gray-6 separators,
   gray-2 row hover, 40px header / 48px body rows (the §4 literal).
   Pair with .table-toolbar above and .pagination below.
   ============================================================ */
.table-wrap { width: 100%; overflow-x: auto; border-radius: var(--radius-4); border: var(--stroke-thin) solid var(--border-subtle); background: var(--color-panel-solid); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-2); }
.table thead th { position: sticky; top: 0; z-index: 1; background: var(--gray-2); text-align: left; font-weight: var(--weight-medium); color: var(--fg-low); padding: 0 var(--space-4); height: 40px; border-bottom: var(--stroke-thin) solid var(--border-subtle); white-space: nowrap; }
.table thead th.is-numeric { text-align: right; }
.table tbody td { height: 48px; padding: 0 var(--space-4); color: var(--table-fg); font-weight: var(--weight-regular); border-bottom: var(--stroke-thin) solid var(--border-subtle); vertical-align: middle; }
.table tbody td.is-numeric { text-align: right; font-variant-numeric: tabular-nums; color: var(--table-fg); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--row-accent); }
.table tbody tr.is-selected td { background: var(--row-accent); }
.table tbody tr[data-href] { cursor: pointer; }   /* clickable rows (wire with the row-click snippet) */
.table .cell-strong { font-weight: var(--weight-regular); color: var(--table-fg); }
.table .cell-sub { color: var(--fg-subtle); }
.table .cell-sub { color: var(--fg-low); font-size: var(--fs-1); }
.table .cell-person { display: flex; align-items: center; gap: var(--space-3); }
.table-toolbar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.table-toolbar .toolbar-spacer { flex: 1; }
.pagination { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); font-size: var(--fs-2); color: var(--fg-low); }
.pagination .page-spacer { flex: 1; }
.pagination .page-info { color: var(--fg-low); }
.pagination .page-controls { display: flex; align-items: center; gap: var(--space-1); }

/* Search field (leading icon inside a surface input) */
.search { position: relative; display: inline-flex; align-items: center; }
.search .search-icon { position: absolute; left: var(--space-2); width: 16px; height: 16px; color: var(--fg-subtle); pointer-events: none; }
.search .input { padding-left: var(--space-6); }

/* ============================================================
   RADIX EXTRAS
   ============================================================ */

/* Segmented Control - track with a sliding active panel */
.segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--gray-3); border-radius: var(--radius-3); }
.segmented-item { display: inline-flex; align-items: center; gap: var(--space-1); height: 28px; padding: 0 var(--space-3); border: 0; background: transparent; color: var(--fg-low); font-family: var(--font-base); font-size: var(--fs-2); font-weight: var(--weight-medium); border-radius: var(--radius-2); cursor: pointer; }
.segmented-item:hover { color: var(--fg-high); }
.segmented-item.is-active { background: var(--color-panel-solid); color: var(--fg-high); box-shadow: var(--shadow-2); }

/* Toggle Group - pressed/unpressed buttons (single or multi) */
.toggle-group { display: inline-flex; gap: var(--space-1); }
.toggle { display: inline-flex; align-items: center; gap: var(--space-1); height: 32px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-2); background: transparent; box-shadow: inset 0 0 0 1px var(--border-ui); color: var(--fg-low); font-family: var(--font-base); font-size: var(--fs-2); font-weight: var(--weight-medium); cursor: pointer; }
.toggle:hover { background: var(--gray-2); color: var(--fg-high); }
.toggle.is-on { background: var(--accent-3); color: var(--accent-11); box-shadow: inset 0 0 0 1px var(--accent-7); }

/* Data List - key/value pairs */
.data-list { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-3) var(--space-5); align-items: baseline; }
.data-list .dl-label { color: var(--fg-low); font-size: var(--fs-2); }
.data-list .dl-value { color: var(--fg-high); font-size: var(--fs-2); }

/* Radio Cards - selectable card group */
.radio-cards { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.radio-card { display: block; padding: var(--space-4); border-radius: var(--radius-4); background: var(--color-panel-solid); box-shadow: inset 0 0 0 1px var(--border-ui); cursor: pointer; }
.radio-card:hover { box-shadow: inset 0 0 0 1px var(--border-strong); }
.radio-card.is-selected { box-shadow: inset 0 0 0 2px var(--accent-9); }
.radio-card .rc-title { font-size: var(--fs-2); font-weight: var(--weight-medium); color: var(--fg-high); }
.radio-card .rc-sub { font-size: var(--fs-1); color: var(--fg-low); margin-top: 2px; }

/* Alert Dialog - destructive confirm (narrower than Dialog) */
.alert-dialog { width: min(460px, 92vw); background: var(--color-panel-solid); border-radius: var(--radius-5); box-shadow: var(--shadow-5); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.alert-dialog .ad-title { font-size: var(--fs-5); line-height: var(--lh-5); font-weight: var(--weight-bold); }
.alert-dialog .ad-body { font-size: var(--fs-2); color: var(--fg-low); }
.alert-dialog .ad-footer { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }

/* Hover Card - rich preview surface */
.hover-card { background: var(--color-panel-solid); border-radius: var(--radius-4); box-shadow: var(--shadow-4); padding: var(--space-4); max-width: 320px; }

/* Context Menu - reuses the dropdown menu surface */
.context-menu { background: var(--color-panel-solid); border-radius: var(--radius-3); box-shadow: var(--shadow-4); padding: var(--space-1); display: flex; flex-direction: column; gap: 1px; min-width: 180px; }

/* Inset - bleed content to the card edge (cancels card padding) */
.inset { margin-left: calc(-1 * var(--space-5)); margin-right: calc(-1 * var(--space-5)); }
.inset.is-top { margin-top: calc(-1 * var(--space-5)); }
.inset.is-bottom { margin-bottom: calc(-1 * var(--space-5)); }
.inset > img { display: block; width: 100%; }

/* Scroll Area - thin custom scrollbars */
.scroll-area { overflow: auto; scrollbar-width: thin; scrollbar-color: var(--gray-7) transparent; }
.scroll-area::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll-area::-webkit-scrollbar-track { background: transparent; }
.scroll-area::-webkit-scrollbar-thumb { background: var(--gray-7); border-radius: var(--radius-full); border: 3px solid var(--color-panel-solid); }
.scroll-area::-webkit-scrollbar-thumb:hover { background: var(--gray-8); }

/* Tab Nav - links styled as tabs (navigation, not in-page panels) */
.tab-nav { display: flex; gap: var(--space-1); border-bottom: var(--stroke-thin) solid var(--border-subtle); }
.tab-nav-item { position: relative; padding: var(--space-2) var(--space-3); color: var(--fg-low); text-decoration: none; font-size: var(--fs-2); font-weight: var(--weight-medium); }
.tab-nav-item:hover { color: var(--fg-high); }
.tab-nav-item.is-active { color: var(--fg-high); }
.tab-nav-item.is-active::after { content: ""; position: absolute; left: var(--space-3); right: var(--space-3); bottom: -1px; height: 2px; border-radius: var(--radius-full); background: var(--accent-9); }

/* Inline typography: Code, Kbd, Blockquote */
.code { font-family: var(--font-mono); font-size: 0.9em; padding: 0.1em var(--space-1); background: var(--gray-3); color: var(--fg-high); border-radius: var(--radius-1); }
.kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 var(--space-1); font-family: var(--font-mono); font-size: var(--fs-1); color: var(--fg-low); background: var(--gray-2); box-shadow: inset 0 0 0 1px var(--border-subtle), 0 1px 0 var(--border-ui); border-radius: var(--radius-2); }
.blockquote { border-left: var(--stroke-thick) solid var(--gray-6); padding-left: var(--space-4); color: var(--fg-low); font-size: var(--fs-3); line-height: var(--lh-3); }

/* Aspect Ratio - set --ratio (e.g. 56.25% for 16:9) on the element */
.aspect { position: relative; width: 100%; overflow: hidden; border-radius: var(--radius-3); }
.aspect::before { content: ""; display: block; padding-top: var(--ratio, 56.25%); }
.aspect > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   HEADER EXTRAS (presence, org switcher, notif count, apps, theme)
   ============================================================ */
.presence { display: inline-flex; align-items: center; gap: var(--space-2); height: 28px; padding: 0 var(--space-3); border-radius: var(--radius-full); box-shadow: inset 0 0 0 1px var(--border-subtle); font-size: var(--fs-1); color: var(--fg-low); }
.presence .dot { width: 7px; height: 7px; border-radius: var(--radius-full); background: var(--green-9); }
.icon-btn { position: relative; }
.icon-btn .ic-badge { position: absolute; top: 0; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--radius-full); background: var(--red-9); color: #fff; font-size: 10px; font-weight: var(--weight-bold); display: inline-flex; align-items: center; justify-content: center; }
/* App launcher popover grid */
.app-launcher { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-1); width: 264px; }
.app-tile { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); padding: var(--space-3) var(--space-2); border-radius: var(--radius-3); text-decoration: none; color: var(--fg-high); font-size: var(--fs-1); }
.app-tile:hover { background: var(--gray-3); }
.app-tile .at-ic { width: 36px; height: 36px; border-radius: var(--radius-3); display: inline-flex; align-items: center; justify-content: center; background: var(--accent-3); color: var(--accent-11); }

/* ============================================================
   LAYOUT HELPERS (archetype grids - see references/layout.md)
   ============================================================ */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.split-2 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-4); align-items: start; }
.split-even { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); align-items: start; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: var(--space-4); }
.stack-5 { display: flex; flex-direction: column; gap: var(--space-5); }
@media (max-width: 1024px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } .split-2, .split-even { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .kpi-row { grid-template-columns: 1fr; } .card-grid { grid-template-columns: 1fr; } }

/* KPI stat card (extends .card) */
.stat-card { gap: var(--space-2); }
.stat-card .sc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.stat-card .sc-label { font-size: var(--fs-2); color: var(--fg-low); }
.stat-card .sc-icon { width: 32px; height: 32px; border-radius: var(--radius-3); display: inline-flex; align-items: center; justify-content: center; background: var(--gray-3); color: var(--fg-low); flex: 0 0 auto; }
.stat-card .sc-value { font-size: var(--fs-8); line-height: 1; letter-spacing: var(--ls-8); font-weight: var(--weight-bold); color: var(--fg-high); }
.stat-card .sc-delta { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-1); }
.stat-card .sc-delta.is-up { color: var(--success-text); }
.stat-card .sc-delta.is-down { color: var(--danger-text); }
.stat-card .sc-spark { margin-top: var(--space-1); height: 40px; }
.stat-card .sc-spark svg { width: 100%; height: 100%; display: block; }

/* Card with a titled header (panel) */
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.panel-title { font-size: var(--fs-4); font-weight: var(--weight-bold); color: var(--fg-high); }
.panel-sub { font-size: var(--fs-1); color: var(--fg-low); margin-top: 2px; }

/* ============================================================
   TABLE ENHANCEMENTS (select, sortable, status) - see layout.md
   ============================================================ */
.table .col-check { width: 44px; text-align: center; }
.table th.is-sortable { cursor: pointer; user-select: none; }
.table th.is-sortable:hover { color: var(--fg-high); }
.table th .th-sort { display: inline-flex; vertical-align: middle; margin-left: 4px; color: var(--fg-subtle); }
.badge.is-void { text-decoration: line-through; }

/* ============================================================
   THREE-PANE (list + detail) - see layout.md
   Use inside <main.app-content> with a flush content-body.
   ============================================================ */
.content-body.is-flush { padding: 0; }
.three-pane { display: grid; grid-template-columns: 232px minmax(320px, 380px) 1fr; height: 100%; }
.pane-rail { border-right: var(--stroke-thin) solid var(--border-subtle); padding: var(--space-4); display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.pane-list { border-right: var(--stroke-thin) solid var(--border-subtle); overflow-y: auto; }
.pane-detail { overflow-y: auto; padding: var(--space-6); }
.pane-list-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4); border-bottom: var(--stroke-thin) solid var(--border-subtle); position: sticky; top: 0; background: var(--color-panel-solid); font-size: var(--fs-1); font-weight: var(--weight-medium); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-subtle); }
.pane-folder { display: flex; align-items: center; gap: var(--space-3); min-height: 34px; padding: 0 var(--space-3); border-radius: var(--radius-3); color: var(--fg-low); text-decoration: none; font-size: var(--fs-2); font-weight: var(--weight-medium); }
.pane-folder:hover { background: var(--gray-3); color: var(--fg-high); }
.pane-folder.is-active { background: var(--accent-3); color: var(--accent-11); }
.pane-folder .pf-ic { width: 18px; height: 18px; color: var(--fg-subtle); flex: 0 0 auto; }
.pane-folder.is-active .pf-ic { color: var(--accent-11); }
.pane-folder .pf-count { margin-left: auto; font-size: var(--fs-1); color: var(--fg-subtle); }
.pane-folder.is-active .pf-count { color: var(--accent-11); }
.mail-item { display: block; padding: var(--space-3) var(--space-4); border-bottom: var(--stroke-thin) solid var(--border-subtle); border-left: 2px solid transparent; cursor: pointer; text-decoration: none; color: inherit; }
.mail-item:hover { background: var(--gray-2); }
.mail-item.is-active { background: var(--accent-2); border-left-color: var(--accent-9); }
.mail-item.is-unread .mail-name { font-weight: var(--weight-bold); }
.mail-item.is-unread { border-left-color: var(--accent-9); }
.mail-from { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.mail-name { font-size: var(--fs-2); font-weight: var(--weight-medium); color: var(--fg-high); }
.mail-time { font-size: var(--fs-1); color: var(--fg-subtle); flex: 0 0 auto; }
.mail-subj { font-size: var(--fs-2); color: var(--fg-high); margin-top: 2px; }
.mail-snippet { font-size: var(--fs-1); color: var(--fg-low); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1024px) { .three-pane { grid-template-columns: minmax(300px, 360px) 1fr; } .three-pane .pane-rail { display: none; } }

/* ============================================================
   APP SHELL EXTENSIONS (v2) - opt-in patterns proven in the field
   Dark app bar, click-to-open profile menu, SPA view switching,
   page tab bar, colored metric cards, parameter sliders, collapsibles.
   All token-driven; the single dark-bar literal is documented below.
   ============================================================ */

/* ---- Dark app bar: add .is-dark to .app-header for a persistent dark
   frame across BOTH themes. Controls flip to light-on-dark. The #242424
   is the one allowed shell literal (a fixed chrome color, theme-independent). */
.app-header.is-dark { background: #242424; color: #fff; border-bottom-color: rgba(255,255,255,.10); }
.app-header.is-dark .brand { color: #fff; }
.app-header.is-dark .header-user,
.app-header.is-dark .icon-btn,
.app-header.is-dark .presence { color: rgba(255,255,255,.72); }
.app-header.is-dark .icon-btn:hover { background: rgba(255,255,255,.12); }
.app-header.is-dark .presence { box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.app-header.is-dark .divider-v { background: rgba(255,255,255,.16); }
.app-header.is-dark .search .search-icon { color: rgba(255,255,255,.55); }
.app-header.is-dark .input { background: rgba(255,255,255,.08); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.app-header.is-dark .input::placeholder { color: rgba(255,255,255,.55); }
.app-header.is-dark .input:focus { box-shadow: inset 0 0 0 1px var(--accent-8); }
.app-header.is-dark .dropdown { background: rgba(255,255,255,.08); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.app-header.is-dark .dropdown:hover { background: rgba(255,255,255,.12); }
.app-header.is-dark .dropdown .dropdown-chevron { color: rgba(255,255,255,.6); }
.app-header.is-dark .avatar.is-neutral { background: rgba(255,255,255,.16); color: #fff; }

/* ---- Profile trigger + menu (header account dropdown; opens on click).
   Put a .profile-btn (avatar + name + chevron) next to a .profile-menu popover. */
.profile-btn { display: inline-flex; align-items: center; gap: var(--space-2); height: 36px; padding: 0 var(--space-2); border: 0; background: transparent; color: var(--fg-high); font-family: var(--font-base); font-size: var(--fs-2); font-weight: var(--weight-medium); border-radius: var(--radius-3); cursor: pointer; }
.profile-btn:hover { background: var(--gray-3); }
.app-header.is-dark .profile-btn { color: #fff; }
.app-header.is-dark .profile-btn:hover { background: rgba(255,255,255,.12); }
.profile-btn .avatar { background: var(--accent-9); color: var(--accent-contrast); }   /* brand account avatar */
.profile-btn .pb-chevron { color: var(--fg-subtle); display: inline-flex; transition: transform .12s; }
.app-header.is-dark .profile-btn .pb-name { color: #fff; }
.app-header.is-dark .profile-btn .pb-chevron { color: rgba(255,255,255,.6); }
.profile-btn[aria-expanded="true"] .pb-chevron { transform: rotate(180deg); }
.profile-menu { width: 320px; padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }
.profile-menu[hidden] { display: none; }                                     /* beats the flex display */
.profile-menu .pm-head { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-2); }
.profile-menu .pm-head .avatar { background: var(--accent-9); color: var(--accent-contrast); }
.profile-menu .pm-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-menu .pm-name { font-size: var(--fs-3); font-weight: var(--weight-bold); color: var(--fg-high); }
.profile-menu .pm-email { font-size: var(--fs-1); color: var(--fg-low); overflow: hidden; text-overflow: ellipsis; }
.profile-menu .pm-viewprofile { margin-top: 2px; font-size: var(--fs-2); font-weight: var(--weight-medium); color: var(--accent-11); text-decoration: none; }
.profile-menu .pm-viewprofile:hover { text-decoration: underline; }
.profile-menu .divider { margin: var(--space-2) 0; width: 100%; }
.profile-menu .pm-field { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-1) var(--space-2); }
.profile-menu .pm-field label { font-size: var(--fs-2); font-weight: var(--weight-medium); color: var(--fg-high); }
.profile-menu .dropdown { width: 100%; min-width: 0; background: var(--color-surface); color: var(--fg-high); box-shadow: inset 0 0 0 1px var(--border-ui); }
.profile-menu .dropdown:hover { background: var(--gray-2); }
.profile-menu .dropdown .dropdown-chevron { color: var(--fg-subtle); }
.profile-menu .pm-item { display: flex; align-items: center; justify-content: space-between; min-height: 36px; padding: 0 var(--space-2); border-radius: var(--radius-2); color: var(--fg-high); text-decoration: none; font-size: var(--fs-2); }
.profile-menu .pm-item svg { color: var(--fg-subtle); }
.profile-menu .pm-item:hover { background: var(--gray-3); }
.profile-menu .pm-version { text-align: center; font-size: var(--fs-1); color: var(--fg-subtle); padding-top: var(--space-1); }

/* ---- SPA view switching: wrap each page in <div class="view" id="..">, toggle [hidden].
   Sidebar .nav-item[data-view] targets a view id; only the active view renders. */
.app-content > .view { display: flex; flex-direction: column; flex: 1; }
.view[hidden] { display: none; }

/* ---- Page tab bar (in-page nav; distinct from sidebar). Active = amber pill. */
.seg-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--space-2); background: var(--gray-3); padding: 4px; border-radius: var(--radius-4); }
.seg-tab { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: 44px; border: 0; background: transparent; color: var(--fg-low); font-family: var(--font-base); font-size: var(--fs-3); font-weight: var(--weight-medium); border-radius: var(--radius-3); cursor: pointer; transition: background .12s, color .12s; }
.seg-tab svg { width: 18px; height: 18px; }
.seg-tab:hover { color: var(--fg-high); }
.seg-tab.is-active { background: var(--accent-9); color: var(--accent-contrast); box-shadow: var(--shadow-2); }
.tab-panel[hidden] { display: none; }
/* brand variant of the segmented control (amber active instead of white panel) */
.segmented.is-brand .segmented-item.is-active { background: var(--accent-9); color: var(--accent-contrast); }
.segmented.is-brand .segmented-item.is-active svg { color: var(--accent-contrast); }

/* ---- Colored metric cards (status-tinted KPI tiles; extends .card).
   Amber stays brand-only, so metric hues use blue/green/purple/red. */
.metric-card { gap: var(--space-1); }
.metric-card .mc-top { display: flex; align-items: center; justify-content: space-between; }
.metric-card .mc-label { font-size: var(--fs-2); font-weight: var(--weight-medium); color: var(--fg-low); }
.metric-card .mc-ic { width: 32px; height: 32px; border-radius: var(--radius-3); display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--mcs) 14%, transparent); color: var(--mcs); }
.metric-card .mc-value { font-size: var(--fs-8); line-height: 1.05; letter-spacing: var(--ls-8); font-weight: var(--weight-bold); color: var(--mc); margin-top: var(--space-2); }
.metric-card .mc-sub { font-size: var(--fs-1); color: var(--fg-low); margin-top: 2px; }
.metric-card.is-blue   { --mc: var(--blue-11);  --mcs: var(--blue-9); }
.metric-card.is-green  { --mc: var(--green-11); --mcs: var(--green-9); }
.metric-card.is-purple { --mc: var(--chart-4);  --mcs: var(--chart-4); }
.metric-card.is-red    { --mc: var(--red-11);   --mcs: var(--red-9); }

/* ---- Filter bar (inline control strip inside a flush .card) */
.filter-bar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) var(--space-4); }
.filter-bar .fb-ic { color: var(--fg-subtle); display: inline-flex; }
.filter-bar .fb-label { font-size: var(--fs-2); color: var(--fg-low); }
.filter-bar .spacer { flex: 1; }

/* ---- Summary strip (compact key/value quad on a gray surface) */
.summary-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--space-4); background: var(--gray-2); border-radius: var(--radius-4); padding: var(--space-4); }
.summary-strip .ss-label { font-size: var(--fs-1); color: var(--fg-low); }
.summary-strip .ss-value { font-size: var(--fs-3); font-weight: var(--weight-medium); color: var(--fg-high); margin-top: 2px; }

/* ---- Parameter slider (labeled range with an icon tile + live value badge).
   Set --pc on .param for the icon hue; the JS paints the track fill. */
.param { padding: var(--space-3) 0; border-top: var(--stroke-thin) solid var(--border-subtle); }
.param-head { display: flex; align-items: flex-start; gap: var(--space-3); }
.param-ic { width: 30px; height: 30px; border-radius: var(--radius-2); display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--pc, var(--accent-9)) 14%, transparent); color: var(--pc, var(--accent-11)); flex: 0 0 auto; }
.param-meta { flex: 1; min-width: 0; }
.param-title { font-size: var(--fs-2); font-weight: var(--weight-medium); color: var(--fg-high); }
.param-desc { font-size: var(--fs-1); color: var(--fg-low); margin-top: 1px; }
.param-val { flex: 0 0 auto; min-width: 44px; text-align: center; height: 24px; line-height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-2); background: var(--gray-3); color: var(--fg-high); font-size: var(--fs-1); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; }
.param .slider { margin-top: var(--space-3); }
.param-range { display: flex; justify-content: space-between; font-size: var(--fs-1); color: var(--fg-subtle); margin-top: 4px; }

/* ---- Collapsible (native <details class="collapse">) */
details.collapse > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-3); box-shadow: inset 0 0 0 1px var(--border-ui); border-radius: var(--radius-3); font-size: var(--fs-2); font-weight: var(--weight-medium); color: var(--fg-high); }
details.collapse > summary::-webkit-details-marker { display: none; }
details.collapse > summary .sm-chev { margin-left: auto; color: var(--fg-subtle); transition: transform .12s; }
details.collapse[open] > summary .sm-chev { transform: rotate(180deg); }
details.collapse .collapse-body { padding: var(--space-3); font-size: var(--fs-2); color: var(--fg-low); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .skeleton::after { display: none; }
}

/* ============================================================================
   COACH EXTENSIONS
   Components skyNote Coach needs that the base DS does not define. Every value
   binds to a token; steps follow the 12-step role table in components.md.
   Documented in components-coach.md. Two documented literals: the range-bar
   marker geometry and the phone device frame.
   ========================================================================== */

/* --- Range bar -----------------------------------------------------------
   A value on a track with the band it should sit in. Roles: track gray-4,
   ideal band green-3 on a green-7 hairline, benchmark blue-2 between blue-8
   dashes, baseline tick gray-9, value marker green-9 / orange-9 / red-9.     */
.rangebar { display: block; position: relative; width: 100%; height: 28px; }
.rangebar .rb-track { position: absolute; inset: 11px 0 auto 0; height: 6px; border-radius: var(--radius-full); background: var(--gray-4); }
.rangebar .rb-ideal { position: absolute; top: 9px; height: 10px; border-radius: var(--radius-full); background: var(--green-3); box-shadow: inset 0 0 0 1px var(--green-7); }
.rangebar .rb-bench { position: absolute; top: 6px; height: 16px; background: var(--blue-2); border-left: 1px dashed var(--blue-8); border-right: 1px dashed var(--blue-8); }
.rangebar .rb-base { position: absolute; top: 5px; width: 2px; height: 18px; border-radius: 1px; background: var(--gray-9); }
.rangebar .rb-you { position: absolute; top: 4px; width: 10px; height: 20px; border-radius: var(--radius-1); transform: translateX(-50%); background: var(--gray-12); box-shadow: 0 0 0 2px var(--color-panel-solid), var(--shadow-2); }
.rangebar .rb-you.is-good { background: var(--green-9); }
.rangebar .rb-you.is-warn { background: var(--orange-9); }
.rangebar .rb-you.is-miss { background: var(--red-9); }
.rangebar .rb-cap { position: absolute; top: 20px; font-size: var(--fs-1); color: var(--fg-subtle); font-family: var(--font-mono); }
.rangebar .rb-cap.is-start { left: 0; }
.rangebar .rb-cap.is-end { right: 0; }

.rangebar-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); font-size: var(--fs-1); color: var(--fg-low); }
.rangebar-legend span { display: inline-flex; align-items: center; gap: var(--space-2); }
.rangebar-legend i { display: inline-block; width: 14px; height: 8px; border-radius: 2px; }
.rangebar-legend i.lg-ideal { background: var(--green-3); box-shadow: inset 0 0 0 1px var(--green-7); }
.rangebar-legend i.lg-you { width: 6px; height: 13px; border-radius: var(--radius-1); background: var(--gray-12); }
.rangebar-legend i.lg-base { width: 2px; height: 13px; background: var(--gray-9); }
.rangebar-legend i.lg-bench { background: var(--blue-2); border-left: 1px dashed var(--blue-8); border-right: 1px dashed var(--blue-8); }

/* --- Metric row (expandable) --------------------------------------------- */
.metric-list { display: flex; flex-direction: column; gap: var(--space-2); }
.metric { border-radius: var(--radius-4); background: var(--color-panel-solid); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.metric.is-flagged { box-shadow: inset 0 0 0 1px var(--red-7); }
.metric > summary { list-style: none; cursor: pointer; padding: var(--space-3) var(--space-4); display: grid; grid-template-columns: minmax(0,1fr) 230px 268px; gap: var(--space-4); align-items: center; border-radius: var(--radius-4); }
.metric > summary::-webkit-details-marker { display: none; }
.metric > summary:hover { background: var(--gray-2); }
.metric > summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.metric[open] { box-shadow: inset 0 0 0 1px var(--accent-8), var(--shadow-2); }
.metric-name { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-2); font-weight: var(--weight-medium); color: var(--fg-high); }
.metric-def { display: block; font-size: var(--fs-1); color: var(--fg-subtle); margin-top: 2px; }
.metric-read { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); }
.metric-read > .metric-value { min-width: 96px; }
.metric-value { text-align: right; white-space: nowrap; }
.metric-value b { font-size: var(--fs-5); font-weight: var(--weight-bold); color: var(--fg-high); font-variant-numeric: tabular-nums; }
.metric-value .mv-unit { font-size: var(--fs-1); color: var(--fg-subtle); margin-left: 3px; }
.metric-delta { display: block; font-size: var(--fs-1); margin-top: 2px;
  text-align: right; text-wrap: balance; }
.metric-delta.is-up { color: var(--success-text); }
.metric-delta.is-down { color: var(--danger-text); }
.metric-chev { color: var(--fg-subtle); display: inline-flex; transition: transform .15s ease-in-out; }
.metric[open] .metric-chev { transform: rotate(90deg); }
.metric-body { padding: var(--space-4); border-top: var(--stroke-thin) solid var(--border-subtle); background: var(--gray-2); border-radius: 0 0 var(--radius-4) var(--radius-4); }

/* --- Moment (playable evidence row) -------------------------------------- */
.moment { display: grid; grid-template-columns: 32px 56px minmax(0,1fr) auto; gap: var(--space-3); align-items: start; padding: var(--space-3); border-radius: var(--radius-3); background: var(--color-panel-solid); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.moment + .moment { margin-top: var(--space-2); }
.moment-play { width: 32px; height: 32px; border: 0; border-radius: var(--radius-full); background: var(--color-surface); color: var(--fg-high); box-shadow: inset 0 0 0 1px var(--border-ui); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .12s ease-out, color .12s ease-out; }
.moment-play:hover { background: var(--accent-9); color: var(--accent-contrast); box-shadow: none; }
.moment-play:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.moment-time { font-family: var(--font-mono); font-size: var(--fs-1); color: var(--accent-11); padding-top: 7px; }
.moment-text { font-size: var(--fs-2); color: var(--table-fg); }
.moment-text mark { background: var(--accent-3); color: var(--fg-high); border-radius: var(--radius-1); padding: 0 3px; }
.moment-text .mt-speaker { font-weight: var(--weight-medium); color: var(--fg-high); }
.moment-meta { display: flex; gap: var(--space-3); font-size: var(--fs-1); color: var(--fg-subtle); margin-top: var(--space-1); }
.moment-actions { display: flex; align-items: center; gap: var(--space-1); }

/* --- Recommendation ------------------------------------------------------ */
.rec { border-radius: var(--radius-4); background: var(--accent-2); box-shadow: inset 0 0 0 1px var(--accent-6); padding: var(--space-4); }
.rec + .rec { margin-top: var(--space-3); }
.rec-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.rec-rank { width: 20px; height: 20px; border-radius: var(--radius-2); background: var(--accent-9); color: var(--accent-contrast); font-size: var(--fs-1); font-weight: var(--weight-bold); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.rec-say { font-size: var(--fs-2); color: var(--fg-high); }
.rec-say b { font-weight: var(--weight-medium); }
.rec-evidence { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }
.rec-foot { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.ev-label { font-size: var(--fs-1); color: var(--fg-subtle); text-transform: uppercase; letter-spacing: .06em; font-weight: var(--weight-medium); }
.ev-chip { display: inline-flex; align-items: center; gap: var(--space-2); height: 24px; padding: 0 var(--space-2) 0 4px; border: 0; border-radius: var(--radius-2); background: var(--color-panel-solid); box-shadow: inset 0 0 0 1px var(--accent-7); color: var(--fg-high); font-family: var(--font-base); font-size: var(--fs-1); cursor: pointer; }
.ev-chip:hover { background: var(--accent-3); }
.ev-chip .ev-ic { width: 16px; height: 16px; border-radius: var(--radius-full); background: var(--accent-3); color: var(--accent-11); display: inline-flex; align-items: center; justify-content: center; }
.ev-chip .ev-t { font-family: var(--font-mono); color: var(--accent-11); }

/* --- Scorecard criterion -------------------------------------------------- */
.crit { border-radius: var(--radius-4); background: var(--color-panel-solid); box-shadow: inset 0 0 0 1px var(--border-subtle); padding: var(--space-4); display: grid; grid-template-columns: 24px minmax(0,1fr) auto 72px; gap: var(--space-3); align-items: start; }
.crit + .crit { margin-top: var(--space-2); }
.crit.is-lost { box-shadow: inset 0 0 0 1px var(--red-7); }
.crit-n { font-family: var(--font-mono); font-size: var(--fs-1); color: var(--fg-subtle); padding-top: 4px; }
.crit-just { font-size: var(--fs-2); color: var(--table-fg); margin-top: var(--space-2); }
.crit-ai { font-size: var(--fs-1); font-weight: var(--weight-medium); color: var(--chart-4); text-transform: uppercase; letter-spacing: .06em; }
.crit-score { text-align: right; font-variant-numeric: tabular-nums; }
.crit-score b { font-size: var(--fs-5); font-weight: var(--weight-bold); color: var(--fg-high); }
.crit-score span { font-size: var(--fs-1); color: var(--fg-subtle); }

/* --- Coaching comment ----------------------------------------------------- */
.thread { border-left: 2px solid var(--accent-6); padding-left: var(--space-4); }
.cmt { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: var(--space-3); }
.cmt + .cmt { margin-top: var(--space-4); }
.cmt-head { display: flex; align-items: baseline; gap: var(--space-2); }
.cmt-who { font-size: var(--fs-1); font-weight: var(--weight-medium); color: var(--fg-high); }
.cmt-when { font-size: var(--fs-1); color: var(--fg-subtle); }
.cmt-bubble { margin-top: 4px; border-radius: var(--radius-3); background: var(--gray-2); box-shadow: inset 0 0 0 1px var(--border-subtle); padding: var(--space-3); font-size: var(--fs-2); color: var(--table-fg); }
.cmt-bubble.is-coach { background: var(--accent-2); box-shadow: inset 0 0 0 1px var(--accent-6); }

/* --- Streak --------------------------------------------------------------- */
.streak { display: flex; gap: var(--space-1); }
.streak i { width: 26px; height: 28px; border-radius: var(--radius-2); display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: var(--fs-1); font-weight: var(--weight-medium); }
.streak i.is-hit { background: var(--success-bg); color: var(--success-text); }
.streak i.is-miss { background: var(--danger-bg); color: var(--danger-text); }
.streak i.is-na { background: var(--gray-3); color: var(--fg-subtle); }

/* --- Speaker share row ----------------------------------------------------- */
.share-row { display: grid; grid-template-columns: 28px minmax(0,1fr) 48px; gap: var(--space-3); align-items: center; }
.share-row + .share-row { margin-top: var(--space-3); }
.share-name { font-size: var(--fs-2); color: var(--fg-high); }
.share-sub { display: block; font-size: var(--fs-1); color: var(--fg-subtle); }
.share-pct { text-align: right; font-size: var(--fs-2); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; color: var(--fg-high); }

/* --- Player (recording surface) --------------------------------------------
   Media chrome stays dark in BOTH themes, following the same convention the
   DS uses for .app-header.is-dark: the #242424 frame plus white alphas. A
   video surface that inverts to white in dark mode stops reading as video.  */
.player { border-radius: var(--radius-4); background: #242424; overflow: hidden; }
.player-stage { aspect-ratio: 16 / 9; display: flex; align-items: flex-start; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3); }
.player-stat { font-size: var(--fs-1); color: rgba(255,255,255,.72); background: rgba(255,255,255,.10); border-radius: var(--radius-1); padding: 2px var(--space-2); }
.player-stat b { color: #fff; font-weight: var(--weight-medium); }
.player-bar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3) var(--space-3); }
.player-time { font-family: var(--font-mono); font-size: var(--fs-1); color: rgba(255,255,255,.62); }
.player-track { flex: 1; height: 4px; border-radius: var(--radius-full); background: rgba(255,255,255,.20); position: relative; }
.player-track i { position: absolute; inset: 0 auto 0 0; border-radius: var(--radius-full); background: var(--accent-9); }
.player-btn { width: 26px; height: 26px; border-radius: var(--radius-full); border: 0; background: rgba(255,255,255,.14); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.player-btn:hover { background: rgba(255,255,255,.24); }

/* Clip thumbnail, same persistent media chrome. */
.clip-thumb { aspect-ratio: 16 / 8; background: #242424; color: rgba(255,255,255,.55); display: flex; align-items: center; justify-content: center; position: relative; }
.clip-thumb .clip-dur { position: absolute; right: 8px; bottom: 8px; font-family: var(--font-mono); font-size: var(--fs-1); color: rgba(255,255,255,.80); background: rgba(0,0,0,.45); border-radius: var(--radius-1); padding: 1px 6px; }

/* --- Device frame (documented literals: fixed device geometry) -------------- */
.phone-row { display: flex; flex-wrap: wrap; gap: var(--space-6); justify-content: center; }
.phone { width: 320px; flex: 0 0 auto; }
.phone-shell { border: 8px solid #242424; border-radius: 34px; overflow: hidden; background: var(--color-page); box-shadow: var(--shadow-4); }
.phone-status { height: 24px; background: #242424; color: rgba(255,255,255,.62); font-family: var(--font-mono); font-size: var(--fs-1); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space-4); }
.phone-screen { height: 600px; overflow: hidden; padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-3); }
.phone-cap { text-align: center; font-size: var(--fs-1); color: var(--fg-low); margin-top: var(--space-2); }
.phone-nav { display: flex; border-top: var(--stroke-thin) solid var(--border-subtle); background: var(--color-panel-solid); }
.phone-nav a { flex: 1; text-align: center; padding: var(--space-2) 0 var(--space-3); font-size: var(--fs-1); color: var(--fg-subtle); text-decoration: none; }
.phone-nav a.is-active { color: var(--accent-11); }
.phone-nav a svg { display: block; margin: 0 auto 2px; }

/* --- E-mail frame ---------------------------------------------------------- */
.email { max-width: 620px; margin: 0 auto; border-radius: var(--radius-4); overflow: hidden; background: var(--color-panel-solid); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.email-head { background: #242424; color: #fff; padding: var(--space-5); }
.email-body { padding: var(--space-5); }
.email-meta { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); background: var(--gray-2); border-bottom: var(--stroke-thin) solid var(--border-subtle); font-size: var(--fs-1); color: var(--fg-low); }

/* --- Design-notes drawer --------------------------------------------------- */
.notes-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(460px, 92vw); z-index: 1200; background: var(--color-panel-solid); box-shadow: var(--shadow-5); padding: var(--space-5); overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-4); }
.notes-drawer[hidden] { display: none; }
.note-item { border-left: 2px solid var(--accent-8); padding-left: var(--space-3); font-size: var(--fs-2); color: var(--table-fg); }
.note-item b { color: var(--fg-high); font-weight: var(--weight-medium); }

/* --- Small helpers (layout only, no new colors) ---------------------------- */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.row-gap { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.stack-2 { display: flex; flex-direction: column; gap: var(--space-2); }
.stack-3 { display: flex; flex-direction: column; gap: var(--space-3); }
.stack-4 { display: flex; flex-direction: column; gap: var(--space-4); }
.text-low { color: var(--fg-low); }
.text-subtle { color: var(--fg-subtle); }
.text-high { color: var(--fg-high); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.grow { flex: 1; }

@media (max-width: 1200px) {
  .metric > summary { grid-template-columns: minmax(0,1fr) 180px; }
  .metric > summary .metric-bar { display: none; }
}
@media (max-width: 900px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .split-2, .split-even { grid-template-columns: 1fr; }
}

/* SPA view fills the content column so the footer stays pinned. */
.app-content > .view:not([hidden]) { flex: 1; display: flex; flex-direction: column; }

/* Control labels never wrap: a wrapped segmented item breaks the 28px track. */
.segmented-item, .seg-tab, .badge, .pagination .page-info { white-space: nowrap; }

/* rules.md S14: a title span and a sub span in the same cell render side by
   side unless the sub is a block. Fixes "Dana Whitfieldthe admin setting is off". */
.table .cell-sub { display: block; margin-top: 2px; }

/* ============================================================================
   COACH EXTENSIONS, PART 2
   CRM gating, the improvement drills on My Coach, and My Discovery.
   Every value binds to a token. Specs in components-coach.md.
   ============================================================================ */

/* ---- CRM gating -----------------------------------------------------------
   The shell carries data-crm on <html>. Anything that only exists once a CRM
   is connected is marked [data-crm-only]; its counterpart for the unconnected
   state is [data-nocrm-only]. One attribute, so a screen cannot drift out of
   sync with the nav. */
:root[data-crm="off"] [data-crm-only] { display: none !important; }
:root[data-crm="on"] [data-nocrm-only] { display: none !important; }

.app-banner .ab-crm { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--fs-1); }
.app-banner .ab-link { border: 0; background: transparent; padding: 0; cursor: pointer;
  font-family: var(--font-base); font-size: var(--fs-1); font-weight: var(--weight-medium);
  color: var(--accent-11); text-decoration: underline; text-underline-offset: 2px; }
.app-banner .ab-link:hover { color: var(--accent-12); }

/* ---- Improvement drills (My Coach, "This week") ---------------------------
   A pillar gets a titled block of two or three drills. Each drill is a named
   technique, what it fixes, and a cue short enough to hold in your head during
   a meeting. Bordered like every other card on the page. */
.drill-block { display: grid; gap: var(--space-3); }
.drill-pillar { display: flex; align-items: center; gap: var(--space-2); }
.drill-pillar .dp-name { font-size: var(--fs-3); font-weight: var(--weight-bold); color: var(--fg-high); }
.drill-pillar .dp-metric { font-size: var(--fs-1); color: var(--fg-low); }
.drill { display: grid; grid-template-columns: 32px 1fr; gap: var(--space-3);
  padding: var(--space-3); border-radius: var(--radius-3); background: var(--gray-2); }
.drill .dr-ic { width: 32px; height: 32px; border-radius: var(--radius-3);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-3); color: var(--accent-11); }
.drill .dr-name { font-size: var(--fs-2); font-weight: var(--weight-medium); color: var(--fg-high); display: block; }
.drill .dr-what { font-size: var(--fs-1); color: var(--fg-low); display: block; margin-top: 2px; }
.drill .dr-cue { display: block; margin-top: var(--space-2); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2); background: var(--color-panel-solid);
  box-shadow: inset 0 0 0 1px var(--border-subtle);
  font-size: var(--fs-2); color: var(--table-fg); }
.drill .dr-cue b { color: var(--fg-high); font-weight: var(--weight-medium); }

/* ---- Discovery Coach ------------------------------------------------------
   A prompt sheet, not a dashboard. Each section is a titled group of prompts;
   each prompt states what it is for, cites the CRM record it came from, and
   can be marked used or discarded. */
.dc-section { padding-top: var(--space-4); border-top: 1px solid var(--border-subtle); }
.dc-section:first-child { padding-top: 0; border-top: 0; }
.dc-head { display: flex; align-items: baseline; gap: var(--space-2); margin-bottom: var(--space-1); }
.dc-head .dc-title { font-size: var(--fs-3); font-weight: var(--weight-bold); color: var(--fg-high); }
.dc-head .dc-why { font-size: var(--fs-1); color: var(--fg-low); }

.prompt { padding: var(--space-3) 0; border-top: 1px dashed var(--border-subtle); }
.prompt:first-of-type { border-top: 0; }
.prompt .pr-say { font-size: var(--fs-2); color: var(--fg-high); line-height: var(--lh-2); }
.prompt .pr-learn { display: block; margin-top: var(--space-1); font-size: var(--fs-1); color: var(--fg-low); }
.prompt .pr-foot { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }
.prompt.is-used { opacity: .55; }
.prompt.is-used .pr-say { text-decoration: line-through; text-decoration-color: var(--gray-8); }

/* the CRM record a prompt is grounded in. Reads as a citation, not a filter. */
.grounded { display: inline-flex; align-items: center; gap: var(--space-1);
  height: 22px; padding: 0 var(--space-2); border-radius: var(--radius-2);
  background: var(--blue-3); color: var(--blue-11);
  font-size: var(--fs-1); font-weight: var(--weight-medium); }
.grounded svg { width: 12px; height: 12px; }

/* said-aloud block: the counselor reads this one out. Quiet, wide measure. */
.say-aloud { padding: var(--space-4); border-radius: var(--radius-3);
  background: var(--gray-2); box-shadow: inset 0 0 0 1px var(--border-subtle);
  font-size: var(--fs-3); line-height: var(--lh-3); color: var(--fg-high); font-style: italic; max-width: 78ch; }

/* the one suggested ask, the only place on the sheet that records anything */
.ask-card { padding: var(--space-4); border-radius: var(--radius-3);
  background: var(--accent-2); box-shadow: inset 0 0 0 1px var(--accent-6); }
.ask-card .ak-title { font-size: var(--fs-2); font-weight: var(--weight-medium); color: var(--fg-high); }
.ask-card .ak-why { display: block; margin-top: var(--space-2); font-size: var(--fs-1);
  color: var(--fg-low); line-height: var(--lh-1); max-width: 92ch; }

/* ---- Activity feed --------------------------------------------------------
   One rail, one dot per event, type carried by icon plus label. */
.feed { display: grid; gap: 0; }
.feed-item { display: grid; grid-template-columns: 28px 1fr auto; gap: var(--space-3);
  padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
.feed-item:last-child { border-bottom: 0; }
.feed-item .fi-ic { width: 28px; height: 28px; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gray-3); color: var(--fg-low); }
.feed-item .fi-ic svg { width: 14px; height: 14px; }
.feed-item.is-tour .fi-ic { background: var(--accent-3); color: var(--accent-11); }
.feed-item.is-note .fi-ic { background: var(--blue-3); color: var(--blue-11); }
.feed-item .fi-what { font-size: var(--fs-2); color: var(--fg-high); }
.feed-item .fi-sub { display: block; margin-top: 2px; font-size: var(--fs-1); color: var(--fg-low); }
.feed-item .fi-when { font-size: var(--fs-1); color: var(--fg-subtle); white-space: nowrap; }

/* ---- Prospect header ------------------------------------------------------ */
.prospect-head { display: flex; align-items: flex-start; gap: var(--space-4); flex-wrap: wrap; }
.prospect-head .ph-name { font-size: var(--fs-5); font-weight: var(--weight-bold); color: var(--fg-high); display: block; }
.prospect-head .ph-meta { display: flex; align-items: center; gap: var(--space-3);
  flex-wrap: wrap; margin-top: var(--space-1); font-size: var(--fs-1); color: var(--fg-low); }

/* stage pipeline: where the prospect is, and how far is left */
.stages { display: flex; align-items: center; gap: var(--space-1); flex-wrap: wrap; }
.stage { display: inline-flex; align-items: center; gap: var(--space-1);
  height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-2);
  font-size: var(--fs-1); font-weight: var(--weight-medium); color: var(--fg-subtle);
  background: var(--gray-3); }
.stage.is-done { background: var(--green-3); color: var(--green-11); }
.stage.is-now { background: var(--accent-9); color: var(--accent-contrast); }
.stage .st-n { display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: var(--radius-full);
  background: color-mix(in srgb, currentColor 18%, transparent); font-size: 10px; }
.stages .st-sep { width: 10px; height: 1px; background: var(--border-strong); flex: 0 0 auto; }

/* ============================================================================
   COACH EXTENSIONS, PART 3
   Lisa, the digital twin, and one-click draft and send.
   Token bound throughout. Specs in components-coach.md.
   ============================================================================ */

/* ---- Lisa's voice ---------------------------------------------------------
   The brief is prose, not a dashboard. Reading size, reading measure. */
.lisa-say { font-size: var(--fs-3); line-height: var(--lh-3); color: var(--fg-high); max-width: 68ch; }
.lisa-say b { font-weight: var(--weight-medium); }
.lisa-mark { width: 40px; height: 40px; border-radius: var(--radius-full); flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-9); color: var(--accent-contrast); }
.lisa-mark.is-sm { width: 28px; height: 28px; }
.lisa-mark svg { width: 20px; height: 20px; }
.lisa-mark.is-sm svg { width: 15px; height: 15px; }

/* ---- Proposal -------------------------------------------------------------
   Lisa proposes, the user approves. Every card carries what she noticed, what
   she wants to do, the record it came from, and an explicit action. A card
   with no action is not a proposal, it is a notification. */
.proposal { display: grid; grid-template-columns: 28px 1fr; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-4);
  background: var(--color-panel-solid); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.proposal.is-late { box-shadow: inset 0 0 0 1px var(--red-7); }
.proposal .pp-ic { width: 28px; height: 28px; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-3); color: var(--accent-11); }
.proposal .pp-ic svg { width: 15px; height: 15px; }
.proposal.is-late .pp-ic { background: var(--red-3); color: var(--red-11); }
.proposal .pp-what { font-size: var(--fs-3); font-weight: var(--weight-medium); color: var(--fg-high); display: block; }
.proposal .pp-why { display: block; margin-top: var(--space-1); font-size: var(--fs-2);
  color: var(--table-fg); line-height: var(--lh-2); max-width: 78ch; }
.proposal .pp-foot { display: flex; align-items: center; gap: var(--space-2);
  flex-wrap: wrap; margin-top: var(--space-3); }

/* the draft Lisa already wrote, folded down to a preview */
.pp-preview { margin-top: var(--space-3); padding: var(--space-3);
  border-radius: var(--radius-3); background: var(--gray-2);
  box-shadow: inset 0 0 0 1px var(--border-subtle); }
.pp-preview .ppv-head { display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--fs-1); color: var(--fg-low); margin-bottom: var(--space-2); }
.pp-preview .ppv-subject { font-size: var(--fs-2); font-weight: var(--weight-medium); color: var(--fg-high); }
.pp-preview .ppv-body { font-size: var(--fs-2); color: var(--fg-low); line-height: var(--lh-2);
  margin-top: 4px; max-width: 78ch; }

/* proposed time slots: pick one, nothing is booked until you do */
.slots { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.slot { display: inline-flex; flex-direction: column; gap: 2px; padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-3); background: var(--color-surface); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--border-ui); }
.slot:hover { box-shadow: inset 0 0 0 1px var(--border-strong); }
.slot.is-picked { background: var(--accent-3); box-shadow: inset 0 0 0 2px var(--accent-9); }
.slot .sl-day { font-size: var(--fs-1); color: var(--fg-low); }
.slot .sl-time { font-size: var(--fs-2); font-weight: var(--weight-medium); color: var(--fg-high); }

/* ---- Today's schedule ----------------------------------------------------- */
.sched { display: grid; gap: var(--space-2); }
.sched-item { display: grid; grid-template-columns: 52px 1fr auto; gap: var(--space-3);
  align-items: center; padding: var(--space-3); border-radius: var(--radius-3);
  background: var(--color-panel-solid); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.sched-item.is-next { box-shadow: inset 0 0 0 1px var(--accent-8); background: var(--accent-2); }
.sched-item .si-time { font-size: var(--fs-2); font-weight: var(--weight-medium);
  color: var(--fg-high); font-variant-numeric: tabular-nums; }
.sched-item .si-title { font-size: var(--fs-2); color: var(--fg-high); display: block; }
.sched-item .si-sub { font-size: var(--fs-1); color: var(--fg-low); display: block; margin-top: 2px; }

/* ---- Ask Lisa -------------------------------------------------------------
   An answer with no citation is a guess, so every answer carries its meetings. */
.chat { display: grid; gap: var(--space-4); }
.chat-msg { display: grid; grid-template-columns: 28px 1fr; gap: var(--space-3); }
.chat-msg.is-me { grid-template-columns: 1fr 28px; }
.chat-msg.is-me .chat-body { justify-self: end; background: var(--accent-3); }
.chat-msg.is-me .chat-av { order: 2; }
.chat-body { padding: var(--space-3) var(--space-4); border-radius: var(--radius-4);
  background: var(--gray-2); font-size: var(--fs-2); line-height: var(--lh-2);
  color: var(--fg-high); max-width: 74ch; }
.chat-body p + p { margin-top: var(--space-2); }
.chat-cites { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }
.chat-ask { display: flex; gap: var(--space-2); align-items: center;
  padding: var(--space-2); border-radius: var(--radius-4);
  background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--border-ui); }
.chat-ask .input { box-shadow: none; background: transparent; }
.chat-suggest { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ---- Draft and send ------------------------------------------------------- */
.draft-row { display: grid; grid-template-columns: 92px 1fr; gap: var(--space-3);
  align-items: start; padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
.draft-row:last-of-type { border-bottom: 0; }
.draft-row .dr-label { font-size: var(--fs-2); color: var(--fg-low); padding-top: 6px; }
.draft-body { font-size: var(--fs-2); line-height: var(--lh-3); color: var(--fg-high);
  white-space: pre-wrap; padding: var(--space-3); border-radius: var(--radius-3);
  background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--border-ui); min-height: 180px; }
.recipients { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

/* a stand-in backdrop, so the dialog can be reviewed inside the shell */
.modal-stage { padding: var(--space-6); border-radius: var(--radius-4); background: var(--gray-3);
  display: flex; justify-content: center; }
.modal-stage > .dialog { position: static; width: min(720px, 100%); }

/* ---- Learned preferences -------------------------------------------------- */
.pref-row { display: grid; grid-template-columns: 1fr auto; gap: var(--space-4);
  align-items: center; padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
.pref-row:last-child { border-bottom: 0; }
.pref-row .pf-what { font-size: var(--fs-2); color: var(--fg-high); display: block; }
.pref-row .pf-how { font-size: var(--fs-1); color: var(--fg-low); display: block; margin-top: 2px; }

/* ============================================================================
   COACH EXTENSIONS, PART 4
   Role play: the live level meter, the objectives checklist, the session
   transcript and the results rating. Token bound. Specs in components-coach.md.
   ============================================================================ */

/* ---- The live level meter -------------------------------------------------
   Five levels, Bad to Excellent. Colour carries valence, the number of filled
   segments carries degree, and the label is always present, so the level reads
   three ways and never depends on colour alone. Amber stays brand, so the
   positive end is green rather than the brand hue. */
.level { display: grid; gap: var(--space-2); }
.level-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.level-seg { height: 10px; border-radius: var(--radius-1); background: var(--gray-4); }
.level-head { display: flex; align-items: baseline; gap: var(--space-2); }
.level-name { font-size: var(--fs-5); font-weight: var(--weight-bold); letter-spacing: var(--ls-5); }
.level-why { font-size: var(--fs-1); color: var(--fg-low); }

.level.is-bad      .level-seg.on { background: var(--red-9); }
.level.is-bad      .level-name   { color: var(--red-11); }
.level.is-notbad   .level-seg.on { background: var(--orange-9); }
.level.is-notbad   .level-name   { color: var(--orange-11); }
.level.is-good     .level-seg.on { background: var(--green-9); }
.level.is-good     .level-name   { color: var(--green-11); }
.level.is-better   .level-seg.on { background: var(--green-9); }
.level.is-better   .level-name   { color: var(--green-11); }
.level.is-excellent .level-seg.on { background: var(--green-9); }
.level.is-excellent .level-name  { color: var(--green-11); }

.level.is-lg .level-seg { height: 16px; border-radius: var(--radius-2); }
.level.is-lg .level-name { font-size: var(--fs-7); letter-spacing: var(--ls-7); }
.level.is-sm .level-seg { height: 6px; }
.level.is-sm .level-name { font-size: var(--fs-3); }

/* how the meter moved across the session, so the rating can be reconciled
   against what the counselor actually saw while speaking */
.level-track { display: flex; gap: 2px; align-items: flex-end; height: 44px; }
.level-track i { flex: 1; border-radius: var(--radius-1) var(--radius-1) 0 0; background: var(--gray-5); }
.level-track i.l1 { height: 20%; background: var(--red-9); }
.level-track i.l2 { height: 40%; background: var(--orange-9); }
.level-track i.l3 { height: 60%; background: var(--green-8); }
.level-track i.l4 { height: 80%; background: var(--green-9); }
.level-track i.l5 { height: 100%; background: var(--green-10); }

/* ---- Objectives, ticking as they are met ---------------------------------- */
.objectives { display: grid; gap: var(--space-2); }
.objective { display: grid; grid-template-columns: 20px 1fr; gap: var(--space-2);
  align-items: start; font-size: var(--fs-2); color: var(--fg-low); }
.objective .ob-mark { width: 20px; height: 20px; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gray-3); color: var(--fg-subtle); }
.objective.is-met { color: var(--fg-high); }
.objective.is-met .ob-mark { background: var(--green-3); color: var(--green-11); }
.objective.is-part .ob-mark { background: var(--orange-3); color: var(--orange-11); }

/* ---- Session transcript ---------------------------------------------------- */
.turns { display: grid; gap: var(--space-3); }
.turn { display: grid; grid-template-columns: 28px 1fr; gap: var(--space-3); }
.turn .tn-body { padding: var(--space-3) var(--space-4); border-radius: var(--radius-4);
  background: var(--gray-2); font-size: var(--fs-2); line-height: var(--lh-2); color: var(--fg-high); max-width: 72ch; }
.turn.is-me .tn-body { background: var(--accent-3); }
.turn .tn-who { font-size: var(--fs-1); color: var(--fg-low); margin-bottom: 3px; display: block; }
.turn .tn-flag { display: inline-flex; align-items: center; gap: 4px; margin-top: var(--space-2);
  font-size: var(--fs-1); }
.turn .tn-flag.is-up { color: var(--success-text); }
.turn .tn-flag.is-down { color: var(--danger-text); }

/* live mic state, so the counselor knows it is listening */
.mic { display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-full);
  background: var(--red-3); color: var(--red-11); font-size: var(--fs-1); font-weight: var(--weight-medium); }
.mic .mic-dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--red-9); }
@media (prefers-reduced-motion: no-preference) {
  .mic .mic-dot { animation: micpulse 1.6s ease-in-out infinite; }
  @keyframes micpulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
}

/* ---- Results --------------------------------------------------------------- */
.rating { display: flex; align-items: baseline; gap: var(--space-2); }
.rating .rt-score { font-size: var(--fs-9); font-weight: var(--weight-bold);
  letter-spacing: var(--ls-9); line-height: 1; color: var(--fg-high); }
.rating .rt-of { font-size: var(--fs-4); color: var(--fg-low); }
.rating-dots { display: flex; gap: 5px; }
.rating-dots i { width: 13px; height: 13px; border-radius: var(--radius-full); background: var(--gray-5); }
.rating-dots i.on { background: var(--green-9); }

.crit-result { display: grid; grid-template-columns: 22px 1fr auto; gap: var(--space-3);
  align-items: start; padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
.crit-result:last-child { border-bottom: 0; }
.crit-result .cr-mark { width: 22px; height: 22px; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center; }
.crit-result.is-met .cr-mark { background: var(--green-3); color: var(--green-11); }
.crit-result.is-part .cr-mark { background: var(--orange-3); color: var(--orange-11); }
.crit-result.is-miss .cr-mark { background: var(--red-3); color: var(--red-11); }
.crit-result .cr-name { font-size: var(--fs-2); color: var(--fg-high); display: block; }
.crit-result .cr-note { font-size: var(--fs-1); color: var(--fg-low); display: block; margin-top: 2px; max-width: 82ch; }

/* ---- Stage picker ---------------------------------------------------------- */
.stage-card .sg-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.stage-card .sg-n { font-size: var(--fs-1); color: var(--fg-subtle); font-family: var(--font-mono); }
.stage-card .sg-what { display: block; margin-top: var(--space-2); font-size: var(--fs-1);
  color: var(--fg-low); line-height: var(--lh-1); }
.stage-card .sg-last { display: flex; align-items: center; gap: var(--space-2);
  margin-top: var(--space-3); font-size: var(--fs-1); color: var(--fg-low); }

/* ---- .list-item on a button -----------------------------------------------
   The base rule assumes a div or an anchor, so a <button class="list-item">
   keeps the user agent's grey fill and border and the menu reads as broken.
   A menu row is actionable, so it should be a button; reset the chrome here
   rather than downgrading the markup. */
button.list-item {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  font-family: var(--font-base);
  font-size: var(--fs-2);
}
button.list-item:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }

/* the selected row needs to read as selected without a check glyph */
.list-item.is-selected { background: var(--accent-3); color: var(--accent-11); }
.list-item.is-selected:hover { background: var(--accent-9); color: var(--accent-contrast); }

/* a menu row carrying an avatar plus a stacked name and caption */
.list-item .li-stack { display: flex; flex-direction: column; line-height: var(--lh-1); }
.list-item .li-sub { font-size: var(--fs-1); color: var(--fg-low); }
.list-item:hover .li-sub { color: var(--accent-contrast); opacity: .8; }
.list-item.is-selected .li-sub { color: var(--accent-11); opacity: .8; }

/* ---- Read-only dropdown ---------------------------------------------------
   Keeps the field shape of a dropdown for a value that is derived rather than
   chosen. Styled as disabled on purpose: sunken fill, low-contrast text, no
   hover and no pointer. A control that looks live but does nothing reads as
   broken, so the affordance is deliberately withdrawn while the shape stays. */
.dropdown.is-readonly {
  background: var(--gray-2);
  box-shadow: inset 0 0 0 1px var(--border-subtle);
  color: var(--fg-low);
  cursor: default;
}
.dropdown.is-readonly:hover { background: var(--gray-2); }
.dropdown.is-readonly .dropdown-chevron { color: var(--fg-disabled); }
