/* ==========================================================================
   Barakah Logic — dashboard

   A piece of software, not a page. One light canvas, white cards with a
   hairline edge and a whisper of shadow, one blue that means "act", and
   figures set large enough to read from across a desk.

   Depth: cards sit on the canvas by contrast and a 1px edge; the shadow is
   there to be felt, not seen. Colour is meaning: blue is the action and the
   current place, green is done, red is money trouble, and orange is reserved
   for one thing — something that has sat with a client too long.

   ORDER MATTERS. Base components come first, modifiers after: a modifier
   defined above its base class loses at equal specificity. Keep every
   `--modifier` below the class it modifies.
   ========================================================================== */

/* The brand serif survives only in the wordmark. Everything else is the
   platform's own interface face, which is what makes the app feel native on a
   Mac, on Windows and on a phone at once. */
@font-face {
  font-family: 'Fraunces';
  src: url('/static/fonts/fraunces-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---- tokens ------------------------------------------------------------- */

:root {
  /* surfaces */
  --canvas: #f5f7fa;
  --paper: #ffffff;
  --paper-sunk: #f7f9fc;
  --paper-hover: #f9fafb;
  --wash: var(--canvas);

  /* text */
  --ink: #0b1220;
  --body: #1f2a37;
  --muted: #667085;
  --muted-strong: #475467;

  /* edges */
  --rule: #e6eaf0;
  --rule-soft: #eef1f5;
  --rule-strong: #d0d5dd;

  /* meaning */
  --blue: #2563eb;
  --blue-ink: #1d4ed8;
  --blue-wash: #eef3ff;
  --blue-edge: #c7d7fe;
  --green-ink: #067647;
  --green-wash: #ecfdf3;
  --green-edge: #abefc6;
  --red-ink: #b42318;
  --red-wash: #fef3f2;
  --red-edge: #fecdca;
  --accent: #f0891e;        /* gone quiet — the one warm colour */
  --accent-ink: #b54708;
  --accent-deep: #c2410c;
  --accent-wash: #fff7ed;
  --accent-edge: #fed7aa;
  --red: var(--red-ink);

  /* type */
  --display: 'Fraunces', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI Variable Text',
    'Segoe UI', Roboto, system-ui, sans-serif;

  --t-micro: 0.6875rem;   /* 11 */
  --t-fine: 0.8125rem;    /* 13 */
  --t-body: 0.875rem;     /* 14 */
  --t-md: 0.9375rem;      /* 15 */
  --t-lg: 1.0625rem;      /* 17 */
  --t-xl: 1.25rem;        /* 20 */
  --t-2xl: 1.5rem;        /* 24 */
  --t-figure: 2rem;       /* 32 */
  --t-hero: 2.5rem;       /* 40 */

  --h-control: 40px;
  --h-control-sm: 32px;

  --unit: 4px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;
  --side-w: 256px;
  --top-h: 64px;

  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.03);
  --shadow-float: 0 12px 32px rgba(16, 24, 40, 0.12), 0 2px 6px rgba(16, 24, 40, 0.06);
  --ring: 0 0 0 4px rgba(37, 99, 235, 0.16);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: var(--blue-ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

svg {
  display: block;
}

/* The hidden attribute must win over any display an element's own rule
   sets — the icon sprite is an <svg hidden> and would otherwise render as an
   empty 150px box at the top of every page. */
[hidden] {
  display: none !important;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--sm {
  width: 16px;
  height: 16px;
}

/* Every number that can change gets fixed-width digits, so columns do not
   twitch as the data does. */
.num,
td,
.figure,
.chip,
.stat__value,
.metric__value,
.readout__value,
.nav__count {
  font-variant-numeric: tabular-nums;
}

/* ---- shell -------------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100vh;
}

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

.main {
  min-width: 0;
  flex: 1 1 auto;
  width: 100%;
  max-width: 1440px;
  padding: 28px 32px 72px;
}

/* ---- top bar ------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--top-h);
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}

.topbar__brand {
  display: none;
  font-family: var(--display);
  font-size: var(--t-lg);
  color: var(--ink);
  letter-spacing: -0.01em;
}

.topbar__brand:hover {
  text-decoration: none;
}

.topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Phone-only controls. Two classes, so this outranks .icon-btn's own display
   whichever order the rules land in. */
.icon-btn.topbar__toggle,
.icon-btn.topbar__search-link {
  display: none;
}

/* The search field: the first thing on every page, as in any serious tool. */
.search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(440px, 100%);
}

.search__icon {
  position: absolute;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
}

.search__input {
  width: 100%;
  height: var(--h-control);
  padding: 0 60px 0 40px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--paper-sunk);
  color: var(--ink);
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.search__input::placeholder {
  color: var(--muted);
}

.search__input:hover {
  border-color: var(--rule-strong);
}

.search__input:focus {
  outline: none;
  background: var(--paper);
  border-color: var(--blue);
  box-shadow: var(--ring);
}

.search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search__kbd {
  position: absolute;
  right: 10px;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  color: var(--muted);
  font-family: var(--sans);
  font-size: var(--t-micro);
  font-weight: 500;
  pointer-events: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--h-control);
  height: var(--h-control);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--muted-strong);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.icon-btn:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
  background: var(--paper-hover);
  text-decoration: none;
}

.icon-btn:active {
  transform: scale(0.97);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue-wash);
  border: 1px solid var(--blue-edge);
  color: var(--blue-ink);
  font-size: var(--t-fine);
  font-weight: 600;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}

