/* ==========================================================================
   ЛапКарта — design tokens
   Light is the default theme; dark is opt-in via the topbar toggle, which sets
   html[data-theme="dark"] (stored in localStorage "lk-theme"). Never follows
   prefers-color-scheme on purpose.
   ========================================================================== */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/public/fonts/onest-cyrillic-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/public/fonts/onest-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg-page: #F3F6F7;
  --bg-card: #FFFFFF;
  --bg-sunken: #EEF3F4;
  --text-primary: #0E2240;
  --text-muted: #5A6B74;
  --line: #E1E8EB;
  --border: #D3DEE2;
  --teal: #0F8F9C;
  --teal-strong: #0C7883;
  --teal-soft: #E3F3F4;
  --navy: #0E2240;
  --on-navy: #FFFFFF;
  --on-navy-muted: #B9C7D6;
  --on-accent: #FFFFFF;
  --ok: #1F7A5C;
  --ok-bg: #E2F3EC;
  --warn: #9A5B0A;
  --warn-bg: #FCEFD9;
  --bad: #B23A2E;
  --bad-bg: #FCE5E1;
  --shadow: 0 1px 2px rgba(14,34,64,.05), 0 8px 24px rgba(14,34,64,.07);
  --shadow-pop: 0 4px 12px rgba(14,34,64,.10), 0 16px 40px rgba(14,34,64,.12);
  --radius-card: 18px;
  --radius-row: 12px;
  --qr-bg: #FFFFFF;

  /* type scale */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-base: 15px;
  --fs-lg: 18px;
  --fs-xl: 24px;
  --fs-2xl: 32px;
  --fw-medium: 500;
  --fw-semi: 650;
  --fw-bold: 800;

  /* aliases for older rule names */
  --gold: var(--teal);
  --gold-strong: var(--teal-strong);
  --gold-bg: var(--teal-soft);
  --border-soft: var(--line);
  --brick: var(--bad);
  --brick-bg: var(--bad-bg);
  --leaf: var(--ok);
  --leaf-bg: var(--ok-bg);
  --amber: var(--warn);
  --amber-bg: var(--warn-bg);
  --bg-header: var(--navy);
  --bg-header-2: var(--navy);
  --text-on-header: #FFFFFF;
  --text-on-header-muted: var(--on-navy-muted);
  --shadow-soft: var(--shadow);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: #0D1620;
  --bg-card: #15212D;
  --bg-sunken: #1B2936;
  --text-primary: #E6EEF4;
  --text-muted: #93A6B3;
  --line: #233342;
  --border: #2D4052;
  --teal: #4CC3CE;
  --teal-strong: #6FD3DC;
  --teal-soft: #123A40;
  --navy: #2B5C8F;
  --on-navy-muted: #D3E0EE;
  --on-accent: #06222A;
  --ok: #5FCB9F;
  --ok-bg: #12352A;
  --warn: #F0B35A;
  --warn-bg: #3A2A12;
  --bad: #F08A7E;
  --bad-bg: #3E1D1A;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --shadow-pop: 0 4px 12px rgba(0,0,0,.35), 0 16px 40px rgba(0,0,0,.4);
}
html[data-theme="dark"] .brand-word-img { filter: brightness(0) invert(1); }

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
html { scroll-padding-top: 120px; scrollbar-gutter: stable; }

a { color: inherit; }
h1, h2, h3, h4 { letter-spacing: -0.02em; font-weight: var(--fw-bold); font-style: normal; }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 3px solid var(--teal-soft); outline-offset: 2px; }
.inline-form { margin: 0; display: inline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.page { max-width: 480px; margin: 0 auto; min-height: 100vh; padding: 0 16px 64px; }
.page.wide { max-width: 720px; }

/* ==========================================================================
   Topbar
   ========================================================================== */
/* The topbar sits outside .page as a full-width band (like .site-footer), so its
   content width never depends on the page's own max-width. */
.topbar {
  position: sticky; top: 0; z-index: 30;
  margin: 0 0 8px;
  background: color-mix(in srgb, var(--bg-page) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1160px; margin: 0 auto; padding: 10px 16px 6px;
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "logo actions" "links links";
  align-items: center; column-gap: 12px;
}
.wordmark { grid-area: logo; display: flex; align-items: center; gap: 8px; text-decoration: none; min-height: 44px; }
.brand-icon { height: 40px; width: auto; display: block; }
.brand-word-img { height: 24px; width: auto; display: block; }
.topbar-links { grid-area: links; display: flex; gap: 4px; margin: 2px -10px 0; overflow-x: auto; }
.nav-link {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 10px; border-radius: 10px;
  font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--text-muted); text-decoration: none; white-space: nowrap;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-sunken); }
.topbar-actions { grid-area: actions; display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.icon-btn, .link-btn {
  appearance: none; border: 1px solid var(--border); background: var(--bg-card);
  min-height: 44px; padding: 0 16px; border-radius: var(--radius-row); font-size: var(--fs-md); font-weight: var(--fw-medium);
  cursor: pointer; color: var(--text-primary); text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.icon-logout-btn, .icon-nav-btn {
  appearance: none; border: none; background: transparent; color: var(--text-muted);
  cursor: pointer; width: 44px; height: 44px; padding: 0; margin: 0; border-radius: var(--radius-row); line-height: 0;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.icon-logout-btn:hover, .icon-nav-btn:hover { background: var(--teal-soft); color: var(--teal-strong); }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.login-btn {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; margin-left: 4px;
  border: 1.5px solid var(--teal); border-radius: var(--radius-row); color: var(--teal-strong);
  font-size: var(--fs-md); font-weight: var(--fw-semi); text-decoration: none; white-space: nowrap;
}
.login-btn:hover { background: var(--teal-soft); }

@media (min-width: 640px) {
  .topbar-inner { grid-template-columns: auto 1fr auto; grid-template-areas: "logo links actions"; padding: 12px 16px; }
  .topbar-links { margin: 0 0 0 auto; }
}

/* ==========================================================================
   Buttons & links
   ========================================================================== */
.primary-btn {
  width: 100%; appearance: none; border: 1.5px solid var(--teal); background: var(--teal); color: var(--on-accent);
  font-size: var(--fs-base); font-weight: var(--fw-semi); min-height: 48px; padding: 12px 18px; border-radius: var(--radius-row);
  cursor: pointer; text-align: center; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.primary-btn:hover { background: var(--teal-strong); border-color: var(--teal-strong); }
.primary-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.secondary-btn {
  width: 100%; appearance: none; background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary); font-size: var(--fs-base); font-weight: var(--fw-semi); min-height: 48px; padding: 12px 18px;
  border-radius: var(--radius-row); cursor: pointer; text-decoration: none; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.secondary-btn:hover { border-color: var(--teal); color: var(--teal-strong); }
.secondary-btn.danger { color: var(--bad); border-color: var(--bad); }
.small-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--teal);
  background: var(--teal); color: var(--on-accent); font-size: var(--fs-sm); font-weight: var(--fw-semi);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.small-btn:hover { background: var(--teal-strong); border-color: var(--teal-strong); }
.small-btn.ghost { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.small-btn.ghost:hover { border-color: var(--teal); color: var(--teal-strong); }
.ghost-link {
  display: inline-block; text-align: center; font-size: var(--fs-sm); color: var(--teal-strong); font-weight: var(--fw-medium);
  background: none; border: none; cursor: pointer; font-family: inherit; text-decoration: none; padding: 0;
}
.ghost-link:hover { text-decoration: underline; }
.danger-link { color: var(--bad); background: none; border: none; font-size: var(--fs-sm); cursor: pointer; font-family: inherit; text-decoration: underline; padding: 0; }
.center-link { text-align: center; margin-top: 16px; }
.oauth-block { margin: 0 0 18px; }
.oauth-buttons { display: flex; flex-direction: column; gap: 10px; }
.oauth-icon { width: 22px; height: 22px; flex: 0 0 auto; }
.oauth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 4px; color: var(--text-muted); font-size: var(--fs-sm); }
.oauth-divider::before, .oauth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ==========================================================================
   Forms
   ========================================================================== */
label.field-label { display: block; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-muted); margin: 0 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date],
input[type=number], input[type=search], input[type=url], select, textarea {
  width: 100%; font-size: var(--fs-base); min-height: 46px; padding: 11px 14px; border-radius: var(--radius-row);
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); margin-bottom: 16px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: .75; }
textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
input[type=checkbox], input[type=radio] { accent-color: var(--teal); width: 18px; height: 18px; }
input[type=file] { display: block; width: 100%; margin-bottom: 16px; font-size: var(--fs-sm); color: var(--text-muted); }
input[type=file]::file-selector-button {
  font-family: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semi); margin-right: 12px;
  min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-primary); cursor: pointer;
}
.tag-input {
  border: 1px solid var(--border); border-radius: var(--radius-row); background: var(--bg-card);
  padding: 6px 10px 0; margin-bottom: 16px; min-height: 46px;
}
.tag-input:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list:not(:empty) { margin: 2px 0 4px; }
.chip.allergy-chip {
  display: inline-flex; align-items: center; gap: 4px; cursor: default; min-height: 30px;
  background: var(--bad-bg); border-color: transparent; color: var(--bad); padding: 4px 4px 4px 12px;
}
.chip-remove {
  appearance: none; border: none; background: none; color: inherit; font-size: 16px; line-height: 1;
  cursor: pointer; padding: 2px 6px; opacity: 0.7; font-family: inherit;
}
.chip-remove:hover { opacity: 1; }
.tag-input input[type=text] { border: none; padding: 6px 4px; margin: 0 0 4px; min-height: 36px; box-shadow: none; background: transparent; }

