/* Lucra — an Actdeck product. Screenshots are the art; everything else gets out
   of the way. Palette and type come straight from the Actdeck brand kit:
   navy #00285F, primary #004AAD, bolt yellow #FFC400, Plus Jakarta Sans. */

/* One variable file covers 400–800 for latin. Self-hosted: a third-party font
   CDN is a render-blocking dependency on every visit. */
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('fonts/plusjakartasans-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #00142E;
  --bg-elev: #001B3D;
  --surface: #002050;
  --surface-hi: #002A63;
  --line: rgba(255, 255, 255, 0.08);
  --line-hi: rgba(255, 255, 255, 0.16);
  --ink: #FFFFFF;
  --ink-dim: #A9BEDC;
  --ink-faint: #7189AC;
  --accent: #FFC400;
  --accent-hi: #FFD84D;
  --accent-dim: rgba(255, 196, 0, 0.16);
  --radius: 14px;
  --cols: 3;
  --navy: #00285F; /* brand navy — text on yellow, dot accents */
  --primary: #004AAD; /* brand blue — secondary highlight */
  /* One family throughout, as the brand kit specifies. Structural labels get
     their archive feel from caps + tracking rather than a second typeface. */
  --sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: var(--sans);
  --mono: var(--sans);
}

.rowlabel,
.sec-pos,
.specs dt { letter-spacing: 0.08em; }
.chip .n,
.tagline em,
.icon-btn em,
.mode em { font-variant-numeric: tabular-nums; }

* { box-sizing: border-box; }

/* Any `display` rule beats the hidden attribute, so state it explicitly once. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'ss01';
}

/* Ambient warmth so pure black doesn't read as cheap */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 60% at 50% -10%, rgba(255, 196, 0, 0.07), transparent 60%);
  z-index: 0;
}

svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

kbd {
  font: 500 10px/1 var(--sans);
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-faint);
  background: rgba(255, 255, 255, 0.03);
}

/* ── Top bar ─────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: rgba(0, 20, 46, 0.78);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }

/* The Actdeck bolt chip, unchanged from the brand kit — the ownership signal. */
.mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent);
  box-shadow: 0 6px 18px -8px rgba(255, 196, 0, 0.8);
}
.mark svg { width: 19px; height: 19px; fill: var(--navy); stroke: none; }

.brand-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.15; }
.wordmark-row { display: flex; align-items: center; gap: 8px; }
.wordmark { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.byline {
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid rgba(255, 196, 0, 0.3);
  background: rgba(255, 196, 0, 0.1);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tagline { font-size: 11.5px; color: var(--ink-faint); letter-spacing: 0.01em; }
.tagline em { font-style: normal; color: var(--accent); font-variant-numeric: tabular-nums; }

/* Pages ⇄ Sections. Same library, two grains. */
.modes {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--ink-faint);
  font: 500 12.5px var(--sans);
  cursor: pointer;
  transition: color 0.16s, background 0.16s;
}
.mode:hover { color: var(--ink-dim); }
.mode.on { color: #00285F; font-weight: 600; background: linear-gradient(160deg, var(--accent-hi), var(--accent)); }
.mode em { font-style: normal; font-size: 11px; opacity: 0.6; font-variant-numeric: tabular-nums; }

.controls { display: flex; align-items: center; gap: 8px; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 300px;
  padding: 0 10px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.search:focus-within { border-color: rgba(255, 196, 0, 0.42); box-shadow: 0 0 0 3px var(--accent-dim); }
.search svg { color: var(--ink-faint); flex: none; }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--ink);
  font: 400 13px var(--sans);
}
.search input::placeholder { color: var(--ink-faint); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-dim);
  font: 500 12.5px var(--sans);
  cursor: pointer;
  transition: color 0.16s, border-color 0.16s, background 0.16s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-hi); }