.avatar--sm {
  width: 30px;
  height: 30px;
  font-size: var(--t-micro);
}

/* Covers the canvas while the drawer is open. */
.scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(11, 18, 32, 0.4);
  backdrop-filter: blur(2px);
}

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

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 16px 16px;
  background: var(--paper);
  border-right: 1px solid var(--rule);
  overflow-y: auto;
}

.side__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 12px;
}

.side__close {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand__logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: -0.02em;
  flex: 0 0 auto;
}

.brand__mark {
  display: block;
  font-family: var(--display);
  font-size: var(--t-md);
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.brand__sub {
  display: block;
  margin-top: 2px;
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav__label {
  padding: 0 12px;
  margin: 14px 0 6px;
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--r-md);
  color: var(--muted-strong);
  font-size: var(--t-body);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.nav__link .icon {
  color: var(--muted);
  transition: color 0.15s var(--ease);
}

.nav__link:hover {
  background: var(--paper-hover);
  color: var(--ink);
  text-decoration: none;
}

.nav__link:hover .icon {
  color: var(--ink);
}

.nav__link[aria-current='page'] {
  background: var(--blue-wash);
  color: var(--blue-ink);
  font-weight: 600;
}

.nav__link[aria-current='page'] .icon {
  color: var(--blue);
}

/* The reference's tell: a short blue bar on the active row's left edge. */
.nav__link[aria-current='page']::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--blue);
}

.nav__text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A count only appears when it is non-zero — a row of grey zeroes is noise. */
.nav__count {
  min-width: 22px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: var(--r-pill);
  background: var(--paper-sunk);
  border: 1px solid var(--rule);
  font-size: var(--t-micro);
  font-weight: 600;
  color: var(--muted-strong);
}

.nav__link[aria-current='page'] .nav__count {
  background: var(--paper);
  border-color: var(--blue-edge);
  color: var(--blue-ink);
}

.nav__count--hot {
  background: var(--accent-wash);
  border-color: var(--accent-edge);
  color: var(--accent-ink);
}

.side__foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--rule-soft);
}

.side__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  min-width: 0;
}

.side__user-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--t-body);
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side__user-sub {
  display: block;
  font-size: var(--t-micro);
  color: var(--muted);
  font-weight: 400;
}

.side__signout {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
}

