/* Minimal, content-first styling. Black and white with one green accent, system fonts, hairline borders. */

:root {
  --bg: #ffffff;
  --surface: #f6f6f4;
  --text: #151515;
  --muted: #6b6b66;
  --line: #e4e4df;
  --accent: #15803d;
  --accent-ink: #ffffff;
  --good: #1f7a4d;
  --bad: #9a4b12;
  --radius: 8px;
  --gutter: 20px;
  --maxw: 1240px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111;
    --surface: #1b1b1a;
    --text: #efefeb;
    --muted: #9a9a94;
    --line: #2d2d2a;
    --accent: #4ade80;
    --accent-ink: #111111;
    --good: #5fcf9a;
    --bad: #e3a36a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111111;
  --surface: #1b1b1a;
  --text: #efefeb;
  --muted: #9a9a94;
  --line: #2d2d2a;
  --accent: #4ade80;
  --accent-ink: #111111;
  --good: #5fcf9a;
  --bad: #e3a36a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 96px; /* room for the compare tray */
}
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0; background: var(--text); color: var(--bg); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.notice { padding: 12px 14px; background: var(--surface); border-radius: var(--radius); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark { display: inline-flex; line-height: 0; }
.count { color: var(--muted); font-size: 13px; }

/* Search + filters */
.search { margin: 28px 0 14px; position: relative; }
.search input {
  width: 100%; height: 52px; padding: 0 16px 0 16px; font-size: 17px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--text); outline: none; }

.filters { display: grid; gap: 10px; margin-bottom: 8px; }
.fgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 6px; }
.fgroup-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); width: 74px; flex: none; }

.chip {
  border: 1px solid var(--line); background: var(--bg); border-radius: 999px;
  padding: 5px 12px; font-size: 13.5px; line-height: 1.3;
}
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

details.more { margin-top: 2px; }
details.more > summary { cursor: pointer; color: var(--muted); font-size: 13.5px; padding: 4px 0; width: fit-content; }
details.more[open] > summary { margin-bottom: 8px; }
.more-body { display: grid; gap: 12px; padding: 4px 0 8px; }
.inline-controls { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }
.inline-controls label { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; }
select, .select {
  height: 34px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); padding: 0 8px;
}

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.toolbar .results { color: var(--muted); font-size: 13.5px; }
.toolbar .right { display: flex; gap: 12px; align-items: center; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 13.5px; }
.link-btn:hover { color: var(--text); }

/* Lens list */
.lens-list { list-style: none; margin: 0; padding: 0; }
.lens-head, .lens-row {
  display: grid; align-items: center; gap: 12px;
  grid-template-columns: 28px minmax(0, 3fr) 56px 104px 80px 70px 58px 52px 50px 56px 64px 72px;
}
.lens-head { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 0; border-bottom: 1px solid var(--line); }
.lens-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.lens-row:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.lens-row .name a { text-decoration: none; font-weight: 550; }
.lens-row .name a:hover { text-decoration: underline; }
.lens-row .sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.cell-num { font-variant-numeric: tabular-nums; }
.lens-row .c-price { text-align: right; }
.pick { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.pick:disabled { cursor: not-allowed; opacity: .4; }
.dim { color: var(--muted); }
.c-mag.hi { font-weight: 600; }
.cell-flag .lbl { display: none; }
.cell-flag.on .v { font-weight: 600; }

.empty { padding: 56px 0; text-align: center; color: var(--muted); }
.empty button { margin-top: 10px; }

/* Tags */
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 11.5px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); white-space: nowrap; }

/* Detail */
.back { display: inline-block; margin: 24px 0 8px; color: var(--muted); text-decoration: none; font-size: 13.5px; }
.back:hover { color: var(--text); }
.detail-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 6px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.detail h1 { font-size: 28px; }
.keyfacts { color: var(--muted); margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.keyfacts strong { color: var(--text); font-weight: 600; }
.btn {
  border: 1px solid var(--text); background: var(--text); color: var(--bg); border-radius: 6px;
  padding: 8px 14px; font-size: 14px; text-decoration: none; display: inline-block;
}
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--text); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.section { margin-top: 36px; }
.section > h2 { font-size: 17px; margin-bottom: 12px; }