.icon-btn.compact { padding: 0 9px; }
.icon-btn em { font-style: normal; font-size: 11px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.icon-btn[aria-pressed='true'] {
  color: var(--accent-hi);
  border-color: rgba(255, 196, 0, 0.38);
  background: rgba(255, 196, 0, 0.09);
}
.icon-btn[aria-pressed='true'] svg { fill: var(--accent); stroke: var(--accent); }
.icon-btn[aria-pressed='true'] em { color: var(--accent); }

/* ── Filters ─────────────────────────────────────────────── */
.filters {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px 28px 4px;
}
.chiprow { display: flex; flex-wrap: wrap; gap: 6px; }

/* The primary axis stays on one line and scrolls — wrapping 8 industries plus
   33 facet chips was burying the grid, especially on a phone. */
.chiprow.scroller {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
}
.chiprow.scroller::-webkit-scrollbar { display: none; }
.chiprow.scroller .chip { flex: none; }

.filter-panel {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
  animation: rise 0.18s ease;
}
.filter-panel[hidden] { display: none; }

.active-row .chip.active-chip {
  color: var(--accent-hi);
  border-color: rgba(255, 196, 0, 0.4);
  background: rgba(255, 196, 0, 0.1);
}
.active-row .chip.active-chip:hover { border-color: rgba(255, 196, 0, 0.75); }
.active-row .chip.clear-all { color: var(--ink-faint); text-decoration: underline; text-underline-offset: 3px; border-color: transparent; }
.active-row .chip.clear-all:hover { color: var(--ink); }

#filterCount {
  font-style: normal;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  text-align: center;
  color: #00285F;
  background: var(--accent);
}

.chip {
  height: 29px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-dim);
  font: 500 12.5px var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s, border-color 0.16s, background 0.16s;
}
.chip:hover { color: var(--ink); border-color: var(--line-hi); }
.chip[aria-pressed='true'] {
  color: #00285F;
  background: linear-gradient(160deg, var(--accent-hi), var(--accent));
  border-color: transparent;
  font-weight: 600;
}
.chip .n { opacity: 0.55; margin-left: 5px; font-variant-numeric: tabular-nums; }

.rowlabel {
  align-self: center;
  margin-right: 3px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  opacity: 0.65;
}
.rowlabel:not(:first-child) { margin-left: 12px; }

.icon-btn .flag { font-size: 13px; line-height: 1; }

.icon-btn.install {
  color: var(--accent);
  border-color: rgba(255, 196, 0, 0.34);
  background: rgba(255, 196, 0, 0.08);
}
.icon-btn.install:hover { color: var(--accent-hi); border-color: rgba(255, 196, 0, 0.6); }

.install-hint {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 200;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border: 1px solid rgba(255, 196, 0, 0.34);
  border-radius: 11px;
  background: rgba(0, 32, 80, 0.96);
  backdrop-filter: blur(10px);
  color: var(--ink-dim);
  font-size: 13px;
  box-shadow: 0 20px 44px -22px #000;
  animation: rise 0.24s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.install-hint b { color: var(--accent-hi); font-weight: 600; }

/* Give the header a little breathing room under a notch when installed. */
@media (display-mode: standalone) {
  .topbar { padding-top: max(18px, env(safe-area-inset-top)); }
}

.chiprow.sub .chip { height: 26px; font-size: 11.5px; padding: 0 10px; color: var(--ink-faint); }
.chiprow.sub .chip:hover { color: var(--ink-dim); }
.chiprow.sub .chip[aria-pressed='true'] {
  color: var(--accent-hi);
  background: rgba(255, 196, 0, 0.1);
  border-color: rgba(255, 196, 0, 0.35);
}

/* ── Grid ────────────────────────────────────────────────── */
main { position: relative; z-index: 1; padding: 20px 28px 60px; }

.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  color: inherit;
  font: inherit;
  transition: transform 0.24s cubic-bezier(0.2, 0.7, 0.3, 1), border-color 0.24s, box-shadow 0.24s;
}
.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(255, 196, 0, 0.34);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 196, 0, 0.08);
  outline: none;
}

/* The signature move: the thumbnail is the *whole* page, and it pans on hover.
   Off-hover it snaps back quickly; on hover it crawls at a constant speed set
   by --pan (computed per card in app.js from the real travel distance). */
.thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background-color: #00102A;
  background-repeat: no-repeat;
  background-size: 100% auto;
  background-position: 50% 0;
  transition: background-position 0.7s cubic-bezier(0.3, 0, 0.2, 1);
  border-bottom: 1px solid var(--line);
}
.card:hover .thumb,
.card:focus-visible .thumb {
  background-position: 50% 100%;
  transition-duration: var(--pan, 12s);
  transition-timing-function: linear;
}

