/* shadcn/ui-style tokens (zinc base) with a copper accent — PCB traces, not purple gradients. */
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --popover: 0 0% 100%;
  --primary: 21 90% 44%;            /* copper */
  --primary-foreground: 0 0% 100%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 240 4.8% 95.9%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 21 90% 44%;
  --success: 142 72% 29%;
  --destructive: 0 72% 51%;
  --star: 38 92% 50%;
  --trace: 21 90% 44%;
  --radius: 0.75rem;
  --font-sans: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;
    --card: 240 8% 6%;
    --popover: 240 8% 6%;
    --primary: 24 95% 58%;
    --primary-foreground: 20 60% 8%;
    --secondary: 240 3.7% 15.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 240 3.7% 15.9%;
    --muted-foreground: 240 5% 64.9%;
    --accent: 240 3.7% 15.9%;
    --border: 240 3.7% 15.9%;
    --input: 240 3.7% 19%;
    --ring: 24 95% 58%;
    --success: 142 69% 58%;
    --destructive: 0 84% 66%;
    --trace: 24 95% 58%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 8% 6%;
  --popover: 240 8% 6%;
  --primary: 24 95% 58%;
  --primary-foreground: 20 60% 8%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --accent: 240 3.7% 15.9%;
  --border: 240 3.7% 15.9%;
  --input: 240 3.7% 19%;
  --ring: 24 95% 58%;
  --success: 142 69% 58%;
  --destructive: 0 84% 66%;
  --trace: 24 95% 58%;
  color-scheme: dark;
}

* { box-sizing: border-box; border-color: hsl(var(--border)); }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font: 14px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--font-mono); }
.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: none; }

