/* Snowy Studio -- hand-written stylesheet (no framework, no build step).
   Theming via CSS custom properties. Dark mode by OS preference only. */

/* ----------------------------------------------------------------- Tokens */
:root {
  --color-bg: #ffffff;
  --color-surface: #f9fafb;
  --color-surface-2: #f3f4f6;
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-border: #d1d5db;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-contrast: #ffffff;
  --color-danger: #dc2626;
  --color-danger-hover: #b91c1c;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-info: #2563eb;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
  --sidebar-w: 240px;
  --maxw: 1100px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-surface-2: #334155;
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-border: #334155;
    --color-primary: #3b82f6;
    --color-primary-hover: #60a5fa;
    --color-danger: #ef4444;
    --color-danger-hover: #f87171;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-info: #60a5fa;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  }
}

/* ------------------------------------------------------------------ Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
}

[x-cloak] { display: none !important; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; font-weight: 700; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

.muted { color: var(--color-text-muted); }
.inline-form { display: inline; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--color-surface-2);
  color: var(--color-text);
  transition: background-color 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--color-primary); color: var(--color-primary-contrast); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: var(--color-danger-hover); }
.btn-ghost { background: transparent; border-color: var(--color-border); color: var(--color-text); }
.btn-ghost:hover { background: var(--color-surface-2); }
.btn-lg { padding: 0.75rem 1.4rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------ Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.notice { border-left: 4px solid var(--color-primary); }

.stat-card { display: flex; flex-direction: column; gap: 0.35rem; }
.stat-label { font-size: 0.8rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 1.4rem; font-weight: 700; }

/* ------------------------------------------------------------------ Forms */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label { font-size: 0.9rem; font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], input[type="search"],
input[type="date"], input[type="time"], select, textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-color: var(--color-primary);
}
.errorlist { list-style: none; color: var(--color-danger); font-size: 0.85rem; }
ul.errorlist li { margin-top: 0.2rem; }

/* ------------------------------------------------------- Marketing layout */
.site-nav {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-nav-inner, .site-footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.site-nav-links { display: flex; gap: 1rem; margin-left: 1rem; }
.site-nav-links a { color: var(--color-text); }
.site-nav-actions { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--color-text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px;
  display: inline-block;
  flex-shrink: 0;
}
.site-main { min-height: 60vh; }

.site-footer { border-top: 1px solid var(--color-border); margin-top: 3rem; }
.site-footer-inner { display: block; color: var(--color-text-muted); font-size: 0.9rem; }

.hero { padding: 4rem 1.25rem; }
.hero-inner { max-width: 720px; margin: 0 auto; text-align: center; }
.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.hero-sub { font-size: 1.2rem; color: var(--color-text-muted); margin-bottom: 1.75rem; }

/* Hero typewriter rotator */
.hero-rotator .hero-line { display: block; }
.typewriter { color: var(--color-primary); white-space: nowrap; }
.typewriter-word { font-style: italic; }
.typewriter-caret {
  display: inline-block;
  width: 0.06em;
  height: 1em;
  margin-left: 0.06em;
  vertical-align: -0.12em;
  background-color: currentColor;
  opacity: 0;
}
.typewriter.is-animating .typewriter-caret {
  opacity: 1;
  animation: typewriter-blink 1s step-end infinite;
}
@keyframes typewriter-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .typewriter-caret { display: none; }
}
.hero-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 1rem; color: var(--color-text-muted); font-size: 0.9rem; }

/* ----------------------------------------------------------- Auth screens */
.auth-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { margin-bottom: 0.5rem; }
.auth-card .muted { margin-bottom: 1.25rem; }
.auth-alt { margin-top: 1rem; font-size: 0.9rem; color: var(--color-text-muted); }

.studio-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.studio-list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.9rem 1rem; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); color: var(--color-text);
}
.studio-list-item:hover { background: var(--color-surface-2); text-decoration: none; }
.studio-list-role { color: var(--color-text-muted); font-size: 0.85rem; }

