
/* ==========================================================
   QUIZ PAGE
   ========================================================== */
.quiz-wrap { max-width: 720px; margin: 0 auto; padding: 32px 24px; }

.quiz-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.quiz-stage-label { font-size: 11px; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.quiz-progress { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.quiz-progress .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition:color 200ms var(--ease),background-color 200ms var(--ease),border-color 200ms var(--ease),box-shadow 200ms var(--ease),transform 200ms var(--ease),opacity 200ms var(--ease); }
.quiz-progress .dot.done { background: var(--brand); }
.quiz-progress .dot.cur { background: var(--brand); box-shadow: 0 0 0 3px rgba(255,122,60,.25); }

.quiz-card {
  background: var(--surface); border-radius: var(--r-xl); padding: 36px 32px;
  box-shadow: var(--shadow-md);
  animation: slideIn 280ms var(--ease);
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

.quiz-q-num { font-size: 12px; color: var(--brand-deep); font-weight: 700; margin-bottom: 4px; }
.quiz-q-title { font-size: 26px; font-family: var(--font-display); font-weight: 600; color: var(--ink); margin: 0 0 8px; line-height: 1.25; letter-spacing: -.015em; }
.quiz-q-sub { font-size: 14px; color: var(--ink-3); margin: 0 0 24px; }

.quiz-options { display: grid; gap: 10px; margin-bottom: 28px; }
.quiz-option {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer; transition: border-color 140ms var(--ease), background 140ms var(--ease), transform 140ms var(--ease);
  text-align: left; width: 100%;
  overflow: hidden;
}
/* Left-edge accent bar (replaces the icon — Fix #3) */
.quiz-option::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--line);
  transition: background 140ms var(--ease), width 140ms var(--ease);
}
.quiz-option:hover {
  border-color: var(--line-strong);
  background: var(--surface-sunk);
  transform: translateY(-1px);
}
.quiz-option:hover::before { background: var(--brand-soft); width: 5px; }
.quiz-option.selected {
  background: var(--brand-soft);
  border-color: var(--brand-deep);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgba(255, 122, 60, .25);
}
.quiz-option.selected::before { background: var(--brand); width: 5px; }

.quiz-option-text { flex: 1; min-width: 0; }
.quiz-option-title {
  font-weight: 700; color: var(--ink); font-size: 15.5px; line-height: 1.35;
  margin-bottom: 3px;
}
.quiz-option.selected .quiz-option-title { color: var(--brand-ink); }
.quiz-option-desc { font-size: 13px; color: var(--ink-3); line-height: 1.4; }
.quiz-option.selected .quiz-option-desc { color: var(--brand-ink); opacity: .85; }

.quiz-option-check {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  display: grid; place-items: center;
  color: transparent;
  font-weight: 700; font-size: 14px;
  transition:color 160ms var(--ease),background-color 160ms var(--ease),border-color 160ms var(--ease),box-shadow 160ms var(--ease),transform 160ms var(--ease),opacity 160ms var(--ease);
  flex-shrink: 0;
}
.quiz-option.selected .quiz-option-check {
  background: var(--brand); border-color: var(--brand-deep); color: white;
}
.quiz-option.picking .quiz-option-check {
  background: var(--brand); border-color: var(--brand-deep); color: white;
  transform: scale(1.1);
}

.quiz-actions { display: flex; justify-content: space-between; align-items: center; }
.quiz-back { color: var(--ink-3); font-size: 13px; padding: 8px 12px; }
.quiz-back:hover { color: var(--ink); }
.quiz-back:disabled { opacity: 0; pointer-events: none; }

/* ==========================================================
   QUIZ TRANSITION / "calculating" splash
   ========================================================== */
