@font-face { font-family: "Inter"; src: url("/static/fonts/inter.woff2") format("woff2"); font-style: normal; font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/static/fonts/source-sans-3.woff2") format("woff2"); font-style: normal; font-weight: 200 900; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/static/fonts/ibm-plex-sans.woff2") format("woff2"); font-style: normal; font-weight: 100 700; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/fonts/manrope.woff2") format("woff2"); font-style: normal; font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/static/fonts/atkinson-hyperlegible-400.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/static/fonts/atkinson-hyperlegible-700.woff2") format("woff2"); font-style: normal; font-weight: 700; font-display: swap; }

/* Locked theme tokens. No page defines its own colour; nothing uses inline
   styles. Change the look here and it changes everywhere. */

:root {
  color-scheme: light;

  /* Surfaces */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-sunken: #eef1f5;
  --border: #dfe3e8;
  --border-strong: #c9d0d9;

  /* Ink */
  --ink: #161b22;
  --ink-muted: #5f6b7a;
  --ink-faint: #8a95a3;
  --ink-inverse: #ffffff;
  --brand-ink: #ffffff;
  --accent-ink: #ffffff;

  /* Brand + accent. One accent, reserved for primary actions. */
  --brand: #3567a6;
  --brand-strong: #182333;
  --accent: #5b8def;
  --accent-strong: #3f72c4;

  /* Status. Used by scorecard cells, priority status, to-do due dates. */
  --ok-bg: #e2f2e8;
  --ok-ink: #226b43;
  --bad-bg: #fae8e6;
  --bad-ink: #a4413b;
  --warn-bg: #f2edff;
  --warn-ink: #6745a1;
  --none-bg: transparent;

  /* Geometry */
  --radius: 10px;
  --radius-sm: 6px;
  --gap: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 18px rgba(16, 24, 40, 0.045);

  --sidebar-w: 248px;
  --topbar-h: 68px;

  --font-inter: "Inter", sans-serif;
  --font-source_sans_3: "Source Sans 3", sans-serif;
  --font-ibm_plex_sans: "IBM Plex Sans", sans-serif;
  --font-manrope: "Manrope", sans-serif;
  --font-atkinson_hyperlegible: "Atkinson Hyperlegible", sans-serif;
  --font: var(--font-inter);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; font-weight: 680; letter-spacing: -0.025em; }
h1 { font-size: 28px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }

/* ---------------------------------------------------------------- layout */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 22px;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.brand { width: calc(var(--sidebar-w) - 22px); display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand-strong); color: #fff; font-weight: 800; }
.brand__logo { display: block; width: auto; max-width: 112px; height: 34px; object-fit: contain; }
.brand__word { font-size: 16px; font-weight: 750; letter-spacing: -0.03em; }

.topbar__context { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center; line-height: 1.1; }
.topbar__context .eyebrow { grid-column: 1 / -1; }
.scope-kind { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; padding: 2px 6px; border-radius: 999px; background: var(--surface-sunken); color: var(--ink-muted); }
.eyebrow { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-faint); font-weight: 750; margin-bottom: 4px; }

.topbar__spacer { flex: 1; }

.topbar__date { font-size: 12px; color: var(--ink-faint); }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  padding: 6px 8px;
  border-radius: 10px;
}
.user-chip:hover { text-decoration: none; background: var(--surface-sunken); }
.user-chip__copy { display: grid; line-height: 1.2; }
.user-chip__copy strong { font-size: 12px; }
.user-chip__copy small { font-size: 10px; color: var(--ink-faint); }
.topbar-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--ink-muted);
}
.topbar-icon:hover { color: var(--ink); background: var(--surface-sunken); text-decoration: none; }
.topbar-icon:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.topbar-icon.is-active { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.topbar-icon svg { display: block; width: 18px; height: 18px; pointer-events: none; }
.topbar-admin-tools { display: flex; align-items: center; gap: 6px; }
.connector-health {
  display: grid;
  place-items: center;
  width: 28px;
  height: 34px;
  border-radius: 9px;
  color: var(--ink-faint);
}
.connector-health:hover { background: var(--surface-sunken); text-decoration: none; }
.connector-health:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.connector-health__dot {
  width: 11px;
  height: 11px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 1px currentColor;
}
.connector-health--healthy { color: var(--ok-ink); }
.connector-health--not-tested { color: var(--warn-ink); }
.connector-health--unhealthy { color: var(--bad-ink); }
.settings-gear { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 9px; color: var(--ink-muted); font-size: 19px; line-height: 1; }
.settings-gear:hover { color: var(--ink); background: var(--surface-sunken); text-decoration: none; }
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu[open] > summary { background: var(--surface-sunken); }
.user-menu__panel { position: absolute; top: calc(100% + 8px); right: 0; display: grid; min-width: 210px; padding: 7px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 14px 34px rgba(0,0,0,.18); }
.user-menu__panel a { display: grid; padding: 9px 10px; border-radius: 7px; color: var(--ink); }
.user-menu__panel a:hover { background: var(--surface-sunken); text-decoration: none; }
.user-menu__panel small { color: var(--ink-faint); font-size: 10px; }

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-strong);
  color: var(--ink-inverse);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
