/* TailTrackerAI — design language shared with syntaxweave.com */

:root {
  --bg:            #0a0a0c;
  --surface:       #131316;
  --surface-hi:    #1c1c22;
  --text:          #e8e8ec;
  --text-dim:      #b8b8c4;
  --text-faint:    #8a8a98;
  --accent:        #d4a574;
  --accent-dim:    rgba(212,165,116,0.12);
  --accent-glow:   rgba(212,165,116,0.22);
  --border:        rgba(255,255,255,0.07);
  --border-hi:     rgba(255,255,255,0.13);
  --ok:            #4ade80;
  --ok-dim:        rgba(74,222,128,0.09);
  --warn:          #fb923c;
  --warn-dim:      rgba(251,146,60,0.1);
  --danger:        #f87171;
  --danger-dim:    rgba(248,113,113,0.1);
  --ease:          cubic-bezier(0.2,0.6,0.2,1);
  --f-sans:        'Inter', system-ui, sans-serif;
  --f-serif:       'Fraunces', Georgia, serif;
  --f-mono:        'JetBrains Mono', 'Fira Code', monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-sans); font-weight: 300;
  background: var(--bg); color: var(--text);
  line-height: 1.6; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}

/* ── HEADER ─────────────────────────────────────────── */
.app-header {
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 0.9rem 1.25rem; position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.brand {
  font-family: var(--f-mono); font-size: 0.82rem; font-weight: 400;
  color: var(--text); text-decoration: none; letter-spacing: -0.01em;
}
.brand::before { content: "§ "; color: var(--accent); }
.header-nav { display: flex; align-items: center; gap: 1.25rem; }
.header-nav a {
  font-family: var(--f-mono); font-size: 0.72rem; color: var(--text-dim);
  text-decoration: none; letter-spacing: 0.01em;
  transition: color 0.2s var(--ease);
}
.header-nav a:hover { color: var(--text); }

/* ── PAGE HERO ───────────────────────────────────────── */
.page-hero {
  padding: 1.75rem 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.back-link {
  display: inline-block; font-family: var(--f-mono); font-size: 0.7rem;
  color: var(--text-faint); text-decoration: none; margin-bottom: 0.9rem;
  letter-spacing: 0.02em; transition: color 0.2s var(--ease);
}
.back-link::before { content: "← "; }
.back-link:hover { color: var(--text-dim); }
.page-title {
  font-family: var(--f-serif); font-weight: 300;
  font-size: clamp(1.85rem, 7vw, 2.75rem);
  letter-spacing: -0.02em; line-height: 1.08; margin: 0 0 0.65rem;
}
.page-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.03em;
  padding: 0.25rem 0.6rem; border: 1px solid var(--border); color: var(--text-dim);
}
.chip.ok    { border-color: rgba(74,222,128,0.2);   color: var(--ok);     }
.chip.warn  { border-color: rgba(251,146,60,0.25);  color: var(--warn);   }
.chip.danger{ border-color: rgba(248,113,113,0.25); color: var(--danger); }
.chip.accent{ border-color: var(--accent-dim);      color: var(--accent); }
.chip.faint { color: var(--text-faint); border-color: var(--border); font-size: 0.62rem; }

/* ── STATS ROW ───────────────────────────────────────── */
.stats-row {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  padding: 0.65rem 1.25rem; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.stat-pill {
  font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.03em;
  padding: 0.22rem 0.6rem; border: 1px solid var(--border); color: var(--text-dim);
  text-decoration: none;
}
a.stat-pill { cursor: pointer; transition: border-color 0.2s var(--ease), color 0.2s var(--ease); }
a.stat-pill:hover { border-color: var(--border-hi); color: var(--text); }
a.stat-pill.active { border-color: var(--accent); color: var(--accent); }
.stat-pill.warn { border-color: rgba(251,146,60,0.3); color: var(--warn); }
a.stat-pill.warn:hover { border-color: var(--warn); }

/* Page body positioning (keeps it above the fixed doodle bg) */
.page-body { position: relative; z-index: 1; }

/* ── CSS vars for tunable dark-mode legibility ──────────────────────── */
:root {
  --stale-strip-1:   2px;
  --stale-strip-2:   4px;
  --stale-tint:      0.04;
  --heatmap-partial: 0.15;
  --heatmap-full:    0.40;
  --batch-bar-bg:    var(--surface-hi);
}

/* ── Zone heatmap ───────────────────────────────────────────────────── */
.zone-heatmap {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--border);
  background: var(--bg); overflow-x: auto;
}
.zone-tile {
  position: relative; min-width: 76px; padding: 0.45rem 0.6rem;
  border: 1px solid rgba(212,165,116,0.35); cursor: pointer;
  background: rgba(212,165,116,var(--zone-fill,0));
  transition: border-color 0.2s var(--ease);
  flex-shrink: 0;
}
.zone-tile.partial { background: rgba(212,165,116,var(--heatmap-partial)); }
.zone-tile.full    { background: rgba(212,165,116,var(--heatmap-full)); border-width: 2px; border-color: var(--accent); }
.zone-tile:hover   { border-color: var(--accent); }
.zone-tile-name {
  font-family: var(--f-mono); font-size: 0.58rem; font-weight: 500;
  color: #fff; text-transform: uppercase; letter-spacing: 0.05em;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px;
}
.zone-tile-count {
  font-family: var(--f-mono); font-size: 0.7rem;
  color: rgba(255,255,255,0.75); display: block; margin-top: 0.1rem;
}
.zone-capacity-dot {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); margin-left: 0.3rem; vertical-align: middle;
}