.err-banner {
  font-size: var(--fs-sm); color: var(--bad); background: var(--bad-bg); border-radius: var(--radius-row);
  padding: 12px 14px; margin-bottom: 16px;
}
.note-banner {
  font-size: var(--fs-sm); color: var(--text-muted); background: var(--bg-sunken); border: 1px solid var(--line);
  border-radius: var(--radius-row); padding: 12px 14px; margin: 4px 0 16px; line-height: 1.5;
}
.note-banner.success { color: var(--ok); background: var(--ok-bg); border-color: transparent; }

.back-row { margin-bottom: 12px; }
.back-row .ghost-link { min-height: 36px; display: inline-flex; align-items: center; }

h1.title { font-weight: var(--fw-bold); font-size: var(--fs-xl); margin: 8px 0 6px; line-height: 1.2; letter-spacing: -0.02em; }
p.subtitle { font-size: var(--fs-md); color: var(--text-muted); margin: 0 0 22px; line-height: 1.5; }

/* role cards (legacy) */
.role-card {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-row);
  padding: 14px 16px; margin-bottom: 10px; text-decoration: none; color: inherit;
}
.role-card.disabled { opacity: 0.5; }
.role-icon {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 10px; background: var(--teal-soft);
  display: flex; align-items: center; justify-content: center; color: var(--teal-strong); font-size: 18px;
}
.role-name { font-size: var(--fs-base); font-weight: var(--fw-semi); margin: 0 0 2px; }
.role-desc { font-size: var(--fs-sm); color: var(--text-muted); margin: 0; }
.role-badge {
  margin-left: auto; font-size: 11px; color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 8px; flex: 0 0 auto;
}

/* species / gender pickers */
.species-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.species-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px; padding: 12px 4px;
  border-radius: var(--radius-row); border: 1.5px solid var(--border); background: var(--bg-card); cursor: pointer;
  color: var(--text-muted); font-size: var(--fs-sm); font-weight: var(--fw-medium);
}
.species-btn svg { width: 32px; height: 32px; }
.species-btn:hover { border-color: var(--teal); }
.species-btn.active, .species-btn:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-strong); }
.species-btn input { position: absolute; opacity: 0; pointer-events: none; }
.species-btn:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--teal-soft); }

.gender-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.gender-btn {
  display: flex; align-items: center; justify-content: center; min-height: 46px; border-radius: var(--radius-row);
  border: 1.5px solid var(--border); background: var(--bg-card); color: var(--text-muted); cursor: pointer; font-size: var(--fs-md); font-weight: var(--fw-medium);
}
.gender-btn:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-strong); }
.gender-btn input { position: absolute; opacity: 0; pointer-events: none; }

/* birth date: exact date or year only (pure CSS switch, works without JS) */
.birth-mode { margin-bottom: 8px; }
.birth-mode .gender-btn { min-height: 40px; font-size: var(--fs-sm); }
.birth-field .birth-year { display: none; }
.birth-field:has(input[value=year]:checked) .birth-year { display: block; }
.birth-field:has(input[value=year]:checked) .birth-exact { display: none; }

/* photo picker */
.photo-picker { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; cursor: pointer; }
.photo-picker input[type=file] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.photo-thumb {
  flex: 0 0 auto; width: 72px; height: 72px; border-radius: 16px; border: 1.5px dashed var(--border);
  background: var(--bg-sunken); color: var(--text-muted); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb.has-photo { border-style: solid; border-color: var(--line); }
.photo-picker:hover .photo-thumb, .photo-picker:has(input:focus-visible) .photo-thumb { border-color: var(--teal); color: var(--teal-strong); }
.photo-picker-title { display: block; margin: 0; font-size: var(--fs-base); font-weight: var(--fw-semi); color: var(--teal-strong); }
.photo-picker-hint { display: block; margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.photo-remove { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-muted); margin: -6px 0 18px; min-height: 36px; }

/* ==========================================================================
   Generic cards, chips, pills
   ========================================================================== */
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.pill {
  display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: var(--fw-semi);
  padding: 3px 10px; border-radius: 999px; white-space: nowrap; line-height: 1.4;
}
.pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.soon { color: var(--warn); background: var(--warn-bg); }
.pill.overdue { color: var(--bad); background: var(--bad-bg); }
.pill.unknown { color: var(--text-muted); background: var(--bg-sunken); }
.pill.teal { color: var(--teal-strong); background: var(--teal-soft); }

.chips { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  appearance: none; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted);
  min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: var(--fs-sm); font-weight: var(--fw-medium);
  cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center;
}
.chip:hover { border-color: var(--teal); color: var(--text-primary); }
.chip.active { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-strong); }

/* "⋯" overflow menu (details/summary) */
.row-menu { position: relative; flex: 0 0 auto; }
.row-menu > summary {
  list-style: none; cursor: pointer; width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 20px; line-height: 1; letter-spacing: 1px;
}
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary:hover, .row-menu[open] > summary { background: var(--bg-sunken); color: var(--text-primary); }
.row-menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 15; min-width: 170px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-row); box-shadow: var(--shadow-pop);
  padding: 6px; display: flex; flex-direction: column;
}
.row-menu-list a, .row-menu-list button {
  appearance: none; border: none; background: none; text-align: left; font-family: inherit; font-size: var(--fs-md);
  color: var(--text-primary); text-decoration: none; padding: 0 12px; min-height: 44px; display: flex; align-items: center;
  border-radius: 8px; cursor: pointer; width: 100%;
}
.row-menu-list a:hover, .row-menu-list button:hover { background: var(--bg-sunken); }
.row-menu-list .danger { color: var(--bad); }
.row-menu-list form { margin: 0; }

/* ==========================================================================
   Pet switcher
   ========================================================================== */
.switcher { display: flex; gap: 8px; margin: 4px 0 16px; overflow-x: auto; scrollbar-width: none; }
.switcher::-webkit-scrollbar { display: none; }
.pet-pill {
  appearance: none; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted);
  min-height: 40px; padding: 0 16px; border-radius: 999px; font-size: var(--fs-md); font-weight: var(--fw-semi); cursor: pointer;
  white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center;
}
.pet-pill.active { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-strong); }
.pet-pill.add { color: var(--teal-strong); border-style: dashed; border-color: var(--teal); background: transparent; }
.pet-pill.add:hover { background: var(--teal-soft); }

/* ==========================================================================
   Pet card (dashboard + vet share page)
   ========================================================================== */
