/* ==========================================================================
   Seomra — Family Command Center
   Light-mode design system, bento kiosk grid, mobile app shell, Kid Mode.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-sunken: #F1F5F9;
  --surface-hover: #F8FAFC;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  /* Type */
  --text: #0F172A;
  --text-muted: #475569;
  --text-subtle: #94A3B8;

  /* Brand */
  --brand: #2563EB;
  --brand-dark: #1D4ED8;
  --brand-soft: #EFF6FF;
  --brand-ring: rgba(37, 99, 235, 0.18);

  /* Semantics */
  --green: #16A34A;
  --green-soft: #F0FDF4;
  --green-border: #BBF7D0;
  --amber: #D97706;
  --amber-soft: #FFFBEB;
  --amber-border: #FDE68A;
  --red: #DC2626;
  --red-soft: #FEF2F2;
  --red-border: #FECACA;
  --violet: #7C3AED;
  --violet-soft: #F5F3FF;
  --slate-soft: #F1F5F9;

  /* Elevation */
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.16);

  /* Geometry */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 999px;

  /* Rhythm */
  --gap: 16px;
  --pad: 18px;
  --header-h: 72px;
  --nav-h: 66px;

  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--brand); text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

/* --------------------------------------------------------------------------
   3. Form controls
   -------------------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.input,
.select,
.textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
  font-family: var(--font);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2394A3B8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.input::placeholder,
.textarea::placeholder { color: var(--text-subtle); font-weight: 500; }

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
              transform 0.12s var(--ease), box-shadow 0.15s var(--ease);
}

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

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--brand);
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover { background: var(--brand-dark); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover { background: var(--surface-sunken); color: var(--text); }

.btn-soft {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-color: #DBEAFE;
}
.btn-soft:hover { background: #DBEAFE; }

.btn-danger-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--red);
}
.btn-danger-ghost:hover { background: var(--red-soft); border-color: var(--red-border); }

.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* Icon button ------------------------------------------------------------- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-subtle);
  border: 1px solid transparent;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  flex: none;
}
.icon-btn:hover { background: var(--surface-sunken); color: var(--text); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }

/* --------------------------------------------------------------------------
   4. Pills & badges
   -------------------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.pill-green { background: var(--green-soft); color: #15803D; border-color: var(--green-border); }
.pill-amber { background: var(--amber-soft); color: #B45309; border-color: var(--amber-border); }
.pill-red   { background: var(--red-soft);   color: #B91C1C; border-color: var(--red-border); }
.pill-blue  { background: var(--brand-soft); color: var(--brand-dark); border-color: #DBEAFE; }
.pill-violet{ background: var(--violet-soft);color: #6D28D9; border-color: #DDD6FE; }
.pill-slate { background: var(--slate-soft); color: var(--text-muted); border-color: var(--border); }

/* Category pills (agenda) */
/* Tinted from the colour an administrator picked for the category. */
.pill-tinted {
  color: var(--tint, var(--text-muted));
  background: color-mix(in srgb, var(--tint, #64748B) 10%, #FFFFFF);
  border-color: color-mix(in srgb, var(--tint, #64748B) 28%, #FFFFFF);
}

/* Fallback for browsers without color-mix(). */
@supports not (background: color-mix(in srgb, red 10%, white)) {
  .pill-tinted { background: var(--slate-soft); border-color: var(--border); }
}

/* Member badge ------------------------------------------------------------ */
.member-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  flex: none;
  line-height: 1;
}

.avatar-lg { width: 28px; height: 28px; font-size: 12px; }

/* --------------------------------------------------------------------------
   5. Top bar
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--header-h);
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 4px;
  margin: -4px;
  border-radius: var(--radius);
  transition: background 0.15s var(--ease);
}
.brand:hover { background: var(--surface-sunken); }

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex: none;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  text-align: left;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-sub {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.topbar-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.topbar-strip::-webkit-scrollbar { display: none; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* Status chips in the header */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex: none;
}

.chip strong { color: var(--text); font-weight: 700; }
.chip-icon { font-size: 15px; line-height: 1; }

.chip-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: var(--text-subtle);
}

.chip.is-good   { background: var(--green-soft); border-color: var(--green-border); color: #15803D; }
.chip.is-good strong { color: #166534; }
.chip.is-warn   { background: var(--amber-soft); border-color: var(--amber-border); color: #B45309; }
.chip.is-warn strong { color: #92400E; }
.chip.is-urgent { background: var(--red-soft); border-color: var(--red-border); color: #B91C1C; }
.chip.is-urgent strong { color: #991B1B; }

/* Active-user switcher ---------------------------------------------------- */
.user-switch { position: relative; flex: none; }

.user-switch-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.user-switch-trigger:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.user-switch-trigger .caret { color: var(--text-subtle); font-size: 10px; }

.user-switch-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 196px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 80;
  display: none;
}
.user-switch-menu[data-open="true"] { display: block; }

.user-switch-head {
  padding: 7px 10px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.user-switch-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  transition: background 0.12s var(--ease);
}
.user-switch-option:hover { background: var(--surface-sunken); }
.user-switch-option[aria-checked="true"] { background: var(--brand-soft); color: var(--brand-dark); }
.user-switch-option .tick { margin-left: auto; color: var(--brand); font-weight: 700; opacity: 0; }
.user-switch-option[aria-checked="true"] .tick { opacity: 1; }

/* --------------------------------------------------------------------------
   6. Layout shell — home glance + section views
   -------------------------------------------------------------------------- */
.app {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--gap) 18px calc(var(--nav-h) + 28px);
}

/* Only the active view is mounted. */
.view { display: none; }
body[data-view="home"]  .view[data-view="home"],
body[data-view="today"] .view[data-view="today"],
body[data-view="pets"]  .view[data-view="pets"],
body[data-view="food"]  .view[data-view="food"],
body[data-view="fleet"] .view[data-view="fleet"],
body[data-view="vault"] .view[data-view="vault"] { display: block; }

.view-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: var(--gap);
}

.view-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.15s var(--ease), color 0.15s var(--ease),
              border-color 0.15s var(--ease);
}
.view-back:hover { background: var(--surface-sunken); color: var(--text); border-color: var(--border-strong); }

.view-title {
  font-size: clamp(19px, 2.6vw, 25px);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}

.view-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.view-grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }

/* --------------------------------------------------------------------------
   6b. Home — glance hero
   -------------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 32px);
  align-items: center;
  padding: clamp(18px, 3vw, 28px) clamp(18px, 3vw, 30px);
  margin-bottom: clamp(20px, 3vw, 30px);
  border-radius: var(--radius-xl);
  background: linear-gradient(125deg, #EFF6FF 0%, #FFFFFF 42%, #F5F3FF 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-clock { min-width: 0; }

.hero-time {
  font-size: clamp(42px, 7.5vw, 76px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.hero-date {
  font-size: clamp(13px, 1.5vw, 15px);
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 6px;
}

.hero-greeting {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  margin-top: 2px;
}

.hero-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  min-width: 0;
}

.hero-panel {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  text-align: left;
  min-width: 0;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease),
              border-color 0.16s var(--ease);
}
.hero-panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.hero-panel-icon { font-size: 24px; line-height: 1; flex: none; }

.hero-bin-swatch {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #FFFFFF;
  background: var(--text-subtle);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.hero-panel-body { min-width: 0; display: flex; flex-direction: column; }

.hero-panel-value {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-panel-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   6c. Home — section tiles
   -------------------------------------------------------------------------- */
.tiles-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 12px;
  padding-left: 2px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(12px, 1.6vw, 18px);
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: clamp(150px, 19vh, 196px);
  padding: clamp(18px, 2.2vw, 24px);
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: left;
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
              border-color 0.2s var(--ease);
}
.tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--tile-accent, var(--border-strong));
}
.tile:active { transform: translateY(-1px); }

.tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--tile-accent, var(--brand));
}

.tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(44px, 5vw, 54px);
  height: clamp(44px, 5vw, 54px);
  border-radius: 16px;
  background: var(--tile-soft, var(--brand-soft));
  font-size: clamp(22px, 2.6vw, 27px);
  margin-bottom: 10px;
  flex: none;
}

.tile-name {
  font-size: clamp(15px, 1.8vw, 18px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.tile-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-subtle);
}

.tile-stat {
  margin-top: auto;
  padding-top: 10px;
  font-size: clamp(13px, 1.5vw, 15px);
  font-weight: 700;
  color: var(--tile-accent, var(--brand));
}

.tile-meter {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: var(--surface-sunken);
}
.tile-meter-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--tile-accent, var(--brand));
  transition: width 0.5s var(--ease);
}

.tile-today { --tile-accent: #3B82F6; --tile-soft: #EFF6FF; }
.tile-pets  { --tile-accent: #16A34A; --tile-soft: #F0FDF4; }
.tile-food  { --tile-accent: #EC4899; --tile-soft: #FDF2F8; }
.tile-fleet { --tile-accent: #F59E0B; --tile-soft: #FFFBEB; }
.tile-vault { --tile-accent: #14B8A6; --tile-soft: #F0FDFA; }
.tile-kid   { --tile-accent: #8B5CF6; --tile-soft: #F5F3FF; }

/* --------------------------------------------------------------------------
   7. Cards
   -------------------------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--border);
  flex: none;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
  min-width: 0;
}

.card-title .card-icon { font-size: 15px; line-height: 1; }

.card-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
}

.card-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--pad);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.card-body.is-flush { padding: 0; }
.card-body.is-tight { padding: 10px; }

.card-foot {
  flex: none;
  padding: 12px var(--pad);
  border-top: 1px solid var(--border);
  background: var(--surface-sunken);
}

/* Scrollbars inside cards */
.card-body::-webkit-scrollbar { width: 8px; }
.card-body::-webkit-scrollbar-track { background: transparent; }
.card-body::-webkit-scrollbar-thumb { background: #E2E8F0; border-radius: 99px; }
.card-body::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

.empty {
  padding: 24px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-subtle);
}
.empty-icon { font-size: 26px; margin-bottom: 8px; opacity: 0.6; }

.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin: 2px 0 8px;
}
.section-label + .section-label,
* + .section-label { margin-top: 18px; }

/* --------------------------------------------------------------------------
   8. Glance card (weather, walk window, bin)
   -------------------------------------------------------------------------- */
.glance-weather {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.weather-icon { font-size: 40px; line-height: 1; flex: none; }

.weather-temp {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.weather-desc { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.weather-place { font-size: 11px; font-weight: 500; color: var(--text-subtle); }

.weather-stats {
  margin-left: auto;
  display: grid;
  gap: 4px;
  text-align: right;
  flex: none;
}
.weather-stat { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.weather-stat strong { color: var(--text); }

.glance-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.glance-row:last-child { border-bottom: 0; padding-bottom: 2px; }

.glance-row-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--surface-sunken);
  flex: none;
}

.glance-row-body { min-width: 0; flex: 1 1 auto; }
.glance-row-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.glance-row-value { font-size: 15px; font-weight: 700; color: var(--text); margin-top: 1px; }
.glance-row-note { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-top: 2px; }

.bin-swatch {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #FFFFFF;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.walk-hours {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.walk-hour {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  padding: 5px 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  border: 1px solid transparent;
}
.walk-hour.is-best { background: var(--green-soft); border-color: var(--green-border); }
.walk-hour.is-wet  { background: var(--red-soft); border-color: var(--red-border); }

.walk-hour-time { font-size: 10px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.walk-hour-rain { font-size: 11px; font-weight: 700; color: var(--text); margin-top: 1px; }

/* --------------------------------------------------------------------------
   9. Agenda
   -------------------------------------------------------------------------- */
.agenda-group + .agenda-group { margin-top: 16px; }

.agenda-day {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 8px;
}
.agenda-day::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--border);
}
.agenda-day.is-today { color: var(--brand); }

.event {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.event + .event { margin-top: 8px; }
.event:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }

.event-rail {
  width: 3px;
  align-self: stretch;
  border-radius: 99px;
  background: var(--brand);
  flex: none;
}

.event-time {
  flex: none;
  width: 48px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}
.event-time.is-allday { font-size: 10px; font-weight: 700; color: var(--text-subtle); letter-spacing: 0.04em; }

.event-body { flex: 1 1 auto; min-width: 0; }
.event-title { font-size: 14px; font-weight: 600; color: var(--text); word-break: break-word; }
.event-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; align-items: center; }
.event-note { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-top: 4px; }

.event .icon-btn { opacity: 0; transition: opacity 0.15s var(--ease); }
.event:hover .icon-btn,
.event:focus-within .icon-btn { opacity: 1; }

@media (hover: none) {
  .event .icon-btn { opacity: 1; }
}

/* --------------------------------------------------------------------------
   10. Trackers (pets)
   -------------------------------------------------------------------------- */
.tracker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 9px;
}

.tracker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  min-height: 60px;
  transition: all 0.18s var(--ease);
}
.tracker:hover { border-color: var(--border-strong); background: var(--surface-hover); }

.tracker-check {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: transparent;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.18s var(--ease);
}

.tracker-text { min-width: 0; flex: 1 1 auto; }
.tracker-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tracker-sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.tracker-emoji { font-size: 17px; flex: none; line-height: 1; }

.tracker[aria-pressed="true"] {
  background: var(--green-soft);
  border-color: var(--green-border);
}
.tracker[aria-pressed="true"] .tracker-check {
  background: var(--green);
  border-color: var(--green);
  color: #FFFFFF;
}
.tracker[aria-pressed="true"] .tracker-label { color: #166534; }
.tracker[aria-pressed="true"] .tracker-sub { color: #15803D; }

.tracker.is-pending { opacity: 0.6; pointer-events: none; }

.tracker-pop { animation: trackerPop 0.3s var(--ease); }
@keyframes trackerPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.035); }
  100% { transform: scale(1); }
}

/* Progress meter ---------------------------------------------------------- */
.meter {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.meter-track {
  flex: 1 1 auto;
  min-width: 48px;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-sunken);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--green);
  width: 0;
  transition: width 0.45s var(--ease);
}

/* --------------------------------------------------------------------------
   11. Kid routine board
   -------------------------------------------------------------------------- */
.kid-board + .kid-board { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

.kid-board-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.kid-board-name { font-size: 14px; font-weight: 700; color: var(--text); }

.stars { display: flex; gap: 3px; margin-left: auto; font-size: 14px; line-height: 1; }
.star { filter: grayscale(1); opacity: 0.3; transition: all 0.3s var(--ease); }
.star.is-on { filter: none; opacity: 1; transform: scale(1.05); }

.kid-tasks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 9px;
}

.kid-task {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  min-height: 92px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 2px solid var(--border);
  transition: all 0.18s var(--ease);
}
.kid-task:hover { border-color: var(--border-strong); }

.kid-task-icon { font-size: 26px; line-height: 1; transition: transform 0.25s var(--ease); }
.kid-task-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
}

