/* Quendar design system. DESIGN.md is the contract; these tokens implement it. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-weight: 500;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-500.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-weight: 600;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-600.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-weight: 700;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-700.woff2") format("woff2");
}
@font-face {
  font-family: "Roboto Mono";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/roboto-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "Roboto Mono";
  font-weight: 500;
  font-display: swap;
  src: url("fonts/roboto-mono-500.woff2") format("woff2");
}

:root {
  --motion-fast: 120ms;
  --motion-base: 200ms;
  --motion-page: 280ms;
  --motion-spin: 700ms;
  --motion-highlight: 1200ms;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --press: 0.97;
  --lift: -1px;
  --page-offset: 24px;
  --page-direction: 1;
  --row-offset: -6px;
  --rail-collapsed: 68px;
  --rail-expanded: 230px;
  --rail-travel: calc(var(--rail-collapsed) - var(--rail-expanded));
  --ground: #E9EBF5;
  --glow-1: radial-gradient(880px 600px at 6% -10%, #C9C4FA, transparent);
  --glow-2: radial-gradient(720px 520px at 98% 6%, #BFE0F2, transparent);
  --glow-3: radial-gradient(820px 640px at 74% 110%, #F6D7C6, transparent);
  --panel: rgba(255, 255, 255, 0.70);
  --panel-quiet: rgba(255, 255, 255, 0.66);
  --panel-edge: rgba(255, 255, 255, 0.90);
  --panel-shadow: 0 8px 28px rgba(52, 44, 110, 0.10);
  --panel-solid: #F4F5FA;
  --hairline: rgba(25, 27, 42, 0.09);
  --text: #191B2A;
  --text-2: #3C4257;
  --text-3: #5C6379;
  --text-4: #6C7489;
  --accent: #6B5BF0;
  --accent-text: #4232C6;
  --accent-bg: rgba(107, 91, 240, 0.14);
  --accent-panel: linear-gradient(150deg, #5B4BE0, #3A2BB0);
  --logo-ring: #1E1B3A;
  --logo-bars: #4F3FD8;
  --on-accent: #FFFFFF;
  --on-accent-2: #E4E0FF;
  --button-bg: #4232C6;
  --button-text: #FFFFFF;
  --warm: #F0A050;
  --warm-deep: #D97524;
  --on-warm: #2B1704;
  --focus: #4232C6;
  --interested-dot: #0E7A50; --interested-text: #0E7A50;
  --callback-dot: #C97E14; --callback-text: #9A5B0C;
  --progress-dot: #6B5BF0; --progress-text: #4232C6;
  --none-dot: transparent; --none-text: #4A5064;
  --unreachable-dot: #9AA1B4; --unreachable-text: #5C6379;
  --dnc-dot: #C33A3A; --dnc-text: #B02F2F;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #08090F;
    --glow-1: radial-gradient(900px 620px at 8% -8%, #2A2060, transparent);
    --glow-2: radial-gradient(760px 520px at 96% 10%, #16384F, transparent);
    --glow-3: radial-gradient(820px 620px at 72% 108%, #3A2142, transparent);
    --panel: rgba(255, 255, 255, 0.05);
    --panel-quiet: rgba(255, 255, 255, 0.045);
    --panel-edge: rgba(255, 255, 255, 0.09);
    --panel-shadow: none;
    --panel-solid: #10121B;
    --hairline: rgba(255, 255, 255, 0.07);
    --text: #EAECF5;
    --text-2: #B9BFD2;
    --text-3: #A3A9BC;
    --text-4: #7F869E;
    --accent: #7C6CF5;
    --accent-text: #A99DFF;
    --accent-bg: rgba(124, 108, 245, 0.22);
    --accent-panel: linear-gradient(150deg, rgba(124, 108, 245, 0.26), rgba(124, 108, 245, 0.08));
    --logo-ring: #ECEAF7;
    --logo-bars: #8B7CF6;
    --on-accent: #FFFFFF;
    --on-accent-2: #C4BCFF;
    --button-bg: rgba(124, 108, 245, 0.22);
    --button-text: #C4BCFF;
    --warm: #F5A33C;
    --warm-deep: #D9762B;
    --on-warm: #241306;
    --focus: #A79BFF;
    --interested-dot: #3FCF8E; --interested-text: #3FCF8E;
    --callback-dot: #F5A33C; --callback-text: #F5A33C;
    --progress-dot: #7C6CF5; --progress-text: #C4BCFF;
    --none-dot: transparent; --none-text: #B4BACC;
    --unreachable-dot: #5A6175; --unreachable-text: #A3A9BC;
    --dnc-dot: #F06A6A; --dnc-text: #FF8A8A;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ground: #08090F;
  --glow-1: radial-gradient(900px 620px at 8% -8%, #2A2060, transparent);
  --glow-2: radial-gradient(760px 520px at 96% 10%, #16384F, transparent);
  --glow-3: radial-gradient(820px 620px at 72% 108%, #3A2142, transparent);
  --panel: rgba(255, 255, 255, 0.05);
  --panel-quiet: rgba(255, 255, 255, 0.045);
  --panel-edge: rgba(255, 255, 255, 0.09);
  --panel-shadow: none;
  --panel-solid: #10121B;
  --hairline: rgba(255, 255, 255, 0.07);
  --text: #EAECF5;
  --text-2: #B9BFD2;
  --text-3: #A3A9BC;
  --text-4: #7F869E;
  --accent: #7C6CF5;
  --accent-text: #A99DFF;
  --accent-bg: rgba(124, 108, 245, 0.22);
  --accent-panel: linear-gradient(150deg, rgba(124, 108, 245, 0.26), rgba(124, 108, 245, 0.08));
  --logo-ring: #ECEAF7;
  --logo-bars: #8B7CF6;
  --on-accent: #FFFFFF;
  --on-accent-2: #C4BCFF;
  --button-bg: rgba(124, 108, 245, 0.22);
  --button-text: #C4BCFF;
  --warm: #F5A33C;
  --warm-deep: #D9762B;
  --on-warm: #241306;
  --focus: #A79BFF;
  --interested-dot: #3FCF8E; --interested-text: #3FCF8E;
  --callback-dot: #F5A33C; --callback-text: #F5A33C;
  --progress-dot: #7C6CF5; --progress-text: #C4BCFF;
  --none-dot: transparent; --none-text: #B4BACC;
  --unreachable-dot: #5A6175; --unreachable-text: #A3A9BC;
  --dnc-dot: #F06A6A; --dnc-text: #FF8A8A;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--text);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

/* The ground: large, soft glows under everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--glow-1), var(--glow-2), var(--glow-3), var(--ground);
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }

h1 { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
h3 { font-size: 15px; font-weight: 600; }

p { max-width: 70ch; }

a { color: var(--accent-text); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.mono {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.muted { color: var(--text-2); }
.label { color: var(--text-3); font-size: 13px; }
.meta { color: var(--text-3); font-size: 12px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--panel-shadow);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  min-width: 0;
}

.panel-quiet { background: var(--panel-quiet); }

.panel-accent {
  background: var(--accent-panel);
  color: var(--on-accent);
}

.panel-accent .kpi-label,
.panel-accent .kpi-sub { color: var(--on-accent-2); }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-tight { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.between { justify-content: space-between; }

/* Shell */
.shell {
  display: grid;
  grid-template-columns: var(--rail-collapsed) minmax(0, 1fr);
  min-height: 100dvh;
  overflow-x: clip;
}