.quiz-calc {
  display: grid; place-items: center; min-height: 52vh;
  text-align: center; padding: 48px 24px; position: relative;
}
.quiz-calc::before {
  content: ""; position: absolute; width: min(440px, 86vw); height: min(440px, 86vw);
  border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle at 50% 45%, var(--brand-soft), transparent 64%);
  opacity: .75;
}
.quiz-calc > * { position: relative; z-index: 1; }
.quiz-calc-orb {
  position: relative; width: 122px; height: 122px; margin: 0 auto 30px;
  display: grid; place-items: center;
}
.qc-ring {
  position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent;
  border-top-color: var(--brand-deep); border-right-color: var(--brand-deep);
  animation: qc-spin 1.15s linear infinite;
}
.qc-ring-2 {
  inset: 15px; border-top-color: var(--accent); border-right-color: transparent;
  border-bottom-color: var(--accent-deep); animation: qc-spin 1.7s linear infinite reverse;
}
.qc-core {
  width: 74px; height: 74px; border-radius: 50%; font-size: 32px;
  background: linear-gradient(135deg, #C2410C, #9A3209);
  display: grid; place-items: center;
  box-shadow: 0 14px 30px -10px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.32);
  animation: qc-breathe 1.5s ease-in-out infinite;
}
@keyframes qc-spin { to { transform: rotate(360deg); } }
@keyframes qc-breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.qc-title {
  margin: 0 0 8px; font-size: clamp(22px, 3vw, 29px); letter-spacing: -.02em;
  background: linear-gradient(110deg, var(--brand) 12%, var(--brand-deep) 64%, var(--accent) 128%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.qc-sub { color: var(--ink-3); margin: 0 0 26px; }
.qc-bar {
  width: min(280px, 72vw); height: 6px; border-radius: var(--r-pill);
  background: var(--surface-sunk); overflow: hidden; position: relative;
}
.qc-bar i {
  position: absolute; left: 0; top: 0; height: 100%; width: 42%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, transparent, var(--brand), var(--brand-deep), transparent);
  animation: qc-slide 1.25s var(--ease) infinite;
}
@keyframes qc-slide { 0% { transform: translateX(-120%); } 100% { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) {
  .qc-ring, .qc-ring-2, .qc-core, .qc-bar i { animation: none !important; }
  .qc-ring { border-color: var(--brand-deep); }
  .qc-ring-2 { border-color: var(--accent); }
  .qc-bar i { width: 100%; transform: none; }
}

/* ==========================================================
   RESULT PAGE
   ========================================================== */
.result-wrap { max-width: 1080px; margin: 0 auto; padding: 32px 24px; }

.result-hero {
  display: grid;
  /* Right column constrained to ~320px so the 1:1 image card feels balanced */
  grid-template-columns: 1fr minmax(260px, 340px);
  gap: 28px;
  align-items: start;
  margin-bottom: 28px;
}
@media (max-width: 800px) {
  .result-hero { grid-template-columns: 1fr; gap: 20px; }
  .result-hero > article.result-top1 { max-width: 380px; margin: 0 auto; }
}

.result-label {
  font-size: clamp(28px, 4vw, 40px);
  font-family: var(--font-display); font-weight: 700;
  color: var(--ink); line-height: 1.1; letter-spacing: -.02em;
  margin: 8px 0;
}
.result-label .brand { color: var(--brand-deep); }
.result-label .italic { font-style: italic; color: var(--accent); }
.result-explain { font-size: 14px; color: var(--ink-2); line-height: 1.65; margin: 0 0 14px; }
.result-traits { display: flex; flex-wrap: wrap; gap: 6px; }

.result-top1 {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: box-shadow 220ms var(--ease), transform 220ms var(--ease);
}
.result-top1:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.result-top1-image {
  aspect-ratio: 1/1;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.result-top1-image::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 35% 25%, rgba(255,255,255,.4), transparent 60%);
  pointer-events: none; z-index: 1;
}
.result-top1-image > svg { width: 70% !important; height: 70% !important; position: relative; z-index: 0; }

.result-top1-rank-badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--bg);
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
  letter-spacing: .04em; box-shadow: var(--shadow-md);
}
.result-top1-score-badge {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  display: inline-flex; flex-direction: column; align-items: flex-end;
  padding: 8px 14px; border-radius: var(--r-md);
  background: var(--surface); color: var(--accent-deep);
  box-shadow: var(--shadow-md);
}
.result-top1-score-badge .score-num {
  font-family: var(--font-mono); font-weight: 800; font-size: 22px; line-height: 1;
}
.result-top1-score-badge .score-label {
  font-size: 9px; letter-spacing: .08em; font-weight: 700;
  color: var(--ink-3); margin-top: 1px;
}

.result-top1-meta {
  padding: 18px 20px 20px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.result-top1-name {
  font-family: var(--font-display); font-size: 26px; font-weight: 700;
  color: var(--ink); margin: 0; line-height: 1.15;
}
.result-top1-sub {
  font-size: 12px; color: var(--ink-3); margin: 2px 0 8px;
}
.result-top1-why {
  font-size: 13px; color: var(--ink-2);
  margin: 0; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* ---- Inline summary + actions in left column (Fix: dead space) ---- */
.result-hero-left { display: flex; flex-direction: column; gap: 8px; }

.result-hero-summary {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px 16px;
  margin-top: 16px;
}
.result-hero-summary-label {
  font-family: var(--font-display); font-weight: 700;
  font-size: 12px; color: var(--ink-3); letter-spacing: .04em;
  text-transform: uppercase; margin-bottom: 10px;
}
.result-hero-summary-list { display: flex; flex-direction: column; gap: 6px; }
.result-hero-summary-row {
  display: grid;
  grid-template-columns: 24px 28px 1fr auto;
  align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 8px;
  cursor: pointer; transition: background 120ms var(--ease);
}
.result-hero-summary-row:hover { background: var(--brand-soft); }
.result-hero-summary-row .rank-pill {
  width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
  color: white;
}
.result-hero-summary-row .rank-pill.rank-1 { background: var(--brand); }
.result-hero-summary-row .rank-pill.rank-2 { background: var(--highlight); color: var(--ink); }
.result-hero-summary-row .rank-pill.rank-3 { background: var(--accent); }
.result-hero-summary-row .thumb-mini {
  width: 28px; height: 28px; border-radius: 7px;
  overflow: hidden; display: grid; place-items: center;
  border: 1px solid var(--line);
}
.result-hero-summary-row .thumb-mini svg,
.result-hero-summary-row .thumb-mini img { width: 100%; height: 100%; object-fit: cover; }
.result-hero-summary-row .name { font-weight: 600; color: var(--ink); font-size: 13px; }
.result-hero-summary-row .score {
  font-family: var(--font-mono); font-weight: 700; font-size: 12px;
  color: var(--accent-deep);
}

.result-hero-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 16px;
}
.result-hero-actions .btn { font-size: 13px; padding: 9px 16px; }

/* Small 1:1 thumbnails on result rows */
.result-tier {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
}
.result-tier-thumb {
  width: 40px; height: 40px;
  border-radius: 10px;
  overflow: hidden; flex-shrink: 0;
  display: grid; place-items: center;
  border: 1px solid var(--line);
}
.result-tier-thumb svg { width: 75%; height: 75%; }

.result-explore-row {
  padding: 10px 12px; gap: 12px;
}
.result-explore-thumb {
  width: 44px; height: 44px;
  border-radius: 10px;
  overflow: hidden; flex-shrink: 0;
  display: grid; place-items: center;
  border: 1px solid var(--line);
}
.result-explore-thumb svg { width: 75%; height: 75%; }

.result-alternates-block {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px;
  margin-bottom: 18px;
}
.result-alternates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
@media (max-width: 600px) { .result-alternates-grid { grid-template-columns: 1fr; } }

.result-block {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px;
}
.result-block-title { font-size: 12px; color: var(--ink-3); font-weight: 700; letter-spacing: .04em; margin-bottom: 12px; }

.result-tier {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface-sunk); border: 1px solid var(--line);
  cursor: pointer; transition:color 140ms var(--ease),background-color 140ms var(--ease),border-color 140ms var(--ease),box-shadow 140ms var(--ease),transform 140ms var(--ease),opacity 140ms var(--ease);
}
.result-tier:hover { background: var(--brand-soft); border-color: var(--brand-deep); }
.result-tier-rank {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: white; flex-shrink: 0;
}
.result-tier-rank.r1 { background: var(--brand); }
.result-tier-rank.r2 { background: var(--highlight); color: var(--ink); }
.result-tier-rank.r3 { background: var(--accent); }
.result-tier-rank.r4 { background: var(--surface); color: var(--ink-3); border: 1.5px solid var(--line-strong); }
.result-tier-body { flex: 1; min-width: 0; }
.result-tier-name { font-weight: 700; color: var(--ink); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.result-tier-name .match-num { font-size: 13px; }
.result-tier-desc { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.result-tier-arrow { color: var(--ink-3); font-size: 14px; }

.result-not-rec {
  background: var(--risk-soft); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px; margin-bottom: 18px;
}
.result-not-rec-title { font-size: 12px; color: var(--risk); font-weight: 700; letter-spacing: .04em; margin-bottom: 12px; }
.result-not-rec-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.result-not-rec-body { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin: 0; }

.result-exploration { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); padding: 18px; }
.result-explore-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-sunk); margin-bottom: 6px; cursor: pointer; }
.result-explore-row:hover { background: var(--accent-soft); }
.result-explore-row:last-child { margin-bottom: 0; }
.result-explore-icon { font-size: 22px; }