/* ── Urgency accent strips ──────────────────────────────────────────── */
.item-row.stale-1 { box-shadow: inset var(--stale-strip-1) 0 0 var(--accent); }
.item-row.stale-2 {
  box-shadow: inset var(--stale-strip-2) 0 0 var(--accent);
  background: rgba(212,165,116,var(--stale-tint));
}
.item-row.stale-2:active { background: rgba(212,165,116,calc(var(--stale-tint) + 0.04)); }

/* ── Row checkbox (batch select) ────────────────────────────────────── */
.row-check {
  width: 18px; height: 44px; flex-shrink: 0; display: flex;
  align-items: center; justify-content: center; cursor: pointer;
}
.row-check input[type=checkbox] {
  width: 15px; height: 15px; accent-color: var(--accent);
  cursor: pointer; flex-shrink: 0;
}
.item-row.selected { background: rgba(212,165,116,0.07) !important; }

/* ── Batch action bar ───────────────────────────────────────────────── */
.batch-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: var(--batch-bar-bg); border-top: 2px solid var(--accent);
  padding: 0.75rem 1.25rem; display: none;
  align-items: center; gap: 0.65rem; flex-wrap: wrap;
}
.batch-bar.show { display: flex; }
.batch-bar-count {
  font-family: var(--f-mono); font-size: 0.72rem; color: var(--text-dim);
  margin-right: auto;
}
.batch-btn {
  font-family: var(--f-mono); font-size: 0.72rem; padding: 0.5rem 1rem;
  border: 1px solid var(--border-hi); background: transparent; color: var(--text);
  cursor: pointer; min-height: 44px; transition: border-color 0.2s, color 0.2s;
}
.batch-btn:hover { border-color: var(--accent); color: var(--accent); }
.batch-btn.cancel-batch { color: var(--text-faint); }