.avatar--muted { background: var(--surface-sunken); color: var(--ink-muted); }

.sidebar {
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  left: 0;
  width: var(--sidebar-w);
  background: var(--brand-strong);
  color: rgba(255, 255, 255, 0.78);
  border-right: 0;
  padding: 18px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.7);
  font-weight: 550;
}
.nav__link:hover { background: rgba(255, 255, 255, 0.08); text-decoration: none; color: #fff; }
.nav__link.is-active { background: rgba(255, 255, 255, 0.13); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }

.nav__label {
  padding: 14px 12px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 700;
}

.main {
  margin: var(--topbar-h) 0 0 var(--sidebar-w);
  padding: 30px 36px 72px;
  max-width: 1520px;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.page-head__sub { color: var(--ink-muted); font-size: 13px; margin: 4px 0 0; }
.page-head .spacer { flex: 1; }

/* ---------------------------------------------------------------- card */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: var(--gap);
  overflow: hidden;
}

.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card__head h2 {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}
.card__head .spacer { flex: 1; }
.card__hint { font-size: 12px; color: var(--ink-faint); }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }

.connector-card { overflow: visible; }
.connector-heading { display: flex; align-items: center; gap: 7px; }
.permission-help { position: relative; }
.permission-help > summary {
  list-style: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink-faint);
  transition: color 120ms ease, background 120ms ease, transform 120ms ease;
}
.permission-help > summary::-webkit-details-marker { display: none; }
.permission-help > summary:hover,
.permission-help > summary:focus-visible {
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  outline: none;
  transform: translateY(-1px);
}
.permission-help[open] > summary {
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.permission-help > summary svg { display: block; }
.permission-help__panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 9px);
  left: -8px;
  width: min(460px, calc(100vw - 48px));
  padding: 15px 17px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 16px 38px rgba(8, 18, 35, 0.22);
  text-transform: none;
  letter-spacing: normal;
}
.permission-help__panel h3 { margin: 0 0 8px; font-size: 14px; color: var(--ink); }
.permission-help__panel p,
.permission-help__panel li { font-size: 12px; line-height: 1.5; }
.permission-help__panel p { margin: 8px 0; }
.permission-help__panel ul { margin: 8px 0; padding-left: 20px; }
.permission-help__panel li + li { margin-top: 5px; }

.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* ---------------------------------------------------------------- stat */

.dashboard-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 8px 2px 24px; }
.dashboard-hero h1 { font-size: clamp(28px, 4vw, 42px); }
.dashboard-hero p { max-width: 650px; margin: 7px 0 0; color: var(--ink-muted); }
.dashboard-hero__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pulse-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }

/* ---------------------------------------------------------------- work calendar */