.result-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; padding: 16px 0 8px; }

/* ==========================================================
   PET DETAIL DRAWER
   ========================================================== */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(31,26,23,.32);
  z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity 220ms var(--ease);
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(520px, 92vw);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  border-radius: var(--r-xl) 0 0 var(--r-xl);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 280ms var(--ease);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.drawer.open { transform: translateX(0); }
@media (max-width: 600px) {
  .drawer {
    top: auto; left: 0; right: 0; bottom: 0; width: auto;
    height: 88vh; border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform: translateY(100%);
  }
  .drawer.open { transform: translateY(0); }
}

.drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.drawer-tag { font-size: 11px; padding: 3px 10px; background: var(--accent-soft); color: var(--accent-deep); border-radius: var(--r-pill); font-weight: 700; }
.drawer-close { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-3); font-size: 20px; }
.drawer-close:hover { background: var(--surface-sunk); color: var(--ink); }

.drawer-body { padding: 18px 22px; overflow-y: auto; flex: 1; }

.drawer-hero {
  border-radius: var(--r-lg); overflow: hidden;
  aspect-ratio: 16 / 9; width: 100%; height: auto;
  margin-bottom: 16px; position: relative;
  display: block;
}
.drawer-hero-bg {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  position: relative;
}
.drawer-hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.drawer-titlerow { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.drawer-name { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--ink); margin: 0; }
.drawer-en { font-size: 12px; color: var(--ink-3); }
.drawer-match { text-align: right; }
.drawer-match-num { font-family: var(--font-mono); font-size: 24px; font-weight: 700; color: var(--accent-deep); line-height: 1; }
.drawer-match-label { font-size: 10px; color: var(--ink-3); margin-top: 2px; }

.drawer-summary { font-size: 13.5px; color: var(--ink-2); margin: 10px 0 16px; line-height: 1.55; }

.drawer-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.drawer-stat {
  background: var(--surface-sunk); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 10px 12px;
}
.drawer-stat-label { font-size: 11px; color: var(--ink-3); }
.drawer-stat-val { font-family: var(--font-mono); font-weight: 700; color: var(--ink); font-size: 14px; margin-top: 2px; }

.drawer-section { margin-bottom: 14px; }
.drawer-section-title { font-size: 11px; font-weight: 700; letter-spacing: .04em; margin-bottom: 6px; }
.drawer-section-title.pos { color: var(--accent-deep); }
.drawer-section-title.neg { color: var(--risk); }
.drawer-section ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); line-height: 1.65; }
.drawer-section li { margin-bottom: 3px; }

.drawer-footer { padding: 16px 22px; border-top: 1px solid var(--line); flex-shrink: 0; }
.drawer-footer .btn { width: 100%; }

/* ==========================================================
   DATABASE PAGE
   ========================================================== */
.db-wrap { padding: 32px 0; }
.db-grid { display: grid; grid-template-columns: 240px 1fr; gap: 28px; }
@media (max-width: 900px) { .db-grid { grid-template-columns: 1fr; gap: 14px; } }

.db-filters {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; height: fit-content; position: sticky; top: 88px;
}
.db-filter-group { margin-bottom: 16px; }
.db-filter-group:last-child { margin-bottom: 0; }
.db-filter-title { font-size: 11px; color: var(--ink-3); letter-spacing: .08em; font-weight: 700; margin-bottom: 6px; }
.db-filter-list { display: flex; flex-direction: column; gap: 2px; }
.db-filter-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; border-radius: var(--r-sm); cursor: pointer;
  font-size: 13px; color: var(--ink-2);
  transition:color 120ms var(--ease),background-color 120ms var(--ease),border-color 120ms var(--ease),box-shadow 120ms var(--ease),transform 120ms var(--ease),opacity 120ms var(--ease);
}
.db-filter-item:hover { background: var(--surface-sunk); color: var(--ink); }
.db-filter-item.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.db-filter-item .count { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }
.db-filter-item.active .count { color: var(--brand-deep); }

