/* uyjonivori — "Plum Paw". Strict CSP: every style lives here, no inline styles in templates. */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/plus-jakarta-sans-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 {
  /* Colours are light-dark(light, dark) pairs. color-scheme picks the side: the device setting unless the
     visitor chose a theme in their profile (data-theme on <html>). */
  color-scheme: light dark;
  /* Brand orange: primary buttons and the logo mark only, in both themes. */
  --brand: light-dark(#EE6C1E, #FF8A3D);
  --brand-hover: light-dark(#D95A10, #F27A2C);
  --brand-end: light-dark(#D9402A, #F25C3A);
  --brand-end-hover: light-dark(#C2341F, #DE4B2C);
  /* Links, icons and highlights: orange in light mode, white in dark mode. Backgrounds and borders are neutral in both. */
  --accent: light-dark(#EE6C1E, #F5F5F5);
  --accent-deep: light-dark(#B8470C, #FFFFFF);
  --ink: light-dark(#2B1A12, #F5F5F5);
  --body: light-dark(#4D3B32, #D4D4D4);
  --mauve: light-dark(#7A6458, #A3A3A3);
  --blush: light-dark(#F2F2F2, #242424);
  --blush-strong: light-dark(#E5E5E5, #333333);
  --line: light-dark(#EBEBEB, #262626);
  --line-strong: light-dark(#D9D9D9, #3A3A3A);
  --milk: light-dark(#FAFAFA, #0A0A0A);
  --white: #FFFFFF;
  --leaf: light-dark(#1F7A5A, #5CC99C);
  --leaf-bg: light-dark(#E6F4EE, #12301F);
  --danger: light-dark(#B42318, #D04434);
  --danger-bg: light-dark(#FDF0F0, #3A1615);
  --warn: light-dark(#6B4A12, #F2C97A);
  --warn-bg: light-dark(#FFF6E5, #352812);
  --star: #E8A317;
  /* Surfaces: cards and fields, the see-through bars and badges, and dark fills that carry white text. */
  --surface: light-dark(#FFFFFF, #161616);
  --surface-glass: light-dark(rgba(255, 255, 255, 0.94), rgba(22, 22, 22, 0.94));
  --strong: light-dark(#171717, #2A2A2A);
  --strong-hover: light-dark(#2A2A2A, #363636);
  --on-strong-muted: light-dark(#D4D4D4, #C4C4C4);
  --track: light-dark(#F0F0F0, #1F1F1F);
  --muted-fill: light-dark(#D4D4D4, #404040);
  --disabled-ink: light-dark(#8C776B, #8A8A8A);
  --danger-ink: light-dark(#6B2020, #F3B4AC);
  --danger-hover: light-dark(#8F1C13, #B53224);
  --mating: light-dark(#C2185B, #F27BB1);
  --ending: light-dark(#B4501E, #F0A06B);
  --focus: light-dark(rgba(238, 108, 30, 0.45), rgba(255, 255, 255, 0.5));
  --tint-bg: light-dark(#F2F2F2, #242424);
  --tint-fg: light-dark(#D9601A, #E5E5E5);
  --tint-dog-bg: light-dark(#F2F2F2, #242424);
  --tint-dog-fg: light-dark(#A0367F, #E5E5E5);
  --tint-bird-bg: light-dark(#F2F2F2, #242424);
  --tint-bird-fg: light-dark(#3D6CA8, #E5E5E5);
  --tint-rabbit-bg: light-dark(#F2F2F2, #242424);
  --tint-rabbit-fg: light-dark(#6A3FB5, #E5E5E5);
  --shadow-color: light-dark(rgba(0, 0, 0, 0.07), rgba(0, 0, 0, 0.35));
  --shadow-button-color: light-dark(rgba(238, 108, 30, 0.3), rgba(0, 0, 0, 0.35));
  --shadow: 0 12px 36px var(--shadow-color);
  --shadow-button: 0 6px 16px var(--shadow-button-color);
  --radius: 22px;
  --radius-small: 16px;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  font: 16px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--milk);
  /* Short pages keep the footer at the bottom of the screen. */
  min-height: 100vh; display: flex; flex-direction: column;
  /* Nothing may make the page scroll sideways on a phone. */
  overflow-x: clip;
}
main { flex: 1 0 auto; }

a { color: var(--accent); }
a:hover { color: var(--accent-deep); }
img { max-width: 100%; display: block; }
svg { flex: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: 34px; font-weight: 800; }
h2 { font-size: 22px; font-weight: 800; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.muted { color: var(--mauve); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-small { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.row > label { flex: 1 1 120px; }
.spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.page { padding-top: 32px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 24px; }
.page-title { font-size: 34px; }
.section-label { font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mauve); }

/* Buttons */
button { font: inherit; color: inherit; cursor: pointer; }
.button {
  --fur-a: var(--brand);
  --fur-b: var(--brand-end);
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--fur-a), var(--fur-b)); color: var(--white); font-weight: 800; text-decoration: none;
  transition: background-color 0.15s;
  box-shadow: var(--shadow-button);
}
.button:hover { --fur-a: var(--brand-hover); --fur-b: var(--brand-end-hover); color: var(--white); }
/* Hair strands drawn by fur.js around primary buttons. They stay still; only their colour follows the button's on hover. */
.fur { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.fur i {
  position: absolute; width: 0.9px; border-radius: 100% 100% 0 0 / 100% 100% 0 0;
  background: color-mix(in oklab, var(--fur-b) var(--mix), var(--fur-a)); transform-origin: 50% 100%;
  rotate: calc(var(--angle) + var(--droop));
  scale: 1 calc(1 + var(--stretch));
  transition: background-color 0.15s;
}
@media (prefers-reduced-motion: reduce) {
  .bookmark.htmx-request svg { animation: none; }
}
.button-secondary { --fur-a: var(--surface); --fur-b: var(--surface); color: var(--ink); border: 1.5px solid var(--line-strong); box-shadow: none; font-weight: 700; }
.button-secondary:hover { --fur-a: var(--blush); --fur-b: var(--blush); color: var(--ink); }
.button-dark { --fur-a: var(--strong); --fur-b: var(--strong); box-shadow: none; }
.button-dark:hover { --fur-a: var(--strong-hover); --fur-b: var(--strong-hover); }
.button-soft { --fur-a: var(--blush); --fur-b: var(--blush); color: var(--accent-deep); box-shadow: none; }
.button-soft:hover { --fur-a: var(--blush-strong); --fur-b: var(--blush-strong); color: var(--accent-deep); }
.button-danger { --fur-a: var(--danger); --fur-b: var(--danger); box-shadow: none; }
.button-danger:hover { --fur-a: var(--danger-hover); --fur-b: var(--danger-hover); }
.button-large { min-height: 58px; padding: 0 30px; font-size: 17px; }
.button-block { width: 100%; }
.button[aria-disabled="true"], .button:disabled { --fur-a: var(--line-strong); --fur-b: var(--line-strong); color: var(--disabled-ink); box-shadow: none; }
.button:disabled { cursor: default; }
.button:disabled .fur i { animation: none; }
.link-button { min-height: 44px; padding: 0 10px; border: 0; background: none; color: var(--accent); font-weight: 700; }
.link-button.danger { color: var(--danger); }
.icon-button {
  width: 44px; height: 44px; padding: 0; border-radius: 999px; border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-glass); color: var(--accent);
}

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.logo:hover { color: var(--ink); }
.logo-mark { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--brand-end)); color: var(--white); display: inline-flex; align-items: center; justify-content: center; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; color: var(--ink); font-weight: 600; text-decoration: none; }
.nav-link:hover, .nav-link[aria-current="page"] { background: var(--blush); color: var(--accent-deep); }
/* Account pill: the profile (or log in) link on the left, the language menu on the right, one outline around both. */
.account-pill { position: relative; display: inline-flex; align-items: stretch; min-height: 44px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); }
.account-link { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px 0 14px; border-radius: 999px 0 0 999px; color: var(--ink); font-weight: 700; text-decoration: none; }
.account-link:has(.avatar) { padding-left: 5px; }
.account-link:hover, .account-link[aria-current="page"] { background: var(--blush); color: var(--ink); }
.pill-menu { display: flex; }
.pill-menu summary {
  display: inline-flex; align-items: center; gap: 3px; height: 100%; min-height: 41px; padding: 0 12px 0 10px; border-left: 1.5px solid var(--line);
  color: var(--mauve); font-size: 13px; font-weight: 800; letter-spacing: 0.04em; cursor: pointer; list-style: none;
}
.pill-menu summary::-webkit-details-marker { display: none; }
.pill-menu:last-child summary { border-radius: 0 999px 999px 0; }
.pill-menu summary:hover, .pill-menu[open] summary { background: var(--blush); color: var(--accent-deep); }
.theme-system-light, .theme-system-dark { display: inline-flex; }
@media (prefers-color-scheme: dark) { .theme-system-light { display: none; } }
@media not (prefers-color-scheme: dark) { .theme-system-dark { display: none; } }
/* Only the chevron (the last icon) flips when open, not the theme icon before it. */
.pill-menu[open] summary > svg:last-child { rotate: 180deg; }
.pill-options {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; display: grid; min-width: 170px; padding: 6px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}
.pill-options button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 0 12px;
  border: 0; border-radius: 12px; background: none; color: var(--ink); font-weight: 600; text-align: left;
}
.pill-options button:hover { background: var(--blush); }
.pill-options button[aria-current="true"] { color: var(--accent-deep); font-weight: 800; }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--blush); color: var(--accent-deep); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.avatar-large { width: 96px; height: 96px; font-size: 38px; background: var(--strong); color: var(--white); }
.avatar-medium { width: 52px; height: 52px; font-size: 19px; background: var(--strong); color: var(--white); }

/* Phone tab bar */
.tab-bar { display: none; }

/* Flash messages */
.messages { padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.flash { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--radius-small); background: var(--leaf-bg); color: var(--leaf); font-weight: 700; }
.flash-error { background: var(--danger-bg); color: var(--danger); }
.notice { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: var(--radius-small); background: var(--surface); border: 1px solid var(--line); }
.errors { margin: 0; padding-left: 18px; color: var(--danger); font-size: 14px; font-weight: 600; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 8px; font-weight: 700; font-size: 15px; }
input[type="text"], input[type="search"], input[type="number"], select, textarea, .dropdown-trigger {
  width: 100%; min-height: 50px; padding: 0 16px; border-radius: var(--radius-small);
  border: 1.5px solid var(--line-strong); background: var(--surface);
  font: inherit; font-weight: 500; font-size: 16px; color: var(--ink);
}
/* Long placeholders and words wrap instead of making the field scroll sideways. */
textarea { padding: 14px 16px; resize: vertical; max-width: 100%; overflow-x: hidden; overflow-wrap: anywhere; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
/* Site dropdown (dropdown.js): a field-like trigger and the same menu as the language and theme switches. */
.dropdown { position: relative; display: block; width: 100%; font-weight: 500; }
.dropdown-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; }
.dropdown-trigger[aria-expanded="true"] { border-color: var(--accent); }
.dropdown-trigger[aria-expanded="true"] svg { rotate: 180deg; }
.dropdown-trigger svg { flex: none; color: var(--mauve); }
.dropdown-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-list { left: 0; right: auto; width: max-content; min-width: 100%; max-width: min(340px, 90vw); max-height: min(320px, 60vh); overflow-y: auto; overscroll-behavior: contain; }
.dropdown-list button { font-size: 15px; white-space: nowrap; }
/* The focused option is highlighted like a hovered one instead of getting a heavy outline. */
.dropdown-list button:focus-visible { outline: none; background: var(--blush); }
.dropdown-group { padding: 10px 12px 4px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mauve); }
.checkbox { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; font-size: 15px; }
.checkbox input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }

/* Chips: links or radio labels */
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip-small { min-height: 44px; padding: 0 14px; font-size: 14px; }
/* The real radio/checkbox is invisible but stays inside its chip or tile, so it can't stretch the page. */
.choice { position: relative; }
.choice input { position: absolute; top: 0; left: 0; opacity: 0; width: 1px; height: 1px; }
.choice input:checked + .chip { background: var(--strong); border-color: var(--strong); color: var(--white); }
.choice input:checked + .chip svg { color: var(--white); }
.choice input:focus-visible + .chip, .choice input:focus-visible + .tile { outline: 3px solid var(--focus); outline-offset: 2px; }
.tag { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; background: var(--blush); color: var(--accent-deep); font-size: 13px; font-weight: 700; }
.tag-leaf { background: var(--leaf-bg); color: var(--leaf); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.segmented { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--track); }
.segmented .choice span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; color: var(--mauve); font-weight: 600; cursor: pointer; }
.segmented .choice input:checked + span { background: var(--surface); color: var(--ink); font-weight: 800; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

/* Species tints */
.tint { background: var(--tint-bg); color: var(--tint-fg); }
.tint-dog { background: var(--tint-dog-bg); color: var(--tint-dog-fg); }
.tint-bird { background: var(--tint-bird-bg); color: var(--tint-bird-fg); }
.tint-rabbit { background: var(--tint-rabbit-bg); color: var(--tint-rabbit-fg); }

/* Home */
/* Kept short so the first row of pets shows without scrolling. */
.hero { display: flex; flex-wrap: wrap; align-items: stretch; gap: 24px; padding-top: 24px; padding-bottom: 16px; }
.hero-text { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
/* The art only fills the height of the text next to it. */
.search-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.search-bar label { flex: 999 1 220px; display: flex; align-items: center; gap: 10px; padding: 0 12px; color: var(--mauve); }
.search-bar label + label { flex: 1 1 230px; border-left: 1px solid var(--line); }
.search-bar input, .search-bar select, .search-bar .dropdown-trigger { border: 0; padding: 0; min-height: 46px; }
/* One row: animals and "More filters" on the left, purpose on the right. The extra filters open as a panel over the page. */
.filter-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.filter-bar .chip { min-height: 42px; padding: 0 16px; }
.filter-bar .segmented .choice span { min-height: 34px; }
.filter-bar > .row { margin-left: auto; }
.more-filters summary { list-style: none; }
.more-filters summary::-webkit-details-marker { display: none; }
.more-filters[open] summary { background: var(--blush); }
/* A dot on the chip when filters inside the panel are in use. */
.more-filters summary.has-filters::after { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--accent); }
.clear-filters-slot:empty { display: none; }
.filter-bar .clear-filters { width: 42px; padding: 0; justify-content: center; color: var(--mauve); }
.filter-bar .clear-filters:hover { color: var(--danger); border-color: var(--danger); }
.more-filters-panel { position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 20; padding: 20px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; align-items: end; }
.results-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 28px; }
.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: 36px 40px; border-radius: 28px; background: var(--strong); color: var(--white); margin: 40px 0 64px; }
.cta-band .button { --fur-a: #FFFFFF; --fur-b: #FFFFFF; color: #0A0A0A; box-shadow: none; }
.cta-band .button:hover { --fur-a: #E5E5E5; --fur-b: #E5E5E5; color: #0A0A0A; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 24px; padding-bottom: 24px; color: var(--mauve); font-size: 14px; }
.footer-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; text-decoration: none; }
.narrow-page { max-width: 760px; }
.feedback-text { min-height: 300px; }

/* Listing card */
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); }
/* The title is the card's one link; its ::after covers the card so a click anywhere opens the listing. */
.card-link { color: inherit; text-decoration: none; }
.card-link:hover { color: inherit; }
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-link:focus-visible { outline: none; }
.card:has(.card-link:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.card-photo { position: relative; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: flex; align-items: center; justify-content: center; }
/* Purpose sits above the title as a small label. */
.card-purpose { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 2px; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-deep); }
.card-purpose-mating { color: var(--mating); }
/* Title and bookmark share a row; negative margins keep the 40px button from making the row taller. */
.card-head { display: flex; align-items: center; gap: 4px; margin: -9px -10px -9px 0; }
.card-head .card-title { flex: 1; min-width: 0; }
.card-body { flex: 1; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.card-title { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price { font-size: 18px; font-weight: 800; }
.price-free { color: var(--leaf); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; color: var(--mauve); }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.card .bookmark { position: relative; z-index: 2; flex: none; }
.card .bookmark-button { width: 40px; height: 40px; border: 0; background: none; box-shadow: none; color: var(--mauve); }
.card .bookmark-button:hover, .card .bookmark-button.saved { color: var(--accent); }
.bookmark { margin: 0; }
.bookmark-button { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.bookmark-button svg { transform-origin: 50% 0; transition: transform 0.45s cubic-bezier(0.3, 1.7, 0.5, 1), fill 0.3s; }
.bookmark-button.saved svg { fill: currentColor; }
/* Stage 1: while saving, the ribbon flutters like a flag in the wind. */
.bookmark.htmx-request svg { animation: flutter 0.7s ease-in-out infinite; }
@keyframes flutter {
  0%, 100% { transform: rotate(0deg) skewX(0deg); }
  25% { transform: rotate(7deg) skewX(-8deg); }
  75% { transform: rotate(-5deg) skewX(6deg); }
}
/* Stage 2: the new button arrives with htmx-added for a moment, so a saved ribbon pops in and fills up. */
.bookmark.htmx-added .saved svg { transform: scale(0.4); fill: transparent; }
.bookmark.htmx-added .bookmark-button:not(.saved) svg { transform: scale(1.25); }

/* Listing page */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--mauve); }
.breadcrumb a { color: var(--mauve); text-decoration: none; }
.detail { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 32px; }
.detail-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.detail-aside { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
/* Photos slide sideways (swipe or thumbnails) with no scroll bars; each one fits whole inside the frame. */
.gallery { display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 28px; }
.gallery::-webkit-scrollbar { display: none; }
.gallery-item, .gallery .gallery-placeholder { flex: none; width: 100%; scroll-snap-align: start; }
.gallery-item { display: block; cursor: zoom-in; }
/* Carousel buttons over the photo: previous and next on the sides, full screen in the bottom right corner. */
.gallery-frame { position: relative; }
.gallery-button { position: absolute; color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.gallery-button:hover { background: var(--surface); }
.gallery-prev { left: 14px; top: 50%; translate: 0 -50%; }
.gallery-next { right: 14px; top: 50%; translate: 0 -50%; }
.gallery-fullscreen { right: 14px; bottom: 14px; }
.gallery img, .gallery .gallery-placeholder { width: 100%; aspect-ratio: 16 / 10; border-radius: 28px; }
.gallery img { display: block; object-fit: contain; background: var(--track); }
/* Photo viewer: the whole photo on a dark backdrop, with previous/next on the sides. */
.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--white); }
.viewer[open] { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.viewer::backdrop { background: rgba(20, 8, 26, 0.92); }
/* The photo fills the space between the arrows (scaled up if small, never cropped). touch-action: none hands
   pinch and drag to gallery.js instead of zooming the page. */
.viewer-image {
  width: calc(100vw - 160px); height: calc(100dvh - 120px); object-fit: contain;
  user-select: none; -webkit-user-drag: none; touch-action: none; cursor: grab; will-change: transform;
}
/* The photo takes focus when the viewer opens, so no button starts with a focus ring. */
.viewer-image:focus { outline: none; }
.viewer-count { position: absolute; top: 24px; left: 50%; translate: -50% 0; font-size: 14px; font-weight: 700; opacity: 0.85; }
.viewer-button {
  position: absolute; width: 52px; height: 52px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.14); color: var(--white); cursor: pointer;
}
.viewer-button:hover { background: rgba(255, 255, 255, 0.26); }
.viewer-close { top: 16px; right: 16px; }
.viewer-prev { left: 20px; top: 50%; translate: 0 -50%; }
.viewer-next { right: 20px; top: 50%; translate: 0 -50%; }
.gallery .gallery-placeholder { display: flex; align-items: center; justify-content: center; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.thumbs a { display: block; border-radius: 14px; overflow: hidden; border: 2px solid transparent; }
.thumbs a:hover { border-color: var(--accent); }
.thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.panel { padding: 28px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 18px; }
.panel-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-title h1 { font-size: 34px; letter-spacing: -0.03em; }
/* The purpose pill hugs its text even when a long breed name wraps the title. */
.panel-title .tag { align-self: flex-start; }
.panel .price { font-size: 28px; }
.view-count { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: -10px; padding: 4px 10px; border-radius: 999px; background: var(--blush); color: var(--mauve); font-size: 13px; font-weight: 700; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.facts div { min-width: 0; padding: 7px 11px; border-radius: 12px; background: var(--milk); }
.facts .fact-wide { grid-column: 1 / -1; }
.facts dt { font-size: 11px; color: var(--mauve); }
.facts dd { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.contact-box { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: 18px; background: var(--blush); }
.contact-box a { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; text-decoration: none; }
.contact-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.contact-line a { min-width: 0; overflow-wrap: anywhere; }
.copy-button { flex: none; width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: none; color: var(--mauve); }
.copy-button:hover { background: var(--blush-strong); color: var(--ink); }
.copy-done { display: inline-flex; color: var(--leaf); }
.share-link { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--blush-strong); }
.contact-box .share-link .button, .contact-box .share-link .button:hover { font-size: 15px; font-weight: 700; color: var(--ink); }
.share-hint { font-size: 13px; color: var(--mauve); text-align: center; }
.card-section { padding: 28px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.description { font-size: 17px; line-height: 1.7; color: var(--body); }
.description-empty { font-style: italic; color: var(--mauve); }
/* Listing location: a Yandex map image that opens the full map in a new tab. */
.minimap { position: relative; display: block; border-radius: var(--radius-small); overflow: hidden; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.minimap img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; background: var(--track); }
.minimap-hint { position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--surface-glass); font-size: 14px; font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.minimap:hover { color: var(--ink); border-color: var(--line-strong); }
.minimap:hover .minimap-hint { text-decoration: underline; }
/* The paw pin (web/_map_marker.html): its tip is on the spot. In the minimap the map is centred on the pin; the
   picker sets left/top itself. Taps go through it to the map. */
.map-marker { position: absolute; left: 50%; top: 50%; translate: -50% -100%; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3)); }
.map-marker svg { display: block; }
.map-marker-drop { fill: var(--brand); stroke: var(--white); stroke-width: 1.5; }
.map-marker-circle { fill: var(--white); }
.map-marker-paw { fill: var(--brand); }
.minimap-figure { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.minimap-caption { display: flex; align-items: flex-start; gap: 6px; color: var(--body); font-size: 15px; font-weight: 600; }
.minimap-caption svg { margin-top: 3px; color: var(--accent); }
/* Location picker in the posting and edit forms. */
.field-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.field-legend { padding: 0; margin-bottom: 8px; font-weight: 700; font-size: 15px; }
.location-picker { display: flex; flex-direction: column; gap: 12px; }
.map-picker { position: relative; border-radius: var(--radius-small); overflow: hidden; border: 1.5px solid var(--line-strong); background: var(--track); }
.map-image { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; cursor: crosshair; user-select: none; -webkit-user-drag: none; }
.map-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.map-zoom .icon-button { width: 40px; height: 40px; color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.coords summary { cursor: pointer; color: var(--mauve); font-size: 14px; font-weight: 700; min-height: 32px; display: inline-flex; align-items: center; }
.coords[open] summary { margin-bottom: 10px; }
.owner-card { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.owner-card:hover { color: var(--ink); border-color: var(--accent); }
.owner-card > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.rating { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--mauve); }
.rating svg { color: var(--star); fill: currentColor; }
.verified { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--leaf); }
.safety-tip { display: flex; gap: 10px; padding: 14px 16px; border-radius: 18px; background: var(--warn-bg); color: var(--warn); font-size: 14px; line-height: 1.5; }

/* Profiles */
.profile-header { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 32px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); }
.profile-header > div { flex: 999 1 320px; display: flex; flex-direction: column; gap: 8px; }
.columns { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 28px; }
.column-wide { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.column-narrow { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.review { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.review-pending { align-self: flex-start; gap: 6px; }
.review-stars { color: var(--star); font-weight: 800; letter-spacing: 2px; }
.review-form textarea { min-height: calc(7 * 1.5em + 28px); }
.review-form { min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 24px; background: var(--surface); border: 2px solid var(--line-strong); }
.star-rating { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; margin: 0; padding: 0; border: 0; }
.star-rating input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-rating label { width: 44px; height: 44px; border-radius: 12px; background: var(--milk); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted-fill); }
.star-rating input:checked ~ label, .star-rating label:hover, .star-rating label:hover ~ label { color: var(--star); }
.star-rating input:checked ~ label svg, .star-rating label:hover svg, .star-rating label:hover ~ label svg { fill: currentColor; }
.star-rating input:focus-visible + label { outline: 3px solid var(--focus); }
.settings-card { padding: 24px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.contact-row { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--milk); }
.contact-row > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.icon-badge { width: 40px; height: 40px; border-radius: 12px; background: var(--blush); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.listing-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.listing-row-photo { flex: none; width: 120px; height: 96px; border-radius: var(--radius-small); object-fit: cover; display: flex; align-items: center; justify-content: center; }
.listing-row-body { flex: 999 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.listing-row-actions { flex: 1 1 auto; display: flex; gap: 8px; justify-content: flex-end; }
.listing-row-status { align-self: flex-start; }
.days-left { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--mauve); }
.days-left.ending { color: var(--ending); }
.danger-zone { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; background: var(--danger-bg); color: var(--danger-ink); }
.delete-listing summary { list-style: none; }
.delete-listing summary::-webkit-details-marker { display: none; }
.delete-listing[open] summary { display: none; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 48px 24px; border-radius: 28px; background: var(--surface); border: 2px dashed var(--line-strong); }
.empty-icon { width: 88px; height: 88px; border-radius: 999px; background: var(--blush); color: var(--accent); display: flex; align-items: center; justify-content: center; }

/* Login */
.login-layout { display: flex; flex-wrap: wrap; align-items: stretch; gap: 24px; padding-top: 16px; padding-bottom: 56px; }
.login-art { flex: 1 1 420px; min-width: 0; min-height: 480px; padding: 48px; border-radius: 32px; background: var(--strong); color: var(--white); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.login-art h1 { font-size: 44px; line-height: 1.08; letter-spacing: -0.03em; }
.login-art p { font-size: 18px; color: var(--on-strong-muted); margin-top: 14px; }
.login-art-icons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.login-art-icons span { aspect-ratio: 1; border-radius: 24px; display: flex; align-items: center; justify-content: center; }
.login-side { flex: 1 1 420px; min-width: 0; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 420px; padding: 40px; border-radius: 32px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 22px; }
.login-buttons { display: flex; flex-direction: column; gap: 12px; }
.checklist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--mauve); }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist svg { color: var(--accent); }

/* Posting flow */
.flow { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 32px; padding-top: 40px; padding-bottom: 64px; }
.flow-card { flex: 999 1 560px; min-width: 0; padding: 40px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 28px; }
.flow-aside { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.step { display: flex; flex-direction: column; gap: 22px; border: 0; margin: 0; padding: 0; min-width: 0; }
.post-form:not(.is-stepped) .step + .step { padding-top: 28px; border-top: 1px solid var(--line); }
/* A fieldset's legend is not a flex item, so it gets its own spacing. Focus is moved here by post-flow.js for screen readers only. */
.step-title { font-size: 38px; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; padding: 0; margin-bottom: 22px; }
.step-title:focus { outline: none; }
.step-title + .step-lead { margin-top: -10px; }
.step > .section-label { margin-bottom: -10px; }
.step-lead { font-size: 17px; color: var(--mauve); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.tiles-wide { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 14px;
  border-radius: 24px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; text-align: center; height: 100%;
}
/* Wide tiles: icon on the left, title and hint on the right. */
.tiles-wide .tile { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 18px; row-gap: 2px; padding: 20px; text-align: left; }
.tiles-wide .tile-icon { grid-row: span 2; width: 64px; height: 64px; }
.tiles-wide .tile strong { align-self: end; }
.tiles-wide .tile .muted { align-self: start; }
.tile:hover { border-color: var(--line-strong); }
.choice input:checked + .tile { border-color: var(--accent); background: var(--blush); }
.tile strong { font-size: 18px; }
.tile-icon { width: 76px; height: 76px; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.tiles-wide .tile-icon { border-radius: 20px; }
.breed-list { display: flex; flex-wrap: wrap; gap: 10px; }
.breed-list .chip-mixed { border-style: dashed; }
.breed-search { max-width: 360px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; border-radius: 18px; border: 1.5px solid var(--line); }
.stepper input { width: 70px; min-height: 44px; text-align: center; border: 0; font-weight: 800; font-size: 22px; padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper button { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 14px; border: 0; background: var(--blush); color: var(--accent-deep); }
.stepper button:hover { background: var(--blush-strong); }
.stepper-label { display: flex; flex-direction: column; gap: 10px; flex: 1 1 220px; font-weight: 700; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 0 18px; border-radius: 18px; border: 2px solid var(--line); cursor: pointer; font-weight: 700; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { width: 48px; height: 28px; border-radius: 999px; background: var(--muted-fill); padding: 3px; display: flex; transition: background 0.15s ease; }
.switch::after { content: ""; width: 22px; height: 22px; border-radius: 999px; background: #FFFFFF; transition: transform 0.15s ease; }
.switch-row:has(input:checked) { border-color: var(--leaf); background: var(--leaf-bg); }
.switch-row input:checked + .switch { background: var(--leaf); }
.switch-row input:checked + .switch::after { transform: translateX(20px); }
.price-input { display: flex; align-items: center; gap: 10px; padding: 0 20px; border-radius: 18px; border: 2px solid var(--accent); }
.price-input input { border: 0; min-height: 64px; padding: 0; font-size: 28px; font-weight: 800; }
.photo-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 32px; border-radius: 24px; border: 2px dashed var(--line-strong); background: var(--surface); color: var(--accent); font-weight: 700; cursor: pointer; text-align: center; }
.photo-drop input { max-width: 100%; color: var(--mauve); }
.photo-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.photo-previews img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 18px; }
.reassure { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--mauve); }
.reassure svg { color: var(--accent); }
.region-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.region-list .chip { width: 100%; border-radius: var(--radius-small); }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.review-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-radius: var(--radius-small); border: 1px solid var(--line); }
.review-row span { display: flex; flex-direction: column; }
.review-row small { font-size: 12px; font-weight: 600; color: var(--mauve); }
.flow-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.flow-nav-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.post-form:not(.is-stepped) .flow-nav, .post-form:not(.is-stepped) .js-only { display: none; }
.post-form.is-stepped .no-js, .post-form.is-stepped [data-breed-group] .section-label { display: none; }
.progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.progress-segment { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--mauve); }
.progress-segment.active { font-weight: 800; color: var(--accent-deep); }
.progress-track { height: 6px; border-radius: 999px; background: var(--blush-strong); overflow: hidden; }
.progress-fill { display: block; height: 6px; width: 0; border-radius: 999px; background: var(--accent); transition: width 0.25s ease; }
.summary-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.summary-chips span { padding: 5px 10px; border-radius: 999px; background: var(--blush); color: var(--accent-deep); font-size: 12px; font-weight: 700; }
.preview-card { border-radius: 24px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.preview-photo { position: relative; aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 600; }
.preview-card .tag { align-self: flex-start; }
.preview-photo img { width: 100%; height: 100%; object-fit: cover; }
.chapters { padding: 22px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.chapter { display: flex; flex-direction: column; gap: 6px; }
.chapter-name { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.chapter-dot { width: 26px; height: 26px; border-radius: 999px; background: var(--muted-fill); color: var(--white); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.chapter.active .chapter-dot, .chapter.done .chapter-dot { background: var(--accent); }
.chapter.active .chapter-name { color: var(--accent-deep); }
.chapter-steps { display: flex; flex-direction: column; gap: 4px; padding-left: 36px; font-size: 14px; color: var(--mauve); }
.chapter-steps .current { color: var(--accent-deep); font-weight: 800; }
.chapter-steps .done { color: var(--ink); }

/* Phone */
@media (max-width: 900px) {
  .flow-aside { display: none; }
}

@media (min-width: 901px) {
  .flow .summary-chips { display: none; }
}

@media (max-width: 720px) {
  .container { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .nav .hide-on-phone { display: none; }
  .hero { padding-top: 16px; padding-bottom: 12px; }
  /* Animals scroll sideways in one line instead of wrapping. */
  .filter-bar .tags { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; width: calc(100% + 32px); }
  .filter-bar .tags .choice { flex: none; }
  .filter-bar > .row { margin-left: 0; }
  .search-bar label + label { border-left: 0; border-top: 1px solid var(--line); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-body { padding: 10px 12px 12px; }
  .card-title { font-size: 15px; }
  .price { font-size: 16px; }
  .card .meta { font-size: 12px; }
  .card-purpose { font-size: 11px; }
  .card-head { margin-right: -8px; }
  .cta-band { padding: 28px 24px; }
  .panel, .card-section, .flow-card, .login-card, .login-art, .profile-header { padding: 22px; }
  .step-title { font-size: 28px; }
  .viewer-image { width: 100vw; height: calc(100dvh - 180px); }
  .viewer-prev, .viewer-next { top: auto; bottom: 24px; translate: none; }
  /* Phone login: a short welcome strip, so the login button shows without scrolling even on small screens. */
  .login-layout { padding-top: 12px; gap: 12px; }
  .login-art { min-height: 0; gap: 14px; padding: 18px 20px; border-radius: 24px; }
  .login-art h1 { font-size: 24px; }
  .login-art p { font-size: 15px; margin-top: 6px; }
  .login-art-icons { gap: 8px; }
  .login-art-icons span { aspect-ratio: auto; height: 44px; border-radius: 14px; }
  .login-art-icons svg { width: 26px; height: 26px; }
  .login-card { gap: 16px; padding: 20px; border-radius: 24px; }
  .login-card .button-large { min-height: 52px; padding: 0 14px; font-size: 15px; }
  /* Docked to the bottom edge: full width, rounded top only, no shadow or bottom border. On iPhones the background
     runs behind the home indicator while the buttons stay clear of it. */
  .tab-bar {
    position: fixed; z-index: 10; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
    padding: 6px max(10px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-radius: 22px 22px 0 0; background: var(--surface-glass); border: 1px solid var(--line); border-bottom: 0;
  }
  .tab-bar a { min-height: 56px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--ink); text-decoration: none; }
  .tab-bar a[aria-current="page"] { background: var(--blush); color: var(--accent-deep); font-weight: 800; }
}

/* Small phones (iPhone SE, mini): keep the logo and the account pill on one line. */
@media (max-width: 400px) {
  .header-row { gap: 8px; }
  .logo { gap: 8px; font-size: 19px; }
  .logo-mark { width: 34px; height: 34px; border-radius: 10px; }
  .account-link { padding: 0 10px 0 12px; }
  .pill-menu summary { padding: 0 9px 0 8px; }
}

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