/* ---- page head ---------------------------------------------------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-head__lead {
  min-width: 0;
}

.page-head__title {
  font-size: var(--t-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.page-head__sub {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: var(--t-body);
}

.page-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-head__actions > form {
  display: flex;
  align-items: center;
}

.section-label {
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.section-label a {
  color: inherit;
}

/* ---- panels ------------------------------------------------------------- */

.panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  /* A grid item defaults to min-width:auto, which lets a wide table push the
     panel past the viewport instead of scrolling inside it. */
  min-width: 0;
}

.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  flex-wrap: wrap;
  padding: 18px 20px 12px;
}

.panel__title {
  font-size: var(--t-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel__title--sm {
  font-size: var(--t-md);
}

.panel__note {
  font-size: var(--t-fine);
  color: var(--muted);
}

.panel__body {
  padding: 0 20px 20px;
}

.panel__body--pad {
  padding-top: 20px;
}

.panel__foot {
  padding: 12px 20px;
  border-top: 1px solid var(--rule-soft);
  font-size: var(--t-fine);
  color: var(--muted);
}

/* The next-action panel, when it is holding something. */
.panel--focal {
  border-color: var(--blue-edge);
  box-shadow: var(--shadow-card), inset 3px 0 0 var(--blue);
}

.grid {
  display: grid;
  gap: 20px;
}

/* The focal column is deliberately dominant: waiting work is why the overview
   exists, and a 50/50 split would make it a peer of the activity log. */
.grid--split {
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  align-items: start;
}

.stack {
  display: grid;
  gap: 20px;
  min-width: 0;
}

/* ---- KPI cards ---------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat {
  padding: 18px 20px 16px;
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}

.stat__label {
  font-size: var(--t-fine);
  font-weight: 500;
  color: var(--muted-strong);
}

.stat__value {
  margin-top: 8px;
  font-size: var(--t-figure);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.stat__meta {
  margin-top: 8px;
  font-size: var(--t-fine);
  color: var(--muted);
}

.stat--lead {
  border-color: var(--blue-edge);
  background: linear-gradient(180deg, #fff 0%, var(--blue-wash) 160%);
}

.stat--lead .stat__value {
  color: var(--blue-ink);
}

/* ---- readout (the engagement headline) ---------------------------------- */

.readout {
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(0, 1fr);
  gap: 20px 32px;
  align-items: center;
  padding: 6px 0 10px;
}

.readout__figure {
  display: grid;
  gap: 4px;
  padding-right: 32px;
  border-right: 1px solid var(--rule);
}

.readout__value {
  font-size: var(--t-hero);
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.03em;
}

.readout__label {
  font-size: var(--t-fine);
  font-weight: 500;
  color: var(--muted-strong);
}

.readout__meta {
  font-size: var(--t-fine);
  color: var(--muted);
}

.readout__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px 20px;
}

.metric {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.metric__label {
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.metric__value {
  font-size: var(--t-xl);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.metric__meta {
  font-size: var(--t-fine);
  color: var(--muted);
}

/* ---- section dwell bars ------------------------------------------------- */

.bar__track {
  display: block;
  width: 100%;
  min-width: 90px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--rule-soft);
  overflow: hidden;
}

.bar__fill {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--blue);
}

/* Widths as stepped classes — the CSP forbids inline style attributes, and
   this keeps the chart readable with JavaScript unavailable. */
.bar__fill--2 { width: 2%; }
.bar__fill--0 { width: 2%; }
.bar__fill--5 { width: 5%; }
.bar__fill--10 { width: 10%; }
.bar__fill--15 { width: 15%; }
.bar__fill--20 { width: 20%; }
.bar__fill--25 { width: 25%; }
.bar__fill--30 { width: 30%; }
.bar__fill--35 { width: 35%; }
.bar__fill--40 { width: 40%; }
.bar__fill--45 { width: 45%; }
.bar__fill--50 { width: 50%; }
.bar__fill--55 { width: 55%; }
.bar__fill--60 { width: 60%; }
.bar__fill--65 { width: 65%; }
.bar__fill--70 { width: 70%; }
.bar__fill--75 { width: 75%; }
.bar__fill--80 { width: 80%; }
.bar__fill--85 { width: 85%; }
.bar__fill--90 { width: 90%; }
.bar__fill--95 { width: 95%; }
.bar__fill--100 { width: 100%; }

.table__bar-col {
  width: 34%;
  min-width: 110px;
}

.table__section {
  color: var(--ink);
  font-weight: 500;
  min-width: 200px;
}

.table__when {
  white-space: nowrap;
}

.table__where {
  white-space: nowrap;
  color: var(--muted-strong);
}

/* ---- facts list --------------------------------------------------------- */

.facts {
  margin: 0;
  display: grid;
}

.facts__row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: var(--t-body);
}

.facts__row:last-child {
  border-bottom: none;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  color: var(--body);
  overflow-wrap: anywhere;
}

/* ---- rows (the waiting list) -------------------------------------------- */

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

/* The signature: a sent item carries its temperature on a left rule that warms
   as it ages. Fresh is almost invisible; stale is the only solid warm colour. */
.row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
  padding: 14px 14px 14px 20px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}

