/* Setup console styles. Mobile first: phone below 40rem (640px), tablet from
   40rem, desktop from 64rem (1024px). Every colour is a token here, so dark mode
   covers every rule. Spacing is an 8px scale with a 4px half step. */
:root {
  --bg: #f4f6f6;
  --surface: #ffffff;
  --surface-2: #f1f4f3;
  --surface-3: #e6ebea;
  --text: #16201e;
  --text-2: #3b4845;
  --muted: #5c6966;
  --border: #e0e6e4;
  --border-strong: #c7d0cd;
  --accent: #0f766e;
  --accent-strong: #0b5c56;
  --on-accent: #ffffff;
  --accent-tint: #e5f3f1;
  --accent-line: #a8d8d1;
  --warn: #8a5208;
  --warn-dot: #d48a0c;
  --warn-bg: #fff7e3;
  --warn-border: #edd08a;
  --error: #b42318;
  --error-dot: #d92d20;
  --error-bg: #fdeeec;
  --error-border: #f2b8b2;
  --ok-dot: #1f9d55;
  --ok-bg: #e7f5ed;
  --ok-border: #abd9be;
  --ok-text: #14532d;
  --shadow-sm: 0 1px 2px rgba(16, 24, 22, 0.06);
  --shadow: 0 1px 2px rgba(16, 24, 22, 0.05), 0 2px 6px rgba(16, 24, 22, 0.04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 22, 0.14), 0 2px 6px rgba(16, 24, 22, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --pill: 999px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Spacing scale: 8px steps, with a 4px half step. */
  --s-half: 0.25rem;
  --s-1: 0.5rem;
  --s-1h: 0.75rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-5: 2.5rem;
  --s-6: 3rem;
  --s-8: 4rem;

  /* Type scale. */
  --fs-title: 1.5rem;
  --fs-section: 1.125rem;
  --fs-card: 1rem;
  --fs-body: 0.9375rem;
  --fs-small: 0.875rem;
  --fs-meta: 0.8125rem;
  --fs-eyebrow: 0.75rem;
  --fs-stat: 1.75rem;

  /* Layout. */
  --gutter: 1rem;
  --content: 75rem;
  --card-pad: 1rem;
  --header-row: 3.5rem;
  --tab-row: 3rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1312;
    --surface: #141c1b;
    --surface-2: #1a2423;
    --surface-3: #263331;
    --text: #e6ecea;
    --text-2: #c2cecb;
    --muted: #97a9a4;
    --border: #253130;
    --border-strong: #36453f;
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --on-accent: #052420;
    --accent-tint: #0f2f2b;
    --accent-line: #1d5c55;
    --warn: #f2c062;
    --warn-dot: #e3a336;
    --warn-bg: #2a2211;
    --warn-border: #5a4719;
    --error: #ff8a80;
    --error-dot: #f0645a;
    --error-bg: #321719;
    --error-border: #6b2a2f;
    --ok-dot: #3ccb7f;
    --ok-bg: #11301f;
    --ok-border: #245a3a;
    --ok-text: #a7e8c0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
  }
}
@media (min-width: 40rem) {
  :root {
    --gutter: 1.5rem;
    --content: 56.25rem;
    --card-pad: 1.5rem;
    --fs-title: 1.75rem;
    --fs-stat: 2rem;
  }
}
@media (min-width: 64rem) {
  :root {
    --gutter: 2rem;
    --content: 75rem;
    --header-row: 4rem;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Header */
.topbar {
  position: relative;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand signout" "menu menu";
  align-items: center;
  column-gap: var(--s-2);
}
.brand {
  grid-area: brand;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--s-1h);
  min-height: var(--header-row);
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand-mark {
  position: relative;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: var(--shadow-sm);
}
/* Three digest lines. The mark is drawn in CSS, so no image is loaded. */
.brand-mark::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0.5625rem;
  width: 1rem;
  height: 0.875rem;
  background:
    linear-gradient(var(--on-accent), var(--on-accent)) 0 0 / 1rem 0.1875rem no-repeat,
    linear-gradient(var(--on-accent), var(--on-accent)) 0 0.34375rem / 0.6875rem 0.1875rem no-repeat,
    linear-gradient(var(--on-accent), var(--on-accent)) 0 0.6875rem / 0.8125rem 0.1875rem no-repeat;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.wordmark { font-weight: 700; font-size: 1rem; letter-spacing: 0.01em; color: var(--text); }
.console-label { color: var(--muted); font-size: var(--fs-eyebrow); font-weight: 500; letter-spacing: 0.01em; }

/* Sign out: a quiet text button at the end of the header */
.topbar .signout { grid-area: signout; justify-self: end; margin: 0; }
.topbar .signout button {
  min-height: 2rem;
  padding: 0 var(--s-1);
  font-size: var(--fs-meta);
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 0;
  box-shadow: none;
}
.topbar .signout button:hover { color: var(--text); background: var(--surface-2); }

/* Page menu: tabs. The current page gets a teal bar on the header's lower edge. */
.menu {
  grid-area: menu;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  margin: 0 calc(-1 * var(--s-1));
  font-size: var(--fs-small);
  font-weight: 500;
}
.menu > a,
.menu .more > summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--tab-row);
  padding: 0 var(--s-1);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.menu > a:hover,
.menu .more > summary:hover { color: var(--text); }
.menu > a[aria-current="page"],
.menu .more:has(a[aria-current="page"]) > summary { color: var(--text); font-weight: 600; }
.menu > a[aria-current="page"]::after,
.menu .more:has(a[aria-current="page"]) > summary::after {
  content: "";
  position: absolute;
  left: var(--s-1);
  right: var(--s-1);
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}
.menu .more { position: relative; }
.menu .more > summary { cursor: pointer; list-style: none; }
.menu .more > summary::-webkit-details-marker { display: none; }
/* Chevron after the text */
.menu .more > summary::before {
  content: "";
  order: 2;
  width: 0.375rem;
  height: 0.375rem;
  margin: -0.1875rem 0 0 var(--s-1);
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.menu .more[open] > summary::before { margin-top: 0.1875rem; transform: rotate(-135deg); }
.menu .more ul {
  position: absolute;
  top: calc(100% + var(--s-half));
  right: 0;
  z-index: 30;
  width: max-content;
  min-width: 14rem;
  max-width: calc(100vw - 2 * var(--gutter));
  list-style: none;
  margin: 0;
  padding: var(--s-1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.menu .more li a {
  display: block;
  padding: var(--s-1) var(--s-1h);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.menu .more li a:hover { background: var(--surface-2); color: var(--text); }
.menu .more li a[aria-current="page"] { background: var(--accent-tint); color: var(--accent-strong); font-weight: 600; }

/* Layout */
main {
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--s-3) var(--gutter) var(--s-8);
}
main > * { margin-top: 0; margin-bottom: var(--s-2); }
main > :last-child { margin-bottom: 0; }
.page-head { margin-bottom: var(--s-3); }
h1 {
  font-size: var(--fs-title);
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0;
}
h2 { font-size: var(--fs-section); line-height: 1.35; font-weight: 600; margin: 0 0 var(--s-1h); letter-spacing: -0.005em; }
h3 { font-size: var(--fs-card); line-height: 1.4; font-weight: 600; margin: 0 0 var(--s-1); }
main > h2 { margin: var(--s-4) 0 var(--s-1h); }
p { margin: 0 0 var(--s-2); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
code, pre { font-family: var(--mono); font-size: 0.875em; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 0.0625em 0.375em; border-radius: 6px; overflow-wrap: anywhere; }
pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--s-2);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Dates, counts and step numbers line up in columns. */
.when, .due, .run-when, .stat-value, .step-num, td, .hint, .last-check { font-variant-numeric: tabular-nums; }

/* Cards: one style for every block that sits on the page background */
.card,
main > form,
main > section,
main > ul,
main > ol,
#wa-panel,
.status-card,
.stat,
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card,
main > form,
main > section,
main > ul,
main > ol,
#wa-panel,
.status-card { padding: var(--card-pad); }
main > ul, main > ol { padding-left: calc(var(--card-pad) + var(--s-3)); }
main > ul li + li, main > ol li + li { margin-top: var(--s-1); }
main > p { max-width: 48rem; }
/* A form that holds only a button is an action, not a card. Actions sit in a row. */
main > form:not(:has(label, fieldset, textarea)) {
  display: inline-flex;
  margin: 0 var(--s-1h) var(--s-3) 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}
@media (min-width: 40rem) {
  main > form:not(.card):has(label, fieldset) { max-width: 48rem; }
  /* Health facts in two columns. */
  main > ul { column-width: 20rem; column-gap: var(--s-4); }
  main > ul li { break-inside: avoid; }
  main > ul li + li { margin-top: 0; }
  main > ul li { margin-bottom: var(--s-1); }
}
/* Prompt texts: Save and Reset to default sit side by side under the text. */
.prompt-editor {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  column-gap: var(--s-1h);
  align-items: start;
}
.prompt-editor > form { display: contents; }
.prompt-editor > h2, .prompt-editor .field, .prompt-editor > p { grid-column: 1 / -1; }
.prompt-editor > form > p:not(.field) { margin: 0 0 var(--s-2); }
.prompt-editor > p:last-child { margin: 0; }
main > form.signout { background: none; border: 0; box-shadow: none; padding: 0; }
.card > :last-child, main > section > :last-child, main > form > :last-child, #wa-panel > :last-child { margin-bottom: 0; }
.card h2, main > section > h2, .status-card h2, #wa-panel h2 { font-size: var(--fs-card); }

/* Page header: the title, then the step line */
.step-header {
  margin: var(--s-1) 0 0;
  max-width: 48rem;
  color: var(--muted);
}
.step-header strong {
  display: inline-block;
  margin-right: var(--s-1);
  padding: 0 var(--s-1);
  border-radius: var(--pill);
  background: var(--accent-tint);
  color: var(--accent-strong);
  font-size: var(--fs-meta);
  font-weight: 600;
  line-height: 1.5rem;
  white-space: nowrap;
}

/* Banners and warnings */
.banner, .warning {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn-border);
}
.banner {
  margin: 0;
  padding: var(--s-1) var(--gutter);
  border-width: 0 0 1px 0;
  text-align: center;
  font-size: var(--fs-small);
  font-weight: 500;
}
/* A warning callout with a drawn "!" mark */
.warning {
  position: relative;
  border-radius: var(--radius);
  padding: var(--s-1h) var(--s-2) var(--s-1h) calc(var(--s-2) + 1.75rem);
  font-size: var(--fs-small);
  line-height: 1.55;
}
.warning::before {
  content: "";
  position: absolute;
  left: var(--s-2);
  top: 0.875rem;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background:
    linear-gradient(var(--warn-bg), var(--warn-bg)) 50% 0.25rem / 0.125rem 0.375rem no-repeat,
    linear-gradient(var(--warn-bg), var(--warn-bg)) 50% 0.75rem / 0.125rem 0.125rem no-repeat,
    var(--warn-dot);
}

/* Status and alerts */
p[role="status"]:not(.banner),
p[role="alert"] {
  border-radius: var(--radius-sm);
  padding: var(--s-1h) var(--s-2);
  font-size: var(--fs-small);
  font-weight: 500;
  max-width: none;
}
p[role="status"]:not(.banner) {
  background: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid var(--ok-border);
}
p[role="status"].pending {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: var(--warn-border);
}
p[role="alert"] {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error-border);
}
p[role="status"] a, p[role="alert"] a { color: inherit; font-weight: 600; }
.refusal { color: var(--error); font-size: var(--fs-meta); font-weight: 500; }

/* Buttons, and a link that looks like a button */
button,
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  min-height: 2.5rem;
  padding: 0 var(--s-2);
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
button:hover,
a.button:hover { color: var(--text); background: var(--surface-2); }
button.primary,
a.button.primary {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}
button.primary:hover,
a.button.primary:hover { color: var(--on-accent); background: var(--accent-strong); border-color: var(--accent-strong); }

/* Advanced settings: closed until opened or until a field in it is refused */
details.advanced {
  margin: 0 0 var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
details.advanced > summary {
  display: flex;
  align-items: center;
  gap: var(--s-1h);
  min-height: 3rem;
  padding: var(--s-1) var(--s-2);
  cursor: pointer;
  list-style: none;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--text);
  border-radius: var(--radius-sm);
}
details.advanced > summary::-webkit-details-marker { display: none; }
details.advanced > summary::before {
  content: "";
  flex: none;
  width: 0.4375rem;
  height: 0.4375rem;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
}
details.advanced[open] > summary::before { transform: rotate(45deg); }
details.advanced > summary:hover { background: var(--surface-2); }
details.advanced[open] > summary { border-bottom: 1px solid var(--border); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
details.advanced > :not(summary) { margin: var(--s-2); }

/* Overview */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-1h);
  margin: 0 0 var(--s-2);
}
@media (min-width: 40rem) { .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .stat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 40rem) { .stat-grid { gap: var(--s-2); } }
/* A section that failed has no tile. Fewer tiles still fill one row on desktop. */
@media (min-width: 64rem) {
  .stat-grid:has(> .stat:last-child:nth-child(5)) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .stat-grid:has(> .stat:last-child:nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-grid:has(> .stat:last-child:nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.note {
  display: inline-block;
  padding: var(--s-1) var(--s-1h);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-width: none;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  padding: var(--s-2);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.stat:hover, .stat:focus-visible { color: var(--text); border-color: var(--accent-line); box-shadow: var(--shadow), 0 0 0 3px var(--accent-tint); }
.stat-value { font-size: var(--fs-stat); font-weight: 650; line-height: 1; letter-spacing: -0.02em; }
.stat-label { color: var(--muted); font-size: var(--fs-meta); line-height: 1.4; }
/* "Mail last checked ..." with a small drawn clock */
.last-check {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  color: var(--muted);
  font-size: var(--fs-meta);
  margin-bottom: var(--s-3);
}
.last-check::before {
  content: "";
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background:
    linear-gradient(currentColor, currentColor) 0.25rem 0.125rem / 1.5px 0.3125rem no-repeat,
    linear-gradient(currentColor, currentColor) 0.25rem 0.375rem / 0.25rem 1.5px no-repeat;
}
.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
.overview-grid > section {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: var(--card-pad);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.overview-grid > section > h2, .section-head h2 { font-size: var(--fs-card); margin: 0 0 var(--s-1h); }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-1) var(--s-2);
  margin: 0 0 var(--s-1h);
}
.section-head h2 { margin: 0; }
@media (min-width: 40rem) {
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid > section { grid-column: 1 / -1; }
  .overview-grid > #events, .overview-grid > #nudges { grid-column: span 1; }
}
/* Desktop: Open Tasks is the main column. Drafts, events and Nudges stack
   beside it at their own heights. Summaries and runs can be long lists, so
   they take the full width. */
@media (min-width: 64rem) {
  .overview-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-rows: auto auto 1fr auto auto;
    grid-template-areas:
      "tasks drafts"
      "tasks events"
      "tasks nudges"
      "summaries summaries"
      "runs runs";
    gap: var(--s-3);
    align-items: start;
  }
  .overview-grid > section { grid-column: auto; }
  .overview-grid > #tasks { grid-area: tasks; align-self: stretch; }
  .overview-grid > #drafts { grid-area: drafts; }
  .overview-grid > #events { grid-area: events; }
  .overview-grid > #nudges { grid-area: nudges; }
  .overview-grid > #summaries { grid-area: summaries; }
  .overview-grid > #runs { grid-area: runs; }
  /* Recent runs as a table: job, state, start time, details. */
  .overview-grid #runs li {
    display: grid;
    grid-template-columns: 11rem 11rem 9rem minmax(0, 1fr);
    column-gap: var(--s-2);
    align-items: baseline;
  }
  .overview-grid #runs .run-when { margin-left: 0; }
  .overview-grid #runs .run-counts, .overview-grid #runs .run-error { grid-column: 4; padding-left: 0; margin-left: 0; justify-self: start; }
}
/* Task groups read as small labels */
.overview-grid h3 {
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: var(--s-2) 0 0;
}
.overview-grid h2 + h3 { margin-top: 0; }
.task-list, .item-list { list-style: none; margin: 0; padding: 0; }
.task-list li, .item-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-half) var(--s-1);
  padding: var(--s-1h) 0;
  border-top: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.task-list li:first-child, .item-list li:first-child { border-top: 0; }
.task-title { font-weight: 500; flex: 1 1 100%; }
@media (min-width: 40rem) { .task-title { flex: 0 1 auto; } }
.urgency {
  display: inline-block;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  line-height: 1.25rem;
  padding: 0 var(--s-1);
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.needs-action, .reason {
  display: inline-block;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  line-height: 1.25rem;
  padding: 0 var(--s-1);
  border: 1px solid var(--warn-border);
  border-radius: var(--pill);
  white-space: nowrap;
}
.urgency.high { color: var(--error); border-color: var(--error-border); background: var(--error-bg); }
.urgency.medium, .needs-action, .reason { color: var(--warn); border-color: var(--warn-border); background: var(--warn-bg); }
.project, .when, .run-counts { color: var(--muted); font-size: var(--fs-meta); }
/* Names come from WhatsApp. Isolate them so a bidi override cannot reverse the row. */
.project, .source, .item-list strong, .draft-item strong, .task-title { unicode-bidi: isolate; }
.when { white-space: nowrap; }
.due { margin-left: auto; font-size: var(--fs-meta); color: var(--text-2); white-space: nowrap; }
.source { color: var(--muted); font-size: var(--fs-meta); }
.item-list strong { font-weight: 600; }
.draft-item { padding: var(--s-2) 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.draft-item:first-of-type { border-top: 0; padding-top: var(--s-half); }
.draft-item:last-child { padding-bottom: 0; }
.draft-item p { margin: 0 0 var(--s-half); }
.draft-item > p:first-child { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0; row-gap: var(--s-half); }
.draft-item > p:first-child .when { flex-basis: 100%; }
@media (min-width: 40rem) { .draft-item > p:first-child .when { flex-basis: auto; margin-left: auto; padding-left: var(--s-2); } }
.draft-item > p:nth-child(2) { color: var(--text-2); }
.draft-item details > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  margin-top: var(--s-half);
  cursor: pointer;
  list-style: none;
  color: var(--accent);
  font-size: var(--fs-small);
  font-weight: 600;
}
.draft-item details > summary::-webkit-details-marker { display: none; }
.draft-item details > summary::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}
.draft-item details[open] > summary::before { transform: rotate(45deg); }
.draft {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: var(--fs-meta);
  line-height: 1.55;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--s-1h) var(--s-2);
  margin-top: var(--s-1);
}
/* Source filter: a small segmented control */
.filter {
  display: inline-flex;
  gap: var(--s-half);
  margin: 0;
  padding: var(--s-half);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-meta);
  font-weight: 500;
}
.filter > a, .filter > strong {
  padding: var(--s-half) var(--s-1h);
  border-radius: 6px;
  line-height: 1.25rem;
  text-decoration: none;
  color: var(--muted);
}
.filter > a:hover { color: var(--text); background: var(--surface); }
.filter > strong { color: var(--text); background: var(--surface); font-weight: 600; box-shadow: var(--shadow-sm); }
/* Recent Summaries: time and source on a meta line on phones, columns from tablet up. */
#summaries .item-list strong { flex-basis: 100%; }
#summaries .item-list .text { flex-basis: 100%; color: var(--text-2); }
/* Tablet: two lines per row. Time over source, sender over text, flag right. */
@media (min-width: 40rem) {
  #summaries .item-list li {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr) auto;
    column-gap: var(--s-2);
    row-gap: var(--s-half);
    align-items: baseline;
  }
  #summaries .item-list .when { grid-column: 1; grid-row: 1; }
  #summaries .item-list .source { grid-column: 1; grid-row: 2; }
  #summaries .item-list strong { grid-column: 2; grid-row: 1; }
  #summaries .item-list .text { grid-column: 2; grid-row: 2; }
  #summaries .item-list .needs-action { grid-column: 3; grid-row: 1; justify-self: end; }
}
/* Desktop: one line per row, in columns. */
@media (min-width: 64rem) {
  #summaries .item-list li { grid-template-columns: 8rem 5rem minmax(0, 12rem) minmax(0, 1fr) auto; }
  #summaries .item-list .when, #summaries .item-list .source, #summaries .item-list strong,
  #summaries .item-list .text, #summaries .item-list .needs-action { grid-row: 1; grid-column: auto; }
  #summaries .item-list .text { color: var(--text); }
}
#events .item-list .when, #nudges .item-list .when { flex-basis: 100%; }
#nudges .item-list .text { flex: 1 1 0; min-width: 0; }
@media (min-width: 64rem) {
  #events .item-list li, #nudges .item-list li {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr) auto;
    column-gap: var(--s-1h);
    align-items: baseline;
  }
}
/* Empty and failed sections read as intentional */
.empty {
  margin: 0;
  padding: var(--s-3) var(--s-2);
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-small);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}
/* In a card stretched beside a taller one, the empty box fills the card. */
.overview-grid .empty { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; }

