/* ============================================================================
   pets/styles.css — Pet Spot Tracker.

   Same glass system as the rest of the site (tokens live in /site.css), with
   one deliberate departure: the accent here is teal rather than casino gold,
   and the three "how loud is this" colours are a traffic light. Everywhere else
   on this site a colour means how much money is on the line; here it means how
   soon to ask someone about it, and the two should not look alike.

   Two layout rules this file exists to protect:

     1. FIXED SLOTS. .hoverline, .triagebar and the verdict box have a minimum
        height, so a location line that wraps to two rows never moves the model
        or the buttons under a thumb. This is the regression that happens first.
     2. THE SHEET IS FIXED. Adding a spot opens a bottom sheet (a side panel on
        a wide screen) that is position:fixed, so nothing behind it reflows —
        and on a wide screen it docks beside the model rather than over it,
        because you are describing the pin you can see.

   The print block at the bottom is not a nicety. The vet report is the output
   of this tool, and a printed page is how it gets across a consulting table.
   ========================================================================== */

:root {
  --bg: var(--g-bg);
  --ink: #e9eef3;
  --muted: #93a1b0;
  --line: var(--g-line);
  --gold: #f0c419;          /* site.css's nav + tab chrome reads this */
  --accent: #3ecfb2;        /* teal: this section's own signal colour */
  --accent-deep: #1d8f7a;
  --soon: #ff6a5e;
  --mention: #f3b93c;
  --watch: #5aa9ff;
  --shadow: var(--g-drop);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: .8rem; }
.grow { color: var(--soon); }
.shrink { color: var(--accent); }
h3 { margin: 0 0 10px; font-size: 1.05rem; letter-spacing: .2px; }
h4 { margin: 18px 0 8px; font-size: .92rem; color: var(--ink); }
h4 .h4-note { font-weight: 400; color: var(--muted); font-size: .8rem; margin-left: 8px; }

/* ------------------------------------------------------------------ header */

.topbar {
  text-align: center;
  padding: 26px 16px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0) 60%),
              linear-gradient(180deg, rgba(29,143,122,.42), rgba(12,64,55,.26));
  border-bottom: 1px solid rgba(62,207,178,.32);
  box-shadow: var(--g-hi), 0 1px 0 rgba(62,207,178,.18), var(--shadow);
  -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur);
}
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.brand .paw { font-size: 1.6rem; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.topbar h1 { margin: 0; font-size: 1.55rem; letter-spacing: .2px; }
.tagline { margin: 8px auto 0; max-width: 760px; color: #cfe6df; font-size: .92rem; }

.langtoggle {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  padding: 4px; border-radius: 999px;
  background: rgba(0,0,0,.26); border: 1px solid var(--g-line);
}
.langtoggle .lt-label { color: var(--muted); font-size: .74rem; padding: 0 8px 0 10px; text-transform: uppercase; letter-spacing: .06em; }
.langtoggle button {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  border-radius: 999px; padding: 6px 14px; font-weight: 650; font-size: .85rem;
  cursor: pointer; font-family: inherit;
}
.langtoggle button.active {
  background: linear-gradient(180deg, #63e3c8, var(--accent));
  color: #04231e; border-color: rgba(150,240,222,.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 4px 14px rgba(62,207,178,.25);
}

/* --------------------------------------------------------------- pet strip */

.petstrip {
  max-width: 1180px; margin: 14px auto 0; padding: 0 16px;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
}
.petstrip::-webkit-scrollbar { display: none; }
.pet-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer; font-family: inherit;
  background: var(--g-in-fill); border: 1px solid var(--g-in-line);
  color: var(--muted); font-weight: 600; font-size: .88rem;
}
.pet-chip .pc-emoji { font-size: 1rem; }
.pet-chip.active { color: var(--ink); border-color: rgba(62,207,178,.55); background: rgba(62,207,178,.14); }
.pet-chip.add { border-style: dashed; }

/* -------------------------------------------------------------- sharing */

.striprow { max-width: 1180px; margin: 14px auto 0; padding: 0 16px; display: flex; align-items: center; gap: 10px; }
.striprow .petstrip { margin: 0; padding: 0; flex: 1; min-width: 0; }
.syncpill {
  flex: 0 0 auto; cursor: pointer; font-family: inherit; font-size: .78rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  background: var(--g-in-fill); border: 1px solid var(--g-in-line); color: var(--muted);
}
.syncpill.ok { color: var(--accent); border-color: rgba(62,207,178,.42); background: rgba(62,207,178,.10); }
.syncpill.sync { color: var(--watch); border-color: rgba(90,169,255,.42); }
.syncpill.off { color: var(--mention); border-color: rgba(243,185,60,.42); background: rgba(243,185,60,.10); }

.sharecard { border: 1px solid var(--g-in-line); border-radius: var(--g-r-md); background: var(--g-in-fill); padding: 12px 14px; margin: 12px 0; }
.sc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.sc-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.15rem; font-weight: 700; letter-spacing: .09em; color: var(--ink);
  background: var(--g-well); border-radius: var(--g-r-sm); padding: 5px 11px;
  user-select: all;
}
/* Said before the code is ever used, not in a footnote after it. */
.sc-warn { margin: 10px 0 0; font-size: .78rem; color: var(--mention); }

/* ------------------------------------------------------------------ layout */

main { max-width: 1180px; margin: 0 auto; padding: 16px 16px 40px; }

.panel {
  background: var(--g-sheen), var(--g-base);
  border: 1px solid var(--g-line); border-radius: var(--g-r-xl);
  box-shadow: var(--g-hi), var(--g-lo), var(--shadow);
  -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur);
  padding: 16px; margin-bottom: 16px;
}

