/* Heidi's Dog House app. Warm, quiet, and professional: warm neutrals, one terracotta accent, and the dogs' photos. */

:root {
  --cream: #f7f5f1;
  --paper: #f1ede7;
  --surface: #ffffff;
  --sunken: #fbfaf8;
  --ink: #1c1917;
  --body: #44403b;
  --muted: #78716c;
  --line: #e7e2db;
  --line-strong: #d9d2c8;
  --terra: #9a4f2e;
  --terra-dark: #7c3d22;
  --terra-soft: #f6ece5;
  --sage: #4d6b55;
  --sage-soft: #e8f0ea;
  --gold-soft: #f8f0dd;
  --gold-ink: #7d5a14;
  --danger: #b03a2e;
  --danger-soft: #fbe9e6;
  --white: #ffffff;

  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 1px 1px rgba(28, 25, 23, 0.02);
  --shadow-pop: 0 12px 32px -12px rgba(28, 25, 23, 0.22), 0 2px 6px rgba(28, 25, 23, 0.06);
}

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }
a { color: var(--terra); text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--terra-dark); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3 { margin: 0; color: var(--ink); }
h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(28px, 3.4vw, 34px); line-height: 1.15; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; }
h3 { font-size: 15px; font-weight: 600; line-height: 1.35; }
p { margin: 0; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
.narrow { max-width: 600px; }
.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 28px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--muted); }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--ink); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; margin-right: auto; font-family: var(--serif); font-weight: 500; font-size: 18px; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--terra); color: var(--white); font-size: 16px; font-weight: 500; line-height: 1; }
.brand-tag { font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: 0.02em; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; }

