/* ==========================================================================
   Deets — app shell & component language
   Desktop-first. Every colour is a var(--token) from tokens.css.
   Sections below mirror the class vocabulary in the project brief so this
   file is easy to scan against a screen module.
   ========================================================================== */

/* ==========================================================================
   1. Shell — fixed sidebar + fluid main, full viewport height
   ========================================================================== */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  height: 100dvh;
}

.main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  overflow: hidden;
}

/* ==========================================================================
   2. Sidebar
   ========================================================================== */

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--soft);
  border-right: 1px solid var(--line);
  padding: 18px 14px 16px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 20px;
  color: var(--ink);
}

.brand-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  background: var(--grad-brand);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: var(--shadow-xs);
}

.brand-name {
  font-weight: 800;
  font-size: 16.5px;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-group {
  margin: 16px 10px 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.nav:first-child .nav-group:first-child,
.nav-group:first-of-type {
  margin-top: 6px;
}

.nav-group-p1 {
  color: var(--primary);
}

.nav-group-p2 {
  color: var(--teal);
}

.nav-group-p3 {
  color: var(--accent);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 13.5px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: var(--soft2);
  color: var(--ink);
}

.nav-ic {
  display: grid;
  place-items: center;
  width: 20px;
  flex: none;
  font-size: 14.5px;
  line-height: 1;
}

.nav-label {
  flex: 1;
  min-width: 0;
}

.nav-item.is-active {
  background: var(--primary-l);
  color: var(--primary-d);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: var(--r-pill);
  background: var(--primary);
}

.sidebar-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.household-card {
  padding: 12px 13px;
  border-radius: var(--r-md);
  background: var(--soft2);
}

.household-card-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

.household-card-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
}

.household-card-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* ==========================================================================
   3. Topbar
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: var(--topbar-h);
  flex: none;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
}

.topbar-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.topbar-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}

.topbar-sub {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: none;
}

.dodged {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
  padding-right: 4px;
}

.dodged-num {
  font-size: 19px;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -0.01em;
}

.dodged-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   4. Content — layout primitives
   ========================================================================== */

.content {
  flex: 1;
  overflow-y: auto;
  padding: var(--content-pad-y) var(--content-pad-x) var(--content-pad-b);
}

.screen {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rowlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.spacer {
  flex: 1;
}

/* ==========================================================================
   5. Cards
   ========================================================================== */

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-xs);
  padding: 20px 22px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.card-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bigcard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-xs);
  padding: 24px 26px;
}

.bigcard-main {
  min-width: 0;
}

.bigcard-num {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.05;
}

.bigcard-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat-num {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* ==========================================================================
   6. Row — the workhorse list item (built by ui.js `row()`)
   ========================================================================== */

.rw {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-xs);
  padding: 11px 13px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.rw:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--line);
}

.rw:active {
  transform: translateY(0);
}

.rw-dashed {
  border-style: dashed;
  background: var(--soft);
  box-shadow: none;
}

.rw-accent {
  border-left: 3px solid var(--primary);
}

.rw-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  font-size: 15px;
  line-height: 1;
}

