/* ==========================================================================
   Insider Studios — UGC Dashboard design system
   Brand tokens extracted live from insiderstudios.com.au (PLAN.md §6).
   Rule of the house: brand sets the feel, data colours set the meaning.
   ========================================================================== */

:root {
  /* Brand */
  --ink: #231F20;
  --paper: #FAFAFA;
  --pink: #EA90B5;
  --teal: #56B099;
  --orange: #EF4623;
  --yellow: #FEBB12;
  --sky: #A3C5E8;

  /* Ink ramp — everything grey is ink at opacity, so greys never go cold */
  --ink-90: rgba(35, 31, 32, .90);
  --ink-70: rgba(35, 31, 32, .70);
  --ink-55: rgba(35, 31, 32, .55);
  --ink-40: rgba(35, 31, 32, .40);
  --ink-20: rgba(35, 31, 32, .20);
  --ink-12: rgba(35, 31, 32, .12);
  --ink-08: rgba(35, 31, 32, .08);
  --ink-05: rgba(35, 31, 32, .05);

  /* Data colours (semantic — do not swap for brand colours) */
  --c-cleared: #56B099;
  --c-inpost: #9BD4C3;
  --c-inprogress: #FEBB12;
  --c-stuck: #EF4623;

  /* Accessible text variants of the data colours on white */
  --c-cleared-ink: #2E7A64;
  --c-inpost-ink: #4E927E;
  --c-inprogress-ink: #8A6100;
  --c-stuck-ink: #C2321A;

  /* Milestone series */
  --m-video: #EA90B5;
  --m-brief: #A3C5E8;
  --m-workshop: #56B099;

  /* Surface */
  --surface: #FFFFFF;
  --shadow-hard: 4px 4px 0 rgba(35, 31, 32, .08);
  --shadow-hard-lg: 6px 6px 0 rgba(35, 31, 32, .10);
  --radius: 10px;
  --radius-sm: 8px;
  --border: 1px solid var(--ink-12);

  --shell: 1280px;
  --gutter: clamp(16px, 3vw, 32px);

  --font-display: "Oswald", "Haettenschweiler", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* --------------------------------------------------------------- reset -- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
svg { display: block; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  font-family: var(--font-display);
  text-transform: uppercase;
  text-decoration: none;
}
.skip-link:focus { left: 8px; top: 8px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Every number in this app is tabular. Non-negotiable — columns must line up. */
.stat__num, .mini-stat__num, .pill__count, .card__ratio, .milestone__now-num,
.tick, .drawer__count, .warn-strip__count, .pmetric__val, table { font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------- masthead -- */

.masthead {
  background: var(--teal);
  color: var(--ink);
  border-bottom: 3px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 30;
}

.masthead__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  min-height: 76px;
  padding-block: 12px;
}

/* Wordmark lockup: ink on teal, condensed + a hard rule, echoing the site. */
.lockup { display: flex; align-items: center; gap: 12px; }

.lockup__mark {
  width: 34px;
  height: 34px;
  border: 2.5px solid var(--ink);
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 3px 3px 0 rgba(35, 31, 32, .22);
}
.lockup__bar {
  width: 5px;
  height: 16px;
  background: var(--ink);
  box-shadow: 8px 0 0 var(--ink);
  transform: translateX(-4px);
}

.lockup__text { display: block; line-height: 1; }

.lockup__brand {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.lockup__sub {
  display: block;
  margin-top: 3px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-70);
}

/* ------------------------------------------------------------- tabs --- */

.tabs {
  display: flex;
  gap: 4px;
  justify-self: center;
  max-width: 100%;
  background: rgba(255, 255, 255, .30);
  padding: 4px;
  border-radius: 999px;
  border: 1.5px solid rgba(35, 31, 32, .16);
  /* Six tabs will not always fit — let the pill rail scroll rather than wrap. */
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-70);
  transition: background .16s var(--ease), color .16s var(--ease);
  white-space: nowrap;
  flex: none;
}
.tab:hover { color: var(--ink); background: rgba(255, 255, 255, .45); }
.tab[aria-current="page"] {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .3);
}

/* --------------------------------------------------- masthead meta --- */

.masthead__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: end;
}

.freshness {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-70);
  text-align: right;
}
.freshness__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  flex: none;
}
.freshness.is-stale .freshness__dot { background: var(--orange); }
.freshness.is-stale { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------- buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--teal);
  color: #fff;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), background .12s var(--ease);
  text-decoration: none;
}
.btn:hover:not(:disabled) { transform: translate(-1.5px, -1.5px); box-shadow: 4.5px 4.5px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translate(1.5px, 1.5px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .65; cursor: progress; }

/* On the teal band the teal button would vanish — invert it to ink. */
.btn--refresh { background: var(--ink); box-shadow: 3px 3px 0 rgba(35, 31, 32, .25); }
.btn--refresh:hover:not(:disabled) { box-shadow: 4.5px 4.5px 0 rgba(35, 31, 32, .25); }
.btn--refresh:active:not(:disabled) { box-shadow: 1px 1px 0 rgba(35, 31, 32, .25); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink-12);
}
.btn--ghost:hover:not(:disabled) { background: var(--ink-05); box-shadow: 4.5px 4.5px 0 var(--ink-12); }

.btn__spin { flex: none; }
.is-refreshing .btn__spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- banners --- */

.banner-slot:empty { display: none; }
.banner-slot { padding-top: 16px; }

.banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-hard);
  margin-bottom: 12px;
  background: #fff;
}
.banner__icon { flex: none; margin-top: 1px; }
.banner__body { flex: 1; min-width: 0; }
.banner__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.banner__text { font-size: 13.5px; color: var(--ink-70); margin-top: 3px; }

.banner--stale { background: #FDEDE9; border-color: var(--orange); }
.banner--stale .banner__title { color: #A82A12; }

/* Warnings: a thin amber strip, expandable — present but never shouty. */
.warn-strip {
  border: 1.5px solid rgba(254, 187, 18, .85);
  background: #FFF8E4;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}
.warn-strip__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  list-style: none;
}
.warn-strip__summary::-webkit-details-marker { display: none; }
.warn-strip__summary:hover { background: rgba(254, 187, 18, .16); }
.warn-strip__count {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 12px;
}
.warn-strip__chev { margin-left: auto; transition: transform .16s var(--ease); }
.warn-strip[open] .warn-strip__chev { transform: rotate(180deg); }
.warn-strip__list { padding: 2px 14px 12px 40px; }
.warn-strip__list li {
  font-size: 13px;
  color: var(--ink-70);
  padding: 4px 0;
  border-top: 1px dashed rgba(35, 31, 32, .14);
}
.warn-strip__list li:first-child { border-top: 0; }

/* ------------------------------------------------------------ views --- */

.view { padding-block: 24px 56px; }

.view-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.view-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3.6vw, 36px);
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: 1.05;
}
.view-sub { font-size: 14px; color: var(--ink-55); }

