/* ============================================================
   Light "apple-clean guide site" theme — warm off-white, frosted
   glass surfaces, single orange accent, pal-collage hero veil.
   Fredoka display / Nunito body, self-hosted.
   ============================================================ */
@font-face {
  font-family: 'Fredoka';
  src: url('/assets/fonts/fredoka.woff2') format('woff2') tech('variations');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('/assets/fonts/nunito.woff2') format('woff2') tech('variations');
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  /* palette */
  --bg: #f5f4f2;
  --glass: rgba(255, 255, 255, 0.78);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --surface: #ffffff;
  --surface-2: #efece8;
  --border: rgba(0, 0, 0, 0.07);
  --border-strong: rgba(0, 0, 0, 0.14);
  --text: #1d1d1f;
  --text-body: #3a3a3c;
  --muted: #6e6e73;
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-soft: #f97316;
  --primary-tint: rgba(234, 88, 12, 0.09);
  --on-primary: #ffffff;
  --accent: #ea580c;
  --accent-soft: #c2410c;
  --destructive: #dc2626;
  --ring: #ea580c;
  --success: #059669;
  /* type */
  --font-display: 'Fredoka', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  /* shape & depth */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-1: 0 1px 2px rgba(60, 40, 20, 0.05);
  --shadow-2: 0 10px 30px rgba(60, 40, 20, 0.09);
  --shadow-3: 0 24px 64px rgba(60, 40, 20, 0.16);
  --glow-primary: 0 0 0 1px rgba(234, 88, 12, 0.35), 0 6px 20px rgba(234, 88, 12, 0.14);
  /* z scale */
  --z-header: 20;
  --z-dropdown: 30;
  --z-modal: 100;
  /* motion */
  --t-fast: 150ms ease;
  --t-med: 250ms ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.6;
}
/* pal-collage veil at the top of the document, fading into the page bg */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 860px;
  z-index: -1;
  pointer-events: none;
  background: url('/assets/bg-collage.webp') center top / cover no-repeat;
}
/* fine grain, very subtle */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}
main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px 56px;
}
a { color: var(--accent-soft); text-decoration-color: rgba(194, 65, 12, 0.35); }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, .logo, .tab-btn, .cta, .pal-chip, .trending-chip, button {
  font-family: var(--font-display);
}
h1 { font-size: 38px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; color: var(--text); text-wrap: balance; }
h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); text-wrap: balance; }
button { font: inherit; cursor: pointer; }
img { user-select: none; }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}

button:active, .pal-chip:active, .trending-chip:active, .inv-item:active, .picker-item:active, .cta:active {
  transform: scale(0.98);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: var(--z-modal);
  background: var(--primary);
  color: var(--on-primary);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  transition: top var(--t-fast);
}
.skip-link:focus { top: 12px; }

/* ---------- header / footer ---------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 10px 22px;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}
.logo svg { color: var(--primary); }
.site-nav { display: flex; gap: 6px; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color var(--t-fast), background var(--t-fast);
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
}

/* language switcher */
.lang-switch { position: relative; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.lang-btn:hover { color: var(--text); border-color: var(--border-strong); }
.lang-btn svg { color: var(--primary); }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 170px;
  background: var(--glass-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
  padding: 6px;
  display: none;
  flex-direction: column;
  z-index: var(--z-dropdown);
}
.lang-switch:hover .lang-menu, .lang-switch:focus-within .lang-menu { display: flex; }
/* tapped open on touch devices (tiny script in the page layout toggles .open) */
.lang-switch.open .lang-menu { display: flex; }
.lang-option {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-body);
  text-decoration: none;
  font-size: 13px;
}
.lang-option:hover { background: var(--surface-2); }
.lang-option.current { color: var(--primary-hover); font-weight: 700; }
.data-note { font-size: 12px; color: var(--muted); margin-left: auto; }
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px 32px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  background: var(--glass);
}
.footer-nav { margin-bottom: 10px; font-size: 14px; }
.footer-nav a { color: var(--accent-soft); text-decoration: none; }

/* ---------- hero / sections ---------- */
.hero { padding: 64px 0 24px; text-align: center; }
.hero h1 { margin: 0 0 12px; font-size: clamp(30px, 5vw, 46px); }
.hero-sub { font-size: 17px; color: var(--muted); max-width: 680px; margin: 0 auto; }
.hero-sub strong { color: var(--primary); }
.freshness {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
  background: rgba(5, 150, 105, 0.08);
  border: 1px solid rgba(5, 150, 105, 0.28);
  border-radius: 999px;
  padding: 5px 14px;
}
section { margin-top: 40px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; }

