/* ============================================================
   Shift One — the shared look of every page.
   Grounded in Apple HIG: semantic tokens, base/elevated depth,
   >=4.5:1 contrast (7:1 target for small text). Set in Inter.

   Every view links this and then adds only what is its own. The link
   carries a stamp taken from this file's bytes (app.locals.styleVersion),
   so nothing has to be bumped when it changes.

   Two themes, one design. Dark is the default and lives in :root. Light is a
   second set of the same colour tokens under :root[data-theme="light"], set
   before first paint by /js/theme.js. Everything that is not a colour is the
   same in both: the typeface, the corners, the spacing, the shape of a
   button, a tab, a badge. Depth is the same recipe in both too: a hairline
   edge, a faint light along the top, a soft shadow and a wash that gives a
   surface a little form, each answered by its own token. A rule asks for a
   token; nothing here is written for one theme alone.
   ============================================================ */

/* --- Tokens ------------------------------------------------ */
:root {
  /* The meta tag alone leaves the computed value "normal", so every native
     control — select popups, date pickers, scrollbars — is drawn light on
     this dark page. Declaring it here is what actually switches them. */
  color-scheme: dark;

  /* Surfaces, in zinc: a neutral with a breath of blue, so the violet sits on
     it rather than fighting it. Light uses the same family, a step either side
     of white. Base recedes, elevated advances. */
  --bg-base:        #09090b;
  --bg-elevated:    #131316;
  --bg-elevated-2:  #1b1b20;
  --bg-inset:       #0d0d10;
  --field:          #0d0d10;
  /* What the chosen tab is lifted onto. */
  --seg-on:         #26262c;

  /* Fills for non-text surfaces */
  --fill:           rgba(255,255,255,0.06);
  --fill-strong:    rgba(255,255,255,0.10);

  /* Labels: primary -> quaternary, per HIG label hierarchy */
  --label:          #fafafa;
  --label-2:        #a1a1aa;
  --label-3:        #8d8d98;
  --label-4:        #5b5b66;

  /* Hairlines are translucent, so they sit right on whatever they are drawn
     over: a card, the page, a hovered row. */
  --separator:      rgba(255,255,255,0.08);
  --separator-firm: rgba(255,255,255,0.14);

  /* Accent split: the fill passes 4.5:1 with white text, and the plain accent
     is the brighter dark-mode tint for text and icons. Violet, which on a dark
     page holds its colour where a mid blue goes grey. */
  --accent:         #a78bfa;
  --accent-fill:    #7c3aed;
  --accent-hover:   #8b5cf6;
  --accent-wash:    rgba(139,92,246,0.16);

  --success:        #34d399;
  --success-wash:   rgba(52,211,153,0.14);
  --warning:        #fbbf24;
  --warning-wash:   rgba(251,191,36,0.14);
  --danger:         #f87171;
  --danger-wash:    rgba(248,113,113,0.14);

  /* Solid fills that carry white text in either theme, for the button that
     says yes and the one that says no. */
  --success-solid:  #15803d;
  --danger-solid:   #dc2626;

  /* A surface is a panel with a little light from above: the wash gives it
     form, the edge draws the lit rim itself. Flat fills read as cut-outs;
     these read as panels. */
  --surface-wash:  linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0) 60%);
  --surface-edge:  inset 0 1px 0 rgba(255,255,255,0.06);
  --accent-bright: #c4b5fd;
  /* The shades a tint, a glow and a pressed button are drawn from. Written out
     rather than derived, because a workspace's colour overrides each of them. */
  --accent-mid:    #8b5cf6;
  --accent-deep:   #6d28d9;
  --accent-press:  #5b21b6;

  /* Colours that rules used to spell out, so each theme can answer for them. */
  --page-aura:     radial-gradient(900px 480px at 18% -10%, color-mix(in srgb, var(--accent-mid) 16%, transparent), transparent 70%),
                   radial-gradient(700px 420px at 100% 0%, color-mix(in srgb, var(--accent-deep) 12%, transparent), transparent 65%);
  --sidebar-wash:  linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0));
  --chrome:        rgba(9,9,11,0.72);
  --chrome-table:  rgba(19,19,22,0.88);
  --chrome-strong: rgba(9,9,11,0.86);
  --quiet-fill:    rgba(255,255,255,0.025);
  --scrim:         rgba(0,0,0,0.6);
  --selection-text: #fff;
  /* The line round something tinted with the accent. Taken from the accent so
     it follows whichever theme is on. */
  --accent-line:   color-mix(in srgb, var(--accent) 30%, transparent);

  /* Corners: the same in both themes. A control is rounded, a card more so,
     and only what is round — an avatar, a dot — is a pill. */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 22px;
  --r-pill: 980px;

  /* Elevation: wide and soft, with a tight contact shadow under it, so
     nothing looks stamped on. */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.5);
  --shadow-2: 0 12px 32px -12px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-3: 0 32px 80px -16px rgba(0,0,0,0.75), 0 4px 16px rgba(0,0,0,0.4);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.5), 0 12px 28px -16px rgba(0,0,0,0.65);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sidebar-w: 260px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
          Roboto, system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

/* --- Light theme ------------------------------------------- */
/* The same design in daylight: the page is a hair off white and a card is
   white on a hairline, with the same form and the same soft shadow. Greys are
   zinc, which keeps them neutral against the violet. Text tokens are held to
   4.5:1 on every surface they sit on by scripts/theme-check.js, because the
   dark values cannot simply be inverted: a colour that is bright enough on
   black is too pale on white. */