/* ------------------------------------------------------- stat cards --- */

.summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 26px;
}

.stat {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 16px 18px 14px;
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--stat-color, var(--ink-20));
}
.stat__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-55);
}
.stat__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 4.4vw, 46px);
  line-height: 1.02;
  letter-spacing: .01em;
  color: var(--stat-color, var(--ink));
  margin-top: 4px;
}
.stat__foot { font-size: 12px; color: var(--ink-40); margin-top: 2px; }

/* A "done/target" ratio ("83/200") is wider than the plain counts the rest
   of the strip shows — scale that one tile's number down so it still fits
   the same card without wrapping. */
.stat--ratio .stat__num { font-size: clamp(22px, 3vw, 30px); }

/* ------------------------------------------------------------ pills --- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--ink-12);
  border-radius: 999px;
  padding: 7px 8px 7px 15px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-70);
  transition: border-color .14s var(--ease), color .14s var(--ease), background .14s var(--ease), transform .14s var(--ease);
}
.pill:hover { border-color: var(--ink-40); color: var(--ink); transform: translateY(-1px); }

.pill__count {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0;
  min-width: 24px;
  text-align: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--ink-08);
  color: var(--ink-70);
}

.pill[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 3px 3px 0 var(--ink-12);
}
.pill[aria-pressed="true"] .pill__count { background: rgba(255, 255, 255, .22); color: #fff; }

.pill--empty { opacity: .45; }

/* ------------------------------------------------------ project grid -- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.pcard {
  --health: var(--ink-20);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border: var(--border);
  border-left: 3px solid var(--health);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 18px;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: transform .14s var(--ease), box-shadow .14s var(--ease);
}
.pcard:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-hard-lg); }
.pcard:active { transform: translate(0, 0); box-shadow: var(--shadow-hard); }

.pcard--ontrack { --health: var(--teal); }
.pcard--atrisk { --health: var(--yellow); }
.pcard--behind { --health: var(--orange); }
.pcard--complete { --health: var(--teal); }
.pcard--notarget { --health: rgba(35, 31, 32, .28); }

.pcard__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.pcard__code {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 25px;
  letter-spacing: .03em;
  line-height: 1;
  text-transform: uppercase;
}
.pcard__client {
  font-size: 13px;
  color: var(--ink-55);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Health badge + the optional "+N needed" badge stack top-right, health on
   top — two pills side-by-side would fight the card code for width. */
.pcard__badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: none;
}

.badge {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex: none;
}
.badge--ontrack { background: rgba(86, 176, 153, .18); color: var(--c-cleared-ink); }
.badge--atrisk { background: rgba(254, 187, 18, .24); color: #7E5800; }
.badge--behind { background: rgba(239, 70, 35, .15); color: var(--c-stuck-ink); }
.badge--complete { background: var(--teal); color: #fff; }
.badge--notarget { background: var(--ink-08); color: var(--ink-55); }
/* Sky tint — a talent gap is a staffing signal, not a health verdict, so it
   deliberately sits outside the teal/amber/orange health ramp above. */
.badge--needs { background: rgba(163, 197, 232, .32); color: #2B5D82; }

.card__ratio {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.card__ratio em { font-style: normal; color: var(--ink-40); font-size: 12.5px; letter-spacing: .1em; }
.card__ratio--none { color: var(--ink-40); }

/* Stacked progress bar — 4 semantic segments. */
.bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--ink-08);
  border: 1px solid var(--ink-08);
}
.bar__seg { height: 100%; min-width: 5px; }
.bar__seg + .bar__seg { box-shadow: inset 1px 0 0 rgba(255, 255, 255, .55); }
.bar__seg--cleared { background: var(--c-cleared); }
.bar__seg--inpost { background: var(--c-inpost); }
.bar__seg--inprogress { background: var(--c-inprogress); }
.bar__seg--stuck { background: var(--c-stuck); }
/* Grey track for contracted slots with no task at all yet — same "needed"
   count the badge above reads from, just drawn into the bar itself. */
.bar__seg--unfilled { background: var(--ink-12); }

.bar-empty {
  height: 12px;
  border-radius: 999px;
  background: repeating-linear-gradient(-45deg, var(--ink-05) 0 6px, transparent 6px 12px);
  border: 1px dashed var(--ink-20);
  display: grid;
  place-items: center;
}

.no-tasks {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-40);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  border-top: 1px solid var(--ink-08);
  padding-top: 12px;
  margin-top: auto;
}
.mini-stat__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1;
  color: var(--mini-color, var(--ink));
}
.mini-stat__label {
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--ink-40);
  margin-top: 3px;
  text-transform: uppercase;
  font-weight: 600;
}
.mini-stat--cleared { --mini-color: var(--c-cleared-ink); }
.mini-stat--inpost { --mini-color: var(--c-inpost-ink); }
.mini-stat--inprogress { --mini-color: var(--c-inprogress-ink); }
.mini-stat--stuck { --mini-color: var(--c-stuck-ink); }
.mini-stat.is-zero .mini-stat__num { color: var(--ink-20); }

/* Staffing/pace/deadline strip — same grid recipe as .mini-stats (4-up,
   ink-08 top rule) so it reads as a sibling row, not a bolted-on widget. */
.pmetrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  border-top: 1px solid var(--ink-08);
  padding-top: 12px;
}
.pmetric__val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  color: var(--ink);
}
.pmetric__label {
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--ink-40);
  margin-top: 3px;
  text-transform: uppercase;
  font-weight: 600;
}
.pmetric--late .pmetric__val { color: var(--c-stuck-ink); }
.pmetric--soon .pmetric__val { color: var(--c-inprogress-ink); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--ink-08);
  font-size: 12.5px;
  color: var(--ink-55);
}
.legend li { display: flex; align-items: center; gap: 7px; }
.legend__swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; }

/* -------------------------------------------------------- milestones -- */

