/* ==========================================================================
   Family Tasks — design system
   Shares the Daily Spelling design language (warm paper, Nunito, soft
   cards) with its own deep-blue primary and the same warm amber accent, off-white paper background, generous radii, soft shadows.
   Built on top of Bootstrap 5 (CDN) — targeted overrides only, no build step.
   ========================================================================== */

:root {
  /* Palette */
  --st-primary: #2457a6; /* deep blue */
  --st-primary-dark: #1c4585;
  --st-primary-soft: #dce7f7; /* soft blue wash */
  --st-primary-softer: #eef3fb;
  --st-accent: #b45309; /* warm amber (text-safe) */
  --st-accent-soft: #fdf1d7; /* hint / warm wash */
  --st-accent-border: #f4d48c;
  --st-green: #2e7d4f; /* gentle success */
  --st-green-dark: #22613d;
  --st-green-soft: #ddf2e4;
  --st-red: #b23b3b;
  --st-red-soft: #fbe9e7;
  --st-ink: #33302b; /* warm near-black */
  --st-muted: #6f675b; /* warm gray, AA on paper */
  --st-paper: #faf6f0; /* page background */
  --st-card: #ffffff;
  --st-line: #eae3d8; /* hairline borders */
  --st-line-strong: #ddd4c6;

  /* Shape + depth */
  --st-radius-lg: 1.15rem;
  --st-radius: 0.75rem;
  --st-radius-sm: 0.55rem;
  --st-shadow:
    0 1px 2px rgba(51, 48, 43, 0.05), 0 6px 18px rgba(51, 48, 43, 0.07);
  --st-shadow-lg:
    0 2px 4px rgba(51, 48, 43, 0.05), 0 14px 34px rgba(51, 48, 43, 0.1);

  /* Typography */
  --st-font:
    'Nunito', -apple-system, blinkmacsystemfont, 'Segoe UI', roboto,
    'Helvetica Neue', arial, sans-serif;

  /* Remap the Bootstrap tokens we lean on */
  --bs-primary: var(--st-primary);
  --bs-primary-rgb: 36, 87, 166;
  --bs-success: var(--st-green);
  --bs-success-rgb: 46, 125, 79;
  --bs-danger: var(--st-red);
  --bs-danger-rgb: 178, 59, 59;
  --bs-body-font-family: var(--st-font);
  --bs-body-bg: var(--st-paper);
  --bs-body-color: var(--st-ink);
  --bs-border-radius: var(--st-radius);
  --bs-link-color: var(--st-primary);
  --bs-link-hover-color: var(--st-primary-dark);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

body {
  font-family: var(--st-font);
  background-color: var(--st-paper);
  color: var(--st-ink);
  font-size: 1.02rem;
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  font-weight: 800;
  color: var(--st-ink);
  letter-spacing: -0.01em;
}

a {
  color: var(--st-primary);
}

a:hover {
  color: var(--st-primary-dark);
}

.text-secondary,
.text-muted {
  color: var(--st-muted) !important;
}

:focus-visible {
  outline: 3px solid rgba(36, 87, 166, 0.45);
  outline-offset: 2px;
}

main.st-main {
  padding-bottom: 4rem;
}

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */

.st-navbar {
  background: var(--st-card);
  border-bottom: 1px solid var(--st-line);
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.st-navbar .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--st-ink);
}

.st-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.7rem;
  background: linear-gradient(135deg, var(--st-primary) 0%, #3a74c9 100%);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(36, 87, 166, 0.35);
}

.st-navbar .nav-link {
  color: var(--st-ink);
  font-weight: 700;
  border-radius: var(--st-radius-sm);
  padding: 0.4rem 0.85rem;
}

.st-navbar .nav-link:hover,
.st-navbar .nav-link:focus {
  color: var(--st-primary-dark);
  background: var(--st-primary-softer);
}

.st-navbar .nav-link.active {
  color: var(--st-primary-dark);
  background: var(--st-primary-soft);
}

.st-navbar .dropdown-menu {
  border: 1px solid var(--st-line);
  border-radius: var(--st-radius);
  box-shadow: var(--st-shadow);
  overflow: hidden;
}