/* ------------------------------------------------------------- App shell */
.app-body { background: var(--color-bg); }
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 1rem;
}
.app-sidebar-head { padding: 0.25rem 0.25rem 0.75rem; border-bottom: 1px solid var(--color-border); }
.app-nav { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.app-nav-link {
  padding: 0.55rem 0.75rem; border-radius: var(--radius-sm);
  color: var(--color-text); font-weight: 500;
}
.app-nav-link:hover { background: var(--color-surface-2); text-decoration: none; }
.app-nav-upgrade { color: var(--color-primary); }
.app-sidebar-foot { border-top: 1px solid var(--color-border); padding-top: 0.75rem; }

.app-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.app-topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  position: sticky; top: 0; z-index: 10;
}
.app-topbar-title { font-weight: 700; }
.app-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.app-user { color: var(--color-text-muted); font-size: 0.9rem; }
.app-main { padding: 1.5rem 1.25rem; flex: 1; }
.page { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.25rem; }
.page-head h1 { margin-bottom: 0.25rem; }

.trial-badge {
  font-size: 0.8rem; font-weight: 600;
  padding: 0.25rem 0.6rem; border-radius: 999px;
  background: var(--color-surface-2); color: var(--color-text-muted);
}

.app-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 0.25rem; }
.app-menu-bars, .app-menu-bars::before, .app-menu-bars::after {
  display: block; width: 22px; height: 2px; background: var(--color-text); position: relative;
}
.app-menu-bars::before, .app-menu-bars::after { content: ""; position: absolute; left: 0; }
.app-menu-bars::before { top: -7px; }
.app-menu-bars::after { top: 7px; }


/* ---------------------------------------------------------------- Toasts */
.toast-stack {
  position: fixed; top: 1rem; right: 1rem; z-index: 50;
  display: flex; flex-direction: column; gap: 0.5rem; max-width: 360px;
}
.toast {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  background: var(--color-surface); border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg); border-left-width: 4px;
}
.toast-body { flex: 1; font-size: 0.9rem; }
.toast-close { background: none; border: none; cursor: pointer; font-size: 1.1rem; color: var(--color-text-muted); }
.toast-success { border-left-color: var(--color-success); }
.toast-error { border-left-color: var(--color-danger); }
.toast-warning { border-left-color: var(--color-warning); }
.toast-info, .toast-debug { border-left-color: var(--color-info); }

/* ---------------------------------------------------------------- Modals */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0, 0, 0, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
}
.modal {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 1.5rem; max-width: 460px; width: 100%;
  box-shadow: var(--shadow-lg);
}
.modal-message { margin-bottom: 1.25rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; }

/* ----------------------------------------------------------- Responsive */
@media (max-width: 820px) {
  .app-menu-btn { display: block; }
  .app-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    transform: translateX(-100%); transition: transform 0.2s ease;
  }
  .app-sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .hero h1 { font-size: 2rem; }
}

/* ============================================================ Marketing */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.container.narrow { max-width: 760px; }
.container-md { max-width: 820px; margin: 0 auto; padding: 0 1.25rem; }

.marketing-section { padding: 3.5rem 0; }
.marketing-section.alt { background: var(--color-surface); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 2.25rem; }
.section-head h1 { font-size: 2.25rem; margin-bottom: 0.6rem; }
.section-head h2 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.section-cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; font-weight: 600; }

/* Stats band */
.stats-band { background: var(--color-surface); padding: 2.25rem 0; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem; text-align: center; }
.stat { display: flex; flex-direction: column; gap: 0.25rem; }
.stat-num { font-size: 1.9rem; font-weight: 800; color: var(--color-primary); }
.stat-cap { font-size: 0.9rem; }