.kid-task[aria-pressed="true"] {
  background: var(--green-soft);
  border-color: var(--green);
}
.kid-task[aria-pressed="true"] .kid-task-label { color: #166534; }
.kid-task[aria-pressed="true"] .kid-task-icon { transform: scale(1.12); }

.kid-task.is-pending { opacity: 0.6; pointer-events: none; }

.kid-done-banner {
  display: none;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  color: #15803D;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.kid-board.is-complete .kid-done-banner { display: block; }

/* --------------------------------------------------------------------------
   12. Meals
   -------------------------------------------------------------------------- */
.meal-list { display: grid; gap: 8px; }

.meal {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s var(--ease);
}
.meal:hover { border-color: var(--border-strong); }

.meal.is-today {
  background: var(--brand-soft);
  border-color: #BFDBFE;
}

.meal-day {
  flex: none;
  width: 42px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.meal.is-today .meal-day { color: var(--brand-dark); }

.meal-body { flex: 1 1 auto; min-width: 0; }

.meal-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
  text-align: left;
}
.meal-name.is-empty { color: var(--text-subtle); font-weight: 500; font-style: italic; }
.meal-note {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
  text-align: left;
}

.meal-edit {
  display: flex;
  gap: 8px;
  width: 100%;
  align-items: center;
}
.meal-edit .input { padding: 7px 10px; font-size: 13px; }

/* --------------------------------------------------------------------------
   13. Groceries
   -------------------------------------------------------------------------- */
.grocery-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px auto;
  gap: 8px;
  align-items: center;
}

.grocery-group + .grocery-group { margin-top: 16px; }

.grocery {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  width: 100%;
  text-align: left;
  transition: all 0.15s var(--ease);
}
.grocery + .grocery { margin-top: 7px; }
.grocery:hover { border-color: var(--border-strong); background: var(--surface-hover); }

.grocery-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border-strong);
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: transparent;
  transition: all 0.15s var(--ease);
}