.row:hover {
  border-color: var(--rule-strong);
  box-shadow: var(--shadow-card);
}

.row__rule {
  position: absolute;
  left: 8px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 3px;
  background: var(--rule);
}

.row--due .row__rule {
  background: var(--blue);
}

.row--late .row__rule {
  background: var(--accent);
}

.row--stale .row__rule {
  background: var(--accent-deep);
}

.row__main {
  min-width: 0;
}

.row__title {
  display: block;
  font-size: var(--t-md);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.005em;
  overflow-wrap: anywhere;
}

.row__title:hover {
  color: var(--blue-ink);
  text-decoration: none;
}

.row__meta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: var(--t-fine);
  color: var(--muted);
}

.row__meta a {
  color: var(--muted-strong);
}

.row__meta a:hover {
  color: var(--ink);
}

/* Every control on this side sits on the same 32px line. */
.row__side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  color: var(--rule-strong);
}

/* ---- chips -------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.chip--quiet {
  background: var(--paper-sunk);
  border-color: var(--rule);
  color: var(--muted-strong);
}

.chip--fresh {
  background: var(--paper);
  border-color: var(--rule);
  color: var(--muted-strong);
}

.chip--due {
  background: var(--blue-wash);
  border-color: var(--blue-edge);
  color: var(--blue-ink);
}

.chip--late {
  background: var(--accent-wash);
  border-color: var(--accent-edge);
  color: var(--accent-ink);
}

/* The one solid warm fill in the interface: work that has gone quiet. */
.chip--stale {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #fff;
}

.chip--won {
  background: var(--green-wash);
  border-color: var(--green-edge);
  color: var(--green-ink);
}

.chip--lost {
  background: var(--paper-sunk);
  border-color: var(--rule);
  color: var(--muted);
}

.chip--type {
  background: transparent;
  border-color: var(--rule);
  color: var(--muted-strong);
  font-weight: 500;
}

.chip--past-due {
  background: var(--red-wash);
  border-color: var(--red-edge);
  color: var(--red-ink);
}

/* In a row's control cluster the chip is part of the 32px line. */
.row__side .chip {
  height: var(--h-control-sm);
  padding: 0 11px;
  font-size: var(--t-fine);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--h-control);
  padding: 0 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink);
  font-size: var(--t-body);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease),
    box-shadow 0.15s var(--ease), transform 0.1s var(--ease);
}

.btn:hover {
  background: var(--paper-hover);
  border-color: #b9c0cc;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.3);
}

.btn--primary:hover {
  background: var(--blue-ink);
  border-color: var(--blue-ink);
}

.btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted-strong);
  font-weight: 500;
  box-shadow: none;
}

.btn--ghost:hover {
  background: var(--paper-hover);
  color: var(--ink);
  border-color: transparent;
}

