@charset "UTF-8";
/*
 * St. Paul's office theme: calm, light, school green.
 * Deep green #013220 carries small text and buttons (AA contrast); emerald
 * #009E60 is reserved for large accents; pistachio #93C572 for soft
 * highlights only (never text). Loaded after Django's base.css on every
 * admin page (templates/admin/base_site.html), so the Django variables
 * below re-theme every stock screen and the sp-* classes style the
 * purpose-built attendance and communications screens.
 */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/Inter_400Regular.51b6ad87261f.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/Inter_600SemiBold.a5f35888d2da.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/Inter_700Bold.6e237de4f1f4.ttf") format("truetype"); }

:root,
html[data-theme="light"],
html[data-theme="dark"] {
  color-scheme: light;
  --sp-deep: #013220;
  --sp-deep-2: #0a4a31;
  --sp-emerald: #009e60;
  --sp-emerald-strong: #00754a;
  --sp-pistachio: #93c572;
  --sp-pistachio-soft: #eef6e7;
  --sp-canvas: #faf8f3;
  --sp-surface: #ffffff;
  --sp-ink: #17231d;
  --sp-muted: #56635c;
  --sp-hairline: #ebe7dd;
  --sp-border: #d6d1c4;
  --sp-radius: 12px;
  --sp-radius-sm: 8px;
  --sp-shadow: 0 1px 2px rgba(1, 50, 32, 0.06), 0 4px 16px rgba(1, 50, 32, 0.06);
  --sp-focus: #00754a;
  --sp-present-bg: #e3f4ea;
  --sp-present-fg: #0b5a36;
  --sp-absent-bg: #fde8e7;
  --sp-absent-fg: #9b1c14;
  --sp-absent-mark: #c0392b;
  --sp-leave-bg: #fdf1d8;
  --sp-leave-fg: #744a00;
  --sp-leave-mark: #c58a12;
  --sp-neutral-bg: #eeece6;
  --sp-neutral-fg: #45504a;

  --primary: var(--sp-emerald);
  --secondary: var(--sp-deep);
  --accent: var(--sp-pistachio);
  --primary-fg: #fff;
  --body-fg: var(--sp-ink);
  --body-bg: var(--sp-surface);
  --body-quiet-color: var(--sp-muted);
  --body-medium-color: #33403a;
  --body-loud-color: #0b1410;
  --header-color: #d8ead0;
  --header-branding-color: #fff;
  --header-bg: var(--sp-deep);
  --header-link-color: #fff;
  --breadcrumbs-fg: var(--sp-muted);
  --breadcrumbs-link-fg: var(--sp-emerald-strong);
  --breadcrumbs-bg: transparent;
  --link-fg: var(--sp-emerald-strong);
  --link-hover-color: var(--sp-deep);
  --link-selected-fg: var(--sp-deep);
  --hairline-color: var(--sp-hairline);
  --border-color: var(--sp-border);
  --error-fg: #a3190f;
  --message-success-bg: #e6f4ea;
  --message-warning-bg: #fdf3dc;
  --message-error-bg: #fdecea;
  --darkened-bg: #f4f1ea;
  --selected-bg: #e7f1df;
  --selected-row: #f1f8ea;
  --button-fg: #fff;
  --button-bg: var(--sp-emerald-strong);
  --button-hover-bg: var(--sp-deep);
  --default-button-bg: var(--sp-deep);
  --default-button-hover-bg: var(--sp-emerald-strong);
  --close-button-bg: #5d6862;
  --close-button-hover-bg: #33403a;
  --delete-button-bg: #a3190f;
  --delete-button-hover-bg: #7f130b;
  --object-tools-fg: #fff;
  --object-tools-bg: var(--sp-deep);
  --object-tools-hover-bg: var(--sp-emerald-strong);
  --font-family-primary: "Inter", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---- Shell ------------------------------------------------------------ */

body { background: var(--sp-canvas); color: var(--sp-ink); font-size: 0.9375rem; line-height: 1.5; }
.theme-toggle { display: none !important; }

/* One header: brand, primary sections, account actions. Django's responsive.css
   loads after this file and turns #header into a column at 1024px, so these
   rules name #container to keep the layout at every width. */
#container > #header {
  position: relative; z-index: 20; display: flex; flex-flow: row wrap; align-items: center; justify-content: flex-start;
  gap: 8px 20px; padding: 10px 28px; background: var(--sp-deep); color: var(--header-color);
}
#container > #header #branding { flex: 0 1 auto; min-width: 0; }
.sp-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
#header a.sp-brand:any-link { color: #fff; text-decoration: none; }
.sp-crest {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px;
  background: #fff; box-shadow: 0 0 0 2px rgba(147, 197, 114, 0.6);
}
.sp-crest img { display: block; width: 38px; height: 39px; object-fit: contain; }
.sp-brand-text { display: grid; gap: 2px; min-width: 0; line-height: 1.2; }
.sp-brand-text strong { font-size: 1.0625rem; font-weight: 700; letter-spacing: 0.01em; color: #fff; }
.sp-brand-text > span { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; color: var(--header-color); font-size: 0.8125rem; }
.sp-env {
  padding: 1px 9px; border-radius: 999px; background: #f6d873; color: #3a2a00;
  font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
}

#container #user-tools {
  order: 2; float: none; margin: 0 0 0 auto; display: flex; align-items: center; gap: 16px;
  font-size: 0.8125rem; font-weight: 400; text-transform: none; letter-spacing: 0; text-align: right; color: var(--header-color);
}
#user-tools .sp-user { color: #fff; font-weight: 600; }
#header #user-tools a:any-link { color: #fff; border-bottom: none; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, 0.45); }
#logout-form { display: inline-flex; }
#header #logout-form button {
  min-height: 40px; padding: 6px 14px; border: 1px solid rgba(255, 255, 255, 0.45); border-radius: var(--sp-radius-sm);
  background: transparent; color: #fff; font: inherit; font-size: 0.875rem; font-weight: 600; text-transform: none;
  letter-spacing: 0; cursor: pointer; margin: 0;
}
#header #logout-form button:hover { background: rgba(255, 255, 255, 0.14); border-bottom: 1px solid #fff; margin: 0; }

