/* Glean — Offline Deal Hunter
   Plain CSS, no build step. Themes: ledger, vault, grove.
   System fonts only, so the desk works fully offline. */

:root,
[data-theme="ledger"] {
  --bg: #efe7d8;
  --bg-elev: #faf6ee;
  --bg-mute: #e6dcc8;
  --ink: #2a2318;
  --ink-soft: #6d6356;
  --line: #d6cbb6;
  --accent: #b55a2a;
  --accent-hover: #94471f;
  --accent-soft: #f4e4d8;
  --good: #3d5a45;
  --good-soft: #e4ede6;
  --warn: #9a6a1c;
  --warn-soft: #f3ead6;
  --again: #8c3a32;
  --shadow: 0 18px 50px rgba(42, 35, 24, 0.09);
  --grain: 0.07;
  --cheap: #3d5a45;
  --cheap-bg: #e4ede6;
  --paper: #faf6ee;
  --paper-2: #e6dcc8;
}

[data-theme="vault"] {
  --bg: #13110f;
  --bg-elev: #1d1a16;
  --bg-mute: #2a261f;
  --ink: #f3ece3;
  --ink-soft: #b0a79b;
  --line: #3a342b;
  --accent: #d4b07a;
  --accent-hover: #e2c396;
  --accent-soft: #2c261c;
  --good: #8fbf9a;
  --good-soft: #1e2a22;
  --warn: #e0b35c;
  --warn-soft: #2c261c;
  --again: #e08a72;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --grain: 0.1;
  --cheap: #8fbf9a;
  --cheap-bg: #1e2a22;
  --paper: #1d1a16;
  --paper-2: #2a261f;
}

[data-theme="grove"] {
  --bg: #e6eee6;
  --bg-elev: #f5f8f4;
  --bg-mute: #d5e0d5;
  --ink: #1c241c;
  --ink-soft: #516056;
  --line: #c5d2c6;
  --accent: #2f6b4f;
  --accent-hover: #24553e;
  --accent-soft: #dcece3;
  --good: #2f6b4f;
  --good-soft: #dcece3;
  --warn: #8a5a1c;
  --warn-soft: #f3ead6;
  --again: #8c3a32;
  --shadow: 0 18px 50px rgba(28, 36, 28, 0.08);
  --grain: 0.05;
  --cheap: #2f6b4f;
  --cheap-bg: #dcece3;
  --paper: #f5f8f4;
  --paper-2: #d5e0d5;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  max-width: 100%;
  overflow-x: clip;
}

img, svg, video, canvas { max-width: 100%; }

body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  letter-spacing: -0.011em;
  position: relative;
  transition: background-color 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.grain,
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0;
  transform: translateY(-120%);
  background: var(--accent);
  color: var(--bg-elev);
  padding: 0.5rem 1rem;
  z-index: 20;
}
.skip:focus { transform: none; top: 0.75rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.top, #app, .foot {
  position: relative;
  z-index: 1;
}

.top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1.5rem 0.45rem;
  max-width: 1280px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.brand img { border-radius: 7px; display: block; }

