:root {
  --bg: #fbf8f6;
  --surface: #ffffff;
  --text: #221a1c;
  --muted: #6f6266;
  --line: #eadfe0;
  --accent: #a12c4b;
  --accent-soft: #fbe9ed;
  --rose-1: #f3a9b8;
  --rose-2: #de6f88;
  --rose-3: #c2415f;
  --rose-4: #a12c4b;
  --rose-5: #7f1f3a;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151112;
    --surface: #1f191b;
    --text: #f4ecee;
    --muted: #ab9da1;
    --line: #33292c;
    --accent: #f08aa2;
    --accent-soft: #3a1f27;
  }
}

/* House style: square corners everywhere, hairline rules instead of floating cards. */
* { box-sizing: border-box; border-radius: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent); }
.skip { position: absolute; left: 8px; top: -60px; z-index: 10; background: var(--text); color: var(--bg); padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 8px; }
.results:focus { outline: none; }
.gallery:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Header / search ---------- */
.top {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: padding .25s ease;
}
body.home .top { padding-top: min(22vh, 200px); }
body.searched .top { padding-top: 20px; }

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.gem { width: 64px; height: 64px; flex: none; transition: width .25s, height .25s; }
.wordmark { font-family: Georgia, "Times New Roman", serif; font-size: 52px; letter-spacing: -.02em; line-height: 1; transition: font-size .25s; }
.wordmark-sub { font-family: "Segoe UI", system-ui, sans-serif; font-size: .3em; letter-spacing: .32em; text-transform: uppercase; color: var(--accent); margin-left: .6em; vertical-align: .9em; }
.tagline { margin: 14px 0 26px; color: var(--muted); text-align: center; }
.tagline-kinds { display: block; margin-top: 6px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }

body.searched .gem { width: 34px; height: 34px; }
body.searched .wordmark { font-size: 28px; }
body.searched .tagline, body.searched .examples { display: none; }
body.searched .brand { margin-bottom: 14px; }