/* Primary sections: pills on a second row, or one row from 1280px. */
.sp-nav { margin: 0; }
.sp-nav--wide { order: 3; flex: 1 0 100%; }
.sp-nav--wide > ul { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.sp-nav li { list-style: none; }
.sp-nav--wide > ul > li { position: relative; }
#header .sp-nav a:any-link, .sp-nav summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; box-sizing: border-box; padding: 8px 14px;
  border-radius: var(--sp-radius-sm); color: #e5f1df; font-size: 0.9375rem; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; list-style: none;
}
.sp-nav summary::-webkit-details-marker { display: none; }
.sp-nav--wide summary::after {
  content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
#header .sp-nav a:any-link:hover, .sp-nav summary:hover, .sp-nav details[open] > summary { background: rgba(255, 255, 255, 0.14); color: #fff; }
#header .sp-nav > ul > li > a[aria-current], #header .sp-nav--wide details[data-current] > summary {
  background: #fff; color: var(--sp-deep);
}
.sp-drop > ul {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 210px; margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid var(--sp-hairline); border-radius: var(--sp-radius); box-shadow: 0 10px 30px rgba(1, 50, 32, 0.28);
}
#header .sp-drop > ul a:any-link { display: flex; width: 100%; color: var(--sp-ink); }
#header .sp-drop > ul a:any-link:hover { background: var(--sp-pistachio-soft); color: var(--sp-deep); }
#header .sp-drop > ul a[aria-current] { background: var(--sp-pistachio-soft); color: var(--sp-deep); font-weight: 700; }
.sp-nav--narrow { display: none; order: 3; flex: 1 0 100%; }
.sp-nav--narrow > summary { border: 1px solid rgba(255, 255, 255, 0.45); color: #fff; min-height: 44px; }
.sp-nav--narrow > summary::before { content: "☰"; font-size: 1.125rem; line-height: 1; }
.sp-nav--narrow ul { display: grid; gap: 2px; margin: 8px 0 0; padding: 0; list-style: none; }
#header .sp-nav--narrow a:any-link { display: flex; min-height: 44px; }
#header .sp-nav--narrow ul a[aria-current] { background: #fff; color: var(--sp-deep); }
.sp-nav-heading { padding: 10px 14px 2px; color: var(--sp-pistachio); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

/* Breadcrumbs: a quiet trail, not a second bar of navigation. */
div.breadcrumbs { padding: 14px 28px 0; font-size: 0.8125rem; }
div.breadcrumbs a:any-link { text-decoration: underline; text-underline-offset: 3px; }
#content { padding: 24px 28px 48px; max-width: 1280px; }
#content h1 { font-size: 1.5rem; font-weight: 700; color: var(--sp-deep); letter-spacing: -0.01em; margin: 4px 0 20px; }
#content h2 { color: var(--sp-deep); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--sp-focus); outline-offset: 2px;
}
#header a:focus-visible, #header button:focus-visible, #header summary:focus-visible { outline-color: #fff; }
.sp-drop > ul a:focus-visible { outline-color: var(--sp-focus); }
.sp-roster:focus-visible { outline: none; }

/* ---- Stock admin surfaces -------------------------------------------- */

.module, .inline-group, fieldset.module {
  background: var(--sp-surface); border: 1px solid var(--sp-hairline); border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow); overflow: hidden;
}
.module h2, .module caption, .inline-group h2 {
  background: var(--sp-pistachio-soft); color: var(--sp-deep); font-size: 0.8125rem; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase; padding: 10px 14px;
}
.module caption a, .module h2 a { color: var(--sp-deep); }
#changelist .toplinks, #changelist-filter { border-radius: var(--sp-radius); }
#changelist-filter { background: var(--sp-surface); border: 1px solid var(--sp-hairline); box-shadow: var(--sp-shadow); }
#changelist-filter h2 { background: var(--sp-pistachio-soft); color: var(--sp-deep); }
#changelist-filter li.selected a { color: var(--sp-deep); font-weight: 700; }
#changelist .actions { background: var(--sp-surface); border-radius: var(--sp-radius-sm); padding: 10px 12px; }
#changelist table thead th { background: #f6f3ec; color: var(--sp-muted); font-size: 0.75rem; letter-spacing: 0.04em; }
#changelist table tbody tr:hover { background: var(--selected-row); }
table { border-radius: var(--sp-radius-sm); }
td, th { padding: 10px 12px; }
input[type="text"], input[type="password"], input[type="email"], input[type="url"], input[type="number"],
input[type="tel"], input[type="search"], input[type="date"], textarea, select, .vTextField {
  border: 1px solid var(--sp-border); border-radius: var(--sp-radius-sm); padding: 8px 10px; min-height: 40px;
  background: #fff; color: var(--sp-ink); font-size: 0.9375rem;
}
textarea { min-height: 120px; }
.button, input[type="submit"], input[type="button"], .submit-row input, a.button, button.button,
.object-tools a, #changelist-search input[type="submit"] {
  border-radius: var(--sp-radius-sm); padding: 10px 16px; font-weight: 600; min-height: 40px;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}