/* ---------- cards (frosted glass) ---------- */
.card {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-2);
}
.card h2 { margin-top: 0; }

/* ---------- tabs (segmented control) ---------- */
.tabs-card { text-align: center; }
.tabs-card .result, .tabs-card .recent { text-align: left; }
.tabs-card .recent { justify-content: center; }
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  transition: color var(--t-fast), background var(--t-med), box-shadow var(--t-med);
}
.tab-btn svg { flex: none; }
.tab-btn.active {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 2px 10px rgba(234, 88, 12, 0.3);
}
.tab-btn:not(.active):hover { color: var(--text); background: rgba(255, 255, 255, 0.7); }

/* ---------- inputs ---------- */
.field-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.field-row input { flex: 1; min-width: 150px; }
input, select, textarea {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font-body);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}
.filter-input { min-width: 180px; }
.plus, .equals { color: var(--muted); font-weight: 800; font-size: 20px; font-family: var(--font-display); }
.result { margin-top: 16px; }
.muted { color: var(--muted); }
.ok { color: var(--success); }
.warn { color: #b45309; }

/* ---------- autocomplete (passives) ---------- */
.ac-wrap { position: relative; flex: 1; min-width: 150px; }
.ac-wrap input { width: 100%; }
.ac-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--glass-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
  z-index: var(--z-dropdown);
  max-height: 320px;
  overflow-y: auto;
}
.ac-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.ac-list li.active { background: var(--primary-tint); }
.ac-list img { border-radius: 6px; }
.ac-label { font-weight: 600; color: var(--text); }
.ac-sub { margin-left: auto; font-size: 12px; color: var(--muted); }

/* ---------- pal chips / grids ---------- */
.pal-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 80px;
  padding: 8px 4px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-1);
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.pal-chip:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--glow-primary);
}
.pal-chip img { border-radius: 8px; }
.pal-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ---------- pairs ---------- */
.pair-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pair {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  box-shadow: var(--shadow-1);
  transition: border-color var(--t-fast);
}
.pair:hover { border-color: var(--border-strong); }
.pair .pal-chip { background: transparent; border-color: transparent; box-shadow: none; width: 72px; padding: 4px 2px; }
.pair .pal-chip:hover { border-color: var(--primary); }
.pair-note { font-size: 12px; color: var(--muted); margin-left: auto; }
.self-pair { border-color: rgba(234, 88, 12, 0.35); }
.show-all {
  margin-top: 10px;
  width: 100%;
  padding: 13px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--accent-soft);
  font-weight: 700;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.show-all:hover { border-color: var(--accent-soft); background: var(--surface); }
.pair-result { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.copy-btn, .mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 600;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.copy-btn:hover, .mini-btn:hover { color: var(--text); border-color: var(--primary); }
.copy-btn svg { display: block; }
.mini-btn.danger:hover { color: var(--destructive); border-color: var(--destructive); }
.gendered-option { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.recent { margin-top: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.recent .pal-chip { width: 64px; font-size: 11px; padding: 6px 2px; }

/* ---------- planner banner (light, orange-tinted) ---------- */
.planner-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 28px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(400px 160px at 92% 0%, rgba(249, 115, 22, 0.14) 0%, transparent 60%),
    var(--glass);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(234, 88, 12, 0.25);
  box-shadow: var(--shadow-2);
}
.planner-banner h2 { margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
.planner-banner h2 svg { color: var(--primary); }
.planner-banner p { margin: 0; color: var(--muted); max-width: 560px; }
.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  padding: 14px 24px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.3);
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.cta:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(234, 88, 12, 0.4); }

/* ---------- pal page ---------- */
.breadcrumb { padding: 18px 0 0; color: var(--muted); font-size: 14px; }
.pal-header { display: flex; align-items: center; gap: 20px; margin: 16px 0 8px; }
.pal-header h1 { margin: 0 0 4px; font-size: 30px; }
.pal-header img { border-radius: var(--radius); }
.guaranteed { color: var(--accent-soft); font-size: 14px; margin: 4px 0; }
.pal-actions { margin: 6px 0 0; font-size: 14px; }
.prose ul, .prose ol { color: var(--text-body); }
.prose p { color: var(--text-body); }

/* ---------- inventory ---------- */
.inv-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#inv-io { width: 100%; margin: 10px 0; }
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
  margin-top: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding: 2px;
}
.inv-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-display);
  transition: transform var(--t-fast), border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.inv-item:hover { transform: scale(1.04); border-color: var(--primary-soft); }
