:root {
  --ink: #1c2733;
  --muted: #66717d;
  --faint: #98a1ab;
  --bg: #f4f6f8;
  --card: #ffffff;
  --line: #e2e7ec;
  --accent: #0e6e56;
  --accent-soft: #e3f2ec;
  --danger: #b3372e;
  --danger-soft: #f9e9e7;
  --warn-soft: #fdf3dd;
  --warn-ink: #8a5a0b;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
main { max-width: 980px; margin: 0 auto; padding: 24px 16px 64px; }

.topbar {
  display: flex; align-items: center; gap: 24px;
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 10px 20px; position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 17px; color: var(--accent); text-decoration: none; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 8px; font-size: 14px; }
.topbar nav a:hover { background: var(--bg); }
.topbar nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.actor { display: flex; align-items: center; gap: 8px; }
.actor label { font-size: 12px; color: var(--faint); }
.foot { text-align: center; color: var(--faint); font-size: 12px; padding: 24px; }

h1 { font-size: 24px; font-weight: 650; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

button, .btn {
  font: inherit; font-size: 14px; font-weight: 500;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  color: var(--ink); padding: 8px 16px; cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { border-color: var(--faint); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #0b5a46; border-color: #0b5a46; }
.btn-danger { background: var(--card); border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }

input, select, textarea {
  font: inherit; font-size: 14px; width: 100%;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  background: var(--card); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label { font-size: 13px; font-weight: 500; color: var(--muted); display: block; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.checkline { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.checkline input { width: auto; }
.hint { font-size: 12px; color: var(--faint); margin-top: 4px; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.pill.home { background: var(--accent-soft); color: var(--accent); }
.pill.lost { background: var(--danger-soft); color: var(--danger); }
.pill.deceased { background: var(--bg); color: var(--muted); }
.pill.strong { background: var(--accent-soft); color: var(--accent); }
.pill.possible { background: var(--warn-soft); color: var(--warn-ink); }
.pill.weak { background: var(--bg); color: var(--muted); }

.code { font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 13px; color: var(--muted); letter-spacing: 0.06em; word-break: break-all; }
.kind-tag { font-size: 11px; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 1px 6px; margin-right: 6px; }

.match-row { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.match-row img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.match-row .m-meta { flex: 1; }
.scorebar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; margin-top: 6px; max-width: 220px; }
.scorebar i { display: block; height: 100%; background: var(--accent); }


.spark { color: var(--accent); }
.notice { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }

input[type="file"] { padding: 4px; border: 1px dashed #c9d2da; background: #fafbfc; }
input[type="file"]::file-selector-button {
  font: inherit; font-size: 13px; font-weight: 500;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 6px; padding: 6px 14px; margin-right: 10px; cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: var(--accent); color: var(--accent); }

.doc-toolbar { max-width: 794px; margin: 0 auto 14px; display: flex; gap: 10px; justify-content: flex-end; }
.sheet {
  background: #fff; max-width: 794px; margin: 0 auto;
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 2px 14px rgba(28, 39, 51, 0.07);
  padding: 52px 60px;
}
.cv-head { display: flex; justify-content: space-between; gap: 28px; border-bottom: 2px solid var(--ink); padding-bottom: 22px; }
.cv-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.cv-head .cv-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.cv-photo { width: 126px; height: 126px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }
.cv-section { margin-top: 30px; }
.cv-h {
  font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--muted); border-bottom: 1px solid var(--line);
  padding-bottom: 6px; margin: 0 0 14px;
}
.cv-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 32px; }
.cv-facts div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dotted #e8ecf0; padding-bottom: 6px; }
.cv-facts dt { font-size: 13px; color: var(--faint); margin: 0; }
.cv-facts dd { font-size: 13.5px; font-weight: 550; margin: 0; text-align: right; }
.cv-rows { list-style: none; margin: 0; padding: 0; }
.cv-rows li { display: flex; gap: 20px; padding: 8px 0; }
.cv-rows li + li { border-top: 1px dotted #e8ecf0; }
.cv-rows time { width: 92px; flex: none; font-family: ui-monospace, monospace; font-size: 12px; color: var(--faint); padding-top: 2px; }
.cv-photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cv-photo-grid figure { margin: 0; }
.cv-photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); }
.cv-photo-grid figcaption { font-size: 10.5px; color: var(--faint); text-align: center; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.08em; }
.cv-foot { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 12px; display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint); }
.cv-empty { font-size: 13px; color: var(--faint); margin: 0; font-style: italic; }
.pen {
  border: none; background: none; padding: 2px; margin-left: 6px; cursor: pointer;
  color: var(--faint); opacity: 0.55; vertical-align: baseline;
}
.pen:hover { color: var(--accent); opacity: 1; border: none; }
.pen-form { display: inline-flex; gap: 6px; align-items: center; }
.pen-form input, .pen-form select { width: auto; min-width: 130px; padding: 4px 8px; font-size: 13px; }
.pen-form button { padding: 4px 10px; font-size: 12.5px; }
.add-toggle {
  float: right; border: 1px solid var(--line); background: var(--card); color: var(--muted);
  width: 22px; height: 22px; line-height: 1; padding: 0; border-radius: 6px;
  font-size: 15px; cursor: pointer;
}
.add-toggle:hover { color: var(--accent); border-color: var(--accent); }
.inline-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #fafbfc; border: 1px dashed var(--line); border-radius: 10px; padding: 10px; margin-bottom: 14px; }
.inline-add[hidden] { display: none; }

@media print {
  .topbar, .foot, .screen-only, .doc-toolbar, .inline-add, .pen, .add-toggle { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .sheet { border: none; box-shadow: none; padding: 0; max-width: none; border-radius: 0; }
  .cv-section { break-inside: avoid; }
  @page { size: A4; margin: 15mm; }
}

/* ---- account chip + landing page ---- */
.avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.who { font-size: 14px; color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-quiet { padding: 5px 10px; font-size: 13px; color: var(--muted); }

.hero { text-align: center; padding: 48px 0 8px; }
.hero-title { font-size: 36px; line-height: 1.15; font-weight: 680; margin: 0 auto 16px; max-width: 640px; }
.hero-sub { color: var(--muted); font-size: 16px; max-width: 560px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-note { color: var(--faint); font-size: 13px; margin-top: 16px; }
.btn-google { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; font-weight: 500; background: var(--card); border-color: var(--line); box-shadow: 0 1px 2px rgba(28,39,51,.06); }
.btn-google:hover { border-color: var(--faint); }
@media (max-width: 600px) { .hero-title { font-size: 28px; } .hero { padding-top: 28px; } }

/* ---- draft sheet: the new-passport form wearing the passport's layout ---- */
.sheet-draft .f-in {
  font: inherit; color: inherit; width: auto; max-width: 100%;
  background: transparent; border: none; border-bottom: 1px dashed var(--line);
  border-radius: 0; padding: 1px 2px; text-align: inherit;
}
.sheet-draft .f-in:focus { outline: none; border-bottom-color: var(--accent); background: var(--accent-soft); }
.sheet-draft .f-in::placeholder { color: var(--faint); font-weight: 400; }
.sheet-draft .cv-facts dd { display: flex; justify-content: flex-end; align-items: baseline; gap: 6px; }
.sheet-draft .cv-facts .f-in { text-align: right; min-width: 90px; }
.sheet-draft h1 .f-in { width: 100%; font-size: 30px; font-weight: 700; letter-spacing: -0.01em; border-bottom-width: 2px; }
.sheet-draft p .f-in, .sheet-draft section > .f-in { width: 100%; }
.sheet-draft .cv-derived { color: var(--faint); font-weight: 400; font-style: italic; }
.est-check { font-size: 11.5px; color: var(--faint); font-weight: 400; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.est-check input { width: auto; margin: 0; }

.photo-slot {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; cursor: pointer; overflow: hidden;
  border: 1px dashed var(--line); background: var(--bg); color: var(--faint);
  font-size: 11px; text-align: center;
}
.photo-slot:hover { border-color: var(--accent); color: var(--accent); }
.photo-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-slot.filled { border-style: solid; }
.photo-slot.filled span { position: relative; z-index: 1; background: rgba(255,255,255,.9); border-radius: 6px; padding: 0 5px; }
.photo-slot-sq { width: 100%; aspect-ratio: 1; border-radius: 3px; font-size: 18px; }
.cv-photo-grid .unindexed { color: var(--warn-ink); background: var(--warn-soft); border-radius: 3px; margin-top: 2px; }

/* ---- first-login role picker ---- */
/* Equal columns, stretched rows: every card is the same size whatever the
   copy length, so the row reads as one block. */
.role-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch; gap: 16px; margin-top: 28px;
}
.role-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  width: 100%; height: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px; cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s;
}
.role-card:hover { border-color: var(--accent); box-shadow: 0 3px 14px rgba(28,39,51,.08); transform: translateY(-1px); }
.role-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.role-icon { color: var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 8px; display: inline-flex; }
.role-text { display: flex; flex-direction: column; gap: 6px; }
.role-label { font-size: 16.5px; font-weight: 620; line-height: 1.25; }
.role-blurb { font-size: 13px; color: var(--muted); font-weight: 400; line-height: 1.55; }
@media (max-width: 760px) {
  .role-grid { grid-template-columns: 1fr; }
  .role-card { flex-direction: row; align-items: flex-start; gap: 14px; }
}

/* ---- owner home: few animals, so big cards beat a sparse grid ---- */
.pet-cards { display: flex; flex-direction: column; gap: 14px; }
.pet-card {
  display: flex; gap: 18px; align-items: center; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; transition: border-color .12s, box-shadow .12s, transform .12s;
}
.pet-card:hover { border-color: var(--accent); box-shadow: 0 3px 14px rgba(28,39,51,.08); transform: translateY(-1px); }
.pet-card.is-lost { border-color: var(--danger); background: linear-gradient(0deg, var(--danger-soft), var(--danger-soft)) padding-box, var(--card); }
.pet-photo { width: 104px; height: 104px; flex: none; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.pet-photo-empty { display: flex; align-items: center; justify-content: center; color: var(--faint); background: var(--bg); }
.pet-main { flex: 1; min-width: 0; }
.pet-name { font-size: 19px; font-weight: 620; display: flex; align-items: center; gap: 10px; }
.pet-meta { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.pet-flag { margin-top: 8px; font-size: 12.5px; color: var(--warn-ink); background: var(--warn-soft); display: inline-block; padding: 2px 9px; border-radius: 20px; }
.pet-actions { margin-top: 10px; }
.pet-action { font-size: 13px; color: var(--accent); font-weight: 500; }
.pet-card-add { border-style: dashed; background: transparent; }
.pet-card-add:hover { background: var(--card); }
.pet-card-add .pet-photo { width: 72px; height: 72px; }
.nav-quiet { font-size: 13px !important; opacity: .8; }
@media (min-width: 900px) { .pet-cards.two-up { display: grid; grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .pet-card { flex-direction: column; align-items: flex-start; }
  .pet-photo { width: 100%; height: 180px; }
}

/* ---- observations ---- */
.obs-form { flex-direction: column; align-items: stretch; gap: 10px; }
.obs-form textarea { width: 100%; font: inherit; font-size: 14px; }
.obs-form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.obs-list li { align-items: flex-start; }
.obs-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sev { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 20px; }
.sev-info { background: var(--bg); color: var(--muted); }
.sev-watch { background: var(--warn-soft); color: var(--warn-ink); }
.sev-urgent { background: var(--danger-soft); color: var(--danger); }
.obs-part { font-size: 12.5px; color: var(--muted); }
.obs-status { font-size: 11px; color: var(--faint); margin-left: auto; }
.obs-open { color: var(--warn-ink); }
.obs-media { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.obs-media img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.obs-media video { width: 220px; border-radius: 6px; border: 1px solid var(--line); }
.obs-media audio { width: 260px; }
.vet-note { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; font-size: 13px; }
.vet-dx { font-weight: 600; color: var(--accent); }
.vet-form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }

/* =========================================================================
   Phone. The sheet is an A4 document on a 390px screen, so the rules below
   unstack it rather than shrink it: facts go one per line, the header goes
   vertical, right-aligned draft inputs go left, and every control grows to a
   thumb-sized target. Print rules are untouched.
   ========================================================================= */

/* iOS zooms the page when a focused input is under 16px. */
@media (max-width: 780px) {
  input, select, textarea, .sheet-draft .f-in { font-size: 16px; }
}

/* Touch devices: real tap targets, no hover-only affordances. */
@media (pointer: coarse) {
  button, .btn, input[type="file"]::file-selector-button { min-height: 44px; }
  .btn-quiet { min-height: 36px; }
  .pen { padding: 8px; opacity: 1; }
  .add-toggle { width: 32px; height: 32px; font-size: 18px; }
  .pet-card:hover, .role-card:hover { transform: none; box-shadow: none; }
}

@media (max-width: 780px) {
  main { padding: 16px 12px 48px; }
  h1 { font-size: 21px; }

  /* Header: brand and account on the first row, nav on its own beneath. */
  .topbar { flex-wrap: wrap; gap: 10px 14px; padding: 10px 14px; }
  .topbar nav { order: 3; width: 100%; flex: none; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .topbar nav a { white-space: nowrap; padding: 7px 12px; }
  .actor { margin-left: auto; }
  .who { max-width: 108px; font-size: 13px; }

  /* The document itself. */
  .doc-toolbar { flex-wrap: wrap; gap: 8px; }
  .doc-toolbar .sub { width: 100%; order: -1; font-size: 13px; }
  .doc-toolbar form { margin-right: 0 !important; }
  .doc-toolbar button, .doc-toolbar .btn { flex: 1 1 auto; }
  .sheet { padding: 24px 18px; border-radius: 12px; }
  .cv-head { flex-direction: column; gap: 16px; padding-bottom: 16px; }
  .cv-head h1 { font-size: 24px; }
  .cv-photo { width: 100%; height: 200px; border-radius: 12px; }
  .cv-section { margin-top: 24px; }
  .cv-facts { grid-template-columns: 1fr; gap: 0; }
  .cv-facts div { padding: 8px 0; gap: 16px; }
  .cv-facts dd { text-align: right; min-width: 0; overflow-wrap: anywhere; }
  .cv-photo-grid { grid-template-columns: repeat(2, 1fr); }
  .cv-rows li { flex-direction: column; gap: 4px; padding: 12px 0; }
  .cv-rows time { width: auto; }
  .cv-foot { flex-direction: column; gap: 4px; }

  /* Draft: right-aligned values look broken once the label sits above them. */
  .sheet-draft .cv-facts div { flex-direction: column; align-items: stretch; gap: 4px; }
  .sheet-draft .cv-facts dd { justify-content: flex-start; text-align: left; }
  .sheet-draft .cv-facts .f-in { text-align: left; width: 100%; min-width: 0; }
  .sheet-draft h1 .f-in { font-size: 24px; }
  .photo-slot.cv-photo { height: 180px; }

  /* Inline add/edit forms stack instead of squeezing. */
  .inline-add { flex-direction: column; align-items: stretch; }
  .inline-add > * { width: 100% !important; }
  .obs-form-row { flex-direction: column; align-items: stretch; }
  .obs-form-row > * { width: 100% !important; }
  .vet-form { flex-direction: column; align-items: stretch; }
  .vet-form > * { width: 100% !important; }
  .pen-form { display: flex; flex-wrap: wrap; width: 100%; }
  .pen-form input, .pen-form select { flex: 1 1 100%; min-width: 0; font-size: 16px; }
  .obs-media video, .obs-media audio { width: 100%; }

  /* Found-report results. */
  .match-row { flex-wrap: wrap; }
  .match-row .m-meta { flex: 1 1 100%; }
  .scorebar { max-width: none; }

  .hero-actions .btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .who { display: none; }              /* avatar carries the identity */
  .cv-photo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .obs-media img { width: calc(50% - 4px); height: 120px; }
  .pet-name { font-size: 17px; }
}

/* Keep the save/print bar reachable without scrolling back down. */
@media (max-width: 780px) {
  .doc-toolbar-sticky {
    position: sticky; bottom: 0; z-index: 4; margin: 0 -12px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(244, 246, 248, .94); backdrop-filter: blur(6px);
    border-top: 1px solid var(--line);
  }
}

/* The wordmark is one word: without this, the flex gap on .brand splits it. */
.wordmark { display: inline; }
.brand { gap: 8px; }
.weight-block { display: flex; gap: 24px; align-items: flex-start; }
.match-actions { display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 780px) {
  .weight-block { flex-direction: column; gap: 10px; }
  .weight-block .spark { width: 100%; }
  .match-actions { flex-direction: row; width: 100%; }
  .match-actions > *, .match-actions form { flex: 1; }
  .match-actions .btn, .match-actions button { width: 100%; text-align: center; }
  .top-save { display: none; }          /* the sticky bar at the foot carries it */
  .pet-photo { height: 160px; }
}

/* ---- photo management on the passport ---- */
/* The cover slot IS the file input's label: the whole photo is the target. */
.cover-slot { position: relative; flex: none; display: block; }
.cover-click { cursor: pointer; }
.cover-click:hover .cv-photo { border-color: var(--accent); }
.cover-hint {
  position: absolute; left: 6px; right: 6px; bottom: 6px; text-align: center;
  padding: 5px 8px; font-size: 12px; border-radius: 8px; pointer-events: none;
  background: rgba(255,255,255,.92); border: 1px solid var(--line); color: var(--ink);
  opacity: 0; transition: opacity .12s;
}
.cover-click:hover .cover-hint, .cover-click:focus-within .cover-hint { opacity: 1; }
.cover-slot.is-uploading .cover-hint { opacity: 1; color: var(--accent); }
.cover-slot.is-uploading .cv-photo { opacity: .5; }
#cover-form[hidden] { display: none; }
.ph { position: relative; }
.ph-tools { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.ph-tools button {
  padding: 3px 8px; font-size: 11px; font-weight: 500; border-radius: 6px;
  color: var(--muted); background: var(--card);
}
.ph-tools .ph-del:hover { color: var(--danger); border-color: var(--danger); }
.ph-gone {
  width: 100%; aspect-ratio: 1; border-radius: 3px; border: 1px dashed var(--line);
  background: var(--bg); color: var(--faint); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; font-size: 11px;
}
.obs-media-item { display: inline-flex; flex-direction: column; gap: 4px; align-items: center; }
.obs-media-item .ph-del { padding: 2px 8px; font-size: 11px; color: var(--muted); }
.obs-media-item .ph-del:hover { color: var(--danger); border-color: var(--danger); }

/* Touch has no hover: the cover button is always visible on a phone. */
/* Touch has no hover, so the hint stays visible. */
@media (pointer: coarse) { .cover-hint { opacity: 1; } }

/* ---- observation status, open cases, request badges ---- */
.badge { background: var(--danger); color: #fff; border-radius: 20px; padding: 0 6px; font-size: 11px; font-weight: 600; }
.open-cases {
  background: var(--warn-soft); border: 1px solid #f0e2bd; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 14px; font-size: 13px;
}
.open-cases ul { margin: 6px 0 0; padding-left: 0; list-style: none; }
.open-cases li { padding: 3px 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.open-cases em { color: var(--warn-ink); font-style: normal; font-size: 11.5px; }
.obs-status { font-size: 11px; margin-left: auto; font-weight: 600; }
.st-ongoing { color: var(--warn-ink); }
.st-improving { color: var(--accent); }
.st-resolved { color: var(--faint); }
.obs-quick { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.obs-quick button { padding: 4px 10px; font-size: 12px; color: var(--muted); }
.obs-quick button:hover { color: var(--accent); border-color: var(--accent); }
.obs-quick .btn-primary { color: #fff; }