.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.calendar-head p { margin: 4px 0 0; color: var(--ink-muted); }
.calendar-head__controls, .calendar-pager, .calendar-views { display: flex; align-items: center; gap: 6px; }
.btn--icon { width: 36px; padding-inline: 0; font-size: 20px; }
.calendar-views { padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-sunken); }
.calendar-views__item { padding: 6px 9px; border-radius: 4px; color: var(--ink-muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
.calendar-views__item:hover { color: var(--ink); text-decoration: none; }
.calendar-views__item.is-current { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.calendar-scroll { width: 100%; max-width: 100%; overflow-x: auto; border-radius: var(--radius); }
.calendar-scroll:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.calendar-grid { display: grid; min-width: 760px; }
.calendar-grid--1 { grid-template-columns: 70px minmax(520px, 1fr); }
.calendar-grid--3 { grid-template-columns: 70px repeat(3, minmax(210px, 1fr)); }
.calendar-grid--5 { grid-template-columns: 70px repeat(5, minmax(170px, 1fr)); }
.calendar-grid--7 { grid-template-columns: 70px repeat(7, minmax(145px, 1fr)); }
.calendar-grid__corner, .calendar-grid__day { position: sticky; top: 0; z-index: 2; min-height: 72px; border-bottom: 1px solid var(--border-strong); background: var(--surface); }
.calendar-grid__day { display: grid; place-content: center; justify-items: center; border-left: 1px solid var(--border); }
.calendar-grid__day span { color: var(--ink-muted); font-size: 11px; text-transform: uppercase; }
.calendar-grid__day strong { display: grid; place-items: center; width: 31px; height: 31px; font-size: 16px; }
.calendar-grid__day.is-today strong { border-radius: 50%; background: var(--brand); color: var(--brand-ink); }
.calendar-grid__time { min-height: 58px; padding: 5px 10px 0 0; border-bottom: 1px solid var(--border); color: var(--ink-faint); font-size: 10px; text-align: right; }
.calendar-grid__slot { min-height: 58px; padding: 3px; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 97%, var(--surface-sunken)); }
.calendar-event { display: grid; gap: 1px; padding: 6px 8px; overflow: hidden; border-left: 3px solid var(--brand); border-radius: 4px; background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--ink); font-size: 11px; line-height: 1.25; }
.calendar-event + .calendar-event { margin-top: 3px; }
.calendar-event:hover { background: color-mix(in srgb, var(--brand) 18%, var(--surface)); text-decoration: none; }
.calendar-event strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event span, .calendar-event small, .calendar-event time { color: var(--ink-muted); font-size: 10px; }
.calendar-event--business_review, .calendar-event--client { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, var(--surface)); }
.calendar-event--quarterly, .calendar-event--annual { border-left-color: var(--warn-ink); }
.calendar-month__title { padding: 16px 18px; border-bottom: 1px solid var(--border); font-size: 18px; font-weight: 700; }
.calendar-month { min-width: 840px; }
.calendar-month__weekdays, .calendar-month__week { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); }
.calendar-month__weekdays > div { padding: 8px; border-right: 1px solid var(--border); color: var(--ink-muted); font-size: 10px; font-weight: 700; text-align: center; text-transform: uppercase; }
.calendar-month__day { min-height: 135px; padding: 7px; border-top: 1px solid var(--border); border-right: 1px solid var(--border); }
.calendar-month__day.is-outside { background: var(--surface-sunken); opacity: .65; }
.calendar-month__date { display: grid; place-items: center; width: 27px; height: 27px; margin: 0 0 5px auto; color: var(--ink-muted); font-size: 12px; }
.calendar-month__day.is-today .calendar-month__date { border-radius: 50%; background: var(--brand); color: var(--brand-ink); }
.calendar-month__events { display: grid; gap: 3px; }
.recommendation-list { display: grid; }
.recommendation { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 300px); gap: 22px; padding: 17px 18px; border-bottom: 1px solid var(--border); }
.recommendation:last-child { border-bottom: 0; }
.recommendation.is-decided { opacity: .7; }
.recommendation__copy { display: grid; gap: 8px; }
.recommendation__copy .markdown-body > :first-child { margin-top: 0; }
.recommendation__copy .markdown-body > :last-child { margin-bottom: 0; }
.recommendation__evidence { margin: 0; color: var(--ink-muted); font-size: 12px; }
.recommendation__actions { display: flex; align-items: end; justify-content: flex-end; gap: 7px; }
.recommendation__actions form { display: flex; align-items: end; gap: 7px; }
.recommendation__actions label { color: var(--ink-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.recommendation__actions select { min-width: 150px; }
.transcript-record > summary { padding: 14px 18px; cursor: pointer; color: var(--ink-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.transcript-record pre { max-height: 520px; margin: 0; padding: 18px; overflow: auto; border-top: 1px solid var(--border); background: var(--surface-sunken); color: var(--ink); font: 11px/1.55 var(--mono); white-space: pre-wrap; }

@media (max-width: 900px) {
  .calendar-head { align-items: flex-start; flex-direction: column; }
  .calendar-head__controls { width: 100%; flex-wrap: wrap; }
  .calendar-month { overflow-x: auto; }
  .calendar-month__weekdays, .calendar-month__week { min-width: 900px; }
  .recommendation { grid-template-columns: 1fr; }
  .recommendation__actions { justify-content: flex-start; flex-wrap: wrap; }
}
.metric-card { position: relative; display: grid; gap: 2px; padding: 17px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.metric-card::after { content: "→"; position: absolute; right: 16px; top: 14px; color: var(--ink-faint); }
.metric-card:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-1px); }
.metric-card__label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-muted); font-weight: 700; }
.metric-card strong { font-size: 32px; letter-spacing: -.04em; line-height: 1.2; }
.metric-card strong.bad { color: var(--bad-ink); }
.metric-card strong.ok { color: var(--ok-ink); }
.metric-card small { color: var(--ink-faint); }

.stat { padding: 16px; text-align: center; }
.stat__label {
  font-size: 12px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 650;
}
.stat__value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.stat__value--ok { color: var(--ok-ink); }
.stat__value--bad { color: var(--bad-ink); }

/* ---------------------------------------------------------------- table */

table { border-collapse: collapse; width: 100%; }

thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  font-weight: 700;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-sunken);
  white-space: nowrap;
}

tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-sunken); }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.col-tight { width: 40px; }
.col-actions { width: 1%; white-space: nowrap; }
.owner-cell { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-faint);
}

/* ---------------------------------------------------------------- scorecard */

.scroll-x { overflow-x: auto; }

.scorecard { min-width: 900px; }
.scorecard th.period { text-align: center; font-size: 10px; line-height: 1.25; padding: 7px 6px; }
.scorecard th.month {
  text-align: center;
  border-left: 1px solid var(--border);
  color: var(--ink-muted);
}
.scorecard td.cell {
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding: 0;
  min-width: 102px;
  font-size: 12.5px;
}
.scorecard .measurable { min-width: 220px; }
.scorecard .goal {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink-muted);
  background: var(--surface-sunken);
  font-weight: 600;
}
.scorecard th.current, .scorecard td.current { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.scorecard th.current { color: var(--accent-strong); }

.cell--on_track { background: var(--ok-bg); color: var(--ok-ink); font-weight: 620; }
.cell--off_track { background: var(--bad-bg); color: var(--bad-ink); font-weight: 620; }
.cell--no_data { background: var(--none-bg); color: var(--ink-faint); }

/* ---------------------------------------------------------------- pills */

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}
.pill--on_track, .pill--done, .pill--ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill--off_track, .pill--overdue { background: var(--bad-bg); color: var(--bad-ink); }
.pill--muted { background: var(--surface-sunken); color: var(--ink-muted); }
.pill--warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill--accent { background: var(--accent); color: var(--accent-ink); }
.pill--pending, .pill--processing, .pill--retrying { background: var(--warn-bg); color: var(--warn-ink); }
.pill--delivered { background: var(--ok-bg); color: var(--ok-ink); }
.pill--failed { background: var(--bad-bg); color: var(--bad-ink); }

