/* Tip Waist Tail: quiet, monochrome, numbers in mono. */

@font-face { font-family: "Geist"; src: url("/fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #ecece9;          /* page */
  --panel: #ffffff;       /* cards, table */
  --panel-2: #f6f6f4;     /* sidebar, panel header strips */
  --soft: #efefec;        /* chips, inputs, hover */
  --ink: #141414;
  --ink-2: #3a3a38;
  --muted: #7a7974;
  --faint: #b3b2ac;
  --line: #e3e2de;
  --line-2: #d6d5d0;
  --accent: #141414;      /* buttons, active, fills */
  --accent-ink: #ffffff;
  --good: #1f8a4c;
  --blue: #2f62c8;        /* the one colour: "matches what you picked" */
  --blue-soft: #e9effb;
  --blue-line: #c9d7f4;
  --radius: 12px;
  --radius-sm: 8px;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0d;
    --panel: #151516;
    --panel-2: #1a1a1c;
    --soft: #222224;
    --ink: #f1f1ee;
    --ink-2: #d2d2cd;
    --muted: #8f8e89;
    --faint: #5c5b57;
    --line: #2a2a2c;
    --line-2: #353537;
    --accent: #f1f1ee;
    --accent-ink: #111111;
    --good: #5fd39b;
    --blue: #86a9f5;
    --blue-soft: #1a2338;
    --blue-line: #2c3b5e;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.45 var(--sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--ink); text-underline-offset: 2px; }
.mono, .num, th, legend, .panel-title, .range-vals, .len, .dims, .chip .n, .brand-kicker { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- header ---------- */
.top {
  display: flex; gap: 20px; align-items: center;
  padding: 14px 28px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand-mark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-mark { width: 34px; height: 34px; flex: none; }
.logo-mark rect { fill: var(--accent); }
.logo-mark path { fill: none; stroke: var(--accent-ink); stroke-width: 1.6; stroke-linejoin: round; }
.brand-kicker { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); line-height: 1.2; }
.top h1, .top .logo { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.tag { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px; width: min(420px, 40vw);
  background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px;
}
.search svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; }
.search input { flex: 1; border: 0; background: none; padding: 9px 0; outline: none; min-width: 0; }
.search:focus-within { border-color: var(--line-2); background: var(--panel); box-shadow: 0 0 0 3px var(--soft); }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; padding: 16px 28px; align-items: start; }
.lens.narrow-lens { display: none; }
.m-cell { display: none; }
.c-narrow { display: none; }
.specs-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.only-narrow { display: none; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}
.panel-title, legend { font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- filters (sidebar) ---------- */
.filters {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 4px 16px 16px; position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow: auto;
}
.filters-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 8px; }
.filters h2 { font-size: 15px; font-weight: 600; margin: 0; }
fieldset { border: 0; padding: 14px 0 0; margin: 0 0 4px; border-top: 1px solid var(--line); }
legend { padding: 0; margin-bottom: 10px; float: left; width: 100%; }
legend + * { clear: both; }
.hint { display: block; margin-top: 3px; font-family: var(--sans); font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--faint); }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: var(--ink); }