/* ── Quick transfer (move icon + popover) ───────────────────────────── */
.move-btn {
  width: 28px; height: 44px; min-height: 44px; padding: 0; flex-shrink: 0;
  background: none; border: none; cursor: pointer; color: var(--text-faint);
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s; position: relative;
}
.move-btn:hover { color: var(--accent); }
.move-popover {
  position: absolute; right: 0; bottom: 48px; z-index: 350;
  background: var(--surface-hi); border: 1px solid var(--border-hi);
  padding: 0.5rem; min-width: 200px; max-height: 260px; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.move-zone-btn {
  display: block; width: 100%; text-align: left; padding: 0.55rem 0.75rem;
  font-family: var(--f-mono); font-size: 0.72rem; color: var(--text-dim);
  background: none; border: none; cursor: pointer; min-height: 44px;
  transition: background 0.15s, color 0.15s;
}
.move-zone-btn:hover { background: var(--surface); color: var(--accent); }

/* ── Vet alert icon ─────────────────────────────────────────────────── */
.vet-btn {
  width: 28px; height: 44px; min-height: 44px; padding: 0; flex-shrink: 0;
  background: none; border: none; cursor: pointer; color: var(--text-faint);
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s;
}
.vet-btn:hover { color: var(--warn); }
.vet-btn.active { color: var(--warn); }
.vet-icon-badge {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--warn); margin-left: 0.25rem; vertical-align: middle;
  flex-shrink: 0;
}

/* ── CONTROLS / SEARCH ───────────────────────────────── */
.controls {
  padding: 0.75rem 1.25rem;
  background: var(--bg); border-bottom: 1px solid var(--border);
  position: sticky; top: 53px; z-index: 90;
}
.search-input {
  width: 100%; padding: 0.65rem 0.85rem;
  font-family: var(--f-mono); font-size: 0.875rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); outline: none;
  transition: border-color 0.2s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-faint); }
.filter-row {
  display: flex; gap: 0.35rem; margin-top: 0.55rem;
  overflow-x: auto; padding-bottom: 2px; scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0; font-family: var(--f-mono); font-size: 0.65rem;
  letter-spacing: 0.04em; padding: 0.28rem 0.7rem;
  border: 1px solid var(--border); color: var(--text-faint);
  text-decoration: none; white-space: nowrap;
  transition: all 0.2s var(--ease);
}
.filter-chip:hover { color: var(--text-dim); border-color: var(--border-hi); }
.filter-chip.active { border-color: var(--accent); color: var(--accent); }
.filter-chip.dim { opacity: 0.28; cursor: default; pointer-events: none; }

/* ── ZONE GROUP HEADER ───────────────────────────────── */
.zone-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 1.25rem 0.45rem;
  font-family: var(--f-mono); font-size: 0.62rem;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-dim);
}

/* ── ITEM LIST ───────────────────────────────────────── */
.item-list { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.item-row {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
  transition: background 0.18s var(--ease);
}
.item-row:last-child { border-bottom: none; }
.item-row:active { background: var(--surface-hi); }

/* ── AVATAR ─────────────────────────────────────────── */
.avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-serif); font-size: 1rem; font-weight: 300; color: var(--accent);
}

/* ── ANIMAL ROW CONTENT ─────────────────────────────── */
.animal-name {
  font-family: var(--f-serif); font-weight: 300; font-size: 1.05rem;
  letter-spacing: -0.01em; line-height: 1.2;
}
.animal-meta-row {
  display: flex; align-items: center; gap: 0.45rem; margin-top: 0.2rem; flex-wrap: wrap;
}
.animal-id {
  font-family: var(--f-mono); font-size: 0.65rem; color: var(--text-dim); letter-spacing: 0.02em;
}
.status-badge {
  font-family: var(--f-mono); font-size: 0.58rem; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 0.1rem 0.4rem;
  border: 1px solid var(--border-hi); color: var(--text-dim);
}
.status-badge.available { border-color: rgba(74,222,128,0.25); color: var(--ok); }
.last-event {
  margin-left: auto; text-align: right; flex-shrink: 0;
  font-family: var(--f-mono); font-size: 0.65rem; color: var(--text-dim);
  line-height: 1.4;
}
.last-event.stale { color: var(--warn); }