.pet-card { padding: 18px; }
.pet-card-allergies {
  display: flex; align-items: flex-start; gap: 8px; margin: 0 0 16px; padding: 10px 12px; border-radius: var(--radius-row);
  background: var(--bad-bg); color: var(--bad); font-size: var(--fs-md); line-height: 1.4;
}
.pet-card-allergies strong { font-weight: var(--fw-semi); }
.pet-card-head { display: flex; gap: 14px; align-items: center; }
.pet-photo {
  flex: 0 0 auto; width: 72px; height: 72px; border-radius: 18px; overflow: hidden;
  background: var(--teal-soft); color: var(--teal-strong); display: flex; align-items: center; justify-content: center;
}
.pet-photo img { width: 100%; height: 100%; object-fit: cover; }
.pet-photo svg { width: 36px; height: 36px; }
.pet-card-id { min-width: 0; }
.pet-card-name { margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.pet-card-sub { margin: 4px 0 0; font-size: var(--fs-md); color: var(--text-muted); }
.pet-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0 0; }
.pet-fact { background: var(--bg-sunken); border-radius: var(--radius-row); padding: 10px 12px; min-width: 0; }
.pet-fact-k { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
.pet-fact-v { display: block; margin-top: 2px; font-size: var(--fs-base); font-weight: var(--fw-semi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-fact-sub { display: block; margin-top: 1px; font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-card-note { margin: 14px 0 0; font-size: var(--fs-md); color: var(--text-muted); line-height: 1.5; white-space: pre-line; }
.pet-card-links { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.pet-card-links a {
  flex: 1 1 auto; min-height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-sm); font-weight: var(--fw-semi);
  color: var(--text-primary); text-decoration: none; white-space: nowrap;
}
.pet-card-links a:hover { border-color: var(--teal); color: var(--teal-strong); }
.pet-card-owner { margin: 14px 0 0; font-size: var(--fs-xs); color: var(--text-muted); }

.dash-photos { display: flex; gap: 8px; margin-top: 12px; }
.dash-photo-thumb {
  flex: 1 1 0; aspect-ratio: 1; min-width: 0; border-radius: var(--radius-row); object-fit: cover;
  background: var(--bg-sunken); border: 1px solid var(--line);
}

/* legacy passport classes (kept for any page still using them) */
.passport { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); overflow: hidden; padding-bottom: 18px; }
.passport-top { padding: 18px 18px 0; display: flex; gap: 14px; align-items: center; }
.photo-frame { flex: 0 0 auto; width: 72px; height: 72px; border-radius: 18px; background: var(--teal-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 28px; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.pet-id { min-width: 0; }
.pet-name { font-weight: var(--fw-bold); font-size: var(--fs-xl); margin: 0 0 4px; line-height: 1.15; letter-spacing: -0.02em; }
.pet-breed, .pet-meta { margin: 0; font-size: var(--fs-md); color: var(--text-muted); }
.passport-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 0; flex-wrap: wrap; }
.verified-line { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.4; }
.passport-note, .passport-allergies { margin: 12px 18px 0; font-size: var(--fs-md); color: var(--text-muted); }
.edit-link { font-size: var(--fs-sm); color: var(--text-primary); text-decoration: none; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }

/* ==========================================================================
   Attention block
   ========================================================================== */
.attention { margin-top: 14px; overflow: hidden; }
.attention-head { margin: 0; padding: 14px 16px 10px; font-size: var(--fs-base); font-weight: var(--fw-bold); letter-spacing: -0.01em; }
.attention-group-title { margin: 0; padding: 8px 16px; font-size: var(--fs-xs); font-weight: var(--fw-semi); text-transform: uppercase; letter-spacing: .04em; }
.attention-group-title.overdue { color: var(--bad); background: var(--bad-bg); }
.attention-group-title.soon { color: var(--warn); background: var(--warn-bg); }
.attention-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.attention-group-title + .attention-row { border-top: none; }
.attention-info { flex: 1; min-width: 0; }
.attention-name { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-semi); overflow-wrap: anywhere; }
.attention-when { margin: 2px 0 0; font-size: var(--fs-sm); }
.attention-when.overdue { color: var(--bad); }
.attention-when.soon { color: var(--warn); }
.attention-ok {
  margin-top: 14px; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--radius-card);
  background: var(--ok-bg); color: var(--ok); font-size: var(--fs-md); font-weight: var(--fw-semi);
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title { font-weight: var(--fw-bold); font-size: var(--fs-lg); letter-spacing: -0.02em; color: var(--text-primary); margin: 0; }
.section-hint { font-size: var(--fs-sm); color: var(--text-muted); }

/* vaccination list */
.vax-list { overflow: visible; }
.vax-item { display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 16px; border-top: 1px solid var(--line); }
.vax-item:first-child { border-top: none; }
.vax-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); }
.vax-dot.ok { background: var(--ok); }
.vax-dot.soon { background: var(--warn); }
.vax-dot.overdue { background: var(--bad); }
.vax-dot.unknown { background: var(--border); }
.vax-body { flex: 1; min-width: 0; }
.vax-title { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-semi); overflow-wrap: anywhere; }
.vax-sub { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-muted); overflow-wrap: anywhere; }
.vax-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; }
.vax-top .pill { flex: 0 0 auto; margin-top: 1px; }
.vax-history { margin-top: 4px; }
.vax-history summary { cursor: pointer; font-size: var(--fs-xs); color: var(--teal-strong); list-style: none; min-height: 28px; display: inline-flex; align-items: center; }
.vax-history summary::-webkit-details-marker { display: none; }
.vax-history-item { margin: 2px 0 0; font-size: var(--fs-xs); color: var(--text-muted); }
.list-empty { padding: 22px 16px; text-align: center; color: var(--text-muted); font-size: var(--fs-md); }

