/* HackerZon. One grotesk (Archivo, variable width) + one mono (IBM Plex Mono) for ASINs and code only. */
:root {
  --ground: #f2f2f0;
  --surface: #ffffff;
  --sunk: #e9e9e6;
  --ink: #161616;
  --ink-2: #555555;
  --ink-3: #6b6b6b;
  --line: #e4e4e1;
  --rule: #efefec;
  --control: #cfcfcb;
  --accent: #0d6b45;
  --accent-ink: #ffffff;
  --accent-tint: #e2f0e8;
  --amber-tint: #fff0d4;
  --amber-ink: #6b4300;
  --focus: #0d6b45;
  --r: 4px;
  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 14px/20px var(--sans);
  font-variation-settings: "wdth" 100;
  font-feature-settings: "tnum" 1;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: 52px; display: flex; align-items: center; gap: 16px;
  padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 16px; font-variation-settings: "wdth" 88; white-space: nowrap; }
.brand svg { display: block; }
.brand small { font-weight: 400; color: var(--ink-2); font-size: 13px; font-variation-settings: "wdth" 100; }
.search { flex: 1; max-width: 560px; position: relative; }
.search input {
  width: 100%; height: 34px; padding: 0 36px 0 10px;
  border: 1px solid var(--control); border-radius: var(--r); background: var(--surface);
}
.search kbd { position: absolute; right: 8px; top: 7px; }
kbd {
  font-family: var(--mono); font-size: 11px; line-height: 18px; min-width: 18px; text-align: center;
  padding: 0 4px; border: 1px solid var(--control); border-bottom-width: 2px; border-radius: 3px; color: var(--ink-2); background: var(--surface);
  display: inline-block;
}
.topbar .spacer { flex: 1; }
.textbtn {
  border: 0; background: none; padding: 6px 8px; border-radius: var(--r); cursor: pointer; white-space: nowrap; color: var(--ink);
}
.textbtn:hover { background: var(--sunk); }

/* Shell */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 0; min-height: calc(100vh - 52px); }
.facets { border-right: 1px solid var(--line); background: var(--ground); padding: 16px 20px 80px 24px; position: sticky; top: 52px; height: calc(100vh - 52px); overflow-y: auto; }
.main { padding: 20px 29px 64px; min-width: 0; }