.grocery-name { font-size: 14px; font-weight: 600; color: var(--text); min-width: 0; word-break: break-word; }
.grocery-qty {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-subtle);
  flex: none;
  font-variant-numeric: tabular-nums;
}

.grocery[aria-pressed="true"] { background: var(--surface-sunken); border-color: var(--border); }
.grocery[aria-pressed="true"] .grocery-check { background: var(--green); border-color: var(--green); color: #FFFFFF; }
.grocery[aria-pressed="true"] .grocery-name { color: var(--text-subtle); text-decoration: line-through; }

.grocery.is-pending { opacity: 0.55; pointer-events: none; }

/* --------------------------------------------------------------------------
   14. Fleet
   -------------------------------------------------------------------------- */
.asset + .asset { margin-top: 10px; }

.asset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.asset-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
}

.asset-icon { font-size: 16px; flex: none; line-height: 1; }
.asset-name { font-size: 13px; font-weight: 700; color: var(--text); min-width: 0; }
.asset-reg {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  text-transform: uppercase;
}

.asset-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: auto;
  flex: none;
}
.asset-status-dot.green { background: var(--green); }
.asset-status-dot.amber { background: var(--amber); }
.asset-status-dot.red   { background: var(--red); }
.asset-status-dot.none  { background: var(--border-strong); }