.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.spec-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 500; margin: 18px 0 6px; }
.spec-group dl { margin: 0; }
.spec-group .srow { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.spec-group dt { color: var(--muted); }
.spec-group dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.reviews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.review-col h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; margin-bottom: 8px; }
.review-col.good h3 { color: var(--good); }
.review-col.bad h3 { color: var(--bad); }
.review-col ul { margin: 0; padding-left: 18px; }
.review-col li { margin: 0 0 6px; }
.verdict { margin: 0 0 14px; font-size: 16px; }
.sources { margin-top: 14px; font-size: 13px; color: var(--muted); }
.sources a { color: var(--text); }
.pending { padding: 16px; background: var(--surface); border-radius: var(--radius); color: var(--muted); }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface); color: var(--muted); }
.badge.warn { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.note { color: var(--muted); font-size: 13.5px; margin-top: 10px; }

/* Compare */
.compare-wrap { overflow-x: auto; margin-top: 8px; }
.compare { width: 100%; border-collapse: collapse; min-width: 560px; table-layout: fixed; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); }
.compare thead th { position: sticky; top: 0; background: var(--bg); z-index: 2; padding-top: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--text); }
.compare .rowlabel { width: 170px; color: var(--muted); font-weight: 400; }
.compare tr.same td { color: var(--muted); }
.compare .grp td, .compare .grp th { padding-top: 24px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); border-bottom: 1px solid var(--line); font-weight: 500; }
.compare .lens-title { font-weight: 600; font-size: 16px; line-height: 1.25; }
.compare .lens-title a { text-decoration: none; }
.compare .lens-title a:hover { text-decoration: underline; }
.compare .brandline { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); display: block; margin-bottom: 2px; }
.compare .remove { margin-top: 6px; }
.best { font-weight: 650; }
.best::after { content: attr(data-best); margin-left: 8px; font-size: 11px; font-weight: 500; color: var(--good); text-transform: uppercase; letter-spacing: .05em; }
.compare ul { margin: 0; padding-left: 16px; }
.compare li { margin-bottom: 4px; }
.add-slot { color: var(--muted); }
.compare-controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin: 20px 0 4px; }
.compare-controls label { display: inline-flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--muted); }

/* Tray + toast */
.tray {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bg);
  border-top: 1px solid var(--text); padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
}
.tray-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tray-items { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.tray-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 4px 3px 12px; font-size: 13px; max-width: 100%; }
.tray-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.tray-chip button { border: 0; background: var(--surface); border-radius: 50%; width: 22px; height: 22px; line-height: 1; padding: 0; color: var(--muted); }
.tray-chip button:hover { color: var(--text); }
.tray-hint { color: var(--muted); font-size: 13px; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 84px; z-index: 30;
  background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: 6px; font-size: 13.5px; max-width: calc(100% - 32px);
}

.site-footer { margin-top: 56px; border-top: 1px solid var(--line); padding: 22px 0 28px; color: var(--muted); font-size: 12.5px; }
.site-footer p { margin: 0 0 8px; max-width: 70ch; }

/* Responsive */
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .lens-head { display: none; }
  .lens-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    grid-template-areas: "pick name price" ". spec spec";
    row-gap: 4px;
  }
  .lens-row .c-pick { grid-area: pick; }
  .lens-row .name { grid-area: name; }
  .lens-row .c-price { grid-area: price; text-align: right; }
  .lens-row .specline { grid-area: spec; display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--muted); font-size: 13px; }
  .lens-row .c-hide-m { display: none; }
  .cell-flag .v { display: none; }
  .cell-flag.on .lbl { display: inline; }
  .cell-flag.dim { display: none; }
  .lens-row .c-year.dim { display: none; }
  .lens-row .c-year:not(.dim)::before { content: 'released '; }
  .lens-row .c-mag:not(.dim)::after { content: ' mag'; }
  .lens-row .c-mag.dim { display: none; }
  .fgroup-label { width: 100%; }
  .specs, .reviews { grid-template-columns: 1fr; }
  .detail h1 { font-size: 24px; }
  .compare .rowlabel { width: 110px; }
}
@media (min-width: 761px) {
  .lens-row .specline { display: contents; }
  .only-m { display: none; }
}

/* ---- size comparison (compare view) ---- */
.size-svg { width: 100%; height: auto; display: block; }
.size-cell { vertical-align: bottom; }
.size-dims { display: block; margin-top: 6px; font-size: 12px; }
.size-note { margin-top: 6px; font-size: 11px; font-weight: 400; line-height: 1.35; }
.size-body { fill: var(--text); fill-opacity: .88; }
.size-ring { fill: var(--bg); fill-opacity: .22; }
.size-mount { fill: var(--muted); }