.mcards { display: flex; flex-direction: column; gap: 18px; }

.mcard {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 20px 22px 16px;
  border-top: 4px solid var(--series, var(--ink));
}
.mcard--video { --series: var(--m-video); }
.mcard--brief { --series: var(--m-brief); }
.mcard--workshop { --series: var(--m-workshop); }

.mcard__head {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.mcard__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(19px, 2.4vw, 24px);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--series);
  margin-right: auto;
  line-height: 1.1;
}
/* Sky is too pale for text on white — darken just the brief title. */
.mcard--brief .mcard__title { color: #4A7BB0; }

.target-field {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--ink-05);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.target-field label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-55);
}
.target-field input {
  width: 62px;
  padding: 5px 8px;
  border: 1.5px solid var(--ink-20);
  border-radius: 6px;
  background: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.target-field input:hover { border-color: var(--ink-40); }
.target-field input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--ink-12); }

.milestone__now {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.milestone__now-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  color: var(--series);
}
.mcard--brief .milestone__now-num { color: #4A7BB0; }
.milestone__now-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-55);
  max-width: 66px;
  line-height: 1.2;
}
.milestone__now.is-hit .milestone__now-num::after {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--teal);
  vertical-align: middle;
}

.chart-wrap { position: relative; height: 260px; }

.mcard__foot {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ink-08);
  font-size: 12px;
  color: var(--ink-55);
}
.mcard__foot span { display: flex; align-items: center; gap: 7px; }
.swatch-line {
  width: 18px;
  height: 0;
  border-top: 2px dashed var(--orange);
  flex: none;
}

/* --------------------------------------------------------- skeletons -- */

.skel {
  background: linear-gradient(90deg, var(--ink-05) 25%, var(--ink-08) 37%, var(--ink-05) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.skel-card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.skel-line { height: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .skel { background: var(--ink-05); }
}

/* ------------------------------------------------------- empty/error -- */

.state {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 48px 32px;
  text-align: center;
  max-width: 520px;
  margin: 40px auto;
}
.state__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.state__text { color: var(--ink-55); font-size: 14px; margin-bottom: 22px; }
.state__mark {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink-05);
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--ink-40);
}

/* ------------------------------------------------------------ drawer -- */

.drawer-root { position: fixed; inset: 0; z-index: 60; }
.drawer-root[hidden] { display: none; }

.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 31, 32, .45);
  animation: fade .18s var(--ease);
}
@keyframes fade { from { opacity: 0; } }

.drawer {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(560px, 100%);
  background: var(--paper);
  border-left: 3px solid var(--ink);
  display: flex;
  flex-direction: column;
  animation: slide-in .22s var(--ease);
  box-shadow: -8px 0 32px rgba(35, 31, 32, .18);
}
@keyframes slide-in { from { transform: translateX(100%); } }

.drawer__head {
  padding: 20px 24px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--ink-12);
  flex: none;
}
.drawer__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.drawer__heading { min-width: 0; }
.drawer__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: .03em;
  text-transform: uppercase;
  line-height: 1;
  overflow-wrap: anywhere;
}
/* The project code beside a client name — same information as the card, so it
   keeps the card's quieter treatment rather than growing to 30px. */
.drawer__code {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .1em;
  color: var(--ink-40);
  white-space: nowrap;
  vertical-align: 5px;
  margin-left: 4px;
}
.drawer__client { font-size: 13.5px; color: var(--ink-55); margin-top: 5px; }

.drawer__close {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--ink-12);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .14s var(--ease), border-color .14s var(--ease);
}
.drawer__close:hover { background: var(--ink-05); border-color: var(--ink-40); }

.drawer__body { overflow-y: auto; padding: 16px 24px 40px; flex: 1; }

.tgroup {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}
.tgroup__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  border-left: 3px solid var(--cat, var(--ink-20));
}
.tgroup__summary::-webkit-details-marker { display: none; }
.tgroup__summary:hover { background: var(--ink-05); }
.tgroup__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.drawer__count {
  font-weight: 700;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ink-08);
  color: var(--ink-70);
}
.tgroup__chev { margin-left: auto; transition: transform .16s var(--ease); color: var(--ink-40); }
.tgroup[open] .tgroup__chev { transform: rotate(180deg); }

.tgroup--stuck { --cat: var(--c-stuck); }
.tgroup--inprogress { --cat: var(--c-inprogress); }
.tgroup--inpost { --cat: var(--c-inpost); }
.tgroup--cleared { --cat: var(--c-cleared); }
.tgroup--stuck .drawer__count { background: rgba(239, 70, 35, .14); color: var(--c-stuck-ink); }

.tlist { border-top: 1px solid var(--ink-08); }
.tlist li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid var(--ink-05);
}
.tlist li:first-child { border-top: 0; }
.tlist li:hover { background: var(--ink-05); }

.task__main { min-width: 0; flex: 1; }
.task__name {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.task__meta { font-size: 11.5px; color: var(--ink-40); margin-top: 3px; }

.chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex: none;
  background: var(--chip-bg, var(--ink-08));
  color: var(--chip-fg, var(--ink-70));
}
.chip--stuck { --chip-bg: rgba(239, 70, 35, .14); --chip-fg: var(--c-stuck-ink); }
.chip--inprogress { --chip-bg: rgba(254, 187, 18, .22); --chip-fg: #7E5800; }
.chip--inpost { --chip-bg: rgba(155, 212, 195, .34); --chip-fg: var(--c-inpost-ink); }
.chip--cleared { --chip-bg: rgba(86, 176, 153, .18); --chip-fg: var(--c-cleared-ink); }

.task__link {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--ink-40);
  transition: background .14s var(--ease), color .14s var(--ease);
}
.task__link:hover { background: var(--ink-08); color: var(--ink); }

/* ------------------------------------------------------------- foot --- */

.site-foot {
  padding-block: 24px 40px;
  font-size: 12px;
  color: var(--ink-40);
  border-top: 1px solid var(--ink-08);
}

/* ------------------------------------------------------------ login --- */

.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 12%, rgba(86, 176, 153, .22), transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(234, 144, 181, .20), transparent 45%),
    var(--paper);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 34px 32px 30px;
}
.login-card .lockup { justify-content: center; margin-bottom: 26px; }
.login-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
}
.login-card__hint {
  font-size: 13px;
  color: var(--ink-55);
  text-align: center;
  margin: 6px 0 24px;
}
.field { display: block; margin-bottom: 16px; }
.field__label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-55);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--ink-20);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 15px;
}
.field input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--ink-12); }
.btn--block { width: 100%; justify-content: center; padding-block: 12px; }