.st-navbar .dropdown-item {
  font-weight: 600;
  padding: 0.5rem 1rem;
}

.st-navbar .dropdown-item:hover,
.st-navbar .dropdown-item:focus {
  background: var(--st-primary-softer);
  color: var(--st-primary-dark);
}

.st-navbar .navbar-toggler {
  border-color: var(--st-line-strong);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  font-weight: 700;
  border-radius: var(--st-radius);
  padding: 0.45rem 1.1rem;
}

.btn-lg {
  border-radius: 0.9rem;
  padding: 0.65rem 1.6rem;
}

.btn-sm {
  border-radius: var(--st-radius-sm);
}

.btn-primary {
  --bs-btn-bg: var(--st-primary);
  --bs-btn-border-color: var(--st-primary);
  --bs-btn-hover-bg: var(--st-primary-dark);
  --bs-btn-hover-border-color: var(--st-primary-dark);
  --bs-btn-active-bg: var(--st-primary-dark);
  --bs-btn-active-border-color: var(--st-primary-dark);
  --bs-btn-disabled-bg: var(--st-primary);
  --bs-btn-disabled-border-color: var(--st-primary);
  --bs-btn-focus-shadow-rgb: 36, 87, 166;
  box-shadow: 0 2px 6px rgba(36, 87, 166, 0.25);
}

.btn-outline-primary {
  --bs-btn-color: var(--st-primary);
  --bs-btn-border-color: var(--st-primary);
  --bs-btn-hover-bg: var(--st-primary);
  --bs-btn-hover-border-color: var(--st-primary);
  --bs-btn-active-bg: var(--st-primary);
  --bs-btn-active-border-color: var(--st-primary);
  --bs-btn-focus-shadow-rgb: 36, 87, 166;
}

.btn-success {
  --bs-btn-bg: var(--st-green);
  --bs-btn-border-color: var(--st-green);
  --bs-btn-hover-bg: var(--st-green-dark);
  --bs-btn-hover-border-color: var(--st-green-dark);
  --bs-btn-active-bg: var(--st-green-dark);
  --bs-btn-active-border-color: var(--st-green-dark);
  --bs-btn-focus-shadow-rgb: 46, 125, 79;
}

.btn-danger {
  --bs-btn-bg: var(--st-red);
  --bs-btn-border-color: var(--st-red);
  --bs-btn-hover-bg: #96312f;
  --bs-btn-hover-border-color: #96312f;
  --bs-btn-active-bg: #96312f;
  --bs-btn-active-border-color: #96312f;
}

.btn-outline-danger {
  --bs-btn-color: var(--st-red);
  --bs-btn-border-color: #d9a4a4;
  --bs-btn-hover-bg: var(--st-red);
  --bs-btn-hover-border-color: var(--st-red);
  --bs-btn-active-bg: var(--st-red);
  --bs-btn-active-border-color: var(--st-red);
}

.btn-outline-secondary {
  --bs-btn-color: var(--st-muted);
  --bs-btn-border-color: var(--st-line-strong);
  --bs-btn-hover-bg: #f1ece3;
  --bs-btn-hover-border-color: var(--st-line-strong);
  --bs-btn-hover-color: var(--st-ink);
  --bs-btn-active-bg: #f1ece3;
  --bs-btn-active-border-color: var(--st-line-strong);
  --bs-btn-active-color: var(--st-ink);
}