/* legacy vaccination rows */
.vax-row { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-row); padding: 13px 14px; margin-bottom: 9px; display: flex; align-items: center; gap: 12px; }
.stamp { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.stamp.ok { border: 1.5px solid var(--ok); color: var(--ok); }
.stamp.soon { border: 1.5px dashed var(--warn); color: var(--warn); }
.stamp.overdue { border: 1.5px solid var(--bad); color: var(--bad); }
.stamp.unknown { border: 1.5px dashed var(--border); color: var(--text-muted); }
.vax-info { flex: 1; min-width: 0; }
.vax-name { font-size: var(--fs-md); font-weight: var(--fw-semi); margin: 0 0 3px; }
.vax-name .vax-product { font-weight: 400; color: var(--text-muted); }
.vax-status { margin: 0; font-size: var(--fs-sm); }
.vax-status.ok { color: var(--ok); }
.vax-status.soon { color: var(--warn); }
.vax-status.overdue { color: var(--bad); }
.vax-status.unknown { color: var(--text-muted); }

/* antigen picker */
.antigen-group { margin-bottom: 10px; }
.antigen-group-title { font-size: var(--fs-xs); font-weight: var(--fw-semi); color: var(--text-muted); margin: 12px 0 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.antigen-group-title:first-child { margin-top: 0; }
.antigen-check { display: flex; align-items: center; gap: 10px; font-size: var(--fs-md); color: var(--text-primary); min-height: 40px; padding: 4px 2px; cursor: pointer; }
.antigen-check:has(input:checked) { color: var(--teal-strong); font-weight: var(--fw-medium); }
.archive-disclosure { margin: 4px 0 16px; }
.archive-disclosure summary { font-size: var(--fs-sm); }

/* ==========================================================================
   Weight chart
   ========================================================================== */
.weight-card { padding: 16px 16px 12px; margin-bottom: 14px; }
.weight-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.weight-title { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); font-weight: var(--fw-medium); }
.weight-value { margin: 2px 0 0; font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -0.02em; line-height: 1.1; }
.weight-delta { font-size: var(--fs-sm); font-weight: var(--fw-semi); color: var(--text-muted); white-space: nowrap; }
.weight-delta.down, .weight-delta.up { color: var(--teal-strong); }
.weight-plot { display: grid; grid-template-columns: 34px 1fr; gap: 0 8px; }
.weight-yaxis { position: relative; height: 132px; }
.weight-yaxis span { position: absolute; right: 0; transform: translateY(-50%); font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.weight-area { position: relative; height: 132px; margin: 0 8px; }
.weight-area svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.weight-grid { stroke: var(--line); stroke-width: 1; }
.weight-fill { fill: var(--teal-soft); opacity: .8; }
.weight-line { fill: none; stroke: var(--teal); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.weight-dot {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: var(--bg-card); border: 2px solid var(--teal);
}
.weight-dot.last { width: 12px; height: 12px; margin: -6px 0 0 -6px; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.weight-xaxis { grid-column: 2; position: relative; height: 22px; margin: 6px 8px 0; }
.weight-xaxis span { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.weight-xaxis span:first-child { transform: none; }
.weight-xaxis span:last-child { transform: translateX(-100%); }

/* weight history (visit weights + manual measurements) */
.weight-item { display: flex; gap: 8px; padding: 12px 8px 12px 16px; border-top: 1px solid var(--line); }
.weight-list > .weight-item:first-child { border-top: none; }
.weight-item-body { flex: 1; min-width: 0; }
.weight-item-value { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-semi); font-variant-numeric: tabular-nums; }
.weight-more > summary {
  list-style: none; cursor: pointer; border-top: 1px solid var(--line); padding: 0 16px; min-height: 44px;
  display: flex; align-items: center; font-size: var(--fs-sm); font-weight: var(--fw-semi); color: var(--teal-strong);
}
.weight-more > summary::-webkit-details-marker { display: none; }
.weight-more[open] > summary { display: none; }
.weight-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* legacy weight-chart */
.weight-chart { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-row); padding: 14px 16px 10px; margin-bottom: 16px; }

/* ==========================================================================
   Visits
   ========================================================================== */
.visit-list { overflow: visible; }
.visit-item { display: flex; gap: 8px; padding: 14px 8px 14px 16px; border-top: 1px solid var(--line); }
.visit-item:first-child { border-top: none; }
.visit-body { flex: 1; min-width: 0; }
.visit-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.visit-title { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-semi); overflow-wrap: anywhere; }
.visit-date { flex: 0 0 auto; font-size: var(--fs-sm); color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.visit-meta { margin: 3px 0 0; font-size: var(--fs-sm); color: var(--text-muted); overflow-wrap: anywhere; }
.visit-plate { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--bg-sunken); font-size: var(--fs-sm); line-height: 1.45; overflow-wrap: anywhere; }
.visit-plate-k { display: block; font-size: var(--fs-xs); font-weight: var(--fw-semi); color: var(--text-muted); margin-bottom: 1px; }
.visit-badge { margin-top: 6px; }
.visit-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.visit-file {
  display: block; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; flex: 0 0 auto;
  border: 1px solid var(--line); background: var(--bg-sunken); color: var(--text-primary); text-decoration: none;
}
.visit-file img { display: block; width: 100%; height: 100%; object-fit: cover; }
.visit-file:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--teal); }
.visit-file-pdf { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; padding: 6px; text-align: center; }
.visit-file-ext { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--bad); background: var(--bad-bg); border-radius: 6px; padding: 2px 6px; }
.visit-file-name { font-size: 10px; line-height: 1.2; color: var(--text-muted); max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.visit-files-edit { margin: 2px 0 12px; }
.visit-file-edit { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.visit-file-remove { display: flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--text-muted); cursor: pointer; }
.visit-file-remove input { width: 14px; height: 14px; margin: 0; }
.field-hint { margin: -10px 0 16px; font-size: var(--fs-xs); line-height: 1.45; color: var(--text-muted); }
.visit-files-note:empty { display: none; }
.visit-files-note { margin-top: -12px; }
.visit-files-note.err { color: var(--bad); }

.lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(6,14,26,.92); padding: 48px 12px 64px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff; }
.lightbox-close, .lightbox-nav {
  position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
  width: 44px; height: 44px; border-radius: 999px; font-size: 26px; line-height: 1;
}
.lightbox-close { top: 10px; right: 10px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-nav.prev { left: 8px; }
.lightbox-nav.next { right: 8px; }
.lightbox-nav[hidden] { display: none; }
.lightbox-bar { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 16px; font-size: var(--fs-sm); color: #fff; }
.lightbox-bar a { color: #fff; }

/* legacy timeline */
.visit { display: grid; grid-template-columns: 66px 1fr; gap: 4px 14px; }
.visit-main { border-left: 2px solid var(--border); padding: 0 0 20px 16px; position: relative; }
.visit-clinic { font-size: var(--fs-md); font-weight: var(--fw-semi); margin: 0 0 3px; }
.visit-type { font-size: var(--fs-xs); font-weight: var(--fw-semi); padding: 2px 8px; border-radius: 999px; display: inline-block; margin-left: 8px; background: var(--teal-soft); color: var(--teal-strong); }
.visit-summary { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--text-muted); }

.empty { text-align: center; padding: 28px 10px; color: var(--text-muted); font-size: var(--fs-md); }

/* ==========================================================================
   Disclosure (add forms)
   ========================================================================== */
details.disclosure { margin: 12px 0 16px; }
details.disclosure summary { cursor: pointer; font-size: var(--fs-md); color: var(--teal-strong); font-weight: var(--fw-semi); list-style: none; }
details.disclosure summary::-webkit-details-marker { display: none; }
details.disclosure .disclosure-body {
  margin-top: 12px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 18px 16px 16px;
}
details.disclosure summary.disclosure-add {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px;
  font-size: var(--fs-md); font-weight: var(--fw-semi); color: var(--teal-strong);
  border: 1.5px dashed var(--teal); border-radius: var(--radius-row); padding: 10px 12px; background: transparent;
}
details.disclosure summary.disclosure-add:hover { background: var(--teal-soft); }
details[open] > summary.disclosure-add { border-style: solid; background: var(--teal-soft); }
.archive-disclosure .antigen-group, details.archive-disclosure .disclosure-body { border: none; padding: 0; }
.form-hint { font-size: var(--fs-xs); color: var(--text-muted); margin: -10px 0 14px; line-height: 1.45; }

/* ==========================================================================
   Share with vet
   ========================================================================== */
.share-hero { padding: 18px; text-align: center; }
.share-hero-qr {
  display: block; width: 200px; height: 200px; margin: 0 auto 12px; padding: 10px; border-radius: 16px;
  background: var(--qr-bg); border: 1px solid var(--line);
}
.share-hero-label { margin: 0; font-size: var(--fs-base); font-weight: var(--fw-semi); }
.share-hero-sub { margin: 2px 0 12px; font-size: var(--fs-sm); color: var(--text-muted); }
.share-url-box {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: var(--radius-row);
  background: var(--bg-sunken); border: 1px solid var(--line); text-align: left;
}
.share-url-text { flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-hero-actions { display: flex; gap: 8px; margin-top: 10px; justify-content: center; flex-wrap: wrap; }
.share-hero-actions form { margin: 0; }
.share-others { margin-top: 12px; }
.share-other { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-top: 1px solid var(--line); }
.share-other:first-child { border-top: none; }
.share-other-info { flex: 1; min-width: 0; }
.share-other-label { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-semi); }
.share-other-url { margin: 2px 0 0; font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-other form { margin: 0; }

/* legacy share list */
.share-card { display: flex; gap: 12px; align-items: flex-start; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-row); padding: 12px 14px; margin-bottom: 9px; }
.share-qr { flex: 0 0 auto; width: 76px; height: 76px; border-radius: 8px; border: 1px solid var(--line); background: var(--qr-bg); padding: 4px; }
.share-info { flex: 1; min-width: 0; }
.share-label { margin: 0 0 4px; font-size: var(--fs-md); font-weight: var(--fw-semi); }
.share-url { margin: 0 0 8px; font-size: var(--fs-xs); color: var(--text-muted); word-break: break-all; }
.share-actions { display: flex; align-items: center; gap: 14px; }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; font-size: var(--fs-md); color: var(--text-muted); line-height: 1.45; }
.checkbox-row input[type=checkbox] { margin-top: 1px; flex: 0 0 auto; }
.checkbox-row .ghost-link { font-size: inherit; display: inline; }

/* ==========================================================================
   Dashboard layout + mobile tab bar
   ========================================================================== */
.dash-grid { display: block; }
.tabbar { display: none; }

@media (max-width: 899px) {
  .page-dashboard { padding-bottom: 24px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg-card) 94%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px;
    font-size: 11px; font-weight: var(--fw-semi); color: var(--text-muted); text-decoration: none; border-radius: 12px;
  }
  .tabbar a:active { background: var(--bg-sunken); }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar a.tab-primary { color: var(--teal-strong); }
  .tab-primary-icon {
    width: 52px; height: 52px; margin-top: -24px; border-radius: 18px; background: var(--teal); color: var(--on-accent);
    display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-pop); border: 3px solid var(--bg-page);
  }
  .tab-primary-icon svg { width: 24px; height: 24px; }
}