.shell.rail-open { grid-template-columns: var(--rail-expanded) minmax(0, 1fr); }

.rail {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 11px;
  view-transition-name: rail;
}

/* Labels may not sit on the ground, so the open rail stands on a panel. It has no blur: it
   moves, and a moving backdrop-filter is what this system forbids. */
.rail::before,
.rail::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: -1;
  transition: transform var(--motion-base) var(--ease-out), opacity var(--motion-base) var(--ease-out);
}

.rail::before {
  left: 0;
  width: var(--rail-expanded);
  background: var(--panel);
  opacity: 0;
  transform: translateX(var(--rail-travel));
}

.rail::after {
  left: calc(var(--rail-expanded) - 1px);
  width: 1px;
  background: var(--hairline);
  transform: translateX(var(--rail-travel));
}

.rail-open .rail::before { opacity: 1; transform: none; }
.rail-open .rail::after { transform: none; }

.rail-link {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 46px;
  min-height: 46px;
  padding: 0 0 0 12px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--text-3);
  text-decoration: none;
}

.rail-link:hover:not(:disabled) { background: var(--hairline); color: var(--text); }
.rail-link[aria-current="page"],
.rail-link[aria-current="page"]:hover { background: transparent; color: var(--accent-text); }
.rail-link svg { width: 22px; height: 22px; flex: none; }