:root[data-theme="light"] {
  color-scheme: light;

  --bg-base:        #fafafa;
  --bg-elevated:    #ffffff;
  --bg-elevated-2:  #f4f4f5;
  --bg-inset:       #f4f4f5;
  --field:          #ffffff;
  --seg-on:         #ffffff;

  --fill:           rgba(24,24,27,0.05);
  --fill-strong:    rgba(24,24,27,0.09);

  --label:          #18181b;
  --label-2:        #52525b;
  --label-3:        #6b6b75;
  --label-4:        #a1a1aa;

  --separator:      rgba(24,24,27,0.10);
  --separator-firm: rgba(24,24,27,0.17);

  /* On white, the dark theme's pale tint is unreadable; the accent that reads
     as text is the deep one, and the fill that carries white text is the same
     violet it is on black. */
  --accent:         #6d28d9;
  --accent-fill:    #7c3aed;
  --accent-hover:   #6d28d9;
  --accent-wash:    rgba(124,58,237,0.10);
  --accent-bright:  #8b5cf6;
  --accent-mid:     #8b5cf6;
  --accent-deep:    #6d28d9;
  --accent-press:   #5b21b6;

  --success:        #047857;
  --success-wash:   rgba(5,150,105,0.10);
  --warning:        #9a4708;
  --warning-wash:   rgba(217,119,6,0.12);
  --danger:         #b91c1c;
  --danger-wash:    rgba(220,38,38,0.09);

  /* The light is on the top edge of a surface in the dark theme; on white it
     is the shade that gathers at the bottom that gives it form. */
  --surface-wash:  linear-gradient(180deg, rgba(255,255,255,0) 40%, rgba(24,24,27,0.022));
  --surface-edge:  inset 0 1px 0 rgba(255,255,255,0.9);

  --page-aura:     radial-gradient(900px 480px at 18% -10%, color-mix(in srgb, var(--accent-mid) 9%, transparent), transparent 70%),
                   radial-gradient(700px 420px at 100% 0%, color-mix(in srgb, var(--accent-deep) 6%, transparent), transparent 65%);
  --sidebar-wash:  linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0));
  --chrome:        rgba(250,250,250,0.78);
  --chrome-table:  rgba(250,250,250,0.92);
  --chrome-strong: rgba(250,250,250,0.94);
  --quiet-fill:    rgba(24,24,27,0.025);
  --scrim:         rgba(24,24,27,0.38);
  --selection-text: var(--label);

  --shadow-1: 0 1px 2px rgba(24,24,27,0.06);
  --shadow-2: 0 12px 32px -12px rgba(24,24,27,0.16), 0 2px 6px rgba(24,24,27,0.05);
  --shadow-3: 0 32px 80px -16px rgba(24,24,27,0.28), 0 4px 16px rgba(24,24,27,0.08);
  --shadow-card: 0 1px 2px rgba(24,24,27,0.05), 0 12px 28px -18px rgba(24,24,27,0.14);
}

/* --- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  /* Two fixed auras over the black. They never scroll, so the page keeps a
     lit top edge however far down you are, and nothing else has to carry a
     gradient of its own. */
  background: var(--page-aura), var(--bg-base);
  background-attachment: fixed;
  color: var(--label);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, p, figure { margin: 0; }
/* Headings break evenly rather than leaving a word on a line of its own. */
h1, h2, h3 { text-wrap: balance; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-wash); color: var(--selection-text); }

/* Focus: always visible, never removed (HIG focus & selection) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 12px 20px; background: var(--accent-fill); color: #fff;
  border-radius: 0 0 var(--r-md) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

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

/* --- Type scale (HIG text styles) -------------------------- */
.t-large-title { font-size: 30px; font-weight: 650; letter-spacing: -0.028em; line-height: 1.15; }
.t-title-1     { font-size: 28px; font-weight: 600; letter-spacing: -0.022em; line-height: 1.2; }
.t-title-2     { font-size: 22px; font-weight: 600; letter-spacing: -0.02em;  line-height: 1.25; }
.t-title-3     { font-size: 19px; font-weight: 600; letter-spacing: -0.018em; line-height: 1.3; }
.t-headline    { font-size: 16px; font-weight: 600; letter-spacing: -0.012em; }
.t-body        { font-size: 15px; font-weight: 400; }
.t-callout     { font-size: 14px; font-weight: 400; }
.t-subhead     { font-size: 13px; font-weight: 500; }
.t-footnote    { font-size: 12px; font-weight: 500; }
.t-caption     { font-size: 11px; font-weight: 500; }
.t-mono        { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0; }

.c-2 { color: var(--label-2); }
.c-3 { color: var(--label-3); }

/* --- App shell --------------------------------------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px 12px;
  background: var(--sidebar-wash);
  border-right: 1px solid var(--separator);
  overflow-y: auto;
}

.identity { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; }
.identity__avatar { position: relative; flex: 0 0 auto; }
.identity__avatar img {
  width: 40px; height: 40px; border-radius: var(--r-pill);
  object-fit: cover; background: var(--bg-elevated);
  border: 1px solid var(--separator);
}
.identity__dot {
  position: absolute; right: -1px; bottom: -1px;
  width: 12px; height: 12px; border-radius: var(--r-pill);
  background: var(--success); border: 2px solid var(--bg-base);
}
.identity__text { min-width: 0; display: flex; flex-direction: column; }
.identity__name {
  font-size: 14px; font-weight: 600; letter-spacing: -0.012em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.identity__meta { font-size: 12px; color: var(--label-3); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__label {
  padding: 0 10px 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--label-4);
}

.nav-link {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 38px; padding: 8px 10px;
  border-radius: var(--r-md);
  color: var(--label-2);
  font-size: 14px; font-weight: 500; letter-spacing: -0.01em;
  transition: background 200ms var(--ease), color 200ms var(--ease);
}
.nav-link svg { flex: 0 0 auto; opacity: 0.85; }
.nav-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link:hover { background: var(--fill); color: var(--label); }
.nav-link:hover svg { opacity: 1; }
/* The page you are on: a tint of the accent with the label set in it, and a
   hairline round it. The tint is shape and weight as well as colour, so it
   still reads as current to somebody who cannot tell violet from grey. */
