:root {
  color-scheme: light;
  font-family:
    "Nunito Sans",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  --ink: #231f20;
  --muted: #786b65;
  --green: #541400;
  --green-2: #974429;
  --green-soft: #f8efe5;
  --gold: #fef3de;
  --paper: #fffdf9;
  --canvas: #eee8e1;
  --line: #ddcfc4;
  --soft-line: #eee4dc;
  --danger: #9f1239;
  --warn: #9a5f08;
  --radius: 14px;
  --shadow: 0 18px 52px rgb(84 20 0 / 10%);
}

* {
  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%);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(
      circle at 50% -10%,
      rgb(254 243 222 / 72%),
      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);
  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: grid;
  grid-template-columns: minmax(190px, 230px) auto minmax(370px, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 8px clamp(16px, 2.5vw, 36px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 22px rgb(35 31 32 / 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 rgb(254 243 222 / 28%);
  padding-left: 12px;
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 15px;
  white-space: nowrap;
}

.topbar-date {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  color: rgb(254 243 222 / 68%);
}

.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: rgb(255 255 255 / 22%);
  padding: 5px 9px;
  color: #fff;
  background: rgb(255 255 255 / 9%);
  color-scheme: dark;
  font-size: 11px;
}

.app-nav {
  display: flex;
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  justify-self: center;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
}

.app-nav a {
  min-height: auto;
  padding: 8px 11px;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  scroll-snap-align: center;
  white-space: nowrap;
}

.app-nav a:hover,
.app-nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.topbar-actions {
  display: flex;
  justify-self: end;
  gap: 7px;
}

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

.topbar-secondary {
  border-color: rgb(255 255 255 / 24%);
  color: #fff;
  background: transparent;
}

.topbar-primary {
  border-color: var(--gold);
  color: var(--green);
  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: white;
  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: rgb(255 255 255 / 10%);
}

.topbar-primary:hover {
  color: var(--green);
  background: #fff8e9;
}

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

.ghost,
.pdfs a,
.assignment-row a {
  border-color: #d9c8bd;
  background: #fffaf5;
  color: var(--green);
}

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

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 #cbd2ce;
  border-radius: 8px;
  outline: none;
  background: white;
  color: var(--ink);
  font: inherit;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgb(151 68 41 / 14%);
}

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

.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%,
      rgba(234, 211, 140, 0.24),
      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 rgb(84 20 0 / 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);
  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: rgba(255, 255, 255, 0.74);
}

.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: #28a267;
  box-shadow: 0 0 0 3px #dcf4e8;
}

.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 rgba(26, 39, 34, 0.035);
}

.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: #fff7ef;
}

.service-day-button.active {
  border-color: #ddc0b1;
  background: var(--green-soft);
  color: var(--green);
}

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

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

.service-chevron {
  color: #9aa49f;
  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 rgb(84 20 0 / 5%);
  text-align: left;
  text-decoration: none;
}

.quick-action:hover {
  border-color: #c99f8a;
  color: var(--ink);
  background: #fff8f1;
  transform: translateY(-1px);
}

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

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

.quick-action-number {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid #dfc4b7;
  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: rgb(254 243 222 / 35%);
  color: var(--gold);
  background: rgb(254 243 222 / 10%);
}

.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: rgb(255 255 255 / 72%);
}

.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: #f7f8f6;
  font-size: 12px;
}

.readiness-summary.ready {
  border-color: #b9ddca;
  background: #edf8f2;
  color: #17643c;
}

.readiness-summary.warn {
  border-color: #ead6a8;
  background: #fff9e9;
  color: #795006;
}

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

.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid #cfd5d1;
  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: #dfcec4;
  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 #ddc4b7;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  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: #dfc4b5;
  background: #fff8f2;
}

.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: #d5ddd9;
  background: #f7f9f8;
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.message-template-preview {
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid #d5ddd9;
  border-radius: 10px;
  background: #f8faf9;
}

.message-template-preview-head {
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #e1e6e3;
  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: #dcfce7;
  color: #166534;
}

.badge.warn,
.badge.mixed {
  background: #fef3c7;
  color: #92400e;
}

.badge.fail,
.badge.missing {
  background: #fee2e2;
  color: #991b1b;
}

.settings-savebar {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 14px 22px;
  background: #f8f9f7;
}