/* Status cards on the status page. The badge word says what the colour says. */
.summary {
  display: flex;
  align-items: center;
  gap: var(--s-1h);
  overflow-wrap: anywhere;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-1h) var(--s-2);
  background: var(--surface);
  max-width: none;
}
.summary::before { content: ""; flex: none; width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--muted); }
.summary.ok { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-border); }
.summary.ok::before { background: var(--ok-dot); }
.summary.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.summary.warn::before { background: var(--warn-dot); }
.summary.bad { background: var(--error-bg); color: var(--error); border-color: var(--error-border); }
.summary.bad::before { background: var(--error-dot); }
.summary a { color: inherit; margin-left: auto; }
.status-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-2);
  margin: 0 0 var(--s-2);
}
/* Tablet: two cards per row. Desktop: three, and when five small cards sit
   above Last runs, the fourth and fifth share a row, so no cell is empty.
   Last runs (wide) always takes a full row. */
@media (min-width: 40rem) {
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-card.wide { grid-column: 1 / -1; }
  .status-grid > :first-child:nth-last-child(6) ~ :nth-child(5) { grid-column: 1 / -1; }
}
@media (min-width: 64rem) {
  .status-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s-3); margin-bottom: var(--s-3); }
  .status-card { grid-column: span 2; }
  .status-grid > :first-child:nth-last-child(6) ~ :nth-child(4),
  .status-grid > :first-child:nth-last-child(6) ~ :nth-child(5),
  .status-grid > :first-child:nth-last-child(5),
  .status-grid > :first-child:nth-last-child(5) ~ :not(.wide) { grid-column: span 3; }
  .status-card.wide { grid-column: 1 / -1; }
}
.status-card { display: flex; flex-direction: column; margin: 0; overflow-wrap: anywhere; }
.status-card.warn { box-shadow: var(--shadow), inset 3px 0 0 var(--warn-dot); }
.status-card.bad { box-shadow: var(--shadow), inset 3px 0 0 var(--error-dot); }
.status-card h2 {
  margin: 0 0 var(--s-1h);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-1) var(--s-1h);
}
.status-card p { margin: 0 0 var(--s-1); color: var(--text-2); }
.status-card .card-link { margin: auto 0 0; padding-top: var(--s-1h); font-size: var(--fs-small); font-weight: 600; }
.badge {
  display: inline-block;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  line-height: 1.25rem;
  padding: 0 var(--s-1);
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.status-card.ok .badge { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-border); }
.status-card.warn .badge { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.status-card.bad .badge { background: var(--error-bg); color: var(--error); border-color: var(--error-border); }
.runs { list-style: none; margin: 0; padding: 0; }
.runs li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-half) var(--s-1h);
  padding: var(--s-1h) 0;
  border-top: 1px solid var(--border);
}
.runs li:first-child { border-top: 0; padding-top: var(--s-half); }
.run-name { display: inline-flex; align-items: center; gap: var(--s-1); font-weight: 600; min-width: 7rem; }
.run-name::before { content: ""; flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--border-strong); }
.runs .ok .run-name::before { background: var(--ok-dot); }
.runs .warn .run-name::before { background: var(--warn-dot); }
.runs .bad .run-name::before { background: var(--error-dot); }
.run-state { color: var(--text-2); font-size: var(--fs-small); }
.run-when { color: var(--muted); font-size: var(--fs-meta); margin-left: auto; white-space: nowrap; }
.runs .warn .run-state { color: var(--warn); font-weight: 600; }
.runs .bad .run-state { color: var(--error); font-weight: 600; }
.run-counts { flex-basis: 100%; padding-left: var(--s-2); }
.run-error {
  flex-basis: 100%;
  overflow-wrap: anywhere;
  color: var(--error);
  font-size: var(--fs-meta);
  margin-left: var(--s-2);
  padding: var(--s-half) var(--s-1);
  background: var(--error-bg);
  border-radius: 6px;
}
.runs .warn .run-error { color: var(--warn); background: var(--warn-bg); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-1h); margin: 0 0 var(--s-1h); }
.actions form { margin: 0; }
.quick .hint { margin: 0; }