.rw-tx {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.rw-tx b {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rw-tx span {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rw-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: none;
  text-align: right;
}

.rw-meta-top {
  font-size: 12px;
  font-weight: 800;
}

.rw-meta-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}

/* ==========================================================================
   7. Tone system — g green, a amber, r red, v violet, t teal
   ========================================================================== */

.tone-g {
  background: var(--green-l);
  color: var(--green);
}

.tone-a {
  background: var(--amber-l);
  color: var(--amber-ink);
}

.tone-r {
  background: var(--red-l);
  color: var(--red);
}

.tone-v {
  background: var(--primary-l);
  color: var(--primary);
}

.tone-t {
  background: #e1f5ee;
  color: var(--teal);
}

.tone-text-g {
  color: var(--green);
}

.tone-text-a {
  color: var(--amber-ink);
}

.tone-text-r {
  color: var(--red);
}

.tone-text-v {
  color: var(--primary);
}

.tone-text-t {
  color: var(--teal);
}

/* ==========================================================================
   8. Chips
   ========================================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.chip-g {
  background: var(--green-l);
  color: var(--green);
}

.chip-a {
  background: var(--amber-l);
  color: var(--amber-ink);
}

.chip-r {
  background: var(--red-l);
  color: var(--red);
}

.chip-v {
  background: var(--primary-l);
  color: var(--primary-d);
}

.chip-t {
  background: #e1f5ee;
  color: var(--teal);
}

/* ==========================================================================
   9. Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, opacity 0.12s ease;
  border: 1px solid transparent;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: var(--bg);
  color: var(--ink-soft);
  border-color: var(--line);
}

.btn-ghost:hover {
  background: var(--soft);
  color: var(--ink);
}

.btn-green {
  background: var(--green);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

.btn-green:hover {
  box-shadow: var(--shadow-sm);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ==========================================================================
   10. Section heads / eyebrow
   ========================================================================== */

.sec-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sec-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.sec-lead {
  font-size: 13px;
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eyebrow-v {
  background: var(--primary-l);
  color: var(--primary-d);
}

.eyebrow-g {
  background: var(--green-l);
  color: var(--green);
}

.eyebrow-a {
  background: var(--amber-l);
  color: var(--amber-ink);
}

.eyebrow-r {
  background: var(--red-l);
  color: var(--red);
}

.eyebrow-t {
  background: #e1f5ee;
  color: var(--teal);
}

/* ==========================================================================
   11. Controls — segmented switch, progress bar, form fields
   ========================================================================== */

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--r-sm);
  background: var(--soft2);
  gap: 2px;
}

.seg-item {
  padding: 7px 14px;
  border-radius: calc(var(--r-sm) - 3px);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.seg-item:hover {
  color: var(--ink-soft);
}

.seg-item.is-on {
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.prog {
  height: 8px;
  width: 100%;
  border-radius: var(--r-pill);
  background: var(--soft2);
  overflow: hidden;
}

.prog i {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--primary);
  transition: width 0.3s ease;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}

.field-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.field-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-l);
}

/* ==========================================================================
   12. Notes / callouts
   ========================================================================== */

.callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink-soft);
}

.callout-green {
  background: var(--green-l);
  border-color: transparent;
  color: #0e6b3d;
}

.callout-amber {
  background: var(--amber-l);
  border-color: transparent;
  color: var(--amber-ink);
}

.callout-red {
  background: var(--red-l);
  border-color: transparent;
  color: #a5252a;
}

.muted-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  background: var(--soft);
}

/* ==========================================================================
   13. Phase banner — Phase 2/3 roadmap chrome
   ========================================================================== */

.phase-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-radius: var(--r-md);
  color: #fff;
}

.phase-banner-tag {
  flex: none;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.22);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.phase-banner-copy {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.96;
}

.phase-banner.p1 {
  background: var(--grad-p1);
}

.phase-banner.p2 {
  background: var(--grad-p2);
}

.phase-banner.p3 {
  background: var(--grad-p3);
}

/* ==========================================================================
   14. Sheet / modal — centred on desktop, not a phone bottom-sheet
   ========================================================================== */

.sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(14, 12, 22, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: deets-scrim-in 0.18s ease;
}

.sheet {
  width: 100%;
  max-width: 460px;
  max-height: min(640px, calc(100vh - 48px));
  overflow-y: auto;
  background: var(--bg);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 24px 26px 26px;
  animation: deets-sheet-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.sheet-grab {
  display: none;
}

.sheet-head {
  margin-bottom: 16px;
}

.sheet-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.sheet-sub {
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}

@keyframes deets-scrim-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes deets-sheet-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   15. Loading / error states
   ========================================================================== */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}

.error {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 24px;
  border-radius: var(--r);
  border: 1px solid var(--red-l);
  background: var(--red-l);
  color: #a5252a;
}

.error h2 {
  font-size: 16px;
  margin-bottom: 8px;
}

.error pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  opacity: 0.85;
}

/* Mobile-only components (Action Dock, avatar/menu button, admin switch)
   are hidden here BY DEFAULT, deliberately placed in front of the
   @media (max-width: 900px) block below that turns them back on. Equal-
   specificity rules resolve by source order, so the "off" declaration has
   to come first in the file or a later same-viewport hit would win back
   over the media query's "on" and hide these on mobile too. */
