/* ============================================================
   EP Decoded — design system
   ============================================================ */

:root {
  --espresso: #16110e;
  --espresso-2: #211813;
  --espresso-3: #2c211b;
  --cream: #f7f1e7;
  --cream-2: #efe5d6;
  --cream-3: #e5d7c4;
  --paper: #fbf7f0;
  --ink: #1c1714;
  --muted: #71645a;
  --muted-2: #9a8b7d;
  --copper: #bd6f46;
  --copper-deep: #9a4f2c;
  --amber: #d9a441;
  --sage: #5c6b57;
  --line: rgba(28, 23, 20, .13);
  --line-dark: rgba(247, 241, 231, .14);
  --radius: 3px;
  --radius-lg: 6px;
  --shadow: 0 24px 60px -30px rgba(28, 23, 20, .45);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --max: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll { overflow: hidden; }

::selection { background: var(--copper); color: var(--cream); }

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.02;
  margin: 0;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

code, .mono { font-family: var(--font-mono); font-size: .92em; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}

/* ---------- buttons ---------- */

.btn {
  --btn-bg: var(--copper);
  --btn-fg: var(--cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { background: var(--copper-deep); transform: translateY(-1px); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 12px; }
.btn-primary { background: var(--copper); color: var(--cream); }
.btn-primary:hover { background: var(--copper-deep); }
.btn-ghost {
  background: transparent;
  color: var(--cream);
  border-color: rgba(247, 241, 231, .32);
}
.btn-ghost:hover { background: rgba(247, 241, 231, .08); border-color: rgba(247, 241, 231, .55); }
.btn-ghost-dark {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost-dark:hover { background: rgba(28, 23, 20, .05); }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  font-size: 15px;
  line-height: 1;
  transition: background .2s, border-color .2s;
}
.icon-btn:hover { background: rgba(28, 23, 20, .06); }
.icon-btn.light { color: var(--cream); border-color: var(--line-dark); }
.icon-btn.light:hover { background: rgba(247, 241, 231, .1); }

/* ---------- shared type ---------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 22px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow.light { color: rgba(247, 241, 231, .62); }
.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 0 0 3px rgba(189, 111, 70, .16);
}

.section {
  padding-block: clamp(72px, 9vw, 128px);
  position: relative;
}

.section-head { max-width: 720px; margin-bottom: 24px; }
.section-head.split {
  max-width: none;
  display: block;
}
.section-head h2 {
  font-family: var(--font-sans);
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -.02em;
  font-weight: 600;
}
.section-head h2 em {
  font-style: normal;
  font-weight: 600;
  color: inherit;
}
.section-lede {
  max-width: 620px;
  margin-top: 22px;
  font-size: clamp(15px, 1.15vw, 17px);
  line-height: 1.7;
  color: var(--muted);
}
.section-lede.narrow { max-width: 440px; margin-top: 0; }
.section-lede code { color: var(--ink); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
}

/* ---------- nav ---------- */

/* ---------- error banner ---------- */
.error-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px var(--gutter);
  background: #7a2b1c;
  color: #ffe9df;
  font-size: 12px;
}
.error-banner button {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
  line-height: 1;
}


.vibe-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}
.vibe {
  height: 28px;
  padding: 0 11px;
  border: 1px dashed rgba(28, 23, 20, .22);
  border-radius: 99px;
  background: transparent;
  font-size: 10.5px;
  color: var(--muted);
  transition: all .18s;
}
.vibe:hover { border-color: var(--copper); color: var(--copper-deep); }
.vibe.is-active {
  background: rgba(189, 111, 70, .12);
  border-color: var(--copper);
  border-style: solid;
  color: var(--copper-deep);
}

.surprise-btn {
  height: 30px;
  padding: 0 14px;
  border: 1px solid var(--copper);
  border-radius: 99px;
  background: transparent;
  color: var(--copper-deep);
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .18s;
}
.surprise-btn:hover { background: var(--copper); color: var(--cream); transform: rotate(-1.2deg); }

/* ---------- card extras ---------- */
.model-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.value-meter {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--copper-deep);
  letter-spacing: .02em;
}
.size-chip {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 3px 6px;
  border-radius: 2px;
  border: 1px solid var(--line);
  color: var(--muted-2);
  white-space: nowrap;
}
.size-chip.size-s { border-color: rgba(92, 107, 87, .45); color: var(--sage); }
.size-chip.size-l { border-color: rgba(189, 111, 70, .45); color: var(--copper-deep); }
.model-card.is-picked {
  animation: pickedPulse .6s ease 2;
  box-shadow: inset 0 0 0 2px var(--copper);
}
@keyframes pickedPulse {
  0%, 100% { transform: none; }
  50% { transform: translateY(-4px); }
}

/* ---------- compare extras ---------- */
.muted-cell { color: rgba(247, 241, 231, .35); font-size: 10.5px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 12px);
  z-index: 120;
  padding: 11px 18px;
  border-radius: 99px;
  background: var(--espresso);
  color: var(--cream);
  border: 1px solid var(--line-dark);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .7);
  font-size: 12px;
  opacity: 0;
  transition: opacity .22s, transform .22s;
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- noscript ---------- */
.noscript-note {
  margin: 90px auto 0;
  max-width: 520px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 13px;
  text-align: center;
}

/* ---------- sources strip ---------- */
.sources-strip { padding-block: 54px 46px; }
.sources-grid p { max-width: 42ch; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .lang-switch { order: 5; }
  .surprise-btn { align-self: flex-start; }
}
@media (max-width: 620px) {
  .vibe-bar { gap: 5px; }
}

/* ============================================================
   v3 — compact code lookup, segmented filters, personas
   ============================================================ */

