
:root {
  --surface-canvas: #FFFFFF;
  --surface-raised: #FFFFFF;
  --surface-overlay: #F5F7FA;
  --text-primary: #0A0A0A;
  --text-secondary: #6E6E73;
  --text-accent: #0066CC;
  --text-status-auto: #1F7A3D;
  --text-status-human-edit: #945500;
  --text-status-compliance-hold: #C81E1E;
  --fill-accent: #0071E3;
  --fill-accent-label: #FFFFFF;
  --shadow-raised: 0 1px 1px rgba(10, 10, 10, 0.03), 0 2px 8px rgba(10, 10, 10, 0.04), 0 12px 24px rgba(10, 10, 10, 0.04);
  --shadow-overlay: 0 2px 8px rgba(10, 10, 10, 0.06), 0 16px 40px rgba(10, 10, 10, 0.12);
  --font-display: "Schibsted Grotesk", "Hanken Grotesk", system-ui, sans-serif;
  --font-ui: "Hanken Grotesk", system-ui, sans-serif;
  /* Derived veils: alpha steps of the token custom properties above via
     color-mix. No color originates here — these track the mode-resolved
     tokens automatically in both modes. */
  --hairline-color: color-mix(in srgb, var(--text-secondary) 30%, transparent);
  --hairline-strong: color-mix(in srgb, var(--text-secondary) 45%, transparent);
  --veil-neutral: color-mix(in srgb, var(--text-secondary) 12%, transparent);
  --veil-accent: color-mix(in srgb, var(--fill-accent) 10%, transparent);
  --veil-bar: color-mix(in srgb, var(--surface-raised) 84%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root {
  --surface-canvas: #000000;
  --surface-raised: #1C1C1E;
  --surface-overlay: #2A2A2E;
  --text-primary: #FFFFFF;
  --text-secondary: #A1A1A6;
  --text-accent: #409CFF;
  --text-status-auto: #30D158;
  --text-status-human-edit: #FFD60A;
  --text-status-compliance-hold: #FF6961;
  --fill-accent: #0A84FF;
  --fill-accent-label: #000000;
  --shadow-raised: none;
  --shadow-overlay: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface-canvas);
  color: var(--text-primary);
  font-family: var(--font-ui); font-size: 17px; line-height: 22px; letter-spacing: -0.00419047619047619em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--fill-accent); color: var(--fill-accent-label); }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}

h1 { font-family: var(--font-display); font-size: 34px; line-height: 41px; letter-spacing: -0.022em; font-weight: 700; margin: 24px 0 32px; }
h2 { font-family: var(--font-display); font-size: 22px; line-height: 28px; letter-spacing: -0.009428571428571427em; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 12px; }
small, .caption { font-family: var(--font-ui); font-size: 13px; line-height: 18px; letter-spacing: 0em; color: var(--text-secondary); }

time { font-variant-numeric: tabular-nums; }

a {
  color: var(--text-accent);
  text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, var(--text-accent) 40%, transparent);
  transition: text-decoration-color 150ms ease;
}
a:hover { text-decoration-color: var(--text-accent); }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 4px solid var(--fill-accent);
  outline-offset: 0;
}

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--veil-bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--hairline-color);
  padding: 4px 20px;
}
header.site nav {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  align-items: center;
}
header.site nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease;
}
header.site nav a:hover { color: var(--text-primary); background: var(--veil-neutral); }
header.site nav a[aria-current="page"] { color: var(--text-primary); font-weight: 600; }
header.site nav .wordmark {
  font-family: var(--font-display); font-size: 22px; line-height: 28px; letter-spacing: -0.009428571428571427em;
  font-weight: 700;
  color: var(--text-primary);
  margin-right: 12px;
}
header.site nav a.wordmark:hover { background: transparent; }
header.site nav .session {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
header.site nav .session .who {
  font-family: var(--font-ui); font-size: 13px; line-height: 18px; letter-spacing: 0em;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Spec 22: sign-out is a live POST form in the top bar — the button reads
   as the quiet accent link it replaced, still a 44pt target. */
header.site nav .signout-form { margin: 0; }
header.site nav button.signout {
  font-family: var(--font-ui); font-size: 13px; line-height: 18px; letter-spacing: 0em;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-accent);
  min-height: 44px;
  min-width: 44px;
  padding: 0 8px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms ease;
}
header.site nav button.signout:hover { background: var(--veil-accent); }

.banner {
  background: var(--surface-overlay);
  box-shadow: var(--shadow-overlay);
  border: 0.5px solid var(--hairline-color);
  border-radius: 16px;
  padding: 16px 24px;
  margin: 20px auto 0;
  max-width: 720px;
}
.banner strong { color: var(--text-primary); }
.banner p:last-child { margin: 0; }

.flash {
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
  border: 0.5px solid var(--hairline-color);
  border-left: 4px solid var(--fill-accent);
  border-radius: 12px;
  padding: 12px 20px;
  margin: 0 0 24px;
}
.flash p { margin: 0; font-weight: 500; }

.card {
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
  border: 0.5px solid var(--hairline-color);
  border-radius: 16px;
  padding: 24px;
  margin: 0 0 20px;
}

.card.empty {
  text-align: center;
  padding: 64px 24px;
}
.card.empty h2 { color: var(--text-primary); }
.card.empty p { color: var(--text-secondary); margin: 0 auto; max-width: 480px; }

.content-item header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 0.5px solid var(--hairline-color);
  margin-bottom: 16px;
}
.content-item .channel {
  font-family: var(--font-ui); font-size: 13px; line-height: 18px; letter-spacing: 0em;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* The card's zones each own their gap ABOVE themselves; the headline+excerpt
   cluster stays tight so the post reads as one object. */
.content-item h2 { margin: 0 0 4px; }
.content-item .excerpt { margin: 0; }
.item-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 12px 0 0;
}
.item-meta .meta { margin: 0; }