/* 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 #cddbd5;
  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: #dfcbbc;
  background: rgb(255 253 249 / 94%);
  box-shadow: 0 9px 30px rgb(84 20 0 / 7%);
  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);
  background: var(--paper);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.subnav a.active {
  border-color: var(--green);
  color: white;
  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: #fff;
}

.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: #166534;
}
.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: #fecdd3;
  color: var(--danger);
  background: #fff1f2;
}

.template-live-preview {
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf8f5;
}
.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;
  }
}

/* Sunday 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 rgb(84 20 0 / 5%);
}

.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);
  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: white;
  background: var(--green);
}

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

.dashboard-metric.attention {
  border-color: #e3bf8b;
  background: #fff8e9;
}

.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 rgb(84 20 0 / 5%);
}

.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);
  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 rgb(84 20 0 / 6%);
}

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

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

.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);
  font-weight: 800;
}

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

.attention-tag.warn {
  background: #c77d00;
}

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

.all-clear {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: #eef6ef;
  color: var(--ok, #1d6b3c);
  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: #eef6ef;
  color: #1d6b3c;
}

.status-chip.fail {
  background: #fdeae4;
  color: #a12800;
}

.status-chip.pending {
  background: #fff5e3;
  color: #a15c00;
}

.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);
  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);
  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);
  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: #f8f4ef;
}

.readiness-breakdown strong {
  color: var(--green);
  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: #fff4e3;
}

.readiness-breakdown .clear {
  background: #edf8f2;
}

.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: #faf7f3;
  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, rgb(255 250 242 / 96%), rgb(255 255 255 / 98%)),
    var(--paper);
  box-shadow: 0 10px 30px rgb(84 20 0 / 6%);
}

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

.pumble-automation .section-heading h2 {
  margin: 2px 0 3px;
  color: var(--green);
  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: rgb(255 255 255 / 82%);
  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, rgb(255 255 255 / 98%), rgb(249 244 237 / 96%)),
    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: rgb(255 255 255 / 82%);
}

.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: rgb(255 255 255 / 72%);
}

.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 rgb(84 20 0 / 5%);
}

.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 rgb(84 20 0 / 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);
  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: #292523;
  background: #fbf8f4;
  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 rgb(84 20 0 / 7%);
}

.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);
  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 rgb(84 20 0 / 5%);
  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);
  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: white;
  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;
  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 rgb(84 20 0 / 5%);
}

.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);
  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: white;
  background: var(--green);
}

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

.readiness-stat.attention {
  border-color: #e6c79b;
  background: #fff9ed;
}

.readiness-stat.ready {
  border-color: #b9ddca;
  background: #edf8f2;
}

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);
  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);
  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 rgb(84 20 0 / 5%);
  break-inside: avoid;
}

body[data-page="compositions"] details.composition-card.needs-attention {
  border-left: 3px solid #b66a38;
}

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 rgb(84 20 0 / 8%);
  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);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.section-jumps a:hover {
  background: var(--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 Sunday · 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 rgb(84 20 0 / 8%);
  overflow-x: auto;
  scrollbar-width: none;
}

.view-tab {
  flex: none;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  color: var(--green);
  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 rgb(84 20 0 / 5%);
  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);
  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 #b66a38;
}

.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(--green);
  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: #655953;
  background: #f2ede8;
}

.badge.mixed,
.badge.missing {
  color: #914418;
  background: #fff0e4;
}

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: #faf7f3;
  font-size: 10px;
  text-decoration: none;
}

.context-pill:hover {
  border-color: #cfad9d;
  color: var(--green);
}

.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: #b9aaa1;
  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: #655953;
  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 #dbcfc6;
  border-radius: 999px;
  background: #fffaf5;
  color: var(--green);
  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: #9b3d24;
  background: transparent;
  font-size: 10px;
}

.assignment-person-remove:hover {
  color: #6b1d0a;
  background: #f8e7df;
}

.assignment-warning {
  margin-top: 3px;
  color: #8f5b16;
}

.confirm-dialog {
  width: min(470px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid #cdbdb1;
  border-radius: 15px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgb(35 17 10 / 28%);
}

.confirm-dialog::backdrop {
  background: rgb(27 19 15 / 52%);
  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);
  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: #fffaf5;
  font-weight: 700;
}

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

.form-error {
  color: #9b2c1b !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 #a8c9b7;
  border-radius: 10px;
  color: #124a37;
  background: #eff9f3;
  box-shadow: 0 14px 40px rgb(35 17 10 / 18%);
  font-size: 12px;
  font-weight: 800;
}

.app-toast[data-tone="error"] {
  border-color: #dfb2a5;
  color: #84240e;
  background: #fff2ed;
}

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 rgb(84 20 0 / 6%);
}

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

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

@media (max-width: 1160px) {
  .topbar {
    grid-template-columns: minmax(190px, 230px) minmax(0, 1fr) auto;
  }

  .app-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
  }

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

  /* Two-row app bar: date + actions up top, scrolling nav beneath. The wide
     brand lockup is dropped — the active nav pill carries identity. */
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 8px;
    padding: 8px 12px 10px;
    min-height: 0;
  }

  .brand {
    display: none;
  }

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

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

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

  .topbar-actions {
    grid-column: 2;
    grid-row: 1;
  }

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

  .app-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    justify-content: start;
    justify-self: stretch;
    overflow-x: auto;
    padding-right: 28px;
    scrollbar-width: none;
  }

  .app-nav a {
    flex: none;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    padding: 8px 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-context strong {
  overflow: hidden;
  color: #fff;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.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: #fffaf5;
}

.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 {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 34px;
  padding: 6px 10px;
  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: #fff;
  background: var(--green);
}

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

.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: #b9aaa0;
  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;
  }
}

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

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

@media print {
  body {
    background: white;
  }

  .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: #cbd5e1;
    box-shadow: none;
  }

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

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