/* =============================================================================
   Birds — app.css
   Location: /home/johnfre1/birds.site1917.com/assets/app.css
   Pre-launch features. V8 iteration on top of V7:
     - .auth-logo: the Birdsnap mark above the wordmark on auth screens.
     - #splash: homescreen-launch splash overlay. Hidden by default; shown ONLY
       under @media (display-mode: standalone). app.js adds .done to fade it
       out; a 3s keyframe failsafe fades it out even if JS never runs.
     - .link-inline: link-styled inline button ("Forgot your password?").
     - Brand-mark menu: .brand-mark-btn / .brand-word-btn split the old
       .topbar__brand button; .brand-menu dropdown with a .switch toggle.
   Species tagging. V7 iteration: the feed card's location moved from under the
   username into a full-width .tag-line row (location left / species pills
   right; each side capped at 50% only when both are present via
   .tag-line--both). New: .sp-pill species pill, .sp-more "+N" expander,
   .sp-row expanded second row, composer/edit .species-row fields, and the
   --accent-soft tint token.
   Phase 5 (PWA). V6 iteration: adds the red offline banner (shown under the top
   bar when the device is offline; also used by /assets/offline.html).
   Carried over from V5: percentage-based crop positioning (image width/left/top
   set in % of the box, so fit/zoom never depends on measuring the box in px);
   square photos + crop box use the padding-box technique (no CSS aspect-ratio).
   Palette: "Kingfisher 1A". Chirp = amber #E8943A. Cards = 2px.
   ============================================================================= */

/* ---- Design tokens ------------------------------------------------------- */
:root {
  --bg:           #EEF3F7;
  --surface:      #FFFFFF;
  --text:         #16232E;
  --text-muted:   #647079;
  --border:       #DBE2E8;
  --accent:       #137ABC;
  --accent-hover: #10659C;
  --accent-soft:  #E3F0F9;
  --chirp:        #E8943A;
  --danger:       #C0392B;

  --r-card:   2px;
  --r-input:  4px;
  --r-btn:    4px;

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px;
  --s-4: 16px; --s-5: 20px; --s-6: 24px;

  --col-max: 480px;
  --shadow-layer: 0 6px 20px rgba(22, 35, 46, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;

  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---- Reset --------------------------------------------------------------- */
* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}

button, input, textarea { font-family: inherit; font-size: 16px; color: inherit; }
a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }
[x-cloak] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- App frame / screens ------------------------------------------------- */
#app { min-height: 100dvh; }
.screen { max-width: var(--col-max); margin: 0 auto; width: 100%; }

.screen--auth {
  display: flex; flex-direction: column; min-height: 100dvh;
  padding: calc(var(--safe-top) + var(--s-6)) var(--s-5) calc(var(--safe-bottom) + var(--s-5));
}
.auth-intro { text-align: center; padding: var(--s-5) 0 var(--s-6); }
.wordmark   { font-size: 22px; font-weight: 600; letter-spacing: 0.2px; }
.tagline    { margin: var(--s-2) 0 0; color: var(--text-muted); font-size: 14px; }
.auth-form  { display: flex; flex-direction: column; gap: var(--s-4); }
.auth-spacer { flex: 1 1 auto; min-height: var(--s-6); }
.auth-help  { margin: var(--s-2) 0 0; text-align: center; color: var(--text-muted); font-size: 14px; }
.form-note  { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.45; }