.hello { flex: 1; min-width: 0; }
.hello .text-btn { display: inline; margin-left: 0.15rem; font-size: 0.78rem; }
.hello .text-btn[hidden],
#clear-demo[hidden] { display: none !important; }
.greet {
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.date { color: var(--ink-soft); font-size: 0.82rem; }

.nav {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-mute);
  border-radius: 999px;
  padding: 0.18rem;
  border: 1px solid var(--line);
}
.nav-btn {
  font: inherit;
  cursor: pointer;
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.32rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 650;
  white-space: nowrap;
}
.nav-btn.is-active {
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.nav-btn:hover { color: var(--ink); }

.top-actions { display: flex; align-items: center; gap: 0.7rem; }
.theme-switch { display: flex; gap: 0.35rem; }

.swatch {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--line);
  cursor: pointer; padding: 0;
  background: #efe7d8;
}
.swatch[data-theme-btn="vault"] { background: #13110f; }
.swatch[data-theme-btn="grove"] { background: #e6eee6; }
.swatch.is-active { outline: 2px solid var(--accent); outline-offset: 2px; }

.icon-btn, .text-btn, .btn-ghost, .btn-primary, .btn-danger, .nav-btn {
  font: inherit; cursor: pointer;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  width: 36px; height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.icon-btn:hover, .btn-ghost:hover, .text-btn:hover { background: var(--bg-mute); }

.alert-btn .badge {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
[data-theme="vault"] .alert-btn .badge { color: #1a140c; }
.badge[hidden] { display: none !important; }

.text-btn {
  background: none; border: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0.2rem 0.1rem;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  font-weight: 650;
  min-width: 5.5rem;
}
[data-theme="vault"] .btn-primary { color: #1a140c; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled, .btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary:disabled:hover { background: var(--accent); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
}
.btn-danger:hover { background: var(--accent-soft); }

a.btn-primary { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

#app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.2rem 1.5rem 0.85rem;
}

.hero {
  padding: 1.4rem 1.35rem 1.2rem;
  margin-bottom: 0.85rem;
}
.hero h1 {
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", "Times New Roman", serif;
  font-size: clamp(1.8rem, 3.2vw, 2.45rem);
  letter-spacing: -0.03em;
  font-weight: 600;
  line-height: 1.15;
  text-transform: none;
  color: var(--ink);
}
.hero-lead {
  color: var(--ink-soft);
  max-width: 42rem;
  margin: 0.55rem 0 1.05rem;
}
.hunt-form {
  display: flex;
  gap: 0.5rem;
  max-width: 54rem;
  flex-wrap: wrap;
}
.hunt-form input[type="search"] {
  flex: 1;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.7rem 1.05rem;
  font-size: 1rem;
}
.hero-hint { color: var(--ink-soft); font-size: 0.82rem; margin: 0.7rem 0 0.3rem; max-width: 46rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin: 0 0 0.85rem;
}
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.7rem 0.9rem 0.75rem;
  box-shadow: var(--shadow);
  min-width: 0;
}
.stat-value {
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  color: var(--ink-soft);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 650;
  margin-top: 0.15rem;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 0.95rem 1.15rem 1rem;
  min-width: 0;
  margin-bottom: 0.85rem;
}

.card-kicker, .card h2, .stat-label, .offer-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 650;
  font-family: "Segoe UI", system-ui, sans-serif;
}
.study-progress {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink-soft);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}
.card-head h2 { margin: 0; color: var(--ink-soft); }
.card-head .muted { margin: 0; }

.subhead {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 650;
  margin: 1rem 0 0.5rem;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.7rem;
  margin-top: 0.75rem;
}
.store-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  color: inherit;
  text-decoration: none;
  min-height: 6.2rem;
}
.store-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.store-name {
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.store-domain { color: var(--ink-soft); font-size: 0.78rem; word-break: break-all; }
.store-sort { color: var(--accent); font-size: 0.75rem; font-weight: 650; margin-top: auto; }


.lens-other-heading {
  list-style: none;
  display: block;
  margin: 0.45rem 0 0.1rem;
  padding: 0.35rem 0.1rem 0.15rem;
  border: 0;
  background: none;
  grid-column: 1 / -1;
}
.lens-other-label {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--ink-soft);
}
.offer-list { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.offer {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(5.5rem, 0.55fr)) auto;
  gap: 0.6rem 0.8rem;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.75rem 0.9rem;
}
.offer.is-cheap {
  border-color: var(--cheap);
  background: var(--cheap-bg);
}
.offer-title { font-weight: 650; line-height: 1.3; }
.offer-source { color: var(--ink-soft); font-size: 0.82rem; }
.offer-num { font-variant-numeric: tabular-nums; }
.offer-num small { display: block; color: var(--ink-soft); font-size: 0.72rem; }
.pill {
  display: inline-block;
  background: var(--cheap);
  color: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  margin-left: 0.35rem;
}
[data-theme="vault"] .pill { color: #1a140c; }
.offer-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; justify-content: flex-end; }
.sample-note, .nudge {
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 0.8rem 0.95rem;
  margin-bottom: 0.7rem;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}
.item-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 0.95rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
  color: inherit;
  cursor: pointer;
  font: inherit;
  width: 100%;
}
.item-card:hover { border-color: var(--accent); }
.item-card.is-hit { box-shadow: inset 3px 0 0 var(--cheap); }
.item-name {
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.item-meta { color: var(--ink-soft); font-size: 0.84rem; }
.item-price {
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.browse-tools {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}
.browse-tools input[type="search"],
.browse-tools select,
.field select,
.field input,
.field textarea,
.hunt-form input {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
}
.browse-tools input[type="search"] { flex: 1; min-width: 8rem; }

.study-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0.2rem 0 0.85rem;
  flex-wrap: wrap;
}
.study-meta { flex: 1; min-width: 0; }
.study-deck {
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.head-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.price-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.price-table th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 650;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
}
.price-table td { padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.price-table tr.is-cheap td { background: var(--cheap-bg); }
.chart {
  width: 100%;
  height: 88px;
  margin: 0.4rem 0 0.8rem;
}
.chart path { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .dots { fill: var(--accent); }

.list-row, .watch-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child, .watch-row:last-child { border-bottom: 0; }
.group-head {
  font-weight: 650;
  margin: 0.85rem 0 0.3rem;
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", "Times New Roman", serif;
}

.foot {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.4rem 1.5rem 1.6rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
}
.built-by { margin-top: 0.35rem; }
.built-btn { font-size: 0.82rem; color: var(--ink-soft); }
.lite-credit { margin-top: 0.35rem; max-width: 42rem; }
.lite-credit a { color: var(--accent); }
.disclaimer { margin-top: 0.55rem; max-width: 46rem; font-size: 0.75rem; }

.about-lead {
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.7rem;
}
.about-maker {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.7rem;
}

.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center; padding: 1rem;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 16, 12, 0.42);
}
.modal-card {
  position: relative; z-index: 1;
  width: min(520px, 100%);
  max-height: min(90vh, 820px);
  overflow: auto;
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 1.05rem 1.15rem 1.15rem;
}
.modal-wide { width: min(680px, 100%); }

.field, .session-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.8rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.field input, .field textarea, .field select {
  width: 100%;
  resize: vertical;
}
.field-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 7rem; }
.field-row .field.grow { flex: 2; min-width: 12rem; }
.check {
  display: flex; align-items: center; gap: 0.45rem;
  margin: 0 0 0.8rem;
  font-size: 0.9rem;
  color: var(--ink);
}
.tight { margin-top: -0.45rem; margin-bottom: 0.8rem; }

.field input:focus, .field textarea:focus, .field select:focus,
.browse-tools input:focus, .browse-tools select:focus,
.hunt-form input:focus,
.icon-btn:focus-visible, .btn-primary:focus-visible, .btn-ghost:focus-visible,
.text-btn:focus-visible, .swatch:focus-visible, .nav-btn:focus-visible,
.store-card:focus-visible, .item-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.settings-actions, .backup-actions {
  display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.3rem;
}
.backup { margin-top: 1.1rem; padding-top: 0.9rem; border-top: 1px dashed var(--line); }
.muted { color: var(--ink-soft); font-size: 0.84rem; margin-bottom: 0.7rem; }
.file-btn { display: inline-flex; align-items: center; cursor: pointer; position: relative; }
.file-btn input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.form-msg { min-height: 1.2em; margin-top: 0.6rem; font-size: 0.82rem; color: var(--good); }
.form-msg.is-error { color: var(--accent); }

.store-settings { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.8rem; }
.store-row {
  display: grid;
  grid-template-columns: auto 7rem 1fr;
  gap: 0.5rem;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.4rem 0.55rem;
}
.store-row select { font: inherit; color: var(--ink); background: var(--bg-elev); border: 1px solid var(--line); border-radius: 8px; padding: 0.25rem 0.4rem; }

.toast {
  position: fixed; bottom: 1.2rem; left: 50%;
  transform: translateX(-50%);
  background: var(--ink); color: var(--bg-elev);
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  z-index: 60;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  max-width: min(90vw, 32rem);
  text-align: center;
}
.toast[hidden] { display: none; }

.empty-hint { color: var(--ink-soft); padding: 0.6rem 0 0.2rem; }
.tiny-btn {
  font: inherit; cursor: pointer;
  background: none; border: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0 0.2rem;
}
.hit-flag { color: var(--cheap); font-weight: 650; font-size: 0.8rem; }