/* ---------------------------------------------------------------- the map */

.canvas-wrap { position: relative; border-radius: var(--g-r-lg); overflow: hidden; background: radial-gradient(120% 90% at 50% 10%, rgba(62,207,178,.10), rgba(0,0,0,.28)); }
#mapcanvas {
  display: block; width: 100%; height: 58vh; min-height: 320px; max-height: 560px;
  touch-action: none;             /* we own the drag and the pinch */
  cursor: crosshair;
  -webkit-tap-highlight-color: transparent;
}
#mapcanvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.viewbtns { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; }
.viewbtns button {
  width: 36px; height: 34px; border-radius: 9px; cursor: pointer; font-family: inherit;
  background: rgba(12,16,22,.62); border: 1px solid var(--g-line); color: var(--muted);
  font-weight: 700; font-size: .8rem;
  -webkit-backdrop-filter: var(--g-blur-soft); backdrop-filter: var(--g-blur-soft);
}
.viewbtns button:hover { color: var(--accent); border-color: rgba(62,207,178,.5); }

/* fixed slot — see the header comment */
.hoverline {
  min-height: 46px; display: flex; flex-direction: column; justify-content: center;
  padding: 6px 4px 4px; font-size: .95rem;
}
.hoverline .hl-hint { color: var(--muted); font-size: .86rem; }
.hoverline .hl-main { font-weight: 650; }
.hoverline .hl-sub { color: var(--muted); font-size: .8rem; }

.triagebar { min-height: 30px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tri-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: var(--g-in-fill); border: 1px solid var(--g-in-line); color: var(--muted);
}
.tri-chip b { font-size: .95rem; }
.tri-chip.lv-soon { color: var(--soon); border-color: rgba(255,106,94,.45); background: rgba(255,106,94,.12); }
.tri-chip.lv-mention { color: var(--mention); border-color: rgba(243,185,60,.42); background: rgba(243,185,60,.11); }
.tri-chip.lv-watch { color: var(--watch); border-color: rgba(90,169,255,.38); background: rgba(90,169,255,.10); }