.form-error {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #FDEDE9;
  border: 1.5px solid var(--orange);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 500;
  color: #A82A12;
  margin-bottom: 16px;
}
.form-error[hidden] { display: none; }

/* ============================================================== HOME ====
   The page a PM opens at 8:55am. One question first — what is overdue —
   answered by a count large enough to read from across the desk, then the
   list. Exactly one colour per row carries meaning (the day chip); every
   other chip stays neutral so the red never has to compete.
   ======================================================================== */

.greet { display: flex; flex-direction: column; gap: 4px; }
.greet__hello {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3.6vw, 36px);
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: 1.05;
}
.greet__sub { font-size: 14px; color: var(--ink-55); }

/* Headline tallies, right of the greeting. */
.hsummary { display: flex; gap: 10px; flex-wrap: wrap; }
.htally {
  display: flex;
  align-items: baseline;
  gap: 9px;
  background: var(--surface);
  border: var(--border);
  border-left: 3px solid var(--tally, var(--ink-20));
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hard);
  padding: 8px 16px 8px 13px;
}
.htally--due { --tally: var(--teal); }
.htally--overdue { --tally: var(--orange); }
.htally__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--tally);
}
.htally--due .htally__num { color: var(--c-cleared-ink); }
.htally--overdue .htally__num { color: var(--c-stuck-ink); }
.htally__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-55);
}

.boards { display: flex; flex-direction: column; gap: 26px; }

.board__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.board__label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-70);
  white-space: nowrap;
}
.board__rule { flex: 1; height: 0; border-top: 2px solid var(--ink-12); }

/* --- section (due today / overdue) --- */

.hsec {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  border-top: 4px solid var(--accent, var(--ink-20));
  overflow: hidden;
}
.hsec + .hsec { margin-top: 14px; }
.hsec--due { --accent: var(--teal); --accent-ink: var(--c-cleared-ink); }
.hsec--overdue { --accent: var(--orange); --accent-ink: var(--c-stuck-ink); }

.hsec__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--ink-08);
}
.hsec__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-ink, var(--ink));
}
.hsec__sep { color: var(--ink-20); font-weight: 700; }
.hsec__count {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--accent-ink, var(--ink));
}
.hsec__note {
  margin-left: auto;
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--ink-40);
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}

/* Rows sit in a fluid grid: two columns of compact rows on a desk monitor
   (a 100-item overdue list halves in height), one column below 900px. Grid
   fills row-major, so "most overdue first" still reads left-to-right. */
.hlist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
}

.hrow {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 16px;
  border-top: 1px solid var(--ink-05);
  min-width: 0;
}
.hlist > .hrow:first-child { border-top: 0; }
.hrow:hover { background: var(--ink-05); }

/* Day-count chip — the one loud thing on the row. Three depths so a 40-day
   miss cannot be mistaken for a 2-day one at a glance. */
.days {
  flex: none;
  min-width: 40px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(239, 70, 35, .12);
  color: var(--c-stuck-ink);
}
.days--warm { background: rgba(239, 70, 35, .26); color: #A82A12; }
/* A fortnight of silence is its own tier — the step between "warm" and the
   solid 21-day chip, so a 16-day wait cannot hide next to a 7-day one. */
.days--late { background: rgba(239, 70, 35, .42); color: #7E1C08; }
.days--hot { background: var(--orange); color: #fff; }
.days--calm {
  background: var(--ink-05);
  color: var(--ink-55);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0;
}

.hrow__main { flex: 1; min-width: 0; }
.hrow__name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hrow__ctx {
  font-size: 11.5px;
  color: var(--ink-40);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hrow__ctx b { font-weight: 600; color: var(--ink-55); }

/* Status chips on Home stay deliberately neutral — see the note above. */
.chip--plain { --chip-bg: var(--ink-05); --chip-fg: var(--ink-55); }
.chip--project {
  --chip-bg: rgba(163, 197, 232, .30);
  --chip-fg: #3E6B9B;
  font-family: var(--font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.avatar {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  color: var(--ink);
  background: var(--avatar, var(--ink-08));
  border: 1px solid rgba(35, 31, 32, .14);
  user-select: none;
}

.hempty {
  padding: 22px 18px;
  font-size: 13.5px;
  color: var(--ink-55);
}

/* A board with nothing due and nothing late gets one card, not two blanks. */
.hclear {
  background: var(--surface);
  border: var(--border);
  border-top: 4px solid var(--teal);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 30px 24px;
  text-align: center;
}
.hclear__mark { font-size: 26px; line-height: 1; margin-bottom: 10px; }
.hclear__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-cleared-ink);
}
.hclear__text { font-size: 13.5px; color: var(--ink-55); margin-top: 5px; }

/* ============================================================= ALERTS ==== */

.agroups { display: flex; flex-direction: column; gap: 16px; }

.agroup {
  background: var(--surface);
  border: var(--border);
  border-left: 3px solid var(--ink-20);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
}
.agroup--sev1 { border-left-color: var(--orange); }
.agroup--sev2 { border-left-color: var(--yellow); }
.agroup--sev3 { border-left-color: var(--sky); }

.agroup__head {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--ink-05);
  border-bottom: 1px solid var(--ink-08);
}
.agroup__label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.agroup__count {
  font-weight: 700;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--ink-08);
  color: var(--ink-70);
}
.agroup__age {
  font-size: 12px;
  color: var(--ink-55);
  font-variant-numeric: tabular-nums;
}
.agroup__actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }

.btn--sm {
  padding: 6px 12px;
  font-size: 11.5px;
  letter-spacing: .09em;
  box-shadow: 2px 2px 0 var(--ink-12);
  gap: 6px;
}
.btn--sm:hover:not(:disabled) { box-shadow: 3px 3px 0 var(--ink-12); }
.btn.is-copied {
  background: var(--teal);
  color: #fff;
  border-color: var(--ink);
}

.alist li {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 18px;
  border-top: 1px solid var(--ink-05);
  min-width: 0;
}
.alist li:first-child { border-top: 0; }
.alist li:hover { background: var(--ink-05); }

.aitem__main { flex: 1; min-width: 0; }
.aitem__name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.aitem__meta { font-size: 11.5px; color: var(--ink-40); margin-top: 2px; }
.aitem__meta b { font-weight: 600; color: var(--ink-55); }
.aitem__actions { display: flex; gap: 6px; flex: none; }

.iconbtn {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1.5px solid var(--ink-12);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-55);
  transition: background .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease);
}
.iconbtn:hover { background: var(--ink-05); border-color: var(--ink-40); color: var(--ink); }
.iconbtn.is-copied { background: var(--teal); border-color: var(--ink); color: #fff; }
.iconbtn--xs { width: 26px; height: 26px; border-radius: 6px; }

/* ---------------------------------------- client email workspace (pm) --- */

/* The whole point of the redesign: three named sections instead of one long
   list, and one collapsed card per client. Nothing here shouts — the day chip
   is the only coloured thing on a card, exactly as on Home. */

.csec { --sec: var(--ink-20); }
.csec + .csec { margin-top: 30px; }

.csec__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 9px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--ink-12);
}
/* Same swatch language as the pipeline legend — the section's colour, stated
   once, quietly. */