.noscript {
  position: relative; z-index: 2;
  margin: 1rem auto; max-width: 40rem;
  padding: 1rem;
  background: var(--accent-soft);
  border-radius: 12px;
}

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  #app, .top, .foot { padding-left: 1rem; padding-right: 1rem; }
  .offer { grid-template-columns: 1fr 1fr; }
  .offer-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 720px) {
  .top {
    flex-wrap: wrap;
    gap: 0.55rem 0.7rem;
    padding-top: max(0.7rem, env(safe-area-inset-top));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  #app {
    padding-left: max(0.9rem, env(safe-area-inset-left));
    padding-right: max(0.9rem, env(safe-area-inset-right));
    padding-bottom: calc(11.5rem + env(safe-area-inset-bottom));
  }
  .foot {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(1.6rem, calc(1.2rem + env(safe-area-inset-bottom)));
  }
  .hello { order: 3; flex-basis: 100%; }
  .nav {
    order: 4;
    flex-basis: 100%;
    width: 100%;
    max-width: 100%;
    justify-content: stretch;
    gap: 0.12rem;
    padding: 0.12rem;
  }
  .nav-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.32rem 0.18rem;
    font-size: 0.72rem;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
  }
  .greet { font-size: 1.15rem; overflow-wrap: anywhere; }
  .hunt-form { flex-direction: column; align-items: stretch; }
  .hunt-field,
  .hunt-market,
  .hunt-region-btn,
  .hunt-form .btn-primary {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
  }
  .hunt-form .btn-primary { width: 100%; }
  .hunt-market,
  .hunt-region-btn { max-width: none; min-height: 44px; }
  .store-row { grid-template-columns: 1fr; }
  .list-row, .watch-row { grid-template-columns: auto 1fr auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  /* Animated WebP would keep playing; swap to a still frame instead. */
  .elara-fab .elara-live { display: none !important; }
  .elara-fab .elara-still { display: block !important; }
}

.install-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.35rem;
}
.install-hint { margin-top: 0.35rem; }
.affiliate-disclosure,
.store-link-note,
.privacy-note {
  margin-top: 0.85rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 42rem;
}
.privacy-note { margin: 0.35rem 0 0; }
.store-link-note { margin-top: 0.75rem; }

#install-ios[hidden], #install-btn[hidden], #affiliate-disclosure[hidden] { display: none !important; }


/* ---------- Ease of use + value ranking + ELARA (website, not app chrome) ---------- */
.hunt-form { align-items: stretch; }
.hunt-field { position: relative; flex: 1 1 16rem; min-width: 0; z-index: 8; }
.hunt-field input[type="search"] { width: 100%; padding-right: 3rem; }
.hunt-image-btn {
  position: absolute;
  top: 0;
  right: 0.2rem;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  cursor: pointer;
  z-index: 2;
}
.hunt-image-btn:hover, .hunt-image-btn:focus { color: var(--ink); background: var(--bg-mute); outline: none; }
.hunt-image-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hunt-image-preview {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.45rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.hunt-image-preview[hidden] { display: none !important; }
.hunt-image-preview img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-mute);
  flex: 0 0 auto;
}
.hunt-image-clear {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: 0;
  background: var(--bg-mute);
  color: var(--ink);
  border-radius: 999px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.hunt-market {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  min-height: 44px;
  min-width: 10.5rem;
  max-width: 16rem;
  flex: 0 1 14rem;
}
.hunt-market:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.market-empty {
  margin: 0.4rem 0 0.8rem;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--bg);
}
.market-empty p { margin: 0 0 0.5rem; }
.hunt-form .btn-primary,
.nav-btn, .btn-primary, .btn-ghost, .text-btn, .icon-btn {
  min-height: 44px;
}
.icon-btn { min-width: 44px; }
.suggest {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  z-index: 80;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(42, 35, 24, 0.18);
  max-height: 16rem;
  overflow: auto;
  isolation: isolate;
  opacity: 1;
}
.suggest[hidden] { display: none; }
.suggest-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 44px;
}
.suggest-item:hover,
.suggest-item.is-active { background: var(--bg-mute); }
.suggest-item small { color: var(--ink-soft); }
.recent-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin: 0.75rem 0 0.2rem;
}
.recent-label { color: var(--ink-soft); font-size: 0.82rem; }
.recent-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  min-height: 36px;
}
.chip:hover { border-color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; margin-top: 0.6rem; }
.advanced { margin-top: 0.8rem; }
.advanced summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 0.88rem;
  padding: 0.35rem 0;
}
.advanced .btn-ghost { margin-top: 0.5rem; }

.empty-hunt {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.4rem;
  margin-top: 1rem;
}
.empty-hunt[hidden] { display: none !important; }
.empty-hunt .elara-portrait {
  width: 140px;
  height: auto;
  border-radius: 18px;
  object-fit: cover;
  object-position: top center;
  flex-shrink: 0;
  background: #e8d5c0;
  box-shadow: 0 8px 20px rgba(30,24,16,0.08);
}
.empty-hunt h2 { margin: 0 0 0.35rem; font-size: 1.25rem; }