/* ---------- primitives: button / input / badge ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: calc(var(--radius) - 4px);
  font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
  border: 1px solid transparent; background: transparent;
  transition: background-color 150ms, color 150ms, border-color 150ms, box-shadow 150ms, transform 120ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible, .input:focus-visible, .select:focus-visible, .card:focus-visible, .sheet-close:focus-visible {
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}
a.btn { text-decoration: none; color: inherit; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); box-shadow: 0 1px 2px hsl(var(--primary) / 0.3), inset 0 1px 0 hsl(0 0% 100% / 0.15); }
.btn-primary:hover { background: hsl(var(--primary) / 0.9); }
.btn-outline { background: hsl(var(--background)); border-color: hsl(var(--input)); box-shadow: 0 1px 2px hsl(0 0% 0% / 0.04); }
.btn-outline:hover { background: hsl(var(--accent)); }
.btn-ghost:hover { background: hsl(var(--accent)); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; }
.btn-icon { width: 36px; padding: 0; }

.input {
  height: 36px; width: 100%; padding: 0 12px;
  border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 4px);
  background: transparent; box-shadow: 0 1px 2px hsl(0 0% 0% / 0.04);
  transition: box-shadow 150ms, border-color 150ms;
}
.input::placeholder { color: hsl(var(--muted-foreground)); }
.input::-webkit-search-cancel-button { display: none; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: 1px 8px; font-size: 12px; font-weight: 500; line-height: 18px; white-space: nowrap;
  border: 1px solid transparent;
}
.badge-secondary { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); }
.badge-outline { border-color: hsl(var(--border)); color: hsl(var(--foreground)); }
.badge-primary { background: hsl(var(--primary) / 0.12); color: hsl(var(--primary)); }
.badge-success { background: hsl(var(--success) / 0.12); color: hsl(var(--success)); }
.badge-destructive { background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: hsl(var(--background) / 0.8);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid hsl(var(--border));
}
.top-inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; white-space: nowrap; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.2), 0 1px 2px hsl(var(--primary) / 0.4);
}
.brand-mark svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }

.nav-search { flex: 1; min-width: 0; display: flex; justify-content: flex-end; }
.search { flex: 1; min-width: 0; max-width: 600px; display: flex; gap: 8px; }
.input-wrap { position: relative; flex: 1; min-width: 0; }
.input-wrap .input { padding-left: 34px; }
.search-icon { position: absolute; left: 11px; top: 10px; color: hsl(var(--muted-foreground)); pointer-events: none; }
#theme-btn .moon { display: none; }
:root[data-theme="dark"] #theme-btn .sun { display: none; }
:root[data-theme="dark"] #theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) #theme-btn .moon { display: block; }
}

.progress { height: 2px; overflow: hidden; margin-bottom: -1px; }
.progress span {
  display: block; height: 100%; width: 100%; background: hsl(var(--primary));
  transform-origin: left; transform: scaleX(var(--p, 0));
  transition: transform 300ms var(--ease-out);
  box-shadow: 0 0 8px hsl(var(--primary) / 0.6);
}

/* ---------- hero: breadboard dot grid ---------- */
.hero {
  position: relative; padding: 88px 0 56px; text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0 -24px; z-index: -1;
  background-image: radial-gradient(hsl(var(--foreground) / 0.13) 1.2px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask: radial-gradient(ellipse 60% 70% at 50% 40%, #000 30%, transparent 75%);
          mask: radial-gradient(ellipse 60% 70% at 50% 40%, #000 30%, transparent 75%);
}
.hero-badge { font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 10px; background: hsl(var(--background)); }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: hsl(var(--success)); box-shadow: 0 0 0 0 hsl(var(--success) / 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px hsl(var(--success) / 0); } 100% { box-shadow: 0 0 0 0 hsl(var(--success) / 0); } }
.hero h1 {
  font-size: clamp(30px, 5vw, 52px); line-height: 1.05; letter-spacing: -0.04em; font-weight: 700;
  margin: 20px 0 16px; max-width: 760px; text-wrap: balance;
}
.hero p { color: hsl(var(--muted-foreground)); font-size: 17px; margin: 0 0 32px; max-width: 560px; text-wrap: pretty; }
/* the search bar is the centerpiece of the landing page */
.hero .search {
  width: 100%; max-width: 640px; flex: none; margin: 0 0 36px; padding: 6px; gap: 6px;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 1px 2px hsl(0 0% 0% / 0.04), 0 16px 40px -20px hsl(var(--primary) / 0.45);
  transition: border-color 200ms, box-shadow 200ms var(--ease-out);
}
.hero .search:focus-within {
  border-color: hsl(var(--primary) / 0.55);
  box-shadow: 0 0 0 4px hsl(var(--primary) / 0.12), 0 16px 40px -20px hsl(var(--primary) / 0.55);
}
.hero .search .input { height: 48px; border: 0; box-shadow: none; background: transparent; font-size: 16px; padding-left: 44px; }
.hero .search .input:focus-visible { box-shadow: none; }
.hero .search-icon { left: 15px; top: 15px; width: 18px; height: 18px; }
.hero .search .btn { height: 48px; padding: 0 24px; font-size: 15px; border-radius: var(--radius); }
.examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.example { font-family: var(--font-mono); font-size: 12.5px; }
.example:hover { border-color: hsl(var(--primary) / 0.5); color: hsl(var(--primary)); background: hsl(var(--primary) / 0.06); }
body.searched .hero { display: none; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 28px 0 20px; }
.toolbar-title { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.025em; }
.toolbar-title .q { font-family: var(--font-mono); font-weight: 500; font-size: 0.85em; color: hsl(var(--primary)); }
.summary { margin: 2px 0 0; color: hsl(var(--muted-foreground)); font-size: 13px; font-variant-numeric: tabular-nums; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.sep { width: 1px; height: 20px; background: hsl(var(--border)); }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.switch-track {
  position: relative; width: 36px; height: 20px; border-radius: 999px; flex: none;
  background: hsl(var(--input)); transition: background-color 150ms;
}
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: hsl(var(--background)); box-shadow: 0 1px 3px hsl(0 0% 0% / 0.25);
  transition: transform 200ms var(--ease-out);
}
.switch input:checked + .switch-track { background: hsl(var(--primary)); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring)); }

.select-wrap { position: relative; }
.select {
  appearance: none; height: 32px; padding: 0 30px 0 12px; font-size: 13px; cursor: pointer;
  border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 4px);
  background: hsl(var(--background)); box-shadow: 0 1px 2px hsl(0 0% 0% / 0.04);
}
.select-wrap .chevron { position: absolute; right: 9px; top: 8px; color: hsl(var(--muted-foreground)); pointer-events: none; }