.mobile-dock,
.admin-switch {
  display: none;
}

.mobile-menu-btn {
  display: none;
}

/* ==========================================================================
   16. Responsive — mobile Action Dock replaces the sidebar under 900px
   Desktop (>900px) is untouched above this block. Under 900px the sidebar
   is hidden outright (its job is taken over by the fixed bottom dock in
   js/mobilenav.js plus the header's avatar/menu sheet), the desktop
   "+ Add a deadline" button and account chip give way to the dock's FAB
   and the menu button, and .content gets extra bottom padding so the last
   row of a screen never sits under the fixed dock.
   ========================================================================== */

@media (max-width: 900px) {
  :root {
    --dock-h: 64px;
  }

  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    display: none;
  }

  .main {
    height: auto;
    overflow: visible;
  }

  /* ---- Mobile header (Fable review, 22 Jul 2026) --------------------
     One slim, vertically-centred row: title on the left (mobile size,
     truncates with ellipsis rather than wrapping/colliding), the dodged
     counter as a compact pill + the avatar/menu button on the right.
     Top safe-area padding keeps it clear of the status-bar/notch. The
     subtitle is dropped on mobile (per the review's explicit fallback)
     instead of truncating beside the title. */
  .topbar {
    position: sticky;
    flex-wrap: nowrap;
    align-items: center;
    height: auto;
    min-height: 56px;
    padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
    gap: 10px;
  }

  .topbar-left {
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
  }

  .topbar-title {
    font-size: 20px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-sub {
    display: none;
  }

  .topbar-right {
    gap: 10px;
  }

  /* Dodged counter collapses to a single compact pill ("🛡 $0") next to
     the avatar instead of the two-line desktop stack — the desktop
     markup/ids are untouched, this only restyles it under 900px. The
     label stays for screen readers (visually hidden, not display:none)
     so "penalties dodged"/"nothing missed yet" is still announced. */
  .dodged {
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 6px 10px 6px 8px;
    border-radius: var(--r-pill);
    background: var(--green-l);
  }

  .dodged::before {
    content: "🛡";
    font-size: 12px;
    line-height: 1;
  }

  .dodged-num {
    font-size: 13px;
  }

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

  #add-btn,
  .topbar-right .account-slot {
    display: none;
  }

  .mobile-menu-btn {
    display: grid;
  }

  /* ---- Type scale step-down (Fable review) --------------------------
     Screen headings/leads and the big stat numbers are desktop sizes
     everywhere else in the file; here they step down ~0.8x so a screen
     doesn't open shouting. Desktop (>900px) is untouched. */
  .sec-title {
    font-size: 15px;
  }

  .sec-lead {
    font-size: 13px;
  }

  .card-title {
    font-size: 14px;
  }

  .bigcard-num {
    font-size: 28px;
  }

  .bigcard-sub {
    font-size: 12.5px;
  }

  .stat-num {
    font-size: 20px;
  }

  .soon-gate h2 {
    font-size: 20px;
  }

  .soon-gate p {
    font-size: 13.5px;
  }

  /* ---- Vertical rhythm ------------------------------------------------
     Tighten the loose desktop gaps a touch so mobile doesn't feel baggy. */
  .screen {
    gap: 20px;
  }

  .stack {
    gap: 12px;
  }

  .card {
    padding: 16px 18px;
  }

  /* ---- Services filter chips (js/screens/services.js) -----------------
     A single-line horizontal-scroll chip row instead of pills wrapping
     their label onto 2–3 lines. Scoped to .svc-filter so the plain .seg
     used elsewhere (e.g. the Today | Your year switch) is untouched. */
  .svc-filter {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .svc-filter::-webkit-scrollbar {
    display: none;
  }

  .svc-filter .seg-item {
    flex: none;
    white-space: nowrap;
    scroll-snap-align: start;
    padding: 9px 16px;
  }

  /* Content bottom padding accounts for the dock height AND the FAB's
     raised (translateY) portion, so the last row of a screen clears it
     instead of sitting partly behind it. */
  .content {
    padding: 20px 16px calc(76px + var(--dock-h) + env(safe-area-inset-bottom));
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  /* Today | Your year switch — see js/mobilenav.js adminSwitch(). Redundant
     chrome above 900px, where the sidebar already links both screens. */
  .admin-switch {
    display: inline-flex;
  }

  /* Bottom Action Dock */
  .mobile-dock {
    display: grid;
  }
}

@media (max-width: 1080px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   17. Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .rw,
  .btn,
  .seg-item,
  .prog i,
  .nav-item,
  .dock-tab,
  .dock-ic,
  .dock-fab,
  .mobmenu-item,
  .mobile-menu-btn {
    transition: none !important;
  }

  .sheet-scrim,
  .sheet {
    animation: none !important;
  }
}

/* ==========================================================================
   Sticky CTA
   A pay/commit bar that pins to the bottom of the scrolling content and
   bleeds edge-to-edge. The negative margins deliberately mirror .content's
   own padding (30px 34px 60px) so the bar meets the pane edges exactly —
   they are derived from --content-pad-x / --content-pad-b, so changing the
   padding in one place keeps the bleed correct instead of springing a
   horizontal scrollbar.
   ========================================================================== */

.sticky-cta {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 0 calc(var(--content-pad-x) * -1) calc(var(--content-pad-b) * -1);
  padding: 16px var(--content-pad-x) 26px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}

/* ==========================================================================
   Nav groups (section-based, replacing the old phase grouping)
   ========================================================================== */

.nav-group-admin    { color: var(--primary-d); }
.nav-group-services { color: #0a7a63; }
.nav-group-money    { color: #b34524; }
.nav-group-account  { color: var(--muted); }

.nav-soon {
  margin-left: auto;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--amber-l);
  color: var(--amber-ink);
}

/* ==========================================================================
   Account chip in the topbar
   ========================================================================== */

.account-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
  margin-left: 4px;
  border-left: 1px solid var(--line);
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: var(--r-pill);
  background: var(--soft);
  border: 1px solid var(--line);
  transition: background 0.12s ease;
}
.account-chip:hover { background: var(--soft2); }

.account-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--grad-brand);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.account-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

/* ==========================================================================
   Services marketplace
   ========================================================================== */

.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 14px;
}