/* ==========================================================================
   Vet share page
   ========================================================================== */
.share-topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; min-height: 60px; }
.vet-bar {
  background: var(--navy); color: var(--on-navy); border-radius: var(--radius-card); padding: 14px 16px; margin: 4px 0 14px;
  display: flex; gap: 12px; align-items: flex-start; font-size: var(--fs-md); line-height: 1.45;
}
.vet-bar svg { flex: 0 0 auto; margin-top: 1px; }
.vet-bar p { margin: 0; }
.vet-bar small { display: block; margin-top: 2px; color: var(--on-navy-muted); font-size: var(--fs-sm); }
.page-share { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.vet-fab {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
  width: min(448px, calc(100% - 32px)); box-shadow: var(--shadow-pop);
}
.vet-form-card { padding: 18px 16px 16px; }

/* ==========================================================================
   Landing
   ========================================================================== */
.hero-split { display: flex; flex-direction: column; gap: 22px; padding-top: 12px; }
.hero { padding: 0; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: var(--fw-semi);
  color: var(--teal-strong); background: var(--teal-soft); padding: 6px 12px; border-radius: 999px;
}
.hero h1 { font-weight: var(--fw-bold); font-size: var(--fs-2xl); line-height: 1.12; letter-spacing: -0.025em; margin: 14px 0 12px; color: var(--text-primary); }
.hero h1 .accent { color: var(--teal); }
.hero p.lead { font-size: var(--fs-base); color: var(--text-muted); line-height: 1.6; margin: 0 0 20px; }
.cta-row { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.cta-row .primary-btn, .cta-row .secondary-btn { width: 100%; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.trust-badge {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
  font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-muted); background: var(--bg-card);
  border: 1px solid var(--line); border-radius: 999px; padding: 0 12px;
}
.trust-badge svg { color: var(--ok); }

.hero-visual { position: relative; }
.hero-photo { position: relative; border-radius: 24px; overflow: hidden; aspect-ratio: 3 / 2; background: var(--bg-sunken); box-shadow: var(--shadow); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-float {
  position: absolute; left: 12px; bottom: 12px; right: 12px; max-width: 360px;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px;
  background: var(--bg-card); border: 1px solid var(--line); box-shadow: var(--shadow-pop);
}
.hero-float-icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; background: var(--teal-soft); color: var(--teal-strong); display: flex; align-items: center; justify-content: center; }
.hero-float-text { flex: 1; min-width: 0; }
.hero-float-name { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-semi); }
.hero-float-sub { margin: 1px 0 0; font-size: var(--fs-xs); color: var(--text-muted); }

.section-block { margin: 56px 0; }
.section-heading { font-weight: var(--fw-bold); font-size: var(--fs-xl); letter-spacing: -0.02em; margin: 0 0 8px; color: var(--text-primary); }
.section-lead { color: var(--text-muted); font-size: var(--fs-md); margin: 0 0 22px; max-width: 560px; line-height: 1.6; }

.steps { display: grid; gap: 12px; counter-reset: step; }
.step-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; }
.step-num {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; background: var(--teal-soft); color: var(--teal-strong);
  display: flex; align-items: center; justify-content: center; font-weight: var(--fw-bold); font-size: var(--fs-lg);
}
.step-card h3 { margin: 0 0 4px; font-size: var(--fs-base); font-weight: var(--fw-semi); letter-spacing: -0.01em; }
.step-card p { margin: 0; font-size: var(--fs-md); color: var(--text-muted); line-height: 1.55; }

.vet-block {
  background: var(--navy); color: var(--on-navy); border-radius: 24px; padding: 28px 22px; display: grid; gap: 18px;
}
.vet-block h2 { margin: 0 0 8px; font-size: var(--fs-xl); color: var(--on-navy); }
.vet-block p { margin: 0; color: var(--on-navy-muted); font-size: var(--fs-md); line-height: 1.6; }
.vet-block ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.vet-block li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-md); color: var(--on-navy); line-height: 1.45; }
.vet-block li svg { flex: 0 0 auto; margin-top: 2px; color: #7FDCE4; }

.faq-list { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.faq-item { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-row); padding: 0 16px; }
.faq-item summary { cursor: pointer; min-height: 52px; display: flex; align-items: center; font-size: var(--fs-base); font-weight: var(--fw-semi); list-style: none; color: var(--text-primary); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; margin-left: auto; padding-left: 12px; color: var(--teal-strong); font-size: 20px; font-weight: 400; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0 0 16px; font-size: var(--fs-md); color: var(--text-muted); line-height: 1.6; }

.final-cta { text-align: center; padding: 32px 20px; margin: 56px 0 24px; }
.final-cta h2 { font-weight: var(--fw-bold); font-size: var(--fs-xl); margin: 0 0 18px; }
.final-cta .cta-row { max-width: 420px; margin: 0 auto; }

/* legacy landing pieces */
.features-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.feature-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-row); padding: 18px; }

/* ==========================================================================
   Admin
   ========================================================================== */
.admin-table-wrap { overflow-x: auto; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.admin-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); white-space: nowrap; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.admin-table th { font-weight: var(--fw-semi); color: var(--text-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--bg-sunken); }
.admin-badge {
  display: inline-block; font-size: 11px; font-weight: var(--fw-semi); color: var(--teal-strong);
  background: var(--teal-soft); border-radius: 999px; padding: 2px 8px; vertical-align: 1px; text-transform: uppercase;
}
.admin-badge.published { color: var(--ok); background: var(--ok-bg); }
.admin-badge.draft { color: var(--text-muted); background: var(--bg-sunken); }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; }
.admin-tab {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; font-size: var(--fs-md); font-weight: var(--fw-semi);
  color: var(--text-muted); background: var(--bg-card); border: 1px solid var(--border); text-decoration: none; white-space: nowrap;
}
.admin-tab.active { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-strong); }
.btn-add-new {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-row);
  background: var(--teal); color: var(--on-accent); font-size: var(--fs-md); font-weight: var(--fw-semi); text-decoration: none; white-space: nowrap;
}
.btn-add-new:hover { background: var(--teal-strong); }

/* ==========================================================================
   Blog
   ========================================================================== */
.post-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.post-card {
  display: block; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 18px; box-shadow: var(--shadow); text-decoration: none; color: inherit;
}
.post-card:hover { border-color: var(--teal); }
.post-card-date { margin: 0 0 6px; font-size: var(--fs-xs); color: var(--text-muted); }
.post-card-title { margin: 0 0 6px; font-weight: var(--fw-bold); letter-spacing: -0.02em; font-size: var(--fs-lg); color: var(--text-primary); }
.post-card-excerpt { margin: 0; font-size: var(--fs-md); color: var(--text-muted); line-height: 1.55; }
.foot-note { margin-top: 32px; text-align: center; font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.6; padding: 0 10px; }

/* ==========================================================================
   Site footer
   ========================================================================== */