.offer-list { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; padding: 0; margin: 0; }
.offer {
  display: grid;
  grid-template-columns: 96px minmax(0, 1.4fr) auto auto auto;
  gap: 0.7rem 1rem;
  align-items: start;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elev);
}
.offer-thumb {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  align-self: start;
}
.offer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  display: block;
}
.offer-thumb.is-empty::after {
  content: "";
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 6px;
  background: #ececec;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
}
.offer-body { min-width: 0; }
.offer.is-best { border-color: #c9a227; box-shadow: 0 0 0 1px rgba(201,162,39,0.35); }
.offer.is-cheap {
  border-color: var(--cheap);
  background: var(--cheap-bg);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cheap) 50%, transparent), 0 10px 24px rgba(47, 109, 79, 0.14);
}
.offer.is-warn { border-color: #c4843a; }
.offer-head { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin: 0.25rem 0 0.15rem; }
.offer-source-row {
  display: flex;
  align-items: center;
  gap: 0.4rem 0.5rem;
  flex-wrap: wrap;
  margin: 0 0 0.2rem;
  min-width: 0;
}
.offer-favicon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 0.62rem;
  font-weight: 700;
  flex: 0 0 auto;
  line-height: 1;
}
.offer-domain {
  color: var(--ink-soft);
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.offer-title { font-weight: 650; line-height: 1.3; }
.offer-source { color: var(--ink-soft); font-size: 0.82rem; }
.offer-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.7rem; margin-top: 0.3rem; font-size: 0.8rem; color: var(--ink-soft); }
.offer-score {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 5.5rem;
}
.offer-score strong { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.offer-score small { color: var(--ink-soft); font-size: 0.72rem; }
.score-bar {
  width: 5.2rem;
  height: 6px;
  border-radius: 99px;
  background: rgba(0,0,0,0.08);
  overflow: hidden;
}
.score-bar > span { display: block; height: 100%; background: #2f7d4a; border-radius: inherit; }
.offer.is-warn .score-bar > span { background: #c4843a; }
.badge, .pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--paper-2, rgba(0,0,0,0.05));
}
.badge-value { background: #f3e2a4; color: #5a4208; }
.badge-trusted { background: #d7eadc; color: #1d4d32; }
.badge-official { background: #d9e4f5; color: #1d3557; }
.badge-cheap { background: var(--cheap); color: #fff; }
[data-theme="vault"] .badge-cheap { color: #1a140c; }
.badge-warn { background: #f6d9b8; color: #6a3a0c; }
.offer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-start;
  grid-column: 2 / -1;
}
.buy-at {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1.15rem;
  font-size: 1rem;
  font-weight: 700;
  flex: 1 1 12rem;
  text-decoration: none;
}
.offer-actions .btn-ghost { min-height: 40px; }

.why-btn {
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.2rem 0;
  min-height: 32px;
}
.why-tip {
  margin: 0.35rem 0 0;
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
  line-height: 1.45;
  background: var(--bg-mute);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.why-tip[hidden] { display: none; }
.fetch-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1.1rem;
  margin: 0.4rem 0 0.8rem;
}
.fetch-toolbar label { display: flex; align-items: center; gap: 0.45rem; font-size: 0.88rem; }
.fetch-toolbar select, .fetch-toolbar input[type="range"] { font: inherit; }
#rating-val { min-width: 2.6rem; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.sample-note { margin: 0 0 0.7rem; }

.onboard {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.onboard[hidden] { display: none !important; }
.onboard-backdrop { position: absolute; inset: 0; background: rgba(20,16,12,0.58); }
.onboard-card {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 1.25rem;
  width: min(680px, 100%);
  background: #f6f1e8;
  color: #1f1a14;
  border-radius: 20px;
  padding: 1.4rem 1.5rem 1.25rem;
  box-shadow: 0 24px 50px rgba(20,16,12,0.28);
  align-items: center;
}
.onboard-elara, .elara-portrait {
  border-radius: 16px;
  object-fit: cover;
  object-position: top center;
  background: #e8d5c0;
}
.onboard-elara { width: 180px; height: auto; flex-shrink: 0; }
.onboard-copy { min-width: 0; flex: 1; }
.onboard-step { margin: 0 0 0.2rem; color: var(--ink-soft); font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }
.onboard-copy h2 { margin: 0 0 0.45rem; font-size: 1.35rem; }
.onboard-fields { display: grid; gap: 0.55rem; margin: 0.9rem 0; }
.onboard-fields[hidden] { display: none !important; }
.onboard-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: flex-end; margin-top: 1rem; }
.onboard-actions .text-btn { margin-right: auto; }

.elara-helper {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}
.elara-helper > * { pointer-events: auto; }
.elara-helper[hidden] { display: none; }
.elara-bubble {
  display: flex;
  gap: 0.7rem;
  align-items: flex-end;
  max-width: min(380px, calc(100vw - 2rem));
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.7rem 0.8rem 0.65rem;
  box-shadow: 0 12px 30px rgba(20,16,12,0.18);
  opacity: 1;
}
.elara-bubble[hidden] { display: none; }
.elara-bubble .elara-portrait { width: 88px; height: auto; border-radius: 12px; }
.elara-name { margin: 0; font-size: 0.75rem; font-weight: 650; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-soft); }
.elara-tip { margin: 0.2rem 0 0.4rem; font-size: 0.92rem; line-height: 1.4; }
.elara-bubble-actions { display: flex; gap: 0.5rem; }
.elara-fab {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 16px;
}
.elara-fab img {
  width: auto;
  height: 180px;
  max-width: 140px;
  object-fit: contain;
  object-position: bottom center;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#view-hunt { padding-bottom: 18rem; padding-right: 10rem; }
.elara-fab[hidden] { display: none; }

.elara-figure {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.elara-now,
.elara-thought {
  margin: 0 0 1.15rem;
  max-width: min(13rem, calc(100vw - 5.5rem));
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.35;
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  padding: 0.42rem 0.7rem 0.45rem;
  box-shadow: 0 8px 18px rgba(20,16,12,0.12);
  position: relative;
  z-index: 1;
  animation: elara-thought-float 4s ease-in-out infinite;
}
.elara-now[hidden],
.elara-thought[hidden] { display: none !important; }
.elara-now-link {
  color: inherit;
  text-decoration: none;
  display: block;
}
.elara-now-link:hover { text-decoration: underline; }
.elara-listen-more {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--accent);
  text-decoration: none;
}
.elara-thought-dots {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.elara-thought-dot {
  position: absolute;
  left: 50%;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(20,16,12,0.08);
}
.elara-thought-dot.d1 { width: 11px; height: 11px; margin-left: -9px; top: 4px; }
.elara-thought-dot.d2 { width: 8px; height: 8px; margin-left: 1px; top: 14px; }
.elara-thought-dot.d3 { width: 5px; height: 5px; margin-left: -4px; top: 24px; }
@keyframes elara-thought-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -4px, 0); }
}

.elara-dock {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
}
.elara-music {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-elev);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(20,16,12,0.12);
  padding: 0;
}
.elara-music.is-on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
[data-theme="vault"] .elara-music.is-on { color: #1a140c; }
.elara-music .speaker-off { display: none; }
.elara-music:not(.is-on) .speaker-wave { display: none; }
.elara-music:not(.is-on) .speaker-off { display: block; }

.elara-helper,
.elara-bubble,
.elara-dock,
.elara-fab {
  overflow: visible;
}
.elara-stage {
  display: block;
  position: relative;
  height: 180px;
  width: auto;
  overflow: visible;
}
.elara-fab img,
.elara-stage img {
  width: auto;
  height: 180px;
  max-width: 140px;
  object-fit: contain;
  object-position: bottom center;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}
.elara-fab .elara-still { display: none; }
.elara-fab .elara-live { display: block; }
.elara-fab.is-still .elara-live { display: none; }
.elara-fab.is-still .elara-still { display: block; }


.about-guide {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 650;
  margin: 0.8rem 0;
}
.about-guide img {
  width: 52px;
  height: auto;
  border-radius: 10px;
  background: #e8d5c0;
}

@media (max-width: 720px) {
  .onboard-card { flex-direction: column; align-items: stretch; text-align: left; }
  .onboard-elara { width: 120px; }
  .empty-hunt { flex-direction: column; align-items: flex-start; }
  .empty-hunt .elara-portrait { width: 120px; }
  #view-hunt { padding-bottom: 0; padding-right: 0; }
  .elara-helper {
    right: max(0.35rem, env(safe-area-inset-right));
    bottom: max(0.35rem, env(safe-area-inset-bottom));
    z-index: 40;
  }
  .elara-bubble { max-width: min(320px, calc(100% - 0.4rem)); padding: 0.5rem 0.6rem; }
  .elara-bubble .elara-portrait { width: 64px; }
  .elara-fab img, .elara-stage img { width: auto; height: 96px; max-width: 80px; }
  .elara-stage { height: 96px; width: auto; }
  .elara-now, .elara-thought {
    max-width: min(9.2rem, calc(100vw - 5.5rem));
    font-size: 0.68rem;
    line-height: 1.25;
    padding: 0.28rem 0.55rem;
    margin-bottom: 0.45rem;
    border-radius: 999px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .elara-now-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
  }
  .elara-now-link #elara-now-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  .elara-listen-more { font-size: 0.6rem; flex: 0 0 auto; }
  .elara-thought-dots { display: none; }
  .elara-helper.is-busy .elara-thought,
  .elara-helper.is-busy .elara-now { opacity: 0; pointer-events: none; visibility: hidden; }
  .elara-music { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  .elara-tip { font-size: 0.84rem; }
  .elara-bubble-actions { flex-wrap: wrap; }
  .elara-bubble-actions .text-btn { min-height: 44px; padding: 0.35rem 0.45rem; }
  .buy-at { width: 100%; flex-basis: 100%; }
}


@media (prefers-reduced-motion: reduce) {
  .onboard, .elara-bubble, .suggest { transition: none; }
}


.recent-row[hidden],
.suggest[hidden],
.empty-hunt[hidden],
.elara-helper[hidden],
.elara-bubble[hidden],
.elara-fab[hidden],
.elara-dock[hidden],
.elara-now[hidden],
.why-tip[hidden],
#share-hunt[hidden],
#share-results[hidden] { display: none !important; }

.onboard-card {
  background: #f6f1e8;
  color: #1f1a14;
  isolation: isolate;
  opacity: 1;
}


/* ---------- Shared live prices, own-key wizard, calm notices ---------- */
.calm-banner {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.95rem 1.05rem;
  margin: 0 0 0.9rem;
  color: var(--ink);
}
.calm-banner img {
  width: 72px;
  height: auto;
  border-radius: 12px;
  background: #e8d5c0;
  flex: 0 0 auto;
}
.calm-banner h3 {
  font-size: 1.05rem;
  font-weight: 650;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}
.calm-banner p { margin: 0 0 0.65rem; color: var(--ink); }
.calm-banner p:last-child { margin-bottom: 0; }
.calm-banner.is-ok { background: var(--good-soft); }
.sample-note, .live-note {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.wizard-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0.4rem 0 0.7rem;
}
.key-wizard {
  margin: 0.2rem 0 1rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elev);
}
.wizard-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.wizard-elara {
  width: 110px;
  height: auto;
  border-radius: 14px;
  background: #e8d5c0;
  flex: 0 0 auto;
}
.wizard-steps { min-width: 0; flex: 1; }
.wizard-step { margin-bottom: 1.05rem; }
.wizard-step:last-child { margin-bottom: 0; }
.wizard-step h4 {
  font-size: 1.02rem;
  margin: 0 0 0.3rem;
  font-weight: 650;
}
.wizard-step .btn-ghost,
.wizard-step .btn-primary { margin-top: 0.35rem; }
.wizard-status {
  margin-top: 0.65rem;
  font-size: 0.95rem;
  line-height: 1.5;
}
.wizard-status.is-ok { color: var(--good); }
.wizard-status.is-fail { color: var(--again); }
.serp-advanced {
  margin-top: 0.4rem;
  padding: 0.35rem 0 0;
}
.serp-advanced summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}
.serp-advanced .field { margin-top: 0.45rem; }
.key-wizard[hidden],
#wizard-hide[hidden],
#wizard-status[hidden],
#key-wizard[hidden] { display: none !important; }
@media (max-width: 640px) {
  .wizard-layout { flex-direction: column; align-items: center; text-align: left; }
  .wizard-elara { width: 96px; }
  .calm-banner { flex-direction: column; align-items: flex-start; }
}


/* ---------- Creator social links (optional, hidden when unset) ---------- */
.social-follow {
  margin: 0.85rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
}
.social-follow[hidden] { display: none !important; }
.social-follow-label {
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--ink-soft);
  margin-right: 0.15rem;
}
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.social-link:hover, .social-link:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
  outline: none;
}
.social-link svg { width: 1.05rem; height: 1.05rem; display: block; }
.modal-card .social-follow { margin-top: 1rem; }

/* ---------- Mobile readability (full-width cards, no sideways scroll) ---------- */
@media (max-width: 720px) {
  .hunt-field,
  .hunt-market,
  .hunt-region-btn,
  .hunt-form .btn-primary {
    flex: 0 0 auto !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
  }
  .hunt-market,
  .hunt-region-btn { min-height: 44px; }
  :root,
  [data-theme="ledger"] {
    --bg: #ece8e1;
    --bg-elev: #ffffff;
    --bg-mute: #f3efe8;
    --line: #e4ddd3;
    --shadow: 0 1px 2px rgba(42, 35, 24, 0.05);
    --paper: #ffffff;
  }
  [data-theme="grove"] {
    --bg: #e7eee8;
    --bg-elev: #ffffff;
    --bg-mute: #f2f6f2;
    --line: #d5dfd6;
    --shadow: 0 1px 2px rgba(28, 36, 28, 0.05);
    --paper: #ffffff;
  }

  .hero { padding: 0.9rem 1rem 0.9rem; margin-bottom: 0.65rem; }
  .hero h1 { font-size: 1.5rem; line-height: 1.2; }
  .hero-lead {
    font-size: 0.95rem;
    margin-bottom: 0.7rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hero.card,
  .card {
    padding: 1rem 1.05rem;
    border-radius: 14px;
    max-width: 100%;
  }

  input[type="search"],
  input[type="text"],
  input[type="url"],
  input[type="number"],
  input[type="password"],
  select,
  textarea,
  .hunt-form input[type="search"],
  .hunt-market,
  .hunt-region-btn,
  .region-search,
  .browse-tools input[type="search"],
  .browse-tools select,
  .field input,
  .field select,
  .field textarea,
  #item-search,
  .fetch-toolbar select {
    font-size: 16px !important;
    max-width: 100%;
  }

  .fetch-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }
  .fetch-toolbar label,
  .fetch-toolbar select,
  .fetch-toolbar .btn-ghost,
  .fetch-toolbar input[type="range"] { width: 100%; max-width: 100%; }
  .browse-tools { flex-direction: column; align-items: stretch; }
  .browse-tools input[type="search"],
  .browse-tools select { width: 100%; min-width: 0; }

  /* Tabs already fitted in the earlier 720 block. Keep them inside the page. */
  .nav, .top, .top-actions, .brand, .hello { max-width: 100%; min-width: 0; }
  .top-actions { flex-shrink: 0; }

  /* Product detail: stack so the title is never squeezed by buttons */
  .study-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }
  .study-head #leave-item { align-self: flex-start; }
  .study-meta { width: 100%; flex: 1 1 auto; min-width: 0; }
  .study-deck {
    font-size: 1.4rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: normal;
  }
  .head-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
  }
  .head-actions .btn-ghost,
  .head-actions .btn-primary {
    flex: 1 1 8rem;
    min-height: 44px;
    justify-content: center;
  }

  #item-detail .settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.7rem;
  }
  #item-detail .settings-actions > * {
    flex: 1 1 100%;
    min-height: 44px;
    margin: 0;
  }
  #item-detail .settings-actions .check {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.2rem;
  }

  /* Price history as stacked rows, no horizontal table scroll */
  .price-table,
  .price-table thead,
  .price-table tbody,
  .price-table th,
  .price-table td,
  .price-table tr { display: block; width: 100%; max-width: 100%; }
  .price-table { overflow: visible; }
  .price-table thead { display: none; }
  .price-table tr {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
  }
  .price-table tr:last-child { border-bottom: 0; }
  .price-table td {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.2rem 0;
    border: 0;
    text-align: right;
  }
  .price-table td::before {
    content: attr(data-label);
    color: var(--ink-soft);
    font-size: 0.8rem;
    text-align: left;
    flex: 0 1 auto;
  }
  .price-table td:last-child { justify-content: flex-end; }

  .list-row, .watch-row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.45rem 0.7rem;
  }
  .list-row > strong, .watch-row > strong,
  .list-row > label, .watch-row > .item-meta:last-child {
    grid-column: 2;
  }
  .list-row input[type="number"] { width: 4rem; max-width: 100%; font-size: 16px; }

  /* Offers: Google-style single column cards */
  #fetch-panel.card {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0.2rem 0 0;
  }
  #fetch-panel .card-head { padding: 0 0.15rem; }
  .offer-list { gap: 0.55rem; }
  .offer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    grid-template-areas:
      "source thumb"
      "title  thumb"
      "head   head"
      "price  price"
      "score  score"
      "ship   ship"
      "meta   meta"
      "why    why"
      "tip    tip"
      "actions actions";
    gap: 0.2rem 0.75rem;
    align-items: start;
    padding: 1rem 1.05rem 0.95rem;
    border: 0;
    border-radius: 12px;
    background: var(--bg-elev);
    box-shadow: var(--shadow);
    max-width: 100%;
  }
  .offer.is-cheap, .offer.is-best, .offer.is-warn {
    box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--cheap) 45%, transparent);
  }
  .offer.is-warn { box-shadow: var(--shadow), 0 0 0 1px rgba(196, 132, 58, 0.45); }
  .offer-body { display: contents; }
  .offer-source-row { grid-area: source; margin: 0; min-width: 0; }
  .offer-title {
    grid-area: title;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
    font-size: 1.25rem; /* 20px */
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -0.015em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0.1rem 0 0.15rem;
  }
  .offer-title a { color: inherit; text-decoration: none; }
  .offer-thumb {
    grid-area: thumb;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    align-self: start;
    justify-self: end;
  }
  .offer-head { grid-area: head; margin: 0.15rem 0 0.1rem; }
  .offer-price {
    grid-area: price;
    margin-top: 0.15rem;
  }
  .offer-price small { display: none; }
  .offer-price strong {
    display: block;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
    font-size: 1.45rem;
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
  }
  .offer-score { grid-area: score; min-width: 0; margin-top: 0.15rem; }
  .offer-num:not(.offer-price) { grid-area: ship; font-size: 0.88rem; color: var(--ink-soft); }
  .offer-meta {
    grid-area: meta;
    font-size: 0.94rem; /* ~15px */
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.15rem;
  }
  .why-btn { grid-area: why; min-height: 36px; }
  .why-tip { grid-area: tip; }
  .offer-actions {
    grid-area: actions;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    margin-top: 0.55rem;
    padding-right: 0;
  }
  .offer-actions .btn-ghost {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  /* Autocomplete like "Mọi người cũng tìm kiếm" */
  .suggest {
    border-radius: 12px;
    padding: 0.2rem 0;
    max-height: min(18rem, 60vh);
  }
  .suggest-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.9rem;
    min-height: 48px;
    font-size: 1rem;
  }
  .suggest-item .suggest-q {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .suggest-item .suggest-kind { display: none; }
  .suggest-ico {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    justify-self: end;
  }
  .suggest-ico svg { width: 16px; height: 16px; display: block; }

  .item-grid { display: flex; flex-direction: column; gap: 0.55rem; }
  .item-card { max-width: 100%; }

  .stats { grid-template-columns: 1fr 1fr; }
}