.db-filter-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.db-filter-chip {
  display: inline-flex; padding: 3px 9px; font-size: 11px;
  border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition:color 120ms var(--ease),background-color 120ms var(--ease),border-color 120ms var(--ease),box-shadow 120ms var(--ease),transform 120ms var(--ease),opacity 120ms var(--ease);
}
.db-filter-chip:hover { border-color: var(--line-strong); }
.db-filter-chip.active { background: var(--accent-soft); color: var(--accent-deep); border-color: transparent; font-weight: 600; }

.db-main { min-width: 0; }
.db-toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
.db-search {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.db-search input {
  flex: 1; background: none; border: 0; outline: 0;
  font-size: 14px; color: var(--ink);
}
.db-search input::placeholder { color: var(--ink-3); }
.db-sort {
  padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
  font-size: 13px; color: var(--ink-2); cursor: pointer;
}

.db-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 12px; color: var(--ink-3); }
.db-meta strong { color: var(--ink); }
.db-reset { color: var(--brand-deep); font-size: 12px; font-weight: 600; cursor: pointer; }

.db-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }

.db-empty {
  text-align: center; padding: 48px 24px;
  color: var(--ink-3); font-size: 14px;
  background: var(--surface-sunk); border-radius: var(--r-lg);
  border: 1px dashed var(--line-strong);
}

/* ==========================================================
   TOOL PAGES (Age / Weight / Cost)
   ========================================================== */
.tool-wrap { max-width: 760px; margin: 0 auto; padding: 32px 24px; }
.tool-eyebrow { font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.tool-title { font-family: var(--font-display); font-size: clamp(28px, 4vw, 36px); font-weight: 700; line-height: 1.15; color: var(--ink); margin: 0 0 8px; }
.tool-sub { font-size: 15px; color: var(--ink-2); margin: 0 0 24px; line-height: 1.55; }

.tool-form {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px; margin-bottom: 18px;
}
.tool-form-grid { display: grid; gap: 12px; }

.tool-field { display: flex; flex-direction: column; gap: 6px; }
.tool-field label { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.tool-field select, .tool-field input[type="number"], .tool-field input[type="text"] {
  padding: 10px 14px;
  background: var(--surface-sunk); border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 14px; color: var(--ink);
  font-family: var(--font-body);
}
.tool-field input:focus, .tool-field select:focus {
  outline: 2px solid var(--brand); outline-offset: 1px;
}

.tool-result {
  background: linear-gradient(135deg, var(--brand-soft), var(--highlight-soft));
  border-radius: var(--r-lg); padding: 24px; text-align: center;
  margin-bottom: 14px;
}
.tool-result-label { font-size: 12px; color: var(--brand-ink); font-weight: 700; letter-spacing: .04em; }
.tool-result-num {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(36px, 6vw, 56px); line-height: 1;
  color: var(--ink); margin: 6px 0;
}
.tool-result-sub { font-size: 13px; color: var(--ink-2); }

.tool-tip {
  background: var(--accent-soft); border-radius: var(--r-md);
  padding: 12px 14px; font-size: 13px; color: var(--ink-2); line-height: 1.55;
  margin-bottom: 10px;
}

.tool-disclaimer {
  text-align: center; font-size: 11.5px; color: var(--risk);
  padding: 8px;
}

/* Weight gauge */
.gauge { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; margin-bottom: 14px; }
.gauge-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-bottom: 8px; }
.gauge-track { height: 10px; border-radius: 999px; background: linear-gradient(90deg, #56B49F 0%, #F2B441 50%, #B44E12 100%); position: relative; margin-bottom: 14px; }
.gauge-pin { position: absolute; top: -5px; width: 20px; height: 20px; background: white; border: 3px solid var(--ink); border-radius: 50%; transform: translateX(-50%); transition: left 360ms var(--ease); }
html[data-theme="dark"] .gauge-pin { background: var(--ink); border-color: var(--bg); }
.gauge-verdict { text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 22px; }

/* BCS Questionnaire (Weight tool) */
/* Tool entry tiles: icon-only cards; tool image uploads are no longer used. */
.tool-tile { text-decoration:none; }
.tool-tile:hover { text-decoration:none; }


.tool-bcs-q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin-bottom: 12px; }
.tool-bcs-qtitle { font-weight: 700; font-size: 14px; margin-bottom: 4px; color: var(--ink); }
.tool-bcs-qhint { font-size: 11px; color: var(--ink-3); margin-bottom: 10px; }
.tool-bcs-options { display: flex; flex-direction: column; gap: 6px; }
.tool-bcs-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; font-size: 13px; transition:color 200ms var(--ease),background-color 200ms var(--ease),border-color 200ms var(--ease),box-shadow 200ms var(--ease),transform 200ms var(--ease),opacity 200ms var(--ease); }
.tool-bcs-opt:hover { border-color: var(--brand-deep); background: var(--brand-soft); }
.tool-bcs-opt.sel { border-color: var(--brand-deep); background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.tool-bcs-opt input { margin-top: 2px; cursor: pointer; }

/* Cost breakdown (Cost tool) */
.tool-cost-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin-bottom: 14px; }
.tool-cost-section h3 { font-family: var(--font-display); font-weight: 700; font-size: 14px; margin: 0 0 12px; color: var(--ink); }
.tool-cost-breakdown { display: grid; gap: 6px; }
.tool-cost-line { display: grid; grid-template-columns: 1fr 80px 1fr; gap: 8px; align-items: center; font-size: 13px; }
.tool-cost-line-label { color: var(--ink-2); }
.tool-cost-line-amount { font-family: var(--font-mono); font-weight: 600; color: var(--ink); text-align: right; }
.tool-cost-line-bar { height: 6px; background: var(--surface-sunk); border-radius: 999px; overflow: hidden; }
.tool-cost-line-bar > div { height: 100%; background: var(--brand); }
.tool-cost-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.tool-cost-total { padding: 12px 14px; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--r-md); }
.tool-cost-total-label { font-size: 11px; color: var(--ink-3); margin-bottom: 4px; }
.tool-cost-total-amount { font-family: var(--font-mono); font-weight: 700; font-size: 18px; color: var(--ink); }
.tool-cost-total.highlight { background: linear-gradient(135deg, var(--brand-soft), var(--highlight-soft)); border-color: var(--brand-deep); }
.tool-cost-total.highlight .tool-cost-total-amount { font-size: 22px; color: var(--brand-deep); }