.connector-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-4);
  margin-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.connector-actions form {
  margin: 0;
}

.connector-mapping-table input,
.connector-mapping-table select {
  min-width: 9rem;
}

.connector-mapping-table th:first-child,
.connector-mapping-table td:first-child {
  min-width: 14rem;
}

.priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.btn:hover { background: var(--surface-sunken); text-decoration: none; }
.btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.btn--primary:hover {
  background: color-mix(in srgb, var(--brand) 86%, var(--ink));
  border-color: color-mix(in srgb, var(--brand) 86%, var(--ink));
  color: var(--brand-ink);
}
.btn--sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--surface-sunken);
  border-color: var(--border);
  color: var(--ink-faint);
}
.btn--link {
  border: none;
  background: none;
  color: var(--brand);
  padding: 4px 6px;
}
.btn--link:hover { background: var(--surface-sunken); }

.actions { display: inline-flex; gap: 6px; align-items: center; }

/* An editable table row: fields sit flush in the cell and only look like
   inputs on hover or focus, so the list still reads as a list. */
.inline-edit { display: flex; gap: 6px; align-items: center; }
.inline-edit .meeting-tags-field { flex: 1 1 auto; }
.inline-edit input[type="text"] { flex: 1 1 auto; min-width: 180px; }
.inline-edit input[type="date"], .inline-edit select { flex: 0 0 auto; width: auto; }
.inline-edit input[type="text"], .inline-edit input[type="date"], .inline-edit select {
  border-color: transparent;
  background: transparent;
}
.inline-edit:hover input, .inline-edit:hover select,
.inline-edit input:focus, .inline-edit select:focus {
  border-color: var(--border-strong);
  background: var(--surface);
}

/* ---------------------------------------------------------------- forms */

label { display: block; font-size: 12px; font-weight: 650; color: var(--ink-muted); margin-bottom: 5px; }

input[type="text"], input[type="search"], input[type="email"], input[type="password"],
input[type="date"], input[type="time"], input[type="number"], input[type="url"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  background: var(--surface);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
  border-color: var(--brand);
}
textarea { min-height: 90px; resize: vertical; }

.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; }

.secret-control { position: relative; }
.secret-control input { padding-right: 42px; }
.secret-control__toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  transform: translateY(-50%);
  transition: color 120ms ease, background 120ms ease;
}
.secret-control__toggle:hover,
.secret-control__toggle[aria-pressed="true"] {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}
.secret-control__toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.secret-control__toggle svg { display: block; pointer-events: none; }

/* Matches the specificity of the `input[type="text"]` rule above so the cell
   reads as part of the grid, not as a form field sitting inside it. */
input.cell-input {
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  padding: 10px 4px;
  color: inherit;
  font-weight: inherit;
}
input.cell-input:focus {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  background: var(--surface);
}

/* ---------------------------------------------------------------- login */

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(150deg, #111827, var(--brand-strong) 52%, #294d78);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 12px 40px rgba(10, 20, 40, 0.28);
}
.login-card h1 { margin-bottom: 4px; }
.login-card .sub { color: var(--ink-muted); margin: 0 0 20px; font-size: 13px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 4px; }
.microsoft-sign-in { gap: 10px; background: var(--surface); border-color: var(--line-strong); }
.microsoft-sign-in:hover { background: var(--surface-sunken); }
.microsoft-mark { display: grid; grid-template-columns: repeat(2, 7px); gap: 2px; }
.microsoft-mark i { width: 7px; height: 7px; background: var(--accent); }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--ink-faint); font-size: 11px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-divider span { white-space: nowrap; }

.banner {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 550;
}
.banner--error { background: var(--bad-bg); color: var(--bad-ink); }
.banner--info { background: var(--warn-bg); color: var(--warn-ink); }

.hint { font-size: 12px; color: var(--ink-faint); margin-top: 14px; text-align: center; }

/* ---------------------------------------------------------------- strategy_plan */

.strategy_plan-section + .strategy_plan-section { margin-top: 18px; }
.strategy_plan-list { margin: 0; padding-left: 18px; }
.strategy_plan-list li { margin-bottom: 5px; }
.value-name { font-weight: 650; }
.value-desc { color: var(--ink-muted); }

.kv { display: flex; gap: 10px; margin-bottom: 8px; }
.kv__k { color: var(--ink-faint); min-width: 120px; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; }