.svc-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg);
  box-shadow: var(--shadow-xs);
  text-align: left;
  width: 100%;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.svc-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-l);
}

.svc-card-ic {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 19px;
  background: var(--soft);
  margin-bottom: 2px;
}
.svc-card-name { font-size: 14px; font-weight: 800; color: var(--ink); }
.svc-card-blurb { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.svc-card-foot {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
}

/* provider rows on a compare page */
.prov {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg);
  box-shadow: var(--shadow-xs);
}
.prov.is-featured { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.prov-name { font-size: 15px; font-weight: 800; color: var(--ink); }
.prov-tag { font-size: 12px; color: var(--muted); }
.prov-detail { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.5; }
.prov-offer {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--green);
  background: var(--green-l);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
.prov-right { text-align: right; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.prov-from { font-size: 19px; font-weight: 900; letter-spacing: -0.02em; color: var(--ink); }
.prov-from small { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.prov-rating { font-size: 11.5px; font-weight: 700; color: var(--amber-ink); }

/* ==========================================================================
   "Coming soon" gate — used by Subscriptions and Switch & compare
   ========================================================================== */

.soon-gate {
  position: relative;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 34px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.soon-gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 220px at 50% -20%, var(--primary-l) 0%, transparent 70%);
  pointer-events: none;
}
.soon-gate > * { position: relative; }
.soon-gate-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  background: var(--amber-l);
  color: var(--amber-ink);
  margin-bottom: 14px;
}
.soon-gate h2 { font-size: 25px; margin-bottom: 10px; }
.soon-gate p { font-size: 14px; color: var(--ink-soft); max-width: 560px; margin: 0 auto 8px; line-height: 1.6; }
.soon-form {
  display: flex;
  gap: 8px;
  max-width: 420px;
  margin: 20px auto 0;
}
.soon-form .field-input { flex: 1; }

/* preview behind the gate — visible but clearly not live */
.soon-preview {
  margin-top: 30px;
  opacity: 0.55;
  filter: saturate(0.6);
  pointer-events: none;
  user-select: none;
}

/* ==========================================================================
   Address finder (moving pack)
   ========================================================================== */

.addr-field { position: relative; }
.addr-results {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: 240px;
  overflow-y: auto;
}
.addr-result {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.addr-result:last-child { border-bottom: none; }
.addr-result:hover,
.addr-result.is-active { background: var(--primary-l); color: var(--primary-d); }
.addr-result small { display: block; font-size: 11px; color: var(--muted); }
.addr-result:hover small { color: var(--primary-d); }

.addr-journey {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}
.addr-box {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--soft);
  border: 1px solid var(--line);
}
.addr-box-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.addr-box-value { font-size: 15px; font-weight: 800; color: var(--ink); margin-top: 3px; }
.addr-arrow { font-size: 20px; color: var(--primary); font-weight: 900; }

@media (max-width: 760px) {
  .addr-journey { grid-template-columns: 1fr; }
  .addr-arrow { transform: rotate(90deg); justify-self: center; }
}

/* ==========================================================================
   Demo-mode banner
   Demo mode populates the app with a fictional household so it can be shown
   fully-loaded. That must never be mistakable for real data, so the banner
   is permanent, unmissable, and carries its own way out.
   ========================================================================== */

.demo-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px 16px;
  background: var(--amber-l);
  border-bottom: 1px solid var(--amber);
  color: var(--amber-ink);
  font-size: 12.5px;
  font-weight: 700;
}