/* ==========================================================
   GUIDES PAGE
   ========================================================== */
.guides-wrap { max-width: 980px; margin: 0 auto; padding: 32px 24px; }
.guide-card {
  display: grid; grid-template-columns: 1fr 240px; gap: 18px;
  padding: 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); margin-bottom: 14px;
  color: inherit; text-decoration: none;
  cursor: pointer;
  transition:color 180ms var(--ease),background-color 180ms var(--ease),border-color 180ms var(--ease),box-shadow 180ms var(--ease),transform 180ms var(--ease),opacity 180ms var(--ease);
}
.guide-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.guide-card-img { aspect-ratio: 4/3; border-radius: var(--r-md); overflow: hidden; }
.guide-card-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--ink); margin: 0 0 6px; line-height: 1.3; }
.guide-card-desc { font-size: 13px; color: var(--ink-2); line-height: 1.55; margin: 0 0 10px; }
.guide-card-meta { font-size: 11px; color: var(--ink-3); }
@media (max-width: 600px) {
  .guide-card { grid-template-columns: 1fr; }
}

/* ==========================================================
   UTILITY
   ========================================================== */
.muted { color: var(--ink-3); }
.center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid var(--bg); }
.drawer-body::-webkit-scrollbar-thumb { border-color: var(--surface); }

/* Footer */
.app-footer {
  margin-top: 64px; padding: 28px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink-3);
  text-align: center;
}
.app-footer a { color: var(--ink-2); }
.app-footer .footer-discl { margin-top: 8px; font-size: 11px; }
.footer-more {
  margin-top: 10px;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 10px;
  font-size: 11px; color: var(--ink-3);
}
.footer-more span { color: var(--ink-3); }
.footer-more a { color: var(--ink-2); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg);
  padding: 10px 18px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600;
  z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity 220ms var(--ease);
  box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; }

/* ==========================================================
   QUIZ LIVE-PREVIEW LAYOUT (Fix #1)
   ========================================================== */
.quiz-wrap { max-width: 1120px; }
.quiz-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .quiz-layout { grid-template-columns: 1fr; gap: 16px; }
}

.quiz-card {
  /* Disable the global slideIn — only animate INTRA-card swaps (Fix #2) */
  animation: none;
}
.quiz-card[data-anim="advance"] .quiz-q-inner { animation: qSlideIn 260ms var(--ease); }
@keyframes qSlideIn {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}
.quiz-card[data-anim="back"] .quiz-q-inner { animation: qSlideBack 260ms var(--ease); }
@keyframes qSlideBack {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Option click feedback: see .quiz-option-check transform in the main quiz styles */

/* Stage-2 floating "see results now" affordance (Fix #3) */
.quiz-skip-result {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; margin-top: 14px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-pill); font-size: 12px; font-weight: 600;
  color: var(--ink-2); cursor: pointer; transition:color 120ms var(--ease),background-color 120ms var(--ease),border-color 120ms var(--ease),box-shadow 120ms var(--ease),transform 120ms var(--ease),opacity 120ms var(--ease);
}
.quiz-skip-result:hover { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-deep); }

.quiz-stage2-hint {
  background: var(--accent-soft); color: var(--accent-deep);
  padding: 10px 14px; border-radius: var(--r-md);
  font-size: 12.5px; line-height: 1.55;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.quiz-stage2-hint .icon { font-size: 18px; }

/* Live preview side panel */
.quiz-preview {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px 18px;
  position: sticky; top: 86px;
}
@media (max-width: 900px) { .quiz-preview { position: static; } }

.preview-eyebrow {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--ink-3); letter-spacing: .04em;
  font-weight: 700; margin-bottom: 12px;
}
.preview-eyebrow .live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); animation: pulse 1.6s ease-in-out infinite;
}
.preview-title-row { display: flex; align-items: center; gap: 6px; }

.preview-empty {
  text-align: center; padding: 22px 16px;
  color: var(--ink-3); font-size: 12.5px; line-height: 1.55;
}
.preview-empty .big-icon { font-size: 36px; margin-bottom: 6px; opacity: .5; }