.nav-link[aria-current="page"],
.nav-link[aria-current="page"]:hover {
  background: var(--accent-wash);
  color: var(--accent); font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.nav-link[aria-current="page"] svg { opacity: 1; color: var(--accent); }
.nav-link--danger:hover { background: var(--danger-wash); color: var(--danger); }

/* The install entry is a button, not a link: it opens Chrome's install
   prompt rather than navigating. The button reset does not cover text, and
   .nav-link's display would otherwise beat [hidden] in the UA sheet, leaving
   it on screen in browsers that cannot install anything.

   No width: the column nav already stretches its items, and setting one
   makes the button 756px wide once the nav turns into a horizontal
   scroller on a phone, pushing everything after it off screen. */
button.nav-link { font: inherit; font-size: 14px; font-weight: 500; text-align: left; }
button.nav-link[hidden] { display: none; }

.nav__divider { height: 1px; margin: 8px 10px; background: var(--separator); }

.sidebar__footer { margin-top: auto; }

.promo {
  display: block; padding: 14px;
  background: var(--bg-elevated); border: 1px solid var(--separator);
  border-radius: var(--r-lg);
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.promo:hover { border-color: var(--separator-firm); background: var(--bg-elevated-2); }
.promo__title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.promo__title svg { color: var(--label-3); }
.promo__body { margin-top: 4px; font-size: 12px; color: var(--label-3); }

/* --- Main ---------------------------------------------------- */
.main { flex: 1 1 auto; min-width: 0; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 40px 40px 80px; }
.wrap--narrow { max-width: 780px; }

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 32px;
}
.page-head__text { min-width: 0; }
.page-head__eyebrow {
  margin-bottom: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent);
}
.page-head__sub { margin-top: 6px; font-size: 15px; color: var(--label-2); }
.page-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; font-size: 13px; font-weight: 500; color: var(--label-3);
}
.breadcrumb a { transition: color 200ms var(--ease); }
.breadcrumb a:hover { color: var(--label); }
.breadcrumb svg { opacity: 0.6; }

/* --- Buttons ------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 8px 16px;
  border: 1px solid transparent; border-radius: var(--r-md);
  background: var(--fill); color: var(--label);
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; white-space: nowrap;
  transition: background 200ms var(--ease), border-color 200ms var(--ease), transform 200ms var(--ease), opacity 200ms var(--ease);
}
.btn:hover { background: var(--fill-strong); }
.btn:active { transform: scale(0.97); }
.btn svg { flex: 0 0 auto; }

/* The primary button is the one lit thing on the page: a gradient that deepens
   from top to bottom, a rim of light along its top edge, and a shadow in its
   own colour. Built from the accent tokens, because a workspace's colour
   overrides them, and the same in either theme. */
.btn--primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-fill) 92%, white), var(--accent-fill) 55%, var(--accent-deep));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 1px 2px rgba(0,0,0,0.18), 0 6px 16px -4px color-mix(in srgb, var(--accent-fill) 45%, transparent);
}
.btn--primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.26), 0 1px 2px rgba(0,0,0,0.18), 0 10px 22px -4px color-mix(in srgb, var(--accent-fill) 55%, transparent);
}
.btn--primary:active { transform: scale(0.98); filter: brightness(0.96); box-shadow: inset 0 1px 0 rgba(255,255,255,0.16); }

.btn--secondary { background: var(--bg-elevated); border-color: var(--separator-firm); color: var(--label); box-shadow: var(--shadow-1); }
.btn--secondary:hover { background: var(--bg-elevated-2); border-color: var(--label-4); }

.btn--danger { background: var(--danger-wash); color: var(--danger); }
.btn--danger:hover { background: var(--danger-solid); color: #fff; }

.btn--ghost { background: transparent; color: var(--label-2); }
.btn--ghost:hover { background: var(--fill); color: var(--label); }

.btn--sm { min-height: 30px; padding: 5px 12px; font-size: 13px; }
.btn--lg { min-height: 46px; padding: 12px 24px; font-size: 16px; }
.btn--block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

/* Icon-only buttons keep a 38px hit area (HIG target sizing) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: 0 0 auto;
  border: 1px solid transparent; border-radius: var(--r-md);
  background: transparent; color: var(--label-2);
  cursor: pointer;
  transition: background 200ms var(--ease), color 200ms var(--ease);
}
.icon-btn:hover { background: var(--fill); color: var(--label); }
.icon-btn--danger:hover { background: var(--danger-wash); color: var(--danger); }

/* --- Cards --------------------------------------------------- */
.card {
  background: var(--surface-wash), var(--bg-elevated);
  border: 1px solid var(--separator);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--surface-edge), var(--shadow-card);
}
.card--flush { padding: 0; overflow: hidden; }

/* A card you can click rises to meet the pointer; a card you only read
   stays where it is. */
a.card, .card--tappable {
  display: block;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
a.card:hover, .card--tappable:hover {
  transform: translateY(-2px);
  border-color: var(--separator-firm);
  box-shadow: var(--surface-edge), var(--shadow-2);
}
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 16px;
}
.card__title { font-size: 16px; font-weight: 600; letter-spacing: -0.012em; }
.card__sub { margin-top: 3px; font-size: 13px; color: var(--label-3); }

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

/* --- Stat tiles ---------------------------------------------- */
/* Laid out the way the design draws a card: what the figure is at the top,
   the figure itself on the bottom edge, and its change beside it on the
   right. The placing is by named area, so a page whose markup puts the value
   before its subtitle still reads top-down in that order. */
.stat {
  position: relative; overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto 1fr;
  grid-template-areas:
    "top   top"
    "label label"
    "meta  meta"
    "value delta";
  min-height: 146px;
  background: var(--surface-wash), var(--bg-elevated);
  border: 1px solid var(--separator);
  border-radius: var(--r-xl); padding: 18px 20px;
  box-shadow: var(--surface-edge), var(--shadow-1);
  transition: border-color 200ms var(--ease), transform 200ms var(--ease);
}
.stat:hover { border-color: var(--separator-firm); transform: translateY(-1px); }

/* The row some tiles carry above the title: the icon on the left, and
   whatever the page puts on the right — a change, a period. */
.stat__top {
  grid-area: top;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}

/* The title reads as a title — sentence case, at text size — with the line
   beneath it saying what is being counted, as the design has it. */
