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

/* ── Tokens ── */
:root {
  --cream:         #FAF6EE;
  --white:         #FFFFFF;
  --ink:           #1F2335;
  --slate:         #6E7796;
  --border:        #E8E3D9;
  --primary:       #5562F4;
  --primary-hover: #4450E0;
  --primary-light: #EEEFFE;
  --red:           #E94B3C;
  --red-light:     #FEF2F1;
  --green:         #3D8F6E;
  --yellow:        #F59E0B;
  --sidebar-w:     240px;
  --header-h:      56px;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-full:   100px;
}

/* ── Brand loader ──
   The accent mark fills bottom-up across the periwinkle square, then clears
   and repeats. Used inline (via _brand_loader.html) and as a full-screen
   overlay that masks the white flash during page navigations. */
.db-loader { width: 6rem; height: 6rem; }
.db-loader__bar {
  stroke-dasharray: 295 295;   /* line length ≈ 294 (208 × √2) */
  stroke-dashoffset: 295;       /* start empty */
  animation: db-fill 1.2s ease-in-out infinite;
}
/* 295 → 0 fills from bottom-left; 0 → -295 clears out the top — one smooth loop */
@keyframes db-fill {
  from { stroke-dashoffset: 295; }
  to   { stroke-dashoffset: -295; }
}
@media (prefers-reduced-motion: reduce) {
  .db-loader__bar { animation: none; stroke-dashoffset: 0; }  /* static mark */
}

/* Full-screen loader: shown on the outgoing page during a navigation so the
   browser doesn't flash white before the next page paints. */
.db-fullscreen-loader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream);
}
.db-fullscreen-loader[hidden] { display: none; }

/* App pages reuse the overlay but only fade it in if the page is slow to load,
   so fast in-app navigations don't flash a loader. */
.db-fullscreen-loader--delayed { opacity: 0; animation: db-overlay-in 0.25s ease-out 0.15s forwards; }
@keyframes db-overlay-in { to { opacity: 1; } }

/* ── Base ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
}

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

/* ── Logo wordmark ── */
.logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.logo span { color: var(--primary); font-weight: 400; }
.logo:hover { text-decoration: none; }

/* ══════════════════════════════════════
   AUTH LAYOUT
══════════════════════════════════════ */
.auth-header {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}

.auth-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 61px);
  padding: 3rem 1.5rem;
}

.auth-form {
  width: 100%;
  max-width: 480px;
}

.auth-form h1 {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

/* ══════════════════════════════════════
   APP LAYOUT — DESKTOP SIDEBAR
══════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 10;
}

.sidebar-logo {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--slate);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.sidebar-nav a:hover { background: var(--cream); color: var(--ink); }
.sidebar-nav a.active { background: var(--primary-light); color: var(--primary); }
.sidebar-nav a svg { flex-shrink: 0; opacity: 0.75; }
.sidebar-nav a.active svg { opacity: 1; }

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

.sidebar-footer form button,
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--slate);
  font-size: 0.9rem;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.sidebar-footer form button:hover,
.sidebar-footer a:hover { background: var(--cream); color: var(--ink); }

/* Main content area */
.app-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-content {
  flex: 1;
  padding: 2.5rem 2.5rem;
  max-width: 760px;
}

/* ── Trial / alert banner ── */
.banner {
  padding: 0.75rem 2.5rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.banner-trial {
  background: var(--cream);
  color: var(--ink);
}
.banner-trial a { color: var(--primary); font-weight: 500; }
.banner-warning {
  background: var(--red-light);
  color: var(--red);
}
.banner-warning a { color: var(--red); font-weight: 600; text-decoration: underline; }

/* ── Page title ── */
.page-header { margin-bottom: 2rem; }
.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.page-header p {
  color: var(--slate);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* ══════════════════════════════════════
   MOBILE NAV
══════════════════════════════════════ */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.hamburger {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
}

/* Full-screen overlay nav */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 100;
  flex-direction: column;
}
.nav-overlay.open { display: flex; }

.nav-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.nav-overlay-links {
  flex: 1;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-overlay-links a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
}
.nav-overlay-links a.active { background: var(--primary-light); color: var(--primary); }
.nav-overlay-links a:hover { background: var(--cream); }

.nav-overlay-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
}
.nav-overlay-footer form button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--slate);
  font-size: 1rem;
  font-weight: 500;
  width: 100%;
}

/* ══════════════════════════════════════
   CARDS
══════════════════════════════════════ */
.card {
  background: var(--white);
  border: 1px solid rgba(31,35,53,0.1);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1F2335;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid rgba(31,35,53,0.1);
  border-radius: 16px;
  padding: 21px;
}

.stat-label {
  font-size: 0.625rem;
  font-weight: 400;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.111em;
}

.stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding-top: 0.75rem;
}