.site-footer { margin-top: 48px; border-top: 1px solid var(--line); }
.site-footer-inner {
  max-width: 480px; margin: 0 auto; padding: 18px 16px 28px;
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: space-between;
  font-size: var(--fs-sm); color: var(--text-muted);
}
.site-footer-inner a { color: var(--text-muted); text-decoration: underline; min-height: 32px; display: inline-flex; align-items: center; }
.site-footer-inner a:hover { color: var(--teal-strong); }
body:has(.vet-fab) .site-footer { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
@media (max-width: 899px) {
  body:has(.tabbar) .site-footer { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* ==========================================================================
   Prose (terms, blog post)
   ========================================================================== */
.prose { padding: 20px 0 60px; line-height: 1.7; font-size: var(--fs-base); overflow-wrap: anywhere; }
.prose h1 { font-weight: var(--fw-bold); font-size: 26px; line-height: 1.2; margin: 0 0 18px; color: var(--text-primary); }
.prose h1:not(:first-child) { margin-top: 40px; }
.prose h2 { font-weight: var(--fw-bold); font-size: 20px; margin: 32px 0 12px; color: var(--text-primary); }
.prose h3 { font-weight: var(--fw-semi); font-size: var(--fs-lg); margin: 24px 0 10px; }
.prose p { margin: 0 0 14px; color: var(--text-primary); }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose strong { font-weight: var(--fw-semi); }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }
.prose a { color: var(--teal-strong); }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-row); }
.prose code { background: var(--bg-sunken); border-radius: 4px; padding: 1px 5px; font-size: 0.92em; }
.prose blockquote { margin: 0 0 14px; padding: 4px 16px; border-left: 3px solid var(--teal); color: var(--text-muted); }

/* ==========================================================================
   Community
   ========================================================================== */
.cm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cm-head .btn-add-new { margin-top: 8px; }
@media (max-width: 480px) {
  .cm-head { flex-direction: column; gap: 0; }
  .cm-head .btn-add-new { margin: 0 0 18px; width: 100%; justify-content: center; }
}
.cm-search input[type=search] { margin-bottom: 12px; }
.cm-chip-sep { flex: 0 0 1px; background: var(--border); margin: 6px 2px; }
.cm-list { display: flex; flex-direction: column; gap: 12px; }
.cm-card, .cm-answer {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 16px; box-shadow: var(--shadow);
}
.cm-answer { margin-bottom: 10px; }
.cm-answer:target, .cm-card:target { border-color: var(--teal); }
.cm-author { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cm-avatar {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; background: var(--teal-soft);
  display: flex; align-items: center; justify-content: center; font-size: 20px; overflow: hidden; text-decoration: none;
}
.cm-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cm-author-info { min-width: 0; }
.cm-author-name { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-semi); }
.cm-time { font-weight: 400; color: var(--text-muted); font-size: var(--fs-sm); }
.cm-pet { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.cm-pet-name { color: var(--teal-strong); font-weight: var(--fw-medium); text-decoration: none; }
.cm-pet-name:hover { text-decoration: underline; }
.cm-card-link { display: block; text-decoration: none; color: inherit; }
.cm-card-title { margin: 0 0 6px; font-size: 17px; font-weight: var(--fw-bold); letter-spacing: -0.02em; line-height: 1.3; }
.cm-card-link:hover .cm-card-title { color: var(--teal-strong); }
.cm-card-excerpt { margin: 0; font-size: var(--fs-md); color: var(--text-muted); line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.cm-question-title { margin: 0 0 10px; font-size: 22px; font-weight: var(--fw-bold); letter-spacing: -0.02em; line-height: 1.25; }
.cm-body { font-size: var(--fs-base); line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.cm-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.cm-answers-link { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--teal-strong); text-decoration: none; white-space: nowrap; min-height: 36px; display: inline-flex; align-items: center; }
.cm-reactions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cm-react-form { margin: 0; }
.cm-react-form[hidden] { display: none; }
.cm-react {
  appearance: none; display: inline-flex; align-items: center; gap: 5px; font-family: inherit; min-height: 36px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted);
  padding: 0 12px; border-radius: 999px; font-size: var(--fs-sm); cursor: pointer; line-height: 1.4;
}
.cm-react:hover { border-color: var(--teal); }
.cm-react.mine { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-strong); font-weight: var(--fw-semi); }
.cm-react-emoji { font-size: 14px; }
.cm-react-count:empty { display: none; }
.cm-picker { position: relative; }
.cm-picker summary {
  list-style: none; cursor: pointer; font-size: var(--fs-sm); color: var(--text-muted); min-height: 36px; display: inline-flex; align-items: center;
  border: 1px dashed var(--border); border-radius: 999px; padding: 0 12px; line-height: 1.4;
}
.cm-picker summary::-webkit-details-marker { display: none; }
.cm-picker-list {
  position: absolute; z-index: 5; bottom: calc(100% + 6px); left: 0; display: flex; gap: 2px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 6px; box-shadow: var(--shadow-pop);
}
.cm-picker-btn { appearance: none; border: none; background: none; font-size: 20px; cursor: pointer; padding: 6px; border-radius: 50%; line-height: 1; }
.cm-picker-btn:hover { background: var(--teal-soft); transform: scale(1.15); }
.cm-answer-form { margin-top: 18px; }
.cm-pager { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; }

/* pet public profile */
.pp-column { max-width: 600px; margin: 0 auto; }
.pp-header { margin-bottom: 20px; }
.pp-feed { display: flex; flex-direction: column; gap: 18px; }
.pp-post { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow); }
.pp-post-photo { width: 100%; max-height: 600px; object-fit: contain; display: block; background: var(--bg-sunken); }
.pp-post-body { padding: 14px 16px 16px; }
.pp-post-caption { margin: 0 0 4px; font-size: var(--fs-md); line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.pp-post-caption strong { margin-right: 6px; }
.pp-comments { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.pp-comment-body { margin: 0; font-size: var(--fs-md); line-height: 1.5; overflow-wrap: anywhere; }
.pp-comment-body strong { margin-right: 6px; }
.pp-comment-form { display: flex; gap: 8px; margin-top: 12px; }
.pp-comment-form input[type=text] { flex: 1; margin-bottom: 0; }
.pp-comment-form .secondary-btn, .pp-comment-form .primary-btn { width: auto; }
.pp-post:target { border-color: var(--teal); }

/* community tabs + shared photo feed */
.cm-tabs { display: flex; gap: 4px; padding: 4px; margin: 4px 0 18px; background: var(--bg-sunken); border-radius: 999px; width: fit-content; max-width: 100%; }
.cm-tab {
  padding: 8px 18px; border-radius: 999px; font-size: var(--fs-md); font-weight: var(--fw-medium);
  color: var(--text-muted); text-decoration: none; white-space: nowrap; min-height: 36px; display: inline-flex; align-items: center;
}
.cm-tab:hover { color: var(--text-primary); }
.cm-tab.active { background: var(--bg-card); color: var(--text-primary); font-weight: var(--fw-semi); box-shadow: 0 1px 3px rgba(14,34,64,.12); }
.feed-strip { margin-bottom: 20px; }
.feed-strip-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.feed-strip-title { margin: 0; font-size: var(--fs-base); font-weight: var(--fw-bold); letter-spacing: -0.01em; }
.feed-strip-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.feed-strip-row::-webkit-scrollbar { display: none; }
.feed-strip-item { position: relative; flex: 0 0 112px; height: 112px; border-radius: 14px; overflow: hidden; background: var(--bg-sunken); display: block; }
.feed-strip-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.feed-strip-item:hover img { transform: scale(1.04); }
.feed-strip-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; font-size: var(--fs-xs); font-weight: var(--fw-semi);
  color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.55)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feed-post-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.feed-post-head .cm-author-info { flex: 1; }
.feed-pet-link { color: var(--text-primary); text-decoration: none; }
.feed-pet-link:hover { color: var(--teal-strong); text-decoration: underline; }
.feed-profile-link { font-size: var(--fs-sm); white-space: nowrap; }
.feed-photo-link { display: block; }
.feed-more-comments { font-size: var(--fs-sm); color: var(--text-muted); text-decoration: none; }
.feed-more-comments:hover { color: var(--teal-strong); }
.feed-guest-note {
  display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius-row);
  background: var(--teal-soft); color: var(--text-primary); font-size: var(--fs-md);
}
.feed-guest-actions { display: flex; gap: 14px; }
.feed-visibility {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  margin: 12px 0 20px; font-size: var(--fs-sm); color: var(--text-muted);
}
.feed-visibility .ghost-link { background: none; border: none; padding: 0; font: inherit; font-weight: var(--fw-medium); cursor: pointer; }
.cm-add-menu { position: relative; }
.cm-add-menu summary { list-style: none; cursor: pointer; }
.cm-add-menu summary::-webkit-details-marker { display: none; }
.cm-add-menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 180px; display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-row); box-shadow: var(--shadow-pop); padding: 6px;
}
.cm-add-menu-list a { padding: 10px 12px; border-radius: 8px; color: var(--text-primary); text-decoration: none; font-size: var(--fs-md); }
.cm-add-menu-list a:hover { background: var(--teal-soft); }
@media (max-width: 480px) {
  .cm-add-menu { margin: 0 0 18px; width: 100%; }
  .cm-add-menu .btn-add-new { width: 100%; justify-content: center; margin: 0; }
  .cm-add-menu-list { left: 0; }
}