/* range: label + editable values, histogram, two-handle slider */
.range { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 4px; margin-bottom: 8px; clear: both; }
.range-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.range-label { font-size: 13px; color: var(--ink-2); }
.range.active .range-label { color: var(--ink); font-weight: 600; }
.range-vals { display: inline-flex; align-items: baseline; gap: 1px; font-variant-numeric: tabular-nums; }
.range-vals input {
  width: 3.9em; padding: 1px 3px; border: 1px solid transparent; border-radius: 5px; background: transparent;
  text-align: center; font-size: 13px; -moz-appearance: textfield;
}
.range-vals input::-webkit-inner-spin-button, .range-vals input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.range-vals input:hover, .range-vals input:focus { border-color: var(--line); background: var(--soft); outline: none; }
.range-vals input.at-bound { color: var(--faint); }
.range-vals input:not(.at-bound) { color: var(--blue); font-weight: 600; }
.range-vals .dash, .range-vals .unit { color: var(--faint); font-size: 11px; }
.range-vals .unit { margin-left: 4px; }
.hist { display: flex; align-items: flex-end; gap: 2px; height: 28px; margin: 8px 10px 0; }
.hist i { flex: 1; background: var(--line); border-radius: 1px; }
.hist i.in { background: var(--line-2); }
.range.active .hist i.in { background: var(--blue); }
.dual { position: relative; height: 26px; margin: 0 10px; }
.dual .track { position: absolute; left: 0; right: 0; top: 11px; height: 3px; border-radius: 2px; background: var(--line); }
.dual .fill { position: absolute; top: 0; bottom: 0; background: var(--line-2); border-radius: 2px; }
.range.active .dual .fill { background: var(--blue); }
.range.active .dual input[type=range]::-webkit-slider-thumb { border-color: var(--blue); }
.range.active .dual input[type=range]::-moz-range-thumb { border-color: var(--blue); }
.range.active { border-color: var(--blue-line); }
.dual input[type=range] {
  position: absolute; left: -10px; right: -10px; width: calc(100% + 20px); top: 0; height: 26px; margin: 0;
  background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.dual input[type=range]::-webkit-slider-runnable-track { background: none; height: 26px; }
.dual input[type=range]::-moz-range-track { background: none; }
.dual input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px; margin-top: 4px; border-radius: 50%;
  background: var(--panel); border: 1.5px solid var(--accent); box-shadow: 0 1px 2px rgb(0 0 0 / .15); cursor: grab;
}
.dual input[type=range]::-moz-range-thumb {
  pointer-events: auto; width: 15px; height: 15px; border-radius: 50%;
  background: var(--panel); border: 1.5px solid var(--accent); box-shadow: 0 1px 2px rgb(0 0 0 / .15); cursor: grab;
}
.dual input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--soft); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; clear: both; }
.chip {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 4px 9px;
  font-size: 13px; cursor: pointer; color: var(--ink-2);
}
.chip:hover { border-color: var(--line-2); }
.chip .n { color: var(--faint); font-size: 11px; margin-left: 5px; }
.chip.on { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue); font-weight: 500; }
.chip.on .n { color: inherit; opacity: .7; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); clear: both; }
.check input { margin-top: 3px; accent-color: var(--accent); }

.primary { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 600; cursor: pointer; }
.backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 20; }

/* ---------- results ---------- */
.results-panel { overflow: hidden; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px 10px; }
#count { margin: 0; color: var(--muted); font-size: 13px; }
.legend { margin-left: 10px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--blue); margin-right: 5px; vertical-align: 0; }
#count b { font-family: var(--mono); font-size: 22px; font-weight: 600; color: var(--ink); margin-right: 4px; letter-spacing: -0.02em; }
.bar-right { display: flex; gap: 8px; align-items: center; }
.seg { display: inline-flex; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08); font-weight: 500; }
.missing { margin: -4px 16px 10px; font-size: 13px; color: var(--muted); }

.table-wrap { overflow: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  position: sticky; top: 0; background: var(--panel-2); cursor: pointer; white-space: nowrap; user-select: none; padding-top: 9px; padding-bottom: 9px;
}
th:hover { color: var(--ink); }
th.num, td.num { text-align: right; white-space: nowrap; }
td.num { font-family: var(--mono); font-size: 13px; }
#results > tbody > tr.row > td:first-child { min-width: 210px; }
th[aria-sort="ascending"]::after { content: " ↑"; color: var(--ink); }
th[aria-sort="descending"]::after { content: " ↓"; color: var(--ink); }
tbody tr.row { cursor: pointer; }
tbody tr.row:hover { background: var(--panel-2); }
tbody tr.row[aria-expanded=true] { background: var(--panel-2); }
.model { font-weight: 500; color: var(--ink); text-decoration: none; }
.sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
.lens { display: flex; flex-wrap: wrap; gap: 4px; max-width: 280px; }
.len { font-size: 12px; padding: 1px 6px; border-radius: 5px; background: var(--soft); color: var(--faint); }
.len.all { color: var(--ink-2); }
.len.hit { background: var(--blue-soft); color: var(--blue); font-weight: 600; box-shadow: inset 0 0 0 1px var(--blue-line); }
.na { color: var(--faint); }
.ref { color: var(--muted); font-size: 11px; }
.dims { color: var(--faint); white-space: nowrap; }
.dims b { color: var(--ink); font-weight: 600; }