/* Desktop still shows a search icon if present, tucked neatly */
.suggest-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
}
@media (min-width: 721px) {
  .suggest-ico {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--line);
  }
  .suggest-item { align-items: center; }
}

.elara-helper.is-busy .elara-thought,
.elara-helper.is-busy .elara-now {
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Shopping region picker */
.hunt-region-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  min-height: 44px;
  min-width: 0;
  max-width: 18rem;
  flex: 0 1 14rem;
  cursor: pointer;
  text-align: left;
}
.hunt-region-btn:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hunt-region-flag { font-size: 1.05rem; line-height: 1; flex: 0 0 auto; }
.hunt-region-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.92rem;
}
.hunt-region-cur {
  flex: 0 0 auto;
  font-size: 0.75rem;
  color: var(--ink-soft);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.03em;
}
.region-sheet[hidden] { display: none !important; }
.region-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.region-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 12, 0.45);
}
.region-sheet-panel {
  position: relative;
  z-index: 1;
  width: min(32rem, 100%);
  max-height: min(88dvh, 40rem);
  background: var(--bg-elev);
  color: var(--ink);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  padding: 0.9rem 0.9rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
}
.region-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}
.region-sheet-head h2 { margin: 0; font-size: 1.05rem; }
.region-sheet-close {
  border: 0;
  background: var(--bg-mute);
  color: var(--ink);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.region-search {
  width: 100%;
  font: inherit;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  min-height: 44px;
  background: var(--bg);
  color: var(--ink);
  margin-bottom: 0.55rem;
}
.region-list {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-height: 0;
  flex: 1 1 auto;
}
.region-group {
  margin: 0.55rem 0.2rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.region-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0.55rem 0.45rem;
  min-height: 44px;
  border-radius: 10px;
  cursor: pointer;
}
.region-option:hover,
.region-option:focus { background: var(--bg-mute); outline: none; }
.region-option.is-current { background: var(--bg-mute); font-weight: 650; }
.region-option-flag { font-size: 1.25rem; width: 1.6rem; text-align: center; flex: 0 0 auto; }
.region-option-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.region-option-cur { flex: 0 0 auto; font-size: 0.78rem; color: var(--ink-soft); }
body.region-sheet-open { overflow: hidden; }

/* Authenticity chips and tags */
.auth-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
}
.auth-chip {
  flex: 1 1 0;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 999px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.45rem;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
}
.auth-chip.is-on {
  background: #1d3557;
  border-color: #1d3557;
  color: #fff;
}
.auth-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 999px;
  padding: 0.08rem 0.42rem;
  line-height: 1.3;
  white-space: nowrap;
  margin-left: 0.25rem;
  vertical-align: middle;
  cursor: help;
}
.auth-tag.is-official,
.auth-tag.is-official.badge-official { background: #e6f4ea; color: #137333; padding: 0.08rem 0.42rem; font-size: 0.68rem; }
.auth-tag.is-regular { background: #f1efe9; color: #5c574e; }
.auth-note { font-size: 0.78rem; margin: 0.65rem 0 0; }

@media (min-width: 721px) {
  .region-sheet { align-items: center; }
  .region-sheet-panel {
    border-radius: 18px;
    max-height: min(80vh, 40rem);
    width: min(28rem, 92vw);
  }
}

@media (max-width: 720px) {
  .hunt-region-btn { max-width: 100%; }
  .auth-chip { font-size: 0.75rem; padding: 0.28rem 0.35rem; min-height: 36px; }
  .auth-filters { width: 100%; }
  .region-sheet-panel {
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
  }
}

/* Sort select — pill style, aligned with authenticity chips */
.sort-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
  width: 100%;
  min-width: 0;
  margin: 0;
}
.sort-field .sort-label {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--ink-soft);
}
.sort-select,
.fetch-toolbar .sort-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background-color: var(--bg);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%235c574e' d='M1.2 1.2L6 6l4.8-4.8 1.2 1.2L6 8.4 0 2.4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
  background-size: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 40px;
  padding: 0.4rem 2.2rem 0.4rem 0.95rem;
  cursor: pointer;
}
.sort-select:focus,
.fetch-toolbar .sort-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.elara-guide-slot:empty { display: none; }