.stat__label {
  grid-area: label;
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; font-weight: 600; color: var(--label);
  text-transform: none; letter-spacing: -0.012em;
}
.stat__meta { grid-area: meta; margin-top: 3px; font-size: 12px; color: var(--label-3); }
.stat__value {
  grid-area: value; align-self: end; margin-top: 14px;
  font-size: 34px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.04;
  font-variant-numeric: tabular-nums;
}
/* The change sits on the value's own line, out at the right edge, rather
   than under it. */
.stat__delta { grid-area: delta; align-self: end; justify-self: end; }

/* The icon chip a tile carries. Accent by default; a page says otherwise
   only where the figure means something — done is green, overdue is red —
   so colour never contradicts the words beside it. */
.stat .stat__icon,
.stat .stat__label > svg {
  background: var(--accent-wash); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent-mid) 26%, transparent);
}
.stat--success .stat__icon, .stat--success .stat__label > svg {
  background: var(--success-wash); color: var(--success); border-color: color-mix(in srgb, var(--success) 26%, transparent);
}
.stat--warning .stat__icon, .stat--warning .stat__label > svg {
  background: var(--warning-wash); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 26%, transparent);
}
.stat--danger .stat__icon, .stat--danger .stat__label > svg {
  background: var(--danger-wash); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 26%, transparent);
}
.stat--quiet .stat__icon, .stat--quiet .stat__label > svg {
  background: var(--fill); color: var(--label-2); border-color: transparent;
}

/* Pages that keep the icon inline in the label get the same chip, so a row
   of tiles reads the same wherever you are. */
.stat__label > svg {
  flex: none; box-sizing: border-box;
  width: 26px; height: 26px; padding: 6px;
  border-radius: var(--r-md);
}

/* --- Section headings ----------------------------------------- */
/* A heading over a block, with room on the right for the count or the link
   that belongs to it. Was written into one page; every page that has a row
   of tiles now puts a heading over them, so it lives here. */
.section__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.section__title { font-size: 17px; font-weight: 600; letter-spacing: -0.016em; }

/* --- Badges: never colour alone — each carries a glyph -------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-sm);
  background: var(--fill); color: var(--label-2);
  font-size: 11px; font-weight: 600; letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge svg, .badge .dot { flex: 0 0 auto; }
.badge .dot { width: 6px; height: 6px; border-radius: var(--r-pill); background: currentColor; }
.badge { border: 1px solid transparent; }
.badge--success { background: var(--success-wash); color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.badge--warning { background: var(--warning-wash); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.badge--danger  { background: var(--danger-wash);  color: var(--danger);  border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.badge--accent  { background: var(--accent-wash);  color: var(--accent);  border-color: color-mix(in srgb, var(--accent-mid) 34%, transparent); }

/* --- Forms --------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 13px; font-weight: 600; letter-spacing: -0.008em; }
.field__hint { font-size: 12px; color: var(--label-3); }
.field__error { font-size: 12px; font-weight: 500; color: var(--danger); }

.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 9px 14px;
  background: var(--field); color: var(--label);
  border: 1px solid var(--separator-firm); border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  font-size: 14px; outline: none;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--label-4); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--label-4); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-wash), var(--shadow-1);
  outline: none;
}
.select {
  appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  /* The list that opens is drawn by the browser, and takes its colours from
     color-scheme, which the page sets for whichever theme is on. */
}

/* Belt to that braces. Chrome on Windows and Linux honours colours set on
   an option and will use these; macOS and Safari ignore them and rely on
   color-scheme above. Set on both so neither route leaves it unreadable. */
.select option {
  background-color: var(--bg-elevated);
  color: var(--label);
}

.search { position: relative; display: flex; align-items: center; }
.search svg {
  position: absolute; left: 13px; pointer-events: none;
  color: var(--label-3);
}
.search .input { padding-left: 38px; }

/* --- Top bar ----------------------------------------------------- */
/* One row across the top of the content: search on the left, the workspace's
   own controls on the right. It sticks, so search is always a keystroke away
   however far down the page you are. */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 40px;
  background: var(--chrome);
  border-bottom: 1px solid var(--separator);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
}
.topbar__search { flex: 1 1 auto; max-width: 520px; position: relative; }
.topbar__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar__me img {
  width: 32px; height: 32px; border-radius: var(--r-pill);
  object-fit: cover; background: var(--bg-elevated);
  border: 1px solid var(--separator);
}
.topbar__me:hover img { border-color: var(--accent); }

/* --- Search results ---------------------------------------------- */
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 40;
  max-height: min(60vh, 460px); overflow-y: auto;
  padding: 6px;
  background: var(--surface-wash), var(--bg-elevated);
  border: 1px solid var(--separator-firm);
  border-radius: var(--r-lg);
  box-shadow: var(--surface-edge), var(--shadow-3);
}
.search-results[hidden] { display: none; }
/* A notice that is filled in and shown by a script starts hidden; its own display would otherwise win. */
.notice[hidden] { display: none; }

/* The links to the policies, at the bottom of every page outside a workspace. */
.legal-footer {
  max-width: 1100px; margin: 48px auto 0; padding: 22px 24px 32px;
  border-top: 1px solid var(--separator);
  font-size: 12.5px; line-height: 1.6; color: var(--label-2);
}
.legal-footer__line { margin: 0 0 10px; }
.legal-footer__links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.legal-footer__links a { color: var(--label-2); }
.legal-footer__links a:hover { color: var(--accent); text-decoration: underline; }
.search-results__group {
  padding: 10px 10px 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--label-4);
}
.search-results__note { padding: 14px 10px; font-size: 13px; color: var(--label-3); }