tr.detail > td { background: var(--panel-2); padding: 14px 16px 18px; }
.detail-grid { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }
.detail-grid img { width: 100%; max-height: 180px; object-fit: contain; background: #fff; border-radius: 10px; border: 1px solid var(--line); }
.specs { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); border-collapse: separate; border-spacing: 0; }
.specs th { position: static; cursor: default; }
.specs td, .specs th { padding: 7px 12px; }
.specs tr:last-child td { border-bottom: 0; }
.specs tr.hit td { background: var(--blue-soft); }
.specs tr.hit td:first-child { color: var(--blue); font-weight: 600; }
.meta { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.meta b { color: var(--ink); font-weight: 600; }
.more { text-align: center; color: var(--muted); margin: 0; padding: 14px; }
.more:empty { display: none; }
.more button { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px 16px; cursor: pointer; }
.more button:hover { border-color: var(--line-2); }

/* ---------- footer ---------- */
footer { padding: 8px 28px 40px; color: var(--muted); font-size: 12px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }
.about { margin: 0 0 12px; max-width: 760px; }
.about summary { cursor: pointer; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.about h2 { font-size: 13px; color: var(--ink); margin: 14px 0 2px; font-weight: 600; }
.about p { margin: 0; font-size: 13px; line-height: 1.55; }
.browse { line-height: 2; }
.browse b { font-family: var(--mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); font-weight: 500; }

/* ---------- generated spec pages ---------- */
.doc .top { justify-content: space-between; }
.cta {
  display: inline-block; background: var(--accent); color: var(--accent-ink); text-decoration: none;
  padding: 8px 14px; border-radius: 10px; font-weight: 500; font-size: 13px;
}
.cta:hover { opacity: .88; }
.doc-main { max-width: 1080px; margin: 0 auto; padding: 24px 28px; }
.doc-main h1 { font-size: 28px; font-weight: 600; margin: 6px 0 8px; letter-spacing: -0.02em; }
.doc-main h2 { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 32px 0 6px; }
.lede { font-size: 16px; color: var(--ink-2); max-width: 760px; }
.crumbs { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.crumbs a { color: var(--muted); }
.doc-main > .table-wrap, .ski .table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.doc-table { background: var(--panel); }
.doc-table th { cursor: default; }
.doc-table .model:hover { text-decoration: underline; }
.doc-table tr:last-child td { border-bottom: 0; }
.ski-grid { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; margin-top: 16px; }
.ski-grid img { width: 100%; max-height: 320px; object-fit: contain; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.ski-grid .specs { width: 100%; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 18px 0; font-size: 14px; }
.facts dt { color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; padding-top: 2px; }
.facts dd { margin: 0; }

@media (max-width: 900px) {
  .doc-main { padding: 14px 16px; }
  .ski-grid { grid-template-columns: 1fr; }
  .doc-table:not(.specs) th:nth-child(2), .doc-table:not(.specs) td:nth-child(2) { display: none; }
}

/* ---------- phones ---------- */
@media (max-width: 900px) {
  .top { flex-wrap: wrap; gap: 10px 14px; padding: 12px 16px; position: static; }
  .tag { display: none; }
  .search { width: 100%; order: 3; }
  .search input { font-size: 16px; }              /* no iOS zoom on focus */
  .doc .top { flex-wrap: nowrap; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  footer { padding: 8px 16px 90px; }
  .only-narrow { display: inline-flex; }
  .hide-narrow { display: none; }
  .lens.narrow-lens { display: flex; margin-top: 8px; max-width: none; }
  .sheet-foot.only-narrow { display: block; }

  /* filters: bottom sheet */
  .filters {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 30; max-height: 88vh; height: 88vh;
    border-radius: 16px 16px 0 0; padding: 0 16px; overflow: auto; overscroll-behavior: contain;
    transform: translateY(105%); transition: transform .25s ease; box-shadow: 0 -8px 30px rgb(0 0 0 / .2);
  }
  .filters.open { transform: none; }
  .filters-head { position: sticky; top: 0; background: var(--panel-2); padding: 16px 0 10px; z-index: 1; gap: 16px; }
  .filters-head h2 { margin-right: auto; }
  .sheet-foot { position: sticky; bottom: 0; background: var(--panel-2); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .sheet-foot .primary { width: 100%; font-size: 16px; }
  body.sheet-open { overflow: hidden; }
  .range-vals input { font-size: 16px; }
  .dual { height: 36px; }
  .dual .track { top: 16px; }
  .dual input[type=range], .dual input[type=range]::-webkit-slider-runnable-track { height: 36px; }
  .dual input[type=range]::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: 4px; }
  .dual input[type=range]::-moz-range-thumb { width: 24px; height: 24px; }
  .chip { padding: 7px 11px; font-size: 14px; }

  .fab {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 10;
    background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 12px 22px;
    font-weight: 600; box-shadow: 0 6px 20px rgb(0 0 0 / .25);
  }
  body.sheet-open .fab { display: none; }

  /* results: cards */
  .results-panel { background: none; border: 0; overflow: visible; }
  .results-panel > .panel-head { display: none; }
  .bar { flex-wrap: wrap; padding: 4px 2px 10px; }
  .missing { margin: -2px 2px 10px; }
  .seg button { white-space: nowrap; padding: 5px 10px; }
  .sort-pick select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 14px; }
  .table-wrap { background: none; border: 0; overflow: visible; }
  #results { display: block; }
  #results > thead { display: none; }
  /* one panel, compact two-line rows */
  #results > tbody { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  #results > tbody > tr.row { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  #results > tbody > tr.row:last-of-type { border-bottom: 0; }
  #results > tbody > tr.row > td { display: none; }
  #results > tbody > tr.row > td.m-cell { display: block; padding: 0; border: 0; }
  #results > tbody > tr.row[aria-expanded=true] { background: var(--panel-2); border-bottom: 0; }
  .m-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .m-name { font-weight: 500; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-badge { display: inline-block; margin-left: 6px; padding: 0 5px; border: 1px solid var(--line-2); border-radius: 4px;
    font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--muted); vertical-align: 2px; }
  .m-key { font-family: var(--mono); font-size: 14px; font-weight: 600; white-space: nowrap; flex: none; }
  .m-sub { margin-top: 3px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
  .m-sub .dims { font-size: 12px; }
  .m-lens { display: flex; gap: 7px; flex-wrap: wrap; min-width: 0; }
  .m-lens i { font-style: normal; color: var(--faint); }
  .m-lens i.hit { color: var(--blue); font-weight: 600; }
  .m-lens i.all { color: var(--ink-2); }
  .m-val { white-space: nowrap; flex: none; color: var(--ink-2); }
  .m-val .ref { font-size: 12px; }
  #results > tbody > tr.detail { display: block; border-bottom: 1px solid var(--line); }
  #results > tbody > tr.detail > td { display: block; border: 0; padding: 4px 14px 14px; background: var(--panel-2); }
  .detail-grid { gap: 8px; grid-template-columns: minmax(0, 1fr); }
  .detail-grid > div { min-width: 0; }
  #results > tbody > tr.detail > td { min-width: 0; max-width: 100%; }
  .detail-grid img { display: none; }
  .detail-grid .meta:first-child, .detail-grid > div:first-child .meta { margin-top: 2px; }
  #results .specs-wrap { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
  #results .specs { display: table; width: 100%; border: 0; border-radius: 0; }
  #results .specs th, #results .specs td { padding: 6px 8px; line-height: 1.3; font-size: 12px; white-space: nowrap; }
  #results .specs th { font-size: 10px; letter-spacing: .04em; }
  #results .specs .c-wide { display: none; }
  #results .specs .c-narrow { display: table-cell; }
  #results .detail .meta { font-size: 12px; line-height: 1.5; margin-top: 8px; }
  #results .detail .meta b { font-weight: 500; color: var(--ink-2); }
  .detail-grid { grid-template-columns: 1fr; }
  .specs { display: block; overflow-x: auto; }
  .more { padding: 14px 0; }
}