.thumb::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 56px;
  background: linear-gradient(transparent, rgba(8, 8, 10, 0.55));
  opacity: 0;
  transition: opacity 0.3s;
}
.card:hover .thumb::after { opacity: 1; }

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 999px;
  font: 600 10px var(--sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(0, 20, 46, 0.72);
  border: 1px solid var(--line-hi);
  backdrop-filter: blur(8px);
}
/* One colour per product category, so the grid is readable before you read it.
   Class names come from industryClass() in app.js — slugified industry name. */
.badge.i-software-ai       { color: #9db9ff; border-color: rgba(157, 185, 255, 0.32); }
.badge.i-hardware          { color: #8fd8e8; border-color: rgba(143, 216, 232, 0.32); }
.badge.i-info-product      { color: #ecd08a; border-color: rgba(236, 208, 138, 0.32); }
.badge.i-health-wellness   { color: #a6e0b4; border-color: rgba(166, 224, 180, 0.32); }
.badge.i-consumer-app      { color: #f0a8c8; border-color: rgba(240, 168, 200, 0.32); }
.badge.i-agency-services   { color: #f2a98a; border-color: rgba(242, 169, 138, 0.32); }
.badge.i-media-content     { color: #c9b8f0; border-color: rgba(201, 184, 240, 0.32); }

.star-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line-hi);
  background: rgba(0, 20, 46, 0.7);
  backdrop-filter: blur(8px);
  color: var(--ink-dim);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, color 0.16s;
}
.card:hover .star-btn, .star-btn.on, .star-btn:focus-visible { opacity: 1; }
.star-btn:hover { color: var(--accent-hi); }
.star-btn.on { color: var(--accent); }
.star-btn.on svg { fill: var(--accent); }

.card-body { display: flex; flex-direction: column; gap: 8px; padding: 13px 14px 15px; }
.card-head { display: flex; align-items: center; gap: 8px; min-width: 0; }

.favicon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex: none;
  background: rgba(255, 255, 255, 0.06);
  object-fit: contain;
}
.favicon.lg { width: 34px; height: 34px; border-radius: 8px; }

.host {
  font-size: 11.5px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.tag {
  padding: 2.5px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-faint);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid transparent;
  white-space: nowrap;
}
.tag.type { color: var(--accent); background: rgba(255, 196, 0, 0.09); }

/* ── Starter ─────────────────────────────────────────────
   One line by default. 22 pages and 133 sections with no entry point is choice
   paralysis, but a gate that blocks the gallery would be worse. */
.starter { margin-bottom: 18px; }

.starter-bar {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 13px 18px;
  border: 1px dashed rgba(255, 196, 0, 0.32);
  border-radius: 12px;
  background: rgba(255, 196, 0, 0.045);
  color: var(--ink-dim);
  font: 400 13.5px var(--sans);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.starter-bar:hover { border-color: rgba(255, 196, 0, 0.6); background: rgba(255, 196, 0, 0.09); }
.starter-bar b { color: var(--ink); font-weight: 600; }
.starter-spark { color: var(--accent); font-size: 11px; }
.starter-chev { margin-left: auto; color: var(--accent); }

.starter-panel {
  padding: 22px;
  border: 1px solid rgba(255, 196, 0, 0.3);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 196, 0, 0.07), transparent 60%), var(--bg-elev);
  animation: rise 0.24s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.starter-panel[hidden] { display: none; }

.starter-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; }
.starter-step {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--accent);
  flex: none;
}
.starter-head h2 {
  margin: 0;
  flex: 1;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.2;
}
.starter-close {
  flex: none;
  border: 0;
  background: none;
  color: var(--ink-faint);
  font-size: 15px;
  cursor: pointer;
  padding: 2px 4px;
}
.starter-close:hover { color: var(--ink); }

.starter-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 8px; }
.starter-opt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, transform 0.16s;
}
.starter-opt:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 196, 0, 0.55);
  background: var(--surface-hi);
}
.starter-opt b { color: var(--ink); font: 600 13.5px var(--sans); }
.starter-opt em { color: var(--ink-faint); font: 400 11.5px var(--sans); font-style: normal; }

.starter-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--ink-faint);
  font-size: 12.5px;
}

/* ── The offer ───────────────────────────────────────────
   Two placements, one visual language: gold edge, the product's own screenshot,
   card geometry borrowed from the grid so it reads as part of the system. */