/* ── SECTION LABEL ───────────────────────────────────── */
.section-label {
  font-family: var(--f-mono); font-size: 0.62rem;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-faint);
  padding: 1.35rem 1.25rem 0.55rem;
}

/* ── ACTION BUTTONS (scan page) ──────────────────────── */
.action-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem;
  padding: 0 1.25rem;
}
.action-btn {
  width: 100%; min-height: 82px; padding: 1.25rem 0.5rem;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-family: var(--f-sans); font-size: 0.95rem; font-weight: 400;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.2rem; cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.action-btn:active { transform: scale(0.97); background: var(--surface-hi); }
.action-btn.primary { border-color: rgba(74,222,128,0.18); }
.action-btn.primary:active { border-color: var(--ok); background: var(--ok-dim); }
.action-btn.danger  { border-color: rgba(248,113,113,0.2); }
.action-btn.danger:active  { border-color: var(--danger); background: var(--danger-dim); }

/* ── NOTES AREA ─────────────────────────────────────── */
.notes-area {
  padding: 1rem 1.25rem; border-top: 1px solid var(--border);
}
.notes-area label {
  display: block; font-family: var(--f-mono); font-size: 0.62rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-faint); margin-bottom: 0.45rem;
}
.notes-area textarea {
  width: 100%; padding: 0.7rem 0.8rem; min-height: 3.75em; resize: vertical;
  font-family: var(--f-mono); font-size: 0.875rem;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  outline: none; transition: border-color 0.2s var(--ease);
}
.notes-area textarea:focus { border-color: var(--accent); }
.notes-area textarea::placeholder { color: var(--text-faint); }
.hint { font-family: var(--f-mono); font-size: 0.65rem; color: var(--text-faint); margin-top: 0.35rem; }

/* ── HISTORY ─────────────────────────────────────────── */
.history-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 0.75rem; padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: none; }
.history-action { font-size: 0.9rem; color: var(--text); }
.history-details { display: block; font-family: var(--f-mono); font-size: 0.72rem; color: var(--text-dim); margin-top: 0.1rem; }
.history-time { flex-shrink: 0; font-family: var(--f-mono); font-size: 0.65rem; color: var(--text-dim); text-align: right; }
.history-empty { padding: 1.25rem; font-family: var(--f-mono); font-size: 0.75rem; color: var(--text-dim); }

/* ── FORMS ───────────────────────────────────────────── */
.form-section { padding: 1.25rem; }
.field { margin-bottom: 1.1rem; }
.field label {
  display: block; font-family: var(--f-mono); font-size: 0.62rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-faint); margin-bottom: 0.4rem;
}
.field input,
.field select,
.field textarea {
  width: 100%; padding: 0.75rem 0.8rem;
  font-family: var(--f-mono); font-size: 0.875rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); outline: none;
  -webkit-appearance: none; appearance: none;
  transition: border-color 0.2s var(--ease);
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23555560'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.85rem center;
  padding-right: 2.25rem;
}
.field select option { background: var(--surface); color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field textarea { resize: vertical; min-height: 3.5em; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; }
.field-hint { font-family: var(--f-mono); font-size: 0.62rem; color: var(--text-faint); margin-top: 0.35rem; }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-block; font-family: var(--f-mono); font-size: 0.8rem;
  letter-spacing: 0.03em; padding: 0.85rem 1.35rem;
  border: 1px solid; cursor: pointer; text-decoration: none;
  transition: all 0.2s var(--ease); -webkit-tap-highlight-color: transparent;
}
.btn-primary  { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-primary:active { opacity: 0.85; transform: scale(0.99); }
.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-hi); }
.btn-full { display: block; width: 100%; text-align: center; }
.btn-sm {
  display: inline-block; font-family: var(--f-mono); font-size: 0.68rem;
  letter-spacing: 0.03em; padding: 0.35rem 0.75rem;
  border: 1px solid var(--border); background: transparent; color: var(--text-dim);
  cursor: pointer; text-decoration: none; transition: all 0.2s var(--ease);
}
.btn-sm:hover { color: var(--text); border-color: var(--border-hi); }
.btn-sm.accent { border-color: var(--accent-dim); color: var(--accent); }
.btn-sm.accent:hover { border-color: var(--accent); }