/* Problem + feature grids */
.problem-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; }
.problem-card h3 { margin-bottom: 0.5rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.feature-card h3 { margin-bottom: 0.4rem; }

.feature-group { margin-bottom: 2rem; }
.feature-group h2 { margin-bottom: 0.75rem; border-bottom: 1px solid var(--color-border); padding-bottom: 0.4rem; }

.check-list { list-style: none; display: grid; gap: 0.6rem; }
.check-list li { position: relative; padding-left: 1.6rem; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 0.45em;
  width: 0.7rem; height: 0.4rem; border-left: 2px solid var(--color-success);
  border-bottom: 2px solid var(--color-success); transform: rotate(-45deg);
}

/* CTA band */
.cta-band { text-align: center; background: var(--color-surface); }
.cta-band h2 { font-size: 1.9rem; margin-bottom: 0.5rem; }
.cta-band .hero-actions { margin-top: 1.5rem; }

/* Waitlist inline form */
.waitlist { margin-top: 1.75rem; }
.waitlist-lead { margin-bottom: 0.6rem; font-size: 0.9rem; }
.waitlist-row { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.waitlist-row input[type="email"] { max-width: 320px; }
.form-success-inline { color: var(--color-success); font-weight: 600; }

/* Pricing */
.billing-toggle {
  display: inline-flex; gap: 0.25rem; margin: 0 auto 2rem; padding: 0.25rem;
  background: var(--color-surface-2); border-radius: 999px;
  position: relative; left: 50%; transform: translateX(-50%);
}
.toggle-opt {
  border: none; background: transparent; cursor: pointer; font: inherit;
  padding: 0.5rem 1.1rem; border-radius: 999px; color: var(--color-text-muted);
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.toggle-opt.active { background: var(--color-bg); color: var(--color-text); box-shadow: var(--shadow); }
.toggle-badge { font-size: 0.7rem; color: var(--color-success); font-weight: 700; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; max-width: 760px; margin: 0 auto; }
.pricing-card { position: relative; display: flex; flex-direction: column; gap: 0.75rem; }
.pricing-card.is-highlight { border-color: var(--color-primary); box-shadow: 0 0 0 1px var(--color-primary), var(--shadow); }
.pricing-flag {
  position: absolute; top: -0.7rem; right: 1rem; background: var(--color-primary);
  color: #fff; font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 999px;
}
.pricing-blurb { min-height: 2.6em; }
.pricing-amount { display: flex; align-items: baseline; gap: 0.1rem; }
.price-currency { font-size: 1.3rem; font-weight: 700; }
.price-value { font-size: 2.6rem; font-weight: 800; }
.price-period { color: var(--color-text-muted); font-weight: 600; }
.price-foot { font-size: 0.85rem; margin-top: -0.4rem; }

.promise { max-width: 760px; margin: 2.25rem auto 0; border-left: 4px solid var(--color-success); }
.promise h3 { margin-bottom: 0.4rem; }

.sms-packs { max-width: 760px; margin: 2.5rem auto 0; text-align: center; }
.sms-packs h2 { margin-bottom: 0.4rem; }
.sms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.sms-card { display: flex; flex-direction: column; gap: 0.3rem; align-items: center; }
.sms-name { font-weight: 700; }
.sms-price { font-size: 1.4rem; font-weight: 800; }
.sms-texts { font-size: 0.85rem; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; background: var(--color-bg); }
.faq-item summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item[open] summary { margin-bottom: 0.6rem; }

/* Forms / contact */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-success { text-align: center; display: flex; flex-direction: column; gap: 0.75rem; align-items: center; }

/* Prose / legal */
.prose { display: flex; flex-direction: column; gap: 0.5rem; }
.prose h2 { font-size: 1.25rem; margin-top: 1.5rem; }
.prose p, .prose ul { margin-bottom: 0.5rem; }
.prose ul { padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.3rem; }
.legal h1 { margin-bottom: 0.25rem; }
.legal .updated { margin-bottom: 1.5rem; }

/* Footer links */
.site-footer-links { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; margin-bottom: 1rem; }
.site-footer-links a { color: var(--color-text-muted); font-size: 0.9rem; }

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

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .section-head h1 { font-size: 1.75rem; }
}

/* ============================================================ Billing */
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; padding: 0.85rem 1.1rem; border-radius: var(--radius-sm);
  margin-bottom: 1.25rem; border: 1px solid var(--color-border);
}
.banner-warning { background: color-mix(in srgb, var(--color-warning) 14%, var(--color-bg)); border-left: 4px solid var(--color-warning); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.current-plan-badge {
  display: inline-block; padding: 0.4rem 0.8rem; border-radius: var(--radius-sm);
  background: var(--color-surface-2); color: var(--color-text-muted); font-weight: 600;
  text-align: center;
}

/* ===================================================== Vertical settings */
.settings-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; align-items: start; }
.vertical-preview { display: flex; flex-direction: column; gap: 1.25rem; }
.preview-block h3 { margin-bottom: 0.6rem; }
.preview-terms { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }
.preview-terms li { display: flex; justify-content: space-between; gap: 1rem; }
.preview-features { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.preview-features li { display: flex; align-items: center; gap: 0.5rem; }
.feat-dot { width: 0.6rem; height: 0.6rem; border-radius: 999px; background: var(--color-border); display: inline-block; }
.preview-features li.is-on .feat-dot { background: var(--color-success); }
.preview-features li.is-off { color: var(--color-text-muted); }
.small { font-size: 0.85rem; }
@media (max-width: 820px) { .settings-grid { grid-template-columns: 1fr; } }

/* ============================================================ Families CRM */
.list-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.head-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.narrow-page { max-width: 680px; }
.list-filters { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.25rem; }
.list-filters input[type="search"] { flex: 1; min-width: 200px; }
.list-filters select { max-width: 180px; }

.table-card { padding: 0; overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--color-border); }
.data-table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); }
.data-table tbody tr:last-child td { border-bottom: none; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--color-surface-2); }
.clickable-row a { position: relative; z-index: 1; }
.empty-row { text-align: center; padding: 2rem 1rem; }