/* ---------- code lookup ---------- */
.lookup {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 12px 16px;
  margin-bottom: 14px;
}
.lookup-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lookup-form label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.lookup-row { display: flex; gap: 6px; }
.lookup-row input {
  width: 180px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(28, 23, 20, .22);
  border-radius: 2px;
  background: var(--cream);
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
}
.lookup-row input:focus { outline: none; border-color: var(--copper); }
.lookup-row .btn { white-space: nowrap; flex: 0 0 auto; }
.lookup-out { min-width: 0; }
.filter-foot .lookup-out { flex: 1 1 260px; }
.lookup-hit {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.lookup-hit .mono { color: var(--ink); font-size: 12px; }
.lookup-hit strong { color: var(--ink); font-weight: 500; }
.lookup-miss {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  padding-left: 10px;
  border-left: 2px solid var(--copper);
}
.lookup-miss strong { color: var(--ink); }

/* ---------- segmented controls ---------- */
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  max-width: 100%;
}
.seg button {
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  padding: 6px 11px;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  transition: background .16s, color .16s;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--cream-2); color: var(--ink); }
.seg button.is-active { background: var(--ink); color: var(--cream); }

/* ---------- drinks row ---------- */
.drink-chip { font-size: 10.5px; }
.drink-chip.is-active { background: var(--copper); border-color: var(--copper); color: var(--cream); }
.filter-hint { font-size: 9.5px; color: var(--muted-2); }

/* ---------- vibe strip (above the filter bar) ---------- */
.vibe-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.vibe {
  height: 30px;
  padding: 0 13px;
  border: 1px dashed rgba(28, 23, 20, .24);
  border-radius: 99px;
  background: transparent;
  font-size: 11px;
  color: var(--muted);
  transition: all .18s;
}
.vibe:hover { border-color: var(--copper); color: var(--copper-deep); transform: translateY(-1px); }
.vibe.is-active {
  background: rgba(189, 111, 70, .12);
  border-color: var(--copper);
  border-style: solid;
  color: var(--copper-deep);
}

/* ---------- personas + drink icons on cards ---------- */
.persona {
  position: absolute;
  bottom: 4px;
  left: 6px;
  padding: 2px 7px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--cream);
  transform: rotate(-2.5deg);
  z-index: 2;
}
.persona-budget   { background: var(--sage); }
.persona-milk     { background: var(--copper); }
.persona-quiet    { background: #4b5d6b; }
.persona-party    { background: #7a3b6b; }
.persona-screen   { background: var(--ink); }
.persona-flagship { background: var(--copper-deep); }
.persona-plain    { background: var(--muted-2); }

.drink-icons {
  position: absolute;
  right: 6px;
  bottom: 4px;
  display: flex;
  gap: 3px;
  z-index: 2;
}
.drink-icon {
  font-size: 12px;
  line-height: 1;
  filter: saturate(.8);
  opacity: .9;
}

/* ---------- responsive ---------- */
@media (max-width: 620px) {
  .lookup-row input { width: 100%; }
  .lookup { flex-direction: column; align-items: stretch; }
  .seg { flex-wrap: wrap; }
  .seg button { flex: 1 1 auto; }
}

/* ============================================================
   v4 — single filter panel
   ============================================================ */

.filterbar {
  border: 1px solid var(--line);
  background: var(--paper);
  margin-bottom: 22px;
}
.filter-head {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--cream-2);
}
.filter-head-title {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 0 0 auto;
}
.filter-head .vibe-bar { margin: 0; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px 22px;
  padding: 18px;
  align-items: start;
}
.filter-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.filter-block-wide { grid-column: 1 / -1; }
.filter-block .search-wrap {
  max-width: none;
  width: 100%;
  flex: 0 0 auto;          /* column flex: reset the old flex-basis (was a height!) */
}
.filter-block .search-wrap input { width: 100%; }
.filter-block input[type="range"] { width: 100%; }
.filter-block select {
  width: 100%;
  height: 34px;
  padding: 0 26px 0 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  font-size: 11.5px;
  cursor: pointer;
}
.filter-block select:focus { outline: none; border-color: var(--copper); }
.filter-block .filter-quick { flex: 1 1 auto; }
.filter-block .chips { flex-wrap: wrap; }

.filter-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--cream-2);
}
.filter-foot .lookup-out { flex: 1 1 320px; }
.filter-foot-actions { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.filter-foot .reset-btn { margin-left: 0; }

/* series chips get a count so the split is obvious */
#seriesChips .chip { font-family: var(--font-mono); font-size: 10px; }
#seriesChips .chip .cnt { opacity: .55; margin-left: 5px; }

@media (max-width: 620px) {
  .filter-grid { grid-template-columns: 1fr; padding: 14px; }
  .filter-foot { flex-direction: column; align-items: stretch; }
}


/* ---------- fun filter: colour swatches ---------- */
.color-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--line);
  flex: 0 0 auto;
}
.color-chip.is-active .color-dot {
  box-shadow: 0 0 0 2px var(--copper);
}

/* ---------- lang switch + compare button in filter head ---------- */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  flex: 0 0 auto;
}
.lang-switch button {
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.lang-switch button:hover { color: var(--ink); background: var(--cream-2); }
.lang-switch button.is-active { background: var(--ink); color: var(--cream); }

.nav-compare {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  flex: 0 0 auto;
}
.nav-compare:hover { background: var(--cream-2); border-color: var(--ink); }
.nav-compare .count {
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--copper);
  color: var(--cream);
  font-size: 10px;
}

/* ---------- restored from backup ---------- */
/* ---------- models / filters ---------- */