.btn--danger {
  color: var(--red-ink);
  border-color: var(--red-edge);
}

.btn--danger:hover {
  background: var(--red-wash);
  border-color: var(--red-ink);
}

.btn--sm {
  height: var(--h-control-sm);
  padding: 0 12px;
  font-size: var(--t-fine);
  border-radius: var(--r-sm);
}

/* ---- forms -------------------------------------------------------------- */

.form {
  display: grid;
  gap: 20px;
  max-width: 760px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field__label {
  font-size: var(--t-fine);
  font-weight: 500;
  color: var(--body);
}

.field__hint {
  font-size: var(--t-fine);
  color: var(--muted);
}

.input,
.select,
.textarea {
  width: 100%;
  height: var(--h-control);
  padding: 0 12px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink);
  font-size: var(--t-body);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #b9c0cc;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: var(--ring);
}

.textarea {
  height: auto;
  min-height: 104px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.55;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%23667085' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

/* Compact variant. Defined AFTER .select so it actually wins. */
.select--quick {
  height: var(--h-control-sm);
  width: auto;
  min-width: 140px;
  padding: 0 30px 0 11px;
  border-radius: var(--r-sm);
  background-position: right 10px center;
  border-color: var(--rule);
  font-size: var(--t-fine);
  color: var(--muted-strong);
  box-shadow: none;
}

.select--quick:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
}

.input--search {
  height: var(--h-control-sm);
  width: auto;
  min-width: 240px;
  font-size: var(--t-fine);
  border-radius: var(--r-sm);
  border-color: var(--rule);
  box-shadow: none;
}

.input--sm {
  height: var(--h-control-sm);
  font-size: var(--t-fine);
  border-radius: var(--r-sm);
  box-shadow: none;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px 18px;
  align-items: end;
}

.form__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  flex-wrap: wrap;
}

.form__actions .spacer {
  margin-left: auto;
}

.fieldset {
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow-card);
  padding: 22px 22px 24px;
  margin: 0;
  display: grid;
  gap: 18px;
  min-width: 0;
}

/* Floated, so the browser stops rendering it in the border gap and it
   becomes an ordinary heading inside the card (a grid item, like the rest). */
.fieldset__legend {
  float: left;
  width: 100%;
  font-size: var(--t-md);
  font-weight: 600;
  color: var(--ink);
  padding: 0;
  margin-bottom: -2px;
}

/* A checkbox sitting inline with its own label. */
.field__label--checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  min-height: var(--h-control);
}

.field__label--checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.errors {
  border: 1px solid var(--red-edge);
  background: var(--red-wash);
  color: var(--red-ink);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: var(--t-body);
}

.errors ul {
  margin: 0;
  padding-left: 18px;
}

/* ---- quick status control ----------------------------------------------- */

/* Progressive enhancement: with JavaScript the select submits on change, so
   the Save button is redundant and hidden. Without it, the button is the only
   way to commit — so it stays. */
.quick {
  display: flex;
  align-items: center;
  gap: 6px;
}

.js .quick__go {
  display: none;
}

/* A 32px square keeps the hit area honest for a single glyph. */
.row__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--h-control-sm);
  height: var(--h-control-sm);
  border-radius: var(--r-sm);
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--muted-strong);
  text-decoration: none;
  font-size: var(--t-body);
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.row__link:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
  text-decoration: none;
}

/* ---- filters ------------------------------------------------------------ */

.filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--h-control-sm);
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--muted-strong);
  font-size: var(--t-fine);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.filter:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
  text-decoration: none;
}

.filter[aria-current='true'] {
  background: var(--blue-wash);
  border-color: var(--blue-edge);
  color: var(--blue-ink);
  font-weight: 600;
}