.search-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 10px; border-radius: var(--r-md);
  transition: background 160ms var(--ease);
}
.search-item:hover, .search-item.is-active { background: var(--accent-wash); }
.search-item__title {
  font-size: 14px; font-weight: 600; color: var(--label);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-item__meta {
  font-size: 12px; color: var(--label-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 900px) {
  .topbar { padding: 10px 20px; }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 16px; gap: 10px; }
  .topbar__search { max-width: none; }
}

/* --- Lists / rows -------------------------------------------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--separator);
  transition: background 160ms var(--ease);
}
.row:last-child { border-bottom: 0; }
a.row, .row--tappable { position: relative; }
a.row:hover, .row--tappable:hover { background: var(--bg-elevated-2); }
a.row::before, .row--tappable::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 2px; border-radius: 0 2px 2px 0;
  background: var(--accent); opacity: 0;
  transition: opacity 200ms var(--ease);
}
a.row:hover::before, .row--tappable:hover::before { opacity: 1; }
.row__main { min-width: 0; flex: 1 1 auto; }
.row__title {
  font-size: 15px; font-weight: 600; letter-spacing: -0.012em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row__meta {
  margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--label-3);
}
.row__meta .sep { color: var(--label-4); }
.row__aside { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.row__chevron { color: var(--label-4); transition: transform 200ms var(--ease), color 200ms var(--ease); }
a.row:hover .row__chevron { color: var(--label-2); transform: translateX(2px); }

.avatar {
  flex: 0 0 auto; object-fit: cover; background: var(--bg-inset);
  border: 1px solid var(--separator); border-radius: var(--r-md);
  width: 44px; height: 44px;
}
.avatar--round { border-radius: var(--r-pill); }
.avatar--lg { width: 56px; height: 56px; border-radius: var(--r-lg); }

/* --- Empty state --------------------------------------------- */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 64px 32px;
  border: 1px dashed var(--separator-firm); border-radius: var(--r-xl);
}
.empty__icon {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin-bottom: 18px;
  background: var(--surface-wash), var(--bg-elevated);
  border: 1px solid var(--separator);
  border-radius: var(--r-lg); color: var(--label-3);
  box-shadow: var(--surface-edge), var(--shadow-1);
}
.empty__title { font-size: 18px; font-weight: 600; letter-spacing: -0.018em; }
.empty__body { margin: 8px 0 22px; max-width: 42ch; font-size: 14px; color: var(--label-2); line-height: 1.5; }

/* --- Modal (HIG modality: focused, dismissible) --------------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: none; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
  background: var(--scrim);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
}
.modal.is-open { display: flex; }
.modal__box {
  width: 100%; max-width: 460px; max-height: calc(100vh - 40px);
  overflow-y: auto; padding: 26px;
  /* Elevated surface advances above the base layer */
  background: var(--surface-wash), var(--bg-elevated);
  border: 1px solid var(--separator-firm);
  border-radius: var(--r-2xl); box-shadow: var(--surface-edge), var(--shadow-3);
  animation: sheet-in 340ms var(--ease);
}
.modal__title { font-size: 19px; font-weight: 600; letter-spacing: -0.018em; }
.modal__sub { margin-top: 6px; font-size: 14px; color: var(--label-2); }
.modal__body { margin-top: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal__actions { margin-top: 24px; display: flex; gap: 10px; }
.modal__actions .btn { flex: 1 1 auto; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

/* --- Tables --------------------------------------------------- */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 13px 20px; text-align: left; }
.table th {
  position: sticky; top: 0; z-index: 1;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--label-3); border-bottom: 1px solid var(--separator); white-space: nowrap;
  background: var(--chrome-table);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
}
.table td { font-size: 14px; border-bottom: 1px solid var(--separator); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 160ms var(--ease); }
.table tbody tr:hover { background: var(--bg-elevated-2); }

/* --- Tabs ------------------------------------------------------- */
/* A track with the current tab lifted onto it, the way a segmented control
   reads: the same in either theme, the lift being a surface, a hairline and a
   soft shadow. */
.segmented {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--fill); border-radius: var(--r-md);
}
.segmented button {
  position: relative;
  padding: 6px 12px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--label-3);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: color 200ms var(--ease), background 200ms var(--ease), box-shadow 200ms var(--ease);
}
.segmented button:hover { color: var(--label); }
/* The current one is named by weight and colour as well as the lift, so it
   does not rest on a shadow alone. */
.segmented button[aria-selected="true"] {
  background: var(--seg-on);
  color: var(--label);
  box-shadow: var(--shadow-1), 0 0 0 1px var(--separator);
}

/* --- Toasts ------------------------------------------------------ */
.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 17px; max-width: 340px;
  background: var(--surface-wash), var(--bg-elevated-2);
  border: 1px solid var(--separator-firm);
  border-radius: var(--r-lg); box-shadow: var(--surface-edge), var(--shadow-2);
  font-size: 14px; font-weight: 500;
  animation: toast-in 320ms var(--ease);
}
.toast svg { flex: 0 0 auto; }
.toast--success svg { color: var(--success); }
.toast--error svg { color: var(--danger); }
.toast.is-leaving { animation: toast-out 280ms var(--ease) forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(14px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* --- Motion ---------------------------------------------------- */
.fade-in { animation: fade-up 500ms var(--ease) both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* --- Scrollbar -------------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--fill-strong); border-radius: var(--r-pill);
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--label-4); }

/* --- Responsive: sidebar collapses to a scrolling top bar ------- */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; flex: 0 0 auto; height: auto; position: sticky; top: 0; z-index: 40;
    flex-direction: row; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-right: 0; border-bottom: 1px solid var(--separator);
    background: var(--chrome-strong);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    overflow-x: auto; overflow-y: hidden;
  }
  .identity { padding: 0 4px 0 0; flex: 0 0 auto; }
  .identity__text { display: none; }
  .nav { flex-direction: row; align-items: center; gap: 4px; flex: 0 0 auto; }
  .nav__label, .nav__divider, .sidebar__footer { display: none; }
  .nav-link { flex: 0 0 auto; padding: 8px 12px; }
  .wrap { padding: 28px 20px 64px; }
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .wrap { padding: 22px 16px 56px; }
  .t-large-title { font-size: 28px; }
  .t-title-1 { font-size: 24px; }
  .card { padding: 18px; border-radius: var(--r-lg); }
  .page-head { align-items: stretch; gap: 16px; }
  .page-head__actions { width: 100%; }
  .page-head__actions > * { flex: 1 1 auto; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .row { padding: 14px 16px; gap: 12px; }
  .empty { padding: 44px 20px; }
  .modal { align-items: flex-start; padding: 12px; }
  .modal__box { padding: 20px; }
  .table th, .table td { padding: 11px 14px; }
}

