:root {
  --ink: #183342;
  --paper: #f5f7f6;
  --surface: #ffffff;
  --line: #cbd5d1;
  --text: #1b2429;
  --muted: #56646b;
  --action: #1f6f5c;
  --action-dark: #17574a;
  --focus: #f2b632;
  --ok-bg: #e3f2ec; --ok-text: #1d5a48; --ok-line: #8cc4b0;
  --warn-bg: #fff3d6; --warn-text: #6b4a00; --warn-line: #e3b94f;
  --error-bg: #fbeaea; --error-text: #8a1f1f; --error-line: #d98080;
  --radius: 6px;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 100%;
  line-height: 1.55;
  color: var(--text);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 1rem; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; margin: 2rem 0 0.75rem; font-weight: 650; }
p { margin: 0 0 1rem; }
a { color: var(--action-dark); text-underline-offset: 0.15em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 36rem; }
.muted, .sub { color: var(--muted); }
.sub { display: block; font-size: 0.875rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: 0.5rem 1rem; z-index: 10; }

/* Header */
.topbar { background: var(--ink); color: #fff; margin-bottom: 2rem; }
.topbar a { color: #fff; }
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem; padding-top: 0.9rem; padding-bottom: 0.9rem; }
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1.2; }
.brand-school { font-weight: 650; font-size: 1.05rem; }
.brand-app { font-size: 0.875rem; opacity: 0.8; }
.account { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem; font-size: 0.9rem; }
.account-name { opacity: 0.8; }
.account form { margin: 0; }
.linklike { background: none; border: 0; padding: 0; color: #fff; font: inherit; text-decoration: underline; text-underline-offset: 0.15em; cursor: pointer; }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem; padding-bottom: 0; }
.nav a { padding: 0.6rem 0.9rem; text-decoration: none; border-radius: var(--radius) var(--radius) 0 0; font-weight: 550; }
.nav a:hover { background: rgba(255, 255, 255, 0.1); }
.nav a[aria-current="page"] { background: var(--paper); color: var(--ink); }

/* Forms */
.stack > * + * { margin-top: 1.25rem; }
fieldset { border: 0; padding: 0; margin: 0; }
fieldset > * + * { margin-top: 0.9rem; }
legend { font-weight: 650; font-size: 1.1rem; margin-bottom: 0.25rem; padding: 0; }
fieldset + fieldset { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.hint { color: var(--muted); font-size: 0.9rem; margin: -0.1rem 0 0.4rem; }
.field-error { color: var(--error-text); font-weight: 600; margin: 0 0 0.4rem; }
.has-error input { border-color: var(--error-text); border-width: 2px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="date"], input[type="search"], input:not([type]) {
  width: 100%; max-width: 24rem; font: inherit; padding: 0.55rem 0.7rem; border: 1px solid #93a39d; border-radius: var(--radius); background: var(--surface); color: var(--text);
}
input[type="tel"], input[type="date"] { font-variant-numeric: tabular-nums; max-width: 16rem; }
input[type="file"] { font: inherit; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 0.35rem; width: 1.1rem; height: 1.1rem; flex-shrink: 0; accent-color: var(--action); }

/* Buttons */
.button { display: inline-block; font: inherit; font-weight: 600; padding: 0.6rem 1.15rem; border-radius: var(--radius); border: 2px solid var(--action); background: var(--action); color: #fff; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--action-dark); border-color: var(--action-dark); color: #fff; }
.button-quiet { background: var(--surface); color: var(--action-dark); }
.button-quiet:hover { background: var(--ok-bg); color: var(--action-dark); }
.button-danger { background: var(--surface); color: var(--error-text); border-color: var(--error-line); }
.button-danger:hover { background: var(--error-bg); color: var(--error-text); border-color: var(--error-text); }
.button-wide { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0; }
.actions form { margin: 0; }

/* Messages */
.flash, .callout { padding: 0.75rem 1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.callout p:last-child { margin-bottom: 0; }
.callout form { margin-top: 0.75rem; }
.flash-ok, .callout-ok { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-line); }
.flash-warn, .callout-warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-line); }
.flash-error, .callout-error { background: var(--error-bg); color: var(--error-text); border-color: var(--error-line); }
.aside { font-size: 0.95rem; }

/* The phone number is the thing most worth double-checking, so it's the one big element. */
.big-number { font-size: 2rem; font-weight: 650; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.2; }
.temp { background: var(--surface); border: 2px dashed var(--line); padding: 1rem; display: inline-block; user-select: all; }

.summary { margin: 0 0 1.5rem; border-top: 1px solid var(--line); }
.summary > div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; }
.sms-preview { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem 1rem 1rem 0.25rem; padding: 0.8rem 1rem; max-width: 26rem; overflow-wrap: anywhere; }

/* Tables */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.search { display: flex; gap: 0.5rem; }
.search input { width: 16rem; }
.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.875rem; color: var(--muted); font-weight: 600; background: var(--paper); }
tbody tr:last-child td { border-bottom: 0; }
td { font-variant-numeric: tabular-nums; }
.dense td { padding: 0.45rem 0.9rem; font-size: 0.9rem; }

.status { display: inline-block; font-size: 0.85rem; font-weight: 600; padding: 0.1rem 0.55rem; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); white-space: nowrap; }
.status-sent { background: #e8eef6; color: #23406b; border-color: #a9bcd8; }
.status-delivered { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-line); }
.status-failed { background: var(--error-bg); color: var(--error-text); border-color: var(--error-line); }
.status-draft { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-line); }

.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 0.8rem 1rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 0.5rem; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.when { display: block; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Parent pages: phone-first, one task per screen */
.public-head { background: var(--ink); color: #fff; padding: 1rem 1.25rem; }
.public-main { max-width: 28rem; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.public-main input[type="date"] { max-width: 100%; font-size: 1.15rem; padding: 0.7rem; }
.public-main .button { font-size: 1.1rem; padding: 0.8rem 1.2rem; }
.public-contact { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); }

@media (max-width: 40rem) {
  h1 { font-size: 1.5rem; }
  .summary > div { grid-template-columns: 1fr; gap: 0.1rem; }
  .big-number { font-size: 1.6rem; }
  .search input { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