/* ---- Fields -------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--s-1); }
.field label { font-size: 12px; color: var(--text-muted); }
.field label .opt { font-weight: 400; }

.field input,
.input-affix input,
textarea {
  width: 100%; padding: 12px var(--s-3);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-input); line-height: 1.45; color: inherit;
}
textarea { resize: vertical; }

.field input:focus,
.input-affix input:focus,
.affix-btn:focus-visible,
.btn:focus-visible,
textarea:focus,
.add-comment input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.field input:disabled { background: var(--bg); color: var(--text-muted); }
.field-hint { margin: 0; font-size: 12px; color: var(--text-muted); }
.counter { margin: 0; align-self: flex-end; font-size: 12px; color: var(--text-muted); }

.input-affix { position: relative; display: flex; align-items: stretch; }
.input-affix input { padding-right: 64px; }
.affix-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  min-width: 56px; min-height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 var(--s-2); background: transparent; border: 0; cursor: pointer;
  color: var(--text-muted); font-size: 14px; border-radius: var(--r-btn);
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-4);
  border: 1px solid transparent; border-radius: var(--r-btn);
  font-size: 16px; font-weight: 500; cursor: pointer;
}
.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 0 var(--s-3); font-size: 14px; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn--ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn--ghost:hover:not(:disabled) { color: var(--text); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover:not(:disabled) { filter: brightness(0.94); }
.btn:disabled { background: var(--border); color: var(--text-muted); border-color: var(--border); cursor: not-allowed; }
.install-cta { width: 100%; margin-top: var(--s-3); }

.link-btn { background: transparent; border: 0; padding: var(--s-1) 0; cursor: pointer; color: var(--text-muted); font-size: 14px; }
.link-btn:hover { color: var(--text); }

/* ---- Errors / spinner ---------------------------------------------------- */
.form-error { margin: 0; color: var(--danger); font-size: 14px; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.45); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner--dark { border: 2px solid var(--border); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Auth logo (login / reset / change-password screens) ------------------ */
.auth-logo { display: block; margin: 0 auto var(--s-3); width: 96px; height: 96px; object-fit: contain; }

/* ---- Splash (homescreen launches only) ------------------------------------ */
/* Hidden everywhere by default; the standalone media query below reveals it.
   Painted from static HTML before any JS loads. app.js adds .done when the app
   has mounted (min 1s on screen). The splash-failsafe animation guarantees it
   fades out at 3s even if JS fails, and pointer-events lets taps through once
   faded. */
#splash { display: none; }
@media (display-mode: standalone) {
  #splash {
    position: fixed; inset: 0; z-index: 100;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: var(--s-3); background: var(--bg);
    opacity: 1; transition: opacity 0.35s ease;
    animation: splash-failsafe 0.35s ease 3s forwards;
  }
  #splash.done { opacity: 0; pointer-events: none; }
  #splash img { width: 140px; height: 140px; object-fit: contain; }
  .splash-word { font-size: 24px; font-weight: 600; letter-spacing: 0.2px; color: var(--text); }
  .splash-spin {
    width: 20px; height: 20px; margin-top: var(--s-2);
    border: 2px solid var(--border); border-top-color: var(--accent);
    border-radius: 50%; animation: spin 0.8s linear infinite;
  }
}
@keyframes splash-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }

/* ---- Inline link button ("Forgot your password?") ------------------------- */
.link-inline { background: transparent; border: 0; padding: 0; cursor: pointer; color: var(--accent-hover); font-size: inherit; }
.link-inline:hover { text-decoration: underline; }

/* ---- Top bar ------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  height: calc(56px + var(--safe-top)); padding-top: var(--safe-top);
  display: flex; align-items: center; justify-content: space-between;
  padding-left: var(--s-3); padding-right: var(--s-2);
  background: var(--bg); border-bottom: 1px solid var(--border);
}
/* V8: .topbar__brand is now a plain container; the mark and the wordmark are
   separate buttons (mark = account menu, wordmark = scroll to top). */
.topbar__brand { position: relative; display: inline-flex; align-items: center; gap: var(--s-1); }
.brand-mark-btn, .brand-word-btn { display: inline-flex; align-items: center; background: transparent; border: 0; cursor: pointer; color: var(--text); padding: var(--s-2); }
.brand-mark-btn { min-width: 40px; min-height: 40px; justify-content: center; border-radius: var(--r-btn); }
.brand-mark-btn:hover { background: var(--accent-soft); }
.brand-word-btn { font-size: 18px; font-weight: 600; padding-left: 0; }
.brand-mark { display: inline-flex; color: var(--accent); }

/* ---- Brand-mark dropdown menu -------------------------------------------- */
.brand-menu {
  position: absolute; left: 0; top: calc(100% + 4px); z-index: 30;
  min-width: 210px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-btn);
  box-shadow: var(--shadow-layer); padding: 4px;
  display: flex; flex-direction: column;
}
.brand-menu__row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  width: 100%; text-align: left; min-height: 44px; padding: 10px var(--s-3);
  background: transparent; border: 0; cursor: pointer;
  font-size: 14px; color: var(--text); border-radius: var(--r-btn);
}
.brand-menu__row:hover:not(:disabled) { background: var(--bg); }
.brand-menu__row:disabled { color: var(--text-muted); cursor: not-allowed; }
.brand-menu__hint { margin: 0; padding: 0 var(--s-3) var(--s-2); font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.brand-menu__sep { height: 1px; background: var(--border); margin: 4px var(--s-2); }

/* ---- Toggle switch (notifications) ---------------------------------------- */
.switch {
  flex: none; width: 40px; height: 24px; border-radius: 999px;
  background: var(--border); position: relative; transition: background 0.15s ease;
}
.switch .knob {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--surface);
  box-shadow: 0 1px 3px rgba(22,35,46,0.3); transition: left 0.15s ease;
}
.switch.on { background: var(--accent); }
.switch.on .knob { left: 19px; }
.topbar__add { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; cursor: pointer; color: var(--accent); }
.topbar__add:disabled { color: var(--text-muted); cursor: not-allowed; }