.demo-banner .btn {
  padding: 4px 12px;
  font-size: 11.5px;
}

/* The shell is a full-height grid; when the banner is present it has to give
   that height back or the sidebar overflows the viewport. */
body.has-demo-banner .shell,
body.has-demo-banner .main,
body.has-demo-banner .sidebar {
  height: calc(100vh - 37px);
  height: calc(100dvh - 37px);
}

/* ==========================================================================
   Mobile Action Dock + avatar/menu sheet (js/mobilenav.js)
   The display:none defaults live earlier in the file (just above section
   16) so the source-order cascade turns them on correctly under 900px —
   see the comment there before changing either side of this pairing.
   ========================================================================== */

.mobile-menu-btn {
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--grad-brand);
  box-shadow: var(--shadow-xs);
  color: #fff;
  margin-left: 2px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.mobile-menu-btn:hover {
  box-shadow: var(--shadow-sm);
}
.mobile-menu-btn:active {
  transform: scale(0.94);
}

.mobile-menu-avatar {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.mobile-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  grid-template-columns: 1fr 1fr auto 1fr 1fr;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  min-height: var(--dock-h);
}

.dock-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px;
  color: var(--muted);
  text-decoration: none;
}

.dock-ic {
  display: grid;
  place-items: center;
  width: 30px;
  height: 26px;
  border-radius: var(--r-sm);
  transition: background 0.15s ease, color 0.15s ease;
}

.dock-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.dock-tab.is-active {
  color: var(--primary);
}

.dock-tab.is-active .dock-ic {
  background: var(--primary-l);
}

/* Raised centre FAB — same add-a-deadline flow as the desktop add-btn. */
.dock-fab {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 4px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(-16px);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  justify-self: center;
}
.dock-fab:hover {
  box-shadow: var(--shadow-sm);
}
.dock-fab:active {
  transform: translateY(-16px) scale(0.94);
}

/* Today | Your year switch — rendered by today.js / year.js at the top of
   their own content. The display:none default lives earlier in the file
   (just above section 16) — see the comment there. */
.admin-switch {
  margin-bottom: -4px;
}

/* Avatar/menu bottom sheet — grouped exactly like the desktop sidebar. */
.mobmenu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobmenu-group {
  margin: 14px 4px 4px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.mobmenu-group:first-child {
  margin-top: 2px;
}

.mobmenu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.mobmenu-item:hover {
  background: var(--soft2);
  color: var(--ink);
}

.mobmenu-ic {
  display: grid;
  place-items: center;
  width: 22px;
  flex: none;
  font-size: 15.5px;
  line-height: 1;
}

.mobmenu-label {
  flex: 1;
  min-width: 0;
}

.mobmenu-foot {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