.filters__spacer {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.timeline-filter {
  font: inherit;
}

/* ---- tables ------------------------------------------------------------- */

.table-wrap {
  /* Positioned, so an absolutely placed descendant (a .sr-only header) is
     contained here and clipped by this scroll box instead of widening the
     page — that was a 214px horizontal scroll on the record page at 375px. */
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-body);
}

.table th {
  text-align: left;
  padding: 10px 20px;
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  background: var(--paper-sunk);
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  white-space: nowrap;
}

.table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: var(--paper-hover);
}

.table__num {
  text-align: right;
  white-space: nowrap;
}

/* A glance is real data but not a read — present, and visibly lesser. */
.table__row--faint td {
  color: var(--muted);
}

.table__name {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.table__name:hover {
  color: var(--blue-ink);
}

.table__sub {
  display: block;
  font-size: var(--t-fine);
  color: var(--muted);
  font-weight: 400;
}

/* Per-row correction buttons on the visits table. */
.table__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.table__actions .btn {
  white-space: nowrap;
}

/* ---- activity feed ------------------------------------------------------ */

.feed {
  display: flex;
  flex-direction: column;
}

.feed__item {
  display: grid;
  gap: 3px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: var(--t-body);
}

.feed__item:last-child {
  border-bottom: none;
}

.feed__item[hidden] {
  display: none;
}

.feed__summary {
  color: var(--body);
  overflow-wrap: anywhere;
}

.feed__when {
  color: var(--muted);
  font-size: var(--t-fine);
}

/* ---- empty states, notices ---------------------------------------------- */

.empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--rule-strong);
  border-radius: 12px;
  background: var(--paper-sunk);
  font-size: var(--t-body);
}

.empty__title {
  font-size: var(--t-md);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.empty--clear {
  border-style: solid;
  border-color: var(--green-edge);
  background: var(--green-wash);
  color: var(--green-ink);
}

.empty--clear .empty__title {
  color: var(--green-ink);
}

.notice {
  margin-bottom: 20px;
  padding: 11px 16px;
  border: 1px solid var(--green-edge);
  background: var(--green-wash);
  color: var(--green-ink);
  border-radius: var(--r-md);
  font-size: var(--t-fine);
  font-weight: 500;
}

.notice--bad {
  border-color: var(--red-edge);
  background: var(--red-wash);
  color: var(--red-ink);
}

.note {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: var(--paper-sunk);
  border: 1px solid var(--rule);
  font-size: var(--t-fine);
  color: var(--muted-strong);
}

.note--warn {
  background: var(--accent-wash);
  border-color: var(--accent-edge);
  color: var(--accent-ink);
}

/* ---- disclosure (the "everything else" fold) ---------------------------- */

.disclosure {
  border-top: 1px solid var(--rule-soft);
}

.disclosure__summary {
  cursor: pointer;
  padding: 12px 20px;
  font-size: var(--t-fine);
  font-weight: 500;
  color: var(--muted-strong);
  list-style: none;
}

.disclosure__summary::-webkit-details-marker {
  display: none;
}

.disclosure__summary::before {
  content: '\25B8\00A0';
}

.disclosure[open] > .disclosure__summary::before {
  content: '\25BE\00A0';
}

.disclosure__body {
  padding: 0 20px 16px;
}

.hash {
  letter-spacing: 0.02em;
}

/* ---- pipeline strip (client stages) ------------------------------------- */

.pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.pipeline__form {
  display: contents;
}

.pipeline__step,
.build-strip__step {
  display: flex;
  align-items: center;
  gap: 7px;
  height: var(--h-control-sm);
  padding: 0 11px 0 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--muted-strong);
  font-size: var(--t-fine);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.pipeline__step {
  cursor: pointer;
}

.pipeline__step:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
}

.pipeline__num,
.build-strip__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--paper-sunk);
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
}