.inv-item.owned {
  border-color: var(--primary);
  background: var(--primary-tint);
  color: var(--text);
}
.inv-item img { border-radius: 8px; }
/* skeleton placeholders inside the planner inventory grid until data arrives */
.inv-item.is-loading {
  pointer-events: none;
  min-height: 86px;
  border-color: var(--border);
  background: linear-gradient(100deg, var(--surface) 40%, var(--surface-2) 50%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

/* ---------- breeding tree ---------- */
.tree-scroll { overflow-x: auto; padding-bottom: 8px; }
.tree, .tree-children { list-style: none; padding-left: 0; }
.tree-children { padding-left: 26px; border-left: 2px solid var(--border-strong); margin-left: 34px; }
.tree-node, .tree-leaf { margin: 10px 0; }
.tree-pair { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tree-tag {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
}
.tree-leaf { display: flex; align-items: center; gap: 10px; }
.tree-leaf .pal-chip { border-color: var(--primary); }

/* ---------- passive planner ---------- */
.odds-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
.odds-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; min-height: 8px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
}
.tag.rank-3 { background: var(--primary-tint); border-color: var(--primary); }
.tag.rank-2 { background: rgba(110, 110, 115, 0.12); border-color: var(--muted); }
.tag.rank-neg { background: rgba(220, 38, 38, 0.1); border-color: var(--destructive); }
.tag button { background: none; border: none; color: inherit; font-size: 15px; padding: 0 2px; }

/* ---------- faq ---------- */
.faq details {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 12px 0;
  transition: border-color var(--t-fast);
}
.faq details[open] { border-color: rgba(234, 88, 12, 0.35); }
.faq summary { cursor: pointer; font-weight: 700; font-family: var(--font-display); color: var(--text); }
.faq p { color: var(--muted); }

/* ---------- breed row (picker-based) ---------- */
.breed-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.pal-select {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 112px;
  height: 112px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.pal-select:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--glow-primary);
}
.pal-select img { border-radius: 10px; }
.pal-select:has(img) { border-style: solid; border-color: rgba(234, 88, 12, 0.4); }
.picker-placeholder { color: var(--muted); display: flex; }
.picker-placeholder svg { width: 26px; height: 26px; }
.picker-hint { color: var(--muted); font-size: 12px; }
.result-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 112px;
}
.result-slot .pal-chip { width: 112px; padding: 12px 6px; border-color: rgba(5, 150, 105, 0.4); }
.result-hint {
  width: 112px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-strong);
  color: var(--muted);
  font-size: 14px;
}
.row-actions { display: flex; gap: 8px; margin-top: 14px; justify-content: center; }
.gendered-result { display: flex; flex-direction: column; gap: 6px; }

/* skeleton shimmer while game data loads (picker buttons start out empty) */
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
.pal-select:empty {
  border-style: solid;
  border-color: var(--border);
  background: linear-gradient(100deg, var(--surface) 40%, var(--surface-2) 50%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

/* inline data-load failure with retry (injected by app.js / planner.js) */
.error-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.06);
  color: var(--text);
  font-size: 14px;
}
.inv-grid .error-box { grid-column: 1 / -1; }

/* ---------- trending chips ---------- */
.trending { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.trending-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-1);
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.trending-chip:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--glow-primary);
}
.trending-chip img { border-radius: 999px; }

/* ---------- picker modal ---------- */
.picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(60, 45, 30, 0.35);
  backdrop-filter: blur(5px);
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 12px 12px;
}
.picker-overlay[hidden] { display: none; }
.picker-modal {
  width: 100%;
  max-width: 720px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: var(--glass-strong);
  backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
.picker-head {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.picker-search-wrap { position: relative; flex: 1; display: flex; min-width: 0; }
.picker-search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.picker-search { flex: 1; min-width: 0; padding-left: 36px; }
.picker-sort { width: 140px; }
.picker-close {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
  font-size: 16px;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.picker-close:hover { color: var(--text); border-color: var(--destructive); }
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 6px;
  padding: 14px;
  overflow-y: auto;
}
.picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-display);
  transition: background var(--t-fast), transform var(--t-fast);
}
.picker-item:hover { background: var(--primary-tint); transform: scale(1.05); }
.picker-item img { border-radius: 8px; }
.picker-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 36px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- prose sections ---------- */
.prose h2 {
  margin: 48px 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}
.prose p { max-width: 65ch; text-wrap: pretty; margin: 0 0 18px; line-height: 1.75; }
.prose ul, .prose ol { max-width: 65ch; padding-left: 22px; text-wrap: pretty; line-height: 1.75; }
.prose li { margin: 12px 0; }
.prose strong { color: var(--text); }