.offer-band {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  margin-bottom: 22px;
  border: 1px solid rgba(255, 196, 0, 0.34);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background:
    linear-gradient(100deg, rgba(255, 196, 0, 0.11), rgba(255, 196, 0, 0.02) 46%, transparent 70%),
    var(--surface);
  transition: border-color 0.22s, box-shadow 0.22s, transform 0.22s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.offer-band:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 196, 0, 0.6);
  box-shadow: 0 20px 44px -26px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 196, 0, 0.14);
}

.offer-shot {
  background-color: #00102A;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 50% 0;
  border-right: 1px solid rgba(255, 196, 0, 0.22);
  min-height: 196px;
}

.offer-copy { display: flex; flex-direction: column; gap: 9px; padding: 22px 24px; align-items: flex-start; }

.offer-eyebrow {
  margin: 0;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

.offer-heading {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.005em;
  color: var(--ink);
}
.offer-heading.small { font-size: 19px; }

.offer-body { margin: 0; max-width: 60ch; font-size: 13px; line-height: 1.6; color: var(--ink-dim); }

.offer-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 3px; }
.offer-price { font-size: 15px; font-weight: 600; color: var(--accent-hi); font-variant-numeric: tabular-nums; }
.offer-price s { color: var(--ink-faint); font-weight: 400; font-size: 12.5px; margin-right: 4px; }
.offer-pill {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 196, 0, 0.3);
  font-size: 11px;
  color: var(--accent);
}

.offer-band .btn.primary { margin-top: 5px; }

/* Detail-panel placement */
.offer-block {
  padding: 18px;
  border: 1px solid rgba(255, 196, 0, 0.3);
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(255, 196, 0, 0.1), transparent 62%), var(--surface);
}
.offer-block h3 { color: var(--accent); }
.offer-block .offer-body { font-size: 12.5px; }
.btn.wide { width: 100%; justify-content: center; margin-top: 14px; }

/* Section crops vary wildly in height, so this grain gets a masonry column flow. */
.grid.sections { display: block; columns: var(--cols); column-gap: 20px; }
.grid.sections .card { width: 100%; margin: 0 0 20px; break-inside: avoid; }

.sec-shot {
  position: relative;
  background-color: #00102A;
  background-repeat: no-repeat;
  background-size: 100% auto;
  background-position: 50% 0;
  border-bottom: 1px solid var(--line);
}
.section-card .card-body { padding: 10px 12px 11px; }
.section-card .card-head { justify-content: space-between; }
.sec-pos { font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; }
.section-card .badge { text-transform: none; letter-spacing: 0.02em; color: var(--accent-hi); border-color: rgba(255, 196, 0, 0.34); }

.empty { text-align: center; padding: 70px 0; color: var(--ink-faint); }
.linkish { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }

.foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 22px 28px 34px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 11.5px;
}
.foot .hint { display: flex; align-items: center; gap: 5px; }

/* ── Detail overlay ──────────────────────────────────────── */
.detail { position: fixed; inset: 0; z-index: 100; }
.detail[hidden] { display: none; }

.detail-backdrop {
  position: absolute;
  inset: 0;
  /* Navy is lighter than the old near-black, so the backdrop needs more cover
     or the grid bleeds through behind the reading pane. */
  background: rgba(0, 10, 24, 0.93);
  backdrop-filter: blur(12px);
  animation: fade 0.22s ease;
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.detail-shell {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  animation: rise 0.28s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.detail-nav {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 14px 20px 0;
}
.icon-btn.ghost { background: rgba(0, 32, 80, 0.8); backdrop-filter: blur(8px); padding: 0 9px; }
.icon-btn.ghost.close { color: var(--ink); }

.detail-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 22px;
  padding: 14px 20px 20px;
}

.shot-pane { min-height: 0; display: flex; }

.browser {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-hi);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elev);
  box-shadow: 0 40px 90px -50px #000;
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 38px;
  flex: none;
  background: #002050;
  border-bottom: 1px solid var(--line);
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: #0B3C7A; flex: none; }
.dot:first-child { background: #12488C; }
.browser-url {
  margin-left: 10px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-faint);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}