/* ------------------------------------------------- agenda reordering */

.agenda-list { list-style: none; margin: 0; padding: 0; counter-reset: agenda; }

.agenda-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  counter-increment: agenda;
}
.agenda-item:last-child { border-bottom: none; }
.agenda-item[draggable="true"] { cursor: grab; }
.agenda-item[draggable="true"]:hover { background: var(--surface-sunken); }
.agenda-item.is-dragging { opacity: 0.4; cursor: grabbing; }

.agenda-item__grip {
  width: 14px;
  color: var(--ink-faint);
  letter-spacing: -3px;
  font-size: 15px;
  line-height: 1;
  flex: none;
}
.agenda-item__name { flex: 1; font-weight: 600; }
.agenda-item__name::before {
  content: counter(agenda) ". ";
  color: var(--ink-faint);
  font-weight: 500;
}
.agenda-item__mins {
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.agenda-item.is-pinned { background: var(--surface-sunken); color: var(--ink-muted); }

/* ------------------------------------------------- live meeting mode */

body.live { background: var(--surface-sunken); }

.live-shell { display: flex; min-height: 100vh; }

.rail {
  width: 232px;
  flex: none;
  background: var(--brand);
  color: var(--ink-inverse);
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
}
.rail__head { padding: 6px 10px 14px; }
.rail__title { font-weight: 700; font-size: 16px; }
.rail__sub { font-size: 12px; color: rgba(255, 255, 255, 0.66); }
.rail__form { margin: 0; }

.rail__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  margin-bottom: 2px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
}
.rail__item:hover { background: rgba(255, 255, 255, 0.09); color: var(--ink-inverse); }
.rail__item.is-current { background: var(--accent); color: var(--ink-inverse); }
.rail__name { flex: 1; }
.rail__now { font-variant-numeric: tabular-nums; font-weight: 700; }
.rail__done { font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.55); }
.rail__plan { color: rgba(255, 255, 255, 0.38); }

.rail__foot { margin-top: auto; padding: 10px; display: grid; gap: 8px; }
.rail__foot .btn--link { color: rgba(255, 255, 255, 0.72); }
.rail__foot .btn--link:hover { background: rgba(255, 255, 255, 0.09); }

.btn--wide { width: 100%; justify-content: center; }

.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.stage__head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.stage__head h1 { font-size: 19px; }
.stage__body { padding: 20px 24px 60px; max-width: 1200px; }
.capture-bar {
  align-items: flex-end;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 24px;
}

html[data-theme="dark"] {
  --bg: #0e1116;
  --surface: #161b22;
  --surface-sunken: #1c232d;
  --border: #29313d;
  --border-strong: #3a4554;
  --ink: #f3f4f6;
  --ink-muted: #a6b0bd;
  --ink-faint: #737f8f;
  --brand: #78a7ea;
  --brand-strong: #121b28;
  --accent: #78a7f0;
  --accent-strong: #9bc1fa;
  --ok-bg: #17382c;
  --ok-ink: #88d4a8;
  --bad-bg: #402628;
  --bad-ink: #f0a29c;
  --warn-bg: #2d2740;
  --warn-ink: #c8b4f2;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.22), 0 10px 30px rgba(0, 0, 0, 0.18);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --bg: #0e1116;
    --surface: #161b22;
    --surface-sunken: #1c232d;
    --border: #29313d;
    --border-strong: #3a4554;
    --ink: #f3f4f6;
    --ink-muted: #a6b0bd;
    --ink-faint: #737f8f;
    --brand: #78a7ea;
    --brand-strong: #121b28;
    --accent: #78a7f0;
    --accent-strong: #9bc1fa;
    --ok-bg: #17382c;
    --ok-ink: #88d4a8;
    --bad-bg: #402628;
    --bad-ink: #f0a29c;
    --warn-bg: #2d2740;
    --warn-ink: #c8b4f2;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.22), 0 10px 30px rgba(0, 0, 0, 0.18);
    color-scheme: dark;
  }
}
.capture-form { align-items: center; display: flex; gap: 6px; }
.capture-form input[type="text"] { min-width: 170px; }
.lead { color: var(--ink-muted); margin: 0 0 16px; }