/* pet nutrition */
.nutri-section { margin-top: 28px; }
.nutri-heading { font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: -0.02em; margin: 0 0 8px; }
.nutri-lead { font-size: var(--fs-sm); color: var(--text-muted); margin: 0 0 14px; line-height: 1.5; }
.nutri-item { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-row); padding: 12px 14px; margin-bottom: 10px; }
.nutri-item-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.nutri-item-name { font-size: var(--fs-md); font-weight: var(--fw-semi); }
.nutri-item-note, .nutri-item-symptoms { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.5; }
.nutri-item-symptoms strong { color: var(--text-primary); }
.nutri-badge { display: inline-block; flex: 0 0 auto; font-size: 11px; font-weight: var(--fw-semi); text-transform: uppercase; letter-spacing: 0.03em; padding: 3px 9px; border-radius: 999px; }
.nutri-badge.safe { color: var(--ok); background: var(--ok-bg); }
.nutri-badge.avoid { color: var(--warn); background: var(--warn-bg); }
.nutri-badge.toxic { color: var(--bad); background: var(--bad-bg); }
.nutri-emergency { margin-top: 28px; background: var(--bad-bg); border: 1.5px solid var(--bad); border-radius: var(--radius-card); padding: 16px 18px; }
.nutri-emergency p { margin: 0 0 8px; font-size: var(--fs-md); line-height: 1.55; color: var(--text-primary); }
.nutri-emergency p:last-child { margin-bottom: 0; }
.nutri-emergency-signs { color: var(--text-muted) !important; font-size: var(--fs-sm) !important; }
.nutri-disclaimer { margin-top: 28px; font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.55; }

/* admin feedback */
.fb-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.fb-item { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 14px 16px; }
.fb-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.fb-author { font-weight: var(--fw-semi); font-size: var(--fs-md); }
.fb-email { font-size: var(--fs-xs); color: var(--text-muted); margin-left: 4px; }
.fb-item-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.fb-date { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }
.fb-message { margin: 0 0 10px; font-size: var(--fs-md); line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.fb-item-actions-row { display: flex; gap: 16px; align-items: center; }

/* ==========================================================================
   Desktop (>=900px)
   ========================================================================== */
@media (min-width: 900px) {
  .page.page-wide { max-width: 1160px; padding-left: 40px; padding-right: 40px; }
  .topbar-inner { padding-left: 40px; padding-right: 40px; }
  .page.page-medium { max-width: 680px; }
  .page.page-form { max-width: 560px; }

  /* landing */
  .hero-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; padding: 40px 0 8px; }
  .hero h1 { font-size: 48px; }
  .hero p.lead { font-size: 17px; max-width: 500px; }
  .cta-row { flex-direction: row; }
  .cta-row .primary-btn, .cta-row .secondary-btn { width: auto; padding-left: 24px; padding-right: 24px; }
  .hero-float { left: -24px; bottom: 24px; right: auto; width: 360px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step-card { flex-direction: column; }
  .vet-block { grid-template-columns: 1fr 1fr; padding: 40px; gap: 40px; align-items: center; }
  .features-grid { grid-template-columns: repeat(3, 1fr); }
  .final-cta .cta-row { justify-content: center; max-width: none; }

  /* dashboard: sticky left column (pet card + attention), content right */
  .dash-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 32px; align-items: start; }
  .dash-aside { position: sticky; top: 88px; }
  .dash-main > .section:first-child { margin-top: 0; }

  /* auth / pet forms framed as a card */
  .form-shell { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 32px 36px 36px; margin-top: 16px; }
  .site-footer-inner { max-width: 1160px; padding-left: 40px; padding-right: 40px; }
  .page-wide .foot-note { text-align: left; max-width: 480px; margin-left: 0; padding: 0; }
  .page-landing.page-wide .foot-note { text-align: center; max-width: none; margin: 0; padding: 0 10px; }
}

/* ==========================================================================
   Забота о питомце (/care)
   ========================================================================== */
.breadcrumbs { margin: 4px 0 6px; font-size: var(--fs-sm); }
.breadcrumbs a { color: var(--teal-strong); font-weight: var(--fw-medium); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.breadcrumbs a::before { content: "←"; margin-right: 6px; }
.breadcrumbs a:hover { text-decoration: underline; }
.care-title { font-weight: var(--fw-bold); font-size: 26px; line-height: 1.18; letter-spacing: -0.02em; margin: 6px 0 10px; }
.care-meta { margin: 0 0 18px; font-size: var(--fs-sm); color: var(--text-muted); }
.care-cover { margin: 0 0 4px; border-radius: var(--radius-card); overflow: hidden; background: var(--bg-sunken); aspect-ratio: 1536 / 498; }
.care-cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 75% 50%; }
.care-prose { padding-top: 16px; }
.care-prose h2:first-child { margin-top: 8px; }
.care-prose h3 { font-size: var(--fs-base); font-weight: var(--fw-semi); margin: 18px 0 6px; }
.care-prose h3 + p { color: var(--text-muted); }
.table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius-row); background: var(--bg-card); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); line-height: 1.45; min-width: 520px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--bg-sunken); font-weight: var(--fw-semi); font-size: var(--fs-sm); color: var(--text-muted); }
.prose tr:last-child td { border-bottom: none; }
.prose td:first-child { font-weight: var(--fw-semi); }

.care-cta {
  display: flex; gap: 14px; align-items: flex-start; margin: 28px 0 24px; padding: 18px;
  background: var(--teal-soft); border: 1px solid color-mix(in srgb, var(--teal) 35%, transparent); border-radius: var(--radius-card);
}
.care-cta-icon {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px; background: var(--bg-card); color: var(--teal-strong);
  display: flex; align-items: center; justify-content: center;
}
.care-cta-body { flex: 1; min-width: 0; }
.prose .care-cta-text { margin: 0 0 14px; line-height: 1.55; }
.care-cta-actions { display: flex; flex-direction: column; gap: 8px; }
.care-cta-actions .primary-btn { text-decoration: none; color: var(--on-accent); }
.care-cta-note { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.4; }
@media (max-width: 480px) {
  .care-cta { flex-direction: column; }
  .care-cover { aspect-ratio: 16 / 10; }
}