/* Header (client and public pages) */
.app-header { flex: none; position: relative; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.app-header .container { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; min-height: 60px; }
.app-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.app-nav a { color: var(--body); text-decoration: none; font-weight: 500; font-size: 14px; padding: 6px 10px; border-radius: 6px; }
.app-nav a:hover { background: var(--paper); color: var(--ink); }
.app-nav a[aria-current="page"] { background: var(--paper); color: var(--ink); font-weight: 600; }
.nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 5px; background: var(--terra); color: var(--white); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Admin shell: a sidebar for navigation, the page beside it */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.sidebar { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding: 18px 12px; background: var(--sunken); border-right: 1px solid var(--line); }
.sidebar .brand { margin: 0; padding: 0 6px; font-size: 16px; white-space: nowrap; gap: 9px; }
.sidebar .brand-mark { width: 26px; height: 26px; font-size: 15px; }
.side-nav { display: grid; gap: 1px; }
.side-nav a, .side-link { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: none; color: var(--body); font: 500 14px/1.4 var(--sans); text-align: left; text-decoration: none; cursor: pointer; }
.side-nav a:hover, .side-link:hover { background: var(--paper); color: var(--ink); }
.side-nav a[aria-current="page"] { background: #ebe6df; color: var(--ink); font-weight: 600; }
.side-foot { margin-top: auto; display: grid; gap: 1px; padding-top: 12px; border-top: 1px solid var(--line); }
.side-foot .button_to { display: block; }
.shell-main { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .sidebar { position: relative; z-index: 20; height: auto; overflow: visible; background: color-mix(in srgb, var(--sunken) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { margin-right: auto; padding: 0; }
  .side-nav { order: 3; flex-basis: 100%; display: flex; gap: 2px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .side-nav a { flex: none; width: auto; }
  .side-foot { margin: 0; padding: 0; border: 0; display: flex; gap: 2px; }
  .side-link { width: auto; padding: 6px 8px; font-size: 13px; color: var(--muted); }
  .sidebar .brand { font-size: 15px; }
  .sidebar .brand-tag { display: none; }
}

main { padding: clamp(24px, 4vw, 40px) 0 72px; }

/* Only the content scrolls. The navigation stays put, and so does each page's title bar with its actions. */
.app-frame { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.app-frame > main { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/* A sticky element stops at the scroller's padding, so the top spacing lives on the container instead. */
.app-frame > main, .shell-main { padding-top: 0; }
.app-frame > main > .container, .shell-main > .container { padding-top: clamp(24px, 4vw, 40px); }
.public .app-header { position: sticky; top: 0; }
.page-head, .cal-toolbar { position: sticky; top: 0; z-index: 15; margin-top: -16px; padding-top: 16px; padding-bottom: 12px; background: var(--cream); }
@supports (animation-timeline: scroll()) {
  .page-head, .cal-toolbar { animation: page-head-stuck linear both; animation-timeline: scroll(nearest); animation-range: 0 32px; }
}
@keyframes page-head-stuck { to { box-shadow: 0 1px 0 var(--line), 0 8px 16px -14px rgba(28, 25, 23, 0.25); } }
[id] { scroll-margin-top: 96px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 + p, .page-head p { color: var(--muted); margin-top: 4px; font-size: 14px; }
.page-head-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.page-head .tabs { margin: 0; }

/* Flash */
.flash { border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 20px; font-weight: 500; font-size: 14px; border: 1px solid transparent; }
.flash-notice { background: var(--sage-soft); border-color: #d3e2d7; color: #2f4a37; }
.flash-alert { background: var(--danger-soft); border-color: #f2cfc8; color: var(--danger); }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: 600 14px/1.2 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  background: var(--terra); color: var(--white); box-shadow: 0 1px 2px rgba(124, 61, 34, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: background-color 120ms, border-color 120ms;
}
.button:hover { background: var(--terra-dark); color: var(--white); }
.button-secondary, .button-quiet { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow); }
.button-secondary:hover, .button-quiet:hover { background: var(--sunken); border-color: #c9c0b4; color: var(--ink); }
.button-danger { background: var(--surface); color: var(--danger); border-color: #ecc3bb; box-shadow: var(--shadow); }
.button-danger:hover { background: var(--danger-soft); color: var(--danger); }
.button-small { min-height: 32px; padding: 5px 11px; font-size: 13px; }
.button[disabled] { opacity: 0.6; cursor: progress; }
button.button, input[type="submit"].button { appearance: none; -webkit-appearance: none; }
.form > input[type="submit"].button, .form > .button { justify-self: start; }
.auth-card .form > input[type="submit"].button { justify-self: stretch; min-height: 42px; }
.app-nav .button_to { display: inline-flex; align-items: center; }
.app-nav .link-button { color: var(--body); text-decoration: none; font-weight: 500; font-size: 14px; padding: 6px 10px; border-radius: 6px; line-height: inherit; }
.app-nav .link-button:hover { background: var(--paper); color: var(--ink); }
.link-button { background: none; border: 0; padding: 0; color: var(--terra); font: inherit; font-weight: 500; cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
.button_to { display: inline; }

/* Cards and lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 2.6vw, 24px); box-shadow: var(--shadow); }
.card-tint { background: var(--paper); border-color: transparent; box-shadow: none; }
.card h2 { margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.caretaker-form { gap: 8px; padding-top: 4px; }
.caretaker-form select { width: auto; min-width: 180px; }
.doses .dose-time { min-width: 76px; font-variant-numeric: tabular-nums; }
.doses > li.is-given .dose-time, .doses > li.is-given .list-title { color: var(--muted); }
.web-push:not([data-state="off"]) .web-push-off, .web-push:not([data-state="on"]) .web-push-on, .web-push:not([data-state="blocked"]) .web-push-blocked { display: none; }
.list-title { font-weight: 600; color: var(--ink); text-decoration: none; }
a.list-title:hover { color: var(--terra); }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); display: grid; gap: 12px; justify-items: center; font-size: 14px; }

.details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 24px; margin: 0; font-size: 14px; }
.details dt { color: var(--muted); font-weight: 500; }
.details dd { margin: 0; white-space: pre-line; color: var(--ink); }

/* Badges: a quiet tint, a dot, and a word */
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap; background: var(--paper); color: var(--body); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.badge-requested, .badge-waitlisted, .badge-pending, .badge-limited, .badge-unpaid { background: var(--gold-soft); color: var(--gold-ink); }
.badge-confirmed, .badge-approved, .badge-scheduled, .badge-open, .badge-paid, .badge-completed { background: var(--sage-soft); color: #2f4a37; }
.badge-declined, .badge-full, .badge-expired { background: var(--danger-soft); color: var(--danger); }
.badge-cancelled { background: var(--paper); color: var(--muted); }

/* Dogs */
.dog-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: center; text-decoration: none; color: inherit; transition: border-color 120ms; }
.dog-card:hover { border-color: var(--line-strong); }
.dog-card:hover h3 { color: var(--terra); }
.avatar { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--paper); display: grid; place-items: center; font-family: var(--serif); font-size: 26px; color: var(--muted); flex: none; }
.avatar-lg { width: 112px; height: 112px; border-radius: 16px; font-size: 42px; }
.avatar-sm { width: 36px; height: 36px; border-radius: 8px; font-size: 16px; }

/* Forms */
.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: minmax(0, 1fr); } }
.field { display: grid; gap: 6px; align-content: start; }
.field label, .field legend { font-weight: 500; font-size: 13px; color: var(--ink); }
.field legend { margin-bottom: 2px; }
.hint, .field .hint { font-size: 13px; color: var(--muted); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="password"],
.field input[type="number"], .field input[type="date"], .field input[type="datetime-local"], .field input[type="search"],
.field input[type="time"], .field select, .field textarea {
  width: 100%; font: 15px/1.4 var(--sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 11px; min-height: 40px;
  box-shadow: inset 0 1px 1px rgba(28, 25, 23, 0.03); transition: border-color 120ms, box-shadow 120ms;
}
.field textarea { min-height: 104px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #a8a29e; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 3px color-mix(in srgb, var(--terra) 16%, transparent); }
.field input[type="file"] { font: inherit; font-size: 14px; }
.field fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-size: 14px; transition: border-color 120ms, background-color 120ms; }
.choice:hover { border-color: #c9c0b4; }
.choice:has(input:checked) { border-color: var(--terra); background: var(--terra-soft); }
.choice input { width: 16px; height: 16px; accent-color: var(--terra); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice.is-disabled { cursor: default; flex-wrap: wrap; background: var(--sunken); }
.choice.is-disabled > span { flex-basis: 100%; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-top: 4px; }
.errors { background: var(--danger-soft); border: 1px solid #f2cfc8; color: var(--danger); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 14px; }
.errors ul { margin: 6px 0 0; padding-left: 20px; }
.field_with_errors { display: contents; }
.field_with_errors input, .field_with_errors select, .field_with_errors textarea { border-color: var(--danger); }

/* Calendar */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar-head { font-size: 12px; font-weight: 500; color: var(--muted); text-align: center; padding-bottom: 4px; }
.calendar-day { min-height: 64px; border-radius: var(--radius-sm); padding: 6px 8px; background: var(--surface); border: 1px solid var(--line); display: grid; align-content: space-between; gap: 4px; font-size: 13px; }
.calendar-day .day-number { font-weight: 500; font-size: 13px; }
.calendar-day.is-past { opacity: 0.45; }
.calendar-day.is-blank { background: transparent; border-color: transparent; }
.calendar-day.is-today { box-shadow: inset 0 0 0 1.5px var(--terra); }
.calendar-day.status-open { background: var(--sage-soft); }
.calendar-day.status-limited { background: var(--gold-soft); }
.calendar-day.status-full { background: var(--danger-soft); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) {
  .calendar { gap: 3px; }
  .calendar-day { min-height: 48px; padding: 4px; font-size: 11px; }
}

/* Stay updates */
.feed { display: grid; gap: 20px; }
.update { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.update-meta { font-size: 13px; color: var(--muted); }
.update-body { white-space: pre-line; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.media-grid img, .media-grid video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); background: var(--paper); }
.media-grid a { display: block; }

/* Auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: var(--cream); }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(24px, 5vw, 36px); box-shadow: var(--shadow-pop); display: grid; gap: 20px; }
.auth-card .brand { justify-content: center; margin: 0 0 4px; font-size: 19px; }
.auth-card h1 { font-size: 24px; text-align: center; }
.auth-card h1 + p { text-align: center; }
.auth-links { text-align: center; font-size: 14px; color: var(--muted); display: grid; gap: 6px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; font-weight: 500; color: var(--muted); background: var(--sunken); white-space: nowrap; }
tbody tr { transition: background-color 120ms; }
tbody tr:hover { background: var(--sunken); }
/* A row that opens a page: the first link stretches over the whole row, other links in it stay clickable on top. */
tr.row-link { position: relative; cursor: pointer; }
tr.row-link .row-link-main::after { content: ""; position: absolute; inset: 0; }
tr.row-link a:not(.row-link-main) { position: relative; z-index: 1; }
tr:last-child td { border-bottom: 0; }
/* Column headers stick under the page's title bar. Phones keep side-scrolling tables instead. */
@media (min-width: 721px) {
  .table-wrap { overflow: visible; }
  .table-wrap thead th { position: sticky; top: var(--page-head-height, 0px); z-index: 10; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line); }
  .table-wrap thead th:first-child { border-top-left-radius: calc(var(--radius) - 1px); }
  .table-wrap thead th:last-child { border-top-right-radius: calc(var(--radius) - 1px); }
}
td a { color: var(--ink); text-decoration: none; }
td:first-child a { font-weight: 500; }
td a[href^="tel:"], td a[href^="mailto:"] { white-space: nowrap; }
td a:hover { color: var(--terra); text-decoration: underline; }

.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; margin-bottom: 20px; padding: 3px; background: var(--paper); border-radius: 9px; }
.tabs a { padding: 5px 12px; border-radius: 6px; text-decoration: none; font-weight: 500; font-size: 14px; color: var(--body); }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(28, 25, 23, 0.1); }

.stat { display: grid; gap: 2px; }
.stat strong { font-size: 28px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* Public landing page */
.public main { padding: 0; }
.landing-hero { padding: clamp(40px, 7vw, 88px) 0; }
.landing-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 72px); align-items: center; }
.landing-title { font-size: clamp(36px, 5vw, 54px); line-height: 1.08; letter-spacing: -0.02em; }
.landing-lede { font-size: clamp(17px, 2vw, 20px); color: var(--body); max-width: 34em; }
.landing-heading { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -0.01em; }
.landing-photos { position: relative; min-height: 440px; }
.landing-photo { width: 100%; object-fit: cover; border-radius: 16px; }
.landing-photo-main { position: absolute; left: 0; top: 0; width: 66%; aspect-ratio: 3 / 4; }
.landing-photo-side { position: absolute; right: 0; bottom: 0; width: 50%; aspect-ratio: 3 / 4; border: 6px solid var(--cream); }
.landing-section { padding: clamp(56px, 8vw, 96px) 0; }
.landing-section-tint { background: var(--paper); }
.landing-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.landing-step-number { width: 36px; height: 36px; border-radius: 8px; background: var(--terra-soft); color: var(--terra-dark); display: grid; place-items: center; font-size: 15px; font-weight: 600; }
.landing-split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 72px); align-items: center; }
.landing-split .landing-photo { aspect-ratio: 4 / 5; }
.landing-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; color: var(--body); }
.landing-features strong { color: var(--ink); }
.public-footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 14px; color: var(--muted); background: var(--cream); }
.public-footer a { color: var(--ink); }
@media (max-width: 860px) {
  .landing-hero-grid, .landing-split { grid-template-columns: minmax(0, 1fr); }
  .landing-photos { min-height: 0; aspect-ratio: 1 / 0.9; max-width: 480px; width: 100%; }
  .landing-steps { grid-template-columns: minmax(0, 1fr); }
  .landing-split .landing-photo { max-width: 420px; }
}
.app-nav a.button { color: var(--white); padding: 5px 12px; }
.app-nav a.button:hover { background: var(--terra-dark); color: var(--white); }

/* Two-factor */
.setup-steps { margin: 0; padding-left: 20px; display: grid; gap: 22px; }
.setup-steps li { display: grid; gap: 12px; }
.qr-wrap { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; width: 212px; justify-self: center; }
.qr-code { display: block; width: 100%; height: auto; }
.secret { display: block; margin-top: 6px; padding: 10px 12px; background: var(--paper); border-radius: var(--radius-sm); font-size: 15px; letter-spacing: 0.06em; word-break: break-all; }
.recovery-codes { list-style: none; margin: 0; padding: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.recovery-codes code { font-size: 16px; letter-spacing: 0.04em; }
.auth-links .button_to { display: block; }

/* Medication times */
.time-list { display: grid; gap: 8px; }
.time-list-item { display: flex; align-items: center; gap: 12px; }
.time-list-item input[type="time"] {
  font: 15px/1.4 var(--sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 11px; min-height: 40px; min-width: 150px;
}
.time-list-item input[type="time"]:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 3px color-mix(in srgb, var(--terra) 16%, transparent); }
.dose-times { display: flex; flex-wrap: wrap; gap: 6px; }


.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; }
/* Sign-up bot trap: off screen for people, still in the form for bots that fill every field. */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.warning-text { color: var(--danger); font-weight: 600; }

/* Admin day view */
.dog-roster { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.dog-roster a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color 120ms, background-color 120ms; }
.dog-roster a:hover { border-color: var(--line-strong); background: var(--sunken); color: var(--ink); }
.dog-roster a > span:last-child { display: grid; min-width: 0; line-height: 1.3; }
.dog-roster strong, .dog-roster .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Pricing */
.pricing-table td, .pricing-table th { vertical-align: middle; }
.pricing-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pricing-table tfoot th { font-size: 14px; font-weight: 600; color: var(--ink); background: var(--surface); border-top: 1px solid var(--line-strong); }
.pricing-table tr.is-waived .pricing-amount { text-decoration: line-through; color: var(--muted); }
.pricing-table .cell-action { text-align: right; white-space: nowrap; }
.pricing-actions { display: inline-flex; align-items: center; gap: 8px; }
.pricing-menu { position: relative; }
.pricing-menu > summary { list-style: none; }
.pricing-menu > summary::-webkit-details-marker { display: none; }
.pricing-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: 300px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); text-align: left; white-space: normal; }
.price-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.price-lines li { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.price-lines li span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-wrap.pricing-table { overflow: visible; }
@media (max-width: 640px) {
  .table-wrap.pricing-table { overflow-x: auto; }
  .pricing-pop { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; }
}

/* Admin vaccine records */
.vaccine-card { display: grid; gap: 18px; scroll-margin-top: 24px; }
.vaccine-card:target { border-color: var(--terra); box-shadow: 0 0 0 3px color-mix(in srgb, var(--terra) 14%, transparent); }
.vaccine-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.vaccine-card-head h2 { margin: 0; font-size: 17px; }
.vaccine-card-head h2 a { color: var(--ink); text-decoration: none; }
.vaccine-card-head h2 a:hover { color: var(--terra); }
.vaccine-card-head > div { display: grid; gap: 2px; }
.vaccine-table td { vertical-align: middle; }
.vaccine-table .cell-action { text-align: right; white-space: nowrap; }
@media (max-width: 640px) {
  .vaccine-card-head { grid-template-columns: auto minmax(0, 1fr); }
  .vaccine-card-head > .button { grid-column: 1 / -1; justify-self: start; }
}
.choice-override { align-items: flex-start; border-style: dashed; }
.choice-override input { margin-top: 3px; flex: none; }

/* Admin calendar */
.segmented { display: inline-flex; align-items: stretch; gap: 2px; background: var(--paper); border-radius: 9px; padding: 3px; }
.segmented a { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 30px; padding: 0 10px; border-radius: 6px; color: var(--body); font-size: 13px; font-weight: 500; text-decoration: none; }
.segmented a:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); color: var(--ink); }
.segmented a[aria-current] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(28, 25, 23, 0.1); }