.timers { display: flex; gap: 22px; }
.timer { text-align: right; }
.timer__label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  font-weight: 700;
}
.timer__value { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer__value--over { color: var(--bad-ink); }
.timer__budget { font-size: 11px; color: var(--ink-faint); margin-left: 4px; }

.rating-input { width: 74px; text-align: center; }

.lobby { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.lobby__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.lobby__agenda { margin: 18px 0; }
.lobby__agenda td { padding: 6px 0; border: none; }
.lobby__card .btn { margin-top: 8px; }

.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }
.nowrap { white-space: nowrap; }
.strike { text-decoration: line-through; color: var(--ink-faint); }
.mono { font-family: var(--mono); }
.right { text-align: right; }

/* ------------------------------------------------- workspace + preferences */

.scope-switcher {
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}
.scope-switcher label { color: rgba(255, 255, 255, 0.46); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.scope-switcher select { color: #fff; background: rgba(0, 0, 0, 0.15); border-color: rgba(255, 255, 255, 0.15); font-weight: 650; }
.scope-switcher option { color: var(--ink); background: var(--surface); }
.scope-switcher__meta { margin-top: 6px; color: rgba(255, 255, 255, 0.46); font-size: 10px; }

.sidebar__footer { margin-top: auto; display: grid; gap: 2px; padding-top: 20px; }
.sidebar__footer a { padding: 7px 11px; color: rgba(255, 255, 255, 0.55); font-size: 12px; }
.sidebar__footer a:hover { color: #fff; text-decoration: none; }

.view-only { display: flex; gap: 8px; padding: 10px 14px; margin-bottom: 18px; border: 1px solid var(--warn-ink); border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); font-size: 12px; }
.is-view-only .main form[method="post"],
.is-view-only .main a[href*="/edit"] { display: none; }

.theme-options { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.theme-option { position: relative; display: grid; gap: 5px; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.theme-option:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 20%, transparent); }
.theme-option input { position: absolute; right: 10px; top: 10px; }
.theme-option strong { color: var(--ink); }
.theme-option small { color: var(--ink-faint); font-weight: 500; }
.theme-option__preview { height: 74px; border-radius: 8px; overflow: hidden; display: grid; grid-template-columns: 24% 1fr; grid-template-rows: 20% 1fr; background: #f6f7f9; border: 1px solid rgba(0,0,0,.08); }
.theme-option__preview i { grid-column: 1 / -1; background: #fff; border-bottom: 1px solid #dfe3e8; }
.theme-option__preview b { background: #182333; }
.theme-option__preview em { margin: 8px; border-radius: 5px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.theme-option__preview--dark { background: #0e1116; border-color: #29313d; }
.theme-option__preview--dark i { background: #161b22; border-color: #29313d; }
.theme-option__preview--dark b { background: #121b28; }
.theme-option__preview--dark em { background: #161b22; }
.theme-option__preview--system { background: linear-gradient(135deg, #f6f7f9 50%, #0e1116 50%); }
.theme-option__preview--system em { background: linear-gradient(135deg, #fff 50%, #161b22 50%); }

.workspace-editor { display: grid; grid-template-columns: minmax(250px, .75fr) minmax(420px, 1.25fr); gap: 24px; align-items: center; margin-bottom: 18px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.workspace-editor__summary h2 { margin: 3px 0 4px; font-size: 20px; }
.workspace-editor__summary p { margin: 0; color: var(--ink-muted); font-size: 12px; }
.workspace-editor__choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.workspace-editor__choices form { margin: 0; }
.workspace-choice { display: grid; width: 100%; min-height: 58px; padding: 10px 12px; text-align: left; color: var(--ink); border: 1px solid var(--border); border-radius: 10px; background: var(--surface-sunken); cursor: pointer; font: inherit; }
.workspace-choice:hover { border-color: var(--border-strong); background: color-mix(in srgb, var(--brand) 6%, var(--surface-sunken)); }
.workspace-choice small { color: var(--ink-faint); text-transform: uppercase; letter-spacing: .07em; font-size: 9px; }
.workspace-choice.is-current { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--surface)); box-shadow: inset 3px 0 0 var(--brand); cursor: default; }
.access-guide { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 14px 18px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-sunken); }
.access-guide > div { display: grid; gap: 2px; }
.access-guide strong { font-size: 12px; }
.access-guide span { color: var(--ink-muted); font-size: 11px; }
.person { display: flex; align-items: center; gap: 9px; min-width: 190px; }
.person > div { display: grid; }
.person small { color: var(--ink-faint); }
.admin-users input, .admin-users select { min-width: 130px; }
.admin-grid { align-items: start; }
.settings-section { display: grid; gap: 16px; margin-bottom: 34px; }
.settings-section__head { display: flex; align-items: flex-start; gap: 12px; padding-top: 6px; }
.settings-section__head > .eyebrow { display: grid; place-items: center; width: 28px; height: 28px; margin: 0; border-radius: 50%; background: var(--surface-sunken); color: var(--brand); }
.settings-section__head h2 { font-size: 19px; }
.settings-section__head p { margin: 2px 0 0; color: var(--ink-muted); font-size: 12px; }
.settings-page-head { align-items: flex-end; }
.settings-nav { display: flex; gap: 4px; margin: -4px 0 24px; padding: 5px; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunken); }
.settings-nav__link { flex: 0 0 auto; padding: 9px 14px; color: var(--ink-muted); border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; }
.settings-nav__link:hover { color: var(--ink); background: var(--surface); text-decoration: none; }
.settings-nav__link.is-current { color: var(--brand); background: var(--surface); box-shadow: var(--shadow); }
.workspace-overview { min-width: 820px; }
.people-grid-head { gap: 12px; }
.people-grid-head > div:first-child { display: grid; gap: 2px; margin-right: auto; }
.add-people-panel { padding: 18px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--brand) 4%, var(--surface)); }
.add-people-panel[hidden] { display: none; }
.add-people-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.add-people-panel__head h3 { margin: 0; font-size: 16px; }
.add-people-panel__head p { margin: 3px 0 0; color: var(--ink-muted); font-size: 12px; }
.branding-grid { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr); gap: 28px; }
.color-picker { display: grid; grid-template-columns: 64px 1fr; gap: 8px; }
.color-picker input[type="color"] { width: 64px; height: 38px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.palette-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.palette-swatch { min-height: 96px; display: flex; flex-direction: column; justify-content: flex-end; padding: 10px; border-radius: var(--radius); background: var(--swatch); color: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.palette-swatch span { font-weight: 700; }
.palette-swatch code { font-size: 10px; opacity: .8; }

/* ------------------------------------------------- process editor */

.process-step-list { display: grid; gap: 12px; margin-bottom: 12px; }
.process-step-editor { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunken); }
.process-step-editor__head { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.process-step-editor__head .spacer { flex: 1; }
.process-step-editor .field:last-child { margin-bottom: 0; }
.process-editor-actions { display: flex; gap: 8px; margin-top: 18px; }
.markdown-body > :first-child { margin-top: 6px; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body ul, .markdown-body ol { padding-left: 22px; }
.markdown-body li + li { margin-top: 4px; }
.external-document-link { display: inline-flex; align-items: center; gap: 5px; }
.external-document-link span { color: var(--ink-faint); font-size: 12px; }
.field-hint { display: block; margin-top: 5px; color: var(--ink-faint); font-size: 11px; }
.tag-suggestions { display: grid; gap: 8px; }
.tag-merge { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.tag-merge:last-child { border-bottom: 0; }
.tag-merge span { flex: 1; }
.department-list { display: grid; gap: 8px; margin: 14px 0; }
.department-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-sunken); }
.department-row--schedule { grid-template-columns: minmax(170px, 1.3fr) minmax(170px, 1.2fr) minmax(130px, .9fr) minmax(125px, .8fr) 110px 105px auto; }
.department-row .field { margin: 0; }
.department-row > .btn { margin-bottom: 1px; }
.workspace-assignment-fieldset { margin: 4px 0 16px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.workspace-assignment-fieldset legend { padding: 0 6px; color: var(--ink-muted); font-size: 12px; font-weight: 700; }
.workspace-assignment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 9px; }
.workspace-assignment { display: grid; grid-template-columns: 1fr minmax(115px, .8fr); gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-sunken); }
.workspace-assignment.is-selected { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.workspace-assignment .check span { display: grid; }
.workspace-assignment .check small { color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; font-size: 9px; }
.people-access-grid { min-width: 1250px; }
.people-access-grid input, .people-access-grid select { min-width: 125px; }
.people-access-grid th:first-child, .people-access-grid td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.people-access-grid th:first-child { background: var(--surface-sunken); }
.people-access-grid td:first-child { box-shadow: 5px 0 8px rgba(0,0,0,.04); }
.annual-priority-list { display: grid; gap: 8px; margin: 14px 0; }
.annual-priority-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; }
.annual-priority-row > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-sunken); color: var(--ink-muted); font-size: 11px; font-weight: 700; }

/* ------------------------------------------------- organization search */

.global-search { width: min(320px, 25vw); }
.global-search input[type="search"] { height: 36px; background: var(--surface-sunken); border-color: transparent; }
.search-filters { display: grid; grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(150px, 1fr)) auto; gap: 12px; align-items: end; }
.search-filters .field { margin: 0; }
.search-filters .btn { height: 38px; }
.search-results { display: grid; }
.search-result { display: flex; align-items: flex-start; gap: 12px; padding: 15px 18px; color: var(--ink); border-bottom: 1px solid var(--border); }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: var(--surface-sunken); text-decoration: none; }
.search-result__body { display: grid; gap: 3px; flex: 1; min-width: 0; }
.search-result__body > span { color: var(--ink-muted); white-space: pre-line; }
.search-result__body small { color: var(--ink-faint); }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.tag { display: inline-flex; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 10%, var(--surface)); color: var(--brand); font-size: 10px; font-weight: 650; }

/* ------------------------------------------------------ guided OpGauge setup */

.setup-page-head { align-items: flex-end; }
.setup-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.setup-step { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.setup-step:hover { border-color: var(--border-strong); text-decoration: none; }
.setup-step.is-current { border-color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand), var(--shadow); }
.setup-step__number { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--surface-sunken); color: var(--ink-muted); font-size: 12px; font-weight: 800; }
.setup-step.is-current .setup-step__number { background: var(--brand); color: var(--brand-ink); }
.setup-step.is-complete .setup-step__number { background: var(--ok-bg); color: var(--ok-ink); }
.setup-step > span:last-child { display: grid; min-width: 0; }
.setup-step strong { font-size: 13px; }
.setup-step small { color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setup-stage { display: grid; gap: 16px; }
.setup-stage__intro { max-width: 760px; padding: 4px 2px 8px; }
.setup-stage__intro h2 { margin-bottom: 6px; font-size: 22px; }
.setup-stage__intro p { margin: 0; color: var(--ink-muted); font-size: 15px; }
.setup-stage__kicker { display: inline-flex; margin-bottom: 8px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.setup-exercise { overflow: visible; }
.evidence-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.evidence-card { position: relative; display: grid; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunken); }
.evidence-card .field { margin: 0; }
.evidence-card__number { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); color: var(--ink-faint); font-size: 10px; font-weight: 800; }
.setup-subsection { display: grid; grid-template-columns: minmax(210px, .65fr) minmax(420px, 1.35fr); gap: 22px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); }
.setup-subsection h3 { margin-bottom: 5px; }
.core-value-drafts { display: grid; gap: 8px; }
.core-value-draft { display: grid; grid-template-columns: 26px minmax(150px, .7fr) minmax(240px, 1.3fr); gap: 8px; align-items: center; }
.core-value-draft > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-sunken); color: var(--ink-muted); font-size: 10px; font-weight: 800; }
.core-value-draft textarea { min-height: 58px; resize: vertical; }
.setup-publish-card .card__body { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.setup-publish-card p { margin: 4px 0 0; }
.setup-next { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.setup-accountability-grid { align-items: stretch; }
.setup-checklist { display: grid; gap: 13px; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: setup-checklist; }
.setup-checklist li { display: grid; grid-template-columns: 30px 1fr; column-gap: 10px; counter-increment: setup-checklist; }
.setup-checklist li::before { content: counter(setup-checklist); grid-row: 1 / 3; display: grid; place-items: center; align-self: start; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-sunken); color: var(--ink-muted); font-size: 10px; font-weight: 800; }
.setup-checklist span { color: var(--ink-muted); }
.assessment-score-form { display: flex; align-items: end; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.assessment-score-form .field { margin: 0; }
.score-input { display: flex; align-items: center; gap: 6px; }
.score-input input { width: 92px; }
.score-input span { color: var(--ink-muted); font-weight: 700; }

.first-run { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.first-run__backdrop { position: absolute; inset: 0; background: rgba(9, 16, 27, .62); backdrop-filter: blur(5px); }
.first-run__dialog { position: relative; width: min(540px, 100%); padding: 32px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 24px 70px rgba(7, 13, 24, .28); }
.first-run__eyebrow { display: block; margin-bottom: 9px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.first-run__dialog h2 { font-size: 24px; }
.first-run__dialog > p { margin: 9px 0 20px; color: var(--ink-muted); font-size: 15px; }
.first-run__steps { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunken); color: var(--ink-muted); font-size: 11px; font-weight: 700; }
.first-run__steps i { height: 1px; flex: 1; background: var(--border-strong); }
.first-run__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

@media (max-width: 900px) {
  :root { --sidebar-w: 190px; }
  .brand { width: 150px; }
  .topbar__date, .user-chip__copy { display: none; }
  .main { padding: 24px 20px 60px; }
  .field-row { flex-wrap: wrap; }
  .theme-options { grid-template-columns: 1fr; }
  .branding-grid { grid-template-columns: 1fr; }
  .settings-page-head { align-items: flex-start; }
  .workspace-editor { grid-template-columns: 1fr; }
  .department-row { grid-template-columns: 1fr; }
  .department-row--schedule { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .pulse-grid { grid-template-columns: repeat(2, 1fr); }
  .search-filters { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .global-search { width: min(240px, 25vw); }
  .evidence-grid { grid-template-columns: 1fr; }
  .setup-subsection { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  :root { --topbar-h: 58px; }
  .topbar { padding: 0 12px; gap: 12px; }
  .brand { width: auto; }
  .brand__word { display: none; }
  .global-search { display: block; width: min(180px, 34vw); }
  .topbar__context .eyebrow, .scope-kind { display: none; }
  .sidebar { position: static; width: auto; margin-top: var(--topbar-h); padding: 8px; }
  .scope-switcher { margin: 0 0 8px; }
  .nav { display: flex; overflow-x: auto; gap: 3px; }
  .nav__label, .sidebar__footer { display: none; }
  .nav__link { white-space: nowrap; padding: 8px 10px; }
  .main { margin: 0; padding: 20px 14px 48px; }
  .page-head { align-items: flex-start; flex-wrap: wrap; }
  .grid--2, .grid--4 { grid-template-columns: 1fr; }
  .workspace-editor__choices, .access-guide { grid-template-columns: 1fr; }
  .department-row--schedule, .workspace-assignment { grid-template-columns: 1fr; }
  .pulse-grid { grid-template-columns: 1fr; }
  .dashboard-hero { align-items: flex-start; flex-direction: column; }
  .search-filters { grid-template-columns: 1fr; }
  .search-result { flex-wrap: wrap; }
  .tag-row { justify-content: flex-start; width: 100%; }
  .setup-steps { grid-template-columns: 1fr; }
  .setup-step small { white-space: normal; }
  .core-value-draft { grid-template-columns: 26px 1fr; }
  .core-value-draft textarea { grid-column: 2; }
  .setup-publish-card .card__body { align-items: flex-start; flex-direction: column; }
  .first-run__dialog { padding: 24px 20px; }
  .first-run__steps { align-items: flex-start; flex-direction: column; }
  .first-run__steps i { display: none; }
}