.models-section {
  background: var(--cream);
  /* the top bar is static, so it scrolls away - no clearance needed */
  padding-top: clamp(26px, 3.5vw, 44px);
}
.filterbar {
  border: 1px solid var(--line);
  background: var(--paper);
  margin-bottom: 26px;
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  flex-wrap: wrap;
}
.filter-row-top { border-bottom: 1px solid var(--line); }
.search-wrap {
  position: relative;
  flex: 1 1 220px;
  max-width: 300px;
}
.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted-2);
}
.search-wrap input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  font-size: 12.5px;
}
.search-wrap input:focus { outline: none; border-color: var(--copper); }
.filter-quick { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 420px; }
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  font-size: 11px;
  color: var(--muted);
  transition: color .18s, border-color .18s, background .18s;
}
.toggle .tick {
  width: 11px;
  height: 11px;
  border: 1px solid var(--line);
  border-radius: 1px;
  position: relative;
  flex: 0 0 auto;
}
.toggle .tick::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 0px;
  width: 5px;
  height: 8px;
  border-right: 1.5px solid var(--cream);
  border-bottom: 1.5px solid var(--cream);
  transform: rotate(40deg) scale(0);
  transition: transform .18s;
}
.toggle:hover { border-color: rgba(28, 23, 20, .3); color: var(--ink); }
.toggle[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}
.toggle[aria-pressed="true"] .tick { background: var(--copper); border-color: var(--copper); }
.toggle[aria-pressed="true"] .tick::after { transform: rotate(40deg) scale(1); }
.sort-wrap { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.sort-wrap label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.sort-wrap select {
  height: 34px;
  padding: 0 26px 0 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  font-size: 11.5px;
  cursor: pointer;
}
.filter-row-bottom { gap: 22px; }
.chips-wrap, .price-wrap { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.filter-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  font-size: 10.5px;
  color: var(--muted);
  transition: all .18s;
}
.chip:hover { border-color: rgba(28,23,20,.32); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.range-wrap { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.range-wrap label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
}
.range-wrap output {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  margin-left: 4px;
  background: var(--cream-3);
  color: var(--ink);
  border-radius: 2px;
  font-size: 10px;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 3px;
  background: var(--cream-3);
  border-radius: 9px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--copper);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--copper);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--copper);
  border: 2px solid var(--paper);
  cursor: pointer;
}
.reset-btn {
  margin-left: auto;
  border: 0;
  background: transparent;
  font-size: 11px;
  color: var(--copper-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.reset-btn:hover { color: var(--ink); }
.results-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px 16px;
  font-size: 12.5px;
  color: var(--muted);
}
.results-line strong { color: var(--ink); font-weight: 600; }
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.view-toggle button {
  height: 30px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  font-size: 10.5px;
  color: var(--muted);
}
.view-toggle button.active { background: var(--ink); color: var(--cream); }

.model-grid {
  display: grid;
  /* wraps on its own: 3 wide on desktop, 2 on a tablet, 1 on a phone */
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.model-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  padding: 18px 20px 16px;
  min-height: 400px;
  transition: background .2s, transform .2s;
  animation: cardReveal .35s both;
}
@keyframes cardReveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.model-card:hover { background: #fffaf3; z-index: 2; box-shadow: 0 22px 44px -34px rgba(28,23,20,.5); }
.model-card.is-selected { background: #fff8ee; box-shadow: inset 0 0 0 1px var(--copper); z-index: 3; }
.model-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.model-code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--ink);
}
.model-series {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 4px;
}
.model-name {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin-bottom: 2px;
}
.model-color {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.14);
  flex: 0 0 auto;
}
.model-art {
  height: 118px;
  display: grid;
  place-items: center;
  margin: 4px 0 8px;
  position: relative;
}
.model-art::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 46%;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(28,23,20,.16), transparent 70%);
}
.model-art svg { height: 112px; width: auto; }
.model-drinks {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 10px 0 8px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.model-drinks strong {
  font-family: var(--font-display);
  font-size: 34px;
  line-height: .9;
  font-weight: 400;
}
.model-drinks span { font-size: 10px; color: var(--muted); line-height: 1.3; }
.model-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 12px; min-height: 22px; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--cream-2);
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}
.tag.tag-copper { background: rgba(189, 111, 70, .12); color: var(--copper-deep); }
.tag.tag-outline { background: transparent; border: 1px solid var(--line); }
.model-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.model-price {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}
.model-price strong { color: var(--ink); font-weight: 500; }
.model-actions { display: flex; align-items: center; gap: 6px; }
.mini-btn {
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--muted);
  transition: all .18s;
}
.mini-btn:hover { border-color: var(--ink); color: var(--ink); }
.mini-btn.is-on { background: var(--copper); border-color: var(--copper); color: var(--cream); }
.compare-quick {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  font-size: 13px;
  line-height: 1;
  color: var(--muted);
  opacity: .55;
  transition: all .18s;
}
.model-card:hover .compare-quick, .compare-quick.is-on { opacity: 1; }
.compare-quick:hover { border-color: var(--copper); color: var(--copper); }
.compare-quick.is-on { background: var(--copper); border-color: var(--copper); color: var(--cream); }
.model-flag {
  position: absolute;
  top: 0;
  right: 0;
  padding: 3px 7px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.model-flag.flag-value { background: var(--sage); }
.model-flag.flag-flagship { background: var(--copper); }

/* table view */

.table-view { overflow-x: auto; border: 1px solid var(--line); background: var(--paper); }
.spec-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 980px; }
.spec-table th, .spec-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.spec-table thead th {
  position: sticky;
  top: 0;
  background: var(--cream-2);
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.spec-table tbody tr:hover { background: #fffaf3; }
.spec-table td:first-child {
  font-family: var(--font-mono);
  font-size: 11px;
  position: sticky;
  left: 0;
  background: inherit;
  z-index: 1;
}
.spec-table .tbl-model { display: flex; align-items: center; gap: 8px; }
.spec-table .tbl-model button {
  border: 0; background: transparent; padding: 0; text-align: left;
  font-family: var(--font-mono); font-size: 11px;
}
.spec-table .tbl-model button:hover { color: var(--copper-deep); text-decoration: underline; }
.spec-table .dot-yes { color: var(--sage); font-weight: 600; }
.spec-table .dot-no { color: var(--muted-2); }

.empty-state {
  text-align: center;
  padding: 70px 20px;
  border: 1px dashed rgba(28,23,20,.22);
  background: var(--paper);
}
.empty-cup { width: 54px; margin: 0 auto 18px; color: var(--copper); }
.empty-state h3 { font-size: 28px; margin-bottom: 8px; }
.empty-state p { max-width: 430px; margin: 0 auto 20px; font-size: 13px; color: var(--muted); }


/* ---------- sources / footer ---------- */

.sources { background: var(--cream); padding-block: 70px 60px; }
.sources-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 34px; }
.sources-head h2 { font-size: 34px; }
.sources-head p { font-size: 12px; color: var(--muted); margin: 0; }
.sources-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
.sources-grid h3 {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
}
.sources-grid p { font-size: 11.5px; line-height: 1.65; color: var(--muted); }
.source-links { display: flex; flex-wrap: wrap; gap: 22px; padding: 22px 0; }
.source-links a { font-size: 11.5px; color: var(--copper-deep); }
.disclaimer { font-size: 10px; color: var(--muted-2); max-width: 800px; line-height: 1.6; }
.site-foot { background: var(--espresso); color: var(--cream); padding: 40px 0; }
.foot-grid { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot-brand p { font-size: 11px; color: rgba(247,241,231,.5); margin: 4px 0 0; }
.foot-links { display: flex; gap: 20px; }
.foot-links a { font-size: 11px; color: rgba(247,241,231,.62); text-decoration: none; }
.foot-links a:hover { color: var(--cream); }
.foot-meta { font-size: 10px; color: rgba(247,241,231,.4); margin: 0; }
.foot-meta a { color: rgba(247,241,231,.6); }


/* ---------- compare tray ---------- */

.compare-tray {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  background: var(--espresso-2);
  color: var(--cream);
  border-top: 1px solid rgba(247,241,231,.14);
  box-shadow: 0 -20px 50px -30px rgba(0,0,0,.8);
  animation: trayIn .3s both;
}
@keyframes trayIn { from { transform: translateY(100%); } to { transform: none; } }
.compare-tray-inner {
  max-width: var(--max);
  margin-inline: auto;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  gap: 20px;
}
.compare-tray-label { display: flex; flex-direction: column; flex: 0 0 auto; }
.compare-tray-label .mono { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--copper); }
.compare-tray-label span:last-child { font-size: 10px; color: rgba(247,241,231,.45); }
.compare-slots { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.compare-slot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(247,241,231,.2);
  background: transparent;
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 10px;
}
.compare-slot .x { color: rgba(247,241,231,.5); font-family: var(--font-sans); }
.compare-slot:hover .x { color: var(--cream); }
.compare-slot.empty {
  border-style: dashed;
  color: rgba(247,241,231,.28);
  font-family: var(--font-sans);
  font-size: 9.5px;
}
.compare-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.tray-clear { border: 0; background: transparent; color: rgba(247,241,231,.5); font-size: 10px; text-decoration: underline; text-underline-offset: 2px; }
.tray-clear:hover { color: var(--cream); }


/* ---------- drawer ---------- */

.drawer-backdrop, .modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(16, 12, 10, .55);
  backdrop-filter: blur(3px);
  animation: fadeIn .25s both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.detail-drawer {
  position: fixed;
  z-index: 75;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(540px, 100vw);
  background: var(--cream);
  box-shadow: -30px 0 80px -30px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  animation: drawerIn .32s cubic-bezier(.2,.7,.2,1) both;
}

.detail-drawer[hidden],
.compare-modal[hidden],
.drawer-backdrop[hidden],
.modal-backdrop[hidden],
.compare-tray[hidden] {
  display: none !important;
}
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: none; } }
.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.drawer-top .mono { font-size: 12px; letter-spacing: .03em; }
.drawer-body { overflow-y: auto; padding: 26px 24px 50px; }
.drawer-art { height: 200px; display: grid; place-items: center; background: var(--cream-2); margin: -26px -24px 24px; border-bottom: 1px solid var(--line); }
.drawer-art svg { height: 170px; width: auto; }
.drawer-kicker { font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--copper-deep); margin-bottom: 6px; }
.drawer-title { font-family: var(--font-display); font-size: 38px; line-height: 1.02; letter-spacing: -.03em; margin-bottom: 4px; }
.drawer-sub { font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.drawer-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 22px; }
.drawer-section { margin-top: 24px; }
.drawer-section h3 {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.drawer-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.drawer-specs div { background: var(--paper); padding: 9px 11px; }
.drawer-specs span { display: block; font-size: 8.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); margin-bottom: 1px; }
.drawer-specs strong { font-size: 12px; font-weight: 500; }
.drink-list { display: flex; flex-wrap: wrap; gap: 5px; }
.drink-list span { padding: 4px 8px; background: var(--cream-2); font-size: 10.5px; color: var(--muted); }
.drawer-copy { font-size: 13px; line-height: 1.7; color: var(--muted); }
.drawer-copy strong { color: var(--ink); }
.drawer-warning {
  margin-top: 18px;
  padding: 13px 14px;
  background: rgba(189,111,70,.08);
  border-left: 2px solid var(--copper);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}