.stores-menu { position: relative; }
#stores-count { font-family: var(--font-mono); font-size: 11px; padding: 0 6px; }
.popover {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  width: 288px; max-height: 70vh; overflow: auto; padding: 4px;
  background: hsl(var(--popover)); border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px);
  box-shadow: 0 10px 38px -10px hsl(240 10% 4% / 0.35), 0 10px 20px -15px hsl(240 10% 4% / 0.2);
  transform-origin: top right; animation: pop-in 150ms var(--ease-out);
}
@keyframes pop-in { from { opacity: 0; transform: scale(0.95); } }
.pop-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 4px 8px; }
.pop-title { font-size: 12px; font-weight: 600; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: hsl(var(--muted-foreground)); }
.pop-sep { height: 1px; background: hsl(var(--border)); margin: 4px -4px; }
.store-list { list-style: none; margin: 0; padding: 0; }
.store-list label { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: calc(var(--radius) - 6px); cursor: pointer; font-size: 13px; }
.store-list label:hover { background: hsl(var(--accent)); }
.store-list .sname { flex: 1; }
.sstate { font-family: var(--font-mono); font-size: 11.5px; color: hsl(var(--muted-foreground)); }
.sstate.err { color: hsl(var(--destructive)); }
.dot { width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; }

.checkbox {
  appearance: none; margin: 0; width: 16px; height: 16px; flex: none; cursor: pointer;
  border: 1px solid hsl(var(--primary)); border-radius: 4px; display: grid; place-items: center;
  transition: background-color 120ms;
}
.checkbox:checked { background: hsl(var(--primary)); }
.checkbox:checked::after {
  content: ""; width: 10px; height: 10px; background: hsl(var(--primary-foreground));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.checkbox:focus-visible { box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring)); }