/* ---- Offline banner ----------------------------------------------------- */
/* A thin red bar that sits directly under the top bar while offline. Sticks
   just below the (sticky) top bar so it stays visible as the feed scrolls. */
.offline-banner {
  position: sticky; top: calc(56px + var(--safe-top)); z-index: 9;
  max-width: var(--col-max); margin: 0 auto; width: 100%;
  background: var(--danger); color: #fff;
  font-size: 13px; font-weight: 500; line-height: 1; text-align: center;
  padding: 8px var(--s-3);
}

/* ---- Feed ---------------------------------------------------------------- */
.screen--feed { padding: var(--s-3) var(--s-3) calc(var(--safe-bottom) + var(--s-5)); display: flex; flex-direction: column; gap: var(--s-3); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-2); padding: var(--s-3); }
.who { min-width: 0; }
.card-head .name { font-weight: 600; font-size: 14px; }
.loc-chip { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; color: var(--text-muted); font-size: 12px; }
.loc-chip svg { color: var(--accent); flex: none; }
.meta { display: flex; align-items: center; gap: 2px; flex: none; position: relative; }

/* ---- Tag line: location left / species right ----------------------------- */
/* Sits directly under .card-head. Each side may take the whole line when the
   other is absent; when both are present, .tag-line--both caps each at 50%. */
.tag-line { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: 0 var(--s-3) var(--s-2); margin-top: -6px; }
.tag-line .loc-chip { margin-top: 0; min-width: 0; }
.tag-line .loc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-line--both .loc-chip, .tag-line--both .sp-wrap { max-width: 50%; }
.sp-wrap { display: flex; align-items: center; gap: 4px; margin-left: auto; min-width: 0; }
.sp-pill { display: inline-flex; align-items: center; gap: 4px; min-width: 0; background: var(--accent-soft); color: var(--accent-hover); font-size: 12px; line-height: 1.3; padding: 3px 9px; border-radius: 999px; }
.sp-pill svg { color: var(--accent); flex: none; }
.sp-pill .sp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-more { flex: none; background: var(--accent-soft); color: var(--accent-hover); border: 0; cursor: pointer; font-size: 12px; line-height: 1.3; font-weight: 500; padding: 3px 8px; border-radius: 999px; }
.sp-more:hover { background: var(--border); }
/* Expanded 2nd..Nth species pills (toggled by .sp-more) */
.sp-row { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 4px; padding: 0 var(--s-3) var(--s-2); }
.time { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

.kebab, .c-kebab { display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; cursor: pointer; color: var(--text-muted); border-radius: var(--r-btn); }
.kebab { width: 32px; height: 32px; }
.c-kebab { width: 28px; height: 28px; }
.kebab-wrap { position: relative; }
.kebab-menu { position: absolute; right: 0; top: 100%; z-index: 20; min-width: 132px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-btn); box-shadow: var(--shadow-layer); padding: 4px; display: flex; flex-direction: column; }
.kebab-menu button { display: flex; align-items: center; gap: var(--s-2); width: 100%; text-align: left; padding: 10px var(--s-3); background: transparent; border: 0; cursor: pointer; font-size: 14px; color: var(--text); border-radius: var(--r-btn); }
.kebab-menu button:hover { background: var(--bg); }
.kebab-menu button.danger { color: var(--danger); }