.stat-sub {
  font-size: 0.875rem;
  color: var(--slate);
  padding-left: 28px;
  padding-top: 4px;
}

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
  line-height: 1;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--primary);
  color: var(--white);
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost {
  background: transparent;
  color: var(--slate);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--cream); color: var(--ink); }

.btn-danger {
  background: var(--red);
  color: var(--white);
}
.btn-danger:hover { opacity: 0.88; }

.btn-full { width: 100%; }
.btn-lg { padding: 0.8rem 1.6rem; font-size: 1rem; }

/* ══════════════════════════════════════
   FORM INPUTS
══════════════════════════════════════ */
.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}
.field input,
.field select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--white);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
}
.field input:focus,
.field select:focus { border-color: var(--primary); }
.field input::placeholder { color: var(--slate); opacity: 0.6; }

.field-password { position: relative; }
.field-password input { padding-right: 2.75rem; }
.field-password .toggle-pw {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--slate);
  padding: 0.2rem;
  display: flex;
  align-items: center;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 7L11 1' stroke='%236E7796' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

/* ── Alerts ── */
.alert {
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}
.alert-error { background: var(--red-light); color: var(--red); }
.alert-success { background: var(--primary-light); color: var(--primary); }

/* ── Form footer text ── */
.form-links {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--slate);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ── Checkbox ── */
.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  cursor: pointer;
}
.checkbox-field input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.checkbox-field span { font-size: 0.875rem; color: var(--slate); line-height: 1.4; }

/* ══════════════════════════════════════
   SCHEDULE / DAY TOGGLES
══════════════════════════════════════ */
.day-toggles {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}
.day-toggle { position: relative; }
.day-toggle input[type="checkbox"] { display: none; }
.day-toggle span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  color: var(--slate);
}
.day-toggle input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.schedule-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}

/* ══════════════════════════════════════
   CONNECTED APPS / ACCOUNT
══════════════════════════════════════ */
.app-row {
  display: grid;
  /* Fixed status + actions columns so every row's status and buttons line up
     vertically, regardless of how many actions a row has. */
  grid-template-columns: 1.4fr 1fr 140px 168px;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  margin: 0 -1.5rem;
  border-bottom: 1px solid var(--border);
}
.app-row:last-child { border-bottom: none; }

.app-row-info { min-width: 0; }
.app-row-name { font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.app-row-type {
  font-size: 0.625rem;
  font-weight: 400;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.111em;
  margin-bottom: 0.2rem;
}

.app-row-email {
  font-size: 0.875rem;
  color: var(--slate);
  min-width: 0;
}

.link-edit {
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.link-edit:hover { text-decoration: underline; }

.app-row-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  justify-content: flex-end;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 400;
  white-space: nowrap;
  color: var(--slate);
}
.status-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-connected { color: var(--green); }
.status-connected::before { background: var(--green); }
.status-paused { color: var(--slate); }
.status-paused::before { background: var(--red); }
.status-disconnected { color: var(--slate); }
.status-disconnected::before { background: var(--slate); }
.status-error { color: var(--red); }
.status-error::before { background: var(--red); }

/* ── Delete account inline confirm ── */
.delete-section { margin-top: 0; }
.delete-confirm {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--red-light);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}
.delete-confirm p { font-size: 0.875rem; color: var(--red); flex: 1; }
.delete-confirm-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

/* ── Danger text link ── */
.link-danger {
  color: var(--red);
  font-size: 0.875rem;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.link-danger:hover { text-decoration: underline; }

/* ══════════════════════════════════════
   MODAL
══════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 35, 53, 0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 440px;
  padding: 2rem;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.modal-subtitle {
  font-size: 0.875rem;
  color: var(--slate);
  margin-bottom: 1.75rem;
  line-height: 1.5;
}
.modal-divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}
.modal-footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.modal-disconnect {
  margin-top: 0;
}
.modal-disconnect-confirm {
  padding: 0.9rem 1rem;
  background: var(--red-light);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}
.modal-disconnect-confirm p { font-size: 0.875rem; color: var(--red); }

/* ══════════════════════════════════════
   SUBSCRIPTION PAGE
══════════════════════════════════════ */
.sub-banner {
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--ink);
  font-size: 0.9rem;
}
.sub-banner strong { font-weight: 600; display: block; margin-bottom: 0.1rem; }
.sub-banner svg { flex-shrink: 0; margin-top: 2px; color: var(--primary); }

.sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}
.sub-row:last-child { border-bottom: none; }
.sub-row-label { font-size: 0.95rem; font-weight: 500; color: var(--ink); }

/* ══════════════════════════════════════
   ONBOARDING
══════════════════════════════════════ */
.ob-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 2rem;
}
.ob-progress-bar {
  height: 4px;
  border-radius: 99px;
  flex: 1;
  background: var(--border);
}
.ob-progress-bar.done { background: var(--primary); }