.csec__head::before {
  content: '';
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--sec);
}
.csec__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.csec__count {
  font-weight: 700;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--ink-08);
  color: var(--ink-70);
}
.csec__note { font-size: 12px; color: var(--ink-40); margin-left: auto; }
.csec__empty { font-size: 13.5px; color: var(--ink-55); padding: 2px 2px 6px; }

.csec--briefs { --sec: var(--sky); }
.csec--videos { --sec: var(--pink); }
.csec--reminders { --sec: var(--yellow); }
.csec--students { --sec: var(--teal); }

.cgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 14px;
}

/* Borrowed from .pcard: same paper, same hard shadow, same lift on hover. The
   accent moves to the top edge so a grid of cards reads as one section. */
.ccard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: var(--border);
  border-top: 4px solid var(--sec, var(--ink-20));
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 14px 16px 11px;
  cursor: pointer;
  transition: transform .14s var(--ease), box-shadow .14s var(--ease);
}
.ccard:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-hard-lg); }
.ccard:active { transform: translate(0, 0); box-shadow: var(--shadow-hard); }
.ccard--rule { --sec: var(--teal); }

.ccard__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

/* The name is a real button so the card is keyboard-reachable, and its ::after
   stretches the hit area over the whole card. Anything that must stay
   clickable (the checkbox) lifts above it with z-index. */
.ccard__open {
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.ccard__open::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}
.ccard__open:focus-visible { outline: none; }
.ccard__open:focus-visible::after { outline: 3px solid var(--ink); outline-offset: 2px; }

.ccard__name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .05em;
  line-height: 1.1;
  text-transform: uppercase;
}
.ccard__code {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--ink-40);
  margin-top: 4px;
}
.ccard--rule .ccard__name { font-size: 16px; letter-spacing: .06em; }
.ccard__code--rule { letter-spacing: .04em; text-transform: none; }

/* Above the card-wide button overlay so its tooltip still works. A click on it
   bubbles to .ccard, which opens the drawer anyway. */
.ccard__age { flex: none; position: relative; z-index: 1; }

.ccard__badges { display: flex; flex-wrap: wrap; gap: 5px; }

/* Send-mix badges. Sky for briefs, pink for videos — the same series colours
   the Milestones tab uses. New vs updated is carried by the fill weight and an
   outline, NOT by lightening the text: at 10.5px the lighter inks (#4A7BB0,
   #A85C7C) measure 4.0:1 on these tints, under the 4.5:1 floor. The darker
   ink reads on both fills, so a revision still never looks like new work. */
.badge--brief { background: rgba(163, 197, 232, .34); color: #2B5D82; }
.badge--briefup { background: rgba(163, 197, 232, .16); color: #2B5D82; box-shadow: inset 0 0 0 1px rgba(43, 93, 130, .30); }
.badge--video { background: rgba(234, 144, 181, .30); color: #9C3A62; }
.badge--videoup { background: rgba(234, 144, 181, .14); color: #9C3A62; box-shadow: inset 0 0 0 1px rgba(156, 58, 98, .30); }
.badge--remind { background: var(--ink-08); color: var(--ink-55); }

/* The stat row: two (or three, counting the warning slot) tabular numbers big
   enough to read from across the room — the whole point of this pass. Same
   font-display/tabular-nums recipe as .stat on Home/Trends, just sized down
   to fit a card instead of a full dashboard tile. */
.ccard__stats { display: flex; align-items: flex-end; gap: 20px; margin: 1px 0; }
.ccard__stat { display: flex; flex-direction: column; gap: 1px; }
.ccard__stat-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.ccard__stat-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-55);
}
.ccard__stat--send .ccard__stat-num { color: var(--c-cleared-ink); }
.ccard__stat--wait .ccard__stat-num { color: var(--c-inprogress-ink); }
.ccard__stat--students .ccard__stat-num { color: var(--m-video); }
.ccard__stat--zero .ccard__stat-num { color: var(--ink-20); }

.ccard__warn {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--c-stuck-ink);
}

.ccard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--ink-08);
}
.ccard__foot-note { font-size: 11px; color: var(--ink-40); }
.ccard__cta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-40);
  transition: color .14s var(--ease);
}
.ccard:hover .ccard__cta { color: var(--ink); }

/* Contacted this week: done, not deleted. The card stays legible — someone has
   to be able to re-read what they sent — but stops competing for attention. */
.ccard--done {
  box-shadow: none;
  border-top-color: var(--ink-12);
  background: #FCFCFC;
}
.ccard--done:hover { box-shadow: var(--shadow-hard); }
.ccard--done .ccard__name,
.ccard--done .ccard__badges,
.ccard--done .ccard__stats { opacity: .55; }
.ccard--done .ccard__code { text-decoration: line-through; }

.ccheck {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  cursor: pointer;
  user-select: none;
}
.ccheck input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--ink-40);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  transition: background .14s var(--ease), border-color .14s var(--ease);
}
.ccheck:hover input { border-color: var(--ink); }
.ccheck input:checked { background: var(--teal); border-color: var(--ink); }
.ccheck input:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2.2px 2.2px 0;
  transform: rotate(40deg);
}
.ccheck__text {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-55);
}
.ccheck input:checked ~ .ccheck__text { color: var(--c-cleared-ink); }

/* ---------------------------------------------- client email workspace -- */

.dhint { font-size: 12.5px; color: var(--ink-40); margin-top: 12px; }