.pipeline__step--current,
.build-strip__step--current {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.pipeline__step--current .pipeline__num,
.build-strip__step--current .build-strip__num {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.next-action__text {
  font-size: var(--t-lg);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
}

.people__add {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--rule-soft);
}

/* ---- projects board ----------------------------------------------------- */

/* Nine-plus-one columns, wider than almost any viewport on purpose: the board
   scrolls sideways inside itself, never the page. */
.board {
  display: flex;
  gap: 12px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 12px;
}

.board__col {
  flex: 1 1 0;
  min-width: 196px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  background: #eef1f5;
  border-radius: 14px;
}

.board__col-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 0;
}

.board__col-title {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-strong);
}

.board__col-count {
  font-size: var(--t-fine);
  color: var(--muted);
}

.board__col-empty {
  padding: 8px 6px 4px;
  font-size: var(--t-fine);
  color: var(--muted);
}

.board__cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.board__card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.board__card:hover {
  border-color: var(--rule-strong);
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
  text-decoration: none;
}

.board__card-client {
  font-size: var(--t-md);
  font-weight: 600;
  color: var(--ink);
}

.board__card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.board__card-next {
  font-size: var(--t-fine);
  color: var(--muted-strong);
}

.build-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.build-strip__step--done .build-strip__num {
  background: var(--green-wash);
  color: var(--green-ink);
}

.build-strip__step--hold {
  border-color: var(--accent-edge);
  background: var(--accent-wash);
  color: var(--accent-ink);
}

.build-strip__step--hold .build-strip__num {
  background: transparent;
  color: inherit;
}

.move-stage__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- go-live checklist -------------------------------------------------- */

.checklist {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
}

.checklist__item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule-soft);
  font-size: var(--t-body);
}

.checklist__item:last-child {
  border-bottom: none;
}

.checklist__mark {
  flex: 0 0 18px;
  color: var(--green-ink);
  font-weight: 700;
}

.checklist__label {
  flex: 1 1 auto;
  color: var(--body);
}

.checklist__item--done .checklist__label {
  color: var(--muted-strong);
}

.checklist__item--future {
  background: var(--paper-sunk);
  color: var(--muted);
}

.checklist__item--future .checklist__label {
  color: var(--muted);
}

.checklist__at {
  flex: 0 0 auto;
  font-size: var(--t-fine);
  color: var(--muted);
}

.checklist__pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: var(--t-fine);
  line-height: 1.6;
  background: var(--paper-sunk);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin: 0 0 10px;
}

.mx-diff {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--red-wash);
  border: 1px solid var(--red-edge);
  border-radius: var(--r-md);
}

.mx-diff h4 {
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--red-ink);
  margin-bottom: 4px;
}

.mx-diff ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--t-fine);
  color: var(--red-ink);
}

/* ---- search page -------------------------------------------------------- */

.search-page__form {
  max-width: 560px;
  margin-bottom: 24px;
}

.results {
  display: grid;
  gap: 20px;
}

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

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(37, 99, 235, 0.08), transparent 60%),
    var(--canvas);
}

.login__card {
  width: 100%;
  max-width: 400px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 20px;
  box-shadow: var(--shadow-float);
  padding: 32px;
}

.login__logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 20px;
  margin-bottom: 18px;
}

.login__brand {
  font-size: var(--t-xl);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.login__sub {
  margin: 4px 0 24px;
  font-size: var(--t-body);
  color: var(--muted);
}

/* ---- utilities ---------------------------------------------------------- */

.inline-form {
  display: inline-flex;
  align-items: center;
}

.muted {
  color: var(--muted);
}

.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;
}

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