/* System notices are inset panels — quiet, caption-scale, one surface step
   off the card. Emphasis comes from weight, never size or the reserved
   status colors. */
.notice {
  display: grid;
  gap: 4px;
  margin: 16px 0 0;
  padding: 12px 16px;
  background: var(--veil-neutral);
  border-radius: 12px;
}
.notice p { margin: 0; }

.badge {
  font-family: var(--font-ui); font-size: 13px; line-height: 18px; letter-spacing: 0em;
  display: inline-flex;
  align-items: center;
  background: var(--veil-neutral);
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
  font-weight: 500;
}
.badge-quiet { color: var(--text-secondary); }
.badge-strong { color: var(--text-primary); font-weight: 600; }
.badge-accent { color: var(--text-accent); font-weight: 600; background: var(--veil-accent); }

.meta { font-family: var(--font-ui); font-size: 13px; line-height: 18px; letter-spacing: 0em; color: var(--text-secondary); margin: 0 0 8px; }
.hashtags { color: var(--text-secondary); }

.failure-reason { font-family: var(--font-ui); font-size: 13px; line-height: 18px; letter-spacing: 0em; color: var(--text-primary); font-weight: 600; }
.failure-detail { font-family: var(--font-ui); font-size: 13px; line-height: 18px; letter-spacing: 0em; color: var(--text-secondary); }
.item-warning {
  font-family: var(--font-ui); font-size: 13px; line-height: 18px; letter-spacing: 0em;
  color: var(--text-primary);
  font-weight: 600;
  margin: 16px 0 0;
  padding: 12px 16px;
  background: var(--veil-neutral);
  border-radius: 12px;
}
.review-note { font-family: var(--font-ui); font-size: 13px; line-height: 18px; letter-spacing: 0em; color: var(--text-secondary); margin: 16px 0 0; }

form { margin: 0 0 12px; }
label {
  display: block;
  margin: 16px 0 4px;
  color: var(--text-secondary);
  font-family: var(--font-ui); font-size: 13px; line-height: 18px; letter-spacing: 0em;
  font-weight: 500;
}
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 16px;
  border: 0.5px solid var(--hairline-strong);
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--text-primary);
  caret-color: var(--fill-accent);
  font-family: var(--font-ui); font-size: 17px; line-height: 22px; letter-spacing: -0.00419047619047619em;
  transition: border-color 150ms ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--text-secondary); }
textarea { min-height: 88px; }

/* Spec 22: preference checkboxes ride inside a 44pt label row — the row is
   the tap target; the box itself stays box-sized. */
input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  height: 20px;
  accent-color: var(--fill-accent);
}
.settings-section label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 20px;
  border: none;
  border-radius: 12px;
  background: var(--fill-accent);
  color: var(--fill-accent-label);
  font-family: var(--font-ui); font-size: 17px; line-height: 22px; letter-spacing: -0.00419047619047619em;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: filter 150ms ease, transform 150ms ease, background-color 150ms ease;
}
button:hover, .button:hover { filter: brightness(1.06); }
button:active, .button:active { filter: brightness(0.92); transform: scale(0.98); }

button.quiet, .button.quiet {
  background: none;
  color: var(--text-accent);
  font-weight: 500;
}
button.quiet:hover, .button.quiet:hover { filter: none; background: var(--veil-accent); }

/* The action bar: one footer per card, separated by a hairline. Primary
   verb first; quiet verbs after; .push-end sends a form to the far edge. */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin: 20px 0 0;
  border-top: 0.5px solid var(--hairline-color);
  padding: 16px 0 0;
}
.actions form { margin: 0; }
.actions p { margin: 0; }
.actions .push-end { margin-left: auto; }

/* The reschedule picker reads as one inline row: select, then its verb. */
.reschedule {
  display: flex;
  flex: 1 1 auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.reschedule select { flex: 1 1 auto; width: auto; min-width: 0; }

/* The edit request is a native disclosure on its own row of the bar; the
   summary reads as the quiet action it is. */
.edit-request { flex-basis: 100%; }
.edit-request summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--text-accent);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  transition: background-color 150ms ease;
}
.edit-request summary::-webkit-details-marker { display: none; }
.edit-request summary:hover { background: var(--veil-accent); }
.edit-request form { margin: 4px 0 0; }
.edit-request textarea { width: 100%; }

