/* CareSync — botanical watercolor theme: linen paper, eucalyptus green, terracotta. Art made in Kittl. */
:root {
  --bg: #f5ede0;
  --card: rgba(255, 252, 246, 0.93);
  --card-solid: #fffcf6;
  --ink: #2b2925;
  --muted: #645d55;
  --border: #e6d9c6;
  --border-strong: #928470;
  --ok-ink: #2d6644;
  --primary: #2f5e4e;
  --primary-strong: #234a3d;
  --primary-soft: #e3ece5;
  --accent: #e3a184;
  --accent-soft: #f8e5da;
  --accent-ink: #973f25;
  --ok: #5c9670;
  --ok-soft: #e4f0e6;
  --warn: #d98a5e;
  --danger: #a33d2b;
  --danger-soft: #f8e1dc;
  --lav: #9d93c4;
  --radius: 0.85rem;
  --radius-lg: 1.35rem;
  --shadow: 0 1px 2px rgba(74, 58, 38, 0.06), 0 8px 24px rgba(74, 58, 38, 0.08);
  --font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sidebar: 15.5rem;
  --tap: 2.75rem;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html.large { font-size: 20px; }
html.large { --tap: 3.4rem; }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  min-height: 100vh;
  min-height: 100dvh;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background: url("../img/bg.jpg") center / cover no-repeat;
}
@media (max-aspect-ratio: 4/5) { body::before { background-image: url("../img/bg-tall.jpg"); } }
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background: rgba(250, 245, 236, 0.35);
}

h1, h2, h3 { font-weight: 800; letter-spacing: -0.01em; margin: 0; line-height: 1.2; }
h1, h2 { font-family: var(--display); font-weight: 650; letter-spacing: -0.015em; font-optical-sizing: auto; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0; }
a { color: var(--primary-strong); }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.tiny { font-size: 0.78rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  width: var(--sidebar);
  flex: none;
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  padding: 1.25rem 0.9rem;
  background: rgba(253, 249, 242, 0.95);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--display); font-weight: 650; font-size: 1.3rem; letter-spacing: -0.01em; padding: 0.2rem 0.5rem 1rem; color: var(--ink); text-decoration: none; }