/* Missing contact details are a blocker, not a footnote — same visual weight
   as the stale-data banner, scoped to the workspace's email card. */
.ewarn {
  display: flex;
  gap: 11px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: #FDEDE9;
  border: 1px solid var(--orange);
  border-radius: var(--radius-sm);
  color: #A82A12;
}
.ewarn__body { min-width: 0; }
.ewarn__title { font-size: 13.5px; font-weight: 700; line-height: 1.35; }
.ewarn__text { font-size: 12.5px; color: var(--ink-70); margin-top: 3px; }

/* The full-screen client email workspace — sidebar email list + main email
   pane, porting the reference demo's information design into our tokens
   (Oswald/Inter, teal/pink/ink, hard offset shadows), never its blue/slate
   theme. Fixed below the masthead: --wtop is measured and set by
   syncWorkspaceTop() in app.js rather than a hardcoded pixel guess, since the
   masthead's own height already changes across the 1100/860px breakpoints.
   Below 760px the masthead stops being sticky (see that breakpoint below) so
   the workspace drops position:fixed entirely and just flows in the page. */
.eworkspace {
  position: fixed;
  top: var(--wtop, 96px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.wtopbar {
  flex: none;
  padding: 10px var(--gutter);
  border-bottom: var(--border);
  background: var(--surface);
}
.wback {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: none;
  padding: 4px 2px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-70);
  transition: color .14s var(--ease);
}
.wback:hover { color: var(--ink); }

.eworkspace__panes { flex: 1; display: flex; min-height: 0; }

/* -------------------------------------------------------- ws sidebar -- */

.wside {
  flex: none;
  width: 340px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: var(--border);
  min-height: 0;
}
.wside__head { flex: none; padding: 16px 18px 12px; border-bottom: 1px solid var(--ink-08); }
.wside__eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-40);
}
.wside__count { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin-top: 2px; }
.wside__updated { font-size: 11px; color: var(--ink-40); margin-top: 2px; }

.wfilters { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--ink-08); }
.wfilters .pill { padding: 5px 6px 5px 11px; font-size: 11px; }

.wlist { flex: 1; overflow-y: auto; }
.wlist__empty { padding: 20px 16px; font-size: 12.5px; color: var(--ink-40); text-align: center; }

.wgroup-label {
  padding: 9px 16px 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-40);
  background: var(--ink-05);
  border-bottom: 1px solid var(--ink-08);
}

.wrow {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-05);
  transition: background .12s var(--ease);
}
.wrow:hover { background: var(--ink-05); }
.wrow--active { background: rgba(86, 176, 153, .12); box-shadow: inset 3px 0 0 var(--teal); }
.wrow--active:hover { background: rgba(86, 176, 153, .16); }

.wrow__open { display: block; flex: 1; min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.wrow__open::after { content: ''; position: absolute; inset: 0; }
.wrow__open:focus-visible { outline: none; }
.wrow__open:focus-visible::after { outline: 2.5px solid var(--ink); outline-offset: -2px; }

.wrow__code { display: block; font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: .04em; }
.wrow__name { display: block; font-size: 12px; color: var(--ink-55); margin-top: 1px; }
.wrow__contracted { display: block; font-size: 10.5px; color: var(--ink-40); margin-top: 2px; }
.wrow__badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 5px; }
.wflag { font-size: 11px; }

.wrow--done { opacity: .55; }
.wrow--done .wrow__code { text-decoration: line-through; }
.wrow--done:hover { opacity: .8; }

/* The checkbox rides above the row-wide button overlay so it stays
   independently clickable — same trick .ccheck already uses on the grid
   cards. The "this week" text is dropped here; the row is narrow and the
   checkbox is the same shared control everywhere else on the page. */
.wrow .ccheck { position: relative; z-index: 2; flex: none; margin-top: 1px; }
.wrow .ccheck__text { display: none; }

/* ----------------------------------------------------------- ws main -- */

.wmain { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.wmain__head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: var(--border);
}
.wmain__meta { min-width: 0; }
.wmain__subject {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .01em;
  line-height: 1.2;
}
.wmain__to { font-size: 13px; color: var(--ink-55); margin-top: 5px; }
.wmain__to--missing { color: var(--c-stuck-ink); font-weight: 600; }
.wmain__contracted { font-size: 11.5px; color: var(--ink-40); margin-top: 2px; }
/* flex-shrink stays at its default (1, not "none"/0) on purpose: at 375px
   three buttons cannot sit on one line, and this is what lets the row shrink
   down far enough for its own flex-wrap to actually kick in instead of just
   overflowing the pane sideways. */
.wmain__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }

.wmain__body { flex: 1; overflow-y: auto; padding: 24px; }

/* The email itself. White card, generous padding, real typography — what the
   client will see, sitting in the pane where it is about to be copied. */
.wcard {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 32px 40px;
  /* Wide enough to use a desktop pane, centered so leftover space splits
     evenly instead of pooling on the right. Line length stays readable
     because the email copy itself sits in normal paragraphs. */
  max-width: 980px;
  margin: 0 auto;
  line-height: 1.65;
}
.wcard__p { color: var(--ink-90); margin-bottom: 14px; }
.wcard__p:last-child { margin-bottom: 0; }