.pinlegend { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.legend-pin {
  display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px;
  width: 100%; text-align: left; cursor: pointer; font-family: inherit;
  padding: 8px 12px; border-radius: var(--g-r-md);
  background: var(--g-in-fill); border: 1px solid var(--g-in-line); color: var(--ink);
  font-size: .88rem;
}
.legend-pin:hover, .legend-pin.active { background: var(--g-in-fill-hover); border-color: var(--g-line-strong); }
.lp-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 999px; font-weight: 800; font-size: .8rem; color: #0b1116;
}
.lv-soon .lp-n { background: var(--soon); }
.lv-mention .lp-n { background: var(--mention); }
.lv-watch .lp-n { background: var(--watch); }
.lp-size { color: var(--muted); font-variant-numeric: tabular-nums; }

.howto { margin: 0; padding-left: 20px; color: var(--muted); font-size: .9rem; }
.howto li { margin-bottom: 8px; }
.howto b { color: var(--ink); }

.empty { text-align: center; padding: 40px 16px; }
.empty-ico { font-size: 2.6rem; }
.empty h2 { margin: 10px 0 6px; font-size: 1.2rem; }
.empty p { color: var(--muted); max-width: 460px; margin: 0 auto 18px; }

/* ----------------------------------------------------------------- spots */

.listhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.listhead h3 { display: flex; flex-direction: column; gap: 2px; }
.listhead h3 .tiny { font-weight: 400; }
.spotlist { display: flex; flex-direction: column; gap: 10px; }