.drawer-actions { display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.drawer-source { margin-top: 22px; font-size: 9px; color: var(--muted-2); word-break: break-all; }
.drawer-source a { color: var(--copper-deep); }


/* ---------- compare modal ---------- */

.compare-modal {
  position: fixed;
  z-index: 80;
  inset: 2.5vh 2.5vw;
  background: var(--espresso);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,.8);
  animation: modalIn .3s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.99); } to { opacity: 1; transform: none; } }
.compare-modal-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line-dark);
  flex: 0 0 auto;
  flex-wrap: wrap;
}
.compare-modal-head h2 { font-size: clamp(28px, 3.4vw, 44px); }
.compare-modal-head .eyebrow { margin-bottom: 8px; }
.compare-modal-tools { display: flex; align-items: center; gap: 18px; }
.diff-toggle { display: flex; align-items: center; gap: 7px; font-size: 11px; color: rgba(247,241,231,.66); cursor: pointer; }
.diff-toggle input { accent-color: var(--copper); }
.compare-modal-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 0 28px 34px; }
/* hint that the comparison table scrolls sideways on small screens */
.swipe-hint {
  display: none;
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: rgba(247, 241, 231, .5);
}
.compare-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.compare-table th, .compare-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-dark);
  font-size: 12px;
  vertical-align: top;
}
.compare-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--espresso);
  padding-top: 20px;
  padding-bottom: 16px;
  vertical-align: bottom;
}
.compare-table thead th:first-child { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: rgba(247,241,231,.4); font-weight: 400; }
.compare-model-code { display: block; font-family: var(--font-mono); font-size: 13px; color: var(--cream); }
.compare-model-name { display: block; font-size: 10px; color: rgba(247,241,231,.45); margin-top: 2px; }
.compare-table tbody th {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(247,241,231,.45);
  font-weight: 400;
  width: 190px;
  /* keep the row label on screen while the table is swiped sideways */
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--espresso);
  box-shadow: 1px 0 0 rgba(247,241,231,.14);
}
.compare-table td { color: rgba(247,241,231,.82); }
.compare-table td.is-best { color: var(--cream); background: rgba(189,111,70,.12); }
.compare-table td.is-best::after { content: var(--best-label, "best"); display: inline-block; margin-left: 7px; font-family: var(--font-mono); font-size: 7px; letter-spacing: .1em; text-transform: uppercase; color: var(--copper); vertical-align: 1px; }
.compare-table .yes { color: #a9c39f; }
.compare-table .no { color: rgba(247,241,231,.3); }
.compare-empty { padding: 60px 20px; text-align: center; color: rgba(247,241,231,.5); font-size: 13px; }
.compare-table tr.is-hidden { display: none; }
.compare-drinks { display: flex; flex-wrap: wrap; gap: 4px; }
.compare-drinks span { padding: 2px 5px; background: rgba(247,241,231,.07); font-size: 9.5px; color: rgba(247,241,231,.7); }


/* ---------- language switch ---------- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 99px;
  overflow: hidden;
  flex: 0 0 auto;
}
.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  padding: 6px 9px;
  transition: background .18s, color .18s;
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button.is-active { background: var(--copper); color: var(--cream); }
.site-head.scrolled .lang-switch { border-color: rgba(247, 241, 231, .26); }
.site-head.scrolled .lang-switch button { color: rgba(247, 241, 231, .6); }
.site-head.scrolled .lang-switch button:hover { color: var(--cream); }
.site-head.scrolled .lang-switch button.is-active { color: var(--cream); }


/* ---------- selects in the filter bar ---------- */
.select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.select-wrap label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
}
.select-wrap select {
  height: 30px;
  max-width: 190px;
  padding: 0 24px 0 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}