/* Month view: a light grid with the dogs' names right in each day, like a modern calendar app. */
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 6px; }
.cal-toolbar-title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.cal-toolbar h1 .muted { color: #a8a29e; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.icon-button { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--body); box-shadow: var(--shadow); }
.icon-button:hover { background: var(--sunken); color: var(--ink); }
.cal-attention { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: var(--radius-sm); background: var(--gold-soft); color: var(--gold-ink); font-size: 13px; font-weight: 500; text-decoration: none; }
.cal-attention::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cal-attention:hover { color: var(--gold-ink); background: #f3e6c6; }
.cal-stats { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.cal-stats strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.cal { --cal-line: #efebe5; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-weekdays { border-bottom: 1px solid var(--cal-line); }
.cal-weekdays div { padding: 8px 10px; font-size: 12px; font-weight: 500; color: var(--muted); }
.cal-cell { position: relative; height: 124px; padding: 6px 6px 8px; border-right: 1px solid var(--cal-line); border-bottom: 1px solid var(--cal-line); display: flex; flex-direction: column; gap: 3px; min-width: 0; transition: background-color 120ms; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:nth-last-child(-n + 7) { border-bottom: 0; }
.cal-cell:hover { background: var(--sunken); }
.cal-cell.is-blocked { background: #f6f3ef; }

/* The whole day is one link to that day. Stays inside it link to the stay. */
.cal-hit { position: absolute; inset: 0; z-index: 0; }
.cal-hit:focus-visible { outline-offset: -2px; }
.cal-cell > :not(.cal-hit) { position: relative; z-index: 1; pointer-events: none; }
.cal-cell .cal-event { pointer-events: auto; }

.cal-cell-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 2px 2px; }
.cal-date { display: inline-flex; align-items: center; gap: 6px; }
.cal-weekday { display: none; }
.cal-day { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 12px; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink); }
.cal-cell.is-today .cal-day { background: var(--terra); color: var(--white); font-weight: 600; }
.cal-cell.is-past:not(.is-today) .cal-day { color: var(--muted); }
.cal-cell.is-other-month .cal-day { color: #b8b1a9; }
.cal-cell.is-other-month .cal-events, .cal-cell.is-other-month .cal-pill { opacity: 0.55; }
.cal-pill { font-size: 11px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-pill.status-full { padding: 1px 6px; border-radius: 5px; background: var(--danger-soft); color: var(--danger); }
.cal-pill.is-closed { color: var(--muted); }

.cal-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; min-width: 0; }
.cal-events > li:nth-child(n + 4) { display: none; }
.cal-event { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 1px 6px 1px 5px; border-left: 3px solid; border-radius: 4px; font-size: 12px; font-weight: 500; line-height: 18px; color: var(--ink); text-decoration: none; }
.cal-event:hover { color: var(--ink); filter: brightness(0.97); }
.cal-event-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event-owner { display: none; }
.cal-event-time { flex: none; font-size: 11px; color: var(--muted); }
.cal-event.is-overnight { background: var(--sage-soft); border-color: var(--sage); }
.cal-event.is-daycare { background: var(--gold-soft); border-color: #c99a3a; }
.cal-event.is-requested, .cal-event.is-waitlisted { background: var(--surface); border: 1px dashed #cdb27a; border-left-width: 1px; padding-left: 7px; color: var(--body); }
.cal-event.is-waitlisted { border-color: var(--line-strong); color: var(--muted); }
.cal-cell.is-past:not(.is-today) .cal-event { opacity: 0.7; }
.cal-more { padding: 0 6px; font-size: 11px; font-weight: 500; color: var(--muted); }
.cal-cell:hover .cal-more { color: var(--ink); }

.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.swatch.is-overnight { background: var(--sage-soft); box-shadow: inset 3px 0 0 var(--sage); }
.swatch.is-daycare { background: var(--gold-soft); box-shadow: inset 3px 0 0 #c99a3a; }
.swatch.is-requested { border: 1px dashed #cdb27a; }
.swatch.is-closed { background: #ece7e1; }

/* On phones the month becomes an agenda: only days with something on them, with each stay and its owner. */
@media (max-width: 720px) {
  .cal-weekdays { display: none; }
  .cal-grid { grid-template-columns: minmax(0, 1fr); }
  .cal-cell { height: auto; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--cal-line); display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 14px; row-gap: 6px; align-items: start; }
  .cal-cell:nth-last-child(-n + 7) { border-bottom: 1px solid var(--cal-line); }
  .cal-cell:last-child { border-bottom: 0; }
  .cal-cell.is-empty, .cal-cell.is-other-month { display: none; }
  .cal-cell-head { grid-row: 1 / span 2; flex-direction: column; align-items: flex-start; gap: 4px; padding: 0; }
  .cal-date { flex-direction: column; align-items: flex-start; gap: 0; }
  .cal-weekday { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
  .cal-day { font-size: 17px; min-width: 30px; height: 30px; border-radius: 15px; margin-left: -4px; }
  .cal-events { grid-column: 2; gap: 6px; }
  .cal-events > li:nth-child(n + 4) { display: block; }
  .cal-event { padding: 6px 10px 6px 9px; border-radius: 6px; font-size: 14px; line-height: 1.35; }
  .cal-event-name { white-space: normal; }
  .cal-event-owner { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
  .cal-more { display: none; }
}

/* Settings: a menu of short sections, so Save is always in view. */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.settings-nav { position: sticky; top: 92px; display: grid; gap: 1px; }
.settings-nav a { padding: 7px 10px; border-radius: 6px; color: var(--body); font-size: 14px; font-weight: 500; text-decoration: none; }
.settings-nav a:hover { background: var(--paper); color: var(--ink); }
.settings-nav a[aria-current="page"] { background: #ebe6df; color: var(--ink); font-weight: 600; }
.settings-body { max-width: 640px; }
.settings-card { padding: 0; }
.settings-card-body { padding: clamp(18px, 2.6vw, 24px); }
.settings-card-body h2 { margin: 0; }
.settings-card-foot { display: flex; justify-content: flex-end; gap: 12px; padding: 12px clamp(18px, 2.6vw, 24px); border-top: 1px solid var(--line); background: var(--sunken); border-radius: 0 0 var(--radius) var(--radius); }
.settings-inline-form { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 12px; align-items: end; }
@media (max-width: 720px) {
  .settings { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .settings-nav { position: static; display: flex; gap: 2px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .settings-nav a { flex: none; }
  .settings-inline-form { grid-template-columns: minmax(0, 1fr); }
  .settings-inline-form .button { justify-self: start; }
}

/* Accounting */
.accounting-hint { max-width: 760px; margin-bottom: 16px; }
.money-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.money-stats .stat { align-content: start; gap: 4px; padding: 16px 18px; }
.money-stats .stat strong { font-size: 24px; }
.is-negative { color: var(--danger); }
.money-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.money-table tr.is-empty td { color: var(--muted); }
.money-table tr.is-today td:first-child { box-shadow: inset 3px 0 0 var(--terra); }
.money-table tfoot th { font-size: 14px; font-weight: 600; color: var(--ink); background: var(--surface); border-top: 1px solid var(--line-strong); }
.money-table tfoot th.is-negative { color: var(--danger); }
.accounting-day, .accounting-categories { margin-top: 0; }
.accounting-categories { margin-top: 24px; max-width: 560px; }