/* --- Reduced motion (HIG accessibility) -------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Page layouts
   The arrangement of each page follows Orbit's (PlanetaryOrbit/orbit):
   a picker with cover cards, a dated greeting over the dashboard, a week
   strip over the sessions, a table of staff behind a toolbar, notices
   behind My/Manage tabs, settings beside a list of their sections, and a
   podium over the activity figures. Only the arrangement: every colour,
   type size and surface here is Shift One's own token. Nothing is copied
   from Orbit's source, which is GPL; these are this stylesheet's rules.
   ============================================================ */

/* --- Account bar --------------------------------------------------------
   Pages outside a workspace carry a bar instead of a sidebar, since until a
   workspace is open there is nothing to navigate between. */
.accountbar {
  position: sticky; top: 0; z-index: 40;
  height: 60px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--separator);
  background: var(--chrome);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 600; letter-spacing: -0.014em;
}
.brand img { width: 28px; height: 28px; border-radius: 7px; }

/* The account menu: a <details>, so it opens without script and closes on
   a second press. */
.user-menu { position: relative; }
.user-menu > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 9px;
  padding: 4px 12px 4px 4px; border-radius: var(--r-pill);
  border: 1px solid var(--separator); background: var(--fill);
  font-size: 14px; font-weight: 500;
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover, .user-menu[open] > summary { border-color: var(--separator-firm); background: var(--fill-strong); }
.user-menu > summary img { width: 28px; height: 28px; border-radius: var(--r-pill); object-fit: cover; background: var(--bg-elevated); }
.user-menu > summary svg { color: var(--label-3); transition: transform 200ms var(--ease); }
.user-menu[open] > summary svg { transform: rotate(180deg); }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 45;
  min-width: 248px; padding: 6px;
  background: var(--surface-wash), var(--bg-elevated);
  border: 1px solid var(--separator-firm); border-radius: var(--r-lg);
  box-shadow: var(--surface-edge), var(--shadow-3);
  animation: sheet-in 220ms var(--ease);
}
.menu__head { padding: 10px 10px 12px; border-bottom: 1px solid var(--separator); margin-bottom: 6px; }
.menu__name { font-size: 14px; font-weight: 600; }
.menu__meta { font-size: 12px; color: var(--label-3); }
.menu .nav-link { min-height: 36px; }
.menu .nav__divider { margin: 6px 4px; }

/* A centred column, the width Orbit gives its pages. */
.wrap--column { max-width: 960px; }

/* --- Page heading with a tile beside it --------------------------------- */
.page-head__lead { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-tile {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-wash); color: var(--accent);
  border: 1px solid var(--accent-line);
  overflow: hidden;
}
.page-tile img { width: 100%; height: 100%; object-fit: cover; }
.page-tile--round { border-radius: var(--r-pill); }

/* --- Tabs: two or three views of one page ------------------------------- */
.tabs {
  display: flex; flex-wrap: wrap; gap: 2px;
  margin-bottom: 24px;
  box-shadow: inset 0 -1px 0 var(--separator);
}
.tab {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  font-size: 13.5px; font-weight: 600; color: var(--label-3);
  transition: color 200ms var(--ease);
}
.tab svg { opacity: 0.8; }
.tab:hover { color: var(--label); }
/* The current one is named by weight and colour as well as the rule. */
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--label); }
.tab[aria-selected="true"]::after, .tab[aria-current="page"]::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent-bright), var(--accent-fill));
  border-radius: 2px 2px 0 0;
}
.tab__count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--warning); color: var(--bg-base); font-size: 11px; font-weight: 700;
}
.tab-panel[hidden] { display: none; }

