:root {
  color-scheme: dark;
  --bg: #1a1917;
  --panel: #22211e;
  --well: #2b2924;
  --line: #3c3932;
  --ink: #f5eee0;
  --sub: #c8bfb0;
  --muted: #a89e8e;
  --accent: #f4c478;
  --ease: cubic-bezier(.22, 1, .36, 1);
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); }
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, strong { font-weight: 600; }
h2 { font-size: 2rem; letter-spacing: -.025em; line-height: 1.15; }
h3 { font-size: 1.0625rem; line-height: 1.25; }
.wrap { width: min(1240px, calc(100% - 64px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[data-icon] { display: inline-flex; align-items: center; flex: 0 0 auto; }
[data-icon] svg { width: 18px; height: 18px; }
.topbar { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 1.125rem; text-decoration: none; white-space: nowrap; }
.brand-mark { padding: 8px; background: var(--accent); color: #21190e; border-radius: 8px; }
nav, .header-actions, .hero-actions { display: flex; align-items: center; gap: 12px; }
nav { gap: clamp(12px, 3vw, 36px); }
nav a, .quiet { font-size: .9375rem; text-decoration: none; color: var(--sub); }
.quiet { background: transparent; border: 0; padding: 8px; white-space: nowrap; }
nav a:hover, .quiet:hover { color: var(--accent); }
.button, .icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 8px 16px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none;
  font-weight: 600; font-size: .9375rem; background: transparent;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.button.primary { color: #241b0e; background: var(--accent); border-color: var(--accent); }
.button.primary:hover:not(:disabled) { background: #ffda99; }
.button.secondary:hover:not(:disabled), .icon-button:hover:not(:disabled) { background: var(--well); border-color: var(--muted); }
.icon-button { padding: 8px; min-width: 44px; }
.hero { position: relative; isolation: isolate; display: grid; grid-template-columns: .86fr 1.14fr; align-items: center; min-height: 392px; margin-block: 28px 48px; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: #24211c; }
.hero-content { padding: 36px 0 40px 44px; z-index: 1; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 600; color: var(--accent); }
.status-dot { display: inline-block; width: 8px; height: 8px; background: var(--accent); border-radius: 2px; }
h1 { margin: 12px 0 16px; font-size: clamp(2.625rem, 5.4vw, 4.75rem); line-height: 1; letter-spacing: -.055em; }
.hero-copy { max-width: 28rem; color: var(--sub); font-size: 1.125rem; }
.hero-copy strong { color: var(--ink); white-space: nowrap; }
.hero-actions { margin-top: 24px; flex-wrap: wrap; }
.hero-art { align-self: stretch; display: flex; justify-content: flex-end; }
.hero-art canvas { width: 100%; height: 100%; object-fit: cover; object-position: right center; image-rendering: pixelated; mask-image: linear-gradient(90deg, transparent, #000 18%); }
.catalog, #delivery, #faq, .information { margin-bottom: 64px; scroll-margin-top: 20px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-heading p { color: var(--muted); margin-top: 4px; }
.search { display: flex; gap: 8px; align-items: center; padding: 0 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; color: var(--muted); width: min(100%, 288px); }
.search input { background: transparent; border: 0; min-height: 44px; width: 100%; outline: 0; color: var(--ink); }
input::placeholder { color: var(--muted); }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.filters { display: flex; flex-wrap: wrap; gap: 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.filters button, .switch button { display: flex; align-items: center; gap: 8px; background: transparent; border: 0; padding: 8px 12px; color: var(--sub); min-height: 40px; }
.filters button { border-bottom: 2px solid transparent; }
.filters button[aria-pressed=true] { border-color: var(--accent); color: var(--ink); }
.filters small { color: var(--muted); font: .75rem ui-monospace, monospace; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.product { overflow: hidden; display: grid; grid-template-rows: auto 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; position: relative; }
.product:hover { border-color: var(--muted); }
.product-open { grid-row: 1 / 3; grid-column: 1; display: grid; grid-template-rows: auto 1fr; text-align: left; background: none; border: 0; padding: 0; }
.product-open:focus-visible { outline-offset: -3px; }
.product-art { display: grid; place-items: center; position: relative; min-height: 116px; border-bottom: 1px solid var(--line); background: #282520; }
.product-art::before { content: ""; position: absolute; width: 55%; height: 1px; background: var(--line); bottom: 24px; }
.sprite { image-rendering: pixelated; position: relative; width: 88px; height: 88px; }
.product-meta { padding: 12px 48px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.product-meta small { color: var(--muted); }
.product-meta b { color: var(--accent); font-weight: 600; }
.quick-add { position: absolute; bottom: 12px; right: 12px; width: 36px; min-height: 36px; min-width: 36px; padding: 0; border-radius: 8px; }
.empty { color: var(--sub); padding: 24px 0; grid-column: 1 / -1; }
.route { list-style: none; margin: 20px 0 12px; padding: 20px 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); }
.route li { display: flex; align-items: start; gap: 12px; }
.route li span { margin-top: 2px; color: var(--accent); }
.route p, .information p, .faq-list p { color: var(--sub); margin-top: 8px; }
.terminal { background: #171613; border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.terminal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.switch { display: flex; gap: 4px; }
.switch button { border-radius: 8px; }
.switch button[aria-pressed=true] { background: var(--well); color: var(--accent); }
.log { padding: 12px 0; min-height: 136px; font: .875rem/1.7 ui-monospace, "Cascadia Code", monospace; color: var(--sub); overflow-wrap: anywhere; }
.log p::before { content: "[Stockroom Bot] "; color: var(--accent); }
.faq-list { border-top: 1px solid var(--line); }
details { padding: 16px 0; border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; }
.information { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 12px; }
.information article { padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; scroll-margin-top: 20px; }
.information h2 { font-size: 1.25rem; letter-spacing: 0; }
.footer { border-top: 1px solid var(--line); min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: .875rem; color: var(--muted); }
.footer .brand { color: var(--ink); }
dialog { color: var(--ink); background: var(--panel); border: 1px solid var(--line); }
dialog::backdrop { background: #100d09b8; }
.modal { width: min(520px, calc(100% - 32px)); padding: 0; border-radius: 16px; max-height: calc(100% - 32px); }
.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(440px, 100%); max-height: none; height: 100%; padding: 0; }
.drawer[open] { display: flex; flex-direction: column; }
.dialog-head { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 1.5rem; }
.dialog-body, .cart-footer { padding: 20px; }
.dialog-body > * + *, .cart-footer > * + * { margin-top: 12px; }
.dialog-body p, .cart-footer p { color: var(--sub); }
.dialog-body .product-art { border: 1px solid var(--line); border-radius: 8px; min-height: 144px; }
.dialog-body .product-art .sprite { width: 120px; height: 120px; }
.full { width: 100%; }
.price { font-size: 1.5rem; color: var(--accent); }
.quantity { display: inline-flex; align-items: center; gap: 4px; }
.quantity input, .field select, .field input { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; min-height: 44px; padding: 8px; }
.quantity input { width: 88px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.presets button[aria-pressed=true] { border-color: var(--accent); color: var(--accent); }
.cart-body { flex: 1; min-height: 0; overflow: auto; padding: 0 20px; }
.cart-line { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line .sprite { width: 48px; height: 48px; }
.cart-line p { color: var(--muted); font-size: .875rem; }
.line-end { display: grid; justify-items: end; gap: 4px; }
.line-end .icon-button { min-width: 36px; min-height: 36px; }
.cart-footer { border-top: 1px solid var(--line); }
.cart-total, .bonus-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bonus-label { font-size: .875rem; }
progress { width: 100%; height: 8px; accent-color: var(--accent); display: block; }
.field { display: grid; gap: 4px; }
.field select, .field input { width: 100%; }
.checkout-summary { margin: 0; padding-left: 20px; color: var(--sub); }
.status { border-left: 3px solid var(--accent); padding-left: 12px; }
@media (max-width: 940px) {
  .wrap { width: calc(100% - 40px); }
  .hero-content { padding-left: 28px; }
  .hero { min-height: 348px; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 660px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { flex-wrap: wrap; gap: 8px; padding-block: 8px; }
  nav { order: 3; width: 100%; justify-content: space-between; padding-block: 4px; }
  nav a { font-size: .875rem; }
  .header-actions { gap: 4px; }
  .header-actions .button { padding-inline: 8px; }
  .hero { grid-template-columns: 1fr; margin-block: 16px 36px; }
  .hero-content { padding: 24px 16px 8px; }
  .hero-art { height: clamp(144px, 42vw, 224px); }
  .hero-art canvas { mask-image: linear-gradient(180deg, transparent, #000 23%); }
  .section-heading { flex-wrap: wrap; gap: 8px; }
  .search { width: 100%; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .filters button { padding-inline: 6px; }
  .route, .information { grid-template-columns: 1fr; }
  .footer { flex-wrap: wrap; padding-block: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; } }
#code-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 4px 8px; }
#code-message { grid-column: 1 / -1; font-size: .875rem; }
#code-message:empty { display: none; }
.hero { min-height: 340px; margin-bottom: 36px; }
.hero-art { position: relative; min-width: 0; }
.hero-art canvas { position: absolute; inset: 0; }