/* The active fill. It travels between the entries; its size follows at once. */
.rail-marker {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 13px;
  background: var(--accent-bg);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--motion-page) var(--ease-out), opacity var(--motion-fast) var(--ease-out);
}
.rail-marker.placed { opacity: 1; }
.rail-marker.instant { transition: none; }

/* The ring is centred at 56 of 120, so 8px puts it on the axis of the rail icons
   and leaves the tail to reach towards the label. */
.rail-home { margin-bottom: 8px; padding-left: 8px; }
.rail-home .logo { width: 32px; height: 32px; }
.rail-home .rail-label { color: var(--logo-ring); font-size: 15px; }

.logo-ring { stroke: var(--logo-ring); stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }
.logo-bars { stroke: var(--logo-bars); stroke-width: 8; stroke-linecap: round; }

/* One label for every state: faded in beside the icon when open, a tooltip when collapsed.
   It is real text either way, and names the link for assistive technology. */
.rail-label {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 46px;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-base) var(--ease-out);
}

.rail-short { display: none; }
.rail-open .rail-label { opacity: 1; }

.shell:not(.rail-open):not(.sliding) .rail-label {
  top: 7px;
  bottom: 7px;
  left: 60px;
  padding: 0 10px;
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  background: var(--panel-solid);
  box-shadow: var(--panel-shadow);
  color: var(--text);
  transition-duration: var(--motion-fast);
}

.shell:not(.rail-open):not(.sliding) .rail-link:hover .rail-label,
.shell:not(.rail-open):not(.sliding) .rail-link:focus-visible .rail-label { opacity: 1; }

.rail-toggle { margin-top: auto; }
.rail-toggle svg { transition: transform var(--motion-base) var(--ease-out); }
.rail-open .rail-toggle svg { transform: rotate(180deg); }

/* The content passes over the fading labels on its way. */
.shell.sliding .rail { z-index: 0; }
.shell.sliding .content {
  position: relative;
  z-index: 1;
  animation: rail-push var(--motion-base) var(--ease-out);
}

@keyframes rail-push {
  from { transform: translateX(var(--rail-push)); }
}

.content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  view-transition-name: content;
}

.stage { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 24px 0;
}

.user-menu { position: relative; }

.user-button {
  position: relative;
  width: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--panel);
  color: var(--text-2);
}

.user-button svg { width: 20px; height: 20px; }
.user-button[aria-expanded="true"],
.user-button[aria-current="page"],
.user-button[aria-current="page"]:hover:not(:disabled) { background: var(--accent-bg); color: var(--accent-text); }

.user-label {
  position: absolute;
  top: 7px;
  bottom: 7px;
  right: 52px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  background: var(--panel-solid);
  box-shadow: var(--panel-shadow);
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-fast) var(--ease-out);
}

.user-button:hover .user-label,
.user-button:focus-visible .user-label { opacity: 1; }
.user-button[aria-expanded="true"] .user-label { opacity: 0; }

.user-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--panel-solid);
  animation: fade-in var(--motion-fast) var(--ease-out);
}

.user-panel[hidden] { display: none; }
.user-name { font-weight: 600; overflow-wrap: anywhere; }
.user-email { margin-top: -8px; font-size: 13px; overflow-wrap: anywhere; }

.page-head h1 { margin-bottom: 2px; }
.page-head > div:first-child { min-width: 0; overflow-wrap: anywhere; }

/* Controls */
button, .button {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--panel-edge);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