.reminder-list { padding: 8px 10px; display: grid; gap: 6px; }

.reminder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
}

.reminder-type {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  flex: none;
  min-width: 78px;
}
.reminder-date { font-size: 11px; font-weight: 500; color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.reminder-notes { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.reminder .pill { margin-left: auto; flex: none; }

/* --------------------------------------------------------------------------
   15. DIY board
   -------------------------------------------------------------------------- */
.diy {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s var(--ease);
}
.diy + .diy { margin-top: 8px; }
.diy:hover { border-color: var(--border-strong); }

.diy-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
}

.diy-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border-strong);
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: transparent;
  margin-top: 1px;
  transition: all 0.15s var(--ease);
}

.diy-main { flex: 1 1 auto; min-width: 0; text-align: left; }
.diy-title { font-size: 14px; font-weight: 600; color: var(--text); word-break: break-word; }
.diy-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

.diy.is-done .diy-check { background: var(--green); border-color: var(--green); color: #FFFFFF; }
.diy.is-done .diy-title { color: var(--text-subtle); text-decoration: line-through; }
.diy.is-done { background: var(--surface-sunken); }
.diy.is-pending { opacity: 0.55; pointer-events: none; }

.diy-spec {
  margin: 0 12px 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.diy-toggle-spec {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  padding: 2px 0;
}

/* --------------------------------------------------------------------------
   16. Vault
   -------------------------------------------------------------------------- */
.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.vault-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 13px 14px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.vault-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }

.vault-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

.vault-icon { font-size: 17px; line-height: 1; flex: none; }
.vault-title { font-size: 13px; font-weight: 700; color: var(--text); min-width: 0; }

.vault-body {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* --------------------------------------------------------------------------
   17. Modals
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--ease), visibility 0.2s var(--ease);
}
.modal-backdrop[data-open="true"] { opacity: 1; visibility: visible; }