@media (max-width: 720px) {

  .elara-guide-slot {
    width: 100%;
    max-width: 100%;
    margin: 0.7rem 0 0;
  }
  .elara-guide-slot .elara-bubble {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    max-width: 100%;
    width: 100%;
    margin: 0;
    box-shadow: 0 6px 16px rgba(20,16,12,0.1);
  }
  .elara-guide-slot .elara-portrait,
  .elara-guide-slot .elara-bubble .elara-portrait {
    width: 64px;
    height: 80px;
    object-fit: cover;
    object-position: top center;
    border-radius: 12px;
    flex: 0 0 auto;
  }
  .sort-select,
  .fetch-toolbar .sort-select { min-height: 44px; font-size: 16px !important; }
}

@media (max-width: 720px) {
  body.elara-guide-inline .elara-thought,
  body.elara-guide-inline .elara-now { display: none !important; }
  body.elara-guide-inline #view-hunt { padding-bottom: 7.5rem; }
  .elara-guide-slot .elara-tip { margin: 0.15rem 0 0.3rem; }
  .elara-guide-slot .elara-bubble-actions { flex-wrap: wrap; gap: 0.25rem 0.6rem; }
}

@media (max-width: 720px) {
  .hunt-image-btn { width: 44px; height: 44px; }
  .hunt-field input[type="search"] { padding-right: 3rem; font-size: 16px !important; }
  .hunt-image-preview { max-width: 100%; }
}