.spot {
  border: 1px solid var(--g-in-line); border-radius: var(--g-r-lg);
  background: var(--g-in-fill); overflow: hidden;
  border-left: 3px solid var(--watch);
}
.spot.lv-soon { border-left-color: var(--soon); }
.spot.lv-mention { border-left-color: var(--mention); }
.spot.done { opacity: .62; border-left-color: #6f7c8a; }
.spot-head {
  display: grid; grid-template-columns: 30px 1fr 18px; gap: 10px; align-items: center;
  padding: 11px 13px; cursor: pointer;
}
.spot-head:hover { background: var(--g-in-fill-hover); }
.sp-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 999px; font-weight: 800; font-size: .82rem; color: #0b1116;
  background: var(--watch);
}
.lv-soon .sp-n { background: var(--soon); }
.lv-mention .sp-n { background: var(--mention); }
.done .sp-n { background: #6f7c8a; }
.sp-loc { font-weight: 620; font-size: .95rem; }
.sp-meta { color: var(--muted); font-size: .8rem; }
.sp-chev { color: var(--muted); }
.spot-body { padding: 4px 14px 16px; border-top: 1px solid var(--g-in-line); }

.verdict { border-radius: var(--g-r-md); padding: 12px 14px; margin: 12px 0 4px; min-height: 62px;
  background: rgba(90,169,255,.08); border: 1px solid rgba(90,169,255,.30); }
.verdict.lv-soon { background: rgba(255,106,94,.10); border-color: rgba(255,106,94,.38); }
.verdict.lv-mention { background: rgba(243,185,60,.09); border-color: rgba(243,185,60,.34); }
.v-head { font-weight: 700; margin-bottom: 6px; }
.verdict ul { margin: 0; padding-left: 18px; }
.verdict li { margin-bottom: 6px; font-size: .86rem; color: var(--muted); }
.verdict li b { color: var(--ink); display: block; }

.mtable { width: 100%; border-collapse: collapse; font-size: .85rem; margin-bottom: 8px; }
.mtable td { padding: 5px 8px; border-bottom: 1px solid var(--g-in-line); }
.mtable td:nth-child(2) { font-variant-numeric: tabular-nums; font-weight: 650; }

.measure-row { margin-top: 8px; }

.spark { width: 100%; max-width: 460px; height: auto; display: block; }
.spark .sp-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.spark .sp-dot { fill: var(--accent); }
.spark .sp-ref { stroke: rgba(243,185,60,.55); stroke-width: 1; stroke-dasharray: 4 4; }
.spark .sp-lab { fill: var(--muted); font-size: 10px; font-family: inherit; }
.spark .sp-val { fill: var(--ink); font-size: 11px; font-weight: 700; font-family: inherit; }

.notes { margin: 0 0 10px; padding-left: 18px; font-size: .88rem; }
.notes time { color: var(--muted); margin-right: 8px; font-size: .8rem; }

.gallery { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ph { position: relative; margin: 0; width: 108px; height: 108px; border-radius: 10px; overflow: hidden; background: var(--g-well); display: flex; align-items: center; justify-content: center; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 999px; border: 0; cursor: pointer; background: rgba(0,0,0,.62); color: #fff; font-size: 1rem; line-height: 1; }

/* -------------------------------------------------------------- behaviour */

/* The day's logging. One row per sign, one tap per row: if this is not a
   two-second job nobody does it daily, and without daily taps the frequency
   has no denominator. */
.today { display: flex; flex-direction: column; gap: 8px; }
.trow {
  display: grid; grid-template-columns: minmax(140px, 1fr) auto; gap: 8px 12px; align-items: center;
  padding: 10px 12px; border-radius: var(--g-r-md);
  background: var(--g-in-fill); border: 1px solid var(--g-in-line);
}
.trow.done { border-color: rgba(62,207,178,.34); }
.trow-name { display: flex; align-items: center; gap: 8px; font-weight: 620; font-size: .92rem; }
.trow-ico { font-size: 1.05rem; }
/* fixed slot: the anchored sentence must never shove the chips under a thumb */
.trow-said { grid-column: 1 / -1; min-height: 32px; display: flex; align-items: center; color: var(--muted); font-size: .82rem; }
.trow.done .trow-said { color: var(--ink); }

.sevchips { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.sev {
  cursor: pointer; font-family: inherit; font-weight: 650; font-size: .78rem;
  padding: 7px 11px; border-radius: 999px; min-width: 54px;
  background: var(--g-in-fill); border: 1px solid var(--g-in-line); color: var(--muted);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.sev:hover { background: var(--g-in-fill-hover); color: var(--ink); }
.sev.s0.on { background: rgba(62,207,178,.20); border-color: rgba(62,207,178,.62); color: #d8fff5; }
.sev.s1.on { background: rgba(90,169,255,.20); border-color: rgba(90,169,255,.62); color: #d8ecff; }
.sev.s2.on { background: rgba(243,185,60,.20); border-color: rgba(243,185,60,.62); color: #ffeec6; }
.sev.s3.on { background: rgba(255,106,94,.22); border-color: rgba(255,106,94,.66); color: #ffdcd8; }
.sev.plus { min-width: 0; border-style: dashed; }
.tiny-num { width: 84px; padding: 7px 9px; }

.statbox { background: var(--g-well); border-radius: var(--g-r-sm); padding: 9px 11px; }
.sb-l { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.sb-v { font-weight: 700; font-size: 1rem; margin: 2px 0; }
.sb-n { color: var(--muted); font-size: .74rem; }
.freqgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }

.scalelist { margin: 0; padding-left: 20px; font-size: .86rem; }
.scalelist li { margin-bottom: 4px; color: var(--muted); }
.scalelist li.hit { color: var(--ink); font-weight: 620; }
.asks { margin: 0; padding-left: 18px; color: var(--muted); font-size: .86rem; }
.asks li { margin-bottom: 4px; }

.sign-n { background: var(--g-in-fill-hover) !important; color: var(--ink); font-size: .95rem; }
.legend-pin.outline .lp-n { background: transparent; border: 1.5px dashed currentColor; }
.legend-pin.outline.lv-soon .lp-n { color: var(--soon); }
.legend-pin.outline.lv-mention .lp-n { color: var(--mention); }
.legend-pin.outline.lv-watch .lp-n { color: var(--watch); }

.spot.lv-now { border-left-color: var(--soon); box-shadow: 0 0 0 1px rgba(255,106,94,.35); }
.verdict.lv-now { background: rgba(255,106,94,.16); border-color: var(--soon); }
.tri-chip.lv-now { color: #fff; background: var(--soon); border-color: var(--soon); }
.lv-now .sp-n { background: var(--soon); }

#pattern-panel { border-color: rgba(243,185,60,.4); background: var(--g-sheen), rgba(243,185,60,.07); }
#pattern-panel h3 { color: var(--mention); }
#pattern-panel p { margin: 0 0 8px; }

.signpicker { display: flex; flex-direction: column; gap: 8px; }
.pickgroup { border: 1px solid var(--g-in-line); border-radius: var(--g-r-md); overflow: hidden; background: var(--g-in-fill); }
.pg-head {
  display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 13px; cursor: pointer; font-family: inherit; font-size: .9rem; font-weight: 620;
  background: transparent; border: 0; color: var(--ink); text-align: left;
}
.pg-head:hover { background: var(--g-in-fill-hover); }
.pickgroup.open .pg-head { border-bottom: 1px solid var(--g-in-line); }
.pg-body { display: flex; flex-direction: column; }
.signopt {
  display: grid; grid-template-columns: 26px 1fr 22px; gap: 10px; align-items: center;
  padding: 10px 13px; cursor: pointer; font-family: inherit; text-align: left;
  background: transparent; border: 0; border-top: 1px solid rgba(255,255,255,.05); color: var(--ink);
}
.signopt:first-child { border-top: 0; }
.signopt:hover:not(:disabled) { background: var(--g-in-fill-hover); }
.signopt:disabled { opacity: .45; cursor: default; }
.so-ico { font-size: 1.1rem; text-align: center; }
.so-txt { display: flex; flex-direction: column; gap: 1px; font-size: .88rem; }
.so-add { color: var(--accent); font-weight: 800; font-size: 1.05rem; text-align: center; }
.resolved-fold summary { cursor: pointer; color: var(--muted); font-size: .86rem; padding: 8px 2px; }

/* severity, on the strips and the timeline */
.spark .sv1, .timeline .sv1 { fill: var(--watch); }
.spark .sv2, .timeline .sv2 { fill: var(--mention); }
.spark .sv3, .timeline .sv3 { fill: var(--soon); }
.spark .sv-checked { fill: rgba(255,255,255,.30); }
.spark .sp-axis { stroke: rgba(255,255,255,.16); stroke-width: 1; }
.timeline { width: 100%; height: auto; display: block; }
.timeline .tl-grid { stroke: rgba(255,255,255,.10); stroke-width: 1; }
.timeline .tl-now { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 3; }
.timeline .tl-rule { stroke: rgba(255,255,255,.07); stroke-width: 1; }
.timeline .tl-lab { fill: var(--muted); font-size: 10.5px; font-family: inherit; }
.timeline .tl-spot { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.timeline .sv-checked-dot { fill: rgba(255,255,255,.32); }
.timeline .sp-val { fill: var(--ink); font-size: 10px; font-weight: 700; font-family: inherit; }
.timeline .sp-lab { fill: var(--muted); font-size: 10px; font-family: inherit; }

/* ----------------------------------------------------------- form widgets */

.chipgrid { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 6px; }
.chipgrid.tight { gap: 5px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-family: inherit;
  padding: 8px 13px; border-radius: 999px; font-size: .85rem; font-weight: 600;
  background: var(--g-in-fill); border: 1px solid var(--g-in-line); color: var(--muted);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.chip:hover { background: var(--g-in-fill-hover); color: var(--ink); }
.chip.on { background: rgba(62,207,178,.16); border-color: rgba(62,207,178,.6); color: var(--ink); }
.chip.big { padding: 10px 14px; }
.chip .chip-ico { font-size: 1rem; }
.chip .chip-sub { color: var(--muted); font-size: .74rem; font-weight: 500; }

.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.row .lbl { color: var(--muted); font-size: .84rem; }
.num, .txt, .sel {
  background: var(--g-well); border: 1px solid var(--g-in-line); color: var(--ink);
  border-radius: var(--g-r-sm); padding: 9px 11px; font-family: inherit; font-size: .92rem;
}
.num { width: 110px; font-variant-numeric: tabular-nums; }
.txt { flex: 1; min-width: 180px; }
.sel { min-width: 140px; }
.num:focus, .txt:focus, .sel:focus { outline: 2px solid rgba(62,207,178,.6); outline-offset: -1px; }
.chk { width: 20px; height: 20px; accent-color: var(--accent); }

.btn {
  cursor: pointer; font-family: inherit; font-weight: 650; font-size: .9rem;
  padding: 10px 16px; border-radius: 999px;
  background: var(--g-in-fill); border: 1px solid var(--g-in-line); color: var(--ink);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--g-in-fill-hover); }
.btn:active { transform: scale(.97); }
.btn.primary {
  background: linear-gradient(180deg, #63e3c8, var(--accent)); color: #04231e;
  border-color: rgba(150,240,222,.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 6px 16px rgba(62,207,178,.24);
}
.btn.ghost { background: transparent; }
.btn.danger { color: var(--soon); border-color: rgba(255,106,94,.4); }
.btn.tiny { padding: 6px 12px; font-size: .8rem; }
.btn.wide { width: 100%; padding: 13px; font-size: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.field { display: block; margin-bottom: 12px; }
.field .fl { display: block; color: var(--muted); font-size: .82rem; margin-bottom: 5px; }
.field .fn { display: block; color: var(--muted); font-size: .78rem; margin-top: 5px; }
.field .txt, .field .sel, .field .num { width: 100%; }
.field2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.preview-wrap { border-radius: var(--g-r-lg); overflow: hidden; margin-bottom: 14px; background: radial-gradient(120% 90% at 50% 10%, rgba(62,207,178,.10), rgba(0,0,0,.26)); }
.preview-canvas { display: block; width: 100%; height: auto; }

.petlist { display: flex; flex-direction: column; gap: 8px; }
.petrow { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: var(--g-r-md); background: var(--g-in-fill); border: 1px solid var(--g-in-line); }
.petrow.active { border-color: rgba(62,207,178,.5); }
.pr-ico { font-size: 1.35rem; text-align: center; }
.pr-txt { display: flex; flex-direction: column; }

/* ------------------------------------------------------------- the sheet */

.scrim { position: fixed; inset: 0; background: rgba(3,6,10,.55); opacity: 0; pointer-events: none; transition: opacity .18s ease; z-index: 40; }
.scrim.on { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  max-height: 78vh; display: flex; flex-direction: column;
  transform: translateY(104%); transition: transform .22s cubic-bezier(.2,.8,.3,1);
  background: var(--g-sheen), rgba(13,17,24,.94);
  border-top: 1px solid var(--g-line-strong);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -18px 60px rgba(0,0,0,.55);
  -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur);
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.open { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.sheet-head h3 { margin: 0; }
.sheet-x { background: transparent; border: 0; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 6px; }
.sheet-body { overflow-y: auto; padding: 0 16px 8px; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 10px 16px 16px; border-top: 1px solid var(--g-in-line); }

.sheet-loc { background: var(--g-well); border-radius: var(--g-r-md); padding: 12px 14px; }
.sl-plain { font-weight: 700; font-size: 1rem; }
.sl-vet { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.sl-flags { margin: 10px 0 8px; padding-left: 18px; font-size: .82rem; color: var(--muted); }
.sl-flags b { color: var(--mention); }

@media (min-width: 920px) {
  /* Dock the sheet beside the model rather than over it — you are describing
     the pin you can see, so covering it is the one thing not to do. */
  .sheet { left: auto; right: 18px; bottom: 18px; top: 76px; width: 420px; border-radius: 20px; transform: translateX(118%); }
  .sheet.open { transform: none; }
  #pane-map { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: start; }
  #pane-map .panel { margin-bottom: 0; }
}

/* ----------------------------------------------------------- vet report */

.rep-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }

.report {
  background: #fff; color: #16202a; border-radius: var(--g-r-lg);
  padding: 26px 28px; box-shadow: var(--shadow);
  font-size: .92rem;
}
.report h2 { margin: 0; font-size: 1.4rem; }
.report h3 { margin: 26px 0 10px; font-size: 1.02rem; border-bottom: 1px solid #d8dee5; padding-bottom: 5px; color: #16202a; }
.report h4 { color: #16202a; }
.report .muted { color: #67757f; }
.report a { color: #1d8f7a; }
.rep-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; border-bottom: 2px solid #16202a; padding-bottom: 12px; }
.rep-sub { margin: 4px 0 0; color: #4b5a66; }
.rep-meta { text-align: right; font-size: .82rem; color: #4b5a66; }
.rep-disclaimer { font-size: .8rem; color: #5a6873; background: #f2f5f7; border-left: 3px solid #b9c4cc; padding: 9px 12px; margin: 14px 0 0; }

.rep-maps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.rep-map { margin: 0; border: 1px solid #dde3e8; border-radius: 8px; padding: 6px; background: #fff; }
.rep-map canvas { display: block; width: 100%; height: auto; }
.rep-map figcaption { text-align: center; font-size: .76rem; color: #67757f; padding-top: 4px; text-transform: uppercase; letter-spacing: .06em; }

.rep-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.rep-table th { text-align: left; border-bottom: 2px solid #16202a; padding: 6px 8px; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #4b5a66; }
.rep-table td { padding: 8px; border-bottom: 1px solid #e3e8ed; vertical-align: top; }
.rep-table tr.lv-soon .rt-n { background: #d94436; }
.rep-table tr.lv-mention .rt-n { background: #d79a1c; }
.rep-table tr.lv-watch .rt-n { background: #3a7fc7; }
.rt-n { color: #fff; font-weight: 800; text-align: center; width: 26px; border-radius: 4px; }
.rt-flag { color: #8a6d1f; font-size: .74rem; margin-top: 2px; }
.report .grow { color: #c0392b; }
.report .shrink { color: #1d8f7a; }

.rep-detail { border: 1px solid #dde3e8; border-left: 4px solid #3a7fc7; border-radius: 6px; padding: 12px 14px; margin-bottom: 12px; break-inside: avoid; }
.rep-detail.lv-soon { border-left-color: #d94436; }
.rep-detail.lv-mention { border-left-color: #d79a1c; }
.rep-detail h4 { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; font-size: .96rem; }
.rd-n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 4px; background: #16202a; color: #fff; font-size: .78rem; }
.rd-plain { margin: 0 0 8px; color: #4b5a66; font-size: .84rem; }
.rd-flags { margin: 0 0 8px; padding-left: 18px; font-size: .78rem; color: #5a6873; }
.rd-grid { display: grid; grid-template-columns: minmax(220px, 1fr) 1.2fr; gap: 16px; align-items: start; }
.rd-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: .82rem; }
.rd-facts dt { color: #67757f; }
.rd-facts dd { margin: 0; }
.rd-notes { margin: 8px 0 0; padding-left: 18px; font-size: .82rem; }
.rd-notes time { color: #67757f; }
.rd-why { margin-top: 8px; font-size: .8rem; color: #5a6873; background: #f7f9fa; padding: 7px 10px; border-radius: 4px; }
.rep-foot { margin-top: 22px; padding-top: 10px; border-top: 1px solid #d8dee5; font-size: .74rem; color: #67757f; }
.report .spark .sp-line { stroke: #1d8f7a; }
.report .spark .sp-dot { fill: #1d8f7a; }
.report .spark .sp-ref { stroke: #d79a1c; }
.report .spark .sp-lab { fill: #67757f; }
.report .spark .sp-val { fill: #16202a; }
.report .spark .sp-axis { stroke: #c8d0d7; }
.report .spark .sv-checked { fill: #b9c4cc; }
.report .spark .sv1, .report .timeline .sv1 { fill: #3a7fc7; }
.report .spark .sv2, .report .timeline .sv2 { fill: #d79a1c; }
.report .spark .sv3, .report .timeline .sv3 { fill: #d94436; }
.report .timeline .tl-grid { stroke: #e3e8ed; }
.report .timeline .tl-now { stroke: #1d8f7a; }
.report .timeline .tl-rule { stroke: #eef2f5; }
.report .timeline .tl-lab { fill: #4b5a66; }
.report .timeline .tl-spot { stroke: #1d8f7a; }
.report .timeline .sv-checked-dot { fill: #b9c4cc; }
.report .timeline .sp-val { fill: #16202a; }
.report .timeline .sp-lab { fill: #67757f; }
.rep-note { font-size: .78rem; color: #5a6873; margin: -2px 0 10px; }
.rep-cluster { background: #fff7e6; border-left: 3px solid #d79a1c; padding: 8px 12px; font-size: .82rem; margin-bottom: 10px; }
.rep-timeline { border: 1px solid #dde3e8; border-radius: 6px; padding: 8px; break-inside: avoid; }
.key { font-weight: 700; }
.key.k0 { color: #b9c4cc; } .key.k1 { color: #3a7fc7; } .key.k2 { color: #d79a1c; }
.key.k3 { color: #d94436; } .key.ks { color: #1d8f7a; }
.rep-table tr.lv-now .rt-n { background: #b3271b; }

/* ------------------------------------------------------------------ foot */

.pagefoot { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; color: var(--muted); font-size: .86rem; }
.pagefoot summary { cursor: pointer; font-weight: 650; color: var(--ink); padding: 10px 0; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.foot-grid h4 { margin: 0 0 6px; color: var(--accent); font-size: .86rem; }
.foot-grid p { margin: 0 0 8px; }
.foot-grid b { color: var(--ink); }
.redflags { margin: 0; padding-left: 18px; }
.redflags li { margin-bottom: 5px; }
.fineprint { text-align: center; font-size: .78rem; margin-top: 22px; }
.fineprint a { color: var(--muted); }

/* --------------------------------------------------------------- phones */

@media (max-width: 640px) {
  main { padding: 12px 12px 32px; }
  .panel { padding: 13px; border-radius: var(--g-r-lg); }
  .topbar { padding: 18px 14px 14px; }
  .topbar h1 { font-size: 1.3rem; }
  .tagline { font-size: .84rem; }
  #mapcanvas { height: 46vh; min-height: 280px; }
  .field2 { grid-template-columns: 1fr; }
  .rep-maps { grid-template-columns: 1fr; }
  .rd-grid { grid-template-columns: 1fr; }
  .trow { grid-template-columns: 1fr; }
  .sevchips { justify-content: flex-start; }
  .sev { flex: 1 1 0; min-width: 0; padding: 10px 4px; font-size: .74rem; }
  /* The measurable signs carry a number box as well as the four chips. At
     phone width those do not share a row — the chips lose the space and the
     labels run into each other — so it takes a line of its own. */
  .sevchips .tiny-num { flex: 1 0 100%; width: 100%; }
  .freqgrid { grid-template-columns: 1fr 1fr; }
  .striprow { flex-wrap: wrap; }
  .syncpill { order: -1; width: 100%; text-align: center; }
  .sc-code { font-size: 1rem; }
  .report { padding: 16px 14px; }
  .rep-meta { text-align: left; }
  /* fat-finger targets: this gets tapped while holding a dog still */
  .chip { padding: 10px 14px; }
  .btn { padding: 11px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet { transition: none; }
  .btn:active { transform: none; }
}

/* ---------------------------------------------------------------- print */
/* The report IS the deliverable. Printing drops every bit of app chrome and
   leaves a plain document: black on white, maps un-broken across pages, and
   each spot's detail block kept whole. */
@media print {
  body { background: #fff; color: #000; }
  body::before { display: none; }
  .sitenav, .topbar, .petstrip, .mode-tabs, .pagefoot, .rep-actions, .noprint,
  #pane-map, #pane-spots, #pane-pets, .scrim, .sheet { display: none !important; }
  main { max-width: none; padding: 0; }
  #pane-report { display: block !important; }
  .report { box-shadow: none; border-radius: 0; padding: 0; font-size: 10.5pt; }
  .report h3 { margin-top: 18pt; }
  .rep-maps { grid-template-columns: repeat(2, 1fr); gap: 8pt; }
  .rep-map { break-inside: avoid; }
  .rep-detail, .rep-table tr { break-inside: avoid; }
  @page { margin: 14mm; }
}