.select-wrap select:focus { outline: none; border-color: var(--copper); }


/* ---------- extra row: hardware filters, vibes, surprise ---------- */
.filter-row-extra {
  border-top: 1px solid var(--line);
  gap: 16px;
  align-items: flex-start;
}
.more-filters { flex: 0 1 auto; }
.more-filters summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0;
}
.more-filters summary::-webkit-details-marker { display: none; }
.more-filters summary::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 10px;
  line-height: 1;
}
.more-filters[open] summary::before { content: "–"; }
.more-filters .filter-quick { padding-top: 10px; }

.vibe-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}
.vibe {
  height: 28px;
  padding: 0 11px;
  border: 1px dashed rgba(28, 23, 20, .22);
  border-radius: 99px;
  background: transparent;
  font-size: 10.5px;
  color: var(--muted);
  transition: all .18s;
}
.vibe:hover { border-color: var(--copper); color: var(--copper-deep); }
.vibe.is-active {
  background: rgba(189, 111, 70, .12);
  border-color: var(--copper);
  border-style: solid;
  color: var(--copper-deep);
}

.surprise-btn {
  height: 30px;
  padding: 0 14px;
  border: 1px solid var(--copper);
  border-radius: 99px;
  background: transparent;
  color: var(--copper-deep);
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .18s;
}
.surprise-btn:hover { background: var(--copper); color: var(--cream); transform: rotate(-1.2deg); }


/* ---------- segmented controls ---------- */
.filter-row-segments {
  border-bottom: 1px solid var(--line);
  gap: 22px;
  align-items: flex-start;
}
.seg-group { display: flex; flex-direction: column; gap: 6px; }
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  max-width: 100%;
}
.seg button {
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  padding: 6px 11px;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  transition: background .16s, color .16s;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--cream-2); color: var(--ink); }
.seg button.is-active { background: var(--ink); color: var(--cream); }


/* ---------- drinks row ---------- */
.filter-row-drinks { gap: 22px; align-items: flex-start; }
.drink-filters { display: flex; flex-direction: column; gap: 7px; flex: 1 1 320px; }
.drink-chip { font-size: 10.5px; }
.drink-chip.is-active { background: var(--copper); border-color: var(--copper); color: var(--cream); }
.filter-hint { font-size: 9.5px; color: var(--muted-2); }


/* ---------- vibe strip (above the filter bar) ---------- */
.vibe-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.vibe {
  height: 30px;
  padding: 0 13px;
  border: 1px dashed rgba(28, 23, 20, .24);
  border-radius: 99px;
  background: transparent;
  font-size: 11px;
  color: var(--muted);
  transition: all .18s;
}
.vibe:hover { border-color: var(--copper); color: var(--copper-deep); transform: translateY(-1px); }
.vibe.is-active {
  background: rgba(189, 111, 70, .12);
  border-color: var(--copper);
  border-style: solid;
  color: var(--copper-deep);
}