/* --- Section heading inside a page -------------------------------------- */
.pane-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 12px; margin: 30px 0 12px;
}
.pane-head:first-child { margin-top: 0; }
.pane-head__title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; letter-spacing: -0.012em; }
.pane-head__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* --- A stack of item cards ---------------------------------------------- */
.item-stack { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px;
  background: var(--surface-wash), var(--bg-elevated);
  border: 1px solid var(--separator); border-radius: var(--r-lg);
  box-shadow: var(--surface-edge), var(--shadow-1);
  transition: border-color 200ms var(--ease), transform 200ms var(--ease), background 200ms var(--ease);
}
a.item:hover, button.item:hover, .item--tappable:hover {
  border-color: var(--separator-firm); background: var(--surface-wash), var(--bg-elevated-2);
  transform: translateY(-1px);
}
button.item { width: 100%; text-align: left; font: inherit; color: inherit; }
.item__main { min-width: 0; flex: 1 1 auto; }
.item__title {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 15px; font-weight: 600; letter-spacing: -0.012em;
}
.item__meta {
  margin-top: 5px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px;
  font-size: 12px; color: var(--label-3);
}
.item__meta > span { display: inline-flex; align-items: center; gap: 5px; }
.item__meta svg { flex: 0 0 auto; color: var(--label-4); }
.item__aside { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.item__avatar { width: 36px; height: 36px; border-radius: var(--r-pill); object-fit: cover; background: var(--bg-inset); border: 1px solid var(--separator); }

/* --- Week strip (sessions) ---------------------------------------------- */
.weekstrip { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 28px; flex-wrap: wrap; }
.weekstrip__days { display: flex; gap: 8px; }
.daypill {
  width: 54px; padding: 8px 0 9px; border-radius: var(--r-lg);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--surface-wash), var(--bg-elevated);
  border: 1px solid var(--separator);
  color: var(--label); font: inherit; cursor: pointer;
  transition: border-color 200ms var(--ease), background 200ms var(--ease), transform 200ms var(--ease);
}
.daypill:hover { border-color: var(--separator-firm); transform: translateY(-1px); }
.daypill__name { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--label-3); }
.daypill__num { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.daypill__dot { width: 4px; height: 4px; border-radius: var(--r-pill); background: transparent; }
.daypill--busy .daypill__dot { background: var(--accent); }
.daypill[aria-pressed="true"] {
  background: var(--accent-fill); border-color: var(--accent-fill); color: #fff;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent-fill) 35%, transparent);
}
.daypill[aria-pressed="true"] .daypill__name { color: rgba(255,255,255,0.8); }
.daypill[aria-pressed="true"] .daypill__dot { background: #fff; }

/* --- Settings: the list of sections beside the open one ----------------- */
.settings-split { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 24px; align-items: start; }
.side-nav {
  position: sticky; top: 24px;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--surface-wash), var(--bg-elevated);
  border: 1px solid var(--separator); border-radius: var(--r-lg);
  box-shadow: var(--surface-edge), var(--shadow-1);
}
.side-nav a, .side-nav button {
  display: flex; align-items: center; gap: 10px;
  min-height: 38px; padding: 8px 10px; border-radius: var(--r-md);
  font: inherit; font-size: 14px; font-weight: 500; color: var(--label-2); text-align: left;
  transition: background 200ms var(--ease), color 200ms var(--ease);
}
.side-nav a::after, .side-nav button::after {
  content: ""; margin-left: auto; width: 6px; height: 6px;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg); opacity: 0.45;
}
.side-nav a:hover, .side-nav button:hover { background: var(--fill); color: var(--label); }
.side-nav [aria-current="true"], .side-nav [aria-current="page"] { background: var(--accent-wash); color: var(--label); font-weight: 600; }
.side-nav [aria-current="true"] svg, .side-nav [aria-current="page"] svg { color: var(--accent); }
.side-nav svg { flex: 0 0 auto; color: var(--label-3); }
.side-nav__label {
  padding: 12px 10px 4px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--label-4);
}
.side-nav__label:first-child { padding-top: 4px; }
.side-nav .side-nav__danger, .side-nav .side-nav__danger svg { color: var(--danger); }
.side-nav .side-nav__danger:hover { background: var(--danger-wash); }
.side-nav .side-nav__danger[aria-current="page"] { background: var(--danger-wash); }

/* --- Disclosure rows ---------------------------------------------------- */
.disclosure {
  border: 1px solid var(--separator); border-radius: var(--r-lg);
  background: var(--quiet-fill);
}
.disclosure + .disclosure { margin-top: 8px; }
.disclosure > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 11px 14px;
  font-size: 14px; font-weight: 600;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after {
  content: ""; margin-left: auto; width: 7px; height: 7px;
  border-right: 1.6px solid var(--label-3); border-bottom: 1.6px solid var(--label-3);
  transform: rotate(45deg) translateY(-2px); transition: transform 200ms var(--ease);
}
.disclosure[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.disclosure__count { font-size: 12px; font-weight: 500; color: var(--label-3); }
.disclosure__body { padding: 2px 14px 14px; }

/* --- Toolbar over a table ----------------------------------------------- */
.toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px; margin-bottom: 12px;
  background: var(--surface-wash), var(--bg-elevated);
  border: 1px solid var(--separator); border-radius: var(--r-lg);
}
.toolbar .search { flex: 0 1 260px; }
.toolbar .search .input { min-height: 34px; }
.toolbar__end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.person-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person-cell img { width: 32px; height: 32px; border-radius: var(--r-pill); object-fit: cover; background: var(--bg-inset); border: 1px solid var(--separator); flex: 0 0 auto; }
.person-cell__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-cell__handle { font-size: 12px; color: var(--label-3); }
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-top: 1px solid var(--separator); }
.pager__label { font-size: 13px; color: var(--label-3); padding: 0 6px; }

/* --- Podium (activity leaderboard) -------------------------------------- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 14px; padding: 18px 0 4px; }
.podium__place { display: flex; flex-direction: column; align-items: center; width: 132px; min-width: 0; }
.podium__avatar {
  width: 58px; height: 58px; border-radius: var(--r-pill); object-fit: cover;
  background: var(--bg-inset); border: 3px solid var(--medal, var(--label-4));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--medal, var(--label-4)) 18%, transparent);
}
.podium__place--1 .podium__avatar { width: 76px; height: 76px; }
.podium__name { margin-top: 8px; max-width: 100%; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium__figure { font-size: 12px; font-weight: 600; color: var(--label-2); font-variant-numeric: tabular-nums; }
.podium__block {
  margin-top: 10px; width: 100%; border-radius: 12px 12px 4px 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: rgba(0,0,0,0.55);
  background: linear-gradient(180deg, var(--medal), color-mix(in srgb, var(--medal) 78%, transparent));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}
.podium__place--1 { --medal: #ffd60a; }
.podium__place--2 { --medal: #c7c7cc; }
.podium__place--3 { --medal: #e3935a; }
.podium__place--1 .podium__block { height: 104px; }
.podium__place--2 .podium__block { height: 76px; }
.podium__place--3 .podium__block { height: 56px; }
.ranked { margin-top: 18px; border-top: 1px solid var(--separator); }
.ranked__row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--separator); font-size: 14px; }
.ranked__row:last-child { border-bottom: 0; }
.ranked__place { width: 20px; color: var(--label-3); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ranked__figure { margin-left: auto; color: var(--label-2); font-size: 13px; font-variant-numeric: tabular-nums; }

/* --- Create card -------------------------------------------------------- */
.create-card {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; text-align: left; font: inherit; color: inherit;
  border: 1px dashed var(--separator-firm); border-radius: var(--r-lg);
  background: transparent; cursor: pointer;
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.create-card:hover { border-color: var(--accent); background: var(--accent-wash); }
.create-card__icon {
  width: 38px; height: 38px; border-radius: var(--r-md); flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-wash); color: var(--accent);
}
.create-card__title { font-size: 15px; font-weight: 600; }
.create-card__sub { margin-top: 2px; font-size: 13px; color: var(--label-3); }

