/* Henri & Mizzy — dogs.sargent.page */
:root {
  --paper: #f6f1e7;
  --paper-2: #efe8da;
  --card: #fffdf8;
  --ink: #22302b;
  --muted: #62716a;
  --line: #ddd5c4;
  --sage: #5f8a6e;
  --sage-ink: #2f5a41;
  --sage-soft: #dfeadf;
  --accent: #c8733f;
  --accent-soft: #f6e0cf;
  --warn: #9a6a12;
  --warn-soft: #f8ebc8;
  --danger: #a4362c;
  --danger-soft: #f7dcd7;
  --henri: #5f7792;
  --henri-soft: #dde5ee;
  --henri-coat: #8796a8;
  --mizzy: #3a2e29;
  --mizzy-soft: #eadfd5;
  --mizzy-coat: #2f2826;
  --mizzy-pixel: #2f2826;
  --diagram-bg: #efe8da;
  --tan: #c48a55;
  --cream: #f4ebdc;
  --zone: rgba(95, 138, 110, 0.28);
  --zone-line: #4f8a60;
  --stroke: #d8672b;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(40, 35, 25, 0.06), 0 6px 20px rgba(40, 35, 25, 0.06);
  --round: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171c1a;
    --paper-2: #1e2421;
    --card: #222a26;
    --ink: #e8ece6;
    --muted: #a3afa8;
    --line: #36403b;
    --sage: #86b595;
    --sage-ink: #b7dcc2;
    --sage-soft: #26372c;
    --accent: #e39463;
    --accent-soft: #3d2b20;
    --warn: #e7c06a;
    --warn-soft: #3a311b;
    --danger: #f0907f;
    --danger-soft: #45231f;
    --henri: #a9bdd6;
    --henri-soft: #2b3441;
    --henri-coat: #7f8ea2;
    --mizzy: #e0c6ad;
    --mizzy-soft: #3a302a;
    --mizzy-coat: #2f2826;
    --mizzy-pixel: #7a6a61;
    --diagram-bg: #dcdfd6;
    --henri-coat: #8796a8;
    --cream: #f4ebdc;
    --zone: rgba(134, 181, 149, 0.3);
    --zone-line: #9fd0ad;
    --stroke: #ff9a5c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--sage-ink); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--round); line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 750; }
h3 { font-size: 1.1rem; font-weight: 700; }
h4 { font-size: 0.95rem; margin-top: 1em; }
p { margin: 0 0 0.9em; }
code { font-size: 0.9em; background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 6px; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.eyebrow { font: 700 0.78rem/1.2 var(--sans); letter-spacing: 0.09em; text-transform: uppercase; color: var(--sage); margin-bottom: 0.5em; }
.intro { font-size: 1.12rem; color: var(--muted); max-width: 42em; }
.optional { font-weight: 400; color: var(--muted); font-size: 0.85em; }

/* Layout */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 12px max(20px, calc((100vw - 1100px) / 2));
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-dogs { display: flex; gap: 2px; }
.brand-dogs .pixel-dog { width: 38px; }
.brand-name { font: 800 1.15rem/1 var(--round); white-space: nowrap; }
.amp { color: var(--accent); }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  display: flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem;
}
.site-nav a:hover { background: var(--paper-2); color: var(--ink); }
.site-nav a.active { background: var(--sage-soft); color: var(--sage-ink); }
.site-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.signout, .signin { margin: 0; font-size: 0.9rem; }
.link-button { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; }
main { max-width: 1100px; margin: 0 auto; padding: 32px 20px 56px; }
.site-footer { max-width: 1100px; margin: 0 auto; padding: 24px 20px 40px; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  body { font-size: 16px; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  /* backdrop-filter would make the header the containing block for the fixed tab bar. */
  .site-header { padding: 10px 16px; gap: 10px; background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .brand-dogs .pixel-dog { width: 30px; }
  .site-nav {
    position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 30;
    justify-content: space-around; gap: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--card) 94%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .site-nav a { flex-direction: column; gap: 2px; font-size: 0.72rem; padding: 6px 12px; border-radius: 12px; }
  .site-nav svg { width: 24px; height: 24px; }
  .signout, .signin { margin-left: auto; }
  main { padding: 22px 16px 40px; }
}

/* Pixel dogs */
.pixel-dog { display: block; width: 48px; height: auto; image-rendering: pixelated; }
.pixel-dog .coat { fill: var(--ink); }
.pixel-dog.henri .coat { fill: var(--henri-coat); }
.pixel-dog.mizzy .coat { fill: var(--mizzy-pixel); }
.pixel-dog .marks { fill: var(--cream); }
.pixel-dog.big { width: 160px; }

/* Buttons & chips */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-weight: 650; font-size: 0.95rem; text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}
.button:hover { border-color: var(--sage); color: var(--ink); }
.button.primary { background: var(--sage-ink); border-color: var(--sage-ink); color: var(--paper); }
.button.primary:hover { background: var(--sage); border-color: var(--sage); color: #fff; }
.button.quiet { background: transparent; }
.button.danger { color: var(--danger); border-color: var(--danger-soft); }
.button.danger:hover { background: var(--danger-soft); }
.button.small { min-height: 34px; padding: 5px 13px; font-size: 0.85rem; }
.text-button { font-size: 0.9rem; font-weight: 600; color: var(--sage-ink); text-decoration: none; }
.text-button:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dog-chip {
  display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
  background: var(--paper-2); color: var(--ink); vertical-align: 1px; white-space: nowrap;
}
.dog-chip.henri { background: var(--henri-soft); color: var(--henri); }
.dog-chip.mizzy { background: var(--mizzy-soft); color: var(--mizzy); }
.level { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.level.noted { background: var(--sage-soft); color: var(--sage-ink); }
.level.watch { background: var(--warn-soft); color: var(--warn); }
.level.urgent { background: var(--danger-soft); color: var(--danger); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--paper-2); font-size: 0.82rem; text-decoration: none; margin: 0 4px 4px 0; }
.overdue, .warn-text { color: var(--danger); font-weight: 650; }
.alert-text { color: var(--danger); }

/* Page header */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 26px; }
.page-header .intro { margin-bottom: 0; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Notices */
.notice { padding: 12px 16px; border-radius: var(--radius-sm); margin: 0 0 20px; font-weight: 550; }
.notice.ok { background: var(--sage-soft); color: var(--sage-ink); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.empty { text-align: center; padding: 42px 20px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

/* Landing & login */
.landing { text-align: center; padding: 8vh 0 4vh; max-width: 640px; margin: 0 auto; }
.landing .intro { margin: 0 auto 1.4em; }
.landing .actions { justify-content: center; }
.landing-dogs { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; }
.landing-dogs .pixel-dog { width: min(38vw, 180px); }
.landing-dogs.small .pixel-dog { width: 90px; }
.login { max-width: 480px; margin: 0 auto; }
.login .page-header { text-align: center; justify-content: center; }
.error-page { text-align: center; max-width: 560px; margin: 6vh auto; }
.error-page .pixel-dog { margin: 0 auto 20px; }
.error-page .page-header { justify-content: center; }

/* Dashboard */
.hello { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.hello h1 { margin: 0; }
.quick-add { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-add .button { min-height: 38px; padding: 7px 14px; font-size: 0.88rem; }
.dog-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 22px; }
.dog-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
}
.dog-card:hover { color: var(--ink); border-color: var(--sage); }
.dog-card.henri { border-left: 6px solid var(--henri); }
.dog-card.mizzy { border-left: 6px solid var(--mizzy); }
.dog-card-text { display: flex; flex-direction: column; }
.dog-card-text strong { font: 800 1.25rem/1.2 var(--round); }
.dog-card-text span { color: var(--muted); font-size: 0.9rem; }
.avatar { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--paper-2); overflow: hidden; flex-shrink: 0; }
.avatar.henri { background: var(--henri-soft); }
.avatar.mizzy { background: var(--mizzy-soft); }
.avatar .pixel-dog { width: 52px; }
.avatar.photo { object-fit: cover; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .avatar.henri { background: #c9d3df; }
  :root:not([data-theme="light"]) .avatar.mizzy { background: #d8cbbd; }
  :root:not([data-theme="light"]) .avatar .pixel-dog.mizzy .coat { fill: #2f2826; }
}
.avatar.large { width: 132px; height: 132px; }
.avatar.large .pixel-dog { width: 104px; }
.dash-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
.dash-grid .meds-panel { grid-row: span 3; }
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } .dash-grid .meds-panel { grid-row: auto; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.panel h2 { font-size: 1.15rem; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.panel-link { margin: 12px 0 0; font-size: 0.9rem; font-weight: 600; }
.panel.tip { background: var(--sage-soft); border-color: transparent; }
.mini-list { list-style: none; padding: 0; margin: 0; }
.mini-list li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }

/* Med checklist */
.checklist .progress { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--muted); }
.checklist meter { flex: 1; height: 10px; }
.slot { margin-top: 14px; }
.slot h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 6px; }
.slot.late h3 { color: var(--accent); }
.slot.late h3::after { content: " · due"; }
.slot ul { list-style: none; padding: 0; margin: 0; }
.slot li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.slot li:last-child { border-bottom: 0; }
.dose-form { margin: 0; }
.dose-toggle { width: 44px; height: 44px; border: 0; background: none; padding: 0; cursor: pointer; display: grid; place-items: center; flex-shrink: 0; }
.dose-toggle .box { width: 28px; height: 28px; border-radius: 9px; border: 2.5px solid var(--sage); background: var(--card); transition: background 0.15s, transform 0.15s; position: relative; }
.dose-toggle:hover .box { transform: scale(1.06); }
li.given .dose-toggle .box { background: var(--sage); }
li.given .dose-toggle .box::after { content: ""; position: absolute; left: 8px; top: 3px; width: 7px; height: 13px; border: solid var(--card); border-width: 0 3px 3px 0; transform: rotate(45deg); }
li.given .dose-name { color: var(--muted); }
.dose-text { display: flex; flex-direction: column; min-width: 0; }
.dose-name { font-weight: 650; }
.dose-detail { font-size: 0.88rem; color: var(--muted); }
.given-note { color: var(--sage-ink); font-weight: 600; }
.slot.prn li { gap: 14px; }
.due-list { list-style: none; margin: 0; padding: 0; }
.due-list a { display: grid; grid-template-columns: 7.5em 1fr; gap: 2px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.due-list .muted { grid-column: 2; font-size: 0.85rem; }
.due-when { font-weight: 700; color: var(--sage-ink); font-size: 0.9rem; }
.due-list li.overdue .due-when { color: var(--danger); }
.history-day ul { list-style: none; padding: 0; }
.history-day li { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* Records */
.dog-hero { display: flex; gap: 26px; align-items: center; margin-bottom: 26px; flex-wrap: wrap; }
.dog-hero h1 { margin-bottom: 0.2em; }
.dog-hero .intro { margin-bottom: 0.8em; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.profile-grid .wide { grid-column: 1 / -1; }
.big-number { font: 800 2.2rem/1 var(--round); }
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.resource-tile {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
}
.resource-tile:hover { border-color: var(--sage); color: var(--ink); }
.tile-title { font: 750 1.08rem/1.2 var(--round); }
.tile-blurb { color: var(--muted); font-size: 0.9rem; flex: 1; }
.tile-count { font-size: 0.8rem; font-weight: 700; color: var(--sage); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 18px; }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--paper-2); border-radius: 999px; }
.tabs a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.tabs a.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.tabs a.active.henri { color: var(--henri); }
.tabs a.active.mizzy { color: var(--mizzy); }
.tabs.subtle { background: transparent; }
.records { display: grid; gap: 12px; }
.record { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.record.ended { opacity: 0.72; }
.record-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.record-head h3 { margin: 0; font-size: 1.08rem; }
.record-head > span, .record-head > .level { flex-shrink: 0; }
.record-meta { color: var(--muted); font-size: 0.9rem; margin: 4px 0 0; }
.record-meta .dot { margin: 0 6px; }
.record-body { margin-top: 10px; font-size: 0.97rem; }
.record-body p:last-child { margin-bottom: 0; }
.record-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.amount { font-variant-numeric: tabular-nums; }
.thumb { display: block; max-width: 220px; border-radius: var(--radius-sm); margin-top: 8px; }
.file-link::before { content: "📎 "; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 10px; font-size: 0.95rem; }
.kv div { display: contents; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; }
.stat-label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font: 800 1.5rem/1.2 var(--round); font-variant-numeric: tabular-nums; }
.more { text-align: center; margin-top: 18px; }
.qol-bars { display: grid; gap: 4px; margin-bottom: 8px; }
.qol-bar { display: grid; grid-template-columns: 8.5em 1fr 1.6em; gap: 10px; align-items: center; font-size: 0.88rem; }
.qol-bar meter { width: 100%; height: 10px; }
.qol-bar b { text-align: right; }

/* Charts */
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; max-width: 760px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 12px var(--sans); }
.chart .line { fill: none; stroke: var(--sage); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart.henri .line, .chart.henri .pt { stroke: var(--henri); }
.chart.mizzy .line, .chart.mizzy .pt { stroke: var(--mizzy); }
.chart .pt { fill: var(--card); stroke: var(--sage); stroke-width: 2.5; }
.chart .limit { stroke: var(--danger); stroke-width: 1.5; stroke-dasharray: 6 5; }
.chart .limit-label { fill: var(--danger); }
.chart .pt.high { fill: var(--danger); stroke: var(--danger); }
.chart figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 6px; }

/* Forms */
.record-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.record-form.narrow { max-width: 480px; margin: 0 auto; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > label, fieldset legend { font-weight: 700; font-size: 0.92rem; }
.hint { font-size: 0.85rem; color: var(--muted); margin: 0; }
input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 13px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--paper); font-size: 16px;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { border-color: var(--sage); outline: none; box-shadow: 0 0 0 3px var(--sage-soft); }
input[type="file"] { font-size: 0.9rem; }
.money-input { display: flex; align-items: center; gap: 6px; }
.money-input span { font-weight: 700; color: var(--muted); }
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 650; background: var(--paper); }
.segmented input:checked + span { background: var(--sage-ink); border-color: var(--sage-ink); color: var(--paper); }
.segmented label.henri input:checked + span { background: var(--henri); border-color: var(--henri); color: var(--paper); }
.segmented label.mizzy input:checked + span { background: var(--mizzy); border-color: var(--mizzy); color: var(--paper); }
.segmented input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.check { display: inline-flex; gap: 10px; align-items: center; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--sage-ink); }
.check-row, .check-grid { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
fieldset { border: 0; padding: 0; margin: 0 0 22px; }
fieldset legend { margin-bottom: 10px; }
.score-input { display: flex; align-items: center; gap: 14px; }
.score-input input { flex: 1; accent-color: var(--sage-ink); height: 30px; }
.score-input output { font: 800 1.4rem var(--round); min-width: 1.6em; text-align: right; }
.scale-labels { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); }
.form-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.danger-zone { margin-top: 26px; text-align: right; }

/* Care */
.feature-card {
  display: flex; gap: 22px; align-items: center; padding: 22px 26px; margin-bottom: 18px;
  background: var(--sage-soft); border-radius: var(--radius); text-decoration: none; color: var(--ink);
}
.feature-card:hover { color: var(--ink); outline: 2px solid var(--sage); }
.feature-card > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.feature-card strong { font: 800 1.45rem/1.2 var(--round); }
.feature-art { display: flex; gap: 4px; flex-shrink: 0; }
.feature-art .pixel-dog { width: 72px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.guide-card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.guide-card:hover { color: var(--ink); border-color: var(--sage); }
.guide-card strong { font: 750 1.1rem/1.25 var(--round); }
.guide-card span { color: var(--muted); font-size: 0.92rem; }
.guide-card.urgent { border-color: var(--danger-soft); background: color-mix(in srgb, var(--danger-soft) 45%, var(--card)); }
.disclaimer { margin-top: 26px; font-size: 0.9rem; color: var(--muted); }
.guide { max-width: 860px; margin: 0 auto; }
.guide > h2 { margin-top: 1.8em; }
.guide ul.checks { padding-left: 0; list-style: none; }
.guide ul.checks li { position: relative; padding-left: 28px; margin-bottom: 0.6em; }
.guide ul.checks li::before { content: ""; position: absolute; left: 4px; top: 0.55em; width: 10px; height: 10px; border-radius: 50%; background: var(--sage); }
.section-intro { color: var(--muted); }
.cite { font-size: 0.68em; line-height: 0; margin-left: 1px; }
.cite a { text-decoration: none; color: var(--sage); font-weight: 700; padding: 0 1px; }
.callout { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--sage); border-radius: var(--radius-sm); padding: 18px 22px; margin: 22px 0; }
.callout h2 { font-size: 1.1rem; margin-bottom: 0.6em; }
.callout ul { margin: 0; padding-left: 1.2em; }
.callout li { margin-bottom: 0.5em; }
.callout.quiet { background: var(--paper-2); border-left-color: var(--line); }
.callout.urgent { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger-soft) 55%, var(--card)); }
.caution { background: var(--warn-soft); color: var(--ink); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.93rem; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.02em; margin-left: 6px; vertical-align: 1px; }
.badge.video { background: var(--accent-soft); color: var(--accent); }
.badge.vet { background: var(--sage-soft); color: var(--sage-ink); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin: 0 0 1em; font-size: 0.95rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.acronym { display: grid; gap: 8px; margin: 0 0 1.2em; }
.acronym div { display: grid; grid-template-columns: 2.2em 1fr; align-items: baseline; }
.acronym dt { font: 800 1.5rem/1 var(--round); color: var(--sage); }
.acronym dd { margin: 0; }
.sources { margin-top: 2.6em; padding-top: 1.2em; border-top: 1px solid var(--line); font-size: 0.88rem; }
.sources h2 { font-size: 1rem; }
.sources li { margin-bottom: 0.4em; }
.sources li:target { background: var(--warn-soft); border-radius: 6px; }
.sources .who { color: var(--muted); }
.guide-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 2.4em; }
.guide-nav a { display: flex; flex-direction: column; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; font-weight: 700; color: var(--ink); background: var(--card); }
.guide-nav a span { font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.guide-nav a.next { text-align: right; }
.call-cards { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.call-card { display: flex; flex-direction: column; padding: 12px 18px; border-radius: var(--radius-sm); background: var(--danger); color: #fff; text-decoration: none; }
.call-card:hover { color: #fff; filter: brightness(1.08); }
.call-card span:first-child { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; }

/* Dog toggle */
.dog-toggle { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -6px 0 18px; font-size: 0.9rem; color: var(--muted); }
.dog-toggle span { margin-right: 4px; }
.dog-toggle button { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 16px; font-weight: 700; cursor: pointer; }
.dog-toggle button[aria-pressed="true"][data-dog-toggle="henri"] { background: var(--henri); border-color: var(--henri); color: var(--paper); }
.dog-toggle button[aria-pressed="true"][data-dog-toggle="mizzy"] { background: var(--mizzy); border-color: var(--mizzy); color: var(--paper); }
.care-page[data-dog="henri"] .shape-mizzy, .care-page[data-dog="mizzy"] .shape-henri { display: none; }

/* Steps & diagrams */
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 0.85rem; color: var(--muted); }
.legend span { display: inline-block; vertical-align: -2px; }
.lg-hand { width: 14px; height: 14px; border-radius: 50%; background: var(--stroke); box-shadow: 0 0 0 4px color-mix(in srgb, var(--stroke) 30%, transparent); }
.lg-zone { width: 22px; height: 14px; border-radius: 7px; background: var(--zone); border: 1.5px solid var(--zone-line); }
.lg-avoid { width: 24px; border-top: 3px dashed var(--danger); }
.steps { display: grid; gap: 18px; margin: 16px 0 10px; }
.step { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 22px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow); scroll-margin-top: 150px; }
.step-diagram { background: var(--diagram-bg); border-radius: var(--radius-sm); padding: 8px; }
.step-count { font-size: 0.78rem; font-weight: 750; letter-spacing: 0.07em; text-transform: uppercase; color: var(--sage); margin-bottom: 0.3em; }
.step h3 { font-size: 1.3rem; }
.step p:last-child { margin-bottom: 0; }
.watch { margin-top: 10px; padding: 9px 13px; border-radius: var(--radius-sm); background: var(--paper-2); font-size: 0.92rem; }
.watch strong { color: var(--accent); margin-right: 4px; }
@media (max-width: 680px) { .step { grid-template-columns: 1fr; } .step-diagram { max-width: 380px; margin: 0 auto; width: 100%; } }
.diagram { display: block; width: 100%; height: auto; }
.diagram .dog-shape > * { fill: var(--henri-coat); }
.diagram .shape-mizzy > * { fill: var(--mizzy-coat); }
.diagram .dog-shape .tail { fill: none; stroke: var(--henri-coat); stroke-width: 9; stroke-linecap: round; }
.diagram .shape-mizzy .tail { stroke: var(--mizzy-coat); stroke-width: 7; }
.diagram .dog-shape .far-leg, .diagram .dog-shape .far-ear { filter: brightness(0.8); }
.diagram .dog-shape .chest { fill: var(--cream); }
.diagram .dog-shape .muzzle, .diagram .dog-shape .dog-head .muzzle { fill: #dcc09b; stroke: rgba(60, 40, 20, 0.28); stroke-width: 1; }
.diagram .dog-shape .points, .diagram .dog-shape .brow { fill: var(--tan); }
.diagram .dog-shape .ground { stroke: #c9bfa9; stroke-width: 3; stroke-linecap: round; }
.diagram .dog-shape .dog-head > * { fill: var(--henri-coat); }
.diagram .shape-mizzy .dog-head > * { fill: var(--mizzy-coat); }
.diagram .dog-shape .dog-head .brow { fill: var(--tan); }
.diagram .dog-shape .dog-head .nose, .diagram .nose { fill: #1c1917; }
.diagram .dog-shape .dog-head .eye, .diagram .eye { fill: #1c1917; stroke: var(--cream); stroke-width: 1.5; }
.diagram .spine line { stroke: var(--cream); stroke-width: 2; opacity: 0.8; }
.diagram .spine circle { fill: var(--cream); opacity: 0.85; }
.diagram .zone { fill: var(--zone); stroke: var(--zone-line); stroke-width: 1.5; stroke-dasharray: 5 4; }
.diagram .avoid-line { stroke: var(--danger); stroke-width: 3.5; stroke-dasharray: 7 6; }
.diagram .stroke-path { fill: none; stroke: var(--stroke); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.35; }
.diagram .stroke-trace { fill: none; stroke: var(--stroke); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.diagram .arrow-head { fill: var(--stroke); }
.diagram .hand-dot { fill: var(--stroke); stroke: #fff; stroke-width: 2; }
.diagram .hand-ring { fill: none; stroke: var(--stroke); stroke-width: 2.5; opacity: 0.55; }
.diagram .weight-arrow path, .diagram .push-arrows path { fill: none; stroke: var(--stroke); stroke-width: 4; stroke-linecap: round; }
.diagram .treat { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.diagram .diagram-label { fill: #22302b; font: 700 13px var(--sans); paint-order: stroke; stroke: rgba(255, 255, 255, 0.85); stroke-width: 4px; }
@media (prefers-reduced-motion: reduce) { .diagram .stroke-trace { stroke-dashoffset: 0; } }

/* Guided player */
.player { position: sticky; top: 70px; z-index: 10; margin: 8px 0 4px; }
.player-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; background: var(--ink); color: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
.player-bar .button { color: var(--ink); }
.player-bar .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.player-step { font-weight: 750; flex: 1; min-width: 10em; }
.player-time { font: 800 1.3rem var(--round); font-variant-numeric: tabular-nums; min-width: 3.2em; }
.step.current { outline: 3px solid var(--accent); outline-offset: 2px; }
.steps.playing .step:not(.current) { opacity: 0.45; }
@media (max-width: 760px) { .player { top: 62px; } }

/* Packet builder */
.packet-form fieldset { margin-bottom: 22px; }

/* Breath counter */
.counter { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.counter .segmented { justify-content: center; }
.tap {
  position: relative; width: min(78vw, 320px); aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.tap:disabled { cursor: default; opacity: 0.9; }
.tap .ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-track { fill: none; stroke: var(--paper-2); stroke-width: 9; }
.ring-fill { fill: none; stroke: var(--sage); stroke-width: 9; stroke-linecap: round; }
.counter:not(.counting):not(.done) .ring-fill { opacity: 0; }
.tap-dogs .tap-dog { display: none; }
.tap-dogs .tap-dog.on { display: block; }
.tap-dog .pixel-dog { width: 110px; }
.tap-count { font: 800 2.6rem/1 var(--round); font-variant-numeric: tabular-nums; }
.counter:not(.counting) .tap-count { font-size: 1.2rem; color: var(--muted); }
.tap-time { font-size: 0.95rem; color: var(--muted); min-height: 1.4em; }
.tap.pulse { animation: pulse 0.35s ease-out; }
@keyframes pulse { 0% { transform: scale(0.97); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .tap.pulse { animation: none; } }
.counter-result { width: 100%; }
.result-number { text-align: center; margin: 0; }
.result-number [data-bpm] { font: 800 3rem/1 var(--round); }
.result-note { text-align: center; font-weight: 600; }
.result-note.high { color: var(--danger); }
.result-note.ok { color: var(--sage-ink); }
.center { text-align: center; }
.small { font-size: 0.85rem; }
.small-print { font-size: 0.85rem; margin-top: 22px; }

/* Vet brief */
.brief .panel { margin-bottom: 18px; }
.brief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.brief-grid .panel { margin-bottom: 0; }
.brief-grid + .panel { margin-top: 18px; }
.brief-questions { border-left: 5px solid var(--accent); }
.question-list { margin: 0; padding-left: 1.3em; }
.question-list li { padding: 6px 0; font-size: 1.05rem; }
.mini-list .level { margin-left: 4px; }

@media print {
  .print-friendly .site-header, .print-friendly .site-footer, .print-friendly .header-actions, .no-print { display: none !important; }
  .print-friendly { background: #fff; padding: 0; }
  .print-friendly main { padding: 0; }
  .print-friendly .panel { box-shadow: none; break-inside: avoid; }
  .print-friendly .brief-grid { grid-template-columns: 1fr 1fr; }
}
