/* SoloDad v1 — charcoal + gold, mobile-first */
:root {
  --bg: #141414;
  --bg-soft: #1d1d1d;
  --card: #232323;
  --card-border: #333333;
  --gold: #e0a92e;
  --gold-soft: #f5c95c;
  --gold-dim: rgba(224, 169, 46, 0.14);
  --text: #f4f1ea;
  --text-dim: #b9b4a8;
  --text-faint: #8a857a;
  --danger: #e05c5c;
  --ok: #6fce7e;
  --radius: 14px;
  --tap: 48px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(20, 20, 20, 0.96);
  border-bottom: 1px solid var(--card-border);
  padding: 12px 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { border-radius: 10px; flex: none; }
.brand h1 { margin: 0; font-size: 22px; letter-spacing: 0.5px; color: var(--gold-soft); }
.tagline { margin: 0; font-size: 13px; color: var(--text-dim); }

/* ---------- Main ---------- */
.app-main { max-width: 680px; margin: 0 auto; padding: 16px 16px 24px; }
.view-head { margin: 4px 0 14px; }
.view-head h2 { margin: 0 0 4px; font-size: 24px; }
.view-head p { margin: 0; color: var(--text-dim); font-size: 15px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.card.gold-edge { border-left: 4px solid var(--gold); }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.card p { margin: 6px 0; color: var(--text-dim); font-size: 15px; }
.card p strong { color: var(--text); }

/* ---------- Checklist items ---------- */
.check-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 10px; }
.check-row .check-item { flex: 1; margin-bottom: 0; }
.check-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  min-height: var(--tap);
  width: 100%;
  text-align: left;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
}
.go-link {
  flex: none;
  background: var(--gold-dim);
  color: var(--gold-soft);
  border: 1px solid rgba(224, 169, 46, 0.4);
  border-radius: 12px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  padding: 0 14px;
  min-height: var(--tap);
  cursor: pointer;
  white-space: nowrap;
}
.check-row .rm {
  flex: none;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 22px;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: var(--tap);
}
.check-item .box {
  flex: none;
  width: 26px; height: 26px;
  border: 2px solid var(--gold);
  border-radius: 8px;
  margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  color: #141414;
  font-weight: 700;
  background: transparent;
}
.check-item.done .box { background: var(--gold); }
.check-item.done .check-text { color: var(--text-faint); text-decoration: line-through; }
.check-item .check-text small { display: block; color: var(--text-dim); font-size: 14px; margin-top: 2px; }
.check-item.done .check-text small { text-decoration: none; }

/* ---------- Progress ---------- */
.progress-wrap { margin: 0 0 16px; }
.progress-label { font-size: 14px; color: var(--text-dim); margin-bottom: 6px; }
.progress-label strong { color: var(--gold-soft); }
.progress-bar { height: 10px; background: #2e2e2e; border-radius: 6px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-soft)); border-radius: 6px; transition: width 0.3s; }

/* ---------- Playbook list & detail ---------- */
.playbook-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: var(--tap);
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); color: var(--text);
  padding: 14px 16px; margin-bottom: 10px;
  font-family: var(--font); font-size: 17px; font-weight: 600;
  cursor: pointer; text-align: left;
}
.playbook-btn .pb-num {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--gold-dim); color: var(--gold-soft);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.playbook-btn .pb-arrow { margin-left: auto; color: var(--gold); }
.back-btn {
  background: none; border: none; color: var(--gold);
  font-size: 16px; font-family: var(--font);
  padding: 8px 0; margin-bottom: 8px; cursor: pointer; min-height: var(--tap);
}
.step { display: flex; gap: 12px; margin-bottom: 14px; }
.step .step-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--gold); color: #141414; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.step .step-body { font-size: 16px; }
.step .step-body p { margin: 0 0 4px; }
.disclaimer {
  background: var(--gold-dim);
  border: 1px solid rgba(224, 169, 46, 0.4);
  border-radius: var(--radius);
  padding: 12px 14px; font-size: 14px; color: var(--text-dim);
  margin-top: 16px;
}
.disclaimer strong { color: var(--gold-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap);
  background: var(--gold); color: #141414;
  border: none; border-radius: 12px;
  font-family: var(--font); font-size: 17px; font-weight: 700;
  padding: 12px 22px; cursor: pointer; width: 100%;
}
.btn:active { transform: scale(0.98); }
.btn-ghost {
  background: transparent; color: var(--gold);
  border: 2px solid var(--gold);
}
.btn-danger-ghost {
  background: transparent; color: var(--danger);
  border: 2px solid var(--danger);
  min-height: 44px; font-size: 15px; margin-top: 10px;
}
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row .btn { width: auto; flex: 1; }