.submit-row { background: var(--sp-surface); border: 1px solid var(--sp-hairline); border-radius: var(--sp-radius); padding: 14px; }
.submit-row a.deletelink { border-radius: var(--sp-radius-sm); padding: 10px 16px; }
ul.messagelist li { border-radius: var(--sp-radius-sm); margin: 0 28px 10px; background-image: none; padding: 12px 16px 12px 16px; color: var(--sp-ink); }
ul.messagelist li.success { border-left: 4px solid var(--sp-emerald-strong); }
ul.messagelist li.warning { border-left: 4px solid #b27700; }
ul.messagelist li.error { border-left: 4px solid var(--error-fg); }
.errornote { border-radius: var(--sp-radius-sm); }
.object-tools { margin-top: 0; }
.object-tools a { background: var(--sp-deep); }
.object-tools a:hover { background: var(--sp-emerald-strong); }
form .aligned label { color: var(--sp-muted); font-weight: 600; }
.help, p.help, form p.help, div.help { color: var(--sp-muted); }

/* ---- Components ---------------------------------------------------------- */

.sp-page { display: grid; gap: 20px; }
.sp-page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.sp-page-header h1 { margin: 0 !important; }
.sp-eyebrow { margin: 0 0 4px; color: var(--sp-muted); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.sp-lede { margin: 6px 0 0; color: var(--sp-muted); max-width: 60ch; }
.sp-card {
  background: var(--sp-surface); border: 1px solid var(--sp-hairline); border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow); padding: 20px;
}
.sp-card > h2, .sp-card-title { margin: 0 0 12px; font-size: 1.0625rem; font-weight: 700; color: var(--sp-deep); background: none; padding: 0; text-transform: none; letter-spacing: 0; }
.sp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sp-card-head h2 { margin: 0; }
.sp-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.sp-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.sp-stats--flush { margin: 16px 0; }
.sp-stat { border-radius: var(--sp-radius-sm); padding: 12px 14px; background: var(--sp-neutral-bg); color: var(--sp-neutral-fg); }
.sp-stat strong { display: block; font-size: 1.625rem; font-weight: 700; line-height: 1.2; color: inherit; }
.sp-stat span { font-size: 0.8125rem; font-weight: 600; }
.sp-stat--present { background: var(--sp-present-bg); color: var(--sp-present-fg); }
.sp-stat--absent { background: var(--sp-absent-bg); color: var(--sp-absent-fg); }
.sp-stat--leave { background: var(--sp-leave-bg); color: var(--sp-leave-fg); }
.sp-stat--brand { background: var(--sp-pistachio-soft); color: var(--sp-deep); }
.sp-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em; background: var(--sp-neutral-bg); color: var(--sp-neutral-fg);
  white-space: nowrap;
}
.sp-chip--present, .sp-chip--submitted, .sp-chip--published, .sp-chip--sent { background: var(--sp-present-bg); color: var(--sp-present-fg); }
.sp-chip--absent, .sp-chip--dead, .sp-chip--alert { background: var(--sp-absent-bg); color: var(--sp-absent-fg); }
.sp-chip--leave, .sp-chip--draft, .sp-chip--failed { background: var(--sp-leave-bg); color: var(--sp-leave-fg); }
.sp-chip--notice, .sp-chip--circular { background: var(--sp-pistachio-soft); color: var(--sp-deep); }
.sp-btn, a.sp-btn, button.sp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; box-sizing: border-box;
  border-radius: var(--sp-radius-sm); border: 1px solid transparent; background: var(--sp-deep); color: #fff;
  font: inherit; font-weight: 600; font-size: 0.9375rem; line-height: 1.2; cursor: pointer; text-decoration: none;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 80ms ease;
}
.sp-btn:hover { background: var(--sp-emerald-strong); color: #fff; text-decoration: none; }
.sp-btn:active { transform: translateY(1px); }
.sp-btn--secondary, a.sp-btn--secondary, button.sp-btn--secondary { background: #fff; color: var(--sp-deep); border-color: var(--sp-border); }
.sp-btn--secondary:hover { background: var(--sp-pistachio-soft); color: var(--sp-deep); }
.sp-btn--quiet, a.sp-btn--quiet, button.sp-btn--quiet { background: transparent; color: var(--sp-deep); border-color: transparent; }
.sp-btn--quiet:hover { background: var(--sp-pistachio-soft); color: var(--sp-deep); }
.sp-btn--danger, a.sp-btn--danger, button.sp-btn--danger { background: #fff; color: var(--error-fg); border-color: #efc4bf; }
.sp-btn--danger:hover { background: var(--sp-absent-bg); color: var(--error-fg); }
.sp-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sp-actions--end { justify-content: flex-end; }
.sp-muted { color: var(--sp-muted); }
.sp-small { font-size: 0.8125rem; }
.sp-callout { border-radius: var(--sp-radius-sm); padding: 12px 14px; background: var(--sp-pistachio-soft); color: var(--sp-deep); }
.sp-callout--warn { background: var(--sp-leave-bg); color: var(--sp-leave-fg); }
.sp-callout--error { background: var(--sp-absent-bg); color: var(--sp-absent-fg); }
.sp-list { margin: 0; padding: 0; list-style: none; }
.sp-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--sp-hairline); }
.sp-list li:last-child { border-bottom: none; }
.sp-list .sp-list-main { display: grid; gap: 2px; min-width: 0; }
.sp-list .sp-list-main strong { font-weight: 600; color: var(--sp-ink); overflow-wrap: anywhere; }
.sp-empty { padding: 20px; text-align: center; color: var(--sp-muted); border: 1px dashed var(--sp-border); border-radius: var(--sp-radius-sm); }
.sp-field { display: grid; gap: 6px; margin-bottom: 16px; }
.sp-field > label, .sp-field legend { font-weight: 600; color: var(--sp-ink); font-size: 0.875rem; padding: 0; }
.sp-field input[type="text"], .sp-field textarea, .sp-field select { width: 100%; box-sizing: border-box; }
.sp-field .sp-help { margin: 0; color: var(--sp-muted); font-size: 0.8125rem; }
.sp-errors { margin: 0; padding: 0; list-style: none; color: var(--error-fg); font-size: 0.875rem; font-weight: 600; }
fieldset.sp-fieldset { border: none; margin: 0 0 16px; padding: 0; }
.sp-form-card label { color: var(--sp-ink); }
.sp-form-card p { margin: 0 0 14px; }
.sp-form-card p label { display: block; font-weight: 600; margin-bottom: 6px; }
.sp-form-card input[type="text"], .sp-form-card select, .sp-form-card textarea { width: 100%; max-width: 520px; box-sizing: border-box; }
.sp-form-card ul.errorlist { margin: 0 0 6px; padding: 0; color: var(--error-fg); font-weight: 600; }
.sp-object-list { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 6px; }
.sp-object-list li { padding: 8px 12px; border-radius: var(--sp-radius-sm); background: var(--darkened-bg); }

/* Segmented choice (radio inputs stay real and focusable) */
.sp-seg { display: inline-flex; flex-wrap: wrap; gap: 6px; border: none; margin: 0; padding: 0; }
.sp-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sp-seg label {
  display: inline-flex; align-items: center; justify-content: center; min-width: 76px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--sp-border); border-radius: var(--sp-radius-sm); background: #fff; color: var(--sp-ink);
  font-weight: 600; font-size: 0.875rem; cursor: pointer; transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
  user-select: none;
}
.sp-seg label:hover { border-color: var(--sp-emerald-strong); }
.sp-seg input:focus-visible + label { outline: 3px solid var(--sp-focus); outline-offset: 2px; }
.sp-seg input:checked + label { background: var(--sp-deep); border-color: var(--sp-deep); color: #fff; }
.sp-seg input[value="present"]:checked + label { background: var(--sp-present-bg); border-color: #7cc49a; color: var(--sp-present-fg); }
.sp-seg input[value="absent"]:checked + label { background: var(--sp-absent-bg); border-color: #e59a93; color: var(--sp-absent-fg); }
.sp-seg input[value="leave"]:checked + label { background: var(--sp-leave-bg); border-color: #e0b35c; color: var(--sp-leave-fg); }
.sp-seg input:disabled + label { cursor: default; opacity: 0.55; }
.sp-seg input:disabled:checked + label { opacity: 1; }
.sp-seg label::before { content: ""; }
.sp-seg input[value="present"]:checked + label::before { content: "✓ "; white-space: pre; }
.sp-seg input[value="absent"]:checked + label::before { content: "✕ "; white-space: pre; }
.sp-seg input[value="leave"]:checked + label::before { content: "L "; white-space: pre; }

/* ---- Attendance -------------------------------------------------------- */

.sp-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.sp-search { flex: 1 1 260px; max-width: 420px; }
.sp-search input { width: 100%; box-sizing: border-box; min-height: 44px; }
.sp-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-filters button {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--sp-border); background: #fff;
  color: var(--sp-ink); font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer;
}
.sp-filters button[aria-pressed="true"] { background: var(--sp-deep); border-color: var(--sp-deep); color: #fff; }
.sp-roster { margin: 0; padding: 0; list-style: none; }
.sp-roster-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  min-height: 60px; padding: 10px 8px 10px 12px; border-bottom: 1px solid var(--sp-hairline); border-left: 4px solid transparent;
  transition: background-color 180ms ease;
}
.sp-roster-row:last-child { border-bottom: none; }
.sp-roster-row[data-status="absent"] { background: var(--sp-absent-bg); border-left-color: var(--sp-absent-mark); }
.sp-roster-row[data-status="leave"] { background: var(--sp-leave-bg); border-left-color: var(--sp-leave-mark); }
.sp-roster-row[hidden] { display: none; }
.sp-student { display: grid; gap: 2px; min-width: 170px; flex: 1 1 180px; }
.sp-student strong { font-weight: 600; font-size: 1rem; overflow-wrap: anywhere; }
.sp-student span { color: var(--sp-muted); font-size: 0.8125rem; }
.sp-row-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sp-seg { min-width: 0; }
.sp-link-btn {
  min-height: 44px; padding: 0 4px; border: none; background: none; color: var(--sp-emerald-strong);
  font: inherit; font-size: 0.875rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.sp-link-btn:hover { color: var(--sp-deep); }
.sp-link-btn[hidden], .sp-reset-confirm[hidden] { display: none; }
.sp-reset { margin: 2px 0 6px; }
.sp-reset-confirm { margin: 6px 0 10px; }
.sp-reset-confirm p { margin: 0 0 10px; font-weight: 600; }
.sp-summary-bar {
  display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; justify-content: space-between;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); margin-top: 8px; border-radius: var(--sp-radius);
  background: #fff; border: 1px solid var(--sp-border); box-shadow: 0 -6px 20px rgba(1, 50, 32, 0.1);
}
.sp-counts { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.sp-counts .sp-chip { font-size: 0.875rem; padding: 5px 12px; }
.sp-actions--bar { flex-wrap: nowrap; }
.sp-discard { margin: 0; }
.sp-group-title { margin: 22px 0 10px; }
.sp-sections { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin: 0; padding: 0; list-style: none; }
.sp-sections--todo { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.sp-sections--done { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.sp-section-tile {
  display: grid; gap: 6px; padding: 14px; border-radius: var(--sp-radius-sm); border: 1px solid var(--sp-hairline);
  background: #fff; color: var(--sp-ink); text-decoration: none; transition: border-color 150ms ease, box-shadow 150ms ease;
}
a.sp-section-tile:hover { border-color: var(--sp-emerald-strong); box-shadow: var(--sp-shadow); text-decoration: none; color: var(--sp-ink); }
.sp-section-tile strong { font-weight: 700; color: var(--sp-deep); }
.sp-tile-state { color: var(--sp-muted); font-size: 0.8125rem; font-weight: 600; }
.sp-section-tile--unstarted, .sp-section-tile--draft { gap: 8px; padding: 16px; border-width: 2px; }
.sp-section-tile--unstarted strong, .sp-section-tile--draft strong { font-size: 1.0625rem; }
.sp-section-tile--unstarted { border-color: var(--sp-deep); }
.sp-section-tile--draft { border-color: var(--sp-leave-mark); background: #fffaf0; }
.sp-section-tile--draft .sp-tile-state { color: var(--sp-leave-fg); }
.sp-tile-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 0 14px;
  border-radius: var(--sp-radius-sm); background: var(--sp-deep); color: #fff; font-weight: 700;
}
a.sp-section-tile:hover .sp-tile-action { background: var(--sp-emerald-strong); }
.sp-section-tile--draft .sp-tile-action { background: #fff; color: var(--sp-leave-fg); box-shadow: inset 0 0 0 2px var(--sp-leave-mark); }
a.sp-section-tile--draft:hover .sp-tile-action { background: var(--sp-leave-bg); }
.sp-section-tile--submitted { gap: 2px; padding: 10px 12px; background: var(--sp-canvas); }
.sp-progress { height: 8px; border-radius: 999px; background: var(--sp-neutral-bg); overflow: hidden; }
.sp-progress span { display: block; height: 100%; background: var(--sp-emerald); border-radius: inherit; }
/* Django's dashboard.css pins `.dashboard #content` to 600px. */
body.dashboard #content { width: auto; }
.sp-all-records { scroll-margin-top: 16px; max-width: 760px; }

/* ---- Communications ------------------------------------------------------ */

.sp-compose { display: grid; gap: 20px; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); align-items: start; }
.sp-class-group { border: 1px solid var(--sp-hairline); border-radius: var(--sp-radius-sm); padding: 10px 12px; margin: 0 0 8px; }
.sp-class-group legend { font-weight: 700; padding: 0 4px; }
.sp-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.sp-checks label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-weight: 500; color: var(--sp-ink); }
.sp-checks input { width: 18px; height: 18px; accent-color: var(--sp-deep); }
.sp-audience[hidden] { display: none; }
.sp-attachments li { gap: 10px; }
.sp-file-meta { color: var(--sp-muted); font-size: 0.8125rem; }
.sp-phone {
  max-width: 380px; margin: 0 auto; border-radius: 28px; padding: 18px; background: var(--sp-canvas);
  border: 1px solid var(--sp-border); box-shadow: var(--sp-shadow);
}
.sp-phone-card { background: #fff; border-radius: 16px; padding: 16px; border: 1px solid var(--sp-hairline); }
.sp-phone-card h3 { margin: 8px 0; font-size: 1.125rem; color: var(--sp-deep); }
.sp-phone-card p { white-space: pre-wrap; margin: 0 0 10px; color: var(--sp-ink); }
.sp-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.sp-dl dt { color: var(--sp-muted); font-weight: 600; }
.sp-dl dd { margin: 0; }

/* ---- Existing screens --------------------------------------------------- */

.parent-slip { max-width: 42rem; margin: 0 auto; font-size: 1.1rem; background: #fff; padding: 24px; border-radius: var(--sp-radius); border: 1px solid var(--sp-hairline); }
.aadhaar-number { font-size: 1.5rem; font-weight: 700; letter-spacing: 0.08em; }

@media (min-width: 1280px) {
  .sp-nav--wide { order: 2; flex: 1 1 auto; }
  #container #user-tools { order: 3; }
}
@media (max-width: 1024px) {
  .sp-compose { grid-template-columns: 1fr; }
  .sp-compose--aside-first > aside { order: -1; }
  #content { padding: 16px 14px 40px; }
  div.breadcrumbs { padding: 12px 14px 0; }
}
@media (max-width: 480px) {
  .sp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sp-stat { padding: 10px 12px; }
  .sp-stat strong { font-size: 1.375rem; }
  #content { padding: 14px 10px 32px; }
  div.breadcrumbs { padding: 12px 10px 0; }
}
@media (max-width: 900px) {
  #container > #header { padding: 10px 14px; }
  .sp-nav--wide { display: none; }
  .sp-nav--narrow { display: block; }
  #user-tools .sp-user, #user-tools .sp-account-link { display: none; }
  #header #logout-form button { min-height: 44px; }
}
@media (max-width: 640px) {
  .sp-brand { gap: 10px; }
  .sp-brand-text strong { font-size: 1rem; }
  .sp-search { flex-basis: 100%; max-width: none; }
  .sp-filters { width: 100%; }
  .sp-filters button { flex: 1 1 0; padding: 0 8px; }
  .sp-mark { padding: 10px 8px; }
  .sp-roster-row { padding-left: 10px; }
  .sp-student { flex-basis: 100%; }
  .sp-row-extra { width: 100%; }
  .sp-roster .sp-seg, .sp-seg--three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; flex: 1 1 100%; }
  .sp-roster .sp-seg label, .sp-seg--three label { min-width: 0; padding: 0 4px; }
  .sp-summary-bar { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); gap: 8px; }
  .sp-counts { flex-wrap: nowrap; gap: 6px; }
  .sp-counts .sp-chip { font-size: 0.8125rem; padding: 3px 8px; }
  .sp-reset-confirm .sp-actions .sp-btn { flex: 1 1 100%; }
  .sp-summary-bar .sp-actions { width: 100%; }
  .sp-summary-bar .sp-btn { flex: 1 1 auto; }
  .sp-summary-bar .sp-actions--bar .sp-btn { flex: 1 1 0; padding: 10px 8px; }
  .sp-sections--todo { grid-template-columns: 1fr; }
  .sp-discard .sp-btn { width: 100%; }
  ul.messagelist li { margin: 0 14px 10px; }
}
/* Keyboard focus scrolled into view must land above the sticky action bar. */
html:has(.sp-summary-bar--sticky) { scroll-padding-bottom: 9rem; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  header, nav, .breadcrumbs, .parent-slip button { display: none !important; }
  body { background: #fff; }
  .parent-slip { max-width: none; color: #000; border: none; }
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Django's `ul li { list-style-type: square }` would mark custom lists. */
.sp-sections li, .sp-list li, .sp-roster li, .sp-object-list li,
.sp-errors li, ul.messagelist li { list-style: none; }
/* Section captions sit on the pale band: keep their links deep green. */
a.section:link, a.section:visited, .module caption a {
  color: var(--sp-deep);
}

/* The sticky bar exists only on a draft's long roster; review and composer pages end with their action bar. */
.sp-summary-bar--sticky { position: sticky; bottom: 0; z-index: 5; }

/* ---- Family records: student, guardian, link and parent-account screens ---- */

.sp-chip--active { background: var(--sp-present-bg); color: var(--sp-present-fg); }
.sp-chip--pending { background: var(--sp-leave-bg); color: var(--sp-leave-fg); }
.sp-chip--disabled { background: var(--sp-absent-bg); color: var(--sp-absent-fg); }
.sp-btn--small, a.sp-btn--small, button.sp-btn--small { min-height: 40px; padding: 6px 12px; font-size: 0.8125rem; }
.sp-list-lede { margin: 0 0 12px; }
.sp-inline-form { margin: 0; }
.sp-help { margin: 10px 0 0; color: var(--sp-muted); font-size: 0.8125rem; }
.sp-card--sensitive { border-left: 4px solid var(--sp-leave-mark); background: #fffdf7; }
.sp-callout--warn h2 { color: var(--sp-leave-fg); }
.sp-card .sp-actions { margin-top: 12px; }
.sp-family-list li { flex-wrap: wrap; align-items: center; }
.sp-family-list .sp-list-main { flex: 1 1 10rem; }
.sp-family-list .sp-inline-form { margin-left: auto; }

/* Two columns on a wide screen (the form, then the family/sensitive panels); the
   panels follow the form on a narrow one. */
body.sp-record #content { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; column-gap: 24px; align-items: start; }
body.sp-record #content > * { grid-column: 1 / -1; }
body.sp-record #content > #content-main { grid-column: 1; grid-row: 2; min-width: 0; }
body.sp-record #content > .sp-side { grid-column: 2; grid-row: 2; display: grid; gap: 16px; min-width: 0; }
body.sp-record #content > br.clear { display: none; }
body.sp-record.sp-record--narrow #content { grid-template-columns: minmax(0, 44rem); }
.sp-record-head { margin-bottom: 16px; }
.sp-record-head .sp-lede a { white-space: nowrap; }

/* Stock form rows: label above the field, one column, help and errors under it. */
body.sp-record fieldset.module.aligned { margin: 0 0 16px; padding: 0 0 6px; }
body.sp-record fieldset .description { margin: 0; padding: 10px 14px 0; color: var(--sp-muted); font-size: 0.875rem; }
/* Below 768px Django sizes each field wrapper to the viewport (100vw - 30px), which
   ignores the card around it and pushes fields past its edge. */
#content .aligned .form-row, #content .aligned .form-row > div { width: auto; max-width: none; }
body.sp-record .aligned .form-row { padding: 12px 14px; border-bottom: 1px solid var(--sp-hairline); overflow: visible; }
body.sp-record .aligned .form-row:last-child { border-bottom: none; }
body.sp-record .aligned .form-row .flex-container { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
body.sp-record .aligned label { float: none; width: auto; min-width: 0; padding: 0; color: var(--sp-ink); font-size: 0.875rem; font-weight: 600; line-height: 1.4; }
body.sp-record .aligned .readonly { margin: 0; padding: 2px 0; font-weight: 600; overflow-wrap: anywhere; }
body.sp-record .aligned .form-row .flex-container.checkbox-row { display: flex; align-items: center; gap: 8px; }
body.sp-record .aligned .checkbox-row label { order: 2; }
body.sp-record .aligned .checkbox-row input { width: 20px; height: 20px; accent-color: var(--sp-deep); }
body.sp-record .aligned input[type="text"], body.sp-record .aligned input[type="password"], body.sp-record .aligned input[type="email"],
body.sp-record .aligned input[type="number"], body.sp-record .aligned select, body.sp-record .aligned .vTextField, body.sp-record .aligned .vDateField {
  width: 100%; max-width: 30rem; box-sizing: border-box;
}
body.sp-record .aligned .help, body.sp-record .aligned div.help { margin: 2px 0 0; padding: 0; font-size: 0.8125rem; }
body.sp-record .aligned .form-row.errors { background: #fff6f5; border-left: 4px solid var(--error-fg); }
body.sp-record .aligned ul.errorlist { margin: 0 0 6px; padding: 0; list-style: none; color: var(--error-fg); font-weight: 600; font-size: 0.875rem; }
body.sp-record .aligned ul.errorlist li { list-style: none; background: none; padding: 0; }
body.sp-record .errornote { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--sp-radius-sm); border-left: 4px solid var(--error-fg); }
/* The stock fieldset heading is a dark band, and `#content h2` above made its text
   dark too. Use the same pale band as every other panel. */
#content fieldset .fieldset-heading {
  margin: 0; padding: 10px 14px; border: none; background: var(--sp-pistachio-soft); color: var(--sp-deep);
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
}
/* History is a quiet link, not a tab that hangs off the form. */
body.sp-record #content-main .object-tools { float: none; margin: 0 0 8px; padding: 0; text-align: right; }
body.sp-record .object-tools li { display: inline; float: none; height: auto; margin: 0; }
body.sp-record .object-tools a:link, body.sp-record .object-tools a:visited {
  display: inline; float: none; padding: 0; border-radius: 0; background: none; color: var(--sp-emerald-strong);
  font-size: 0.875rem; font-weight: 600; letter-spacing: 0; text-transform: none; text-decoration: underline; text-underline-offset: 3px;
}

/* Save hierarchy: Save first, Save and continue quieter, leaving the page quietest. */
.sp-save-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sp-save-row .submit-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; padding: 0; border: none; background: none; box-shadow: none; }
body.sp-record .sp-save-row .submit-row input, body.sp-record .sp-save-row .submit-row a.closelink {
  float: none; margin: 0; height: auto; min-height: 44px; text-transform: none; font-size: 0.9375rem;
}
body.sp-record .sp-save-row .submit-row input[name="_save"] { background: var(--sp-deep); color: #fff; border: 1px solid var(--sp-deep); }
body.sp-record .sp-save-row .submit-row input[name="_continue"], body.sp-record .sp-save-row .submit-row input[name="_addanother"] {
  background: #fff; color: var(--sp-deep); border: 1px solid var(--sp-border);
}
body.sp-record .sp-save-row .submit-row input:hover { background: var(--sp-emerald-strong); color: #fff; }

/* A one-time or sensitive action sits behind an explicit, no-script confirmation. */
.sp-confirm { border: 1px solid var(--sp-border); border-radius: var(--sp-radius-sm); background: #fff; }
.sp-confirm > summary { display: flex; width: 100%; box-sizing: border-box; list-style: none; cursor: pointer; }
.sp-confirm > summary::-webkit-details-marker { display: none; }
.sp-confirm[open] > summary { border-radius: var(--sp-radius-sm) var(--sp-radius-sm) 0 0; }
.sp-confirm-body { padding: 12px 14px 14px; }
.sp-confirm-body p { margin: 0 0 8px; }
.sp-consequences { margin: 0 0 12px; padding-left: 20px; }
.sp-consequences li { list-style: disc; margin: 0 0 4px; }

/* Lists: the search first, the filters quieter, wide tables scroll inside their box. */
.sp-familylist #changelist .results { overflow-x: auto; }
.sp-familylist #changelist-search .help, .sp-familylist #toolbar .help { margin: 6px 0 0; color: var(--sp-muted); font-size: 0.8125rem; }
.sp-familylist #toolbar form #searchbar { min-width: 0; }
.sp-familylist #changelist-filter { font-size: 0.875rem; }
.sp-familylist #changelist .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.sp-familylist #changelist .actions label { display: inline-flex; align-items: center; gap: 6px; }

/* Slip: legible on screen and on paper; the printed sheet is the slip alone. */
.parent-slip h1 { margin: 0 0 4px; font-size: 1.375rem; }
.parent-slip h2 { margin: 0 0 16px; font-size: 1.125rem; }
.parent-slip h3 { margin: 18px 0 6px; font-size: 1rem; }
.sp-slip-code { margin: 10px 0; }
.sp-slip-code strong {
  display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 6px; background: var(--sp-pistachio-soft);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 1.5rem; letter-spacing: 0.12em; overflow-wrap: anywhere;
}
.aadhaar-number { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.sp-slip-scan { display: flex; gap: 20px; align-items: center; margin: 12px 0; }
.sp-slip-scan p { margin: 4px 0; }
.sp-slip-qr { flex: none; width: 168px; height: 168px; image-rendering: pixelated; }
.sp-slip-batch .parent-slip { margin-bottom: 24px; }
.sp-table { border-collapse: collapse; width: 100%; max-width: 64rem; margin: 16px 0; }
.sp-table th, .sp-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--sp-hairline); }
.sp-table tfoot th { border-top: 2px solid var(--sp-hairline); }

/* Stock lists keep the filter beside the results down to 768px, where it covers the
   Search button. Put it under the results at tablet width and below. */
@media (max-width: 1024px) {
  .sp-familylist #changelist { flex-direction: column; align-items: stretch; }
  .sp-familylist #changelist-filter { flex: none; order: 2; width: auto; margin: 16px 0 0; }
}
@media (max-width: 1100px) {
  /* Stock #content-main floats at full width; unfloat it so the panels follow the form. */
  body.sp-record #content { display: block; }
  body.sp-record #content-main { float: none; width: auto; }
  body.sp-record #content > .sp-side { clear: both; margin-top: 16px; }
}
@media (max-width: 640px) {
  /* Keep the columns that matter (name, status) on screen without side-scrolling. */
  .sp-familylist #changelist table th, .sp-familylist #changelist table td { padding: 8px 6px; }
  .sp-familylist #changelist table thead th { white-space: normal; letter-spacing: 0; }
  .sp-familylist #changelist table { font-size: 0.875rem; }
  .sp-btn--small, a.sp-btn--small, button.sp-btn--small { min-height: 44px; }
  .sp-slip-code strong { font-size: 1.25rem; margin-left: 0; }
  .sp-save-row .submit-row, .sp-save-row .submit-row input, .sp-save-row > .sp-btn { width: 100%; }
  .sp-family-list .sp-inline-form, .sp-family-list .sp-inline-form .sp-btn { width: 100%; }
  body.sp-record .aligned .form-row { padding: 12px 10px; }
}
@media print {
  @page { margin: 14mm; }
  .sp-noprint, .skip-to-content-link, ul.messagelist, #footer { display: none !important; }
  body.sp-slip-page #content, body.sp-slip-page .main { padding: 0; }
  .parent-slip { border: 2px solid #000; border-radius: 0; box-shadow: none; padding: 16px; font-size: 13pt; break-inside: avoid; }
  .parent-slip h1 { font-size: 18pt; }
  .sp-slip-code strong { padding: 2px 10px; border: 2px solid #000; border-radius: 0; background: #fff; font-size: 22pt; }
  /* Whole-class batches: two slips per A4 sheet, cut along the border. */
  .sp-slip-batch .parent-slip { font-size: 10.5pt; padding: 10px 14px; margin: 0 0 6mm; height: 128mm; overflow: hidden; }
  .sp-slip-batch .parent-slip:nth-of-type(2n) { break-after: page; }
  .sp-slip-batch .parent-slip h1 { font-size: 14pt; }
  .sp-slip-batch .parent-slip h2 { margin-bottom: 6px; }
  .sp-slip-batch .parent-slip h3 { margin: 6px 0 2px; }
  .sp-slip-batch .sp-slip-code strong { font-size: 16pt; }
  .sp-slip-batch .sp-slip-qr { width: 40mm; height: 40mm; }
}

/* ---- Communications, sign-in and MFA setup ------------------------------------ */

/* Where a message or a setup is in its sequence (numbered, not colour alone). */
.sp-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: none; }
.sp-steps li { box-sizing: border-box; min-width: 0; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 14px 4px 6px; border: 1px solid var(--sp-border); border-radius: 999px; background: #fff; color: var(--sp-muted); font-size: 0.875rem; font-weight: 600; }
.sp-steps li.is-current { border-color: var(--sp-deep); background: var(--sp-deep); color: #fff; }
.sp-steps li.is-done { border-color: #7cc49a; background: var(--sp-present-bg); color: var(--sp-present-fg); }
.sp-step-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--sp-neutral-bg); color: var(--sp-neutral-fg); font-size: 0.75rem; }
.sp-steps li.is-current .sp-step-n { background: #fff; color: var(--sp-deep); }
.sp-steps li.is-done .sp-step-n { background: var(--sp-present-fg); color: #fff; }
.sp-audience-summary { margin: 0 0 12px; font-weight: 600; }
.sp-audience-name { margin: 0 0 12px; font-weight: 600; overflow-wrap: anywhere; }
.sp-publish-actions { margin-top: 16px; }
.sp-next { margin: 0 0 16px; }
.sp-next p { margin: 0 0 12px; }
.sp-instructions { margin: 0 0 16px; padding-left: 22px; }
.sp-instructions li { list-style: decimal; margin: 0 0 6px; }
.sp-qr { display: block; margin: 0 0 8px; padding: 8px; border: 1px solid var(--sp-border); border-radius: var(--sp-radius-sm); background: #fff; max-width: 100%; height: auto; }
.sp-tokens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin: 16px 0 4px; padding: 0; list-style: none; counter-reset: token; }
.sp-tokens li { counter-increment: token; list-style: none; padding: 8px 12px; border: 1px solid var(--sp-border); border-radius: var(--sp-radius-sm); background: #fff; }
.sp-tokens li::before { content: counter(token) ". "; color: var(--sp-muted); font-size: 0.875rem; }
.sp-tokens code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 1.125rem; letter-spacing: 0.06em; overflow-wrap: anywhere; }

/* Staff sign-in: the stock card, in the office palette, sized for a phone. */
body.login { background: var(--sp-canvas); }
body.login #container { width: auto; max-width: 28rem; min-width: 0; margin: 24px auto; border: none; border-radius: var(--sp-radius); background: transparent; overflow: visible; box-shadow: none; }
body.login #container > #header { justify-content: center; border-radius: var(--sp-radius) var(--sp-radius) 0 0; }
body.login #content { padding: 24px 24px 28px; background: #fff; border: 1px solid var(--sp-hairline); border-top: none; border-radius: 0 0 var(--sp-radius) var(--sp-radius); box-shadow: var(--sp-shadow); }
.sp-login-title { margin: 0 0 6px; }
body.login #content h1 { margin: 0 0 6px; }
.sp-login .sp-field { margin-bottom: 18px; }
.sp-login .sp-field input[type="text"], .sp-login .sp-field input[type="password"], .sp-login .sp-field select { width: 100%; box-sizing: border-box; min-height: 48px; font-size: 1rem; }
.sp-login ul.errorlist { margin: 0 0 6px; padding: 0; list-style: none; color: var(--error-fg); font-weight: 600; font-size: 0.875rem; }
.sp-login ul.errorlist li { list-style: none; background: none; padding: 0; }
.sp-login-actions { flex-direction: column; align-items: stretch; margin-top: 8px; }
.sp-login-actions .sp-btn { width: 100%; min-height: 48px; }
body.login .errornote { margin: 0; padding: 12px 24px; border-radius: 0; border: 1px solid var(--sp-hairline); border-bottom: none; border-left: 4px solid var(--error-fg); background: #fff6f5; color: var(--error-fg); font-weight: 600; }

@media (max-width: 640px) {
  .sp-tokens { grid-template-columns: 1fr; }
  body.login { padding: 0 10px; }
  body.login #container { margin: 12px auto; }
  body.login #content { padding: 20px 16px 24px; }
  body.login .errornote { padding: 12px 16px; }
  /* The flash message already confirms each save; the bar keeps only its two buttons. */
  .sp-bar-status { display: none; }
  /* Three columns, number above label: the progress takes ~60px, not ~140px, so the
     sticky action bar below fits on a short phone. */
  .sp-steps { flex-wrap: nowrap; gap: 6px; }
  .sp-steps li { flex: 1 1 0; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; padding: 8px 4px; border-radius: 12px; text-align: center; font-size: 0.75rem; line-height: 1.2; }
}
@media print {
  /* Recovery tokens: the sheet alone. No menu, no QR code, no secret. */
  body.sp-provision .sp-qr, body.sp-provision form { display: none !important; }
  body.sp-provision #content, body.sp-provision .main { padding: 0; }
  .sp-tokens-sheet { border: 2px solid #000; border-radius: 0; box-shadow: none; padding: 16px; break-inside: avoid; }
  .sp-tokens li { border: 1px solid #000; border-radius: 0; }
  .sp-tokens code { font-size: 15pt; }
}

/* A grid child never forces its column wider than the screen: the native file input
   and long words otherwise hold the whole page open on a 320px phone. */
.sp-page > *, .sp-compose > * { min-width: 0; }
.sp-field input[type="file"] { width: 100%; max-width: 100%; box-sizing: border-box; }

/* `.sp-btn { display: inline-flex }` beats the browser's [hidden] rule, which would
   show a Print button that does nothing when scripts are off. */
.sp-btn[hidden] { display: none; }