/* Facets */
.facet { padding: 12px 0; border-bottom: 1px solid var(--line); }
.facet:last-child { border-bottom: 0; }
.facet h2 { font-size: 13px; line-height: 20px; margin: 0 0 6px; font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; }
.facet h2 .why { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.facet .opt { display: flex; align-items: center; gap: 8px; min-height: 26px; cursor: pointer; }
.facet .opt input { margin: 0; accent-color: var(--accent); flex: none; }
.facet .opt span.l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet .opt span.c { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.facet .opt.zero { color: var(--ink-3); }
.facet .more { border: 0; background: none; padding: 2px 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font-size: 13px; }
.facet .find { width: 100%; height: 28px; border: 1px solid var(--control); border-radius: var(--r); padding: 0 8px; margin-bottom: 6px; background: var(--surface); font-size: 13px; }
.facet-group { margin-top: 8px; }
.facet-group > summary { cursor: pointer; font-weight: 600; font-size: 13px; padding: 10px 0; list-style-position: inside; }
.facet-group > summary .why { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.years { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.years select { height: 28px; border: 1px solid var(--control); border-radius: var(--r); background: var(--surface); padding: 0 4px; }
.hist { display: flex; align-items: flex-end; gap: 1px; height: 40px; }
.hist button { flex: 1; border: 0; padding: 0; background: var(--control); cursor: pointer; min-height: 1px; }
.hist button.in { background: var(--accent); }
.hist button:hover { outline: 1px solid var(--ink); }
.hist-axis { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 11px; line-height: 16px; }

/* Header of the list */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
h1 { font-size: 24px; line-height: 30px; margin: 0; font-weight: 700; font-variation-settings: "wdth" 90; letter-spacing: -0.01em; }
.summary { margin: 4px 0 0; color: var(--ink-2); }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.seg { display: inline-flex; border: 1px solid var(--control); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.seg button { border: 0; background: none; height: 32px; padding: 0 12px; cursor: pointer; white-space: nowrap; border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.sortnote { color: var(--ink-3); font-size: 12px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; min-height: 0; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 9px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--control); white-space: nowrap; flex: none; font-size: 13px;
}
.tag b { font-weight: 400; color: var(--ink-2); }
.tag button { border: 0; background: none; width: 20px; height: 20px; cursor: pointer; border-radius: 3px; font-size: 15px; line-height: 1; }
.tag button:hover { background: var(--sunk); }
.tag.clear { border-style: dashed; padding: 0 9px; cursor: pointer; background: none; }

/* List (ledger) */
.ledger { margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.lhead, .row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 240px 64px 92px 32px; gap: 16px; align-items: center; padding: 0 16px; }
.lhead { height: 36px; color: var(--ink-3); font-size: 12px; border-bottom: 1px solid var(--line); position: sticky; top: 52px; background: var(--surface); z-index: 5; border-radius: var(--r) var(--r) 0 0; }
.lhead .axis { display: flex; justify-content: space-between; }
.lhead .r, .row .r { text-align: right; }
.row { min-height: 84px; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); position: relative; }
.row:last-child { border-bottom: 0; }
.row.sel { background: #f6f6f4; box-shadow: inset 3px 0 0 var(--ink); }
.thumb { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: var(--surface); position: relative; text-decoration: none; }
/* The box sets the size, the image never does: portrait and landscape images fit inside the same square. */
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb.none { background: var(--sunk); color: var(--ink-3); font-size: 11px; line-height: 14px; text-align: center; padding: 4px; }
.ptitle { font-weight: 600; font-size: 15px; line-height: 20px; font-variation-settings: "wdth" 88; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ptitle:hover { text-decoration: underline; }
.row.seen .ptitle { color: var(--ink-2); }
.pmeta { margin-top: 3px; color: var(--ink-2); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pmeta .sep { color: var(--control); }
.pill { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 3px; font-size: 11px; line-height: 18px; white-space: nowrap; flex: none; }
.pill.topic { background: var(--accent-tint); color: #0a4a30; }
.pill.gone { background: var(--amber-tint); color: var(--amber-ink); }
.pill.mock { background: var(--sunk); color: var(--ink-2); }
.users { font-size: 20px; line-height: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.users small { display: block; font-size: 11px; line-height: 14px; font-weight: 400; color: var(--ink-3); }
.when { font-size: 12px; line-height: 16px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.star { border: 0; background: none; width: 32px; height: 32px; cursor: pointer; border-radius: var(--r); color: var(--ink-3); font-size: 17px; }
.star:hover { background: var(--sunk); }
.star[aria-pressed="true"] { color: var(--ink); }

/* Signature: the recommendation strip. One tick per HN user, placed at their first recommendation. */
.strip { position: relative; height: 22px; }
.strip::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.strip .out { position: absolute; top: 0; bottom: 0; background: var(--surface); opacity: .8; z-index: 1; }
.strip i { position: absolute; top: 3px; bottom: 3px; width: 2px; margin-left: -1px; background: var(--accent); }
.strip i.again { top: 7px; bottom: 7px; background: var(--ink-3); }
.strip.big { height: 44px; }
.strip.big i { top: 6px; bottom: 6px; width: 3px; cursor: pointer; }
.strip.big i.again { top: 14px; bottom: 14px; }
.strip.big i:hover { background: var(--ink); }
.strip-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); line-height: 16px; }

/* Grid */
.grid { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.tile { background: var(--surface); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.tile.sel { outline: 2px solid var(--ink); }
.tile .thumb { width: 100%; height: auto; aspect-ratio: 1 / 1; flex: none; }
.tile .thumb img { inset: 8%; width: 84%; height: 84%; }
.tile .ptitle { -webkit-line-clamp: 3; font-size: 14px; }
/* Timeline and numbers sit at the bottom of every tile, however many lines the title and brand take. */
.tile .strip { margin-top: auto; flex: none; }
.tile .foot { display: flex; justify-content: space-between; align-items: baseline; }
.tile .star { position: absolute; top: 6px; right: 6px; }

.empty { margin-top: 12px; border: 1px dashed var(--control); border-radius: var(--r); padding: 24px; background: var(--surface); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--ink-2); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--control); background: var(--surface); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: #0a5838; }

/* Mobile filter trigger + sheet */
.mobilebar { display: none; }
.sheet-foot { display: none; }

/* Help dialog */
dialog { border: 1px solid var(--line); border-radius: var(--r); padding: 20px 24px; max-width: 420px; width: calc(100% - 32px); box-shadow: 0 12px 32px rgba(0,0,0,.18); }
dialog::backdrop { background: rgba(20,20,20,.35); }
dialog h2 { margin: 0 0 12px; font-size: 16px; }
dialog table { border-collapse: collapse; width: 100%; }
dialog td { padding: 4px 0; vertical-align: top; }
dialog td:first-child { width: 96px; }

/* Product page */
.crumbs { color: var(--ink-2); font-size: 13px; margin-bottom: 10px; }
.crumbs a { color: var(--ink-2); }
.pp { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; max-width: 1180px; }
.pp h1 { font-size: 24px; line-height: 30px; max-width: 30em; }
.pp .byline { margin-top: 6px; color: var(--ink-2); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.said { margin-top: 20px; background: var(--surface); border-radius: var(--r); padding: 16px 20px; }
.said p.lead { margin: 0 0 10px; font-size: 16px; line-height: 24px; }
.section-h { display: flex; justify-content: space-between; align-items: baseline; margin: 28px 0 8px; gap: 12px; flex-wrap: wrap; }
.section-h h2 { font-size: 18px; line-height: 24px; margin: 0; }
.comments { background: var(--surface); border-radius: var(--r); }
.cm { padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.cm:last-child { border-bottom: 0; }
.cm.sel { box-shadow: inset 3px 0 0 var(--ink); }
.cm.flash { background: #f6f6f4; }
.cm-h { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.cm-h .who { color: var(--ink); font-weight: 600; text-decoration: none; }
.cm-h .who:hover { text-decoration: underline; }
.cm-h .hnlink { margin-left: auto; }
.cm-thread { margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.cm-thread a { color: var(--ink); }
.cm-parent { margin-top: 8px; font-size: 13px; }
.cm-parent summary { cursor: pointer; color: var(--ink-2); }
.cm-parent .ptext { margin-top: 6px; padding-left: 12px; border-left: 2px solid var(--line); color: var(--ink-2); max-width: 68ch; }
.cm-body { margin-top: 8px; font-size: 15px; line-height: 23px; max-width: 68ch; overflow-wrap: anywhere; }
.cm-body.clamped { display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.cm-body p { margin: 8px 0 0; }
.cm-body pre { font-family: var(--mono); font-size: 12px; line-height: 18px; background: var(--ground); padding: 8px 10px; overflow-x: auto; white-space: pre-wrap; }
.cm-body a.amz { background: var(--accent-tint); text-decoration: none; padding: 0 2px; border-radius: 2px; }
.cm-more { border: 0; background: none; padding: 4px 0 0; text-decoration: underline; cursor: pointer; color: var(--ink-2); }
.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 72px; align-self: start; }
.panel { background: var(--surface); border-radius: var(--r); padding: 16px; }
.panel h2 { font-size: 14px; margin: 0 0 8px; }
.hero-img { background: var(--surface); border-radius: var(--r); aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; padding: 20px; }
.hero-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hero-img.none { background: var(--sunk); color: var(--ink-2); text-align: center; padding: 24px; }
.price { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--rule); }
.price .v { font-size: 22px; font-weight: 600; color: var(--ink-3); }
.mkts { list-style: none; margin: 12px 0 0; padding: 0; }
.mkts li { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--rule); font-size: 13px; }
.mkts li a { font-weight: 600; }
.facts { width: 100%; border-collapse: collapse; font-size: 13px; }
.facts th { text-align: left; font-weight: 400; color: var(--ink-2); padding: 5px 12px 5px 0; vertical-align: top; width: 38%; }
.facts td { padding: 5px 0; vertical-align: top; overflow-wrap: anywhere; }
.facts tr + tr th, .facts tr + tr td { border-top: 1px solid var(--rule); }
.facts .dash { color: var(--ink-3); }
.copy { border: 1px solid var(--control); background: var(--surface); border-radius: 3px; font-size: 11px; height: 20px; padding: 0 6px; cursor: pointer; margin-left: 6px; }
.related { list-style: none; margin: 0; padding: 0; }
.related li { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--rule); font-size: 13px; }
.related li:first-child { border-top: 0; }
.related img { width: 40px; height: 40px; object-fit: contain; }
.bullets { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.bullets li + li { margin-top: 4px; }

/* Tablet */
@media (max-width: 1100px) {
  .lhead, .row { grid-template-columns: 56px minmax(0, 1fr) 160px 56px 32px; }
  .lhead .c-when, .row .when { display: none; }
  .thumb { width: 56px; height: 56px; }
  .pp { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
}

/* Phone */
@media (max-width: 760px) {
  body { font-size: 14px; }
  .topbar { padding: 0 16px; gap: 10px; height: 48px; }
  .brand small, .topbar .hide-sm, .search kbd { display: none; }
  .search input { height: 36px; }
  .shell { display: block; }
  .main { padding: 14px 16px 64px; }
  .mobilebar { display: flex; gap: 8px; margin-top: 12px; }
  .mobilebar .btn { flex: 1; height: 44px; }
  .mobilebar select { flex: 1; height: 44px; border: 1px solid var(--control); border-radius: var(--r); background: var(--surface); padding: 0 8px; }
  .toolbar .seg.sort, .toolbar .sortnote { display: none; }
  .toolbar { margin-top: 8px; }
  .tags { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .facets {
    position: fixed; inset: 0; z-index: 40; height: auto; padding: 0 16px 96px; border: 0; background: var(--ground);
    display: none; overflow-y: auto;
  }
  body.sheet-open { overflow: hidden; }
  body.sheet-open .facets { display: block; }
  .sheet-head { position: sticky; top: 0; background: var(--ground); display: flex; justify-content: space-between; align-items: center; height: 52px; border-bottom: 1px solid var(--line); z-index: 2; }
  .sheet-head h2 { margin: 0; font-size: 16px; }
  .sheet-foot { display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--line); z-index: 41; }
  body:not(.sheet-open) .sheet-foot { display: none; }
  .sheet-foot .btn { flex: 1; height: 44px; }
  .facet .opt { min-height: 40px; }
  .lhead { display: none; }
  .row { grid-template-columns: 56px minmax(0, 1fr) 40px; grid-template-areas: "img body star" "strip strip strip"; gap: 8px 12px; padding: 12px; }
  .row .thumb { grid-area: img; }
  .row .body { grid-area: body; }
  .row .star { grid-area: star; align-self: start; width: 40px; height: 40px; }
  .row .strip { grid-area: strip; }
  .row .users, .row .when { display: none; }
  .row .m-only { display: inline; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 8px; }
  .pp { display: flex; flex-direction: column; gap: 16px; }
  .side { position: static; display: contents; }
  .side .hero-img { order: -2; aspect-ratio: auto; height: 220px; }
  .side .buy { order: -1; }
  .pp .content { order: 0; }
  .side .factsp { order: 1; }
  .side .relp { order: 2; }
  .cm { padding: 14px 16px; }
  .cm-h .hnlink { margin-left: 0; }
}
.m-only { display: none; }
@media (min-width: 761px) { .sheet-head { display: none; } }
/* Product page: centred content, image kept short so the buy box stays above the fold */
#page { max-width: 1240px; margin: 0 auto; }
#page .pp { max-width: none; }
.hero-img { aspect-ratio: auto; height: 240px; }
a.pill { text-decoration: none; }
a.pill:hover { text-decoration: underline; }
@media (min-width: 761px) {
  .pp { grid-template-rows: auto 1fr; row-gap: 0; }
  .pp .ptop { grid-column: 1; grid-row: 1; }
  .pp .content { grid-column: 1; grid-row: 2; }
  .pp .side { grid-column: 2; grid-row: 1 / 3; }
}
@media (max-width: 760px) {
  .pp .ptop { order: -3; }
  .side .hero-img { height: 140px; padding: 12px; }
  .said { margin-top: 0; }
  .pp h1 { font-size: 20px; line-height: 26px; }
}
@media (max-width: 760px) {
  h1 { font-size: 20px; line-height: 26px; }
  .summary { font-size: 13px; }
  .toolbar { display: none; }
}

/* ---- Added for the real site ---- */
.pmeta.excerpt { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot-site { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; line-height: 18px; max-width: 80ch; }
.foot-site p { margin: 0 0 6px; }
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { font-size: 17px; margin: 24px 0 8px; }
.prose li { margin-bottom: 6px; }
a.textbtn { text-decoration: none; display: inline-flex; align-items: center; }