/* Quiet action links on cards (Word list / Progress / Settings) */
.btn-quiet {
  --bs-btn-color: var(--st-primary);
  --bs-btn-bg: var(--st-primary-softer);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-bg: var(--st-primary-soft);
  --bs-btn-hover-color: var(--st-primary-dark);
  --bs-btn-active-bg: var(--st-primary-soft);
  --bs-btn-active-color: var(--st-primary-dark);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.card {
  border: 1px solid var(--st-line);
  border-radius: var(--st-radius-lg);
  background: var(--st-card);
}

.card.shadow-sm,
.st-card {
  box-shadow: var(--st-shadow) !important;
}

.card-footer {
  border-top: 1px solid var(--st-line);
  background: transparent;
  border-bottom-left-radius: var(--st-radius-lg) !important;
  border-bottom-right-radius: var(--st-radius-lg) !important;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form-control,
.form-select {
  border-radius: var(--st-radius);
  border-color: var(--st-line-strong);
  padding: 0.5rem 0.85rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--st-primary);
  box-shadow: 0 0 0 0.25rem rgba(36, 87, 166, 0.15);
}

.form-label {
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Alerts / messages
   -------------------------------------------------------------------------- */

.alert {
  border-radius: var(--st-radius);
  border: 1px solid transparent;
  font-weight: 600;
}

.alert-success {
  background: var(--st-green-soft);
  border-color: #b9e2c6;
  color: var(--st-green-dark);
}

.alert-info {
  background: var(--st-primary-softer);
  border-color: #c4d6f0;
  color: var(--st-primary-dark);
}

.alert-warning {
  background: var(--st-accent-soft);
  border-color: var(--st-accent-border);
  color: #8a4a06;
}

.alert-danger,
.alert-error {
  background: var(--st-red-soft);
  border-color: #eec5c0;
  color: #96312f;
}

/* --------------------------------------------------------------------------
   Chips
   -------------------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.st-table-card {
  background: var(--st-card);
  border: 1px solid var(--st-line);
  border-radius: var(--st-radius-lg);
  box-shadow: var(--st-shadow);
  overflow: hidden;
}

.st-table-card .table {
  margin-bottom: 0;
}

.table {
  --bs-table-hover-bg: #faf7f1;
  color: var(--st-ink);
}

.table thead th {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--st-muted);
  background: #f6f1e9;
  border-bottom: 1px solid var(--st-line);
  padding: 0.65rem 1rem;
}

.table tbody td {
  padding: 0.7rem 1rem;
  border-color: var(--st-line);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

/* Result markers (summary + progress) — color plus text, never color alone */
.result-good {
  color: var(--st-green-dark);
  font-weight: 700;
}

.result-ok {
  color: var(--st-accent);
  font-weight: 700;
}

.result-miss {
  color: var(--st-red);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Landing hero
   -------------------------------------------------------------------------- */

.st-hero {
  text-align: center;
  padding: 4.5rem 1rem 3rem;
}

.st-hero-badge {
  display: inline-block;
  background: var(--st-accent-soft);
  color: var(--st-accent);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.st-hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.st-hero h1 .accent {
  color: var(--st-primary);
}

.st-hero .lead {
  max-width: 38rem;
  margin: 0 auto 2rem;
  color: var(--st-muted);
  font-size: 1.15rem;
  font-weight: 600;
}

.st-feature-card {
  background: var(--st-card);
  border: 1px solid var(--st-line);
  border-radius: var(--st-radius-lg);
  box-shadow: var(--st-shadow);
  padding: 1.75rem 1.5rem;
  height: 100%;
  text-align: center;
}

.st-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 1rem;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.st-feature-icon.tint-blue {
  background: var(--st-primary-soft);
}

.st-feature-icon.tint-amber {
  background: var(--st-accent-soft);
}

.st-feature-icon.tint-green {
  background: var(--st-green-soft);
}

.st-feature-card h3 {
  font-size: 1.08rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.st-feature-card p {
  color: var(--st-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Avatars, empty states, steps, callouts
   -------------------------------------------------------------------------- */

.st-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 50%;
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.st-avatar-0 {
  background: linear-gradient(135deg, #2457a6, #3a74c9);
}

.st-avatar-1 {
  background: linear-gradient(135deg, #b45309, #d97a1f);
}

.st-avatar-2 {
  background: linear-gradient(135deg, #6d5db4, #8a7ad1);
}

.st-avatar-3 {
  background: linear-gradient(135deg, #b34a72, #d0688f);
}

.st-avatar-4 {
  background: linear-gradient(135deg, #2e7d4f, #47a06c);
}

/* Onboarding / empty states */
.st-empty {
  max-width: 34rem;
  margin: 3rem auto;
  text-align: center;
}

.st-empty-art {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 1rem;
}

.st-steps {
  list-style: none;
  counter-reset: st-step;
  padding: 0;
  margin: 1.75rem 0;
  text-align: left;
}

.st-steps li {
  counter-increment: st-step;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.6rem 0;
}

.st-steps li::before {
  content: counter(st-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--st-primary-soft);
  color: var(--st-primary-dark);
  font-weight: 800;
  flex-shrink: 0;
}

.st-steps strong {
  display: block;
}

.st-steps span {
  color: var(--st-muted);
  font-size: 0.95rem;
}

/* Soft callout (e.g. "ready to practice" pointer) */
.st-callout {
  background: var(--st-primary-softer);
  border: 1px solid #c4d6f0;
  border-radius: var(--st-radius-lg);
  padding: 1.1rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.st-callout p {
  margin: 0;
  font-weight: 600;
  color: var(--st-primary-dark);
}

/* --------------------------------------------------------------------------
   Auth (allauth entrance) pages
   -------------------------------------------------------------------------- */

.st-auth-wrap {
  max-width: 26.5rem;
  margin: 3rem auto 4rem;
  padding: 0 1rem;
}

.st-auth-card {
  background: var(--st-card);
  border: 1px solid var(--st-line);
  border-radius: var(--st-radius-lg);
  box-shadow: var(--st-shadow-lg);
  padding: 2.25rem 2rem;
}

.st-auth-card h1 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.st-auth-card .btn {
  width: 100%;
  margin-top: 0.5rem;
}

.st-auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.st-auth-brand .st-brand-mark {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  font-size: 1.5rem;
}

/* --------------------------------------------------------------------------
   Page headers
   -------------------------------------------------------------------------- */

.st-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0 1.5rem;
}

.st-page-header h1 {
  margin: 0;
  font-size: 1.65rem;
}

.st-page-header .subtitle {
  color: var(--st-muted);
  font-weight: 600;
  margin: 0.15rem 0 0;
}


/* ==========================================================================
   Family Tasks — app
   ========================================================================== */

.st-brand-mark svg {
  width: 1.2rem;
  height: 1.2rem;
}

.st-navbar .nav-link svg {
  width: 1.05rem;
  height: 1.05rem;
  margin-right: 0.3rem;
  vertical-align: -0.15rem;
}

.st-feature-icon svg {
  width: 1.6rem;
  height: 1.6rem;
}

.tint-blue svg {
  color: var(--st-primary);
}

.tint-amber svg {
  color: var(--st-accent);
}

.tint-green svg {
  color: var(--st-green);
}

.st-footer {
  border-top: 1px solid var(--st-line);
  color: var(--st-muted);
  font-size: 0.9rem;
  /* Only vertical: keep the container's side padding on small screens. */
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
}

.st-footer a {
  color: var(--st-muted);
  margin-right: 1.25rem;
}

/* Section cards (forms, settings) */
.st-section {
  background: var(--st-card);
  border: 1px solid var(--st-line);
  border-radius: var(--st-radius-lg);
  box-shadow: var(--st-shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.st-section h2 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.st-section .section-help {
  color: var(--st-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.st-narrow {
  max-width: 44rem;
}

.st-form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1.5rem;
}

.st-form-actions .ms-auto {
  margin-left: auto;
}

/* Radio / checkbox lists rendered as tappable pills */
.st-choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.st-choice-list label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--st-line-strong);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--st-card);
}

.st-choice-list input {
  accent-color: var(--st-primary);
}

.st-choice-list label:has(input:checked) {
  background: var(--st-primary-soft);
  border-color: var(--st-primary);
  color: var(--st-primary-dark);
}

/* Generic list rows (tasks, kids, rotations, seasons, breaks) */
.st-list {
  background: var(--st-card);
  border: 1px solid var(--st-line);
  border-radius: var(--st-radius-lg);
  box-shadow: var(--st-shadow);
  overflow: hidden;
}

.st-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--st-line);
}

.st-row:last-child {
  border-bottom: 0;
}

.st-row-main {
  flex: 1;
  min-width: 0;
}

.st-row-title {
  font-weight: 800;
  color: var(--st-ink);
  text-decoration: none;
}

a.st-row-title:hover {
  color: var(--st-primary-dark);
}

.st-row-meta {
  color: var(--st-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.st-row-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: var(--st-primary-softer);
  color: var(--st-primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.st-row.is-inactive .st-row-title {
  color: var(--st-muted);
}

.task-icon {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
}

.task-icon-lg {
  width: 2.4rem;
  height: 2.4rem;
}

.chip-muted {
  background: #efe9df;
  color: #635b4e;
}

.chip-blue {
  background: var(--st-primary-soft);
  color: var(--st-primary-dark);
}

.chip-amber {
  background: var(--st-accent-soft);
  color: var(--st-accent);
}

/* Filter bar */
.st-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.st-filters .form-control,
.st-filters .form-select {
  width: auto;
  min-width: 10rem;
}

/* Icon picker */
.icon-picker-current {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-picker-preview {
  width: 3rem;
  height: 3rem;
  border-radius: 0.9rem;
  border: 1px dashed var(--st-line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--st-ink);
  background: var(--st-card);
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.5rem;
  max-height: 22rem;
  overflow-y: auto;
  margin-top: 0.75rem;
}

.icon-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.6rem 0.25rem;
  border: 1px solid var(--st-line);
  border-radius: var(--st-radius);
  background: var(--st-card);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--st-muted);
  line-height: 1.2;
  text-align: center;
  word-break: break-word;
}

.icon-grid button:hover,
.icon-grid button:focus-visible {
  border-color: var(--st-primary);
  color: var(--st-primary-dark);
  background: var(--st-primary-softer);
}

.icon-grid .task-icon {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--st-ink);
}

/* Ordered pickers (rotation kids/tasks) */
.order-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.order-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--st-line);
  border-radius: var(--st-radius);
  margin-bottom: 0.4rem;
  background: var(--st-card);
}

.order-list li.is-selected {
  border-color: var(--st-primary);
  background: var(--st-primary-softer);
}

.order-list .order-num {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--st-primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.order-list li:not(.is-selected) .order-num {
  visibility: hidden;
}

.order-list label {
  flex: 1;
  font-weight: 700;
  margin: 0;
  cursor: pointer;
}

.order-list .btn {
  padding: 0.15rem 0.5rem;
}

/* Rotation turn tables */
.turns th,
.turns td {
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Week preview
   -------------------------------------------------------------------------- */

.week-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.75rem 0 1.25rem;
}

.week-toolbar h1 {
  font-size: 1.55rem;
  margin: 0;
}

.week-nav {
  display: inline-flex;
  gap: 0.35rem;
}

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

.week-side {
  position: sticky;
  top: 1rem;
}

.week-side .st-section {
  padding: 1.1rem 1.25rem;
}

.week-side h2 {
  font-size: 1rem;
}

.week-side ul {
  padding-left: 1.1rem;
  margin: 0;
  font-size: 0.92rem;
}

.sheet-card {
  margin-bottom: 1.75rem;
}

.sheet-card-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.sheet-card-bar h2 {
  font-size: 1.1rem;
  margin: 0;
}

/* The paper: a letter-landscape page with 0.4in margins, at real size,
   zoomed down by week.js to fit the screen. */
.sheet-paper {
  background: #fff;
  border-radius: 0.35rem;
  box-shadow: var(--st-shadow-lg);
  padding: 0.4in;
  width: 11in;
  transform-origin: top left;
}

.sheet-zoom {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   The printed sheet (screen preview and paper are the same layout)
   -------------------------------------------------------------------------- */

.sheet {
  --row: 0.32in;
  --scale: 1;
  --line: #9a9a9a;
  --ink: #000;
  --checkbox: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='3' y='5' width='10' height='10' rx='1.5' fill='none' stroke='black' stroke-width='1.3'/%3E%3C/svg%3E");

  width: 10.2in;
  height: 7.7in;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: #fff;
  font-family: var(--st-font);
  font-size: calc(10.5pt * var(--scale));
  line-height: 1.2;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.sheet-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 2.5px solid var(--ink);
  padding-bottom: 0.05in;
  margin-bottom: 0.1in;
}

.sheet-kid {
  font-size: calc(24pt * var(--scale));
  font-weight: 800;
  line-height: 1;
}

.sheet-meta {
  text-align: right;
  font-size: 10pt;
  font-weight: 700;
}

.sheet-meta .sheet-family {
  font-weight: 600;
  font-size: 9pt;
}

.sheet-box {
  border: 1.5px solid var(--ink);
  border-radius: 0.07in;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheet-box-title {
  font-weight: 800;
  font-size: 9pt;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.03in 0.08in;
  border-bottom: 1.5px solid var(--ink);
  height: 0.27in;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sheet-box-title .sheet-date {
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

/* Lined body: every row is a checkbox plus a writing line, drawn as a
   background so blank rows fill whatever space the tasks leave. */
.sheet-lines {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0 0.06in;
  background-image:
    var(--checkbox), linear-gradient(to top, var(--line) 0.75px, transparent 0.75px);
  background-size:
    var(--row) var(--row),
    100% var(--row);
  background-repeat: repeat-y;
  background-position:
    0.04in 0,
    0 0;
  background-origin: content-box;
}

.sheet-item {
  position: relative;
  background: #fff;
  min-height: var(--row);
  line-height: var(--row);
  padding-left: calc(var(--row) + 0.02in);
  border-bottom: 0.75px solid var(--line);
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* A wrapped title spans two rows; its line-height keeps rows aligned. */
.sheet-item::before {
  content: '';
  position: absolute;
  left: 0.04in;
  top: 0;
  width: var(--row);
  height: var(--row);
  background: var(--checkbox) no-repeat 0 0 / var(--row) var(--row);
}

.sheet-item .task-icon {
  width: calc(var(--row) * 0.62);
  height: calc(var(--row) * 0.62);
  margin-right: 0.04in;
  vertical-align: -0.2em;
  color: var(--ink);
}

.sheet-weekly {
  height: calc(0.27in + var(--row) * 3 + 3px);
  margin-bottom: 0.1in;
  flex-shrink: 0;
}

.sheet-weekly-cols {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sheet-weekly-cols .sheet-lines + .sheet-lines {
  border-left: 0.75px solid var(--line);
}

.sheet-days {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.07in;
}

.sheet-day.is-overflowing {
  outline: 3px solid var(--st-red);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Print: only the sheets, one per page
   -------------------------------------------------------------------------- */

@page {
  size: letter landscape;
  margin: 0.4in;
}

@media print {
  body {
    background: #fff !important;
  }

  body > :not(main),
  .st-main > :not(.week-print-root),
  .week-print-root > :not(.week-layout),
  .week-layout > :not(.week-sheets),
  .sheet-card-bar {
    display: none !important;
  }

  .st-main,
  .week-layout,
  .week-sheets {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: auto !important;
  }

  .sheet-card {
    margin: 0;
    break-after: page;
  }

  .sheet-card:last-child {
    break-after: auto;
  }

  .sheet-zoom {
    height: auto !important;
    overflow: visible;
  }

  .sheet-paper {
    transform: none !important;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    width: auto;
  }

  .sheet-day.is-overflowing {
    outline: 0;
  }
}

/* --------------------------------------------------------------------------
   Landing sample sheet
   -------------------------------------------------------------------------- */

.st-sample {
  max-width: 62rem;
  margin: 0 auto 4rem;
}

.st-sample .sheet-paper {
  box-shadow:
    0 2px 4px rgba(51, 48, 43, 0.06),
    0 24px 60px rgba(51, 48, 43, 0.16);
}

.st-sample-caption {
  text-align: center;
  color: var(--st-muted);
  font-weight: 600;
  margin-top: 1rem;
}

@media (max-width: 991.98px) {
  .week-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .week-side {
    position: static;
  }
}

.ui-icon {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.15em;
}

.st-features {
  max-width: 62rem;
}

/* Error pages */
.st-error {
  max-width: 32rem;
  margin: 4rem auto;
  text-align: center;
}

.st-error-code {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--st-primary);
  margin-bottom: 0.5rem;
}