.preview-list { display: flex; flex-direction: column; gap: 8px; }
.preview-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  background: var(--surface-sunk); border: 1px solid transparent;
  cursor: pointer; transition:color 160ms var(--ease),background-color 160ms var(--ease),border-color 160ms var(--ease),box-shadow 160ms var(--ease),transform 160ms var(--ease),opacity 160ms var(--ease);
}
.preview-row:hover { background: var(--brand-soft); border-color: var(--brand-deep); }
.preview-row.top1 { background: linear-gradient(135deg, var(--brand-soft), var(--highlight-soft)); border: 1px solid var(--brand-soft); }
.preview-rank {
  width: 22px; height: 22px; border-radius: 7px;
  display: grid; place-items: center; flex-shrink: 0;
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
  color: white;
}
.preview-rank.r1 { background: var(--brand); }
.preview-rank.r2 { background: var(--highlight); color: var(--ink); }
.preview-rank.r3 { background: var(--accent); }
.preview-row-thumb {
  width: 32px; height: 32px; border-radius: 8px;
  overflow: hidden; flex-shrink: 0;
}
.preview-row-body { flex: 1; min-width: 0; }
.preview-row-name { font-weight: 700; color: var(--ink); font-size: 12.5px; line-height: 1.2; }
.preview-row-score { font-family: var(--font-mono); font-size: 11px; font-weight: 700; }
.preview-row-score.high { color: var(--accent-deep); }
.preview-row-score.mid { color: #8C5D11; }
.preview-row-score.low { color: var(--risk); }
.preview-row-bar {
  height: 3px; border-radius: 999px;
  background: var(--line); margin-top: 3px; overflow: hidden;
}
.preview-row-bar > div {
  height: 100%; border-radius: 999px;
  transition: width 520ms cubic-bezier(.2,.8,.2,1);
}

.preview-note {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 11px; color: var(--ink-3);
  text-align: center; line-height: 1.55;
}

/* ==========================================================
   PET CARD: 1:1 layout (Fix #4)
   ========================================================== */
.pet-card-img { aspect-ratio: 1/1; }   /* override 4:3 globally */
.pet-card-img.tall { aspect-ratio: 4/5; }

.pet-card .pet-illus { position: relative; }
.pet-card .pet-illus::before {
  /* subtle inner highlight for a more "photo" feel */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.35), transparent 55%);
  pointer-events: none;
}

/* ==========================================================
   PETS DB: mobile/portrait fix (Fix #5)
   ========================================================== */
@media (max-width: 900px) {
  .db-filters {
    position: static;       /* don't sticky on mobile */
    height: auto;
    max-height: none;
    padding: 14px;
  }
  .db-filter-group { margin-bottom: 12px; }
  .db-filter-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .db-filter-list::-webkit-scrollbar { display: none; }
  .db-filter-item {
    flex-shrink: 0;
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 6px 12px;
    border-radius: var(--r-pill);
  }
  .db-filter-item .count { display: none; }
  .db-filters input[type="range"] { width: 100%; }
}

/* On very narrow viewports, single column of pet cards */
@media (max-width: 480px) {
  .db-results { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important; }
}

/* ==========================================================
   INSPIRATION WALL: auto-rotation (Fix #6)
   ========================================================== */
.inspiration-grid .pet-card {
  animation: inspirationIn 480ms var(--ease) both;
}
@keyframes inspirationIn {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.inspiration-grid .pet-card.rotating-out {
  animation: inspirationOut 360ms var(--ease) forwards;
}
@keyframes inspirationOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(.96); }
}

.inspiration-title .refresh-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--r-pill);
  background: transparent; color: var(--ink-3);
  border: 1px solid var(--line);
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition:color 120ms var(--ease),background-color 120ms var(--ease),border-color 120ms var(--ease),box-shadow 120ms var(--ease),transform 120ms var(--ease),opacity 120ms var(--ease);
}
.inspiration-title .refresh-btn:hover { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-deep); }
.inspiration-title .refresh-btn svg { width: 12px; height: 12px; transition: transform 400ms var(--ease); }
.inspiration-title .refresh-btn:hover svg { transform: rotate(180deg); }

/* ==========================================================
   ADMIN / CMS — Code-free Backend Management
   ========================================================== */
.admin-shell {
  display: grid; grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 70px);
}
.admin-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 24px 0;
  position: sticky; top: 70px;
  height: calc(100vh - 70px);
  overflow-y: auto;
}
.admin-sidebar-section {
  font-size: 10.5px; letter-spacing: .12em; font-weight: 700;
  color: var(--ink-3); text-transform: uppercase;
  padding: 8px 24px 4px;
}
.admin-sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 24px;
  color: var(--ink-2); font-size: 14px; font-weight: 500;
  border-left: 3px solid transparent;
  transition:color 120ms var(--ease),background-color 120ms var(--ease),border-color 120ms var(--ease),box-shadow 120ms var(--ease),transform 120ms var(--ease),opacity 120ms var(--ease);
}
.admin-sidebar a:hover { background: var(--surface-sunk); color: var(--ink); }
.admin-sidebar a.active {
  background: var(--brand-soft); color: var(--brand-ink);
  border-left-color: var(--brand-deep);
}
.admin-sidebar a .badge {
  margin-left: auto; padding: 1px 7px;
  font-size: 10px; border-radius: var(--r-pill);
  background: var(--surface-sunk); color: var(--ink-3); font-weight: 700;
}
.admin-sidebar a.active .badge { background: var(--brand); color: white; }

.admin-main { padding: 28px 36px; max-width: 1100px; overflow-x: hidden; }
.admin-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding-bottom: 18px; border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.admin-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 26px; line-height: 1.2; color: var(--ink); margin: 0;
}
.admin-subtitle { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.admin-actions { display: flex; gap: 8px; }

@media (max-width: 800px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: static; height: auto; padding: 14px 0;
    border-right: 0; border-bottom: 1px solid var(--line);
    overflow-x: auto; white-space: nowrap;
    display: flex; align-items: center;
  }
  .admin-sidebar-section { display: none; }
  .admin-sidebar a {
    border-left: 0; border-bottom: 3px solid transparent;
    padding: 8px 14px;
  }
  .admin-sidebar a.active { border-left: 0; border-bottom-color: var(--brand-deep); }
  .admin-main { padding: 18px; }
}

/* Admin tiles & stats */
.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.stat-tile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 16px 18px;
}
.stat-tile-label {
  font-size: 11px; color: var(--ink-3); letter-spacing: .04em;
  font-weight: 700; text-transform: uppercase; margin-bottom: 6px;
}
.stat-tile-value {
  font-family: var(--font-display); font-weight: 700;
  font-size: 32px; color: var(--ink); line-height: 1;
}
.stat-tile-delta { font-size: 12px; color: var(--accent-deep); margin-top: 4px; }
.stat-tile-delta.down { color: var(--risk); }