/* ── ZONE LIST ROWS ──────────────────────────────────── */
.zone-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.zone-row:last-child { border-bottom: none; }
.zone-label {
  flex: 1; font-family: var(--f-serif); font-weight: 300; font-size: 1rem; letter-spacing: -0.01em;
}
.zone-meta { font-family: var(--f-mono); font-size: 0.65rem; color: var(--text-faint); margin-right: 0.25rem; }
.zone-actions { display: flex; gap: 0.35rem; }

/* ── INLINE ADD FORM ─────────────────────────────────── */
.inline-add {
  padding: 1rem 1.25rem; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.add-row { display: flex; gap: 0.45rem; }
.add-row input {
  flex: 1; padding: 0.65rem 0.75rem;
  font-family: var(--f-mono); font-size: 0.85rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); outline: none;
  transition: border-color 0.2s var(--ease);
}
.add-row input:focus { border-color: var(--accent); }
.add-row input::placeholder { color: var(--text-faint); }
.add-row .btn-add {
  padding: 0.65rem 1rem; background: var(--accent); color: var(--bg);
  border: 1px solid var(--accent); font-family: var(--f-mono); font-size: 0.78rem;
  font-weight: 500; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}

/* ── SUPPLY ROWS ─────────────────────────────────────── */
.supply-row {
  padding: 0.95rem 1.25rem; border-bottom: 1px solid var(--border);
}
.supply-row:last-child { border-bottom: none; }
.supply-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.5rem; }
.supply-name { font-size: 0.95rem; }
.supply-qty  { font-family: var(--f-mono); font-size: 0.9rem; color: var(--text); }
.supply-qty.low { color: var(--warn); }
.supply-unit { font-family: var(--f-mono); font-size: 0.68rem; color: var(--text-faint); margin-left: 0.2rem; }
.supply-bottom { display: flex; justify-content: space-between; align-items: center; }
.reorder-badge {
  font-family: var(--f-mono); font-size: 0.58rem; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 0.1rem 0.4rem;
  border: 1px solid rgba(251,146,60,0.3); color: var(--warn);
}
.threshold-note { font-family: var(--f-mono); font-size: 0.65rem; color: var(--text-faint); }
.adjust-row { display: flex; gap: 0.35rem; align-items: center; }
.adjust-input {
  width: 64px; padding: 0.38rem 0.45rem; text-align: center;
  font-family: var(--f-mono); font-size: 0.82rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); outline: none;
  -moz-appearance: textfield;
}
.adjust-input::-webkit-inner-spin-button,
.adjust-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.adjust-input:focus { border-color: var(--accent); }
.btn-use    { font-family: var(--f-mono); font-size: 0.65rem; padding: 0.38rem 0.65rem; background: transparent; border: 1px solid rgba(248,113,113,0.25); color: var(--danger); cursor: pointer; }
.btn-restock{ font-family: var(--f-mono); font-size: 0.65rem; padding: 0.38rem 0.65rem; background: transparent; border: 1px solid rgba(74,222,128,0.2);   color: var(--ok);    cursor: pointer; }

/* ── MOVE PICKER ─────────────────────────────────────── */
.move-select {
  width: 100%; padding: 0.85rem 2.5rem 0.85rem 0.85rem;
  font-family: var(--f-mono); font-size: 0.875rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); outline: none;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23555560'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.9rem center;
  transition: border-color 0.2s var(--ease); margin-bottom: 0.65rem;
}
.move-select:focus { border-color: var(--accent); }
.move-select option { background: var(--surface); color: var(--text); }

