/* Glass-to-Dishrack Finder — modern professional theme.
   Swiss/minimalist + "Trust & Authority": monochrome charcoal/near-black,
   crisp hairline borders, near-white primary actions, restrained motion. */
:root {
  /* Charcoal / graphite surface ramp (neutral, near-black) */
  --bg: #0b0c0e;
  --bg-grad: radial-gradient(1100px 520px at 50% -220px, #17191d 0%, #0b0c0e 62%);
  --surface: #141517;
  --surface-2: #191b1e;
  --surface-3: #212327;
  --line: #2a2d32;
  --line-strong: #383c42;
  --line-soft: #1e2024;

  /* Ink */
  --ink: #f4f5f6;
  --ink-soft: #a6abb3;
  --ink-faint: #6c7178;

  /* Primary action = near-white (high-contrast, premium) */
  --accent: #f2f3f5;
  --accent-hover: #ffffff;
  --accent-ink: #0b0c0e;
  --ring: rgba(255, 255, 255, .26);
  --hl: rgba(255, 255, 255, .06);   /* faint light fill for active/elevated bits */

  /* Functional fit colours (muted for dark surfaces) */
  --good: #5cb389;
  --tight: #d3a558;
  --snug: #d9776a;
  --schematic-bg: #161719;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 18px 44px -16px rgba(0, 0, 0, .7);
  --t: 200ms cubic-bezier(.2, .6, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "tnum" 1, "cv05" 1;
  font-variant-numeric: tabular-nums;
}
a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
a:hover { border-color: var(--ink-soft); }
::selection { background: rgba(255, 255, 255, .16); }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Header ---------- */
header.site {
  border-bottom: 1px solid var(--line-soft);
  background: rgba(11, 12, 14, .76);
  backdrop-filter: saturate(120%) blur(12px);
  position: sticky; top: 0; z-index: 50;
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.brandrow { display: flex; align-items: center; gap: 14px; padding: 15px 0; }
.brandrow img.logo {
  height: 32px; background: #fff; padding: 5px 8px; border-radius: var(--radius-xs);
  box-shadow: var(--shadow-sm);
}
.brandrow .titles { flex: 1; min-width: 0; }
.brandrow .titles h1 {
  margin: 0; font-size: 1.12rem; font-weight: 650; letter-spacing: -.34px;
}
.brandrow .titles p {
  margin: 2px 0 0; color: var(--ink-soft); font-size: .84rem; letter-spacing: -.1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* EN / SV segmented switch */
.lang { display: flex; flex: none; padding: 3px; gap: 2px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); }
.lang button { font-family: inherit; font-size: .72rem; font-weight: 600; line-height: 1; letter-spacing: .6px;
  padding: 6px 11px; border: 0; border-radius: 999px; cursor: pointer;
  color: var(--ink-faint); background: transparent; transition: background var(--t), color var(--t); }
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 520px){
  .brandrow .titles p { display: none; }
  .brandrow .titles h1 { font-size: 1rem; }
}

/* ---------- Layout ---------- */
main.wrap { padding-top: 30px; padding-bottom: 64px; }
.grid { display: grid; grid-template-columns: 400px 1fr; gap: 24px; align-items: start; }
@media (max-width: 920px){ .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel { padding: 22px; position: sticky; top: 86px; box-shadow: var(--shadow-sm); }
@media (max-width: 920px){ .panel { position: static; } }
/* Tablet: two-column form so the results aren't pushed a full screen down */
@media (min-width: 621px) and (max-width: 920px){
  .panel { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
  .panel .field.full, .panel .toggles { grid-column: 1 / -1; }
  .panel .btnrow { align-self: end; margin: 0 0 17px; }
  .panel .toggles { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 4px; }
}

/* ---------- Inputs ---------- */
.field { margin-bottom: 17px; }
.field label { display:block; font-weight:600; font-size:.7rem; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.field .hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-faint); }
.inputbox { position: relative; }
input[type=number], input[type=text], select {
  width: 100%; padding: 11px 13px; font-size: .96rem; font-family: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #0e0f11; transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
input::placeholder { color: var(--ink-faint); }
/* Browser spinner arrows clash with the dark inputs and overlap the unit label */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input:focus, select:focus { outline: none; border-color: var(--line-strong);
  background: #0c0d0f; box-shadow: 0 0 0 3px var(--ring); }
.unit { position:absolute; right:13px; top:50%; transform:translateY(-50%);
  color: var(--ink-faint); font-size:.8rem; pointer-events:none; }
.two { display:grid; grid-template-columns:1fr 1fr; gap:12px; }

.search input { padding-left: 38px; padding-right: 38px; }
.clearx { position:absolute; right:8px; top:50%; transform:translateY(-50%); width:26px; height:26px;
  display:grid; place-items:center; padding:0; border:0; border-radius:7px; cursor:pointer;
  font-size:1.15rem; line-height:1; color: var(--ink-faint); background: transparent; transition: all 120ms ease; }
.clearx:hover { color: var(--ink); background: var(--surface-3); }
.clearx[hidden] { display:none; }
.search .mag { position:absolute; left:13px; top:50%; transform:translateY(-50%);
  color: var(--ink-faint); pointer-events:none; }

/* autocomplete */
/* Wider than the narrow form column on desktop (spills over the results), never wider than the screen */
.ac-list {
  position:absolute; z-index:30; left:0; top:calc(100% + 6px);
  width: max(100%, min(470px, calc(100vw - 48px)));
  background: var(--surface-2); border:1px solid var(--line-strong); border-radius: 12px;
  box-shadow: 0 24px 60px -12px rgba(0,0,0,.8), 0 0 0 1px rgba(0,0,0,.4);
  max-height: min(430px, 62vh); overflow-y:auto; overscroll-behavior: contain;
  display:none; padding:6px;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.ac-list::-webkit-scrollbar { width: 8px; }
.ac-list::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px;
  border: 2px solid var(--surface-2); }
@media (max-width: 920px){ .ac-list { width: 100%; } }   /* stacked layout: input is already full width */
.ac-list.open { display:block; animation: drop 140ms ease-out; }
@keyframes drop { from { opacity:0; transform: translateY(-4px); } }
.ac-item { padding:11px 12px; cursor:pointer; border-radius:9px; display:flex; gap:12px;
  align-items:flex-start; transition: background 120ms ease; }
.ac-item + .ac-item { margin-top:2px; }
.ac-item:hover, .ac-item.active { background: var(--surface-3); }
.ac-item .ic { width:32px; height:32px; flex:none; border-radius:8px; display:grid; place-items:center;
  background: var(--hl); color: var(--ink-faint); border: 1px solid var(--line); margin-top:1px;
  transition: color 120ms ease, border-color 120ms ease; }
.ac-item:hover .ic, .ac-item.active .ic { color: var(--ink); border-color: var(--line-strong); }
.ac-item .body { min-width:0; flex:1; }
.ac-item .kicker { font-size:.64rem; font-weight:700; letter-spacing:.7px; text-transform:uppercase;
  color: var(--ink-faint); line-height:1.4; }
.ac-item .kicker span { font-weight:600; }
.ac-item .nm { font-weight:600; font-size:.93rem; line-height:1.32; letter-spacing:-.1px;
  color: var(--ink); margin-top:2px; overflow-wrap:anywhere; }
.ac-item .meta { display:flex; flex-wrap:wrap; align-items:center; gap:4px 12px; margin-top:6px;
  font-size:.75rem; color: var(--ink-soft); }
.ac-item .meta span { white-space:nowrap; }
.ac-item .sku { font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace; font-size:.7rem;
  color: var(--ink); background: var(--surface); border:1px solid var(--line); border-radius:5px;
  padding:1px 6px; }
.ac-head { padding:8px 12px 4px; font-size:.64rem; font-weight:700; letter-spacing:.8px;
  text-transform:uppercase; color: var(--ink-faint); }
.ac-item mark { background: rgba(255,255,255,.16); color: var(--ink); border-radius:3px; padding:0 1px; }

/* buttons */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px;
  width:100%; padding:12px; font-size:.95rem; font-weight:600; font-family:inherit; letter-spacing:-.1px;
  color: var(--accent-ink); background: var(--accent); border:1px solid var(--accent);
  border-radius: var(--radius-sm); cursor:pointer; transition: background var(--t), transform 60ms ease, border-color var(--t); }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface-2); color: var(--ink-soft); border:1px solid var(--line); }
.btn.ghost:hover { background: var(--surface-3); color: var(--ink); border-color: var(--line-strong); }
.btnrow { display:flex; gap:10px; margin-top:8px; }

.toggles { margin-top:20px; padding-top:18px; border-top:1px solid var(--line-soft); }
.toggle { display:flex; align-items:center; gap:10px; font-size:.86rem; margin-bottom:12px;
  color: var(--ink-soft); cursor:pointer; transition: color 120ms ease; }
.toggle input { width:16px; height:16px; accent-color: var(--ink); cursor:pointer; }
.toggle:hover { color: var(--ink); }

/* ---------- Results ---------- */
.results-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between;
  gap:12px; margin-bottom:20px; scroll-margin-top: 84px; }
.head-actions { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.linkbtn { display:inline-flex; align-items:center; gap:6px; font-family:inherit; font-size:.78rem; font-weight:550; line-height:1;
  padding:7px 12px; border-radius:999px; cursor:pointer; color: var(--ink-soft);
  background: transparent; border:1px dashed var(--line-strong); transition: all 140ms ease; }
.linkbtn:hover { color: var(--ink); border-style: solid; }
.linkbtn.done { color: var(--good); border-color: rgba(92,179,137,.4); border-style: solid; }
.linkbtn[hidden] { display:none; }
.results-head h2 { margin:0; font-size:1.02rem; font-weight:650; letter-spacing:-.25px; }
.results-head .count { color: var(--ink-faint); font-weight:500; font-size:.88rem; }
.sortbar { display:flex; gap:6px; flex-wrap:wrap; }
.chip { font-size:.78rem; padding:7px 13px; border:1px solid var(--line); background: var(--surface);
  border-radius:999px; cursor:pointer; color: var(--ink-soft); font-weight:550; font-family:inherit;
  transition: all 140ms ease; }
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight:600; }

/* Best-fit hero card */
.hero {
  position: relative; overflow: hidden;
  display:grid; grid-template-columns: 128px 1fr auto; gap:24px; padding:24px;
  border:1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(255,255,255,.028), transparent 42%), var(--surface);
  box-shadow: var(--shadow);
}
.hero::before { content:""; position:absolute; left:0; right:0; top:0; height:1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent); }
.hero.enter { animation: rise 320ms cubic-bezier(.2, .6, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.bestpill { display:inline-flex; align-items:center; gap:6px; font-size:.64rem; font-weight:700;
  letter-spacing:.8px; text-transform:uppercase; color: var(--accent-ink);
  background: var(--accent); padding:4px 10px; border-radius:999px; }
.bestpill.spec { background: transparent; color: var(--ink-soft); border: 1px solid var(--line-strong); }
.hero { scroll-margin-top: 84px; }
.backbtn { margin-left:8px; font-family:inherit; font-size:.74rem; font-weight:600; padding:3px 9px;
  border-radius:999px; cursor:pointer; color: var(--ink-soft); background: transparent;
  border:1px solid var(--line); transition: all 120ms ease; }
.backbtn:hover { color: var(--ink); border-color: var(--line-strong); }

/* "For: <glass> · 265 × 105 mm" above the results */
.forline { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; margin-bottom:12px;
  padding:0 2px; font-size:.86rem; color: var(--ink-soft); line-height:1.45; }
.forline .k { font-size:.66rem; font-weight:700; letter-spacing:.8px; text-transform:uppercase;
  color: var(--ink-faint); }
.forline b { color: var(--ink); font-weight:600; }
.forline .sku { font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace; font-size:.72rem;
  color: var(--ink-soft); background: var(--surface); border:1px solid var(--line); border-radius:5px; padding:1px 6px; }
.forline .dims { white-space:nowrap; }
.hero .schematic { width:128px; height:128px; }
.hero .name { font-size:1.34rem; font-weight:700; letter-spacing:-.5px; margin:11px 0 4px; line-height:1.2; }
.hero .art { font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace; font-size:.8rem;
  color: var(--ink-soft); }

.specs { display:grid; grid-template-columns: 1fr 1fr; gap:12px 20px; margin-top:18px; max-width:388px; }
.spec .k { font-size:.66rem; text-transform:uppercase; letter-spacing:.6px; color: var(--ink-faint); }
.spec .v { font-size:1.0rem; font-weight:600; margin-top:3px; }
.spec .v small { font-weight:500; color: var(--ink-soft); font-size:.76rem; }
.spec .v .pin { font-size:.72rem; font-weight:700; padding:1px 7px; border-radius:5px; margin-left:6px;
  border:1px solid transparent; }
.pin.good { background: rgba(92,179,137,.14); color: var(--good); border-color: rgba(92,179,137,.28); }
.pin.tight { background: rgba(211,165,88,.14); color: var(--tight); border-color: rgba(211,165,88,.28); }
.pin.snug { background: rgba(217,119,106,.14); color: var(--snug); border-color: rgba(217,119,106,.28); }

.badges { margin-top:16px; display:flex; flex-wrap:wrap; gap:7px; }
.badge { font-size:.71rem; font-weight:600; padding:4px 10px; border-radius:7px;
  background: var(--surface-3); color: var(--ink-soft); border:1px solid var(--line);
  display:inline-flex; align-items:center; gap:5px; }
.badge svg { flex: none; opacity: .85; }
.badge.cap { background: var(--hl); color: var(--ink); border-color: var(--line-strong); }
.badge.mfr { background: rgba(92,179,137,.13); color: var(--good); border-color: rgba(92,179,137,.3); }
.badge.needed { background: rgba(211,165,88,.13); color: var(--tight); border-color: rgba(211,165,88,.26); }
.badge.black { background:#0a0b0c; color:#cfd4da; border-color:#34383f; }
.badge.est { background: var(--surface-2); color: var(--ink-faint); border-color: var(--line);
  border-style: dashed; }

.pricecol { text-align:right; min-width:148px; }
.price-label { font-size:.66rem; color: var(--ink-faint); text-transform:uppercase; letter-spacing:.7px; }
.price { font-size:1.5rem; font-weight:750; letter-spacing:-.6px; white-space:nowrap; margin-top:3px; }
.price .cur { font-size:.78rem; font-weight:600; color: var(--ink-soft); }
.price.horeca { font-size:.84rem; font-weight:550; color: var(--ink-soft); margin-top:5px; letter-spacing:-.1px; }
.total { margin-top:14px; padding-top:12px; border-top:1px solid var(--line-soft); }
.total span { display:block; font-size:.66rem; color: var(--ink-faint); text-transform:uppercase; letter-spacing:.7px; }
.total b { display:block; font-size:1.05rem; font-weight:700; margin-top:3px; white-space:nowrap; }

@media (max-width:680px){
  .hero { grid-template-columns: 96px 1fr; gap:18px; padding:20px; }
  .hero .schematic { width:76px; height:76px; }
  .hero .pricecol { grid-column:1/-1; text-align:left;
    border-top:1px solid var(--line-soft); padding-top:14px; margin-top:2px; }
  .hero .total { border-top:0; padding-top:0; margin-top:10px; }
  .hero img.bild { width:96px; }   /* img.bild outranks the base .hero .bild rule below */
  .specs { max-width:none; }
}
/* Phones: stack the hero so specs get the full card width */
@media (max-width:520px){
  .hero { grid-template-columns: 1fr; gap:14px; }
  .hero img.bild, .hero .schematic { width:88px; }
}

/* Actual FRIES reference image (catalog guide chart) */
.bild { display:block; background:#fff; object-fit:contain; border:1px solid var(--line-strong); }
.hero .bild { width:128px; height:auto; max-height:212px; align-self:start;
  padding:7px; border-radius:12px; box-shadow: var(--shadow-sm); }
.row .bild { width:46px; height:46px; padding:3px; border-radius:8px; }

/* Other-fits collapsible */
.others { margin-top:20px; }
.others-toggle { width:100%; text-align:left; cursor:pointer; background:var(--surface);
  border:1px solid var(--line); border-radius: var(--radius-sm); padding:13px 16px;
  color: var(--ink-soft); font-weight:600; font-size:.88rem; font-family:inherit; display:flex;
  align-items:center; justify-content:space-between; transition: all 140ms ease; }
.others-toggle:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); }
.others-toggle .arr { transition: transform 200ms ease; color: var(--ink-faint); font-size:1.1rem; }
.others-toggle[aria-expanded="true"] .arr { transform: rotate(90deg); }
.others-list { margin-top:10px; display:none; }
.others-list.open { display:block; }

.row { display:grid; grid-template-columns: 46px 1fr auto auto; gap:15px; align-items:center;
  padding:12px 14px; margin-bottom:8px; transition: border-color 140ms ease, background 140ms ease; }
.row { cursor:pointer; }
.row:hover { border-color: var(--line-strong); background: var(--surface-2); }
.row:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--radius); }
.row .schematic { width:46px; height:46px; }
.row .rname { font-weight:600; font-size:.92rem; letter-spacing:-.1px; }
.row .rsub { font-size:.77rem; color: var(--ink-soft); margin-top:2px; }
.row .rmargins { font-size:.77rem; color: var(--ink-soft); white-space:nowrap; text-align:right; }
.row .rmargins b { color: var(--ink); font-weight:600; }
.row .rprice { font-weight:700; white-space:nowrap; text-align:right; }
.row .rprice small { display:block; font-weight:500; font-size:.7rem; color: var(--ink-faint); }
@media (max-width:680px){
  .row { grid-template-columns: 40px 1fr auto; }
  .row .rmargins { display:none; }
  .row .schematic { width:40px; height:40px; }
  .row .bild { width:40px; height:40px; }
}

/* empty / placeholder states */
.empty, .placeholder { text-align:center; padding:56px 28px; }
.empty .big { font-size:2.4rem; margin-bottom:12px; color: var(--ink-faint); }
.empty h3, .placeholder h3 { color: var(--ink); margin:0 0 8px; font-weight:650; letter-spacing:-.2px; }
.empty p, .placeholder p { color: var(--ink-soft); margin:0 auto; max-width:448px; font-size:.9rem; }
.placeholder img { width:100%; max-width:300px; border-radius:12px; box-shadow: var(--shadow);
  margin-bottom:22px; border:1px solid var(--line); filter: grayscale(.18) contrast(1.02); }

footer { text-align:center; padding:32px 24px; color: var(--ink-faint); font-size:.78rem;
  border-top:1px solid var(--line-soft); margin-top:24px; line-height:1.7; }
footer strong { color: var(--ink-soft); font-weight:600; }

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce){
  * { animation-duration:.01ms !important; transition-duration:.01ms !important; }
  html { scroll-behavior:auto; }
}