/* Admin tables */
.admin-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden;
}
.admin-table thead {
  background: var(--surface-sunk);
}
.admin-table th, .admin-table td {
  text-align: left; padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.admin-table th {
  font-size: 11px; letter-spacing: .04em;
  color: var(--ink-3); font-weight: 700; text-transform: uppercase;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: var(--surface-sunk); cursor: pointer; }
.admin-table .thumb {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--line); overflow: hidden;
  display: grid; place-items: center;
}
.admin-table .thumb img, .admin-table .thumb svg { width: 100%; height: 100%; object-fit: cover; }

/* Admin form */
.admin-form { display: grid; gap: 14px; max-width: 720px; }
.admin-form-row {
  display: grid; grid-template-columns: 180px 1fr;
  gap: 14px; align-items: start;
}
@media (max-width: 600px) { .admin-form-row { grid-template-columns: 1fr; } }
.admin-form-row label {
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  padding-top: 9px;
}
.admin-form-row label small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.admin-input, .admin-textarea, .admin-select {
  padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font: inherit; font-size: 13.5px; color: var(--ink);
  width: 100%;
}
.admin-textarea { min-height: 80px; resize: vertical; }
.admin-input:focus, .admin-textarea:focus, .admin-select:focus {
  outline: 2px solid var(--brand); outline-offset: 1px;
  border-color: var(--brand-deep);
}
.admin-help { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

/* Login screen */
.admin-login {
  max-width: 380px; margin: 80px auto; padding: 32px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-md);
  text-align: center;
}
.admin-login h2 { margin-bottom: 8px; }
.admin-login .lock { font-size: 48px; margin-bottom: 8px; }
.admin-login input {
  width: 100%; margin: 14px 0;
  padding: 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: 14px;
  font-family: var(--font-mono);
}
.admin-login button { width: 100%; }
.admin-login .err { color: var(--risk); font-size: 12px; margin-top: -4px; margin-bottom: 8px; }
.admin-login .hint { font-size: 11px; color: var(--ink-3); margin-top: 10px; }

/* Photo upload zone */
.upload-zone {
  display: block;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-lg); padding: 30px 20px;
  text-align: center; cursor: pointer;
  transition:color 140ms var(--ease),background-color 140ms var(--ease),border-color 140ms var(--ease),box-shadow 140ms var(--ease),transform 140ms var(--ease),opacity 140ms var(--ease);
  background: var(--surface-sunk);
  position: relative;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--brand-deep); background: var(--brand-soft);
}
.upload-zone:active { transform: scale(.998); }
.upload-zone-icon { font-size: 36px; margin-bottom: 8px; line-height: 1; }
.upload-zone-text { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.upload-zone-sub { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.upload-zone input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
  overflow: hidden;
}

/* Photo grid (batch preview) */
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px; margin-top: 16px;
}
.photo-tile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden;
  position: relative;
}
.photo-tile-img {
  aspect-ratio: 1/1;
  background: var(--surface-sunk);
  display: grid; place-items: center;
  overflow: hidden;
}
.photo-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile-info { padding: 8px 10px; font-size: 11px; }
.photo-tile-info .name { font-weight: 600; color: var(--ink); }
.photo-tile-info .match { color: var(--accent-deep); }
.photo-tile-info .nomatch { color: var(--risk); }
.photo-tile .badge {
  position: absolute; top: 6px; left: 6px;
  padding: 2px 7px; border-radius: var(--r-pill);
  font-size: 10px; font-weight: 700;
  background: var(--accent); color: white;
}
.photo-tile .badge.nomatch { background: var(--risk); }