/* ── ERROR BANNER ────────────────────────────────────── */
.error-banner {
  padding: 0.85rem 1.25rem; background: var(--danger-dim); color: var(--danger);
  border-bottom: 1px solid rgba(248,113,113,0.2);
  font-family: var(--f-mono); font-size: 0.8rem;
}

/* ── TOAST ───────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(140%);
  background: var(--text); color: var(--bg);
  padding: 0.7rem 1.25rem; white-space: nowrap;
  font-family: var(--f-mono); font-size: 0.78rem;
  opacity: 0; z-index: 1000; pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  transition: opacity 0.28s var(--ease), transform 0.32s var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); color: #fff; }

/* ── EMPTY STATE ─────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 4rem 1.5rem; color: var(--text-faint);
}
.empty-state h2 {
  font-family: var(--f-serif); font-weight: 300; font-size: 1.5rem;
  color: var(--text-dim); letter-spacing: -0.02em; margin-bottom: 0.75rem;
}
.empty-state p  { font-size: 0.9rem; line-height: 1.6; }
.empty-state code {
  font-family: var(--f-mono); font-size: 0.78rem; color: var(--accent);
  background: var(--surface); padding: 0.2rem 0.45rem;
  border: 1px solid var(--border);
}

/* ── FAB ─────────────────────────────────────────────── */
.fab {
  position: fixed; bottom: 1.5rem; right: 1.25rem;
  background: var(--accent); color: var(--bg);
  padding: 0.72rem 1.2rem; font-family: var(--f-mono); font-size: 0.75rem;
  letter-spacing: 0.04em; text-decoration: none;
  border: 1px solid var(--accent); box-shadow: 0 4px 24px var(--accent-glow);
  transition: opacity 0.2s var(--ease);
}
.fab:active { opacity: 0.82; }

/* ── FOOTER ──────────────────────────────────────────── */
.app-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.25rem 3.5rem; text-align: center;
}
.app-footer a {
  font-family: var(--f-mono); font-size: 0.68rem; color: var(--text-faint);
  text-decoration: none; margin: 0 0.5rem;
  transition: color 0.2s var(--ease);
}
.app-footer a:hover { color: var(--text-dim); }

/* ── PAGE PADDING ────────────────────────────────────── */
.page-body { padding-bottom: 5rem; }

/* ── HOLD PANELS ─────────────────────────────────────── */
.hold-panel {
  margin: 1rem 1.25rem 0;
  padding: 1rem 1.1rem; border: 1px solid; border-left-width: 3px;
}
.hold-panel.medical {
  border-color: rgba(251,146,60,0.25); border-left-color: var(--warn);
  background: var(--warn-dim);
}
.hold-panel.behavioral {
  border-color: rgba(248,113,113,0.25); border-left-color: var(--danger);
  background: var(--danger-dim);
}
.hold-header { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.35rem; }
.hold-type-label {
  font-family: var(--f-mono); font-size: 0.62rem;
  text-transform: uppercase; letter-spacing: 0.12em; font-weight: 500;
}
.medical .hold-type-label { color: var(--warn); }
.behavioral .hold-type-label { color: var(--danger); }
.hold-severity {
  font-family: var(--f-mono); font-size: 0.62rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.hold-reason { font-size: 0.9rem; color: var(--text); margin: 0 0 0.4rem; line-height: 1.5; }
.hold-dates { font-family: var(--f-mono); font-size: 0.68rem; color: var(--text-dim); line-height: 1.7; }
.hold-edit-link {
  display: inline-block; margin-top: 0.55rem;
  font-family: var(--f-mono); font-size: 0.68rem; color: var(--accent);
  text-decoration: none; letter-spacing: 0.02em;
  transition: opacity 0.2s var(--ease);
}
.hold-edit-link:hover { opacity: 0.75; }

/* ── ACTION BUTTON SUBTITLES ─────────────────────────── */
.action-btn .action-label { font-size: 0.95rem; line-height: 1.2; }
.action-btn .action-sub {
  font-family: var(--f-mono); font-size: 0.58rem;
  letter-spacing: 0.03em; color: var(--text-faint); line-height: 1.3;
  text-align: center;
}
.action-btn.danger .action-sub { color: rgba(248,113,113,0.5); }
.action-btn.primary .action-sub { color: rgba(74,222,128,0.45); }

/* ── ANIMAL DETAIL META ──────────────────────────────── */
.animal-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.detail-cell {
  padding: 0.8rem 1.25rem; border-bottom: 1px solid var(--border);
}
.detail-cell:nth-child(odd) { border-right: 1px solid var(--border); }
.detail-label {
  font-family: var(--f-mono); font-size: 0.58rem;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint);
  margin-bottom: 0.2rem;
}
.detail-value {
  font-family: var(--f-mono); font-size: 0.82rem; color: var(--text);
}
.detail-value.em { font-family: var(--f-sans); font-size: 0.88rem; }