.visually-hidden {
  position: absolute;
  width: 4px;
  height: 4px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Form errors are monochrome-plus-accent per the spec 19 rider: emphasis
   through primary color and weight, never the reserved status roles (the
   summary additionally carries role="alert" in the markup). */
.field-error { color: var(--text-primary); font-weight: 600; font-family: var(--font-ui); font-size: 13px; line-height: 18px; letter-spacing: 0em; margin: 4px 0 0; }
.error-summary { color: var(--text-primary); font-weight: 600; }

ul.plain { list-style: none; padding: 0; margin: 0 0 12px; }
ul.plain li { padding: 12px 0; border-bottom: 0.5px solid var(--hairline-color); }
ul.plain li:last-child { border-bottom: none; }
ol.plain { list-style: none; padding: 0; margin: 0 0 12px; }

/* Spec 20: the follow-up form inside the centered progress card reads as a
   form again — left-aligned, content-width, monochrome like every form. */
.onboarding-progress .followup {
  text-align: left;
  max-width: 480px;
  margin: 20px auto 0;
}
.onboarding-progress .followup textarea { width: 100%; }
ul.connections li {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.steps { list-style: none; padding: 0; margin: 0 0 16px; }
.steps li { padding: 8px 0; border-bottom: 0.5px solid var(--hairline-color); color: var(--text-secondary); }
.steps li.done { color: var(--text-primary); }
.steps li.current { color: var(--text-accent); font-weight: 600; }

/* ---- Settings grammar: eyebrow-titled groups of hairline-separated rows.
   The group title lives OUTSIDE the card; the card is a list of rows —
   label + support left, sized-to-content control right; footnotes under
   the card. */
.settings-group { margin: 0 0 32px; }
.settings-group > h2 {
  font-family: var(--font-ui); font-size: 13px; line-height: 18px; letter-spacing: 0em;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 8px;
  padding: 0 4px;
}
.card.group { margin: 0; padding: 4px 24px; }
.group-foot {
  font-family: var(--font-ui); font-size: 13px; line-height: 18px; letter-spacing: 0em;
  color: var(--text-secondary);
  margin: 8px 0 0;
  padding: 0 4px;
  max-width: 60ch;
}
.settings-group .banner { margin: 12px 0 0; }

.settings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 16px 0;
  margin: 0;
  min-height: 44px;
}
.card.group > .settings-row + .settings-row,
.card.group > form.settings-row + form.settings-row { border-top: 0.5px solid var(--hairline-color); }
.row-text { flex: 1 1 64px; min-width: 0; display: grid; gap: 4px; }
.row-text label, .row-label {
  font-family: var(--font-ui); font-size: 17px; line-height: 22px; letter-spacing: -0.00419047619047619em;
  color: var(--text-primary);
  font-weight: 500;
  margin: 0;
}
.row-support { font-family: var(--font-ui); font-size: 13px; line-height: 18px; letter-spacing: 0em; color: var(--text-secondary); margin: 0; max-width: 52ch; }
.row-support strong { color: var(--text-primary); }
.row-value { font-family: var(--font-ui); font-size: 13px; line-height: 18px; letter-spacing: 0em; color: var(--text-secondary); }
.row-control { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.row-control form { margin: 0; display: flex; align-items: center; gap: 8px; }
.row-control input[type="number"] {
  width: calc(64px + 16px);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.row-control a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  font-weight: 500;
}

/* Channel rows: the 29pt squircle icon tile (spec 08 metrics) carries a
   monogram; the name fills; the health control sits at the edge. */
.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  border-radius: 7px;
  background: var(--veil-neutral);
  color: var(--text-secondary);
  font-family: var(--font-ui); font-size: 13px; line-height: 18px; letter-spacing: 0em;
  font-weight: 600;
  flex-shrink: 0;
}
ul.connections li { min-height: 44px; }
ul.connections li strong { flex: 1; min-width: 0; }
ul.connections li form { margin: 0; }
.card.group ul.plain { margin: 0; }

/* The danger group: deletion folds behind a native disclosure; a confirm
   error re-renders it open. Isolation and the typed confirm ARE the
   destructive styling — no reserved status color is spent on it. */
.danger-disclosure summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.danger-disclosure summary::-webkit-details-marker { display: none; }
.danger-disclosure[open] { padding-bottom: 16px; }
.danger-disclosure[open] summary { margin-bottom: 8px; }
.danger-disclosure form { margin: 0; max-width: 480px; }

/* ---- Auth surfaces: one narrow centered column; the card holds the form. */
.auth { max-width: 440px; margin: 0 auto; }
.auth.wide { max-width: 560px; }
.auth h1 { margin: 24px 0 24px; }
.auth .card { padding: 24px; }
.auth-alt { text-align: center; margin: 16px 0 0; }
.form-commit { margin: 20px 0 0; }
.form-commit button { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
