/* Storage Hound web app — mobile-first, Apple-flavored (matches the native app). */

:root {
  --bg: #ffffff;
  --bg-card: #fbfbfd;
  --bg-subtle: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --hairline: #d2d2d7;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --negative: #d70015;
  --green: #00875a;
  --screen: #eef4fc;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000; --bg-card: #1c1c1e; --bg-subtle: #2c2c2e;
    --text: #f5f5f7; --text-2: #aeaeb2; --text-3: #8e8e93;
    --hairline: #38383a; --blue: #0a84ff; --blue-hover: #409cff;
    --negative: #ff453a; --green: #30d158; --screen: #000;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--screen);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 16px; }

/* Top bar — the app's blue header */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  background: var(--blue); color: #fff;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px;
}
.topbar-back {
  background: none; border: none; color: #fff;
  font-size: 30px; line-height: 1; padding: 0 4px 4px 0; width: 26px;
}
.topbar-names { flex: 1; min-width: 0; }
.topbar-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: rgba(255,255,255,0.8);
}
.topbar-title {
  font-size: 19px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-sub { font-size: 12px; color: rgba(255,255,255,0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The hound tilts side to side as he searches with his magnifying glass;
   the lens glints and a sparkle circles it. Plays for a few seconds on
   load and whenever he is tapped. */
.dogwrap {
  position: relative; flex: 0 0 auto; width: 48px; height: 48px;
  border: none; background: none; padding: 0;
  transform-origin: 50% 92%;
}
.topbar-dog { width: 48px; height: 48px; object-fit: contain; display: block; }
/* Lens centre sits about 90% across and 34% down the artwork. */
.dog-glint {
  position: absolute; left: 90%; top: 34%; width: 12px; height: 12px;
  margin: -6px 0 0 -6px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.4) 45%, rgba(255,255,255,0) 72%);
}
.dog-orbit { position: absolute; left: 90%; top: 34%; width: 0; height: 0; opacity: 0; }
.dog-orbit svg { position: absolute; width: 10px; height: 10px; left: -5px; top: -16px; fill: #ffd60a; }
.dogwrap.play { animation: dog-sniff 3.4s ease-in-out 1; }
.dogwrap.play .dog-glint { animation: dog-glint 3.4s ease-in-out 1; }
.dogwrap.play .dog-orbit { animation: dog-orbit 3.4s linear 1; }
@keyframes dog-sniff {
  0%   { transform: rotate(0) scale(1); }
  12%  { transform: rotate(-8deg) scale(1.06); }
  28%  { transform: rotate(7deg) scale(1.06); }
  44%  { transform: rotate(-6deg) scale(1.05); }
  60%  { transform: rotate(5deg) scale(1.04); }
  76%  { transform: rotate(-2deg) scale(1.02); }
  100% { transform: rotate(0) scale(1); }
}
@keyframes dog-glint {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  15%, 47%, 79% { opacity: 1; transform: scale(1.25); }
  31%, 63% { opacity: 0.25; transform: scale(0.8); }
}
@keyframes dog-orbit {
  0%   { opacity: 0; transform: rotate(0deg); }
  10%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(720deg); }
}
@media (prefers-reduced-motion: reduce) {
  .dogwrap.play, .dogwrap.play .dog-glint, .dogwrap.play .dog-orbit { animation: none; }
}
.topbar-icon {
  background: rgba(255,255,255,0.16); border: none; border-radius: 50%;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.topbar-icon svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; }

main { max-width: 680px; margin: 0 auto; padding: 16px 14px calc(env(safe-area-inset-bottom, 0px) + 40px); }

/* Catalog grid (home) */
.hero-line { text-align: center; color: var(--text-2); font-size: 14.5px; margin: 6px 0 16px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 520px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.tile {
  background: var(--bg-card); border: 1px solid var(--hairline); border-radius: 18px;
  overflow: hidden; display: flex; flex-direction: column;
}
.tile-body { padding: 18px 14px 12px; text-align: center; border: none; background: none; color: inherit; }
.tile-icon {
  display: flex;
  width: 56px; height: 56px; border-radius: 16px; background: var(--blue);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 10px;
}
.tile-icon svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tile-name { display: block; font-size: 15.5px; font-weight: 700; }
.tile-meta { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.tile-details {
  border: none; border-top: 1px solid var(--hairline); background: none;
  color: var(--blue); font-size: 13.5px; font-weight: 600; padding: 9px;
}
.tile-suggested { border-style: dashed; justify-content: center; padding: 18px 14px; background: none; color: inherit; }
.tile-suggested .tile-icon { background: var(--bg-subtle); }
.tile-suggested .tile-icon svg { stroke: var(--blue); }
.tile-sug-label { font-size: 14.5px; font-weight: 600; color: var(--blue); }
.tile-sug-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* Lists (boxes, items) */
.rowlist { display: flex; flex-direction: column; gap: 10px; }
.boxrow {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--bg-card); border: 1px solid var(--hairline); border-radius: 16px;
  padding: 13px 14px; color: inherit;
}
.boxrow-num {
  width: 42px; height: 42px; border-radius: 12px; background: var(--blue);
  color: #fff; font-weight: 800; font-size: 17px;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.boxrow-main { flex: 1; min-width: 0; }
.boxrow-label { display: block; font-size: 15.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boxrow-meta { display: block; font-size: 12.5px; color: var(--text-3); }
.boxrow-chev { color: var(--text-3); font-size: 20px; }

/* Home: box cards — same size until opened with the chevron */
.cardgrid {
  display: grid; gap: 12px; align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
}
.boxcard {
  position: relative;
  background: var(--bg-card); border: 1px solid rgba(0, 113, 227, 0.16); border-radius: 18px;
  padding: 14px 14px 6px;
  box-shadow: 0 1px 2px rgba(0, 40, 100, 0.05), 0 4px 14px rgba(0, 60, 140, 0.07);
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.boxcard::before {
  content: ''; position: absolute; left: 18px; right: 18px; top: -1px; height: 3px;
  border-radius: 0 0 3px 3px; background: linear-gradient(90deg, #0071e3, #2997ff);
  opacity: .35; transition: opacity .2s ease;
}
.boxcard:not(.collapsed)::before { opacity: 1; }
@media (hover: hover) {
  .boxcard:hover {
    border-color: rgba(0, 113, 227, 0.34); transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 40, 100, 0.06), 0 12px 28px rgba(0, 60, 140, 0.14);
  }
  .boxcard:hover::before { opacity: 1; }
  .boxcard-chev:hover { background: rgba(0, 113, 227, 0.12); }
  .boxcard-thumb:hover { border-color: var(--blue); transform: scale(1.04); }
  .strip-arrow:hover, .boxcard-addphoto:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
  .boxcard-nophoto:hover { background: rgba(0, 113, 227, 0.12); border-color: var(--blue); }
}
.boxcard:focus-within { border-color: rgba(0, 113, 227, 0.45); box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.14), 0 8px 22px rgba(0, 60, 140, 0.1); }
.boxcard-head .boxrow-num {
  background: linear-gradient(145deg, #2997ff, #0060c7);
  box-shadow: 0 3px 8px rgba(0, 113, 227, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.boxcard-head {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--hairline);
}
.boxcard-head .boxrow-num { border: none; padding: 0; }
.boxcard-title {
  flex: 1; min-width: 0; text-align: left; background: none; border: none;
  padding: 0; color: inherit;
}
.boxcard-chev {
  transition: background .15s;
  flex: none; width: 40px; height: 40px; margin-right: -6px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 10px; color: var(--blue);
}
.boxcard-chev svg { transition: transform .2s ease; }
.boxcard-chev[aria-expanded="true"] svg { transform: rotate(90deg); }
.boxcard-items { list-style: none; margin: 4px 0 0; padding: 0; }
.boxcard-items li {
  font-size: 15px; padding: 10px 2px; overflow-wrap: anywhere;
  border-bottom: 1px solid var(--bg-subtle);
}
.boxcard-items li:last-child { border-bottom: none; }
.boxcard-empty { font-size: 14px; color: var(--text-3); padding: 12px 2px 2px; }
.boxcard .addrow { margin-top: 12px; }
.boxcard .addrow .btn { padding: 11px 18px; }
.boxcard-photorow { position: relative; margin-top: 12px; }
.strip-arrow {
  position: absolute; top: 50%; z-index: 1; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%; padding: 0; display: none;
  align-items: center; justify-content: center;
  border: 1px solid rgba(0, 113, 227, 0.25); background: var(--bg-card);
  color: var(--blue); box-shadow: 0 2px 8px rgba(0, 40, 100, 0.18); transition: opacity .15s;
}
.strip-prev { left: -8px; }
.strip-next { right: -8px; }
.boxcard-photorow.scrolls .strip-arrow { display: flex; }
.strip-arrow:disabled { opacity: 0; pointer-events: none; }
.boxcard-nophoto {
  margin-top: 12px; width: 100%; height: 71px; display: flex; align-items: center; gap: 12px;
  padding: 0 14px; text-align: left; border: 1.5px dashed rgba(0, 113, 227, 0.35);
  border-radius: 12px; background: rgba(0, 113, 227, 0.05); color: var(--blue);
}
.boxcard-nophoto svg { width: 26px; height: 26px; flex: none; }
.boxcard-nophoto span { font-size: 12.5px; color: var(--text-2); line-height: 1.35; }
.boxcard-nophoto b { display: block; font-size: 14px; color: var(--blue); font-weight: 600; }
.boxcard-addphoto {
  margin-right: auto; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(0, 113, 227, 0.3); background: rgba(0, 113, 227, 0.07);
  color: var(--blue); font-size: 13px; font-weight: 600; padding: 6px 12px 6px 10px; border-radius: 980px;
}
.boxcard-addphoto svg { width: 17px; height: 17px; }
.boxcard-thumbs {
  display: flex; gap: 8px; overflow-x: auto; padding: 3px 0 4px;
  scrollbar-width: none;
}
.boxcard-thumbs::-webkit-scrollbar { display: none; }
.boxcard-thumb {
  transition: transform .12s, border-color .12s;
  flex: none; width: 64px; height: 64px; padding: 0; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--hairline); background: var(--bg-subtle);
}
.boxcard-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.boxcard-foot {
  margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--bg-subtle);
  display: flex; justify-content: flex-end; align-items: center;
}
.boxcard-open {
  background: none; border: none; color: var(--blue); font-size: 13.5px;
  font-weight: 600; padding: 9px 4px;
}

.itemrow {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 10px 12px;
}
.itemrow-text { flex: 1; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.itemrow button {
  background: none; border: none; color: var(--text-3); font-size: 15px; padding: 4px 6px;
}
.itemrow button.del { color: var(--negative); }

/* Box detail */
.section-title { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; color: var(--text-3); margin: 22px 2px 8px; }
.addrow { display: flex; gap: 8px; margin-top: 10px; }
.addrow input { flex: 1; }
.photos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-thumb {
  position: relative; border: 1px solid var(--hairline); border-radius: 12px;
  overflow: hidden; aspect-ratio: 1; background: var(--bg-subtle); padding: 0;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-add {
  border: 1px dashed var(--hairline); border-radius: 12px; aspect-ratio: 1;
  background: none; color: var(--blue); font-size: 13px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.photo-add span.big { font-size: 26px; line-height: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 980px; border: 1px solid var(--hairline);
  background: var(--bg); color: var(--text);
  font-size: 15px; font-weight: 600; padding: 11px 20px;
}
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-danger-outline { border-color: var(--negative); color: var(--negative); background: none; }
.btn-block { width: 100%; margin-top: 10px; }
.btn-ai { background: var(--bg-card); }
.btn[disabled] { opacity: 0.5; }

.input {
  width: 100%; border: 1px solid var(--hairline); border-radius: 12px;
  background: var(--bg); color: var(--text); padding: 11px 12px; outline: none;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,113,227,0.15); }
textarea.input { min-height: 90px; resize: vertical; }

/* Overlays & modals */
.overlay {
  /* above the photo viewer (60): its Delete confirmation used to open behind it */
  position: fixed; inset: 0; z-index: 70;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 14px; overflow-y: auto;
}
.overlay[hidden] { display: none; }
.overlay-card {
  position: relative; width: 100%; max-width: 480px;
  background: var(--bg); border-radius: 20px; padding: 22px 18px 18px;
  margin-top: max(16px, env(safe-area-inset-top, 0px));
}
.overlay-card h2 { font-size: 19px; letter-spacing: -0.3px; margin-bottom: 12px; }
.overlay-x {
  position: absolute; top: 10px; right: 10px;
  background: none; border: none; color: var(--text-3); font-size: 17px; padding: 6px;
}
.hint { font-size: 13px; color: var(--text-3); margin-top: 8px; }
.label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 14px 2px 6px; }

/* Kind picker rows (new catalog) */
.kindrow {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--bg-card); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 11px 12px; margin-top: 8px; color: inherit;
}
.kindrow.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.kindrow svg { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: var(--blue); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.kindrow.on svg { stroke: #fff; }
.kindrow-name { font-size: 15.5px; font-weight: 600; }
.kindrow-perk { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.kindrow.on .kindrow-perk { color: rgba(255,255,255,0.85); }

/* AI review rows */
.airow { display: flex; align-items: flex-start; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--bg-subtle); }
.airow input { margin-top: 4px; accent-color: var(--blue); width: 17px; height: 17px; }
.airow-label { font-size: 15px; }
.ai-status { font-size: 13.5px; color: var(--text-2); margin-top: 10px; min-height: 18px; }
.ai-spin {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px;
  border: 2px solid var(--hairline); border-top-color: var(--blue); border-radius: 50%;
  animation: shspin 0.8s linear infinite;
}
@keyframes shspin { to { transform: rotate(360deg); } }

/* Menu */
.menu-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 15px; }
.menu-brand img { width: 44px; height: 44px; border-radius: 10px; }
.menu-brand span { color: var(--text-3); font-size: 12.5px; }
.menu-item {
  display: block; width: 100%; text-align: left;
  background: none; border: none; border-top: 1px solid var(--bg-subtle);
  color: var(--text); font-size: 15.5px; padding: 13px 2px;
}
.menu-danger { color: var(--negative); }
.menu-note { font-size: 12.5px; color: var(--text-3); margin-top: 12px; line-height: 1.5; }

/* Search */
.search-input { margin-bottom: 12px; }
.search-results { max-height: 60vh; overflow-y: auto; }
.search-hit {
  display: block; width: 100%; text-align: left;
  background: none; border: none; border-top: 1px solid var(--bg-subtle);
  padding: 10px 2px; color: inherit;
}
.search-hit-title { font-size: 15px; font-weight: 600; }
.search-hit-sub { font-size: 12.5px; color: var(--text-3); }
.search-hit mark { background: rgba(0,113,227,0.18); color: inherit; border-radius: 3px; }

/* Zoom viewer */
.zoom { position: fixed; inset: 0; z-index: 60; background: #000; }
.zoom[hidden] { display: none; }
.zoom-pan { position: absolute; inset: 0; overflow: auto; display: flex; }
.zoom-pan img { margin: auto; width: 100%; transition: width 0.15s ease; }
.zoom-x {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 14px; z-index: 2;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,0.16); border: none; color: #f5f5f7; font-size: 17px;
}
.zoom-controls {
  position: absolute; right: 14px; bottom: calc(env(safe-area-inset-bottom, 0px) + 70px); z-index: 2;
  display: flex; flex-direction: column; gap: 10px;
}
.zoom-controls button {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.16); border: none; color: #f5f5f7; font-size: 24px;
}
.zoom-caption {
  position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  text-align: center; color: #f5f5f7; font-size: 14px; padding: 0 60px; z-index: 2;
}

.empty { text-align: center; color: var(--text-3); font-size: 14.5px; padding: 30px 10px; }
.danger-zone { margin-top: 26px; }

/* Floating Add Box button — always reachable while scrolling */
.fab {
  position: fixed;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 980px;
  background: var(--blue);
  color: #fff;
  font-size: 15.5px;
  font-weight: 700;
  padding: 14px 22px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}
.fab:active { background: var(--blue-hover); }

/* Plans picker (menu → Plans & pricing) */
.menu-plan { display: flex; justify-content: space-between; align-items: center; }
.menu-plan-tag { font-size: 12px; color: var(--blue); font-weight: 600; }
.pcard {
  position: relative; border: 1.5px solid var(--hairline); border-radius: 16px;
  padding: 14px 16px; margin-top: 12px; cursor: pointer; background: var(--bg-card);
}
.pcard.on { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,113,227,0.15); }
.pcard-top { display: flex; justify-content: space-between; align-items: center; font-size: 16.5px; }
.pcheck { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--hairline); }
.pcard.on .pcheck { background: var(--blue); border-color: var(--blue); box-shadow: inset 0 0 0 4px var(--bg-card); }
.pprice { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pprice small { font-size: 13px; font-weight: 500; color: var(--text-3); }
.pper { font-size: 13px; color: var(--text-2); }
.pbadge {
  position: absolute; top: -10px; left: 14px; background: var(--blue); color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 980px; padding: 2px 9px;
}
.psizes { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.psize {
  border: none; background: var(--bg-subtle); color: var(--text-2); border-radius: 980px;
  font-size: 14.5px; font-weight: 600; min-width: 48px; padding: 7px 12px;
}
.psize.on { background: var(--blue); color: #fff; }
.psizes-l { margin-left: 6px; font-size: 12.5px; color: var(--text-3); }

/* Sign-in (cloud mode) */
body.signed-out #search-btn, body.signed-out #menu-btn { display: none; }
.signin {
  max-width: 420px; margin: 24px auto 0; background: var(--bg); border-radius: 20px;
  padding: 24px 20px 18px; border: 1px solid var(--hairline);
}
.signin h2 { font-size: 22px; letter-spacing: -0.3px; margin-bottom: 6px; }
.signin .hint { margin: 0 0 8px; font-size: 14px; color: var(--text-2); }
.signin-btn { font-weight: 600; }
.signin-or { text-align: center; color: var(--text-3); font-size: 13px; margin: 14px 0 10px; }
.signin-fine { font-size: 12px; color: var(--text-3); margin-top: 12px; text-align: center; }
.signin-fine a { color: var(--blue); }
.menu-account { font-size: 12.5px; color: var(--text-3); }

/* Specialty Hounds */
.hound-cta {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  margin-top: 22px; padding: 14px; border-radius: 16px; color: inherit;
  border: 1.5px dashed rgba(0,113,227,0.45); background: rgba(0,113,227,0.06);
}
.hound-cta svg { flex: 0 0 auto; fill: var(--blue); }
.hound-cta b { display: block; font-size: 15px; color: var(--blue); }
.hound-cta span span { display: block; font-size: 12.5px; color: var(--text-2); }
.hound-cta-chev { margin-left: auto; color: var(--blue); font-size: 22px; }
.hound-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-top: 1px solid var(--bg-subtle);
}
.hound-row-main { flex: 1; min-width: 0; }
.hound-row-main b { display: block; font-size: 15.5px; }
.hound-row-main span { display: block; font-size: 12.5px; color: var(--text-2); }
.hound-notify { padding: 8px 14px; font-size: 13.5px; white-space: nowrap; }
.hound-on { font-size: 12.5px; color: var(--green); font-weight: 600; white-space: nowrap; }
.hound-suggest-icon {
  width: 52px; height: 52px; border-radius: 16px; background: var(--blue);
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.hound-suggest-icon svg { fill: #fff; width: 28px; height: 28px; }

/* Photo ↔ list review */
.rv-group { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); margin: 16px 2px 2px; }
.rv-sub { text-transform: none; letter-spacing: 0; font-weight: 500; }
.rv-same { color: var(--green); font-weight: 600; margin-top: -2px; }
.rv-count { display: inline-block; margin-left: 6px; font-size: 12.5px; font-weight: 700; color: var(--blue); background: rgba(0,113,227,0.1); border-radius: 980px; padding: 1px 8px; }
.rv-missing { color: var(--text-2); }
.rv-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rv-photo { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 2px solid var(--hairline); cursor: pointer; }
.rv-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-photo input { position: absolute; opacity: 0; }
.rv-photo span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10.5px; font-weight: 700; text-align: center; color: #fff; background: rgba(0,0,0,0.45); padding: 2px 0; }
.rv-photo:has(input:checked) { border-color: var(--negative); }
.rv-photo:has(input:checked) span { background: var(--negative); }

/* Photo viewer actions */
.zoom-act { background: none; border: none; color: #f5f5f7; font-size: 13px; padding: 6px 8px; }
.zoom-act-del { color: #ff6961; }

/* Cropper (full screen, above the viewer) */
.cropper {
  position: fixed; inset: 0; z-index: 80; background: #000;
  display: flex; flex-direction: column;
}
.cropper-stage {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px 12px;
}
.cropper-wrap { position: relative; line-height: 0; overflow: hidden; touch-action: none; max-width: 100%; max-height: 100%; }
.cropper-wrap img { display: block; max-width: 100%; max-height: calc(100vh - 330px); user-select: none; }
.cropper-rect {
  position: absolute; cursor: move; touch-action: none;
  border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  background:
    linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)) 33.33% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)) 66.66% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)) 0 33.33% / 100% 1px no-repeat,
    linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)) 0 66.66% / 100% 1px no-repeat;
}
.cropper-rect span { position: absolute; width: 30px; height: 30px; touch-action: none; }
.cropper-rect span::after { content: ''; position: absolute; width: 16px; height: 16px; border: 0 solid #2997ff; }
.cropper-rect [data-c="nw"] { left: -9px; top: -9px; cursor: nwse-resize; }
.cropper-rect [data-c="ne"] { right: -9px; top: -9px; cursor: nesw-resize; }
.cropper-rect [data-c="sw"] { left: -9px; bottom: -9px; cursor: nesw-resize; }
.cropper-rect [data-c="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }
.cropper-rect [data-c="nw"]::after { left: 7px; top: 7px; border-left-width: 4px; border-top-width: 4px; }
.cropper-rect [data-c="ne"]::after { right: 7px; top: 7px; border-right-width: 4px; border-top-width: 4px; }
.cropper-rect [data-c="sw"]::after { left: 7px; bottom: 7px; border-left-width: 4px; border-bottom-width: 4px; }
.cropper-rect [data-c="se"]::after { right: 7px; bottom: 7px; border-right-width: 4px; border-bottom-width: 4px; }
.cropper-panel {
  flex: none; background: var(--bg); border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(env(safe-area-inset-bottom, 0px) + 14px);
  max-width: 520px; width: 100%; margin: 0 auto;
}
.cropper-panel h2 { font-size: 18px; margin-bottom: 10px; }

/* Photo loading spinner */
@keyframes ph-spin { to { transform: rotate(360deg); } }
.photo-thumb, .boxcard-thumb, .rv-photo { position: relative; }
.ph-loading > img { opacity: 0; }
.ph-loading::after {
  content: ''; position: absolute; left: 50%; top: 50%; z-index: 1;
  width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  border: 2.5px solid rgba(0, 113, 227, 0.2); border-top-color: var(--blue);
  animation: ph-spin .8s linear infinite; pointer-events: none;
}
.zoom-pan.ph-loading::after {
  position: fixed; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-width: 3px;
  border-color: rgba(255, 255, 255, 0.2); border-top-color: #fff;
}
.ph-failed > img { opacity: 0; }
.ph-failed::after {
  content: '!'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--text-3);
}
.zoom-pan.ph-failed::after { position: fixed; color: #f5f5f7; }
@media (prefers-reduced-motion: reduce) { .ph-loading::after { animation-duration: 2.4s; } }

/* Add photo chooser + unsaved new photo */
.ap-opt {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  border: 1px solid rgba(0, 113, 227, 0.22); background: rgba(0, 113, 227, 0.06);
  border-radius: 14px; padding: 14px; margin-bottom: 10px; color: var(--blue);
}
.ap-opt svg { width: 26px; height: 26px; flex: none; }
.ap-opt span { font-size: 13px; color: var(--text-2); line-height: 1.35; }
.ap-opt b { display: block; font-size: 15.5px; color: var(--text); font-weight: 600; }
.pending { z-index: 65; } /* above the viewer (60), below dialogs (70) and the crop box (80) */
.pending-img { max-width: 100%; max-height: calc(100vh - 300px); display: block; margin: auto; border-radius: 8px; }
.pending-row { display: flex; gap: 10px; margin-top: 10px; }
.pending-row .btn { flex: 1; }

/* Line icons */
.ico { display: inline-block; vertical-align: -0.18em; flex: none; }
.btn .ico, .fab .ico, .zoom-act .ico, .boxcard-open .ico { margin-right: 2px; }
.boxcard-open .ico { margin: 0 0 0 2px; vertical-align: -0.2em; }
.h-ico { display: flex; align-items: center; gap: 8px; }
.h-ico .ico { color: var(--blue); }
.hound-on .ico, .rv-same .ico { color: var(--green); }
.photo-add span.big .ico { display: block; }
.topbar-back .ico, .overlay-x .ico, .zoom-x .ico, .zoom-controls .ico { display: block; margin: auto; }
.hound-cta svg { fill: none; stroke: var(--blue); }

/* Box page: back to all boxes */
.go-home {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 4px;
  border: 1px solid rgba(0, 113, 227, 0.3); background: rgba(0, 113, 227, 0.07);
  color: var(--blue); font-size: 14px; font-weight: 600; padding: 8px 14px 8px 12px; border-radius: 980px;
}
.go-home:active { background: rgba(0, 113, 227, 0.16); }
@media (hover: hover) { .go-home:hover { background: var(--blue); color: #fff; border-color: var(--blue); } }
.hound-suggest-icon svg { fill: none; stroke: #fff; }