/* ── FORM SECTION HEADER ─────────────────────────────── */
.form-section-header {
  font-family: var(--f-mono); font-size: 0.62rem;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-faint);
  padding: 1.35rem 1.25rem 0.6rem;
  border-top: 1px solid var(--border);
}
.form-section-header:first-child { border-top: none; }

/* ── FOOTER LINK VISIBILITY ──────────────────────────── */
.app-footer a { color: var(--text-dim); }
.app-footer a:hover { color: var(--text); }

/* ── Floating doodle animations ────────────────────────────────────────── */
@keyframes float-up {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}
@keyframes float-down {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(10px) rotate(-2deg); }
}
@keyframes float-sway {
  0%, 100% { transform: translateY(-5px) rotate(-1deg); }
  50% { transform: translateY(5px) rotate(1deg); }
}
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.doodle-float {
  animation: float-up 6s ease-in-out infinite;
}
.doodle-float-alt {
  animation: float-down 7s ease-in-out infinite;
}
.doodle-sway {
  animation: float-sway 5s ease-in-out infinite;
}
.animate-in {
  animation: fade-in-up 0.6s ease-out both;
}

/* ── Quick-detail bottom sheet modals ──────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,0.72); backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: flex-end; justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-sheet {
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: 1.25rem 1.25rem 0 0; padding: 1.5rem 1.25rem 2rem;
  width: 100%; max-width: 480px;
  animation: modal-slide-up 0.22s var(--ease) both;
}
@keyframes modal-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-title {
  font-family: var(--f-serif); font-size: 1.1rem; color: var(--text);
  margin: 0 0 1.25rem; text-align: center;
}
.modal-section-label {
  font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 0.6rem;
}
.chip-row {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.1rem;
}
.chip-sel {
  font-family: var(--f-mono); font-size: 0.78rem;
  padding: 0.45rem 0.85rem; border-radius: 2rem;
  border: 1px solid var(--border-hi); background: var(--surface-hi);
  color: var(--text-dim); cursor: pointer; transition: all 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.chip-sel:hover  { border-color: var(--accent); color: var(--text); }
.chip-sel.active {
  background: var(--accent-dim); border-color: var(--accent);
  color: var(--accent);
}
.modal-actions {
  display: flex; gap: 0.75rem; margin-top: 0.5rem;
}
.modal-btn {
  flex: 1; padding: 0.8rem; border-radius: 0.6rem; border: none;
  font-family: var(--f-mono); font-size: 0.85rem; cursor: pointer;
  transition: opacity 0.15s var(--ease);
}
.modal-btn:active { opacity: 0.75; }
.modal-btn.cancel { background: var(--surface-hi); color: var(--text-dim); }
.modal-btn.confirm { background: var(--accent); color: #0a0a0c; font-weight: 600; }