/* keep headings legible where they overlap the collage veil */
.breadcrumb, .section-head h2, section > .muted, .prose h2 {
  text-shadow: 0 1px 10px rgba(245, 244, 242, 0.95), 0 0 4px rgba(245, 244, 242, 0.9);
}

/* ---------- guide & steps grids ---------- */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.guide-card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-1);
}
.guide-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.guide-card h3::before {
  content: '';
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--primary);
  flex: none;
}
.guide-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.step-card { position: relative; padding-top: 22px; }
.step-num {
  position: absolute;
  top: -13px;
  left: 18px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
}

/* two-column prose band */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.two-col h2 { margin-top: 0; }

/* faq two-column */
.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  align-items: start;
}

/* ---------- NPS survey popup ---------- */
#nps-root { position: fixed; z-index: var(--z-modal); bottom: 16px; right: 16px; left: 16px; }
@media (min-width: 640px) {
  #nps-root { left: auto; right: 24px; bottom: 24px; width: 380px; }
}
.nps-card {
  background: var(--glass-strong);
  backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: npsFadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes npsFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.nps-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 16px;
  background: linear-gradient(100deg, rgba(234, 88, 12, 0.14), rgba(5, 150, 105, 0.1));
  border-bottom: 1px solid var(--border);
}
.nps-head p { margin: 0; font-weight: 700; font-size: 14px; color: var(--text); flex: 1; }
.nps-min {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 4px;
  border-radius: 999px;
  display: flex;
}
.nps-min:hover { color: var(--text); background: rgba(0, 0, 0, 0.06); }
.nps-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.nps-score { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.nps-num {
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-body);
  font-weight: 700;
  font-size: 12px;
  transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.nps-num:hover { background: var(--surface-2); transform: scale(1.06); }
.nps-num.sel-low { background: #fee2e2; border-color: #fca5a5; color: var(--destructive); transform: scale(1.08); }
.nps-num.sel-high { background: #fef3c7; border-color: #fcd34d; color: #92400e; transform: scale(1.08); }
.nps-scale { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.nps-tags { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--border); padding-top: 12px; }
.nps-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: all var(--t-fast);
}
.nps-tag:hover { color: var(--text); border-color: var(--border-strong); }
.nps-tag.active { background: var(--primary-tint); border-color: var(--primary); color: var(--primary-hover); }
.nps-actions { display: flex; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 12px; }
.nps-submit {
  padding: 9px 18px;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 10px rgba(234, 88, 12, 0.3);
  transition: transform var(--t-fast), background var(--t-fast);
}
.nps-submit:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); }
.nps-submit:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; box-shadow: none; }
.nps-success { padding: 26px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.nps-success-emoji { font-size: 28px; }
.nps-success strong { font-family: var(--font-display); color: var(--text); }
.nps-success p { margin: 0; font-size: 12px; color: var(--muted); }
.nps-fab {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-display);
  box-shadow: var(--shadow-2);
  transition: transform var(--t-fast);
}
.nps-fab:hover { transform: translateY(-2px); }
.nps-fab svg { color: var(--primary); }

/* ---------- motion & responsive ---------- */
.u-hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 640px) {
  h1 { font-size: 26px; }
  .data-note { display: none; }
  .planner-banner { flex-direction: column; align-items: flex-start; }
  .tabs { display: flex; }
  .tab-btn { flex: 1; justify-content: center; padding: 12px 8px; font-size: 14px; }
  .breed-row { gap: 8px; }
  .breed-row .equals { flex-basis: 100%; text-align: center; line-height: 1; }
  .breed-row .result-slot { justify-content: center; }
  .pal-select, .result-hint { width: 96px; height: 96px; }
  .result-slot .pal-chip { width: 96px; }
  .hero { padding: 36px 0 16px; }
  .two-col, .faq-grid { grid-template-columns: 1fr; }
  /* Apple HIG 44px touch targets */
  .mini-btn, .copy-btn { min-height: 44px; align-items: center; }
  /* deep breeding trees must fit small screens */
  .tree-children { margin-left: 14px; padding-left: 14px; }
  .tree .pal-chip { width: 58px; font-size: 10px; }
  .tree .pal-chip img { width: 32px; height: 32px; }
  /* picker modal full-width on phones */
  .picker-overlay { padding: 0; align-items: stretch; }
  .picker-modal { max-width: none; max-height: none; height: 100%; border-radius: 0; }
  .picker-sort { width: 118px; }
  /* pal header card stacks cleanly */
  .pal-header { align-items: flex-start; gap: 14px; }
  .pal-header img { width: 72px; height: 72px; }
  .card { padding: 16px; }
}