/* ---------- grid + cards ---------- */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 224px), 1fr));
  padding-bottom: 64px;
}
.card {
  all: unset; box-sizing: border-box; cursor: pointer; position: relative;
  display: flex; flex-direction: column;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  box-shadow: 0 1px 2px hsl(0 0% 0% / 0.04);
  transition: border-color 200ms, box-shadow 200ms var(--ease-out), transform 200ms var(--ease-out);
}
/* copper "trace" that draws along the top edge on hover */
.card::before {
  content: ""; position: absolute; left: 16px; right: 16px; top: -1px; height: 2px; border-radius: 2px;
  background: hsl(var(--trace)); transform: scaleX(0); transform-origin: left;
  transition: transform 300ms var(--ease-out);
}
.card.new { animation: rise 280ms var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (hover: hover) {
  .card:hover { border-color: hsl(var(--foreground) / 0.18); box-shadow: 0 8px 24px -12px hsl(240 10% 4% / 0.25); transform: translateY(-2px); }
  .card:hover::before { transform: scaleX(1); }
}

.card-media {
  margin: 8px 8px 0; aspect-ratio: 4 / 3; border-radius: calc(var(--radius) - 4px);
  background: #fff; display: grid; place-items: center; overflow: hidden;
  border: 1px solid hsl(240 5.9% 90% / 0.6);
}
.card-media img { width: 82%; height: 82%; object-fit: contain; opacity: 0; transition: opacity 250ms; }
.card-media img.loaded { opacity: 1; }
.card-media.noimg { background: hsl(var(--muted)); border-color: transparent; color: hsl(var(--muted-foreground)); }
.card-media.noimg img { display: none; }
.card-media.noimg::after {
  content: ""; width: 32px; height: 32px; opacity: 0.5; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='5' y='5' width='14' height='14' rx='2'/%3E%3Cpath d='M9 2v3M15 2v3M9 19v3M15 19v3M2 9h3M2 15h3M19 9h3M19 15h3'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='5' y='5' width='14' height='14' rx='2'/%3E%3Cpath d='M9 2v3M15 2v3M9 19v3M15 19v3M2 9h3M2 15h3M19 9h3M19 15h3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.card-body { padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-title {
  margin: 0; font-size: 13.5px; font-weight: 500; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: calc(1.4em * 2);
}
.card-price { display: flex; flex-direction: column; margin-top: auto; }
.price { font-family: var(--font-mono); font-size: 20px; font-weight: 600; letter-spacing: -0.03em; }
.at { font-size: 12px; color: hsl(var(--muted-foreground)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 14px; border-top: 1px dashed hsl(var(--border)); font-size: 12px;
}
.card-footer .stores { font-family: var(--font-mono); font-size: 11px; }
.rating { white-space: nowrap; font-family: var(--font-mono); font-size: 11.5px; color: hsl(var(--muted-foreground)); }
.star { color: hsl(var(--star)); }

.empty { text-align: center; padding: 72px 16px; color: hsl(var(--muted-foreground)); border: 1px dashed hsl(var(--border)); border-radius: var(--radius); margin-bottom: 64px; }
.empty .icon { width: 28px; height: 28px; }
.empty h3 { color: hsl(var(--foreground)); font-size: 16px; margin: 12px 0 4px; font-weight: 600; }
.empty p { margin: 0; font-size: 13px; }

.skel { border-radius: var(--radius); border: 1px solid hsl(var(--border)); padding: 8px; display: flex; flex-direction: column; gap: 10px; }
.skel i { display: block; border-radius: calc(var(--radius) - 4px); background: hsl(var(--muted)); animation: skel 1.6s ease-in-out infinite; }
.skel i:nth-child(1) { aspect-ratio: 4 / 3; }
.skel i:nth-child(2) { height: 12px; width: 90%; margin: 4px 6px 0; }
.skel i:nth-child(3) { height: 12px; width: 60%; margin: 0 6px; }
.skel i:nth-child(4) { height: 20px; width: 40%; margin: 8px 6px 6px; }
@keyframes skel { 50% { opacity: 0.5; } }

/* ---------- sheet ---------- */
.sheet {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(540px, 100vw); max-width: 100vw;
  border: 0; border-left: 1px solid hsl(var(--border)); padding: 0;
  background: hsl(var(--background)); color: hsl(var(--foreground));
  box-shadow: -10px 0 40px hsl(0 0% 0% / 0.15);
}
.sheet::backdrop { background: hsl(240 10% 4% / 0.6); backdrop-filter: blur(2px); }
.sheet[open] { animation: sheet-in 300ms var(--ease-out); }
.sheet[open]::backdrop { animation: fade-in 300ms var(--ease-out); }
@keyframes sheet-in { from { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } }
.sheet-inner { padding: 24px; position: relative; }
.sheet-close {
  position: absolute; top: 16px; right: 16px; width: 28px; height: 28px; border-radius: 6px;
  border: 0; background: transparent; cursor: pointer; display: grid; place-items: center;
  color: hsl(var(--muted-foreground)); transition: background-color 150ms, color 150ms;
}
.sheet-close:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.sheet-header { display: grid; grid-template-columns: 88px 1fr; gap: 16px; align-items: center; padding-right: 32px; margin-bottom: 24px; }
.d-media { width: 88px; height: 88px; border-radius: calc(var(--radius) - 2px); background: #fff; border: 1px solid hsl(var(--border)); display: grid; place-items: center; overflow: hidden; }
.d-media img { width: 86%; height: 86%; object-fit: contain; }
.d-media.noimg { background: hsl(var(--muted)); }
.d-media.noimg img { display: none; }
.sheet-title { font-size: 16px; line-height: 1.35; margin: 0 0 6px; font-weight: 600; letter-spacing: -0.01em; }
.sheet-desc { margin: 0; font-size: 13px; color: hsl(var(--muted-foreground)); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sheet-desc .range { font-family: var(--font-mono); color: hsl(var(--foreground)); }

.d-section-label { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: hsl(var(--muted-foreground)); margin-bottom: 8px; }
.d-offers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.d-offer {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 14px;
  border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--card));
}
.d-offer.best { border-color: hsl(var(--primary) / 0.5); box-shadow: 0 0 0 3px hsl(var(--primary) / 0.08); }
.d-offer.oos { background: transparent; }
.d-offer.oos .d-price, .d-offer.oos .d-store { opacity: 0.55; }
.d-store { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; min-width: 0; }
.d-price { text-align: right; font-family: var(--font-mono); font-size: 16px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.d-price s { font-size: 12px; font-weight: 400; color: hsl(var(--muted-foreground)); margin-right: 6px; }
.d-listing { grid-column: 1 / -1; font-size: 12.5px; color: hsl(var(--muted-foreground)); line-height: 1.45; }
.d-facts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.d-facts .badge { font-size: 11.5px; }
.d-visit { align-self: end; justify-self: end; }
.d-visit .icon { width: 14px; height: 14px; }

.alert {
  display: flex; gap: 10px; margin-top: 20px; padding: 12px 14px;
  border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px);
  font-size: 12.5px; color: hsl(var(--muted-foreground));
}
.alert .icon { margin-top: 1px; color: hsl(var(--foreground)); }
.alert p { margin: 0; }

/* ---------- header lists ---------- */
.top-actions { display: flex; align-items: center; gap: 2px; }
.nav-btn { position: relative; gap: 6px; padding: 0 10px; }
.nav-btn .count { font-family: var(--font-mono); font-size: 11px; padding: 0 6px; line-height: 17px; }
.muted { color: hsl(var(--muted-foreground)); }
.small { font-size: 12.5px; }
.grow { flex: 1; min-width: 0; }
.danger { color: hsl(var(--destructive)); }
.danger:hover { background: hsl(var(--destructive) / 0.08); }
.btn-icon-sm { width: 28px; height: 28px; padding: 0; border-radius: 6px; }
.btn-icon-sm .icon { width: 14px; height: 14px; }

/* ---------- detail additions ---------- */
.d-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.d-toolbar .d-section-label { margin: 0; }
.menu-anchor { position: relative; }
.d-offer { grid-template-columns: 1fr auto; }
.d-facts { grid-column: 1; }
.d-actions { grid-column: 2; display: flex; gap: 6px; align-self: end; justify-self: end; }
.d-actions .icon { width: 14px; height: 14px; }

/* ---------- menu (add to project) ---------- */
.menu { width: 300px; padding: 6px; }
.menu .pop-title { display: block; padding: 4px 8px 6px; }
.menu-item {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 8px; border-radius: calc(var(--radius) - 6px); font-size: 13px; cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: hsl(var(--accent)); }
.menu .inline-form { padding: 4px; }

/* ---------- sheets: cart + projects ---------- */
.sheet-body { display: flex; flex-direction: column; gap: 16px; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding-right: 36px; }
.sheet-head .back { margin: -4px 0 6px -8px; }
.title-input { height: 40px; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; padding: 0 10px; margin: 0 0 6px -10px; width: calc(100% + 10px); border-color: transparent; box-shadow: none; background: transparent; }
.title-input:hover { border-color: hsl(var(--input)); }
.title-input:focus { border-color: hsl(var(--ring)); outline: none; }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { height: 32px; font-size: 13px; }

.list-empty { text-align: center; padding: 40px 16px; border: 1px dashed hsl(var(--border)); border-radius: var(--radius); color: hsl(var(--muted-foreground)); }
.list-empty .icon { width: 24px; height: 24px; }
.list-empty h3 { color: hsl(var(--foreground)); font-size: 15px; margin: 10px 0 4px; }
.list-empty p { margin: 0 auto; font-size: 13px; max-width: 300px; }

.cart-store { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px); background: hsl(var(--card)); overflow: hidden; }
.cart-store > header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid hsl(var(--border)); font-size: 14px; }
.cart-store > header .sub { margin-left: auto; font-weight: 600; }
.ship-hint { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 12px; color: hsl(var(--muted-foreground)); background: hsl(var(--muted) / 0.5); border-bottom: 1px solid hsl(var(--border)); flex-wrap: wrap; }
.ship-hint .icon { width: 14px; height: 14px; }
.ship-hint.ok { color: hsl(var(--success)); }
.ship-bar { flex-basis: 100%; height: 4px; border-radius: 4px; background: hsl(var(--border)); overflow: hidden; }
.ship-bar span { display: block; height: 100%; background: hsl(var(--primary)); transform-origin: left; transform: scaleX(var(--p)); transition: transform 300ms var(--ease-out); }