@media (max-width: 1180px) {
  .grid--split {
    grid-template-columns: minmax(0, 1fr);
  }

  .readout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .readout__figure {
    padding-right: 0;
    padding-bottom: 16px;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
}

/*
 * Below 900px the sidebar becomes a drawer. The menu button sits on the
 * right, where a thumb is; the drawer slides in from the same side.
 */
@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar {
    height: 56px;
    padding: 0 16px;
    gap: 8px;
  }

  .topbar__brand {
    display: block;
  }

  .search {
    display: none;
  }

  .icon-btn.topbar__toggle,
  .icon-btn.topbar__search-link {
    display: inline-flex;
  }

  .topbar .avatar {
    display: none;
  }

  .side {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    z-index: 40;
    width: min(84vw, 300px);
    height: 100dvh;
    padding-top: 16px;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.24s var(--ease), visibility 0.24s;
    border-right: none;
    border-left: 1px solid var(--rule);
  }

  .side__close {
    display: inline-flex;
    width: 36px;
    height: 36px;
  }

  .nav-open .side {
    transform: translateX(0);
    visibility: visible;
    box-shadow: var(--shadow-float);
  }

  .nav-open .scrim {
    display: block;
  }

  .nav-open {
    overflow: hidden;
  }

  .nav__link[aria-current='page']::before {
    left: -16px;
  }

  .main {
    padding: 20px 16px 56px;
  }

  .page-head {
    margin-bottom: 20px;
  }

  .page-head__actions {
    width: 100%;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat {
    padding: 14px 14px 12px;
  }

  .stat__value {
    font-size: var(--t-2xl);
  }

  .row {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 12px 12px 18px;
  }

  .row__side {
    flex-wrap: wrap;
  }

  .facts__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .input--search {
    min-width: 0;
    width: 100%;
  }

  .filters__spacer {
    margin-left: 0;
    width: 100%;
  }

  .panel__head {
    padding: 16px 16px 10px;
  }

  .panel__body {
    padding: 0 16px 16px;
  }

  .panel__foot,
  .disclosure__summary {
    padding-left: 16px;
    padding-right: 16px;
  }

  .table th,
  .table td {
    padding-left: 16px;
    padding-right: 16px;
  }

  .fieldset {
    padding: 18px 16px 20px;
  }

  .mx-diff {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---- Email preview modal ------------------------------------------------------ */
.modal {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
}
.modal::backdrop {
  background: rgba(11, 18, 32, 0.45);
}
.modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
}
.modal__title {
  margin: 0;
  font-size: var(--t-md);
  font-weight: 600;
  white-space: nowrap;
}
.modal__sub {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: var(--t-fine);
  color: var(--muted);
}
.modal__frame {
  display: block;
  width: 100%;
  height: min(72vh, 760px);
  border: 0;
  background: #eef3f7;
}
.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--rule);
}
@media (max-width: 600px) {
  .modal__sub {
    display: none;
  }
}

/* ---- our own website's traffic (views/site.ejs) ------------------------- */

/* A note under a table, explaining what the number does and does not mean.
   The tables here carry more caveats than the rest of the dashboard: a
   per-source visitor count is distinct within that source, page scroll is an
   average of furthest points, and neither survives being read as a plain
   total. */
.panel__note--foot {
  margin: 10px 2px 0;
  line-height: 1.5;
}

/* Label, bar, number — the shape both the funnel and the button counts
   want. A four-column table does not fit the narrow column of the split
   grid: the last heading is cut off and short labels wrap mid-word. */
.tally {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tally__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px auto;
  align-items: center;
  gap: 10px;
}

.tally__label {
  font-size: 14px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.tally__count {
  min-width: 36px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 600;
}

/* The bar is the one thing that may shrink when the column is tight. */
.tally .bar__track {
  min-width: 0;
}

/* Inline SVG rather than a canvas: the CSP forbids inline style attributes,
   and a polyline needs no script to draw. preserveAspectRatio="none" lets one
   viewBox stretch to whatever width the panel has. */
.spark {
  display: block;
  width: 100%;
  height: 92px;
  overflow: visible;
}

.spark__line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.spark__line--alt {
  stroke: var(--accent);
  stroke-dasharray: 3 3;
}

/* The Overview panel's compact version of the same two numbers. */
.site-pulse {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.site-pulse__figure {
  display: block;
  font-size: 28px;
  font-weight: 650;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.site-pulse__label {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

.site-pulse__delta {
  font-size: 13px;
  color: var(--muted);
}