/* Step pages and the Setup guide */
.guide { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
.guide > * { margin: 0; }
@media (min-width: 64rem) {
  .guide {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "intro all" "how all";
    column-gap: var(--s-4);
    align-items: start;
  }
  .guide-intro { grid-area: intro; }
  .guide-all { grid-area: all; }
  .guide-how { grid-area: how; }
}
.guide-intro > .hint { margin: 0 0 var(--s-1); font-size: var(--fs-small); font-weight: 500; color: var(--text-2); }
.progress { display: flex; gap: var(--s-half); margin: 0 0 var(--s-2); }
.progress span { flex: 1; height: 0.375rem; border-radius: var(--pill); background: var(--surface-3); }
.progress span.done { background: var(--accent); }
.guide-next {
  margin: 0;
  padding: var(--s-3) var(--card-pad);
  background: linear-gradient(180deg, var(--accent-tint) 0%, var(--surface) 85%);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.guide-next h2 {
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin: 0 0 var(--s-1);
}
.guide-next p { margin: 0 0 var(--s-1h); max-width: 40rem; color: var(--text-2); }
.guide-next p:first-of-type { font-size: 1.25rem; line-height: 1.35; color: var(--text); }
.guide-next p:first-of-type strong { font-weight: 650; }
.guide-next p:last-child { margin: var(--s-3) 0 0; }
.guide-all, .guide-how {
  padding: var(--card-pad);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.guide-all h2, .guide-how h2 { font-size: var(--fs-card); margin-bottom: var(--s-1h); }
.guide-how { background: var(--surface-2); box-shadow: none; }
.guide-how p { margin: 0; color: var(--text-2); max-width: 40rem; }
.guide-steps { list-style: none; margin: 0; padding: 0; }
.guide-steps li {
  display: flex;
  align-items: center;
  gap: var(--s-1h);
  padding: var(--s-1h) var(--s-1);
  margin: 0 calc(-1 * var(--s-1));
  border-top: 1px solid var(--border);
}
.guide-steps li:first-child { border-top: 0; }
/* The first step still to do is the next one. */
.guide-steps .todo:not(.todo ~ .todo) { background: var(--accent-tint); border-radius: var(--radius-sm); border-top-color: transparent; }
.guide-steps .todo:not(.todo ~ .todo) + li { border-top-color: transparent; }
.guide-steps a { font-weight: 500; }
.step-num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 600;
}
.guide-steps .done .step-num { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-text); }
.guide-steps .todo:not(.todo ~ .todo) .step-num { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.step-state {
  margin-left: auto;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  line-height: 1.25rem;
  padding: 0 var(--s-1);
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.guide-steps .done .step-state { border-color: var(--ok-border); background: var(--ok-bg); color: var(--ok-text); }

/* Two column pages: a main column, and a side column for a warning or the sign-in */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
.split > * { margin: 0; min-width: 0; }
.split-aside > *, .split-main > * { margin: 0 0 var(--s-2); }
.split-aside > :last-child, .split-main > :last-child { margin-bottom: 0; }
@media (min-width: 64rem) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); column-gap: var(--s-3); align-items: start; }
  .split-main { grid-column: 1; grid-row: 1; }
  .split-aside { grid-column: 2; grid-row: 1; }
  .google-split > .g-setup { grid-column: 1; grid-row: 1; }
  .google-split > .g-signin { grid-column: 2; grid-row: 1; }
}
.g-signin h2 + p { color: var(--text); font-weight: 500; }
.g-signin form { display: inline-flex; margin: 0 var(--s-1) var(--s-2) 0; }
.setup-list { margin: 0 0 var(--s-3); padding-left: var(--s-3); color: var(--text-2); }
.setup-list li + li { margin-top: var(--s-1); }
.setup-list li::marker { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.form-foot { margin: var(--s-3) 0 0; padding-top: var(--s-2); border-top: 1px solid var(--border); }

/* Screen reader only */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Forms */
form { margin: 0; }
form > p { margin: 0 0 var(--s-2); }
form > p:last-child { margin-bottom: 0; }
label { font-weight: 500; }
p > label:has(input:not([type="radio"]):not([type="checkbox"])) {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  font-size: var(--fs-small);
  font-weight: 600;
}
/* A radio or checkbox line: the box sits on the first line of the text. */
p > label:has(> input[type="radio"]),
p > label:has(> input[type="checkbox"]) {
  display: flex;
  align-items: flex-start;
  gap: var(--s-1h);
  cursor: pointer;
}
p > label:has(> input[type="radio"]) { font-weight: 400; }
input[type="radio"], input[type="checkbox"] {
  flex: none;
  width: 1rem;
  height: 1rem;
  margin: 0.25rem 0 0;
  accent-color: var(--accent);
}
/* Radio choices are cards. The picked one is teal. */
p:has(> label > input[type="radio"]) {
  margin: 0 0 var(--s-1);
  padding: var(--s-1h) var(--s-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
p:has(> label > input[type="radio"]:checked) { border-color: var(--accent-line); background: var(--accent-tint); }
input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),
textarea,
select {
  width: 100%;
  min-height: 2.5rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: var(--s-1) var(--s-1h);
}
@media (min-width: 40rem) {
  input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), select { font-size: var(--fs-body); }
}
.field input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), .field select { max-width: 36rem; }
textarea { font-family: var(--mono); font-size: var(--fs-meta); line-height: 1.55; resize: vertical; }
textarea[readonly] { background: var(--surface-2); color: var(--muted); }
input:hover, textarea:hover, select:hover { border-color: var(--muted); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
fieldset { min-width: 0; border: 0; margin: 0 0 var(--s-2); padding: 0; }
/* A floated legend lays out like a normal block (the Bootstrap 5 method). */
legend { float: left; width: 100%; padding: 0; margin: 0 0 var(--s-1h); font-weight: 600; font-size: var(--fs-card); line-height: 1.4; }
legend + * { clear: left; }
fieldset > p { margin: 0 0 var(--s-2); }
fieldset > p:last-child { margin-bottom: 0; }
.field { display: flex; flex-direction: column; gap: var(--s-1); margin: 0 0 var(--s-3); }
.field > label { font-size: var(--fs-small); font-weight: 600; }
.hint { color: var(--muted); font-size: var(--fs-meta); line-height: 1.5; }
.field > .hint { margin-top: calc(-1 * var(--s-half)); }
.tag {
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0 var(--s-1);
  border-radius: var(--pill);
  color: var(--muted);
  vertical-align: middle;
}

/* Form cards: groups split by hairlines, the Save button in a footer */
.form-card > fieldset { padding: var(--s-3) 0 0; margin: 0 0 var(--s-3); border-top: 1px solid var(--border); }
.form-card > fieldset:first-of-type { padding-top: 0; border-top: 0; }
.form-card > details.advanced > fieldset { padding: var(--s-3) 0 0; margin: 0 var(--s-2) var(--s-3); border-top: 1px solid var(--border); }
.form-card > details.advanced > fieldset:first-of-type { border-top: 0; padding-top: var(--s-1); }
.form-card > p:last-child {
  margin: var(--s-3) calc(-1 * var(--card-pad)) calc(-1 * var(--card-pad));
  padding: var(--s-2) var(--card-pad);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
}
.subform { display: flex; align-items: center; gap: var(--s-1h); }
main > form > p:last-child:has(> button) { margin-top: var(--s-3); }
.subform > p { margin: 0; }

/* Desktop forms: settings rows. On Install config the group name sits in a
   left column. In every row the label and hint sit left and the box right. */
@media (min-width: 64rem) {
  .settings > fieldset,
  .settings > details.advanced > fieldset { display: flow-root; }
  .settings legend { width: 13rem; margin: 0; padding-top: var(--s-1); }
  .settings legend + * { clear: none; }
  .settings fieldset > .field { margin-left: 15rem; }
  .rows .field {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    grid-template-rows: auto 1fr;
    column-gap: var(--s-4);
    row-gap: var(--s-half);
    align-items: start;
    padding: 0 0 var(--s-2);
    margin: 0 0 var(--s-2);
    border-bottom: 1px solid var(--border);
  }
  .rows .field:last-child, .rows .field:has(+ .form-foot) { border-bottom: 0; padding-bottom: 0; }
  .rows .field > label { grid-column: 1; grid-row: 1; padding-top: var(--s-1); }
  .rows .field > .hint { grid-column: 1; grid-row: 2; margin: 0; }
  .rows .field > input, .rows .field > select, .rows .field > textarea { grid-column: 2; grid-row: 1 / span 2; }
  /* A refusal sits right under its box. */
  .rows .field:has(> .refusal) > input, .rows .field:has(> .refusal) > select, .rows .field:has(> .refusal) > textarea { grid-row: 1; }
  .rows .field > .refusal { grid-column: 2; grid-row: 2; }
  .rows > p:has(> label > input[type="checkbox"]) {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    column-gap: var(--s-4);
  }
  .rows > p:has(> label > input[type="checkbox"]) > label { grid-column: 2; }
  .settings .rows .field, .settings fieldset > .field { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
}

/* Tables: scroll sideways on narrow screens */
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: var(--fs-small);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 0 var(--s-2);
  overflow: hidden;
}
th, td { text-align: left; padding: var(--s-1h) var(--s-2); vertical-align: top; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
th {
  color: var(--muted);
  background: var(--surface-2);
  font-weight: 600;
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
@media (max-width: 40rem) { table { display: block; overflow-x: auto; } }

/* WhatsApp panel */
#wa-panel img { display: block; max-width: 100%; height: auto; padding: var(--s-1); background: var(--on-accent); border-radius: var(--radius-sm); border: 1px solid var(--border); }
#wa-panel p { margin: 0 0 var(--s-2); }
#wa-panel form > p { margin: 0; }

/* Setup and sign-in: one centred card, wordmark above */
body:has(.auth-card) .topbar { display: none; }
body:has(.auth-card) main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: calc(26rem + 2 * var(--gutter));
}
body:has(.auth-card) .page-head { margin: 0 0 var(--s-2); }
body:has(.auth-card) h1 { font-size: var(--fs-body); font-weight: 500; color: var(--muted); text-align: center; letter-spacing: 0; }
/* The brand mark, then the wordmark, both drawn in CSS. */
body:has(.auth-card) main::before {
  content: "";
  align-self: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: var(--s-1h);
  border-radius: 10px;
  box-shadow: var(--shadow);
  background:
    linear-gradient(var(--on-accent), var(--on-accent)) 0.625rem 0.75rem / 1.25rem 0.25rem no-repeat,
    linear-gradient(var(--on-accent), var(--on-accent)) 0.625rem 1.1875rem / 0.875rem 0.25rem no-repeat,
    linear-gradient(var(--on-accent), var(--on-accent)) 0.625rem 1.625rem / 1rem 0.25rem no-repeat,
    linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}
body:has(.auth-card) .page-head::before {
  content: "AI-COS";
  display: block;
  text-align: center;
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: 0.01em;
  color: var(--text);
  margin-bottom: var(--s-half);
}
.auth-card { padding: var(--s-3); }
.auth-card p { margin: 0 0 var(--s-2); color: var(--text-2); }
.auth-card form > p:last-child { margin-bottom: 0; }
.auth-card button { width: 100%; }

/* Desktop header: one row with the brand, the tabs and sign out */
@media (min-width: 64rem) {
  .topbar-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand menu signout";
    column-gap: var(--s-5);
  }
  .menu { align-self: stretch; margin: 0; }
  .menu > a, .menu .more > summary { min-height: var(--header-row); padding: 0 var(--s-1h); }
  .menu > a[aria-current="page"]::after,
  .menu .more:has(a[aria-current="page"]) > summary::after { left: var(--s-1h); right: var(--s-1h); }
  .menu .more ul { right: auto; left: 0; }
  main { padding-top: var(--s-4); }
  .page-head { margin-bottom: var(--s-4); }
}