.search {
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 6px 6px 6px 16px;
  background: var(--surface);
  border: 1px solid var(--text);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.search textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 17px;
  line-height: 1.45;
  padding: 8px 0;
  max-height: 140px;
}
/* One line only: a wrapped placeholder would be cut off inside the one-row field. */
.search textarea::placeholder { color: var(--muted); opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search button {
  flex: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: var(--rose-4);
  display: grid;
  place-items: center;
  transition: background .15s, transform .1s;
}
.search button:hover { background: var(--rose-3); }
.search button:active { transform: scale(.95); }
.search button svg { width: 20px; height: 20px; fill: #fff; }

.examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.examples button, .chip {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 7px 14px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}
.examples button:hover, a.chip:hover { border-color: var(--rose-2); color: var(--text); }

/* ---------- Results ---------- */
.results { width: 100%; max-width: 760px; margin: 22px auto 0; padding: 0 16px; flex: 1; }
.understanding {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.understanding svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.understanding p { margin: 0; }
.understanding p.answer { font-size: 16.5px; line-height: 1.55; }
.followups { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.place-question p { margin: 0; }
.place-pick { border: 1px solid var(--accent); background: transparent; color: var(--text); padding: 7px 14px; font-weight: 600; }
.place-pick:hover { background: var(--accent); color: var(--bg); }
.followup { border: 1px solid var(--accent); background: transparent; color: var(--text); padding: 6px 12px; font-size: 14px; }
.followup:hover { background: var(--accent); color: var(--bg); }
.understanding .filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 13px; padding: 2px 10px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }

.meta { font-size: 14px; color: var(--muted); margin: 0 4px 10px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.toolbar .meta { margin-bottom: 0; }
.sort { display: flex; flex-wrap: wrap; align-items: center; font-size: 13px; }
.sort-label { color: var(--muted); margin-right: 8px; }
.sort button { border: 1px solid var(--line); margin-left: -1px; background: transparent; padding: 5px 10px; font-size: 13px; color: var(--muted); }
.sort button:hover { color: var(--text); }
.sort button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); position: relative; }
.sort-note { margin: 0 4px 10px; font-size: 13px; color: var(--muted); }
.more-inline { border: 0; border-bottom: 1px solid currentColor; background: transparent; padding: 0; font-size: 13px; font-weight: 600; color: var(--accent); }
.more-inline:disabled { opacity: .6; cursor: default; }
.load-more { display: block; width: 100%; margin-top: 16px; padding: 12px; border: 1px solid var(--text); background: transparent; font-weight: 600; }
.load-more:hover { background: var(--text); color: var(--bg); }
.load-more:disabled { opacity: .6; cursor: default; }
.list-end { margin: 14px 4px 0; font-size: 14px; color: var(--muted); }
.alert-form { border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 14px 16px; margin: 18px 0 6px; }
.alert-form label { display: block; font-weight: 600; margin-bottom: 8px; }
.alert-row { display: flex; gap: 0; }
.alert-row[hidden] { display: none; }
.alert-row input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; padding: 9px 12px; }
.alert-row button { border: 0; background: var(--rose-4); color: #fff; font-weight: 600; padding: 9px 18px; }
.alert-row button:hover { background: var(--rose-3); }
.alert-note, .alert-status { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.alert-status:empty { display: none; }
.alert-status { color: var(--text); }
.notice { background: var(--surface); border: 1px solid var(--line); padding: 16px; margin-bottom: 14px; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.divider { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 22px 4px 8px; border-bottom: 1px solid var(--line); }
.item { border-bottom: 1px solid var(--line); transition: background .15s; }
.item:hover, .item.open { background: var(--surface); }
.item.open { box-shadow: inset 3px 0 0 var(--accent); }
.row { width: 100%; display: flex; gap: 14px; align-items: center; padding: 10px; border: 0; background: transparent; text-align: left; }
.thumb { width: 112px; height: 78px; flex: none; object-fit: cover; background: var(--line); }
.thumb.empty { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-facts { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-why { font-size: 14px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-source { font-size: 12px; color: var(--muted); margin-top: 2px; }
.row-price { flex: none; font-weight: 700; font-size: 18px; white-space: nowrap; padding-right: 6px; }
.chev { flex: none; width: 18px; height: 18px; fill: var(--muted); transition: transform .2s; }
.item.open .chev { transform: rotate(180deg); }

.detail { border-top: 1px solid var(--line); padding: 16px; }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin-bottom: 14px; padding-bottom: 4px; }
.gallery img { height: 220px; scroll-snap-align: start; background: var(--line); }
.summary { margin: 0 0 14px; font-size: 16.5px; }
.summary-label { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; font-weight: 600; }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; margin: 0 0 16px; }
.specs div { min-width: 0; }
.specs .wide { grid-column: 1 / -1; }
/* position: relative so that visually hidden text inside a scrolled table is clipped with it and cannot widen the page. */
.table-scroll { position: relative; overflow-x: auto; margin: 0 0 26px; }
.table-scroll table { border-collapse: collapse; width: 100%; }
.table-scroll th, .table-scroll td { text-align: left; padding: 6px 14px 6px 0; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table-scroll th { border-bottom-color: var(--text); font-size: 14px; }
.spec-hint { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.specs dt { font-size: 12px; color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.seller { font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--rose-4);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 11px 20px;
}
.cta:hover { background: var(--rose-3); }
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.save { border: 1px solid var(--text); background: transparent; padding: 10px 16px; font-weight: 600; }
.save:hover { background: var(--text); color: var(--bg); }
.save[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.save[aria-pressed="true"]:hover { background: var(--accent); color: var(--bg); }
.saved-link { margin-top: 12px; font-size: 14px; color: var(--accent); }
.saved-head { margin: 0 0 6px; font-size: 20px; }
.saved-note { margin: 0 4px 14px; font-size: 14px; color: var(--muted); }
.cta svg { width: 16px; height: 16px; fill: currentColor; }

.more { margin: 22px 0 8px; }
.more h2 { font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 4px 10px; }
.more-links { display: flex; flex-wrap: wrap; gap: 8px; }
a.chip { color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.chip-note { font-size: 12px; color: var(--muted); }
a.chip svg { width: 13px; height: 13px; fill: var(--muted); }

.skeleton { height: 98px; margin-bottom: 1px; background: linear-gradient(90deg, var(--line) 25%, var(--surface) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
.detail .skeleton { height: 120px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } * { transition: none !important; } }

.foot { max-width: 760px; margin: 0 auto; padding: 28px 16px 22px; text-align: center; font-size: 13px; color: var(--muted); }
.foot p { margin: 0; }
.foot .owner-note { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--accent); }
.owner-box { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); padding: 14px 16px; margin: 0 0 26px; }
.owner-box p { margin: 0 0 10px; }
.owner-box button { border: 1px solid var(--text); background: transparent; padding: 7px 14px; font-weight: 600; }
.owner-box button:hover { background: var(--text); color: var(--bg); }

@media (max-width: 560px) {
  body.home .top { padding-top: 12vh; }
  .gem { width: 48px; height: 48px; }
  .wordmark { font-size: 38px; }
  .thumb { width: 84px; height: 64px; }
  .row { gap: 10px; flex-wrap: wrap; }
  .row-main { flex-basis: calc(100% - 100px); }
  .row-price { margin-left: 94px; font-size: 17px; }
  .chev { margin-left: auto; }
  .gallery img { height: 170px; }
}

/* Compare: a tick box per row, a bar while something is ticked, a table when asked. */
.pick { display: block; padding: 0 10px 10px 136px; font-size: 13px; color: var(--muted); cursor: pointer; }
.pick input { margin: 0 6px 0 0; accent-color: var(--rose-4); vertical-align: -2px; }
.pick:has(input:checked) { color: var(--text); font-weight: 600; }
.pick:has(input:disabled) { opacity: .5; cursor: default; }
.compare-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 10px 16px; background: var(--text); color: var(--bg); font-size: 14px; }
.compare-bar button { border: 1px solid var(--bg); background: transparent; color: var(--bg); padding: 7px 16px; font-weight: 600; }
.compare-bar .compare-go { background: var(--bg); color: var(--text); }
.compare-bar button:disabled { opacity: .5; cursor: default; }
.compare-bar button:focus-visible { outline: 2px solid var(--rose-1); outline-offset: 2px; }
body:has(.compare-bar) .foot { padding-bottom: 80px; }
.compare { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); padding: 14px 16px 2px; margin-bottom: 18px; }
.compare:focus { outline: none; }
.compare-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.compare-head h2 { margin: 0; font-size: 18px; }
.compare-close { border: 1px solid var(--text); background: transparent; padding: 6px 12px; font-size: 14px; }
.compare-close:hover { background: var(--text); color: var(--bg); }
.compare-note { margin: 6px 0 12px; font-size: 13px; color: var(--muted); }
.compare table { min-width: 100%; }
.compare th, .compare td { vertical-align: top; white-space: normal; min-width: 150px; padding: 8px 14px 8px 0; }
.compare thead th { font-size: 15px; }
.compare thead th img { display: block; width: 150px; height: 100px; object-fit: cover; margin-bottom: 6px; background: var(--line); }
.compare tbody th { min-width: 96px; font-size: 13px; font-weight: 400; color: var(--muted); border-bottom-color: var(--line); }
.compare td.best { font-weight: 700; }
.compare .best-word { font-size: 12px; font-weight: 600; color: var(--accent); border: 1px solid var(--accent); padding: 0 5px; margin-left: 4px; white-space: nowrap; }
.compare .none { color: var(--muted); font-size: 13px; }
@media (max-width: 560px) {
  .pick { padding-left: 104px; }
  .compare th, .compare td { min-width: 128px; }
  .compare thead th img { width: 128px; height: 86px; }
}