/* ---------- Person / kid cards ---------- */
.person-card { position: relative; }
.person-card .p-name { font-size: 18px; font-weight: 700; margin: 0 0 2px; }
.person-card .p-role {
  display: inline-block; font-size: 13px; font-weight: 700;
  color: var(--gold-soft); background: var(--gold-dim);
  border-radius: 20px; padding: 3px 12px; margin-bottom: 8px;
}
.kv { display: flex; gap: 8px; font-size: 15px; margin: 3px 0; color: var(--text-dim); }
.kv b { color: var(--text); font-weight: 600; min-width: 78px; }
.kv a { color: var(--gold-soft); }
.card-actions { display: flex; gap: 8px; margin-top: 10px; }
.chip-btn {
  background: var(--bg-soft); color: var(--text-dim);
  border: 1px solid var(--card-border); border-radius: 10px;
  font-family: var(--font); font-size: 14px;
  padding: 8px 14px; min-height: 40px; cursor: pointer;
}
.chip-btn:hover { color: var(--text); border-color: var(--gold); }
.empty-note {
  text-align: center; color: var(--text-faint);
  padding: 28px 16px; font-size: 15px;
  border: 1px dashed var(--card-border); border-radius: var(--radius);
  margin-bottom: 12px;
}

/* ---------- Resource links ---------- */
.res-card { display: block; text-decoration: none; color: var(--text); }
.res-card:hover { border-color: var(--gold); }
.res-card .res-name { font-size: 17px; font-weight: 700; color: var(--gold-soft); margin: 0 0 4px; }
.res-card .res-desc { margin: 0 0 8px; font-size: 15px; color: var(--text-dim); }
.res-card .res-go { font-size: 14px; color: var(--gold); font-weight: 600; }

/* ---------- Tab bar ---------- */
.tab-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex;
  background: #1a1a1a;
  border-top: 1px solid var(--card-border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; background: none; border: none; cursor: pointer;
  color: var(--text-faint);
  font-family: var(--font);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px 6px; min-height: 64px;
}
.tab-icon { font-size: 20px; line-height: 1; }
.tab-label { font-size: 11px; font-weight: 600; }
.tab.active { color: var(--gold-soft); }
.tab.active .tab-icon { transform: scale(1.15); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.65);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: 18px 18px 0 0;
  width: 100%; max-width: 560px;
  max-height: 92vh; overflow-y: auto;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-head h2 { margin: 0; font-size: 20px; }
.icon-btn {
  background: var(--card); color: var(--text);
  border: 1px solid var(--card-border); border-radius: 10px;
  width: 44px; height: 44px; font-size: 24px; cursor: pointer; line-height: 1;
}
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--text-dim); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: var(--tap);
  background: var(--card); color: var(--text);
  border: 1px solid var(--card-border); border-radius: 10px;
  font-family: var(--font); font-size: 16px; padding: 10px 12px;
}
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--gold); color: #141414; font-weight: 700;
  padding: 12px 20px; border-radius: 12px; z-index: 60;
  font-size: 15px; box-shadow: 0 4px 18px rgba(0,0,0,0.5);
  max-width: 90vw; text-align: center;
}
.toast[hidden] { display: none; }

/* ---------- Misc ---------- */
.week-label {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--gold); margin: 18px 0 8px;
}
.week-label:first-of-type { margin-top: 4px; }