.brand img { width: 2.1rem; height: 2.1rem; border-radius: 0.6rem; }
.nav { display: flex; flex-direction: column; gap: 0.25rem; }
.nav a {
  display: flex; align-items: center; gap: 0.75rem;
  min-height: var(--tap);
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius);
  color: var(--ink); text-decoration: none; font-weight: 700;
}
.nav a:hover { background: var(--primary-soft); }
.nav a.active { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(47, 94, 78, 0.3); }
.nav svg { width: 1.3rem; height: 1.3rem; flex: none; }
.sidebar .spacer { flex: 1; }
.side-foot { display: flex; flex-direction: column; gap: 0.6rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.me-chip { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0.4rem; }
.me-chip .name { font-weight: 800; line-height: 1.1; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none;
  position: sticky; top: 0; z-index: 20;
  align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  padding-top: calc(0.6rem + env(safe-area-inset-top));
  background: rgba(253, 249, 242, 0.97);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { padding: 0; font-size: 1.1rem; flex: 1; }
.view { width: 100%; max-width: 62rem; margin: 0 auto; padding: 1.5rem 1.5rem 3rem; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.view-head p { margin-top: 0.2rem; }

.drawer-back { position: fixed; inset: 0; background: rgba(43, 41, 37, 0.35); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-back.open { opacity: 1; pointer-events: auto; }
.drawer .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-105%); transition: transform .25s ease; background: #fdf9f2; width: min(19rem, 86vw); padding-top: calc(1.25rem + env(safe-area-inset-top)); }
.drawer.open .sidebar { transform: none; box-shadow: 8px 0 30px rgba(43, 41, 37, 0.18); }

@media (max-width: 860px) {
  .shell > .sidebar { display: none; }
  .topbar { display: flex; }
  .view { padding: 1.1rem 1rem 3rem; padding-bottom: calc(3rem + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.45rem; }
}
@media (min-width: 861px) { .drawer, .drawer-back { display: none; } }

/* ---------- Cards & layout ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem;
}
.card + .card, .stack > * + * { margin-top: 1rem; }
.grid > .card + .card, .grid > * { margin-top: 0; }
#view:focus { outline: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.85rem; flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 0.5rem; }
.card-head h2 .ico { width: 1.9rem; height: 1.9rem; border-radius: 0.6rem; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-strong); }
.card-head h2 .ico svg { width: 1.1rem; height: 1.1rem; }
.card-head h2 .ico.peach { background: var(--accent-soft); color: var(--accent-ink); }
.card-head h2 .ico.green { background: var(--ok-soft); color: var(--ok-ink); }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }

.hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 1rem;
  min-height: 9.5rem; padding-right: 40%;
  background: linear-gradient(120deg, rgba(255, 252, 246, 0.97) 35%, rgba(248, 229, 218, 0.95));
}
.hero h1 { font-size: 1.7rem; }
.hero-art { position: absolute; right: 0; bottom: 0; height: 100%; width: auto; max-width: 42%; object-fit: contain; object-position: right bottom; pointer-events: none; }
@media (max-width: 560px) {
  .hero { flex-wrap: wrap; padding-right: 1.2rem; padding-bottom: 0; }
  .hero > .grow, .hero > div:not(.avatar-stack) { flex-basis: calc(100% - 4.5rem); }
  .hero-art { position: static; height: auto; width: 100%; max-width: 15rem; margin: 0.3rem auto 0; display: block; }
}
.auth-art { display: block; width: 100%; max-width: 13rem; height: auto; margin: -0.4rem auto 0.2rem; }
.stat { display: flex; flex-direction: column; gap: 0.15rem; }
.stat .big { font-family: var(--display); font-size: 1.85rem; font-weight: 650; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-weight: 800; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
a.card.stat { transition: transform .15s, box-shadow .15s; }
a.card.stat:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(74,58,38,.06), 0 14px 30px rgba(74,58,38,.12); }
.progress { height: 0.55rem; background: var(--primary-soft); border-radius: 99px; overflow: hidden; margin-top: 0.45rem; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s; }

/* ---------- Buttons & inputs ---------- */
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: var(--tap);
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--primary); color: #fff;
  font: inherit; font-weight: 800; font-size: 0.97rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, transform .05s, box-shadow .15s;
  box-shadow: 0 3px 10px rgba(47, 94, 78, 0.25);
}
.btn:hover { background: var(--primary-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn svg { width: 1.15rem; height: 1.15rem; }
.btn.secondary { background: var(--card-solid); color: var(--ink); border-color: var(--border); box-shadow: none; }
.btn.secondary:hover { background: #f4ebde; }
.btn.peach { background: var(--accent); color: #4a2414; box-shadow: 0 3px 10px rgba(227, 161, 132, 0.4); }
.btn.peach:hover { background: #db9172; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: none; }
.btn.ghost:hover { background: rgba(230, 217, 198, 0.55); }
.btn.danger { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.btn.danger:hover { background: #f3cfc9; }
.btn.block { width: 100%; }
.btn.icon { padding: 0; width: var(--tap); }
.btn.sm { min-height: 2.75rem; padding: 0.35rem 0.75rem; font-size: 0.88rem; }
html.large .btn.sm { min-height: 2.8rem; }

label.field { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 700; font-size: 0.92rem; }
.field .hint { font-weight: 600; color: var(--muted); font-size: 0.82rem; }
.input, select.input, textarea.input {
  width: 100%;
  min-height: var(--tap);
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fffdf8;
  color: var(--ink);
  font: inherit; font-size: 1rem;
}
textarea.input { min-height: 5rem; resize: vertical; }
.input:focus, .btn:focus-visible, .check:focus-visible, .chip:focus-visible, .nav a:focus-visible, .cal-day:focus-visible, a:focus-visible, .switch input:focus-visible, button:focus-visible {
  outline: 3px solid var(--primary); outline-offset: 2px;
}
label.btn:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }
.nav a.active:focus-visible { outline-color: var(--ink); }
.form { display: flex; flex-direction: column; gap: 0.95rem; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
@media (max-width: 480px) { .form .two { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  min-height: 2.5rem; padding: 0.25rem 0.75rem;
  border-radius: 99px; border: 1px solid var(--border);
  background: #fffdf8; color: var(--ink);
  font: inherit; font-weight: 700; font-size: 0.88rem; cursor: pointer;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.6rem; border-radius: 99px; background: var(--primary-soft); color: var(--primary-strong); font-weight: 800; font-size: 0.8rem; }
.pill.peach { background: var(--accent-soft); color: var(--accent-ink); }
.pill.ok { background: var(--ok-soft); color: var(--ok-ink); }
.pill.gray { background: #efe7db; color: var(--muted); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: var(--tap); font-weight: 700; cursor: pointer; }
.switch input { -webkit-appearance: none; appearance: none; width: 2.9rem; height: 1.65rem; border-radius: 99px; background: #b3a593; position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 0.18rem; left: 0.18rem; width: 1.29rem; height: 1.29rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(1.25rem); }

/* ---------- Avatars ---------- */
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; font-weight: 800; color: #fff; background: var(--primary); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(43, 41, 37, 0.15); overflow: hidden; }
.avatar.peach { background: var(--accent); color: #4a2414; }
.avatar-stack { display: flex; }
.avatar-stack .avatar + .avatar { margin-left: -0.6rem; }

/* ---------- Dose / task lists ---------- */
.list { display: flex; flex-direction: column; gap: 0.55rem; }
.item {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius);
  background: #fffdf8;
  border: 1px solid var(--border);
}
.item.due { background: var(--accent-soft); border-color: #efc8b4; }
.item.done { background: var(--ok-soft); border-color: #c7dfcd; }
.item .title { font-weight: 800; }
.item .sub { color: var(--muted); font-size: 0.86rem; font-weight: 600; }
.item.done .title { text-decoration: line-through; text-decoration-color: rgba(59,53,48,.35); }
.check {
  -webkit-appearance: none; appearance: none;
  width: var(--tap); height: var(--tap); flex: none;
  border-radius: 0.8rem; border: 2px solid var(--border-strong); background: #fff;
  display: grid; place-items: center; cursor: pointer; margin: 0;
  transition: background .15s, border-color .15s;
}
.check:checked { background: var(--ok); border-color: var(--ok); }
.check:checked::after { content: ""; width: 42%; height: 22%; border: solid #fff; border-width: 0 0 0.22rem 0.22rem; transform: rotate(-45deg) translate(6%, -18%); }
.time-badge { flex: none; min-width: 4.6rem; text-align: center; font-weight: 800; font-size: 0.9rem; padding: 0.3rem 0.4rem; border-radius: 0.6rem; background: var(--primary-soft); color: var(--primary-strong); }
.item.due .time-badge { background: #f5d3c2; color: var(--accent-ink); }
.item.done .time-badge { background: #cde3d2; color: var(--ok-ink); }
.item.late { background: #fbe7e2; border-color: #ecbcb0; }
.item.late .time-badge { background: #f6cfc5; color: var(--danger); }
.item.late .sub { color: var(--danger); }
.time-inline { display: none; font-weight: 800; color: var(--primary-strong); font-size: 0.9rem; }
.item.due .time-inline { color: var(--accent-ink); }
.item.done .time-inline { color: var(--ok-ink); }
.item.late .time-inline { color: var(--danger); }
/* Large buttons on a phone: move the time into the text so names have room. */
@media (max-width: 560px) {
  html.large .item > .time-badge { display: none; }
  html.large .time-inline { display: block; }
}
.empty { text-align: center; padding: 1.4rem 1rem; color: var(--muted); }
.empty .big-ico { width: 3.2rem; height: 3.2rem; margin: 0 auto 0.6rem; border-radius: 1rem; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-strong); }
.empty .big-ico svg { width: 1.6rem; height: 1.6rem; }

/* ---------- Medications ---------- */
.med-card { display: flex; gap: 0.9rem; align-items: flex-start; }
.med-photo { width: 4.5rem; height: 4.5rem; border-radius: 0.9rem; object-fit: cover; flex: none; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent-ink); border: 1px solid var(--border); cursor: zoom-in; }
.med-photo svg { width: 1.8rem; height: 1.8rem; }
.med-msg { margin-top: 0.5rem; padding: 0.5rem 0.75rem; border-radius: 0.75rem; background: var(--accent-soft); color: #6b3622; font-weight: 600; font-style: italic; font-size: 0.9rem; }
.week-dots { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.45rem; }
.week-dots .wd-label { flex-basis: 100%; margin-top: 0.15rem; }
.week-dots span { width: 0.75rem; height: 0.75rem; border-radius: 50%; background: #e8ddcd; }
.week-dots span.full { background: var(--ok); }
.week-dots span.part { background: linear-gradient(90deg, var(--ok) 50%, #e8ddcd 50%); border: 1px solid var(--ok); }
.week-dots span.none { background: transparent; border: 1px dashed var(--border-strong); }
.week-dots span.missed { background: #fff; border: 2px solid var(--danger); }
.times-edit { display: flex; flex-direction: column; gap: 0.45rem; }
.times-edit .row .input { max-width: 11rem; }
.photo-drop { display: flex; align-items: center; gap: 0.8rem; }
.photo-drop img { width: 5rem; height: 5rem; object-fit: cover; border-radius: 0.8rem; border: 1px solid var(--border); }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 0.5rem; }
.cal-head h2 { flex: 1; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.3rem; margin-top: 0.8rem; }
.cal-dow { text-align: center; font-weight: 800; font-size: 0.78rem; color: var(--muted); padding-bottom: 0.2rem; }
.cal-day {
  aspect-ratio: 1 / 1; min-height: 2.6rem;
  border-radius: 0.8rem; border: 1px solid transparent; background: rgba(255, 254, 251, 0.75);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 0.15rem;
  padding: 0.3rem 0.15rem; cursor: pointer; font: inherit; font-weight: 800; color: var(--ink);
}
.cal-day.other { color: var(--muted); font-weight: 600; background: transparent; }
.cal-day.today { border-color: var(--primary); }
.cal-day.sel { background: var(--primary); color: #fff; }
.cal-day .dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
.cal-day .dots i { width: 0.42rem; height: 0.42rem; border-radius: 50%; display: block; }
.cal-day.sel .dots i { box-shadow: 0 0 0 1.5px #fff; }
.t-doctor { background: var(--primary); }
.t-refill { background: var(--accent); }
.t-activity { background: var(--ok); }
.t-other { background: var(--lav); }
.legend { display: flex; flex-wrap: wrap; gap: 0.8rem; font-size: 0.82rem; font-weight: 700; color: var(--muted); margin-top: 0.8rem; }
.legend i { display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 50%; margin-right: 0.3rem; vertical-align: middle; }
.ev-bar { width: 0.35rem; align-self: stretch; border-radius: 99px; flex: none; }
@media (min-width: 900px) { .cal-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; align-items: start; } .cal-layout > .card + .card { margin-top: 0; } }

/* ---------- Activity ---------- */
.bars { display: flex; align-items: flex-end; gap: 0.5rem; height: 8rem; padding-top: 0.5rem; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; height: 100%; justify-content: flex-end; }
.bars .bar span.fill { width: 100%; max-width: 2.4rem; background: linear-gradient(180deg, var(--primary), #7fae98); border-radius: 0.5rem 0.5rem 0.25rem 0.25rem; min-height: 4px; }
.bars .bar.today span.fill { background: linear-gradient(180deg, var(--accent), #f3cbb6); }
.bars .bar small { font-weight: 800; color: var(--muted); font-size: 0.72rem; }
.map { height: 18rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #eee5d7; z-index: 0; }
.map-fallback { height: 100%; display: grid; place-items: center; text-align: center; padding: 1rem; color: var(--muted); }
.map-fallback svg { width: 2.5rem; height: 2.5rem; margin: 0 auto 0.4rem; display: block; }
.empty svg { flex: none; }
.loc-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0; }
.loc-row + .loc-row { border-top: 1px dashed var(--border); }

/* ---------- Dialog / toast / banner ---------- */
dialog.sheet {
  border: none; padding: 0; margin: auto;
  width: min(34rem, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 2rem);
  border-radius: var(--radius-lg);
  background: var(--card-solid); color: var(--ink);
  box-shadow: 0 20px 60px rgba(43, 41, 37, 0.3);
}
dialog.sheet::backdrop { background: rgba(43, 41, 37, 0.42); }
dialog.sheet form { display: flex; flex-direction: column; max-height: calc(100dvh - 2rem); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem 0.4rem; }
.sheet-body { padding: 0.6rem 1.2rem 1rem; overflow-y: auto; }
.sheet-foot { display: flex; gap: 0.6rem; justify-content: flex-end; padding: 0.8rem 1.2rem 1rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.sheet-foot .left { margin-right: auto; }
@media (max-width: 600px) {
  dialog.sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .sheet-foot { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
  .sheet-foot .btn { flex: 1; }
  .sheet-foot .left { flex: 0 0 auto; }
}
dialog.photo { background: transparent; box-shadow: none; padding: 0; border: none; max-width: 95vw; }
dialog.photo img { max-height: 85vh; border-radius: 1rem; display: block; }
dialog.photo::backdrop { background: rgba(30, 26, 22, 0.75); }

.toasts { position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 0.5rem; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 2rem); }
.toast { pointer-events: auto; background: #2b2925; color: #fff; padding: 0.7rem 1rem; border-radius: 0.9rem; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.2); display: flex; align-items: center; gap: 0.8rem; animation: pop .2s ease; }
.toast button { background: none; border: none; color: #a9dcc3; font: inherit; font-weight: 800; cursor: pointer; padding: 0.2rem; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

.reminders {
  position: fixed; left: 50%; top: calc(0.8rem + env(safe-area-inset-top)); transform: translateX(-50%);
  z-index: 90; width: min(30rem, calc(100vw - 1.5rem));
  display: flex; flex-direction: column; gap: 0.6rem;
  max-height: calc(100dvh - 2rem); overflow-y: auto;
}
.reminders:empty { display: none; }
.reminder {
  background: #fffcf6; border: 2px solid var(--accent); border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(43, 41, 37, 0.25); padding: 1rem 1.1rem;
  animation: pop .25s ease;
}
.reminder .row { margin-top: 0.7rem; }

.banner { display: flex; align-items: center; gap: 0.8rem; padding: 0.75rem 1rem; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid #efc8b4; margin-bottom: 1rem; font-weight: 700; flex-wrap: wrap; }
.banner.teal { background: var(--primary-soft); border-color: #c3d6c9; }
.banner .grow { min-width: 12rem; }

.offline-pill { display: none; }
html.offline .offline-pill { display: inline-flex; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.auth-card { width: min(27rem, 100%); }
.auth-card .brand { justify-content: center; font-size: 1.75rem; padding-bottom: 0.4rem; }
.auth-card .brand img { width: 3rem; height: 3rem; border-radius: 0.8rem; }
.auth-card .tag { text-align: center; color: var(--muted); margin-bottom: 1.2rem; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.role-pick label { border: 2px solid var(--border); border-radius: var(--radius); padding: 0.8rem; cursor: pointer; background: #fffdf8; display: flex; flex-direction: column; gap: 0.2rem; font-weight: 800; }
.role-pick label small { font-weight: 600; color: var(--muted); }
.role-pick input { position: absolute; opacity: 0; pointer-events: none; }
.role-pick label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Added: form errors, drawer, dashboard order ---------- */
.sheet-error { margin: 0 1.2rem; color: var(--danger); font-weight: 800; }
.sheet-error:empty { display: none; }
.sheet-error:not(:empty) { padding: 0.6rem 0.8rem; margin-bottom: 0.4rem; background: var(--danger-soft); border-radius: var(--radius); }
.sheet-error:focus { outline: 3px solid var(--danger); outline-offset: 2px; }
[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 2px rgba(163, 61, 43, 0.25); }
.drawer:not(.open) .sidebar { visibility: hidden; }
.dash { display: flex; flex-direction: column; gap: 1rem; }
.dash > * { margin-top: 0 !important; }
@media (max-width: 700px) {
  .dash-hero { order: 0; } .dash-main { order: 1; } .dash-stats { order: 2; } .dash-coming { order: 3; }
}