.wgroup {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-55);
  margin: 16px 0 6px;
}
.wsend-block { margin-bottom: 16px; }
.wsend { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; }
.wdot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex: none; }
.wdot--brief { background: var(--yellow); }
.wdot--video { background: var(--teal); }
.wdot--updated { background: var(--pink); }
.wsend__link { color: #2B5D82; text-decoration: none; font-weight: 500; font-size: 13.5px; line-height: 1.4; overflow-wrap: anywhere; }
.wsend__link:hover { text-decoration: underline; }
.wsend__link--missing { color: var(--ink-40); font-style: italic; }
.wnolink {
  flex: none;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: #FFF8E4;
  border: 1px solid rgba(254, 187, 18, .6);
  color: #7E5800;
}

.wwait-intro { color: var(--ink-55); font-style: italic; margin: 22px 0 12px; font-size: 13px; }
.wwait { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 4px; }
.wwait th {
  background: var(--ink-05);
  text-align: left;
  font-weight: 600;
  padding: 8px 12px;
  border: 1px solid var(--ink-12);
  color: var(--ink-70);
}
.wwait td { padding: 7px 12px; border: 1px solid var(--ink-12); color: var(--ink-90); }
.wwait td a { color: var(--ink-90); text-decoration: none; }
.wwait td a:hover { text-decoration: underline; color: #2B5D82; }
.wwait tr:nth-child(even) td { background: var(--ink-05); }

.wfeedback {
  margin-top: 22px;
  padding: 12px 16px;
  background: var(--ink-05);
  border-left: 3px solid var(--ink-20);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  color: var(--ink-70);
  line-height: 1.6;
}
.wsignoff { margin-top: 20px; color: var(--ink-90); }
.wsignoff p { margin-bottom: 2px; }

/* ============================================================= TRENDS ==== */

.trend-grid { display: flex; flex-direction: column; gap: 18px; }

.mcard--trend { --series: var(--teal); }
.mcard--trend .mcard__head { margin-bottom: 10px; }

.delta-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.delta {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 15px 18px 13px;
  position: relative;
  overflow: hidden;
}
.delta::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--stat-color, var(--ink-20));
}
.delta__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-55);
}
.delta__row { display: flex; align-items: baseline; gap: 10px; margin-top: 3px; }
.delta__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.02;
  font-variant-numeric: tabular-nums;
  color: var(--stat-color, var(--ink));
}
.delta__chg {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.delta__chg--up { background: rgba(86, 176, 153, .18); color: var(--c-cleared-ink); }
.delta__chg--down { background: rgba(239, 70, 35, .13); color: var(--c-stuck-ink); }
.delta__chg--flat { background: var(--ink-05); color: var(--ink-55); }
.delta__foot { font-size: 12px; color: var(--ink-40); margin-top: 2px; }

.wip-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-55);
  margin-top: -4px;
}
.wip-note::before {
  content: "";
  width: 18px;
  height: 0;
  border-top: 2px dashed var(--ink-20);
  flex: none;
}

.spark-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.spark {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hard);
  padding: 11px 13px 6px;
}
.spark__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.spark__code {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.spark__pct {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--c-cleared-ink);
}
.spark__client {
  font-size: 11px;
  color: var(--ink-40);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}
.spark__wrap { position: relative; height: 60px; margin-top: 6px; }

.note-card {
  background: var(--surface);
  border: var(--border);
  border-left: 3px solid var(--sky);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hard);
  padding: 16px 18px;
}
.note-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.note-card__text { font-size: 13px; color: var(--ink-55); margin-top: 4px; }
.note-card__meter {
  height: 6px;
  border-radius: 999px;
  background: var(--ink-08);
  margin-top: 10px;
  overflow: hidden;
}
.note-card__fill { height: 100%; background: var(--sky); }

/* ============================================================== ADMIN ==== */

.acard {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  margin-bottom: 18px;
  overflow: hidden;
}
.acard__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--ink-08);
}
.acard__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.acard__hint { font-size: 12.5px; color: var(--ink-55); }
.acard__body { padding: 14px 18px 18px; }

.atable-wrap { overflow-x: auto; }
.atable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.atable th {
  text-align: left;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-55);
  padding: 8px 12px;
  border-bottom: 1.5px solid var(--ink-12);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--surface);
}
.atable td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--ink-05);
  vertical-align: middle;
}
.atable tbody tr:hover { background: var(--ink-05); }
.atable tr.is-paused td { opacity: .62; }
.atable tr.is-saving td:first-child { box-shadow: inset 3px 0 0 var(--yellow); }

.acode {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.aclient { color: var(--ink-55); }
.anum {
  width: 78px;
  padding: 5px 8px;
  border: 1.5px solid var(--ink-20);
  border-radius: 6px;
  background: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.anum:hover { border-color: var(--ink-40); }
.anum:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--ink-12); }

/* Same recipe as .anum, just wider — a 'YYYY-MM-DD' native date field needs
   more room than a 2-3 digit count. */
.adate {
  width: 152px;
  padding: 5px 8px;
  border: 1.5px solid var(--ink-20);
  border-radius: 6px;
  background: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.adate:hover { border-color: var(--ink-40); }
.adate:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--ink-12); }

/* Contact fields are free text, so they get the .anum recipe in a body face
   and a flexible width — an address list is not a number. */
.atext {
  width: 100%;
  min-width: 90px;
  padding: 5px 9px;
  border: 1.5px solid var(--ink-20);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}
.atext:hover { border-color: var(--ink-40); }
.atext:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--ink-12); }
.atext::placeholder { color: var(--ink-20); }
.atext--name { min-width: 130px; }
.atext--to { min-width: 240px; }
.atext--folder {
  min-width: 118px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

/* Let the address column take the slack rather than the code/client columns. */
.atable--clients { min-width: 880px; }
.atable--clients th:nth-child(4), .atable--clients td:nth-child(4) { width: 34%; }

.dot-over {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  border: 1px solid rgba(35, 31, 32, .3);
  vertical-align: middle;
  margin-right: 6px;
}

/* Orange, not yellow: an overridden value is a choice, a missing contact is a
   client who cannot be emailed at all. */
.dot-warn {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  border: 1px solid rgba(35, 31, 32, .3);
  vertical-align: middle;
  margin-left: 5px;
}
.dot-warn[hidden] { display: none; }

.linkbtn {
  border: 0;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-55);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.linkbtn:hover { color: var(--ink); }

/* Switch — a real checkbox, restyled, so it keeps keyboard + a11y for free. */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.switch input {
  appearance: none;
  -webkit-appearance: none;
  width: 38px;
  height: 21px;
  border-radius: 999px;
  background: var(--ink-12);
  border: 1.5px solid var(--ink-20);
  position: relative;
  cursor: pointer;
  transition: background .16s var(--ease), border-color .16s var(--ease);
  flex: none;
  margin: 0;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 1.5px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(35, 31, 32, .3);
  transition: transform .16s var(--ease);
}
.switch input:checked { background: var(--teal); border-color: var(--ink-40); }
.switch input:checked::after { transform: translateX(17px); }
.switch__text {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-55);
  text-transform: uppercase;
  white-space: nowrap;
}
.paused-note {
  display: block;
  font-size: 11px;
  color: var(--c-stuck-ink);
  font-weight: 600;
  margin-top: 2px;
}
/* display:block would otherwise win over the UA rule for [hidden]. */
.paused-note[hidden] { display: none; }

.targets-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.tfield {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink-05);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.tfield label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-55);
}