.line-items { list-style: none; margin: 0; padding: 0; }
.sheet-body > .line-items { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px); background: hsl(var(--card)); }
.line-item { display: grid; grid-template-columns: 48px 1fr auto 28px; gap: 12px; align-items: center; padding: 12px 10px 12px 14px; }
.line-item + .line-item { border-top: 1px solid hsl(var(--border)); }
.thumb { width: 48px; height: 48px; border-radius: 8px; background: #fff; border: 1px solid hsl(var(--border)); display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 88%; height: 88%; object-fit: contain; opacity: 0; transition: opacity 200ms; }
.thumb img.loaded { opacity: 1; }
.thumb.noimg { background: hsl(var(--muted)); }
.thumb.noimg img { display: none; }
.li-main { min-width: 0; }
.li-title { font-size: 13px; font-weight: 500; line-height: 1.35; color: inherit; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.li-title:hover { text-decoration: underline; text-underline-offset: 2px; }
.li-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 3px; }
.li-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.li-total { font-size: 13px; font-weight: 600; }
.stepper { display: inline-flex; align-items: center; border: 1px solid hsl(var(--input)); border-radius: 7px; height: 30px; }
.stepper .btn-icon-sm { height: 28px; width: 26px; }
.stepper-n { min-width: 26px; text-align: center; font-size: 12.5px; }

.project-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.project-card {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer;
  padding: 14px; border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px); background: hsl(var(--card));
  transition: border-color 150ms, box-shadow 150ms;
}
.project-card:hover { border-color: hsl(var(--primary) / 0.5); box-shadow: 0 0 0 3px hsl(var(--primary) / 0.06); }
.project-card:focus-visible { box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring)); }
.pc-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pc-main strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-cost { font-weight: 600; }