/* Bar chart (CSS-only) */
.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 50px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-row .lbl { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .track {
  height: 18px; background: var(--surface-sunk);
  border-radius: 6px; overflow: hidden;
}
.bar-row .fill {
  height: 100%; background: linear-gradient(90deg, var(--brand), var(--highlight));
  border-radius: 6px; transition: width 600ms cubic-bezier(.2,.8,.2,1);
}
.bar-row .num { font-family: var(--font-mono); font-weight: 700; color: var(--ink); font-size: 12px; }

/* Recent events log */
.events-log {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden; font-family: var(--font-mono);
  font-size: 11.5px; max-height: 400px; overflow-y: auto;
}
.events-log .ev {
  padding: 6px 14px; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 80px 130px 1fr; gap: 12px;
}
.events-log .ev:last-child { border-bottom: 0; }
.events-log .ev .time { color: var(--ink-3); }
.events-log .ev .event { color: var(--brand-deep); font-weight: 600; }
.events-log .ev .props { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Humanized events log (used in dashboard + analytics) */
.events-log-humane {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden;
  max-height: 480px; overflow-y: auto;
}
.events-log-humane .ev-row {
  display: grid; grid-template-columns: 28px 1fr auto;
  gap: 12px; align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.events-log-humane .ev-row:last-child { border-bottom: 0; }
.events-log-humane .ev-row:hover { background: var(--surface-sunk); }
.events-log-humane .ev-icon {
  font-size: 16px; line-height: 1;
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-sunk);
}
.events-log-humane .ev-text { color: var(--ink); }
.events-log-humane .ev-ago {
  font-size: 11.5px; color: var(--ink-3);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* Pet override pulse — show that a pet's been customized */
.pet-overridden::after {
  content: "✎"; color: var(--brand-deep);
  font-weight: 700; margin-left: 6px;
}

/* Override badge */
.override-flag {
  display: inline-block; padding: 1px 7px;
  font-size: 10px; font-weight: 700;
  background: var(--highlight-soft); color: #8C5D11;
  border-radius: var(--r-pill);
  margin-left: 6px;
}

/* Tag colour palette swatches (admin → tags editor) */
.tag-swatch {
  transition: transform 100ms var(--ease), outline-offset 100ms var(--ease);
}
.tag-swatch:hover {
  transform: scale(1.18);
  outline-offset: 2px !important;
}

/* Guide body markdown */
.guide-body h1 { font-family: var(--font-display); font-weight: 700; font-size: 24px; margin: 20px 0 12px; line-height: 1.25; }
.guide-body h2 { font-family: var(--font-display); font-weight: 700; font-size: 19px; margin: 18px 0 10px; line-height: 1.3; }
.guide-body h3 { font-family: var(--font-display); font-weight: 600; font-size: 16px; margin: 14px 0 8px; }
.guide-body h4 { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin: 12px 0 8px; }
.guide-body h5, .guide-body h6 { font-weight: 700; font-size: 14px; margin: 10px 0 6px; }
.guide-body p { margin: 0 0 12px; }
.guide-body ul, .guide-body ol { padding-left: 22px; margin: 0 0 12px; }
.guide-body li { margin: 4px 0; }
.guide-body strong { color: var(--ink); font-weight: 700; }
.guide-body em { color: var(--brand-deep); font-style: italic; }
.guide-body del { color: var(--ink-3); text-decoration-thickness: 1.5px; }
.guide-body a { color: var(--brand-deep); text-decoration: underline; text-underline-offset: 2px; }
.guide-body code {
  font-family: var(--font-mono); font-size: .92em;
  background: var(--surface-sunk); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 5px;
}
.guide-body pre {
  margin: 14px 0; padding: 14px 16px;
  overflow-x: auto; background: var(--surface-sunk);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.guide-body pre code { display: block; padding: 0; border: 0; background: transparent; white-space: pre; }
.guide-body blockquote {
  margin: 12px 0; padding: 10px 16px;
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--brand-ink); font-style: italic;
}
.guide-body blockquote p:last-child { margin-bottom: 0; }
.guide-body hr { border: 0; border-top: 1px solid var(--line-strong); margin: 20px 0; }
.guide-body .md-table-wrap { width: 100%; overflow-x: auto; margin: 14px 0 18px; border: 1px solid var(--line); border-radius: var(--r-md); }
.guide-body table { width: 100%; border-collapse: collapse; min-width: 520px; background: var(--surface); font-size: 13.5px; }
.guide-body th, .guide-body td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 9px 11px; vertical-align: top; }
.guide-body th:last-child, .guide-body td:last-child { border-right: 0; }
.guide-body tr:last-child td { border-bottom: 0; }
.guide-body thead th { background: var(--surface-sunk); color: var(--ink); font-weight: 700; }
.guide-body tbody tr:nth-child(even) td { background: rgba(0,0,0,.015); }
html[data-theme="dark"] .guide-body tbody tr:nth-child(even) td { background: rgba(255,255,255,.025); }
.guide-body .task-list { list-style: none; padding-left: 0; }
.guide-body .task-list li { display: flex; align-items: flex-start; gap: 8px; }
.guide-body .task-list input { margin-top: .35em; accent-color: var(--brand-deep); }
.guide-body img { max-width: 100%; height: auto; border-radius: var(--r-md); border: 1px solid var(--line); margin: 12px 0; }
.guide-body .md-image { text-align: center; }
.guide-body .md-image img { margin-left: auto; margin-right: auto; }


/* Hide native file inputs inside .btn labels */
.btn input[type="file"] { display: none; }

.callout-info { display: flex; align-items: flex-start; gap: 12px;
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  padding: 12px 16px; border-radius: var(--r-md); }
.callout-info .callout-icon {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: white;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.callout-info .callout-title { font-weight: 700; color: var(--ink); font-size: 13px; margin-bottom: 4px; }
.callout-info .callout-body { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }

/* Photo kind tabs (Photos admin section) */
.photo-kind-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
.photo-kind-tab {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-md); cursor: pointer;
  text-align: left; transition:color 140ms var(--ease),background-color 140ms var(--ease),border-color 140ms var(--ease),box-shadow 140ms var(--ease),transform 140ms var(--ease),opacity 140ms var(--ease);
}
.photo-kind-tab:hover { border-color: var(--line-strong); }
.photo-kind-tab.active {
  border-color: var(--brand-deep); background: var(--brand-soft);
}
.photo-kind-tab .tab-icon { font-size: 28px; flex-shrink: 0; }
.photo-kind-tab strong { display: block; font-size: 14px; color: var(--ink); }
.photo-kind-tab small { display: block; font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.photo-kind-tab.active strong { color: var(--brand-ink); }

/* Two-slot photo preview in pet edit */
.pet-photo-slots {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 640px) {
  .pet-photo-slots { grid-template-columns: 1fr; }
}
.pet-photo-slot {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px;
}
.pet-photo-slot-label {
  font-size: 11px; font-weight: 700; color: var(--ink-3);
  letter-spacing: .04em; text-transform: uppercase; margin-bottom: 8px;
}
.pet-photo-preview-1x1 {
  aspect-ratio: 1/1; width: 100%;
  border-radius: var(--r-md); overflow: hidden;
  display: grid; place-items: center;
  border: 1px solid var(--line);
}
.pet-photo-preview-1x1 img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pet-photo-preview-16x9 {
  aspect-ratio: 16/9; width: 100%;
  border-radius: var(--r-md); overflow: hidden;
  display: grid; place-items: center;
  border: 1px solid var(--line);
}
.pet-photo-preview-16x9 img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pet-photo-slot-actions {
  display: flex; gap: 6px; margin-top: 10px;
}