/* ---------- Custody walkthrough ---------- */
.playbook-btn.featured { border: 2px solid var(--gold); background: linear-gradient(180deg, rgba(224,169,46,0.12), var(--card)); }
.feat-tag { display: inline-block; font-size: 11px; font-weight: 700; color: #141414; background: var(--gold); border-radius: 12px; padding: 2px 9px; margin-left: 6px; vertical-align: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.disclaimer-top { margin: 0 0 16px; }
.word-row { align-items: flex-start; margin: 8px 0; }
.word-row b { min-width: 128px; }
.plain-list { margin: 6px 0 2px; padding-left: 20px; color: var(--text-dim); font-size: 15px; }
.plain-list li { margin-bottom: 6px; }
.res-link { color: var(--gold-soft); font-weight: 700; font-size: 16px; text-decoration: none; }
.sched-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.sched-chip.on { background: var(--gold); color: #141414; border-color: var(--gold); font-weight: 700; }
.sched-split { color: var(--text) !important; }
.sched-week { display: grid; grid-template-columns: 34px repeat(7, 1fr); gap: 3px; margin-bottom: 3px; }
.sched-dow { font-size: 10px; color: var(--text-faint); text-align: center; font-weight: 700; }
.sched-wk { font-size: 10px; color: var(--text-faint); font-weight: 700; display: flex; align-items: center; }
.sched-cell { font-size: 9px; text-align: center; padding: 6px 1px; border-radius: 6px; background: #2e2e2e; color: var(--text-faint); font-weight: 600; line-height: 1.2; }
.sched-cell.dad { background: var(--gold); color: #141414; }
.sched-cell.visit { background: var(--gold-dim); color: var(--gold-soft); border: 1px dashed var(--gold); }
.check-item .box { font-size: 13px; }
.inline-add { display: flex; gap: 8px; margin-top: 10px; }
.inline-add input {
  flex: 1; min-height: var(--tap);
  background: var(--card); color: var(--text);
  border: 1px solid var(--card-border); border-radius: 10px;
  font-family: var(--font); font-size: 16px; padding: 10px 12px;
}
.inline-add button {
  flex: none; min-height: var(--tap); padding: 0 18px;
  background: var(--gold); color: #141414; border: none; border-radius: 10px;
  font-family: var(--font); font-size: 16px; font-weight: 700; cursor: pointer;
}
.routine-head { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0 8px; }
.state-picker-label { display: block; font-size: 13px; font-weight: 700; color: var(--text-faint); margin: 10px 0 6px; }

/* ---------- Premium / Court-Ready Kit ---------- */
.premium-tag { background: transparent; color: var(--gold-soft); border: 1px solid var(--gold); }
.premium-price-line { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.premium-price { font-size: 40px; font-weight: 800; color: var(--gold-soft); line-height: 1; }
.premium-billing { font-size: 13px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.6px; line-height: 1.35; }
.premium-checkout-btn:disabled { background: #3a3a3a; color: var(--text-faint); cursor: not-allowed; }
.premium-checkout-btn:disabled:active { transform: none; }
.premium-honest-note { font-size: 13px !important; color: var(--text-faint) !important; }
.premium-feature-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.premium-feature-head h3 { margin: 0; }
.lock-tag {
  flex: none; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-faint); border: 1px solid var(--card-border); border-radius: 12px; padding: 3px 9px;
}
.premium-feature.locked { border-style: dashed; }
.premium-locked-note { font-size: 13px !important; color: var(--text-faint) !important; margin-bottom: 0 !important; }
.premium-upsell .premium-honest-note { margin-bottom: 0; }
.state-picker {
  width: 100%; min-height: var(--tap);
  background: var(--card); color: var(--text);
  border: 1px solid var(--gold); border-radius: 10px;
  font-family: var(--font); font-size: 17px; font-weight: 600; padding: 10px 12px;
}
.state-card .kv a { color: var(--gold-soft); font-weight: 700; }
.routine-head h3 { margin: 0; font-size: 19px; }
.routine-head .day-tag { font-size: 13px; color: var(--text-faint); }
@media (min-width: 720px) {
  .modal-backdrop { align-items: center; padding: 24px; }
  .modal { border-radius: 18px; }
}

/* ---------- Install banner (Add to Home Screen) ---------- */
.install-banner {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--gold);
  border-radius: var(--radius); padding: 12px 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.install-banner.show { opacity: 1; transform: none; pointer-events: auto; }
.install-icon { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.install-text { flex: 1; min-width: 0; }
.install-title { margin: 0 0 2px; font-size: 15px; font-weight: 700; color: var(--text); }
.install-sub { margin: 0; font-size: 13px; color: var(--text-dim); line-height: 1.4; }
.install-sub b { color: var(--gold-soft); }
.install-action {
  flex: none; min-height: 44px; padding: 10px 18px;
  background: var(--gold); color: #141414; border: none; border-radius: 10px;
  font-family: var(--font); font-size: 15px; font-weight: 700; cursor: pointer;
}
.install-action:active { transform: scale(0.97); }
.install-close {
  flex: none; align-self: flex-start;
  background: none; border: none; color: var(--text-faint);
  font-size: 22px; line-height: 1; padding: 2px 4px; cursor: pointer;
}