/* --- Request card (leave notices) -------------------------------------------------------- */
.request__head { display: flex; align-items: center; gap: 12px; }
.request__who { min-width: 0; flex: 1 1 auto; }
.request__name { font-size: 15px; font-weight: 600; }
.request__status { font-size: 12px; color: var(--label-3); }
.request__body {
  margin-top: 12px; padding: 12px 14px;
  background: var(--bg-inset); border: 1px solid var(--separator); border-radius: var(--r-lg);
}
.request__dates { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--label-3); }
.request__reason { margin-top: 5px; font-size: 14px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.request__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
/* Solid fills that keep white text above 4.5:1. */
.btn--approve { background: var(--success-solid); color: #fff; }
.btn--approve:hover { filter: brightness(1.1); }
.btn--deny { background: var(--danger-solid); color: #fff; }
.btn--deny:hover { filter: brightness(1.1); }

/* --- Workspace cover cards (picker) ------------------------------------- */
.covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.cover {
  position: relative; isolation: isolate; display: block;
  aspect-ratio: 2.2 / 1; min-height: 150px;
  border-radius: var(--r-xl); overflow: hidden;
  border: 1px solid var(--separator); background: var(--bg-elevated);
  box-shadow: var(--surface-edge), var(--shadow-2);
  transition: transform 220ms var(--ease), border-color 220ms var(--ease), box-shadow 220ms var(--ease);
}
.cover:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--surface-edge), var(--shadow-3); }
/* The group's own icon, blown up and blurred into the card's backdrop. */
.cover__art {
  position: absolute; inset: -24px; z-index: -2;
  width: calc(100% + 48px); height: calc(100% + 48px); object-fit: cover;
  filter: blur(22px) saturate(150%); opacity: 0.9;
}
.cover::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.35) 45%, rgba(0,0,0,0.82) 100%);
}
.cover__icon {
  position: absolute; left: 18px; top: 18px;
  width: 54px; height: 54px; border-radius: var(--r-lg); object-fit: cover;
  border: 1px solid rgba(255,255,255,0.22); background: var(--bg-inset);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}
.cover__text { position: absolute; left: 18px; right: 64px; bottom: 16px; }
.cover__name, .cover__meta { display: block; }
.cover__name { color: #fff; font-size: 18px; font-weight: 700; letter-spacing: -0.018em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover__meta { margin-top: 2px; font-size: 12px; color: rgba(255,255,255,0.72); }
/* The workspace's own colour, as a dot. Ringed in white because the card behind it
   is its group's icon, blurred, and could be any colour at all — including that one. */
.cover__dot {
  display: inline-block; width: 8px; height: 8px; margin-right: 6px;
  border-radius: var(--r-pill); vertical-align: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.55);
}
.cover__go {
  position: absolute; right: 14px; bottom: 14px;
  width: 36px; height: 36px; border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.16); color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background 200ms var(--ease), transform 200ms var(--ease);
}
.cover:hover .cover__go { background: var(--accent-fill); transform: translateX(2px); }

/* --- Dated greeting (workspace home) ------------------------------------ */
.greeting {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--separator);
}
.greeting__date { font-size: 13px; color: var(--label-3); }
.greeting__title { margin-top: 4px; font-size: 32px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.greeting__sub { margin-top: 6px; font-size: 15px; color: var(--label-2); }
.greeting__mark { width: 60px; height: 60px; border-radius: var(--r-xl); object-fit: cover; border: 1px solid var(--separator-firm); flex: 0 0 auto; background: var(--bg-elevated); }

@media (max-width: 900px) {
  .settings-split { grid-template-columns: minmax(0, 1fr); }
  .side-nav { position: static; flex-direction: row; overflow-x: auto; }
  .side-nav a, .side-nav button { flex: 0 0 auto; }
  .side-nav a::after, .side-nav button::after { display: none; }
}
@media (max-width: 640px) {
  .accountbar { padding: 0 14px; }
  .user-menu > summary span { display: none; }
  .covers { grid-template-columns: minmax(0, 1fr); }
  .weekstrip__days { gap: 5px; }
  .daypill { width: 42px; }
  .podium { gap: 8px; }
  .podium__place { width: 96px; }
  .request__actions { grid-template-columns: 1fr; }
  .greeting__title { font-size: 26px; }
  .greeting__mark { width: 48px; height: 48px; }
}

/* Under the bar, a page fills what is left of the screen rather than the
   whole of it, so a short page does not scroll by the bar's height. */
.accountbar + .app { min-height: calc(100vh - 60px); }
.accountbar + .main { min-height: calc(100vh - 60px); }


/* --- The theme switch -------------------------------------------------- */
/* One button, two glyphs. It shows where it will take you — the sun while the
   page is dark — and states where you are with aria-pressed, which theme.js
   keeps in step. */
.theme-toggle__sun { display: block; }
.theme-toggle__moon { display: none; }
:root[data-theme="light"] .theme-toggle__sun { display: none; }
:root[data-theme="light"] .theme-toggle__moon { display: block; }
.accountbar .theme-toggle { margin-left: auto; }


/* --- The colour picker, in the workspace builder and in Settings ----------- */
/* Radios, visually hidden and drawn as swatches, so the group works with the
   arrow keys and a screen reader hears "Orange, 4 of 10" without any script. */
.swatches { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 10px; }
.swatch { position: relative; display: block; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.swatch__chip {
  display: block; aspect-ratio: 1; border-radius: var(--r-md);
  background: var(--swatch); border: 1px solid rgba(0,0,0,0.12);
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.swatch:hover .swatch__chip { transform: translateY(-2px); }
/* The chosen one is ringed in its own colour, held off the chip by a gap in the
   card's colour, so the ring is visible on every swatch and on both themes. */
.swatch input:checked + .swatch__chip { box-shadow: 0 0 0 2px var(--bg-elevated), 0 0 0 4px var(--swatch); }
.swatch input:focus-visible + .swatch__chip { outline: 2px solid var(--label); outline-offset: 3px; }
@media (max-width: 560px) { .swatches { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
