/* Theming: every colour is declared once as light-dark(light, dark); the active
   side is chosen by `color-scheme` below. Light is the default regardless of OS,
   dark is opt-in via data-theme (set before paint by /assets/theme.js).
   light-dark() takes colours only, so composite values like box-shadow keep
   their offsets here and tokenise just the colour. */
:root {
  color-scheme: light;
  font-family:
    "Nunito Sans",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  /* Text */
  --ink: light-dark(#14241a, #ece2d8);
  --muted: light-dark(#786b65, #a3958a);

  /* Brand. --green paints surfaces (it is a maroon; the name is legacy),
     --green-ink is the same colour used as text and must lighten in dark. */
  --green: light-dark(#193f27, #10291a);
  --green-ink: light-dark(#193f27, #dfe8c9);
  --green-2: light-dark(#2f6a45, #6fae86);
  --green-soft: light-dark(#eef4ec, #2c211b);
  --gold: light-dark(#ffe27a, #3a3110);
  /* Gold remains a light surface in dark mode. Keep foregrounds on it dark
     rather than inheriting the lightened, dark-surface brand text. */
  --on-gold: light-dark(#193f27, #193f27);
  --gold-wash: light-dark(rgb(255 226 122 / 72%), rgb(16 41 26 / 26%));
  --on-brand: light-dark(#fff, #fff);
  --on-brand-muted: light-dark(rgb(255 255 255 / 74%), rgb(255 255 255 / 78%));
  --on-brand-line: light-dark(rgb(255 255 255 / 13%), rgb(255 255 255 / 18%));
  --on-brand-line-strong: light-dark(
    rgb(255 255 255 / 24%),
    rgb(255 255 255 / 30%)
  );
  --on-brand-wash: light-dark(rgb(255 255 255 / 10%), rgb(255 255 255 / 14%));
  --on-brand-wash-soft: light-dark(
    rgb(255 255 255 / 5%),
    rgb(255 255 255 / 8%)
  );
  --on-brand-wash-strong: light-dark(
    rgb(255 255 255 / 12%),
    rgb(255 255 255 / 16%)
  );
  --on-gold-line: light-dark(rgb(255 226 122 / 35%), rgb(255 226 122 / 42%));
  --on-gold-wash: light-dark(rgb(255 226 122 / 10%), rgb(255 226 122 / 15%));

  /* Surfaces */
  --paper: light-dark(#fffdf9, #241c18);
  --paper-2: light-dark(#fffaf5, #2a211c);
  --paper-3: light-dark(#faf7f3, #201915);
  --control-surface: light-dark(#fff, #2a211c);
  --canvas: light-dark(#f5efe4, #17110e);
  --line: light-dark(#ddcfc4, #3b2e26);
  --soft-line: light-dark(#eee4dc, #32261f);
  --hero-glow: light-dark(rgb(246 197 22 / 24%), rgb(16 41 26 / 22%));

  /* Translucent sticky-header veils */
  --veil-strong: light-dark(rgb(255 255 255 / 98%), rgb(36 28 24 / 97%));
  --veil: light-dark(rgb(255 255 255 / 82%), rgb(36 28 24 / 88%));
  --veil-soft: light-dark(rgb(255 255 255 / 72%), rgb(36 28 24 / 76%));

  /* Status */
  --ok: light-dark(#1d6b3c, #6ec894);
  --ok-soft: light-dark(#edf8f2, #16301f);
  --ok-line: light-dark(#b9ddca, #2f5a41);
  --danger: light-dark(#9f1239, #f2919f);
  --danger-soft: light-dark(#fff1f2, #351b20);
  --danger-line: light-dark(#fecdd3, #69313d);
  --warn: light-dark(#9a5f08, #e3a44e);
  --warn-soft: light-dark(#fff8e9, #33270f);
  --warn-line: light-dark(#ead6a8, #6a552e);
  --accent-ink: light-dark(#8a6d00, #f6c516);
  --accent-line: light-dark(#d8bf88, #6a5836);
  --focus-ring: light-dark(rgb(47 106 69 / 14%), rgb(111 174 134 / 28%));

  /* Fixed-purpose surfaces. Print and code remain intentionally fixed across
     themes; diff accents brighten in dark so their meaning stays visible. */
  --print-paper: light-dark(#fff, #fff);
  --print-line: light-dark(#cbd5e1, #cbd5e1);
  --code-surface: light-dark(#14241a, #14241a);
  --code-ink: light-dark(#f9eee6, #f9eee6);
  --code-line: light-dark(#302a27, #302a27);
  --diff-match: light-dark(#2f855a, #68c58f);
  --diff-change: light-dark(#c05621, #e09267);
  --diff-missing: light-dark(#b7791f, #e3b15c);

  /* Shadow + overlay colours, named by their light-mode alpha so light output
     is unchanged. All collapse to black at higher alpha in dark. */
  --shadow-05: light-dark(rgb(25 63 39 / 5%), rgb(0 0 0 / 40%));
  --shadow-06: light-dark(rgb(25 63 39 / 6%), rgb(0 0 0 / 44%));
  --shadow-07: light-dark(rgb(25 63 39 / 7%), rgb(0 0 0 / 46%));
  --shadow-08: light-dark(rgb(25 63 39 / 8%), rgb(0 0 0 / 48%));
  --shadow-10: light-dark(rgb(25 63 39 / 10%), rgb(0 0 0 / 52%));
  --shadow-14: light-dark(rgb(25 63 39 / 14%), rgb(0 0 0 / 56%));
  --shadow-18: light-dark(rgb(35 31 32 / 18%), rgb(0 0 0 / 58%));
  --shadow-modal-color: light-dark(rgb(35 17 10 / 28%), rgb(0 0 0 / 68%));
  --backdrop: light-dark(rgb(27 19 15 / 52%), rgb(0 0 0 / 70%));

  --radius: 14px;
  --shadow: 0 18px 52px var(--shadow-10);
}

/* The toggle writes data-theme onto <html>. "system" follows the OS because
   light-dark() then resolves against a `light dark` scheme. */
:root[data-theme="dark"] {
  color-scheme: dark;
}

:root[data-theme="system"] {
  color-scheme: light dark;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

/* Icon-only, so square off the topbar button's label padding. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  padding: 8px;
  flex: none;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 50% -10%, var(--gold-wash), transparent 42rem),
    var(--canvas);
  color: var(--ink);
}

main {
  max-width: 1720px;
  margin: 0 auto;
  padding: 22px 28px 64px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  color: var(--green-ink);
  font-family: "Zilla Slab", Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.04;
}

h2 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 6px;
  font-size: 15px;
}

p {
  margin-bottom: 0;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 8px clamp(16px, 2.5vw, 36px);
  border-bottom: 1px solid var(--on-brand-line);
  background: var(--green);
  color: var(--on-brand);
  box-shadow: 0 4px 22px var(--shadow-18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  color: inherit;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 145px;
  height: 32px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.brand strong {
  border-left: 1px solid var(--on-brand-line-strong);
  padding-left: 12px;
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 15px;
  white-space: nowrap;
}

.topbar-date {
  display: flex;
  min-width: 0;
  flex: 0 1 230px;
  flex-direction: column;
  gap: 2px;
  color: var(--gold-wash);
}

.topbar-date > span {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.topbar-date select {
  width: 100%;
  min-height: 34px;
  border-color: var(--on-brand-line-strong);
  padding: 5px 9px;
  color: var(--on-brand);
  background: var(--on-brand-wash);
  color-scheme: dark;
  font-size: 11px;
}

/* The shared Workspaces dropdown (filled by shared.js), in topbar colors. */
.admin-menu {
  position: relative;
}

.admin-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--on-brand-line-strong);
  border-radius: 8px;
  color: var(--on-brand);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-menu summary::-webkit-details-marker {
  display: none;
}

.admin-menu summary::after {
  content: "▾";
  font-size: 11px;
  opacity: 0.8;
}

.admin-menu summary:hover {
  background: var(--on-brand-wash);
}

.admin-menu[open] summary {
  background: var(--on-brand-wash-strong);
}

.admin-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  display: grid;
  min-width: 220px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 28px var(--shadow-18);
}

.admin-menu-list a {
  min-height: auto;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  justify-content: flex-start;
}

.admin-menu-list a:hover {
  background: var(--green-soft);
  color: var(--green-ink);
}

.admin-menu-list a.active {
  background: var(--green);
  color: var(--on-brand);
}

.topbar-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 7px;
}

.topbar-actions button {
  min-height: 38px;
  padding: 7px 12px;
}

.topbar-secondary {
  border-color: var(--on-brand-line-strong);
  color: var(--on-brand);
  background: transparent;
}

.topbar-primary {
  border-color: var(--gold);
  color: var(--on-gold);
  background: var(--gold);
}

button,
.button,
.pdfs a,
.assignment-row a {
  appearance: none;
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: var(--on-brand);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

button:hover,
.button:hover {
  background: var(--green-2);
}

.topbar-secondary:hover {
  background: var(--on-brand-wash);
}

.topbar-primary:hover {
  color: var(--green-ink);
  background: var(--warn-soft);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ghost,
.pdfs a,
.assignment-row a {
  border-color: var(--line);
  background: var(--paper-2);
  color: var(--green-ink);
}

.ghost:hover,
.pdfs a:hover,
.assignment-row a:hover {
  background: var(--green-soft);
}

.icon-button {
  min-height: 32px;
  padding: 6px 9px;
  border-color: transparent;
  background: transparent;
  color: var(--green-ink);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

select,
input,
textarea {
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--control-surface);
  color: var(--ink);
  font: inherit;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

textarea {
  width: 100%;
  min-height: 210px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

input[type="search"] {
  min-width: min(340px, 70vw);
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--green-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero-copy,
.summary,
.muted,
.hint,
[role="status"],
small {
  color: var(--muted);
}

.hint {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.error {
  color: var(--danger);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(24px, 6vw, 72px) 18px;
}

.login-card {
  width: min(100%, 440px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(26px, 6vw, 38px);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 8vw, 40px);
}

.login-intro {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.login-logo {
  display: block;
  width: 168px;
  height: auto;
  margin-bottom: 20px;
}

.login-reassurance {
  margin-top: 24px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.login-account-line {
  margin: 16px 0;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--gold-wash);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
}

.login-account-line strong {
  color: var(--green-ink);
}

.login-notice {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  background: var(--paper-2);
}

.login-notice.error {
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.login-options {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

.google-sign-in {
  width: 100%;
  min-height: 46px;
  gap: 10px;
  border-color: var(--line);
  color: var(--ink);
  background: var(--control-surface);
}

.google-sign-in:hover {
  color: var(--ink);
  background: var(--paper-2);
}

.google-sign-in svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.login-divider span {
  white-space: nowrap;
}

.login-email-form {
  display: grid;
  gap: 14px;
}

.login-email-form h2 {
  margin: 0;
  color: var(--ink);
}

.login-email-form .hint {
  margin: -8px 0 0;
}

.login-email-form button {
  width: 100%;
  min-height: 44px;
}

.login-sent-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--green-ink);
  background: var(--paper-2);
  place-items: center;
}

.login-sent-icon svg {
  width: 28px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.login-sent-icon .login-sent-check {
  stroke: var(--ok);
  stroke-width: 2;
}

.login-sent-help {
  display: grid;
  gap: 5px;
  margin-top: 24px;
  border-left: 3px solid var(--gold);
  padding: 3px 0 3px 14px;
}

.login-sent-help p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.login-retry {
  width: 100%;
  margin-top: 26px;
  border-color: var(--line);
  padding: 9px 13px;
  color: var(--ink);
  background: var(--control-surface);
}

.login-retry:hover {
  color: var(--ink);
  background: var(--paper-2);
}

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

.workspace-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 48px;
  align-items: end;
  margin-bottom: 26px;
  padding: 30px 34px;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at 83% -20%, var(--hero-glow), transparent 45%),
    var(--paper);
  box-shadow: var(--shadow);
}

.workspace-hero h1 {
  max-width: 720px;
}

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
  padding: 12px 4px 22px;
  border-bottom: 1px solid var(--shadow-14);
}

.page-intro h1 {
  margin-bottom: 7px;
}

.page-intro-meta {
  display: grid;
  min-width: 220px;
  gap: 3px;
  border-left: 2px solid var(--green-2);
  padding: 5px 0 5px 14px;
  color: var(--muted);
  font-size: 11px;
}

.page-intro-meta strong {
  color: var(--green-ink);
  font-size: 14px;
}

.page-intro-meta.sync-line {
  display: flex;
}

.hero-copy {
  max-width: 660px;
  font-size: 15px;
  line-height: 1.55;
}

.hero-controls {
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--veil-soft);
}

.sync-line {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-line);
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.service-rail,
.day-workspace,
.settings-disclosure,
section.panel,
article.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 4px 20px var(--shadow-05);
}

.day-workspace {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.service-rail {
  position: static;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
}

.service-rail .section-head {
  padding-right: 14px;
  border-right: 1px solid var(--soft-line);
}

.service-rail h2 {
  margin: 0;
  font-size: 15px;
}

.service-rail .eyebrow {
  margin-bottom: 3px;
  font-size: 9px;
}

.section-head,
.day-heading,
.article-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.section-head.compact {
  align-items: center;
}

.service-days {
  display: flex;
  gap: 6px;
  margin: 0;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.service-day-button {
  display: flex;
  width: 184px;
  flex: 0 0 184px;
  min-height: auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 10px;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.service-day-button:hover {
  background: var(--paper-2);
}

.service-day-button.active {
  border-color: var(--accent-line);
  background: var(--green-soft);
  color: var(--green-ink);
}

.service-day-button span:first-child {
  display: grid;
  gap: 3px;
}

.service-day-button small {
  font-size: 10px;
  font-weight: 500;
}

.service-chevron {
  color: var(--muted);
  font-size: 22px;
  font-weight: 400;
}

.workspace-main {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.day-workspace {
  padding: 4px 0 0;
}

.day-heading {
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--soft-line);
}

.action-launchers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 26px;
}

.quick-action {
  display: grid;
  min-width: 0;
  min-height: 132px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 8px 24px var(--shadow-05);
  text-align: left;
  text-decoration: none;
}

.quick-action:hover {
  border-color: var(--accent-line);
  color: var(--ink);
  background: var(--paper-2);
  transform: translateY(-1px);
}

.quick-action.featured {
  border-color: var(--green);
  color: var(--on-brand);
  background: var(--green);
}

.quick-action.featured:hover {
  color: var(--on-brand);
  background: var(--green-2);
}

.quick-action-number {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  color: var(--green-2);
  background: var(--green-soft);
  font-family: "Zilla Slab", Georgia, serif;
  font-weight: 700;
}

.featured .quick-action-number {
  border-color: var(--on-gold-line);
  color: var(--gold);
  background: var(--on-gold-wash);
}

.quick-action-copy {
  display: grid;
  gap: 3px;
}

.quick-action-copy small {
  color: var(--green-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.quick-action-copy strong {
  color: inherit;
  font-size: 14px;
}

.quick-action-copy > span:not(.readiness-summary) {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.featured .quick-action-copy small,
.featured .quick-action-copy > span:not(.readiness-summary) {
  color: var(--veil-soft);
}

.quick-action-arrow {
  color: var(--green-2);
  font-size: 17px;
}

.featured .quick-action-arrow {
  color: var(--gold);
}

.quick-action .readiness-summary {
  display: flex;
  min-width: 0;
  gap: 5px;
  align-items: center;
  border: 0;
  padding: 3px 0 0;
  background: transparent;
  font-size: 10px;
}

.quick-action .readiness-summary.ready,
.quick-action .readiness-summary.warn {
  border: 0;
  background: transparent;
}

.quick-action .readiness-summary strong {
  font-size: 10px;
}

.quick-action .readiness-summary > span:last-child {
  display: none;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
  font-size: 17px;
}

.section-heading > span {
  color: var(--muted);
  font-size: 11px;
}

.service-overview {
  margin-bottom: 24px;
}

.service-overview .notion-services {
  margin: 0;
}

.communication-heading {
  margin-top: 2px;
}

.communication-flow {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.communication-flow::before {
  display: none;
}

.readiness-summary {
  display: grid;
  min-width: 250px;
  gap: 3px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-3);
  font-size: 12px;
}

.readiness-summary.ready {
  border-color: var(--ok-line);
  background: var(--ok-soft);
  color: var(--ok);
}

.readiness-summary.warn {
  border-color: var(--warn-line);
  background: var(--warn-soft);
  color: var(--warn);
}

.readiness-summary span {
  color: inherit;
  opacity: 0.8;
}

.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.notion-services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin: 18px 0 22px;
}

.notion-service-card {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: var(--paper);
}

.notion-service-card h3 {
  margin-top: 9px;
  font-size: 18px;
}

.notion-service-card p {
  margin-bottom: 5px;
  font-size: 13px;
}

.source-pill,
.chip,
.badge {
  display: inline-flex;
  width: max-content;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.text-link {
  flex: none;
  color: var(--green-2);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.workflow-flow {
  position: relative;
  display: grid;
  gap: 10px;
}

.workflow-flow::before {
  position: absolute;
  top: 30px;
  bottom: 30px;
  left: 18px;
  width: 1px;
  background: var(--line);
  content: "";
}

.workflow-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  padding: 15px 16px 15px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 11px;
  background: var(--paper);
}

.workflow-number {
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-ink);
  font-family: Georgia, serif;
  font-weight: 700;
}

.workflow-copy > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.workflow-actions,
.toolbar,
.row,
.grid,
.contexts,
.chips,
.pdfs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.workflow-actions {
  margin-top: 11px;
}

.workflow-actions .button,
.workflow-actions button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 11px;
}

.send-card {
  border-color: var(--accent-line);
  background: var(--paper-2);
}

.settings-disclosure {
  overflow: hidden;
}

.settings-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.settings-disclosure > summary::-webkit-details-marker {
  display: none;
}

.settings-disclosure > summary span:first-child {
  display: grid;
  gap: 4px;
}

.summary-action {
  color: var(--green-2);
  font-size: 12px;
  font-weight: 800;
}

.settings-body {
  border-top: 1px solid var(--soft-line);
}

.settings-section {
  padding: 22px;
  border-bottom: 1px solid var(--soft-line);
}

.template-actions,
.template-token-list,
.message-template-preview-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.template-actions {
  justify-content: flex-end;
}

#orchestra-template {
  min-height: 250px;
  margin-top: 8px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
}

.template-token-list {
  margin-top: 10px;
}

.template-token {
  min-height: 30px;
  padding: 5px 8px;
  border-color: var(--line);
  background: var(--paper-3);
  color: var(--green-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.message-template-preview {
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-3);
}

.message-template-preview-head {
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: 11px;
}

.message-template-preview pre {
  min-height: 130px;
  max-height: 380px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  color: var(--ink);
  font:
    13px/1.55 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.schedule-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 140px;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
}

.check input {
  min-height: auto;
}

.health-results {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.health-check {
  display: flex;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.badge.pass,
.badge.ready {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge.warn,
.badge.mixed {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.fail,
.badge.missing {
  background: var(--danger-soft);
  color: var(--danger);
}

.settings-savebar {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 14px 22px;
  background: var(--paper-3);
}

/* Shared secondary pages */
.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 15px 17px;
  border: 1px solid var(--ok-line);
  border-radius: 12px;
  background: var(--green-soft);
}

.context-bar-copy {
  display: grid;
  gap: 3px;
}

.context-bar label {
  min-width: 250px;
}

section.panel {
  margin-top: 14px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.toolbar {
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.workspace-toolbar {
  position: sticky;
  z-index: 8;
  top: 78px;
  min-height: 68px;
  margin-bottom: 18px;
  border-color: var(--line);
  background: var(--veil-strong);
  box-shadow: 0 9px 30px var(--shadow-07);
  backdrop-filter: blur(12px);
}

.workspace-toolbar [role="status"] {
  margin-left: auto;
  font-size: 11px;
}

.subnav {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: -3px 0 18px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.subnav a {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--green-ink);
  background: var(--paper);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.subnav a.active {
  border-color: var(--green);
  color: var(--on-brand);
  background: var(--green);
}

.subnav span {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

/* Template Messages admin portal */
.template-admin-main {
  max-width: 1600px;
}

.template-admin-grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.34fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.template-list-panel,
.template-editor-panel {
  padding: 20px !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius);
  background: var(--paper) !important;
  box-shadow: var(--shadow) !important;
}

.template-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.template-list-item {
  display: flex;
  width: 100%;
  min-height: 68px;
  justify-content: space-between;
  padding: 12px;
  border-color: var(--soft-line);
  text-align: left;
  background: var(--paper);
}

.template-list-item > span:first-child {
  display: grid;
  gap: 3px;
}
.template-list-item strong {
  color: var(--ink);
}
.template-list-item small {
  color: var(--muted);
  text-transform: capitalize;
}
.template-list-item.active {
  border-color: var(--green);
  background: var(--green-soft);
}
.template-state {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.template-state.enabled {
  color: var(--ok);
}
.template-empty {
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
}
.template-empty strong {
  display: block;
  color: var(--ink);
}

.template-editor-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.template-editor-fields label {
  display: grid;
  gap: 6px;
}
.template-editor-fields label > span,
.template-live-preview label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.template-editor-fields .wide {
  grid-column: 1 / -1;
}
#template-body {
  min-height: 230px;
  font:
    13px/1.55 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}
.template-token-list small {
  flex: 1;
  color: var(--muted);
  font-size: 11px;
}

.template-editor-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--soft-line);
}
.template-editor-actions [role="status"] {
  flex: 1;
  color: var(--muted);
  font-size: 11px;
}
.danger-text {
  border-color: var(--danger-line);
  color: var(--danger);
  background: var(--danger-soft);
}

.template-live-preview {
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-3);
}
.template-live-preview > header,
.template-live-preview > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
}
.template-live-preview > header {
  border-bottom: 1px solid var(--line);
}
.template-live-preview > footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.template-live-preview pre {
  min-height: 240px;
  max-height: 520px;
  margin: 0;
  overflow: auto;
  padding: 18px;
  font:
    13px/1.55 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  white-space: pre-wrap;
}

@media (max-width: 820px) {
  .template-admin-grid {
    grid-template-columns: 1fr;
  }
  .template-editor-fields {
    grid-template-columns: 1fr;
  }
  .template-editor-fields .wide {
    grid-column: auto;
  }
  .template-editor-actions {
    flex-wrap: wrap;
  }
}

/* rehearsal information dashboard */
.sunday-dashboard {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.dashboard-loading {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-metric {
  display: grid;
  min-height: 102px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  align-content: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 8px 24px var(--shadow-05);
}

.dashboard-metric small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-metric strong {
  color: var(--green-ink);
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 31px;
  line-height: 1;
}

.dashboard-metric span {
  align-self: end;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-metric.primary {
  border-color: var(--green);
  color: var(--on-brand);
  background: var(--green);
}

.dashboard-metric.primary small,
.dashboard-metric.primary strong,
.dashboard-metric.primary span {
  color: inherit;
}

.dashboard-metric.attention {
  border-color: var(--warn-line);
  background: var(--warn-soft);
}

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

.dashboard-panel {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 8px 24px var(--shadow-05);
}

.dashboard-panel > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.dashboard-panel > header h2 {
  margin: 0;
  color: var(--green-ink);
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 22px;
}

.dashboard-panel > header > span {
  color: var(--muted);
  font-size: 11px;
}

.services-panel {
  grid-column: span 8;
}

.rehearsals-panel {
  grid-column: span 4;
}

.readiness-panel,
.people-panel {
  grid-column: span 6;
}

.attention-panel,
.highlights-panel {
  grid-column: span 7;
}

.schedule-panel {
  grid-column: span 12;
}

.delivery-panel {
  grid-column: span 5;
}

.highlight-block + .highlight-block {
  margin-top: 14px;
}

.highlight-block h3 {
  margin: 0 0 8px;
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 15px;
  color: var(--ink);
}

.highlight-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 12px;
  border-left: 3px solid var(--green);
  background: var(--paper);
  border-radius: 0 10px 10px 0;
  box-shadow: 0 1px 3px var(--shadow-06);
}

.highlight-row + .highlight-row {
  margin-top: 7px;
}

.hl-role {
  flex: none;
  min-width: 92px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--green-ink);
}

.hl-copy {
  min-width: 0;
}

.hl-copy strong {
  display: block;
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 16px;
  line-height: 1.25;
}

.hl-copy small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.hl-with {
  display: block;
  font-family: "Zilla Slab", Georgia, serif;
  font-style: italic;
  font-size: 13px;
  color: var(--green-ink);
}

/* Points of Service — Notion's order numbers on every row. */

.point-order {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--on-gold);
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 12px;
  font-weight: 700;
}

.point-order.is-blank {
  background: var(--canvas);
  color: var(--muted);
}

.points-more {
  margin-top: 8px;
  border-top: 1px solid var(--soft-line);
  padding-top: 8px;
}

.points-more summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  color: var(--green-ink);
  padding: 2px 0 6px;
}

.people-panel:has(.people-details) {
  grid-column: span 5;
}

.attention-list {
  display: grid;
  gap: 8px;
}

.attention-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}

.attention-row .what {
  min-width: 0;
  flex: 1;
}

.attention-row .what strong {
  display: block;
  font-size: 14px;
}

.attention-row .what small {
  color: var(--muted);
  font-size: 12px;
}

.attention-row > span:last-child {
  color: var(--green-ink);
  font-weight: 800;
}

.attention-tag {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.attention-tag.warn {
  background: var(--warn);
}

.attention-tag.info {
  background: var(--line);
}

.all-clear {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--ok-soft);
  color: var(--ok, var(--ok));
  font-weight: 700;
  font-size: 14px;
}

.delivery-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.delivery-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
}

.delivery-list li.disabled {
  opacity: 0.6;
}

.delivery-label {
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
}

.delivery-label small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
}

.status-chip {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.status-chip.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.status-chip.fail {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-chip.pending {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-chip.idle {
  background: var(--canvas);
  color: var(--muted);
}

.day-timeline {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.day-timeline li {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
}

.day-timeline .when {
  color: var(--green-ink);
  font-size: 13px;
  font-weight: 800;
}

.day-timeline .what strong {
  display: block;
  font-size: 14px;
}

.day-timeline .what small {
  color: var(--muted);
  font-size: 12px;
}

.people-details summary {
  cursor: pointer;
  color: var(--green-ink);
  font-size: 13px;
  font-weight: 800;
}

.people-details[open] summary {
  margin-bottom: 10px;
}

.compact-intro {
  align-items: center;
}

.sunday-services,
.rehearsal-list {
  display: grid;
  gap: 7px;
}

.sunday-service-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--soft-line);
}

.sunday-service-card:first-child {
  padding-top: 0;
  border-top: 0;
}

.service-time,
.service-card-copy {
  display: grid;
  gap: 2px;
}

.service-time small,
.service-card-copy p,
.rehearsal-row small {
  color: var(--muted);
  font-size: 10px;
}

.service-time strong {
  color: var(--green-ink);
  font-size: 17px;
}

.service-card-copy h3 {
  margin: 0;
  font-size: 14px;
}

.rehearsal-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--soft-line);
  color: var(--ink);
  font-size: 11px;
  text-decoration: none;
}

.rehearsal-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.rehearsal-row > span {
  display: grid;
  gap: 2px;
}

.readiness-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.readiness-breakdown > div {
  display: grid;
  min-height: 90px;
  align-content: center;
  padding: 12px;
  border-radius: 9px;
  background: var(--paper-3);
}

.readiness-breakdown strong {
  color: var(--green-ink);
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 25px;
}

.readiness-breakdown span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.readiness-breakdown .warn {
  background: var(--warn-soft);
}

.readiness-breakdown .clear {
  background: var(--ok-soft);
}

.people-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.people-list span {
  padding: 6px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 7px;
  background: var(--paper-3);
  font-size: 11px;
  font-weight: 700;
}

.compact-empty {
  padding: 16px;
}

.status-line {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

/* Pumble messages */
.pumble-automation {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--green-2) 24%, var(--line));
  border-radius: 13px;
  background:
    linear-gradient(135deg, var(--veil-strong), var(--veil-strong)),
    var(--paper);
  box-shadow: 0 10px 30px var(--shadow-06);
}

.pumble-automation .section-heading {
  margin-bottom: 14px;
}

.pumble-automation .section-heading h2 {
  margin: 2px 0 3px;
  color: var(--green-ink);
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 23px;
}

.pumble-automation .section-copy {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.pumble-automation .section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

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

.automation-job {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(130px, 0.45fr) minmax(
      120px,
      0.4fr
    );
  gap: 10px 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: var(--veil);
  transition:
    opacity 150ms ease,
    border-color 150ms ease;
}

.automation-job.disabled {
  opacity: 0.68;
}

.automation-job > label:not(.automation-switch) {
  display: grid;
  gap: 5px;
  margin: 0;
}

.automation-job > label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.automation-job select,
.automation-job input[type="time"] {
  min-height: 40px;
}

.automation-job-copy {
  align-self: center;
}

.automation-job-copy p {
  margin: 5px 0 0 29px;
  color: var(--muted);
  font-size: 11px;
}

.automation-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
}

.automation-switch input {
  min-height: auto;
}

.automation-switch span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.automation-state {
  grid-column: 1 / -1;
  padding-top: 9px;
  border-top: 1px solid var(--soft-line);
  color: var(--green-2);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.automation-timezone {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 10px;
}

.email-automation {
  border-color: color-mix(in srgb, var(--green-2) 25%, var(--line));
  background:
    linear-gradient(135deg, var(--veil-strong), var(--veil)), var(--paper);
}

.email-automation-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
}

.email-automation-preview {
  display: grid;
  align-content: center;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: var(--veil);
}

.email-automation-preview > div {
  display: grid;
  gap: 3px;
  padding: 11px 13px;
  border-top: 1px solid var(--soft-line);
}

.email-automation-preview > div:first-child {
  border-top: 0;
}

.email-automation-preview span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.email-automation-preview strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-template-editor {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: var(--veil-soft);
}

.email-template-editor summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.email-template-editor summary::-webkit-details-marker {
  display: none;
}

.email-template-editor summary > span:first-child {
  display: grid;
  gap: 2px;
}

.email-template-editor summary strong {
  font-size: 12px;
}

.email-template-editor summary small {
  color: var(--muted);
  font-size: 10px;
}

.email-template-fields {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
  border-top: 1px solid var(--soft-line);
}

.email-template-fields > label {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.email-template-fields textarea {
  min-height: 108px;
  resize: vertical;
}

.email-template-fields .hint {
  margin: 0;
}

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

.pumble-message-card {
  display: grid;
  min-height: 330px;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 8px 24px var(--shadow-05);
}

.message-delivery {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--soft-line);
  background: var(--paper);
}

.message-delivery > label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.message-delivery select {
  min-height: 34px;
  padding: 5px 30px 5px 9px;
  font-size: 11px;
}

.message-recipient-preview {
  position: relative;
  color: var(--green-2);
  font-size: 10px;
  font-weight: 700;
}

.message-recipient-preview summary {
  cursor: pointer;
}

.message-recipient-preview ul {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: calc(100% + 8px);
  width: min(320px, 75vw);
  max-height: 220px;
  margin: 0;
  overflow: auto;
  padding: 8px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  box-shadow: 0 12px 30px var(--shadow-14);
}

.message-recipient-preview li {
  display: grid;
  gap: 1px;
  padding: 6px;
  border-bottom: 1px solid var(--soft-line);
}

.message-recipient-preview li:last-child {
  border-bottom: 0;
}

.message-recipient-preview li small {
  overflow: hidden;
  color: var(--muted);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pumble-message-card > header,
.pumble-message-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
}

.pumble-message-card > header {
  border-bottom: 1px solid var(--soft-line);
}

.pumble-message-card > header h2 {
  margin: 0;
  color: var(--green-ink);
  font-family: "Zilla Slab", Georgia, serif;
}

.message-schedule {
  display: block;
  margin-top: 4px;
  color: var(--green-2);
  font-size: 10px;
  font-weight: 700;
}

.message-schedule.disabled {
  color: var(--muted);
}

.pumble-message-card > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--soft-line);
}

.pumble-message-card pre {
  max-height: 245px;
  margin: 0;
  overflow: auto;
  padding: 16px;
  color: var(--ink);
  background: var(--paper-3);
  font:
    12px/1.55 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-state {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.message-state.error {
  color: var(--danger);
}

.message-settings {
  margin-top: 10px;
}

.messages-savebar {
  position: static;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 -8px 28px var(--shadow-07);
}

.messages-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(390px, 0.75fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.messages-review-panel,
.messages-delivery-panel {
  min-width: 0;
}

.workspace-section-heading {
  display: flex;
  min-height: 58px;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.workspace-section-heading h2 {
  margin: 0 0 2px;
  color: var(--green-ink);
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 20px;
}

.workspace-section-heading p:not(.eyebrow),
.workspace-section-heading > span {
  color: var(--muted);
  font-size: 10px;
}

.messages-review-panel .pumble-message-card[data-message="orchestra"] {
  grid-column: 1 / -1;
}

@media (min-width: 1161px) {
  .messages-review-panel .message-board {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .messages-review-panel .pumble-message-card {
    grid-column: span 2;
  }

  .messages-review-panel .pumble-message-card > footer {
    flex-wrap: wrap;
  }
}

.messages-delivery-panel {
  display: grid;
  gap: 10px;
}

.messages-delivery-panel .pumble-automation {
  margin: 0;
  padding: 14px;
}

.messages-delivery-panel .pumble-automation .section-heading h2 {
  font-size: 18px;
}

.messages-delivery-panel .section-copy,
.messages-delivery-panel .automation-timezone {
  line-height: 1.4;
}

.messages-delivery-panel .automation-job-grid,
.messages-delivery-panel .email-automation-grid {
  grid-template-columns: 1fr;
}

.messages-delivery-panel .automation-job {
  grid-template-columns: minmax(0, 1fr) 108px 104px;
  padding: 11px;
}

.messages-delivery-panel .automation-job-copy p {
  display: none;
}

.messages-delivery-panel .email-automation-preview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.messages-delivery-panel .email-automation-preview > div {
  border-top: 0;
  border-left: 1px solid var(--soft-line);
}

.messages-delivery-panel .email-automation-preview > div:first-child {
  border-left: 0;
}

.messages-savebar [role="status"] {
  margin-right: auto;
  color: var(--muted);
  font-size: 11px;
}

/* Music library */
.library-gateways {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}

.library-gateway {
  display: grid;
  min-height: 145px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 4px 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 8px 24px var(--shadow-05);
  text-decoration: none;
}

.library-gateway small,
.library-gateway span {
  grid-column: 1;
}

.library-gateway small {
  color: var(--green-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.library-gateway strong {
  color: var(--green-ink);
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 21px;
}

.library-gateway span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.library-gateway b {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  color: var(--green-2);
}

.library-gateway.primary {
  border-color: var(--green);
  color: var(--on-brand);
  background: var(--green);
}

.library-gateway.primary small,
.library-gateway.primary strong,
.library-gateway.primary span,
.library-gateway.primary b {
  color: inherit;
}

.library-repertoire {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.library-repertoire .section-heading label {
  min-width: 280px;
}

.library-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.library-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid var(--soft-line);
  border-radius: 9px;
  background: var(--paper);
}

.library-item small {
  color: var(--green-2);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.library-item h3 {
  margin: 2px 0;
  font-size: 14px;
}

.library-item p,
.library-item > span {
  color: var(--muted);
  font-size: 10px;
}

.library-item > span {
  max-width: 38%;
  text-align: right;
}

body[data-page="compositions"] #summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.readiness-stat {
  display: grid;
  min-height: 76px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-content: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  box-shadow: 0 8px 24px var(--shadow-05);
}

.readiness-stat small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.readiness-stat strong {
  color: var(--green-ink);
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 25px;
  line-height: 1;
}

.readiness-stat span {
  align-self: end;
  color: var(--muted);
  font-size: 11px;
}

.readiness-stat.primary {
  border-color: var(--green);
  color: var(--on-brand);
  background: var(--green);
}

.readiness-stat.primary small,
.readiness-stat.primary strong,
.readiness-stat.primary span {
  color: inherit;
}

.readiness-stat.attention {
  border-color: var(--warn-line);
  background: var(--paper-2);
}

.readiness-stat.ready {
  border-color: var(--ok-line);
  background: var(--ok-soft);
}

body[data-page="compositions"] .items {
  display: grid;
  gap: 20px;
}

.music-section {
  scroll-margin-top: 170px;
}

.music-section + .music-section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.music-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.music-section-heading h2 {
  margin: 0 0 2px;
  color: var(--green-ink);
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 22px;
}

.music-section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 11px;
}

.section-totals {
  display: flex;
  flex: none;
  gap: 8px;
  align-items: baseline;
  color: var(--muted);
}

.section-totals strong {
  color: var(--green-ink);
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 24px;
}

.section-totals span {
  font-size: 11px;
}

.composition-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

/* Collapsed-by-default composition rows. Items needing attention render
   open so the actionable ones are visible without hunting. */
body[data-page="compositions"] details.composition-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  box-shadow: 0 8px 24px var(--shadow-05);
  break-inside: avoid;
}

body[data-page="compositions"] details.composition-card.needs-attention {
  border-left: 3px solid var(--accent-ink);
}

body[data-page="compositions"] details.composition-card > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 15px;
  cursor: pointer;
  list-style: none;
}

body[data-page="compositions"]
  details.composition-card
  > summary::-webkit-details-marker {
  display: none;
}

.composition-summary {
  min-width: 0;
  flex: 1;
}

.composition-summary h3 {
  display: inline;
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.composition-summary small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

details.composition-card .disclosure {
  color: var(--muted);
  transition: transform 0.15s ease;
}

details.composition-card[open] .disclosure {
  transform: rotate(180deg);
}

.composition-body {
  display: grid;
  gap: 10px;
  padding: 2px 15px 14px;
  border-top: 1px solid var(--soft-line);
}

.section-jumps {
  position: sticky;
  top: 70px;
  z-index: 5;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 8px 24px var(--shadow-08);
  scrollbar-width: none;
}

.section-jumps a {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--green-ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.section-jumps a:hover {
  background: var(--gold);
  color: var(--on-gold);
}

.section-jumps a span {
  color: var(--muted);
  font-weight: 700;
}

.music-section {
  scroll-margin-top: 128px;
}

button.readiness-stat {
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.readiness-stat.selected {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

/* Orchestra view tabs: This rehearsal · Rehearsals · Readiness */
.view-tabs {
  position: sticky;
  top: 70px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 14px 0 16px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 8px 24px var(--shadow-08);
  overflow-x: auto;
  scrollbar-width: none;
}

.view-tab {
  flex: none;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  color: var(--green-ink);
  background: transparent;
  border: 0;
  border-radius: 999px;
  min-height: 40px;
  padding: 8px 18px;
  cursor: pointer;
}

.view-tab.active {
  background: var(--green);
  color: var(--gold);
}

.view-tab-link {
  flex: none;
  margin-left: auto;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.view-panel[hidden] {
  display: none !important;
}

#view-sunday:not([hidden]),
#view-rehearsals:not([hidden]) {
  display: grid;
  gap: 14px;
}

.program-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 8px 24px var(--shadow-05);
  padding: 16px;
}

.program-card > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.program-card > header h2 {
  margin: 0;
  color: var(--green-ink);
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 21px;
}

.program-card > header small {
  color: var(--muted);
  font-size: 12px;
}

.program-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.program-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
}

.program-row.needs-attention {
  border-left: 3px solid var(--accent-ink);
}

.program-order {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--on-gold);
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 14px;
  font-weight: 700;
}

.program-copy {
  min-width: 0;
  flex: 1;
}

.program-copy strong {
  display: block;
  font-size: 15px;
}

.program-copy small {
  color: var(--muted);
  font-size: 12px;
}

.program-meta {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hymn-footnote {
  margin: 12px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 13px;
}

.hymn-footnote span {
  margin-right: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-2);
}

@media (min-width: 900px) {
  #view-sunday {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.composition-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.composition-card-head h3 {
  margin: 1px 0 0;
  font-size: 17px;
  line-height: 1.25;
}

.card-kicker {
  color: var(--green-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge.hymn-resource,
.badge.none {
  color: var(--muted);
  background: var(--canvas);
}

.badge.mixed,
.badge.missing {
  color: var(--warn);
  background: var(--warn-soft);
}

body[data-page="compositions"] .contexts {
  gap: 5px;
  margin-top: 7px;
}

.context-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--paper-3);
  font-size: 10px;
  text-decoration: none;
}

.context-pill:hover {
  border-color: var(--accent-line);
  color: var(--green-ink);
}

.context-pill span {
  color: var(--muted);
}

.instrumentation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.instrumentation-list span {
  color: var(--green-2);
  font-size: 10px;
  font-weight: 700;
}

.instrumentation-list span + span::before {
  margin-right: 5px;
  color: var(--muted);
  content: "•";
}

.composition-readiness {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: stretch;
  margin: 0;
  padding: 2px 0 2px 20px;
  border-top: 0;
  border-left: 1px solid var(--soft-line);
}

.composition-readiness > div {
  min-width: 0;
}

.composition-readiness small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.composition-readiness .muted {
  font-size: 11px;
}

.context {
  color: var(--muted);
  font-size: 12px;
}

.context a {
  color: var(--green-2);
}

.meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

details.nested-details {
  grid-column: 1 / -1;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--soft-line);
}

details.nested-details summary {
  color: var(--green-2);
  cursor: pointer;
  font-size: 13px;
}

.assignments {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.assignment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--soft-line);
}

.assignment-row div {
  display: grid;
  gap: 2px;
}

.assignment-copy {
  min-width: 0;
}

.assignment-people {
  display: flex !important;
  flex-wrap: wrap;
  gap: 5px !important;
  margin-top: 4px;
}

.assignment-person {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--green-ink);
  font-size: 11px;
  font-weight: 700;
}

.assignment-person > span {
  padding: 5px 4px 5px 9px;
}

.assignment-person-remove {
  min-height: 0;
  padding: 5px 9px 5px 5px;
  border: 0;
  border-radius: 0;
  color: var(--danger);
  background: transparent;
  font-size: 10px;
}

.assignment-person-remove:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.assignment-warning {
  margin-top: 3px;
  color: var(--warn);
}

.confirm-dialog {
  width: min(470px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  box-shadow: 0 24px 70px var(--shadow-modal-color);
}

.confirm-dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(3px);
}

.confirm-dialog-content {
  display: grid;
  gap: 10px;
  padding: 24px;
}

.confirm-dialog-content h2,
.confirm-dialog-content p {
  margin: 0;
}

.confirm-dialog-content h2 {
  color: var(--green-ink);
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 25px;
}

.confirm-dialog-content > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.confirm-detail {
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: var(--paper-2);
  font-weight: 700;
}

.form-error:empty {
  display: none;
}

.form-error {
  color: var(--danger) !important;
  font-weight: 700;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 7px;
}

.app-toast {
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 15px;
  border: 1px solid var(--ok-line);
  border-radius: 10px;
  color: var(--ok);
  background: var(--ok-soft);
  box-shadow: 0 14px 40px var(--shadow-18);
  font-size: 12px;
  font-weight: 800;
}

.app-toast[data-tone="error"] {
  border-color: var(--danger-line);
  color: var(--danger);
  background: var(--danger-soft);
}

body[data-page="print-lab"] main {
  max-width: 1400px;
}

body[data-page="print-lab"] section.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  background: var(--paper);
  box-shadow: 0 10px 30px var(--shadow-06);
}

body[data-page="print-lab"] .items {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

body[data-page="print-lab"] .print-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid var(--soft-line);
}

body[data-page="print-lab"] .print-select {
  position: relative;
  display: grid;
  cursor: pointer;
}

body[data-page="print-lab"] .print-select input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

body[data-page="print-lab"] .print-select input:checked + .num {
  box-shadow: inset 0 0 0 2px var(--green-ink);
}

body[data-page="print-lab"] .print-select input:not(:checked) + .num {
  background: var(--paper-3);
  color: var(--muted);
}

body[data-page="print-lab"] .print-select input:focus-visible + .num {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

body[data-page="print-lab"] .print-job-note {
  margin: 8px 0 0;
  color: var(--muted);
}

.num {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green-ink);
  font-weight: 800;
}

@media (max-width: 1160px) {
  .workspace-hero {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .service-rail {
    grid-template-columns: 160px minmax(0, 1fr);
  }

  .action-launchers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="compositions"] #summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .services-panel,
  .rehearsals-panel,
  .attention-panel,
  .delivery-panel,
  .highlights-panel,
  .schedule-panel,
  .people-panel:has(.people-details) {
    grid-column: span 12;
  }

  .library-gateways {
    grid-template-columns: 1fr 1fr;
  }

  .messages-workspace {
    grid-template-columns: 1fr;
  }

  .messages-delivery-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .messages-delivery-panel > .workspace-section-heading {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  main {
    padding: 20px 14px 44px;
  }

  /* Compact app bar: the logo shrinks, the page label hides, and the
     actions wrap onto a second row when they need it. */
  .topbar {
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 8px 12px 10px;
    min-height: 0;
  }

  .brand img {
    width: 118px;
    height: 26px;
  }

  .brand strong {
    display: none;
  }

  .topbar-date {
    flex: 1 1 auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .topbar-date > span {
    display: none;
  }

  .topbar-date select {
    min-height: 40px;
    font-size: 14px;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .topbar-actions button {
    min-height: 40px;
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 13px;
  }

  .page-intro {
    align-items: stretch;
    flex-direction: column;
    padding-inline: 0;
  }

  .page-intro-meta {
    min-width: 0;
  }

  .service-rail {
    display: block;
  }

  .service-rail .section-head {
    padding-right: 0;
    padding-bottom: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--soft-line);
  }

  .service-days {
    margin-top: 10px;
  }

  .service-day-button {
    width: 164px;
    flex-basis: 164px;
  }

  .action-launchers,
  .communication-flow {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .subnav {
    align-items: stretch;
    flex-direction: column;
  }

  .subnav span {
    margin-left: 0;
  }

  .day-heading,
  .page-header,
  .page-intro,
  .article-head,
  .assignment-row,
  .context-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .confirm-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .readiness-summary {
    min-width: 0;
  }

  .notion-service-card {
    align-items: start;
    flex-direction: column;
  }

  .schedule-grid,
  .meta {
    grid-template-columns: 1fr;
  }

  .settings-savebar {
    align-items: stretch;
    flex-direction: column;
  }

  .composition-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="compositions"] #summary,
  .composition-readiness {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .composition-readiness {
    margin-top: 11px;
    padding: 10px 0 0;
    border-top: 1px solid var(--soft-line);
    border-left: 0;
  }

  .music-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .automation-job-grid,
  .email-automation-grid,
  .library-gateways,
  .library-items {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics,
  .message-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-metric {
    min-height: 82px;
    padding: 12px;
  }

  .dashboard-metric strong {
    font-size: 25px;
  }

  .dashboard-metric span {
    font-size: 9px;
  }

  .readiness-breakdown {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .readiness-breakdown > div {
    min-height: 104px;
    padding: 10px;
  }

  .messages-workspace,
  .messages-delivery-panel {
    grid-template-columns: 1fr;
  }

  .message-board > *,
  .messages-review-panel .pumble-message-card[data-message="orchestra"] {
    grid-column: 1 / -1;
  }

  .workspace-section-heading {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .pumble-message-card {
    min-height: 300px;
  }

  .messages-delivery-panel .automation-job {
    grid-template-columns: 1fr 1fr;
  }

  .messages-delivery-panel .automation-job-copy {
    grid-column: 1 / -1;
  }

  .messages-delivery-panel .email-automation-preview {
    grid-template-columns: 1fr;
  }

  .messages-delivery-panel .email-automation-preview > div {
    border-top: 1px solid var(--soft-line);
    border-left: 0;
  }

  .messages-delivery-panel .email-automation-preview > div:first-child {
    border-top: 0;
  }

  .automation-job {
    grid-template-columns: 1fr 1fr;
  }

  .automation-job-copy {
    grid-column: 1 / -1;
  }

  .pumble-automation .section-actions {
    justify-content: flex-start;
  }

  .readiness-panel,
  .people-panel {
    grid-column: span 12;
  }

  .sunday-service-card {
    grid-template-columns: 1fr;
  }

  .library-repertoire .section-heading label {
    min-width: 0;
    width: 100%;
  }

  .library-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .library-item > span {
    max-width: none;
    text-align: left;
  }

  .workspace-toolbar {
    position: static;
  }
}

.access-main {
  max-width: 1400px;
}

.access-roster-panel {
  margin: 0 0 18px !important;
  padding: 20px !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius);
  background: var(--paper) !important;
  box-shadow: var(--shadow) !important;
}

.access-roster-heading {
  margin-bottom: 12px;
}

.access-roster-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.access-roster-tools .permission-note {
  max-width: 760px;
  margin: 0;
}

.access-roster-tools label {
  display: grid;
  min-width: min(340px, 100%);
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.orchestra-roster-table {
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 11px;
}

.orchestra-roster-columns,
.orchestra-roster-row {
  display: grid;
  grid-template-columns:
    minmax(210px, 1.25fr) minmax(150px, 0.9fr)
    minmax(220px, 1.3fr) minmax(150px, 0.8fr);
  gap: 14px;
  align-items: center;
}

.orchestra-roster-columns {
  padding: 9px 13px;
  color: var(--muted);
  background: var(--paper-3);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.orchestra-roster-row {
  padding: 12px 13px;
  border-top: 1px solid var(--soft-line);
}

.roster-person,
.roster-values,
.roster-access {
  min-width: 0;
}

.roster-person {
  display: grid;
  gap: 2px;
}

.roster-person a {
  color: var(--ink);
  text-decoration: none;
}

.roster-person a:hover {
  color: var(--green-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.roster-person small,
.roster-values small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.roster-values {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.roster-values > span {
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--green-ink);
  background: var(--green-soft);
  font-size: 10px;
  font-weight: 800;
}

.roster-access {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 7px;
}

.roster-access button {
  min-height: 32px;
  padding: 5px 9px;
}

.access-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
  gap: 18px;
}

.access-grid > .panel {
  margin: 0;
}

.access-users {
  display: grid;
  gap: 9px;
}

.access-user {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding: 13px 14px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: var(--paper-2);
}

.access-user > div {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.access-user strong {
  overflow-wrap: anywhere;
}

.access-user small {
  grid-column: 1;
  color: var(--muted);
}

.access-user .remove-admin,
.access-user .unblock-email {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 34px;
  padding: 6px 10px;
}

.access-user .remove-admin {
  color: var(--danger);
}

.role-badge,
.count-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.role-badge.owner {
  color: var(--on-brand);
  background: var(--green);
}

.role-badge.admin,
.count-badge {
  color: var(--on-gold);
  background: var(--gold);
}

.role-badge.blocked {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.role-badge.linked,
.role-badge.member {
  color: var(--green-ink);
  background: var(--green-soft);
}

.leader-tag {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  padding: 2px 8px;
  margin-top: 2px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent-ink) 14%, transparent);
}

.access-user .linked-emails {
  color: var(--green-ink);
}

/* ── Individual account pages ──────────────────────────────────────────── */

/* A person's name is a doorway to their account card. */
.account-open {
  min-height: auto;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.account-open:hover {
  background: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-search {
  display: grid;
  gap: 5px;
  margin-top: 14px;
}

.account-search span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.account-results {
  margin-top: 12px;
}

/* Each search result is one click from the person's page. */
.account-row {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.account-row:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

.account-row::after {
  content: "→";
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--green-ink);
  font-weight: 800;
}

.access-blocks {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--soft-line);
}

.access-blocks > .section-heading {
  margin-bottom: 0;
}

.owner-invite-note {
  margin-top: 8px;
}

.danger-button {
  color: var(--paper);
  background: var(--danger);
}

.add-admin-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--soft-line);
}

.add-admin-form[hidden] {
  display: none;
}

.add-admin-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.add-admin-form input {
  width: 100%;
}

.permission-table-wrap {
  overflow-x: auto;
}

.permission-table {
  width: 100%;
  border-collapse: collapse;
}

.permission-table th,
.permission-table td {
  padding: 11px 9px;
  border-bottom: 1px solid var(--soft-line);
  text-align: center;
}

.permission-table th:first-child {
  text-align: left;
}

.permission-table thead th {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.permission-table tbody th {
  font-size: 12px;
}

.permission-yes {
  color: var(--green-2);
  font-size: 18px;
  font-weight: 900;
}

.permission-no {
  color: var(--muted);
  font-size: 17px;
}

.permission-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .access-grid {
    grid-template-columns: 1fr;
  }

  .access-roster-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .orchestra-roster-columns {
    display: none;
  }

  .orchestra-roster-row {
    grid-template-columns: 1fr 1fr;
  }

  .roster-person,
  .roster-access {
    grid-column: 1 / -1;
  }

  .roster-values::before,
  .roster-access::before {
    content: attr(data-label);
    width: 100%;
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}

@media (max-width: 600px) {
  .access-user,
  .add-admin-form {
    grid-template-columns: 1fr;
  }

  .access-user .remove-admin,
  .access-user .unblock-email {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .orchestra-roster-row {
    grid-template-columns: 1fr;
  }

  .roster-person,
  .roster-access {
    grid-column: 1;
  }
}

@media print {
  body {
    background: var(--print-paper);
  }

  .topbar,
  .toolbar,
  .page-actions,
  .context-bar,
  details.nested-details,
  .pdfs a,
  .assignment-row a {
    display: none !important;
  }

  main {
    max-width: none;
    padding: 0;
  }

  section.panel,
  article {
    border-color: var(--print-line);
    box-shadow: none;
  }

  body[data-page="compositions"] .items {
    gap: 8px;
  }

  .composition-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Snapshot parity workspace */
.parity-context strong {
  overflow: hidden;
  color: var(--on-brand);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parity-main {
  max-width: 1500px;
}

.parity-source-tabs {
  display: inline-flex;
  gap: 5px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.parity-source-tabs a {
  padding: 9px 13px;
  border-radius: 7px;
  color: var(--green-ink);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.parity-source-tabs a.active {
  color: var(--on-brand);
  background: var(--green);
}

.parity-safety {
  display: flex;
  align-items: center;
  gap: 10px 18px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  color: var(--warn);
  background: var(--warn-soft);
  font-size: 12px;
}

.parity-safety strong {
  white-space: nowrap;
}

.parity-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.parity-stat {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 8px 24px var(--shadow-06);
}

.parity-stat > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.parity-stat > strong {
  overflow: hidden;
  color: var(--green-ink);
  font:
    700 22px/1.1 "Zilla Slab",
    Georgia,
    serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parity-stat.ok {
  border-color: var(--ok-line);
  background: var(--ok-soft);
}

.parity-stat.warn {
  border-color: var(--warn-line);
  background: var(--warn-soft);
}

.parity-stat.pending {
  border-color: var(--accent-line);
  background: var(--paper-2);
}

.parity-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.38fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.parity-list-panel,
.parity-detail-panel,
.parity-diff-panel {
  margin: 0 !important;
  padding: 19px !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius);
  background: var(--paper) !important;
  box-shadow: var(--shadow) !important;
}

.parity-detail-panel {
  position: sticky;
  top: 82px;
}

.parity-snapshot-grid,
.parity-diff-results {
  display: grid;
  gap: 9px;
  margin-top: 15px;
}

.parity-snapshot-card {
  display: grid;
  width: 100%;
  min-height: 106px;
  justify-items: start;
  gap: 4px;
  padding: 13px;
  border-color: var(--soft-line);
  color: var(--ink);
  text-align: left;
  background: var(--paper);
}

.parity-snapshot-card:hover,
.parity-snapshot-card.active {
  border-color: var(--green-2);
  color: var(--ink);
  background: var(--green-soft);
}

.parity-snapshot-card:disabled {
  border-style: dashed;
  color: var(--muted);
  background: var(--paper-3);
}

.parity-snapshot-card strong,
.parity-snapshot-card small,
.parity-snapshot-card > span:last-child {
  overflow-wrap: anywhere;
}

.parity-snapshot-card > span:last-child {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.parity-card-state,
.parity-readonly-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--ok);
  background: var(--ok-soft);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.parity-snapshot-card.missing .parity-card-state {
  color: var(--warn);
  background: var(--warn-soft);
}

.parity-readonly-badge {
  color: var(--on-gold);
  background: var(--gold);
}

.parity-json {
  min-height: 440px;
  max-height: calc(100vh - 250px);
  margin: 14px 0 0;
  overflow: auto;
  padding: 15px;
  border: 1px solid var(--code-line);
  border-radius: 10px;
  color: var(--code-ink);
  background: var(--code-surface);
  font:
    11px/1.55 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  white-space: pre-wrap;
}

.parity-diff-row {
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-left-width: 4px;
  border-radius: 10px;
  background: var(--paper);
}

.parity-diff-row.match {
  border-left-color: var(--diff-match);
}

.parity-diff-row.different {
  border-left-color: var(--diff-change);
}

.parity-diff-row.missing-cuecapture,
.parity-diff-row.missing-notion,
.parity-diff-row.missing-both {
  border-left-color: var(--diff-missing);
}

.parity-diff-row > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 14px;
}

.parity-diff-row > header > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.parity-diff-row > header strong,
.parity-diff-row > header small {
  overflow-wrap: anywhere;
}

.parity-diff-row > header > span {
  flex: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.parity-diff-row details {
  border-top: 1px solid var(--soft-line);
  padding: 10px 14px 14px;
}

.parity-diff-row summary {
  color: var(--green-ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.parity-difference-list {
  display: grid;
  gap: 9px;
  margin-top: 11px;
}

.parity-difference-list article {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: var(--paper-3);
}

.parity-difference-list code {
  overflow-wrap: anywhere;
  color: var(--green-2);
  font-size: 10px;
}

.parity-difference-list div {
  min-width: 0;
}

.parity-difference-list div > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.parity-difference-list pre {
  margin: 4px 0 0;
  overflow: auto;
  font:
    10px/1.4 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .parity-summary-grid,
  .parity-workspace {
    grid-template-columns: 1fr;
  }

  .parity-detail-panel {
    position: static;
  }

  .parity-difference-list article {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .parity-source-tabs,
  .parity-safety,
  .parity-diff-row > header {
    align-items: stretch;
    flex-direction: column;
  }

  .parity-source-tabs {
    display: flex;
  }
}

/* ── Conversation oversight (on /access) ─────────────────────────────────
   The dialog classes mirror the ones in my.css rather than importing them —
   the two stylesheets are peers and never load together. */

.oversight-grid {
  margin-top: 18px;
}

.oversight-rooms,
.oversight-audit {
  display: grid;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.oversight-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
}

.oversight-row + .oversight-row {
  border-top: 1px solid var(--soft-line);
}

.oversight-row-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.oversight-row-main strong {
  font-size: 14px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
}

.oversight-meta {
  font-size: 12px;
  color: var(--muted);
}

.oversight-reason {
  font-size: 12px;
  font-style: italic;
  color: var(--green-ink);
}

.oversight-row button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.chat-dialog {
  width: min(620px, calc(100vw - 32px));
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 70px var(--shadow-modal-color);
}

.chat-dialog::backdrop {
  background: var(--backdrop);
}

.chat-dialog-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--soft-line);
}

.chat-dialog-head h2 {
  margin: 0;
  font-size: 17px;
  color: var(--green-ink);
}

.chat-dialog-body {
  padding: 14px 16px;
}

.chat-dialog-actions {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--soft-line);
}

.chat-dialog-cancel {
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  min-height: 40px;
  cursor: pointer;
}

.oversight-transcript {
  display: grid;
  gap: 10px;
  max-height: 60dvh;
  overflow-y: auto;
  scrollbar-width: thin;
}

.oversight-line {
  display: grid;
  gap: 2px;
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--soft-line);
}

.oversight-line strong {
  font-size: 13px;
}

.oversight-line > span:first-of-type {
  font-size: 11px;
  color: var(--muted);
}

.oversight-line em {
  font-size: 11px;
  color: var(--warn);
}

/* Retained, not shown to members — the reason soft delete exists. */
.oversight-line.is-deleted .oversight-body {
  opacity: 0.7;
  text-decoration: line-through;
}

.oversight-body {
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Native-only recovery UI. The class is added by the Android bridge, so the
   production browser surface does not gain app chrome. */
.tbc-native-app .native-error-banner {
  position: fixed;
  z-index: 10000;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 620px;
  margin-inline: auto;
  padding: 12px 14px;
  color: var(--on-brand);
  background: var(--green);
  border: 1px solid var(--on-brand-line-strong);
  border-radius: 12px;
  box-shadow: 0 12px 36px var(--shadow-modal-color);
  font-size: 14px;
  line-height: 1.4;
}

.tbc-native-app .native-error-banner[hidden] {
  display: none;
}

.tbc-native-app .native-error-banner span {
  flex: 1 1 auto;
}

.tbc-native-app .native-error-banner button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 14px;
  color: var(--green);
  background: var(--on-brand);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

/* Combinable audiences on the template editor. */
.template-audiences {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.template-audiences legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.template-audiences > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.template-audience-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.admin-menu-group {
  margin: 8px 4px 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-menu-group:first-child {
  margin-top: 2px;
}

/* The current hub's pages as a strip under the top bar. */
.hub-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  padding: 7px clamp(16px, 2.5vw, 36px);
  background: var(--paper);
}

.hub-tabs-label {
  margin-right: 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hub-tabs a {
  border-radius: 999px;
  padding: 6px 13px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.hub-tabs a:hover {
  color: var(--green-ink);
  background: var(--green-soft);
}

.hub-tabs a.active {
  color: var(--on-brand);
  background: var(--green);
}

/* Hub tabs v2: centered, icon-led, profile on the right. The strip itself
   must not scroll-clip — the profile dropdown hangs below it; only the
   middle links rail scrolls. */
.hub-tabs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 30;
  overflow: visible;
}

.hub-tabs-label {
  display: none;
}

.hub-tabs-links {
  display: flex;
  justify-content: center;
  gap: 4px;
  overflow-x: auto;
  grid-column: 2;
}

.hub-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hub-tabs a svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hub-tabs-account {
  grid-column: 3;
  justify-self: end;
}

.profile-menu {
  position: relative;
}

.profile-menu summary {
  list-style: none;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
  background: var(--green-soft);
}

.profile-menu summary::-webkit-details-marker {
  display: none;
}

.profile-menu summary svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-menu summary:hover,
.profile-menu[open] summary {
  color: var(--on-brand);
  background: var(--green);
}

.profile-menu-list {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 170px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  background: var(--paper);
  box-shadow: 0 14px 40px var(--shadow-14);
}

.profile-menu-list a,
.profile-menu-list button {
  min-height: 0;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.profile-menu-list a:hover,
.profile-menu-list button:hover {
  background: var(--green-soft);
}

/* The sun/moon is ambient, not a bordered button. */
button.theme-toggle {
  min-height: 38px;
  width: 38px;
  border: 0;
  padding: 8px;
  background: transparent;
  box-shadow: none;
  color: inherit;
}

button.theme-toggle:hover {
  background: var(--green-soft);
}

/* Icon-only header actions. */
button.icon-only {
  width: 40px;
  padding: 8px;
}

/* CueCapture portal. The workspace's own scope, running inside a Durable
   Object — a status board first, because the first honest thing to show about
   a scope is whether it booted and what it actually holds. */
/* Auto-fit rather than a fixed count: the number of facts worth reporting about
   a scope will change, and a grid that has to be edited alongside them is a
   grid that will one day disagree with them. */
.cuecapture-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.cuecapture-stat {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 8px 24px var(--shadow-06);
}

.cuecapture-stat > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cuecapture-stat > strong {
  overflow: hidden;
  color: var(--green-ink);
  font:
    700 22px/1.1 "Zilla Slab",
    Georgia,
    serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cuecapture-stat > small {
  color: var(--muted);
  font-size: 11px;
}

.cuecapture-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.44fr);
  gap: 16px;
  align-items: start;
}

.cuecapture-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

/* A second query inside one panel needs air above it. */
.cuecapture-next-heading {
  margin-top: 22px;
}

.cuecapture-table {
  width: 100%;
  border-collapse: collapse;
}

.cuecapture-table th,
.cuecapture-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
  vertical-align: top;
}

.cuecapture-table thead th {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cuecapture-table tbody td {
  font-size: 12px;
}

.cuecapture-mono {
  color: var(--muted);
  font:
    11px/1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  overflow-wrap: anywhere;
}

.cuecapture-empty {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* The live stream's own state, said plainly. A dot that lies about the
   connection is worse than no dot. */
.cuecapture-live {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cuecapture-live::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
}

.cuecapture-live[data-state="open"] {
  color: var(--ok);
}

.cuecapture-live[data-state="open"]::before {
  background: var(--ok);
}

.cuecapture-live[data-state="failed"] {
  color: var(--danger);
}

.cuecapture-live[data-state="failed"]::before {
  background: var(--danger);
}

.cuecapture-log {
  display: grid;
  gap: 0;
  max-height: 340px;
  margin: 12px 0 0;
  overflow: auto;
  padding: 0;
  list-style: none;
}

.cuecapture-log li {
  display: grid;
  gap: 3px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--soft-line);
}

.cuecapture-log strong {
  font-size: 12px;
}

.cuecapture-log small {
  color: var(--muted);
  font-size: 11px;
}

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