.pill { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--color-surface-2); color: var(--color-text-muted); }
.pill-active { background: color-mix(in srgb, var(--color-success) 18%, var(--color-bg)); color: var(--color-success); }
.pill-inactive, .pill-withdrawn { background: var(--color-surface-2); color: var(--color-text-muted); }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; align-items: start; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.row-item { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--color-border); }
.row-item:last-child { border-bottom: none; }

.flag-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.flag { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.flag-red { background: color-mix(in srgb, var(--color-danger) 18%, var(--color-bg)); color: var(--color-danger); }
.flag-amber { background: color-mix(in srgb, var(--color-warning) 18%, var(--color-bg)); color: var(--color-warning); }
.flag-green { background: color-mix(in srgb, var(--color-success) 18%, var(--color-bg)); color: var(--color-success); }
.flag-blue { background: color-mix(in srgb, var(--color-primary) 18%, var(--color-bg)); color: var(--color-primary); }
.flag-gray { background: var(--color-surface-2); color: var(--color-text-muted); }
.flag-add-form { display: flex; gap: 0.35rem; align-items: center; }
.flag-add-form input { max-width: 140px; }

.note-form { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.note-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.note-list li { padding: 0.6rem 0.75rem; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
.note-list li.pinned { border-left: 3px solid var(--color-primary); }
.form-actions { display: flex; gap: 0.6rem; margin-top: 0.5rem; }
.checkbox-group { flex-direction: row; align-items: center; gap: 0.5rem; }
.checkbox-group input { width: auto; }

/* Parent portal */
.portal-body { background: var(--color-bg); }
.portal-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--color-border); background: var(--color-surface); }
.portal-topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.portal-main { padding: 1.5rem 1.25rem; }
.portal-page { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.25rem; }
.portal-students { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; margin: 0.5rem 0; }

/* ============================================================ Classes */
.wide-page { max-width: 1100px; }
.simple-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.simple-list li { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px solid var(--color-border); }
.simple-list li:last-child { border-bottom: none; }
.swatch { width: 0.9rem; height: 0.9rem; border-radius: 4px; display: inline-block; }
.form-error { color: var(--color-danger); background: color-mix(in srgb, var(--color-danger) 10%, var(--color-bg)); border: 1px solid var(--color-danger); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; }
.meeting-list { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; max-height: 320px; overflow-y: auto; }
.meeting-list li.canceled { text-decoration: line-through; color: var(--color-text-muted); }

.cal-controls { display: flex; gap: 0.5rem; }
.cal-scroll { overflow-x: auto; padding: 0; }
.cal-grid { width: 100%; border-collapse: collapse; min-width: 760px; }
.cal-grid th, .cal-grid td { border: 1px solid var(--color-border); vertical-align: top; padding: 0.4rem; }
.cal-grid thead th { background: var(--color-surface-2); font-size: 0.8rem; text-align: center; padding: 0.5rem; }
.cal-rowhead { background: var(--color-surface-2); font-size: 0.85rem; white-space: nowrap; min-width: 120px; }
.cal-cell { width: 13%; height: 100%; }
.cal-class { display: flex; flex-direction: column; gap: 0.05rem; padding: 0.35rem 0.5rem; margin-bottom: 0.35rem; background: var(--color-bg); border: 1px solid var(--color-border); border-left: 3px solid var(--color-primary); border-radius: var(--radius-sm); color: var(--color-text); }
.cal-class:hover { background: var(--color-surface-2); text-decoration: none; }
.cal-time { font-size: 0.72rem; color: var(--color-text-muted); }
.cal-name { font-weight: 600; font-size: 0.85rem; }
.cal-meta { font-size: 0.72rem; }

/* ============================================================ Enrollment */
.add-student-form { margin-bottom: 1.25rem; }
.add-row { display: flex; gap: 0.5rem; margin-top: 0.4rem; }
.add-row select { flex: 1; }
.class-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.class-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.class-card-head h2 { font-size: 1.1rem; }
.enroll-row { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.enroll-row select { flex: 1; }
.embed-body { padding: 0.5rem; background: transparent; }
.embed-table { width: 100%; }

/* ============================================================ Attendance */
.meeting-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.meeting-card { display: flex; gap: 0.9rem; align-items: center; color: var(--color-text); }
.meeting-card:hover { background: var(--color-surface-2); text-decoration: none; }
.meeting-card-time { font-weight: 700; font-size: 1.1rem; color: var(--color-primary); min-width: 4.5rem; }
.meeting-card-body { display: flex; flex-direction: column; }

.att-roster { display: flex; flex-direction: column; }
.att-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--color-border); }
.att-row:last-child { border-bottom: none; }
.att-name { font-weight: 500; }
.att-buttons { display: flex; gap: 0.3rem; }
.att-btn { width: 2.4rem; height: 2.4rem; border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: var(--color-bg); color: var(--color-text-muted); font-weight: 700; cursor: pointer; }
.att-btn:hover { border-color: var(--color-primary); }
.att-present.is-active { background: var(--color-success); color: #fff; border-color: var(--color-success); }
.att-absent.is-active { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.att-late.is-active { background: var(--color-warning); color: #fff; border-color: var(--color-warning); }
.att-excused.is-active { background: var(--color-info); color: #fff; border-color: var(--color-info); }

.kiosk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
.kiosk-tile { min-height: 90px; border-radius: var(--radius); border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); font-size: 1.05rem; font-weight: 600; cursor: pointer; padding: 0.75rem; }
.kiosk-tile:hover { border-color: var(--color-primary); }
.kiosk-tile.is-done { background: var(--color-success); color: #fff; border-color: var(--color-success); cursor: default; }
.kiosk-check { font-size: 0.8rem; font-weight: 500; }
.clock-card { display: flex; flex-direction: column; gap: 0.75rem; align-items: flex-start; }

/* ============================================================ Billing */
.inline-pay { display: flex; gap: 0.3rem; align-items: center; }
.balance-tag { font-size: 0.95rem; }
.pill-paid { background: color-mix(in srgb, var(--color-success) 18%, var(--color-bg)); color: var(--color-success); }
.pill-open { background: color-mix(in srgb, var(--color-primary) 16%, var(--color-bg)); color: var(--color-primary); }
.pill-past_due, .pill-uncollectible { background: color-mix(in srgb, var(--color-danger) 16%, var(--color-bg)); color: var(--color-danger); }
.pill-draft, .pill-void { background: var(--color-surface-2); color: var(--color-text-muted); }

/* ============================================================ Messaging */
.pill-sent { background: color-mix(in srgb, var(--color-success) 18%, var(--color-bg)); color: var(--color-success); }
.pill-failed { background: color-mix(in srgb, var(--color-danger) 16%, var(--color-bg)); color: var(--color-danger); }
.pill-blocked_quota, .pill-skipped_optout { background: var(--color-surface-2); color: var(--color-text-muted); }
.thread { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; max-height: 420px; overflow-y: auto; }
.bubble { max-width: 80%; padding: 0.5rem 0.8rem; border-radius: var(--radius); }
.bubble-in { align-self: flex-start; background: var(--color-surface-2); }
.bubble-out { align-self: flex-end; background: var(--color-primary); color: #fff; }
.bubble-out .muted { color: rgba(255,255,255,0.8); }
.reply-form { display: flex; gap: 0.5rem; }
.reply-form textarea { flex: 1; }

/* ============================================================ Recitals */
.lineup { margin: 0; padding-left: 1.5rem; display: flex; flex-direction: column; gap: 0.35rem; }
.pill-planning { background: var(--color-surface-2); color: var(--color-text-muted); }
.pill-published { background: color-mix(in srgb, var(--color-success) 18%, var(--color-bg)); color: var(--color-success); }
.pill-completed { background: color-mix(in srgb, var(--color-primary) 16%, var(--color-bg)); color: var(--color-primary); }
.ticket-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--color-border); }

/* --- KPI dashboard cards (Slice 14 reports) --- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi { display: flex; flex-direction: column; gap: 0.35rem; }
.kpi-label { font-size: 0.85rem; color: var(--color-text-muted); }
.kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }

/* --- Leads pipeline board (Slice 15) --- */
.pipeline-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: 0.5rem; }
.pipeline-col { min-width: 180px; }
.pipeline-col-head { font-size: 0.95rem; margin-bottom: 0.5rem; }

.app-version { font-size: 0.75rem; color: var(--color-text-muted); }