.modal {
  width: 100%;
  max-width: 460px;
  max-height: calc(100dvh - 36px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.22s var(--ease);
}
.modal-backdrop[data-open="true"] .modal { transform: translateY(0) scale(1); }

.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.modal-title { font-size: 15px; font-weight: 700; color: var(--text); }
.modal-head .icon-btn { margin-left: auto; }

.modal-body {
  padding: 18px;
  overflow-y: auto;
  display: grid;
  gap: 14px;
}

.modal-foot {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-sunken);
  flex: none;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-error {
  display: none;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  border: 1px solid var(--red-border);
  color: #B91C1C;
  font-size: 12px;
  font-weight: 600;
}
.form-error[data-show="true"] { display: block; }

/* Radio chip group (bin override) ----------------------------------------- */
.choice-group { display: flex; flex-wrap: wrap; gap: 8px; }

.choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s var(--ease);
}
.choice:hover { border-color: var(--border-strong); }
.choice[aria-checked="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.choice-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

/* --------------------------------------------------------------------------
   18. Toasts
   -------------------------------------------------------------------------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 18px);
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(420px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border-radius: var(--radius-pill);
  background: #0F172A;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.26s var(--ease);
  max-width: 100%;
}
.toast.is-error { background: var(--red); }
.toast.is-good { background: #166534; }
.toast.is-leaving { animation: toastOut 0.22s var(--ease) forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(0.97); }
}

/* --------------------------------------------------------------------------
   19. Mobile bottom nav
   -------------------------------------------------------------------------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: var(--nav-h);
  color: var(--text-subtle);
  transition: color 0.15s var(--ease);
  position: relative;
}

.nav-icon { font-size: 19px; line-height: 1; }
.nav-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 2px;
}

.nav-item[aria-current="page"] { color: var(--brand); }
.nav-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  width: 26px;
  height: 3px;
  border-radius: 0 0 99px 99px;
  background: var(--brand);
}

.nav-dot {
  position: absolute;
  top: 8px;
  right: 50%;
  margin-right: -17px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  border: 1.5px solid #FFFFFF;
  display: none;
}
.nav-dot[data-show="true"] { display: block; }

/* --------------------------------------------------------------------------
   20. Kid Mode (fullscreen)
   -------------------------------------------------------------------------- */
.kid-mode {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: linear-gradient(160deg, #EFF6FF 0%, #F5F3FF 55%, #FDF2F8 100%);
  display: none;
  flex-direction: column;
  overflow-y: auto;
  padding: 22px clamp(16px, 4vw, 48px) 40px;
}
.kid-mode[data-open="true"] { display: flex; }
body.kid-mode-on { overflow: hidden; }

.kid-mode-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
  margin-bottom: 18px;
}

.kid-mode-title {
  font-size: clamp(22px, 3.4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.kid-mode-sub { font-size: 13px; font-weight: 600; color: var(--text-muted); }

.kid-mode-close {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}
.kid-mode-close:hover { color: var(--text); }

.kid-mode-boards {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-content: start;
}

.kid-panel {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #FFFFFF;
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.07);
  padding: clamp(16px, 2.4vw, 26px);
}

.kid-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.kid-panel-name {
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 700;
  color: var(--text);
}

.kid-panel .stars { font-size: clamp(20px, 2.4vw, 28px); gap: 5px; }

.kid-panel-tasks {
  display: grid;
  gap: clamp(10px, 1.6vw, 18px);
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.kid-mode .kid-task {
  min-height: clamp(130px, 16vh, 190px);
  border-radius: var(--radius-lg);
  border-width: 3px;
  gap: 10px;
  background: #FFFFFF;
}
.kid-mode .kid-task-icon { font-size: clamp(36px, 4.6vw, 56px); }
.kid-mode .kid-task-label { font-size: clamp(13px, 1.3vw, 17px); }

.kid-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.kid-progress-track {
  flex: 1 1 auto;
  height: 14px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

.kid-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #34D399, #10B981);
  transition: width 0.6s var(--ease);
}

.kid-progress-count {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  flex: none;
}

.kid-panel.is-complete {
  background: linear-gradient(140deg, rgba(240, 253, 244, 0.95), rgba(255, 255, 255, 0.9));
  border-color: var(--green-border);
}

.kid-cheer {
  display: none;
  margin-top: 14px;
  text-align: center;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 700;
  color: #15803D;
}
.kid-panel.is-complete .kid-cheer { display: block; animation: cheerPop 0.5s var(--ease); }

@keyframes cheerPop {
  0%   { transform: scale(0.85); opacity: 0; }
  60%  { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Confetti ---------------------------------------------------------------- */
.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -24px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  opacity: 0.95;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0%   { transform: translate3d(0, -10vh, 0) rotate(0deg); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translate3d(var(--drift, 0px), 108vh, 0) rotate(var(--spin, 540deg)); opacity: 0; }
}

/* --------------------------------------------------------------------------
   21. Loading / offline states
   -------------------------------------------------------------------------- */
.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 37%, #F1F5F9 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  height: 14px;
}
.skeleton + .skeleton { margin-top: 10px; }
.skeleton.is-tall { height: 46px; }

@keyframes shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.offline-banner {
  position: fixed;
  top: calc(var(--header-h) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  color: #B45309;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  display: none;
}
body.is-offline .offline-banner { display: block; }

.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--nav-h) + 18px);
  z-index: 90;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--brand);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 400;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.36);
  transition: transform 0.15s var(--ease), background 0.15s var(--ease);
}
.fab:hover { background: var(--brand-dark); }
.fab:active { transform: scale(0.94); }