/* Square photo via padding-box (robust across all engines) */
.card-photo-box { position: relative; width: 100%; background: var(--border); overflow: hidden; }
.card-photo-box::before { content: ""; display: block; padding-top: 100%; }
.card-photo { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

.card-actions { padding: var(--s-2) var(--s-3) 0; }
.chirp-btn { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-1); background: transparent; border: 0; cursor: pointer; color: var(--text); }
.chirp-icon { display: inline-flex; }
.chirp-icon .bird path { stroke: var(--text); }
.chirp-icon .halo { fill: var(--surface); }
.chirp-icon .heart path { stroke: var(--text-muted); fill: none; transition: fill .12s ease, stroke .12s ease; }
.chirp-btn.active .chirp-icon .heart path { stroke: var(--chirp); fill: var(--chirp); }
.chirp-btn .count { font-size: 14px; color: var(--text-muted); }
.chirp-btn.active .count { color: var(--chirp); }

.card-caption { padding: var(--s-2) var(--s-3) 0; font-size: 14px; line-height: 1.45; }
.card-caption .name { font-weight: 600; margin-right: 6px; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.more { margin-top: 2px; background: transparent; border: 0; padding: 0; cursor: pointer; color: var(--text-muted); font-size: 14px; }

.comments { padding: var(--s-2) var(--s-3) 0; display: flex; flex-direction: column; gap: var(--s-2); }
.view-all { align-self: flex-start; background: transparent; border: 0; padding: 0; cursor: pointer; color: var(--text-muted); font-size: 14px; }
.comment { font-size: 14px; line-height: 1.45; }
.comment-body { display: flex; flex-direction: column; gap: 2px; }
.c-text .name { font-weight: 600; margin-right: 6px; }
.c-meta-row { display: flex; align-items: center; gap: var(--s-2); }
.c-meta { color: var(--text-muted); font-size: 12px; }
.edited { font-style: italic; }
.c-edit { display: flex; flex-direction: column; gap: var(--s-2); }
.c-edit-field { width: 100%; resize: vertical; padding: var(--s-2) var(--s-3); background: var(--surface); color: inherit; border: 1px solid var(--border); border-radius: var(--r-input); line-height: 1.45; }
.c-edit-actions { display: flex; justify-content: flex-end; gap: var(--s-2); }

.add-comment { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3); margin-top: var(--s-2); border-top: 1px solid var(--border); }
.add-comment input { flex: 1 1 auto; min-width: 0; padding: 10px var(--s-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-input); line-height: 1.4; }
.post-btn { flex: none; background: transparent; border: 0; cursor: pointer; color: var(--accent); font-weight: 500; font-size: 14px; padding: var(--s-2); }
.post-btn:disabled { color: var(--text-muted); cursor: not-allowed; }

.sentinel { height: 1px; }
.loader { display: flex; align-items: center; justify-content: center; gap: var(--s-2); padding: var(--s-4) 0; color: var(--text-muted); font-size: 14px; }
.caught-up { text-align: center; color: var(--text-muted); font-size: 14px; padding: var(--s-4) 0; }
.feed-msg { text-align: center; padding: var(--s-6) var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); align-items: center; color: var(--text-muted); }
.empty-state { text-align: center; padding: 18vh var(--s-5) var(--s-6); display: flex; flex-direction: column; align-items: center; gap: var(--s-2); color: var(--text-muted); }
.empty-ico { color: var(--border); }
.empty-state h3 { margin: var(--s-2) 0 0; color: var(--text); font-size: 17px; font-weight: 500; }
.empty-state p { margin: 0; font-size: 14px; }

.card.skeleton { padding: 0; }
.sk-head { height: 44px; margin: var(--s-3); border-radius: var(--r-btn); }
.sk-photo { width: 100%; height: 0; padding-top: 100%; }
.sk-line { height: 14px; margin: var(--s-3); border-radius: var(--r-btn); }
.sk-head, .sk-photo, .sk-line {
  background: linear-gradient(90deg, var(--border) 25%, #E8EEF3 50%, var(--border) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---- Modals (composer + edit) ------------------------------------------- */
.modal-root { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(22, 35, 46, 0.45); }
.modal-sheet {
  position: relative; width: 100%; max-width: var(--col-max); max-height: 92dvh;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card) var(--r-card) 0 0; box-shadow: var(--shadow-layer);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-head {
  flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-3); padding-top: calc(var(--s-3) + var(--safe-top));
  border-bottom: 1px solid var(--border);
}
.modal-cancel { justify-self: start; background: transparent; border: 0; cursor: pointer; color: var(--text-muted); font-size: 16px; padding: var(--s-2); }
.modal-title { justify-self: center; font-size: 17px; font-weight: 500; }
.modal-head .btn { justify-self: end; }
.modal-body {
  flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: var(--s-4) var(--s-4) calc(var(--safe-bottom) + var(--s-5));
  display: flex; flex-direction: column; gap: var(--s-4);
}

.picker {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-1);
  min-height: 200px; padding: var(--s-6);
  border: 1.5px dashed var(--border); border-radius: var(--r-input);
  color: var(--text-muted); cursor: pointer; text-align: center;
}
.picker:hover { border-color: var(--accent); color: var(--text); }
.picker-ico { color: var(--text-muted); }
.picker-text { font-weight: 500; color: var(--text); font-size: 15px; margin-top: var(--s-2); }
.picker-sub { font-size: 12px; }
.crop-loading { display: flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 200px; color: var(--text-muted); font-size: 14px; }