.everywhere-china-note,
.taobao-image-note {
  margin: 0.35rem 0 0.7rem;
  overflow-wrap: break-word;
  word-break: break-word;
}
.taobao-image-note a {
  font-weight: 650;
}

/* ===== h7 (2026-11-24): layout + overlay fixes ===== */
/* Suggestions sit in the page flow, so they push the search button down instead of covering it. */
.hunt-form { align-items: flex-start; }
.hunt-field .suggest,
.hunt-field .suggest:not([hidden]) {
  position: static;
  top: auto; left: auto; right: auto;
  margin-top: 0.35rem;
  width: 100%;
  box-shadow: 0 8px 20px rgba(42, 35, 24, 0.12);
}
.hunt-field { z-index: auto; }
/* Hero copy is never clipped on phones. */
@media (max-width: 720px) {
  .hero-lead { display: block; -webkit-line-clamp: unset; overflow: visible; }
  .hunt-form input[type="search"]::placeholder { text-overflow: ellipsis; }
}

/* ELARA: a small pill when there is no free margin beside the content. */
#view-hunt { padding-right: 0; padding-bottom: 2rem; }
@media (min-width: 1180px) {
  /* Wide screens keep a free right margin for the ELARA figure, so it never covers content. */
  #view-hunt { padding-right: 10rem; padding-bottom: 14rem; }
}
.elara-pill { display: none; }
.elara-helper.is-compact .elara-figure,
.elara-helper.is-compact .elara-fab,
.elara-helper.is-compact .elara-now { display: none !important; }
.elara-helper.is-compact .elara-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 36px;
  padding: 0 0.7rem 0 0.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(20,16,12,0.12);
}
.elara-helper.is-compact .elara-pill img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: top; }
.elara-helper.is-compact .elara-music { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
.elara-helper.is-compact { gap: 0.4rem; }
body.elara-compact-on:not(.elara-inflow) .foot { padding-bottom: 4.5rem; }
body.elara-compact-on:not(.elara-inflow) main { padding-bottom: 3.5rem; }
.elara-pill-slot:empty { display: none; }
.elara-pill-slot { margin: 0.55rem 0 0; }
.elara-helper.is-inflow {
  position: static;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  z-index: auto;
}
.elara-helper.is-inflow .elara-bubble { order: 3; flex-basis: 100%; max-width: 100%; box-shadow: none; }
@media (min-width: 1180px) {
  .foot { padding-right: 12rem; }
}
/* Wide screens: the figure and its notes stay inside the free right margin. */
.elara-helper:not(.is-compact) .elara-bubble { max-width: min(380px, var(--elara-gutter, 380px)); }
.elara-helper:not(.is-compact) .elara-now { max-width: min(13rem, var(--elara-gutter, 13rem)); }

/* Results: relevance + info rows + empty states */
.relevance-note, .auth-empty {
  border: 1px solid var(--line);
  background: var(--bg-mute, rgba(0,0,0,0.03));
  border-radius: 14px;
  padding: 0.7rem 0.9rem;
  margin: 0.6rem 0;
}
.relevance-note p, .auth-empty p { margin: 0.2rem 0; }
.relevance-hints { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.similar-heading { border-top: 1px dashed var(--line); padding-top: 0.6rem; margin-top: 0.4rem; }
.offer.is-similar { opacity: 0.86; }
.offer.is-info { grid-template-columns: auto 1fr auto; }
.offer.is-info .offer-actions { align-self: center; }
.auth-tag.is-info-tag { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }
.learn-more { white-space: nowrap; }
.quota-stores { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0; }
.quota-stores a { text-decoration: none; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0.4rem 0; }
.foot-links a { color: inherit; }
.history-note { font-size: 0.8rem; color: var(--ink-soft); margin: 0.1rem 0 0.4rem; }
.watch-note { font-size: 0.82rem; color: var(--ink-soft); margin: 0 0 0.6rem; }
@media (max-width: 720px) {
  .offer.is-info { grid-template-columns: 1fr; }
  .learn-more { width: 100%; text-align: center; }
}
/* Wide screens: the whole dock (now playing, music button, figure) stays inside the free margin. */
.elara-helper:not(.is-compact) .elara-dock { max-width: var(--elara-gutter, 240px); flex-wrap: wrap; justify-content: flex-end; }

/* h9: thumbnail placeholder, search busy state, scroll target */
.offer-thumb { position: relative; overflow: hidden; }
.offer-thumb img { position: absolute; inset: 0; z-index: 1; }
.offer-thumb.is-empty::after { content: none; }
.thumb-ph {
  display: flex; align-items: center; justify-content: center;
  width: 2.6rem; height: 2.6rem; border-radius: 10px;
  background: var(--bg-elev, #f3eee4); color: var(--muted, #7a6f60);
  font-weight: 700; font-size: 1.1rem; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
#fetch-panel { scroll-margin-top: calc(var(--sticky-offset, 0px) + 12px); }
#fetch-title:focus { outline: none; }
#fetch-title:focus-visible { outline: 2px solid var(--accent, #b55a2a); outline-offset: 3px; border-radius: 4px; }
.btn-primary.is-busy { opacity: 0.85; cursor: progress; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }
.btn-spinner {
  display: inline-block; width: 1em; height: 1em; flex: none;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: glean-spin 0.7s linear infinite; vertical-align: -0.15em;
}
@keyframes glean-spin { to { transform: rotate(360deg); } }
.search-loading .searching-note { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; margin: 0.25rem 0 0.8rem; }
.search-skeleton { display: grid; gap: 0.6rem; }
.search-skeleton span {
  display: block; height: 84px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(0,0,0,0.05), rgba(0,0,0,0.09), rgba(0,0,0,0.05));
  background-size: 200% 100%; animation: glean-shimmer 1.2s ease-in-out infinite;
}
@keyframes glean-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .btn-spinner { animation: none; border-right-color: currentColor; opacity: 0.5; }
  .search-skeleton span { animation: none; }
}

/* h10: 0-match message + unrelated toggle */
.relevance-note.no-match .no-match-title { margin: 0 0 .35rem; }
.unrelated-results { margin: 1rem 0; border-top: 1px dashed var(--line, #ccc); padding-top: .75rem; }
.unrelated-results > summary { cursor: pointer; font-weight: 600; padding: .5rem 0; min-height: 44px; display: flex; align-items: center; }
.unrelated-results > summary .lbl-hide { display: none; }
.unrelated-results[open] > summary .lbl-show { display: none; }
.unrelated-results[open] > summary .lbl-hide { display: inline; }
.unrelated-results .offer { opacity: .8; }
.recent-chip {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); background: var(--bg-elev); color: inherit;
  font: inherit; font-size: 0.85rem; padding: 0.4rem 0.7rem; border-radius: 999px;
  cursor: pointer; min-height: 36px; text-decoration: none;
}
.recent-chip:hover { border-color: var(--ink-soft); }
.unrelated-results > summary { list-style: none; gap: .5rem; }
.unrelated-results > summary::-webkit-details-marker { display: none; }
.unrelated-results > summary::before { content: "▸"; display: inline-block; transition: transform .15s; }
.unrelated-results[open] > summary::before { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .unrelated-results > summary::before { transition: none; } }
/* h12: implausibly low price note (hidden "other" section) */
.bogus-price-note { margin: .2rem 0 0; font-size: .82rem; color: var(--warn, #9a3412); }