/* --------------------------------------------------------------------------
   22. Mobile (< 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1023.98px) {
  .topbar { padding: 10px 14px; gap: 10px; flex-wrap: wrap; min-height: auto; }
  .topbar-strip { order: 3; width: 100%; flex-basis: 100%; padding-bottom: 2px; }
  .topbar-actions { margin-left: auto; }
  .brand-sub { display: none; }
  .btn-label { display: none; }

  .app { padding: 14px 14px calc(var(--nav-h) + 86px); }

  .hero { grid-template-columns: minmax(0, 1fr); text-align: left; }
  .hero-panels { grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); }

  .grocery-add { grid-template-columns: minmax(0, 1fr) 118px; }
  .grocery-add .btn { grid-column: 1 / -1; }

  .form-row { grid-template-columns: 1fr; }

  /* Comfortable tap targets on phones */
  .tracker { min-height: 64px; }
  .kid-task { min-height: 104px; }
  .kid-task-icon { font-size: 30px; }
}

@media (max-width: 480px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { min-height: 136px; padding: 14px; border-radius: var(--radius-lg); }
  .tile-icon { width: 38px; height: 38px; font-size: 20px; border-radius: 12px; margin-bottom: 6px; }
  .tile-sub { display: none; }
  .tile-name { font-size: 13.5px; }
  .tile-stat { font-size: 12.5px; padding-top: 6px; }

  .tracker-grid { grid-template-columns: 1fr 1fr; }
  .vault-grid { grid-template-columns: minmax(0, 1fr); }
  .nav-label { font-size: 8.5px; }
  .brand-text { display: none; }
  .hero-time { font-size: 46px; }
}

/* --------------------------------------------------------------------------
   23. Desktop / wall-tablet kiosk (>= 1024px)
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  :root { --header-h: 72px; --gap: 16px; }

  .bottom-nav,
  .fab { display: none; }

  .app { padding: clamp(18px, 2.4vw, 28px) 24px 40px; }

  .view-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Keep tall cards from running off a 1080p screen. */
  .view-grid .card { max-height: calc(100dvh - var(--header-h) - 150px); }

  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .toasts { bottom: 22px; }
}

@media (min-width: 1500px) {
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tile { min-height: 180px; }
}

/* --------------------------------------------------------------------------
   24. Shared form bits used by the app modals
   (login/logout have their own stylesheet: assets/css/auth.css)
   -------------------------------------------------------------------------- */
.auth-help {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.5;
}
.auth-help code {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 11px;
}

.auth-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.4;
}
.auth-check + .auth-check { margin-top: 12px; }
.auth-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--brand);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   25. People & logins admin
   -------------------------------------------------------------------------- */
.modal-wide { max-width: 580px; }
.modal-head .btn { margin-left: auto; }
.modal-head .btn + .icon-btn { margin-left: 8px; }

.user-rows { display: grid; gap: 8px; }

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.user-row:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.user-row.is-inactive { opacity: 0.62; }

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

.user-row-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.user-row-you {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  margin-left: 4px;
  vertical-align: 1px;
}

.user-row-meta {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-subtle);
  margin-top: 1px;
}

.user-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.user-row-edit {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
}

.input-colour {
  padding: 4px;
  height: 42px;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   26. Print & motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .confetti-layer { display: none; }
}

@media print {
  .topbar, .bottom-nav, .fab, .toasts, .modal-backdrop, .kid-mode { display: none !important; }
  .app { height: auto; padding: 0; }
  .view { display: block !important; }
  .view-grid { display: block; }
  .card { break-inside: avoid; box-shadow: none; margin-bottom: 12px; }
  .card-body { overflow: visible; }
}