/* ---------- personas + drink icons on cards ---------- */
.persona {
  position: absolute;
  bottom: 4px;
  left: 6px;
  padding: 2px 7px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--cream);
  transform: rotate(-2.5deg);
  z-index: 2;
}
.persona-budget   { background: var(--sage); }
.persona-milk     { background: var(--copper); }
.persona-quiet    { background: #4b5d6b; }
.persona-party    { background: #7a3b6b; }
.persona-screen   { background: var(--ink); }
.persona-flagship { background: var(--copper-deep); }
.persona-plain    { background: var(--muted-2); }

.drink-icons {
  position: absolute;
  right: 6px;
  bottom: 4px;
  display: flex;
  gap: 3px;
  z-index: 2;
}
.drink-icon {
  font-size: 12px;
  line-height: 1;
  filter: saturate(.8);
  opacity: .9;
}



/* ---------- model-code lookup spans two columns ---------- */
.filter-block-span2 { grid-column: span 2; }
@media (max-width: 620px) {
  .filter-block-span2 { grid-column: 1 / -1; }
}

/* ---------- simple top bar (static, not sticky, no menus) ---------- */
.top-bar {
  position: static;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.top-bar .brand-text {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: -.01em;
  color: var(--ink);
}
.top-bar .brand-text span { color: var(--copper); font-style: italic; }

/* ============================================================
   consolidated filter groups
   ============================================================ */

.filter-groups {
  display: block;
}

.filter-group {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.filter-group:last-child { border-bottom: 0; }

.group-label {
  flex: 0 0 78px;
  padding-top: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.group-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 26px;
  align-items: flex-start;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.filter-item-grow { flex: 1 1 260px; max-width: 420px; }
.filter-item-wide { flex: 1 1 100%; }
.filter-item-range { flex: 0 1 260px; }
.filter-item-inline { flex: 0 0 auto; justify-content: flex-end; padding-top: 5px; }

.filter-item .filter-label {
  padding-top: 0;
  display: block;
}
.filter-item input[type="range"] { width: 100%; }
.filter-item select {
  width: 100%;
  min-width: 190px;
  height: 34px;
  padding: 0 26px 0 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  font-size: 11.5px;
  cursor: pointer;
}
.filter-item select:focus { outline: none; border-color: var(--copper); }
.filter-item .search-wrap { max-width: none; width: 100%; flex: 0 0 auto; }
.filter-item .search-wrap input { width: 100%; }
.filter-item .chips { flex-wrap: wrap; }
.filter-item .lookup-row { display: flex; gap: 6px; }
.filter-item .lookup-out { min-width: 0; }
.filter-item .filter-quick { flex: 1 1 auto; }

.filter-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--cream-2);
}

@media (max-width: 760px) {
  .filter-group { flex-direction: column; gap: 8px; padding: 12px 14px; }
  .group-label { flex: 0 0 auto; padding-top: 0; }
  .group-body { gap: 12px 18px; }
  .filter-item-grow { max-width: none; }
}

/* toggle rows inherit the group label; no inner label needed */
.filter-item .filter-quick { margin-top: 0; }

/* ============================================================
   legend
   ============================================================ */

.legend-section { background: var(--cream); }
.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 26px 34px;
}
.legend-col h3,
.legend-notes h3 {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 12px;
}
.legend-list { margin: 0; }
.legend-list > div {
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.legend-list > div:first-child { border-top: 0; padding-top: 0; }
.legend-list dt {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.legend-list dd {
  margin: 3px 0 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}
.legend-count {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .06em;
  color: var(--copper);
  border: 1px solid rgba(189, 111, 70, .35);
  border-radius: 2px;
  padding: 1px 5px;
  white-space: nowrap;
}
.legend-notes {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.legend-list-wide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0 34px;
}
@media (max-width: 620px) {
  .legend-list-wide { grid-template-columns: 1fr; }
}

/* ---------- card footer must never push the page wide ---------- */
.model-foot { min-width: 0; }
.model-price { min-width: 0; overflow-wrap: anywhere; }
.model-actions { flex: 0 0 auto; min-width: 0; }
@media (max-width: 460px) {
  .model-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .model-actions {
    justify-content: space-between;
    width: 100%;
  }
  .model-actions .size-chip { flex: 0 0 auto; }
  .model-actions .mini-btn { flex: 1 1 auto; }
}

/* ---------- page title: a label, not a billboard ---------- */
.page-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

/* ---------- long tags must wrap instead of pushing the page wide ---------- */
.model-tags { max-width: 100%; }
.model-tags .tag {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}
@media (max-width: 460px) {
  .model-tags .tag { font-size: 9px; padding: 3px 6px; }
}

/* ============================================================
   MOBILE & TOUCH LAYER  (applies at <= 860px)
   ------------------------------------------------------------
   Everything here is a phone-first override of the desktop rules
   above. Nothing changes the markup or the behaviour of app.js.
   ============================================================ */

@media (max-width: 860px) {

  :root { --gutter: 16px; }

  html { scroll-padding-top: 16px; }

  /* ------------------------------------------------------------
     1. Type floor — body copy 16px, labels 14px, nothing tinier
     ------------------------------------------------------------ */
  body { font-size: 16px; }

  .eyebrow,
  .page-title,
  .filter-label,
  .group-label,
  .filter-head-title,
  .chip,
  .seg button,
  .toggle,
  .vibe,
  .mini-btn,
  .nav-compare,
  .view-toggle button,
  .lang-switch button,
  .model-series,
  .model-code,
  .model-color,
  .model-price,
  .value-meter,
  .size-chip,
  .tag,
  .model-drinks span,
  .results-line,
  .lookup-hit,
  .lookup-miss,
  .compare-tray-label .mono,
  .compare-tray-label span:last-child,
  .compare-slot,
  .diff-toggle,
  .legend-count,
  .drawer-kicker,
  .drawer-section h3,
  .drawer-specs span,
  .sources-grid h3,
  .sources-head p,
  .foot-brand p,
  .foot-meta,
  .error-banner { font-size: 14px; }

  .legend-col h3,
  .legend-notes h3 { font-size: 14px; }

  .section-lede,
  .legend-list dd,
  .legend-list dt,
  .drawer-copy,
  .drawer-warning,
  .drawer-sub,
  .drink-list span,
  .sources-grid p,
  .source-links a,
  .empty-state p,
  .noscript-note,
  .disclaimer,
  .lookup-out { font-size: 16px; }

  .drawer-specs strong { font-size: 16px; }
  .compare-table th,
  .compare-table td { font-size: 15px; }
  .compare-table tbody th { font-size: 13px; }
  .compare-model-name,
  .compare-drinks span,
  .muted-cell { font-size: 13px; }

  .section { padding-block: clamp(48px, 10vw, 72px); }
  .section-head h2 { font-size: 26px; }
  .sources-head h2 { font-size: 26px; }

  /* ------------------------------------------------------------
     2. Top bar — brand + language must fit on 360px
     ------------------------------------------------------------ */
  .top-bar-inner {
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .top-bar .brand-text { font-size: 19px; }
  .lang-switch button {
    height: 40px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .error-banner {
    font-size: 14px;
    padding: 10px var(--gutter);
  }
  .error-banner button {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  /* ------------------------------------------------------------
     3. Filter panel head — FILTERS / COMPARE / mood presets
     ------------------------------------------------------------ */
  .filter-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
  }
  .filter-head-title { grid-column: 1; grid-row: 1; }
  .nav-compare {
    grid-column: 2;
    grid-row: 1;
    height: 40px;
    padding: 0 14px;
    font-size: 14px;
  }
  .nav-compare .count {
    min-width: 22px;
    height: 22px;
    font-size: 14px;
  }
  .vibe-bar {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 8px;
  }
  .vibe {
    height: 40px;
    padding: 0 14px;
    font-size: 14px;
  }

  /* ------------------------------------------------------------
     4. Filter groups — label above the controls, stacked layout
     ------------------------------------------------------------ */
  .filter-group {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
  }
  .group-label {
    flex: 0 0 auto;
    padding-top: 0;
  }
  .group-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 18px;
    align-items: start;
  }
  .filter-item {
    min-width: 0;
    width: 100%;
  }
  .filter-item-grow,
  .filter-item-wide,
  .filter-item-range {
    grid-column: 1 / -1;
    flex: none;
    max-width: none;
  }
  .filter-item-inline {
    grid-column: 1 / -1;
    padding-top: 0;
    justify-content: flex-start;
  }

  /* ------------------------------------------------------------
     5. Segmented controls — wrap into a group of tappable pills
        (nothing is clipped, nothing hides behind a scroll)
     ------------------------------------------------------------ */
  .seg {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--cream-2);
    overflow: visible;
  }
  .seg button {
    flex: 0 1 auto;
    min-height: 40px;
    padding: 6px 14px;
    border: 1px solid transparent;
    border-radius: 99px;
    background: var(--paper);
    font-size: 14px;
    line-height: 1.3;
    white-space: normal;
    text-align: center;
  }
  .seg button:last-child { border-right: 1px solid transparent; }
  .seg button:hover { background: #fffaf3; color: var(--ink); }
  .seg button.is-active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--cream);
  }

  /* ------------------------------------------------------------
     6. Inputs — search, model code, look up button
     ------------------------------------------------------------ */
  .filter-item .search-wrap input {
    height: 46px;
    font-size: 16px;
    padding-left: 40px;
  }
  .search-wrap svg {
    width: 18px;
    height: 18px;
    left: 13px;
  }
  .filter-item .lookup-row {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .filter-item .lookup-row input {
    width: 100%;
    height: 46px;
    font-size: 16px;
  }
  .filter-item .lookup-row .btn {
    width: 100%;
    min-height: 46px;
    font-size: 16px;
  }
  .filter-item select {
    width: 100%;
    min-width: 0;
    height: 46px;
    font-size: 16px;
  }

  /* ------------------------------------------------------------
     7. Chips + quick toggles — 40px tap targets
     ------------------------------------------------------------ */
  .chips { gap: 6px; }
  .chip {
    height: 40px;
    min-height: 40px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
  }
  #seriesChips .chip { font-size: 14px; }
  .color-dot { width: 14px; height: 14px; }
  .filter-quick { gap: 8px; }
  .toggle {
    height: 40px;
    min-height: 40px;
    padding: 0 14px;
    gap: 9px;
    font-size: 14px;
  }
  .toggle .tick { width: 15px; height: 15px; }
  .toggle .tick::after { left: 3px; top: 1px; width: 5px; height: 8px; }

  /* ------------------------------------------------------------
     8. Range slider — real thumb, 32px+ touch area
     ------------------------------------------------------------ */
  .filter-item input[type="range"] {
    width: 100%;
    height: 40px;
    background: transparent;
  }
  .filter-item input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 99px;
    background: var(--cream-3);
  }
  .filter-item input[type="range"]::-webkit-slider-thumb {
    width: 26px;
    height: 26px;
    margin-top: -10px;
    border-radius: 50%;
    background: var(--copper);
    border: 3px solid var(--paper);
    box-shadow: 0 0 0 1px var(--copper), 0 2px 8px rgba(28, 23, 20, .3);
  }
  .filter-item input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 99px;
    background: var(--cream-3);
  }
  .filter-item input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--copper);
    border: 3px solid var(--paper);
    box-shadow: 0 0 0 1px var(--copper);
  }

  /* ------------------------------------------------------------
     9. Filter foot — surprise me / reset all
     ------------------------------------------------------------ */
  .filter-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }
  .filter-foot-actions {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }
  .surprise-btn {
    flex: 1 1 auto;
    height: 44px;
    justify-content: center;
    font-size: 15px;
  }
  .reset-btn {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 2px;
    text-decoration: none;
    font-size: 14px;
  }

  /* ------------------------------------------------------------
     10. Results line + view toggle
     ------------------------------------------------------------ */
  .results-line {
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 0 2px 14px;
  }
  .view-toggle button {
    height: 40px;
    padding: 0 16px;
    font-size: 14px;
  }

  /* ------------------------------------------------------------
     11. Cards — two-up on a tablet, one-up on a phone
     ------------------------------------------------------------ */
  .model-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
    align-content: start;
    padding: 16px;
    min-height: 0;
  }
  .model-flag {
    position: static;
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    align-self: center;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 14px;
    letter-spacing: .04em;
  }
  .compare-quick {
    position: static;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    width: 40px;
    height: 40px;
    font-size: 18px;
    opacity: 1;
  }
  .model-card-top,
  .model-name,
  .model-color,
  .model-art,
  .model-drinks,
  .model-tags,
  .model-foot { grid-column: 1 / -1; }

  .model-name { font-size: 21px; }
  .model-color { margin-bottom: 6px; }
  .model-art {
    height: 132px;
    margin: 6px 0 10px;
  }
  .model-art svg {
    height: 112px;
    width: auto;
    max-width: 100%;
  }
  .model-drinks {
    margin-top: 0;
    padding: 10px 0 8px;
  }
  .model-drinks strong { font-size: 30px; }
  .model-tags {
    min-height: 26px;
    margin: 8px 0 12px;
    gap: 6px;
  }
  .tag {
    font-size: 14px;
    padding: 3px 9px;
    white-space: normal;
    max-width: 100%;
  }
  .model-tags .tag {
    font-size: 14px;
    padding: 3px 9px;
  }
  .model-foot {
    flex-wrap: wrap;
    gap: 10px 12px;
  }
  .model-price { font-size: 14px; }
  .model-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  .model-actions .mini-btn { flex: 0 0 auto; }
  .model-actions .size-chip { flex: 0 0 auto; }
  .size-chip {
    font-size: 14px;
    padding: 5px 9px;
  }
  .mini-btn {
    height: 40px;
    padding: 0 16px;
    font-size: 14px;
  }
  .persona {
    font-size: 14px;
    padding: 3px 8px;
    bottom: 6px;
    left: 8px;
    letter-spacing: .04em;
  }
  .drink-icons { right: 8px; bottom: 6px; gap: 4px; }
  .drink-icon { font-size: 15px; }

  /* ------------------------------------------------------------
     12. Compare tray — must fit on 360px
     ------------------------------------------------------------ */
  .compare-tray-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 12px;
    padding: 10px var(--gutter);
  }
  .compare-tray-label { grid-column: 1; grid-row: 1; }
  .compare-actions {
    grid-column: 2;
    grid-row: 1;
    gap: 10px;
  }
  .compare-slots {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 6px;
  }
  .compare-slot {
    height: 36px;
    padding: 0 10px;
    font-size: 14px;
  }
  .compare-slot.empty { font-size: 13px; }
  .compare-actions .btn {
    min-height: 40px;
    padding: 0 14px;
    font-size: 14px;
  }
  .tray-clear {
    min-height: 40px;
    padding: 0 4px;
    font-size: 14px;
  }

  /* keep the last cards clear of the fixed tray */
  body:has(.compare-tray:not([hidden])) { padding-bottom: 172px; }

  /* ------------------------------------------------------------
     13. Compare modal — full screen, table scrolls inside
     ------------------------------------------------------------ */
  .compare-modal {
    inset: 0;
    border-radius: 0;
  }
  .compare-modal-head {
    padding: 14px;
    gap: 12px;
    align-items: flex-start;
  }
  .compare-modal-head h2 { font-size: 24px; }
  .compare-modal-head .eyebrow { margin-bottom: 6px; }
  .compare-modal-tools {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }
  .diff-toggle {
    font-size: 14px;
    gap: 9px;
    min-height: 40px;
  }
  .diff-toggle input {
    width: 20px;
    height: 20px;
  }
  .icon-btn {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
  }
  .compare-modal-body {
    padding: 0 14px 24px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .compare-table { min-width: 560px; }
  .compare-table th,
  .compare-table td {
    padding: 10px 10px;
    font-size: 15px;
  }
  .compare-table tbody th {
    width: 130px;
    font-size: 13px;
  }
  .compare-model-code { font-size: 14px; }
  .swipe-hint { display: block; }

  /* ------------------------------------------------------------
     14. Detail drawer — full width, close always reachable
     ------------------------------------------------------------ */
  .detail-drawer {
    max-width: 100%;
  }
  .drawer-top {
    padding: 12px 16px;
    background: var(--cream);
  }
  .drawer-top .mono { font-size: 14px; }
  .drawer-body {
    padding: 20px 16px 44px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .drawer-art {
    height: 160px;
    margin: -20px -16px 20px;
  }
  .drawer-art svg {
    height: 140px;
    max-width: 100%;
    width: auto;
  }
  .drawer-title { font-size: 30px; }
  .drawer-specs { grid-template-columns: 1fr; }
  .drawer-actions .btn {
    min-height: 44px;
    font-size: 15px;
  }

  /* ------------------------------------------------------------
     15. Toast — fits and is readable
     ------------------------------------------------------------ */
  .toast {
    left: 12px;
    right: 12px;
    bottom: 16px;
    width: auto;
    max-width: 420px;
    margin-inline: auto;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
    transform: translateY(12px);
  }
  .toast.is-on { transform: translateY(0); }
  body:has(.compare-tray:not([hidden])) .toast { bottom: 170px; }

  /* ------------------------------------------------------------
     16. Legend + sources — one column, badges intact
     ------------------------------------------------------------ */
  .legend-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .legend-list-wide { grid-template-columns: 1fr; }
  .legend-list dt {
    font-size: 16px;
    gap: 6px;
  }
  .legend-count {
    font-size: 14px;
    padding: 2px 7px;
    white-space: nowrap;
  }
  .sources-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .source-links {
    flex-direction: column;
    gap: 4px;
  }
  .source-links a {
    padding: 10px 0;
    border-top: 1px solid var(--line);
  }
  .foot-grid {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .site-foot { padding: 32px 0; }

  /* ------------------------------------------------------------
     17. Empty state
     ------------------------------------------------------------ */
  .empty-state { padding: 44px 16px; }
  .empty-state h3 { font-size: 24px; }
  .empty-state .btn {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
  }
}

/* ------------------------------------------------------------
    One column for the cards on a real phone
    ------------------------------------------------------------ */
@media (max-width: 620px) {
  .model-card { padding: 14px; }
  .model-name { font-size: 20px; }
  .model-art { height: 124px; }
  .model-art svg { height: 104px; }
  .drawer-art { height: 140px; }
  .drawer-art svg { height: 120px; }
  /* the drawer becomes a full-screen sheet on a phone */
  .detail-drawer {
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
  }
}