.browser-view { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.browser-view img { display: block; width: 100%; }

/* Info pane */
.info-pane {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.info-head { display: flex; align-items: flex-start; gap: 12px; }
.info-head h2 {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: 0.005em;
}
.lede { margin: -6px 0 0; color: var(--ink-dim); font-size: 13.5px; line-height: 1.6; }

.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-dim);
  font: 500 12.5px var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.16s, border-color 0.16s, background 0.16s;
}
.btn:hover { color: var(--ink); border-color: var(--line-hi); background: var(--surface-hi); }
.btn.primary {
  color: #00285F;
  font-weight: 600;
  border-color: transparent;
  background: linear-gradient(160deg, var(--accent-hi), var(--accent));
}
.btn.primary:hover { filter: brightness(1.08); color: #00285F; }
.btn.on { color: var(--accent); border-color: rgba(255, 196, 0, 0.4); }
.btn.on svg { fill: var(--accent); }

.block h3 {
  margin: 0 0 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.why { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.why li {
  position: relative;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
}
.why li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255, 196, 0, 0.6);
}
.why b { color: var(--accent-hi); font-weight: 600; }

.anatomy { display: flex; flex-wrap: wrap; gap: 6px; }
.anatomy span,
.anatomy button {
  padding: 4px 9px;
  border-radius: 6px;
  font: 400 11.5px var(--sans);
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}
.anatomy.patterns button {
  cursor: pointer;
  color: var(--accent);
  background: rgba(255, 196, 0, 0.08);
  border-color: rgba(255, 196, 0, 0.26);
  transition: background 0.16s, border-color 0.16s;
}
.anatomy.patterns button:hover { background: rgba(255, 196, 0, 0.18); border-color: rgba(255, 196, 0, 0.5); }

.specs { margin: 0; display: grid; grid-template-columns: 104px 1fr; gap: 9px 14px; font-size: 12.5px; }
.specs dt { color: var(--ink-faint); }
.specs dd { margin: 0; color: var(--ink-dim); }
.specs dd a { color: var(--accent); text-decoration: none; }
.specs dd a:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1180px) {
  .detail-body { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 980px) {
  .grid { --cols: 2 !important; }
  .detail-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .info-pane { max-height: 42vh; }
}
@media (max-width: 860px) {
  .offer-band { grid-template-columns: 1fr; }
  .offer-shot { min-height: 150px; border-right: 0; border-bottom: 1px solid rgba(255, 196, 0, 0.22); }
}
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .brand { flex: 1; min-width: 0; }
  .wordmark { font-size: 20px; }
  .tagline { display: none; }

  /* Controls wrap inside their own row; search drops to a full-width line. */
  .modes { order: 3; flex: none; }
  .controls { order: 4; flex: 1 0 100%; flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
  .search { order: 5; width: 100%; }
  #densityBtn { display: none; } /* one column on a phone — nothing to toggle */

  /* Icon-only buttons, but never hide the flag: it *is* the Malaysia label. */
  .icon-btn span:not(.flag) { display: none; }
  .icon-btn { padding: 0 11px; }
  #filterBtn span { display: inline; }

  .filters { padding: 12px 16px 4px; gap: 8px; }
  .chiprow.scroller { margin: 0 -16px; padding: 0 16px 2px; }
  main, .foot { padding-left: 16px; padding-right: 16px; }
  main { padding-top: 14px; }
  .grid { --cols: 1 !important; }
  .grid.sections { columns: 1 !important; }
  .foot .hint { display: none; }

  /* Six stacked options ran taller than the viewport — go two-up and tighten. */
  .starter-panel { padding: 16px 14px; }
  .starter-head { gap: 10px; margin-bottom: 13px; }
  .starter-head h2 { font-size: 19px; }
  .starter-options { grid-template-columns: 1fr 1fr; gap: 7px; }
  .starter-opt { padding: 11px 12px; }
  .starter-opt b { font-size: 12.5px; }
  .starter-opt em { font-size: 10.5px; }
  .starter-bar { padding: 12px 14px; font-size: 12.5px; }

  /* The band must not eat the whole first screen — the grid has to be visible
     without scrolling past an offer. Screenshot goes, copy tightens. */
  .offer-band { grid-template-columns: 1fr; margin-bottom: 16px; }
  .offer-shot { display: none; }
  .offer-copy { padding: 16px; gap: 7px; }
  .offer-eyebrow { font-size: 9.5px; }
  .offer-heading { font-size: 18px; }
  .offer-body {
    font-size: 12.5px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .offer-band .btn.primary { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .thumb { transition: none; }
}