.sheet-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; padding-top: 12px; border-top: 1px dashed hsl(var(--border)); }
.total-row strong { font-size: 20px; letter-spacing: -0.02em; }
.sheet-foot p { margin: 0; }
.foot-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.foot-actions .icon { width: 14px; height: 14px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 16px; border-radius: calc(var(--radius) - 2px); font-size: 13px; font-weight: 500;
  background: hsl(var(--foreground)); color: hsl(var(--background));
  box-shadow: 0 10px 30px -10px hsl(0 0% 0% / 0.4);
}
.toast.show { animation: toast-in 240ms var(--ease-out); }
.toast .btn { color: hsl(var(--primary)); height: 26px; }
.toast .btn:hover { background: hsl(var(--background) / 0.12); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* cards off-screen skip layout/paint work */
.card { content-visibility: auto; contain-intrinsic-size: auto 340px; }

/* ---------- hero store list ---------- */
.store-strip { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 860px; }
.strip-label { font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: hsl(var(--muted-foreground)); }
.store-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.store-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 999px;
  border: 1px solid hsl(var(--border)); background: hsl(var(--background)); color: inherit; text-decoration: none;
  font-size: 12.5px; font-weight: 500; transition: border-color 150ms, background-color 150ms;
}
.store-chip:hover { border-color: hsl(var(--primary) / 0.5); background: hsl(var(--primary) / 0.05); }
.store-chip .dot { border-radius: 50%; width: 7px; height: 7px; }

/* ---------- homepage sections ---------- */
.home { padding-bottom: 24px; }
.home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 16px; }
.home-head h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.025em; }
.home-head p { margin: 2px 0 0; font-size: 13px; }
.home-grid { padding-bottom: 40px; }
.mrp { font-family: var(--font-mono); color: hsl(var(--muted-foreground)); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 14px; scrollbar-width: thin; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; flex: none; height: 30px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid hsl(var(--border)); background: transparent; font-size: 12.5px; font-weight: 500; color: hsl(var(--muted-foreground));
  transition: background-color 150ms, color 150ms, border-color 150ms;
}
.tab:hover { color: hsl(var(--foreground)); }
.tab[aria-selected="true"] { background: hsl(var(--foreground)); color: hsl(var(--background)); border-color: transparent; }
.tab:focus-visible { box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring)); outline: none; }
.tab .dot { border-radius: 50%; width: 7px; height: 7px; }
body.searched .home { display: none; }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .top-inner { gap: 8px; }
  .brand-name { display: none; }
  .search .btn { padding: 0 12px; }
  .hero .search .btn { padding: 0 16px; }
  .hero { padding: 56px 0 40px; }
  .hero::before { inset: 0 -16px; }
  .toolbar { padding: 20px 0 16px; }
  .controls { gap: 10px; }
  .sep { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-media { margin: 6px 6px 0; }
  .card-body { padding: 10px 10px 8px; }
  .card-footer { padding: 8px 10px; }
  .price { font-size: 17px; }
  .sheet { width: 100vw; border-left: 0; }
  .hide-sm { display: none; }
  .nav-btn { padding: 0 8px; }
  .line-item { grid-template-columns: 40px 1fr auto 28px; gap: 10px; padding: 10px 6px 10px 10px; }
  .thumb { width: 40px; height: 40px; }
  .menu { width: min(300px, calc(100vw - 48px)); }
  .sheet-inner { padding: 20px 16px; }
  .sheet-header { grid-template-columns: 68px 1fr; gap: 12px; }
  .d-media { width: 68px; height: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
