:root {
  color-scheme: light;
  --navy: #16273f;
  --navy-2: #203b5e;
  --gold: #b48a3c;
  --cream: #f7f3e9;
  --white: #ffffff;
  --ink: #1d2734;
  --muted: #647083;
  --line: #d9dee6;
  --danger: #9c2f2f;
  --success: #24673d;
  font-family: "Source Sans 3", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: #f3f5f8; color: var(--ink); }
.topbar { background: var(--navy); color: var(--white); padding: 1.25rem clamp(1rem, 4vw, 3rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.topbar h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.55rem, 3vw, 2.2rem); }
.eyebrow { margin: 0 0 .25rem; color: #ead8a8; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
main { width: min(1180px, calc(100% - 2rem)); margin: 2rem auto 4rem; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: clamp(1rem, 3vw, 1.5rem); box-shadow: 0 8px 24px rgba(22,39,63,.06); margin-bottom: 1.25rem; }
.panel h2 { margin: 0 0 .35rem; font-family: Georgia, serif; color: var(--navy); }
.panel p { color: var(--muted); margin-top: .35rem; }
.login-panel { max-width: 480px; margin: 5rem auto; }
.grid { display: grid; gap: 1.25rem; }
.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stats article { background: var(--navy); color: white; padding: 1.1rem 1.25rem; border-radius: 12px; display: flex; flex-direction: column; }
.stats strong { color: #f0d28d; font-size: 2rem; }
.stats span { font-size: .9rem; }
form { display: grid; gap: .8rem; }
label { color: var(--navy); font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #bfc7d3; border-radius: 8px; padding: .75rem; font: inherit; color: inherit; background: white; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(180,138,60,.25); border-color: var(--gold); }
.check-row { display: grid; grid-template-columns: auto 1fr; gap: .65rem; align-items: start; font-weight: 400; color: var(--ink); }
.check-row input { width: 1.1rem; height: 1.1rem; margin-top: .15rem; }
.button { border: 1px solid transparent; border-radius: 8px; padding: .7rem 1rem; font: inherit; font-weight: 700; cursor: pointer; width: fit-content; }
.button:disabled { opacity: .55; cursor: wait; }
.primary { background: var(--gold); color: #111; }
.secondary { background: white; color: var(--navy); border-color: #aeb8c6; }
.danger { color: var(--danger); border-color: #d8aaaa; background: #fff7f7; }
.status { min-height: 1.4em; margin: 0; font-weight: 600; }
.status.error { color: var(--danger); }
.status.success { color: var(--success); }
.form-meta, .section-heading, .filters { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.form-meta { color: var(--muted); font-size: .85rem; }
.filters { justify-content: flex-start; margin: 1rem 0; }
.filters input { max-width: 320px; }
.filters select { max-width: 190px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--navy); }
.badge { display: inline-block; padding: .2rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge.active { background: #e3f4e8; color: var(--success); }
.badge.paused { background: #fff2cf; color: #735314; }
.badge.completed { background: #e8edf4; color: #49576a; }
.badge.unsubscribed { background: #f8e4e4; color: var(--danger); }
.record-list { display: grid; gap: .75rem; }
.record { border: 1px solid var(--line); border-radius: 8px; padding: .75rem; }
.record p { margin: 0 0 .4rem; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.record small { color: var(--muted); }
.schedule-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 2rem; margin-top: 1.25rem; align-items: start; }
.schedule-form { min-width: 0; }
.schedule-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.schedule-fields > div { display: grid; gap: .8rem; }
.schedule-options { border: 0; padding: 0; margin: 0; min-width: 0; }
.schedule-options legend { color: var(--navy); font-weight: 700; margin-bottom: .55rem; }
.weekday-options { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.weekday-options label { cursor: pointer; font-size: .82rem; font-weight: 700; text-align: center; }
.weekday-options input { position: absolute; opacity: 0; pointer-events: none; }
.weekday-options span { display: block; border: 1px solid #bfc7d3; border-radius: 7px; padding: .55rem .2rem; background: white; }
.weekday-options input:checked + span { background: var(--navy); color: white; border-color: var(--navy); }
.weekday-options input:focus-visible + span { outline: 3px solid rgba(180,138,60,.35); border-color: var(--gold); }
.field-help { margin: .35rem 0 0; font-size: .85rem; }
.subheading { margin: 0 0 .75rem; color: var(--navy); font-family: Georgia, serif; }
.schedule-record { display: grid; gap: .45rem; }
.schedule-record-heading { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.schedule-record-heading strong { color: var(--navy); font-size: 1.05rem; }
.schedule-record p { margin-top: .25rem; }
.schedule-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
.schedule-actions .button { padding: .45rem .75rem; font-size: .88rem; }
.schedule-form-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
code { background: var(--cream); padding: .1rem .3rem; border-radius: 4px; }
@media (max-width: 760px) {
  .two-column, .stats, .schedule-layout, .schedule-fields { grid-template-columns: 1fr; }
  .section-heading, .filters, .form-meta { align-items: stretch; flex-direction: column; }
  .button { width: 100%; }
  .weekday-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .schedule-actions .button { width: auto; }
  .schedule-form-actions .button { width: auto; }
}