/* ============================================================== TOAST ==== */

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 500;
  max-width: 340px;
  box-shadow: 4px 4px 0 rgba(35, 31, 32, .22);
  animation: toast-in .2s var(--ease);
}
.toast--error { background: #A82A12; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------- responsive --- */

@media (max-width: 1100px) {
  .summary { grid-template-columns: repeat(3, 1fr); }
  .summary .stat:nth-child(4) { grid-column: span 2; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delta-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .masthead { position: static; }
  .masthead__inner {
    grid-template-columns: 1fr auto;
    grid-template-areas: "lockup meta" "tabs tabs";
    row-gap: 14px;
  }
  .lockup { grid-area: lockup; }
  .masthead__meta { grid-area: meta; }
  /* Tabs must stay reachable on mobile — full-width rail that scrolls sideways
     rather than squashing six labels into unreadable stubs. */
  .tabs { grid-area: tabs; justify-self: stretch; }
  .tab { text-align: center; padding-inline: 13px; }
  /* The dot is decorative; once the text wraps it reads as a stray mark, so
     keep it only when it carries meaning (stale data). */
  .freshness { font-size: 11.5px; max-width: 150px; text-align: left; }
  .freshness__dot { display: none; }
  .freshness.is-stale .freshness__dot { display: block; }
  .btn__label { display: none; }
  .btn--refresh { padding: 10px; }
  /* "Takes about a minute" is the whole point of the new refresh — it is the
     one label worth the space on a phone, so let it back in (wrapped) while
     a crawl is actually running. */
  .btn--refresh.is-refreshing .btn__label {
    display: inline;
    max-width: 96px;
    font-size: 10.5px;
    letter-spacing: .05em;
    line-height: 1.2;
    white-space: normal;
  }
}

/* The workspace's own breakpoint: below 860px the masthead is no longer
   sticky (see above), so position:fixed has nothing reliable to sit under —
   drop it and let the workspace flow in the page like everything else does
   at this width. Below 760px specifically, stack sidebar-over-pane rather
   than keeping them side by side at a width too narrow for either to read. */
@media (max-width: 860px) {
  .eworkspace { position: static; top: auto; }
}

@media (max-width: 760px) {
  .eworkspace__panes { flex-direction: column; }
  .wside { width: 100%; max-height: 260px; border-right: 0; border-bottom: 1.5px solid var(--ink-12); }
  .wtopbar { position: sticky; top: 0; z-index: 5; }
  .wmain__body { overflow-y: visible; }
}

@media (max-width: 680px) {
  body { font-size: 14.5px; }
  .summary { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .summary .stat:nth-child(4) { grid-column: auto; }
  .summary .stat:last-child { grid-column: span 2; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .stat { padding: 13px 14px 11px; }
  .stat__num { font-size: 32px; }
  .mcard { padding: 16px 14px 12px; }
  .mcard__head { gap: 12px; }
  .mcard__title { flex-basis: 100%; margin-right: 0; }
  .chart-wrap { height: 220px; }
  .drawer { border-left: 0; border-top: 3px solid var(--ink); inset: 56px 0 0 0; }
  .drawer__body { padding-inline: 16px; }
  .drawer__head { padding-inline: 18px; }

  /* Home / Alerts / Trends on a phone: one column, tighter rows, actions
     drop under the group title instead of fighting it for the same line. */
  .hlist { grid-template-columns: minmax(0, 1fr); }
  .hsec__head { padding: 11px 13px; }
  .hsec__note { display: none; }
  .htally { padding: 7px 13px 7px 11px; }
  .htally__num { font-size: 26px; }
  .agroup__head { padding: 12px 13px; }
  .agroup__actions { margin-left: 0; width: 100%; }

  /* One card per row on a phone, and the section note drops — the count
     already says how big the pile is. */
  .cgrid { grid-template-columns: minmax(0, 1fr); }
  .csec__note { display: none; }
  .csec + .csec { margin-top: 24px; }
  .ccard { padding: 13px 14px 10px; }
  .ccard__name { font-size: 18px; }
  .ccard__stats { gap: 14px; }
  .ccard__stat-num { font-size: 26px; }

  /* The workspace's own phone tweaks — sidebar/main stacking already
     switches on at 760px (see that breakpoint); this just tightens the
     padding to match every other panel at this width. */
  .wtopbar { padding: 8px 13px; }
  .wside__head { padding: 13px 14px 10px; }
  .wmain__head { padding: 13px 14px; }
  .wmain__body { padding: 16px 14px; }
  .wcard { padding: 18px; max-width: none; }

  /* One flex line cannot hold a task name, a status and two controls at 375px
     without ellipsing the only part that matters. Below 680 the row becomes a
     two-line grid: the name gets the full width and wraps, the status chip
     drops underneath it. */
  .hrow {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas:
      "days main avatar link"
      "days chip chip   chip";
    align-items: center;
    column-gap: 9px;
    row-gap: 5px;
    padding: 11px 13px;
  }
  .hrow .days { grid-area: days; align-self: start; margin-top: 2px; }
  .hrow__main { grid-area: main; }
  .hrow .chip { grid-area: chip; justify-self: start; }
  .hrow .avatar { grid-area: avatar; }
  .hrow .task__link { grid-area: link; }
  .hrow__name { white-space: normal; }
  .hrow__ctx { white-space: normal; }

  .alist li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "days main link"
      "days chip acts";
    align-items: center;
    column-gap: 9px;
    row-gap: 5px;
    padding: 11px 13px;
  }
  .alist .days { grid-area: days; align-self: start; margin-top: 2px; }
  .aitem__main { grid-area: main; }
  .alist .chip { grid-area: chip; justify-self: start; }
  .aitem__actions { grid-area: acts; justify-self: end; }
  .alist .task__link { grid-area: link; }
  .delta { padding: 12px 14px 11px; }
  .spark-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .acard__body { padding: 12px 13px 15px; }
  .acard__head { padding: 13px 13px 11px; }
  .toast-stack { left: 14px; right: 14px; bottom: 14px; }
  .toast { max-width: none; }
}

@media print {
  .masthead__meta, .filters, .tabs, .site-foot, .drawer-root, .toast-stack,
  .agroup__actions, .aitem__actions, .ccard__cta, .eworkspace { display: none !important; }
  .pcard, .stat, .mcard, .hsec, .agroup, .acard, .delta, .ccard, .wcard {
    box-shadow: none;
    break-inside: avoid;
  }
  .csec { break-inside: avoid; }
}