button:hover:not(:disabled), .button:hover { background: var(--hairline); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

/* The label stays in place, only unseen, so the button keeps its width. */
button.is-loading {
  position: relative;
  opacity: 1;
  cursor: progress;
  -webkit-text-fill-color: transparent;
}

.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 16px;
  height: 16px;
  margin: auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin var(--motion-spin) linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.primary {
  background: var(--button-bg);
  color: var(--button-text);
  border-color: transparent;
}

.primary:hover:not(:disabled) { background: var(--button-bg); filter: brightness(1.12); }

.danger { color: var(--dnc-text); }

label { display: flex; flex-direction: column; gap: 4px; color: var(--text-2); font-size: 13px; }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-size: 14px; }

input, select, textarea {
  font: inherit;
  font-size: 16px;
  min-height: 44px;
  width: 100%;
  padding: 9px 13px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: var(--panel);
  color: var(--text);
}

textarea { min-height: 88px; resize: vertical; }

.field { display: flex; flex-direction: column; gap: 4px; }

.password-input { position: relative; }
.password-input input { padding-right: 76px; }
.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 68px;
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--text-2);
  font-size: 14px;
}

/* A closed dropdown that opens onto a field of its own. */
.reveal summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  list-style: none;
}
.reveal summary::-webkit-details-marker { display: none; }
.reveal summary svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--text-3);
  transition: transform var(--motion-fast) var(--ease-out);
}
.reveal[open] summary svg { transform: rotate(180deg); }
.reveal[open] summary { margin-bottom: 10px; }

select option { background: var(--panel-solid); color: var(--text); }

input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 1px 0 0;
  flex: none;
}

form { display: flex; flex-direction: column; gap: 10px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.notice { color: var(--text-2); font-size: 14px; }
.error { color: var(--dnc-text); font-size: 14px; }
.warning {
  border-left: 3px solid var(--warm);
  padding-left: 12px;
  color: var(--text-2);
  font-size: 14px;
}

/* KPI row: four genuinely parallel figures. */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kpi-label { color: var(--text-3); font-size: 13px; }
.kpi-value { font-size: 30px; font-weight: 500; line-height: 1.25; }
.kpi-sub { color: var(--text-3); font-size: 12px; }

/* Call list beside a narrower column: panels are not all the same size. */
.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.calls { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; }
.calls th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--text-3);
  padding: 0 10px 8px;
}
.calls td {
  padding: 11px 10px;
  border-top: 1px solid var(--hairline);
  vertical-align: middle;
}
.calls .number, .calls .when { color: var(--text-2); }
.calls tr.active td { background: var(--accent-bg); }
.calls tr.active td:first-child { border-radius: 12px 0 0 12px; }
.calls tr.active td:last-child { border-radius: 0 12px 12px 0; }

.calls tbody tr:hover td { background: var(--hairline); }
.calls tbody tr.active:hover td { background: var(--accent-bg); }

@keyframes row-in {
  from { opacity: 0; transform: translateY(var(--row-offset)); }
}
@keyframes fade-in {
  from { opacity: 0; }
}
@keyframes fade-out {
  to { opacity: 0; }
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(calc(var(--page-offset) * var(--page-direction))); }
}
@keyframes page-out {
  to { opacity: 0; transform: translateY(calc(var(--page-offset) * var(--page-direction) * -1)); }
}
@keyframes pulse {
  from { opacity: 0.35; }
}

.calls tr.new { animation: row-in var(--motion-base) var(--ease-out); }

/* A status change flashes on a layer of its own: only opacity runs, never the background. */
.calls tr.changed td { position: relative; }
.calls tr.changed td::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-bg);
  opacity: 0;
  pointer-events: none;
  animation: flash var(--motion-highlight) var(--ease-in-out);
}
@keyframes flash {
  from { opacity: 1; }
}

.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; white-space: nowrap; }
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot);
}
.s-interested { --dot: var(--interested-dot); color: var(--interested-text); }
.s-callback { --dot: var(--callback-dot); color: var(--callback-text); }
.s-progress { --dot: var(--progress-dot); color: var(--progress-text); }
.s-none { --dot: var(--none-dot); color: var(--none-text); }
.s-unreachable { --dot: var(--unreachable-dot); color: var(--unreachable-text); }
.s-dnc { --dot: var(--dnc-dot); color: var(--dnc-text); }

.bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--hairline);
}
.bar span { display: block; min-width: 2px; }
.seg-interested { background: var(--interested-dot); }
.seg-callback { background: var(--warm); }
.seg-reached { background: var(--accent); }
.seg-none { background: var(--text-4); }
.seg-unreachable { background: var(--unreachable-dot); }
.seg-dnc { background: var(--dnc-dot); }

.progress { height: 8px; border-radius: 999px; background: var(--hairline); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.legend { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.legend li { display: flex; justify-content: space-between; gap: 10px; }

.list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--hairline);
}
.list > li:first-child { border-top: 0; }
.list-title { font-weight: 600; }

.tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.tabs button[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent-text); }

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--warm), var(--warm-deep));
  color: var(--on-warm);
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: none;
}

/* Triage */
.triage { max-width: 560px; margin: 0 auto; width: 100%; }
.triage-card {
  touch-action: pan-y;
  text-align: center;
  padding: 34px 20px;
  transition: transform var(--motion-base) var(--ease-out);
}
.triage-card .avatar { width: 64px; height: 64px; font-size: 23px; margin: 0 auto 12px; }
.triage-name { font-size: 23px; font-weight: 600; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.triage-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.triage-actions button { min-height: 56px; flex-direction: column; gap: 0; }
.key { font-size: 12px; font-weight: 400; opacity: 0.8; }


.diff { font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff .add { color: var(--interested-text); }
.diff .del { color: var(--dnc-text); }

.pin { font-size: 30px; font-weight: 500; }

.qa-row { display: grid; gap: 10px; padding: 10px 0; border-top: 1px solid var(--hairline); }

.auth { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.auth .panel { width: 100%; max-width: 440px; }

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  max-width: min(420px, calc(100vw - 32px));
  background: var(--panel-solid);
  animation: row-in var(--motion-base) var(--ease-out);
}

@media (max-width: 1040px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .shell { display: block; }
  .content { padding: 12px 12px 92px; gap: 12px; }
  .topbar { padding: 12px 12px 0; }
  .stack { gap: 12px; }
  .kpis, .board { gap: 12px; }
  .panel { padding: 15px 16px; }
  h1 { font-size: 23px; }
  .kpi-value { font-size: 27px; }

  .rail {
    position: fixed;
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    height: auto;
    z-index: 4;
    flex-direction: row;
    gap: 0;
    padding: 4px;
    border: 1px solid var(--panel-edge);
    border-radius: 14px;
    background: var(--panel-solid);
    box-shadow: var(--panel-shadow);
  }
  .rail::before, .rail::after, .rail-home, .rail-toggle, .rail-label { display: none; }
  .rail-link {
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    width: auto;
    min-width: 44px;
    height: 50px;
    padding: 0;
  }
  .rail-link svg { width: 20px; height: 20px; }
  .rail-short { display: block; font-size: 12px; font-weight: 500; line-height: 1; }

  .toast { bottom: 84px; }
}

/* The table answers to its own panel, not the viewport: the rail changes the room it has. */
.panel:has(> .calls) { container: calls / inline-size; }

@container calls (max-width: 640px) {
  .calls .optional { display: none; }
}

@container calls (max-width: 500px) {
  /* One row per call: name and outcome, then number and time in mono. */
  .calls thead { display: none; }
  .calls, .calls tbody { display: block; }
  .calls tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 10px;
    padding: 10px 8px;
    border-top: 1px solid var(--hairline);
  }
  .calls tbody tr:first-child { border-top: 0; }
  .calls td { display: block; padding: 0; border: 0; min-width: 0; }
  .calls tr.active { background: var(--accent-bg); border-radius: 12px; }
  .calls tr.active td,
  .calls tbody tr:hover td,
  .calls tbody tr.active:hover td { background: none; }
  .calls tbody tr:not(.active):hover { background: var(--hairline); border-radius: 12px; }
  .calls .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
  .calls .outcome { text-align: right; }
  .calls .when { text-align: right; }
  .calls .number, .calls .when { font-size: 13px; }
  .calls .optional { display: none; }
}

/* Labels. The colour is the customer's own filing, in a dot; the name stays in a text colour. */
.label-violet { --label: #8B7CF6; }
.label-blue { --label: #4C93E8; }
.label-teal { --label: #2FB5AE; }
.label-green { --label: #4DB56A; }
.label-yellow { --label: #E3BC2D; }
.label-orange { --label: #EC8A36; }
.label-red { --label: #E25C5C; }
.label-pink { --label: #E06AB2; }
.label-grey { --label: #8D94A8; }
.label-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--label); flex: none; }
.label-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 3px 10px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.label-toggle { padding: 4px 6px; }
.label-toggle[aria-pressed="true"] { background: var(--accent-bg); }

.contact-filters { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
.contact-row { flex-wrap: nowrap; justify-content: flex-start; }
.contact-who { min-width: 0; flex: 0 1 240px; }
.contact-who p { overflow-wrap: anywhere; }
.contact-labels { display: flex; flex: 1; flex-wrap: wrap; gap: 6px; min-width: 0; }
.bulk-bar { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.bulk-bar .select-box { width: auto; flex: 1 1 160px; }
.passage { font-size: 16px; line-height: 1.6; max-width: 70ch; padding: 12px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }

@media (max-width: 720px) {
  .contact-filters { grid-template-columns: 1fr 1fr; }
  .contact-filters input { grid-column: 1 / -1; }
  .contact-row { flex-wrap: wrap; }
  .contact-who { flex: 1 1 calc(100% - 40px); }
  .contact-labels { flex-basis: 100%; }
}

/* The portal's own controls. Nothing the browser draws is left showing. */
input[type="checkbox"] {
  appearance: none;
  display: inline-grid;
  place-content: center;
  padding: 0;
  border: 1px solid var(--text-3);
  border-radius: 7px;
  background: var(--panel);
  cursor: pointer;
  position: relative;
}
/* The fill grows from the centre and the tick lands on it. Colour itself never animates. */
input[type="checkbox"]::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 7px;
  background: var(--button-bg);
  opacity: 0;
  transform: scale(0.4);
  transition: transform var(--motion-base) var(--ease-out), opacity var(--motion-fast) var(--ease-out);
}
input[type="checkbox"]::after {
  content: "";
  position: relative;
  width: 11px;
  height: 6px;
  margin-top: -3px;
  border-left: 2px solid var(--button-text);
  border-bottom: 2px solid var(--button-text);
  opacity: 0;
  transform: rotate(-45deg) scale(0.3);
  transition: transform var(--motion-base) var(--ease-out), opacity var(--motion-fast) var(--ease-out);
}
input[type="checkbox"]:checked { border-color: var(--accent); }
input[type="checkbox"]:checked::before { opacity: 1; transform: scale(1); }
input[type="checkbox"]:checked::after { opacity: 1; transform: rotate(-45deg) scale(1); }

input[type="number"] { appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { appearance: none; margin: 0; }
input[type="search"]::-webkit-search-cancel-button { appearance: none; }
input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 100px var(--panel-solid) inset;
  caret-color: var(--text);
}

.select-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}
.select-box svg { width: 18px; height: 18px; flex: none; color: var(--text-3); }
.select-text { flex: 1; min-width: 0; min-height: 1.3em; overflow-wrap: anywhere; }
.select-empty { color: var(--text-3); }

.popover {
  position: fixed;
  z-index: 40;
  max-width: calc(100vw - 16px);
  overflow-y: auto;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--panel-solid);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}
.select-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 9px 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 400;
  text-align: left;
}
.select-option:hover, .select-option:focus-visible { background: var(--hairline); }
.select-option:focus-visible { outline-offset: -2px; }
.select-option[aria-selected="true"] { background: var(--accent-bg); color: var(--accent-text); }

.calendar { display: flex; flex-direction: column; gap: 8px; padding: 10px; width: 330px; max-width: 100%; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.calendar-head svg { width: 18px; height: 18px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.weekday { padding: 4px 0; color: var(--text-3); font-size: 12px; text-align: center; }
.day {
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: "Roboto Mono", monospace;
  font-size: 14px;
  font-weight: 400;
}
.day:hover { background: var(--hairline); }
.day[aria-current="date"] { color: var(--accent-text); font-weight: 500; }
.day[aria-pressed="true"] { background: var(--button-bg); color: var(--button-text); }

.file-box { position: relative; }
.file-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-name { overflow-wrap: anywhere; font-size: 14px; }
.file-box:focus-within .button { outline: 2px solid var(--focus); outline-offset: 2px; }

.clock {
  margin-right: auto;
  align-self: center;
  padding: 7px 12px;
  border: 1px solid var(--panel-edge);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-2);
  font-size: 13px;
  letter-spacing: -0.03em;
}

.page-head .select-box { min-width: 190px; }

/* Calls over time. The plot fades nothing and moves nothing: a poll just redraws it. */
.chart {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 8px;
}
.chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  height: 120px;
  font-size: 12px;
  color: var(--text-3);
}
.chart-y span { line-height: 0; }
.chart-plot {
  position: relative;
  display: flex;
  height: 120px;
  border-bottom: 1px solid var(--hairline);
}
.chart-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--hairline);
}
.chart-slot {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 1px;
}
.chart-slot:hover { background: var(--hairline); }
.chart-bar {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  width: 100%;
  max-width: 24px;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
}
.chart-bar span { flex-basis: 0; min-height: 1px; }
.chart-tip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  z-index: 2;
  min-width: 150px;
  padding: 8px 10px;
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  background: var(--panel-solid);
  box-shadow: var(--panel-shadow);
  color: var(--text-2);
  font-size: 12px;
  transform: translateX(-50%);
  pointer-events: none;
}
.chart-tip strong { display: block; margin-bottom: 4px; color: var(--text); }
.chart-tip-row { display: flex; justify-content: space-between; gap: 16px; }
.chart-tip.tip-start { left: 0; transform: none; }
.chart-tip.tip-end { left: auto; right: 0; transform: none; }
.chart-slot:hover .chart-tip { display: block; }
.chart-x { grid-column: 2; display: flex; height: 16px; }
.chart-tick { position: relative; flex: 1 1 0; min-width: 0; }
.chart-tick span {
  position: absolute;
  left: 50%;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  transform: translateX(-50%);
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--text-2);
}
.chart-legend li { display: flex; align-items: center; gap: 6px; }
.chart-key { width: 10px; height: 10px; border-radius: 3px; }

.range-box, .filters { display: flex; flex-wrap: wrap; gap: 10px; }
.range-box > .select-box, .filters > .select-box { width: auto; flex: 0 1 220px; }
.range-dates { display: flex; flex: 1 1 320px; gap: 10px; }
.range-dates[hidden] { display: none; }
.range-dates .select-box { flex: 1; min-width: 0; }

[hidden] { display: none !important; }
.follow-up-note { display: block; margin-top: 2px; }

dialog.modal.modal-wide { width: min(680px, calc(100vw - 24px)); }
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-underline-offset: 3px;
}
.link-button:hover:not(:disabled) { background: none; text-decoration-color: currentColor; }
.call-now { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }

.creating { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 32px 0; }
.creating-bars { display: flex; align-items: center; gap: 7px; height: 56px; }
.creating-bars span {
  width: 7px;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  animation: voice-bar var(--motion-spin) var(--ease-in-out) infinite alternate;
}
.creating-bars span:nth-child(2) { animation-delay: calc(var(--motion-spin) * 0.2); }
.creating-bars span:nth-child(3) { animation-delay: calc(var(--motion-spin) * 0.4); }
.creating-bars span:nth-child(4) { animation-delay: calc(var(--motion-spin) * 0.6); }
.creating-bars span:nth-child(5) { animation-delay: calc(var(--motion-spin) * 0.8); }
@keyframes voice-bar {
  from { transform: scaleY(0.3); }
  to { transform: scaleY(1); }
}
.creating-phase { color: var(--text-2); }

.with-icon { display: inline-flex; align-items: center; gap: 7px; }
.with-icon svg { width: 18px; height: 18px; }

dialog.modal {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 20px;
  overflow-y: auto;
  border: 1px solid var(--panel-edge);
  border-radius: 18px;
  background: var(--panel-solid);
  color: var(--text);
}
dialog.modal::backdrop { background: rgba(8, 9, 15, 0.55); }
dialog.modal[open] { display: flex; flex-direction: column; gap: 12px; animation: modal-in var(--motion-base) var(--ease-out); }
@keyframes modal-in {
  from { opacity: 0; }
}
.modal-close { width: 44px; padding: 0; justify-content: center; }
.modal-close[hidden] { display: none; }
.modal-close svg { width: 18px; height: 18px; }

.label-form { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.label-form:not(:has(> :nth-child(4))) { grid-template-columns: auto minmax(0, 1fr) auto; }
.color-box { width: auto; padding-inline: 11px; }
.color-box .select-text { display: none; }
.label-dot { flex: none; }

@media (max-width: 720px) {
  dialog.modal { padding: 15px; }
  .label-form { grid-template-columns: auto minmax(0, 1fr); }
  .label-form:not(:has(> :nth-child(4))) { grid-template-columns: auto minmax(0, 1fr); }
  .label-form button[type] { grid-column: span 1; }
  .label-form .select-box { grid-column: 1; }
}

/* Hover and press, on everything that takes them. Colour changes are instant: only transform
   and opacity ever run. */
button, .button, .rail-link, a, input[type="checkbox"] {
  transition: transform var(--motion-fast) var(--ease-out);
}

a:not(.button):not(.rail-link) { display: inline-block; }
a:not(.button):not(.rail-link):hover { text-decoration-thickness: 2px; }

@media (prefers-reduced-motion: no-preference) {
  @media (hover: hover) {
    button:hover:not(:disabled), .button:hover { transform: translateY(var(--lift)); }
    .rail-link:hover:not(:disabled) { transform: none; }
  }
  button:active:not(:disabled), .button:active, .rail-link:active:not(:disabled), a:active,
  input[type="checkbox"]:active:not(:disabled) {
    transform: scale(var(--press));
  }
}

/* Page transitions. The sidebar is left out, and clicks pass through while one runs. */
::view-transition { pointer-events: none; }
::view-transition-group(root),
::view-transition-group(rail),
::view-transition-group(content) { animation: none; }
::view-transition-old(root),
::view-transition-old(rail) { display: none; }
::view-transition-new(root),
::view-transition-new(rail) { animation: none; }
::view-transition-old(content) { animation: page-out var(--motion-fast) var(--ease-out) both; }
::view-transition-new(content) { animation: page-in var(--motion-page) var(--ease-out) both; }
.content.page-enter { animation: page-in var(--motion-page) var(--ease-out); }

/* Opacity at most: nothing slides, lifts, presses or spins. */
@media (prefers-reduced-motion: reduce) {
  .creating-bars span { animation-name: pulse; }
  input[type="checkbox"]::before { transform: none; transition: opacity var(--motion-fast) ease; }
  input[type="checkbox"]::after {
    transform: rotate(-45deg);
    transition: opacity var(--motion-fast) ease;
  }
  input[type="checkbox"]:checked::before { transform: none; }
  input[type="checkbox"]:checked::after { transform: rotate(-45deg); }
  .rail::before, .rail::after, .rail-toggle svg, .triage-card { transition: none; }
  .shell.sliding .content { animation: none; }
  .calls tr.new, .toast { animation-name: fade-in; }
  .rail-marker { transition: none; }
  ::view-transition-old(content) { animation-name: fade-out; }
  ::view-transition-new(content), .content.page-enter { animation-name: fade-in; }
  .is-loading::after {
    border-right-color: currentColor;
    animation: pulse var(--motion-spin) ease-in-out infinite alternate;
  }
}

/* Why nothing is being called, above every page, and the links every page carries. */
.account-notice:empty { display: none; }
.account-notice { display: grid; gap: 8px; margin-bottom: 16px; }
.legal-footer { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; padding: 24px 16px; font-size: 13px; }
.legal-footer a { color: var(--text-2); }
.auth { grid-template-rows: 1fr auto; }
.legal.auth { display: block; padding: 16px; }
.legal main { max-width: 720px; margin: 0 auto; }
.legal .todo { color: var(--dnc-text); font-weight: 600; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