/* Crop — square viewport via padding-box (no aspect-ratio dependency).
   The image is positioned with width/left/top in % of the box (set inline by
   cropImgStyle), so fit/zoom never depend on measuring the box in px. */
.crop-wrap { display: flex; flex-direction: column; gap: var(--s-2); }
.crop-box {
  position: relative; width: 100%; height: 0; padding-top: 100%;
  overflow: hidden; background: #0c1318;
  touch-action: none; cursor: grab; user-select: none;
}
.crop-box:active { cursor: grabbing; }
.crop-img {
  position: absolute; height: auto;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
  will-change: left, top, width;
}
.crop-hint {
  position: absolute; left: 50%; bottom: var(--s-3); transform: translateX(-50%);
  background: rgba(12, 19, 24, 0.72); color: #fff; font-size: 12px;
  padding: 6px var(--s-3); border-radius: 999px; white-space: nowrap; pointer-events: none;
}
.crop-controls { padding: 0 2px; }
.zoom { width: 100%; accent-color: var(--accent); }
.crop-links { display: flex; justify-content: space-between; }

.loc-row { display: flex; gap: var(--s-2); align-items: stretch; }
.loc-row input { flex: 1 1 auto; min-width: 0; }
.loc-row .btn { flex: none; white-space: nowrap; }
.loc-attached { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--text-muted); font-size: 12px; }
.loc-attached svg { color: var(--accent); flex: none; }
.loc-attached .link-btn { margin-left: auto; }

/* ---- Species fields (composer + edit modal) ------------------------------ */
.species-row { display: flex; gap: var(--s-2); align-items: center; }
.species-row input { flex: 1 1 auto; min-width: 0; }
.species-row + .species-row { margin-top: var(--s-2); }
.sp-remove { flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; cursor: pointer; color: var(--text-muted); border-radius: var(--r-btn); }
.sp-remove:hover { color: var(--danger); }
.sp-add { align-self: flex-start; color: var(--accent-hover); }
.sp-add:hover { color: var(--accent); }

@media (min-width: 520px) {
  .modal-root { align-items: center; }
  .modal-sheet { border-radius: var(--r-card); margin: var(--s-4); max-height: 88dvh; }
  .modal-head { padding-top: var(--s-3); }
}

/* ---- Delete confirm sheet ----------------------------------------------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 65; background: rgba(22, 35, 46, 0.4); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: var(--col-max); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card) var(--r-card) 0 0; box-shadow: var(--shadow-layer); padding: var(--s-5) var(--s-4) calc(var(--safe-bottom) + var(--s-4)); display: flex; flex-direction: column; gap: var(--s-4); }
.sheet-msg { margin: 0; font-size: 15px; line-height: 1.45; }
.sheet-actions { display: flex; gap: var(--s-2); }
.sheet-actions .btn { flex: 1 1 0; }
@media (min-width: 520px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: var(--r-card); margin: var(--s-4); } }

/* ---- Toast --------------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + var(--s-5)); transform: translateX(-50%); max-width: calc(var(--col-max) - var(--s-6)); z-index: 70; background: var(--text); color: #fff; padding: var(--s-3) var(--s-4); border-radius: var(--r-btn); box-shadow: var(--shadow-layer); font-size: 14px; }

/* ---- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .spinner, .sk-head, .sk-photo, .sk-line, .splash-spin { animation: none; }
  /* NOTE: the #splash failsafe animation is deliberately NOT disabled here —
     it's what guarantees the splash goes away if JS fails. */
  .chirp-icon .heart path { transition: none; }
  * { scroll-behavior: auto !important; }
}