.care-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 18px; }
.care-card {
  display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card);
  overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: border-color .15s;
}
.care-card:hover { border-color: var(--teal); }
.care-card-img { display: block; width: 100%; height: auto; aspect-ratio: 640 / 336; object-fit: cover; background: var(--bg-sunken); }
.care-card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.care-card-title { font-weight: var(--fw-bold); font-size: var(--fs-lg); line-height: 1.25; letter-spacing: -0.02em; }
.care-card-excerpt { font-size: var(--fs-md); color: var(--text-muted); line-height: 1.5; }
.care-card-meta { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.care-more { margin-top: 8px; padding-top: 24px; border-top: 1px solid var(--line); }
.care-more-title { font-size: 20px; margin: 0; }
@media (min-width: 640px) {
  .care-grid { grid-template-columns: repeat(2, 1fr); }
  .care-cta-actions { flex-direction: row; align-items: center; gap: 14px; }
  .prose td:first-child { white-space: nowrap; }
  .care-cta-actions .primary-btn { width: auto; flex: 0 0 auto; white-space: nowrap; padding-left: 22px; padding-right: 22px; }
}
@media (min-width: 900px) {
  .care-title { font-size: var(--fs-2xl); }
  .page-wide .care-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Калькулятор ревакцинации */
.care-calc { margin: 8px 0 24px; padding: 18px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.care-calc-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
.care-calc-wide { grid-column: 1 / -1; }
.care-calc input, .care-calc select { margin-bottom: 14px; }
.care-calc select { width: 100%; min-height: 46px; padding: 0 12px; border-radius: var(--radius-row); border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); font-size: var(--fs-base); }
.care-calc-opt { font-weight: 400; }
.care-calc-error { margin-top: 12px; font-size: var(--fs-sm); color: var(--bad); background: var(--bad-bg); border-radius: var(--radius-row); padding: 10px 12px; }
.care-calc-result { margin-top: 14px; padding: 16px; border-radius: var(--radius-row); background: var(--teal-soft); }
.care-calc-result.is-overdue { background: var(--warn-bg); }
.prose .care-calc-result p { margin: 0; }
.prose .care-calc-result-label { font-size: var(--fs-sm); color: var(--text-muted); }
.prose .care-calc-result-date { font-size: 26px; font-weight: var(--fw-bold); letter-spacing: -0.02em; line-height: 1.2; margin: 2px 0 8px; }
.prose .care-calc-result-note { font-size: var(--fs-sm); line-height: 1.5; margin-bottom: 12px; }
.care-calc-result .small-btn { text-decoration: none; color: var(--on-accent); }
@media (max-width: 420px) { .care-calc-grid { grid-template-columns: 1fr; } }
.prose a.care-download {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; margin: 2px 8px 2px 0;
  border: 1.5px solid var(--teal); border-radius: var(--radius-row); color: var(--teal-strong); font-weight: var(--fw-semi); text-decoration: none;
}
.prose a.care-download::before { content: "↓"; font-weight: var(--fw-bold); }
.prose a.care-download:hover { background: var(--teal-soft); }
.prose th, .prose td { overflow-wrap: normal; }

/* ==========================================================================
   Pet card v2 (owner dashboard): who → what needs attention → what to do
   ========================================================================== */
/* share page card: let the birth date wrap instead of being cut off */
.pet-fact-v, .pet-fact-sub { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }

.pet-hero { position: relative; padding: 18px; }
.pet-hero-menu { position: absolute; top: 10px; right: 10px; }
.pet-hero-head { display: flex; gap: 16px; align-items: center; padding-right: 36px; }
.pet-hero-photo { width: 84px; height: 84px; border-radius: 22px; }
.pet-hero-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.pet-hero-fact { background: var(--bg-sunken); border-radius: var(--radius-row); padding: 10px 12px; min-width: 0; }
.pet-hero-v { display: block; margin-top: 2px; font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: -0.01em; line-height: 1.25; }
.pet-hero-sub { display: block; margin-top: 2px; font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.35; }
.pet-hero-add { display: inline-block; margin-top: 4px; font-size: var(--fs-md); font-weight: var(--fw-semi); color: var(--teal-strong); text-decoration: none; }
.pet-hero-add:hover { text-decoration: underline; }
.pet-hero-allergies { margin: 12px 0 0; }

.next-event {
  margin-top: 12px; padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  border-left: 4px solid var(--teal);
}
.next-event.overdue { border-left-color: var(--bad); background: var(--bad-bg); }
.next-event.soon { border-left-color: var(--warn); background: var(--warn-bg); }
.next-event.unknown { border-left-color: var(--border); }
.next-event-info { flex: 1; min-width: 0; }
.next-event-when { margin: 0; font-size: var(--fs-base); font-weight: var(--fw-bold); letter-spacing: -0.01em; }
.next-event.overdue .next-event-when { color: var(--bad); }
.next-event.soon .next-event-when { color: var(--warn); }
.next-event-what { margin: 3px 0 0; font-size: var(--fs-sm); color: var(--text-muted); overflow-wrap: anywhere; }
.next-event-more { display: inline-block; margin-top: 6px; font-size: var(--fs-sm); font-weight: var(--fw-semi); color: var(--teal-strong); text-decoration: none; }
.next-event-more:hover { text-decoration: underline; }

/* compact empty state: "Нет прививок → Добавить" */
.next-event-empty, .empty-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px;
  padding: 10px 16px; border: 1px dashed var(--border); border-radius: var(--radius-row);
  font-size: var(--fs-md); color: var(--text-muted); text-decoration: none; cursor: pointer; list-style: none;
}
.next-event-empty { margin-top: 12px; }
.empty-row::-webkit-details-marker { display: none; }
.next-event-empty:hover, .empty-row:hover { border-color: var(--teal); }
.next-event-empty-cta, .empty-row-cta { color: var(--teal-strong); font-weight: var(--fw-semi); white-space: nowrap; }
details.disclosure-empty { margin-top: 0; }
details.disclosure-empty > summary.empty-row { font-weight: var(--fw-medium); }
details.disclosure-empty[open] > summary.empty-row { border-style: solid; border-color: var(--teal); background: var(--teal-soft); }

.pet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.pet-actions .primary-btn, .pet-actions .secondary-btn { padding-left: 10px; padding-right: 10px; font-size: var(--fs-md); white-space: nowrap; }

/* feed blocks */
.dash-panel .section, .dash-panel details, .dash-panel .card { scroll-margin-top: 80px; }

.nutrition-link {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; color: var(--text-primary);
}
.nutrition-link:hover { border-color: var(--teal); }
.nutrition-link > span:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nutrition-link strong { font-size: var(--fs-base); font-weight: var(--fw-semi); }
.nutrition-link > span:first-child > span { font-size: var(--fs-sm); color: var(--text-muted); }
.nutrition-link-arrow { color: var(--teal-strong); font-size: var(--fs-lg); font-weight: var(--fw-bold); }
@media (min-width: 900px) { .dash-main > .dash-panel:first-child > .section:first-child { margin-top: 0; } }
/* documents */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; padding: 12px; }
.doc-tile { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text-primary); min-width: 0; }
.doc-tile img, .doc-tile-pdf {
  width: 100%; aspect-ratio: 1; border-radius: var(--radius-row); object-fit: cover; background: var(--bg-sunken); border: 1px solid var(--line);
}
.doc-tile-pdf { display: flex; align-items: center; justify-content: center; font-weight: var(--fw-bold); color: var(--bad); font-size: var(--fs-lg); }
.doc-tile-cap { font-size: var(--fs-xs); line-height: 1.35; overflow-wrap: anywhere; }
.doc-tile-cap span { color: var(--text-muted); }
.doc-tile-file { display: block; color: inherit; text-decoration: none; }
.doc-tile-file img, .doc-tile-file .doc-tile-pdf { display: flex; }
.doc-tile-foot { display: flex; align-items: flex-start; gap: 2px; }
.doc-tile-foot .doc-tile-cap { flex: 1; min-width: 0; padding-top: 4px; }
.doc-tile-menu > summary { width: 30px; height: 30px; font-size: 16px; }
@media (max-width: 480px) { .doc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px; } }

/* bottom sheet / modal */
dialog.sheet {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 48px); padding: 18px 18px 20px; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--bg-page); color: var(--text-primary);
  box-shadow: var(--shadow-pop);
}
dialog.sheet::backdrop { background: rgba(6,14,26,.45); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.sheet-title { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: -0.01em; }
.sheet-close {
  appearance: none; border: none; background: var(--bg-sunken); color: var(--text-muted); width: 36px; height: 36px;
  border-radius: 999px; font-size: 22px; line-height: 1; cursor: pointer;
}
.sheet-close:hover { color: var(--text-primary); }
.sheet-lead { display: block; margin: 0 0 14px; line-height: 1.45; }
dialog.sheet .share-hero { padding: 0; }
.add-choices { display: grid; gap: 8px; margin-top: 8px; }
.add-choice {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius-row);
  background: var(--bg-card); border: 1px solid var(--line); text-decoration: none; color: var(--text-primary);
}
.add-choice:hover { border-color: var(--teal); }
.add-choice > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.add-choice strong { font-size: var(--fs-base); font-weight: var(--fw-semi); }
.add-choice > span:last-child > span { font-size: var(--fs-sm); color: var(--text-muted); }
.add-choice-icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; background: var(--teal-soft); color: var(--teal-strong);
  display: flex; align-items: center; justify-content: center;
}
.add-choice-icon svg { width: 22px; height: 22px; }

@media (max-width: 899px) {
  dialog.sheet {
    width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; border-bottom: none;
    max-height: 88vh; padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
}