/* ---- kit coverage ---- */
/* Main navigation: Lenses / Planner / Kit */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--bg); }
.main-nav { border-top: 1px solid var(--line); }
.nav-row { display: flex; gap: 6px; }
.nav-tab { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 9px 12px 8px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.nav-tab:hover { color: var(--text); background: var(--surface); }
.nav-tab[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.nav-t { font-size: 15.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; color: var(--text); }
.nav-s { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#plan-link .nav-t { color: var(--accent); }
.kit-n { display: inline-block; min-width: 1.5em; padding: 0 6px; border-radius: 999px; text-align: center; font-size: 12px; font-weight: 600; line-height: 1.55; background: var(--surface); color: var(--muted); font-variant-numeric: tabular-nums; border: 1px solid var(--line); }
.kit-n.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.kit-n.bump { animation: kit-bump .55s ease-out; }
@keyframes kit-bump { 0% { transform: scale(1); } 35% { transform: scale(1.5); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .kit-n.bump { animation: none; } }
.toast a { color: inherit; text-decoration: underline; margin-left: 8px; font-weight: 600; }

/* Intro on the main page */
.intro { margin: 26px 0 8px; }
.intro h1 { font-size: clamp(26px, 4.2vw, 36px); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 10px; }
.intro .lead { color: var(--muted); font-size: 17px; max-width: 68ch; margin: 0 0 6px; }
@media (max-width: 760px) { .intro .lead { font-size: 16px; } }
.kit-btn { font: inherit; font-size: 12px; line-height: 1; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; margin-left: 6px; cursor: pointer; white-space: nowrap; }
.kit-btn:hover { border-color: var(--text); color: var(--text); }
.kit-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.btn.kit-btn { font-size: 14px; line-height: inherit; padding: 8px 14px; margin-left: 0; border-radius: var(--radius); color: var(--text); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.kit h1 { margin-bottom: 4px; }
.kit-lead { margin: 0 0 18px; max-width: 62ch; }
.kit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.kit-main, .kit-side { min-width: 0; }
@media (max-width: 900px) { .kit-layout { grid-template-columns: minmax(0, 1fr); } }
.kit h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin: 0 0 10px; }
.kit-bar { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-bottom: 14px; }
.kit-bar label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.kit-chart { border-top: 1px solid var(--line); }
.kit-row { padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.kit-row.kit-top { padding-bottom: 0; border-bottom: 0; }
.kit-row.kit-bottom { padding: 0; }
.kit-row.kit-plain { border-bottom: 0; }
.kit-row.kit-plain:first-of-type { padding-top: 14px; }
.kit-row.off .kit-lab, .kit-row.off svg { opacity: .45; }
.kit-lab { display: flex; flex-wrap: wrap; gap: 0 10px; align-items: baseline; margin-bottom: 4px; min-width: 0; }
.kit-lab .nm { font-weight: 600; text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.kit-lab a.nm:hover { text-decoration: underline; }
.kit-lab .meta { color: var(--muted); font-variant-numeric: tabular-nums; }
.kit-lab .rm { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 4px; font-size: 16px; line-height: 1; }
.kit-lab .rm:hover { color: var(--accent); }
.kit .note { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.kit .note.warn { color: var(--bad); }
.kit-svg { display: block; width: 100%; overflow: visible; }
.kit-axis text { fill: var(--muted); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.kit-grid { stroke: var(--line); stroke-width: 1; }
.kit-lens { fill: var(--text); fill-opacity: .88; }
.kit-off { fill: var(--muted); fill-opacity: .5; }
.kit-cover { fill: color-mix(in srgb, var(--accent) 16%, var(--bg)); stroke: var(--accent); stroke-width: 1; }
.kit-over { fill: var(--accent); }
.kit-gap { fill: none; stroke: var(--muted); stroke-dasharray: 3 3; }
.kit-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.kit-legend .sw { display: inline-block; width: 18px; height: 8px; vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.kit-legend .sw.lens { background: var(--text); opacity: .88; }
.kit-legend .sw.cover { background: color-mix(in srgb, var(--accent) 16%, var(--bg)); border: 1px solid var(--accent); }
.kit-legend .sw.over { background: var(--accent); }
.kit-legend .sw.gap { border: 1px dashed var(--muted); }
.kit-find { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; margin-top: 22px; }
.kit-find ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.kit-find li { font-variant-numeric: tabular-nums; }
.kit-find li small { display: block; color: var(--muted); font-size: 12px; }
.kit-find .big { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.kit-stats { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); }
.kit-stats:empty { display: none; }
.kit-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.kit-search { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--text); font: inherit; padding: 9px 12px; margin-bottom: 10px; }
.kit-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.kit-list { max-height: 520px; overflow: auto; border-top: 1px solid var(--line); }
.kit-item { display: flex; gap: 10px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.kit-item .t { flex: 1; min-width: 0; }
.kit-item .t b { font-weight: 600; overflow-wrap: anywhere; }
.kit-item small { display: block; color: var(--muted); font-variant-numeric: tabular-nums; }
.kit-add { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; font-size: 18px; line-height: 1; }
.kit-add:hover { border-color: var(--accent); }
.kit-add[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.kit-more { padding: 10px 2px; color: var(--muted); }
@media (max-width: 760px) { .kit-find .big { font-size: 18px; } .nav-s { display: none; } .nav-tab { padding: 11px 8px 9px; align-items: center; text-align: center; } .nav-t { font-size: 15px; } }