.ob-form h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}
.ob-form p {
  font-size: 0.9rem;
  color: var(--slate);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.ob-section-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.ob-section { margin-bottom: 1.75rem; }

/* Source picker */
.source-picker { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem; }
.source-option {
  display: block;
  padding: 1.1rem 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
.source-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  text-decoration: none;
}
.source-name { font-weight: 600; font-size: 1rem; }
.source-desc { font-size: 0.85rem; color: var(--slate); margin-top: 0.15rem; }

/* Child picker */
.child-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
.child-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.child-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
}
.child-option input[type="radio"] { accent-color: var(--primary); }
.child-name { font-size: 0.95rem; font-weight: 500; }

/* ══════════════════════════════════════
   STATUS BADGES (sync runs)
══════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success { background: #DCFCE7; color: #16A34A; }
.badge-error   { background: var(--red-light); color: var(--red); }
.badge-partial { background: #FEF3C7; color: #D97706; }

/* ══════════════════════════════════════
   LANDING (unchanged)
══════════════════════════════════════ */
.landing-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.landing-nav-links { display: flex; gap: 1.5rem; align-items: center; }
.landing-nav-links a { color: var(--slate); font-size: 0.9rem; }
.landing-nav-links a:hover { color: var(--ink); text-decoration: none; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 768px) {
  /* ── Layout ── */
  .sidebar { display: none; }
  .mobile-header { display: flex; }
  .app-main { margin-left: 0; }
  .app-content { padding: 1.25rem 1rem; }

  /* ── Page header ── */
  .page-header { margin-bottom: 1.25rem; }
  .page-header h1 { font-size: 1.4rem; }

  /* ── Cards ── */
  .card { padding: 1.25rem; margin-bottom: 0.75rem; }
  .card-title {
    margin-left: -1.25rem;
    margin-right: -1.25rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  /* ── Banner ── */
  .banner { padding: 0.75rem 1rem; }

  /* ── Stat cards ── */
  .stat-grid { grid-template-columns: 1fr; gap: 0.75rem; }

  /* ── Connected apps: collapse 4-col to 2-col/2-row ── */
  .app-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.2rem 0.75rem;
    padding: 0.875rem 1.25rem;
    margin: 0 -1.25rem;
  }
  .app-row-info  { grid-column: 1; grid-row: 1; }
  .app-row-email { grid-column: 1; grid-row: 2; font-size: 0.8rem; }
  .status-dot       { grid-column: 2; grid-row: 1; align-self: center; }
  .link-edit        { grid-column: 2; grid-row: 2; align-self: center; justify-self: end; }
  .app-row-actions  { grid-column: 2; grid-row: 2; align-self: center; justify-self: end; }

  /* ── Billing sub-row ── */
  .sub-row { gap: 0.75rem; }

  /* ── Schedule day toggles ── */
  .schedule-row { grid-template-columns: 1fr; }
  .day-toggles { gap: 0.3rem; }
  .day-toggle span { width: 36px; height: 36px; font-size: 0.75rem; }

  /* ── Modal slides up from bottom ── */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { border-radius: var(--radius) var(--radius) 0 0; max-width: 100%; width: 100%; }

  /* ── Auth pages ── */
  .auth-header { padding: 1rem 1.25rem; }
  .auth-body { padding: 2rem 1.25rem; max-width: 100%; }
}

@media (max-width: 400px) {
  .app-content { padding: 1rem 0.875rem; }
  .card { padding: 1rem; }
  .card-title {
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .app-row { padding: 0.75rem 1rem; margin: 0 -1rem; }
  .day-toggle span { width: 32px; height: 32px; font-size: 0.7rem; }
  .page-header h1 { font-size: 1.25rem; }
}

/* ── Toggle switch ── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 99px;
  transition: background 0.2s;
}
.toggle-track::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-track { background: var(--primary); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(20px); }

/* ── Schedule section heading ── */
.section-heading {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.section-label {
  font-size: 0.625rem;
  font-weight: 400;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.111em;
  line-height: 15px;
}

.time-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(31,35,53,0.15);
  border-radius: 14px;
  font-size: 0.9rem;
  background: var(--white);
  box-sizing: border-box;
}
.time-input::-webkit-calendar-picker-indicator {
  width: 16px;
  height: 16px;
  opacity: 0.4;
  cursor: pointer;
}
.time-input.time-input--off {
  border-color: rgba(31,35,53,0.08);
  color: rgba(31,35,53,0.22);
  pointer-events: none;
}
.time-input.time-input--off::-webkit-calendar-picker-indicator {
  opacity: 0.15;
}

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

/* ── Utility ── */
.text-slate { color: var(--slate); }
.text-red   { color: var(--red); }
.text-sm    { font-size: 0.875rem; }
.mt-1  { margin-top: 0.5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mb-0  { margin-bottom: 0; }
