:root {
  --ink: #151511;
  --muted: #6f6c63;
  --paper: #f7f5ef;
  --panel: #fffdf7;
  --line: #d9d5c9;
  --signal: #ff4d17;
  --signal-dark: #d83a08;
  --acid: #e8ff47;
  --green: #147b50;
  --yellow: #a86d00;
  --red: #b42727;
  --shadow: 8px 8px 0 #151511;
  font-family: Inter, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .28;
  background-image: radial-gradient(#151511 0.45px, transparent .45px);
  background-size: 5px 5px;
  mix-blend-mode: multiply;
  z-index: 10;
}

.site-header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 2px solid var(--ink);
  background: rgba(247, 245, 239, .94);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 2;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 20px; font-weight: 900; letter-spacing: -.05em; }
.brand-mark { width: 32px; height: 32px; border: 2px solid var(--ink); display: flex; align-items: end; gap: 3px; padding: 5px; background: var(--acid); transform: rotate(-2deg); }
.brand-mark i { display: block; flex: 1; background: var(--ink); }
.brand-mark i:nth-child(1) { height: 45%; }
.brand-mark i:nth-child(2) { height: 90%; }
.brand-mark i:nth-child(3) { height: 65%; }
.live-badge { display: flex; align-items: center; gap: 8px; font: 800 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.live-badge i { width: 8px; height: 8px; background: var(--signal); border-radius: 50%; box-shadow: 0 0 0 4px rgba(255, 77, 23, .15); animation: pulse 1.8s infinite; }

main { min-height: calc(100vh - 160px); }
.hero { position: relative; overflow: hidden; padding: 92px max(24px, calc((100vw - 1180px) / 2)) 54px; border-bottom: 2px solid var(--ink); }
.hero::after { content: "在庫"; position: absolute; right: -22px; top: 6px; font-weight: 1000; font-size: clamp(140px, 23vw, 330px); letter-spacing: -.13em; line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(21,21,17,.09); pointer-events: none; }
.eyebrow { margin: 0 0 16px; color: var(--signal-dark); font: 900 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .18em; }
h1 { position: relative; z-index: 1; max-width: 780px; margin: 0; font-size: clamp(58px, 9vw, 118px); line-height: .89; letter-spacing: -.085em; font-weight: 1000; }
h1 em { color: var(--signal); font-style: normal; position: relative; }
h1 em::after { content: ""; position: absolute; left: -3%; right: -8%; bottom: 5%; height: 10px; background: var(--acid); z-index: -1; transform: rotate(-1.5deg); }
.lead { margin: 30px 0 38px; max-width: 640px; color: #47453f; font-size: clamp(15px, 1.8vw, 19px); line-height: 1.85; font-weight: 650; }

.search-panel { position: relative; z-index: 1; max-width: 1080px; padding: 18px; border: 2px solid var(--ink); background: var(--panel); box-shadow: var(--shadow); }
.field-label { display: block; margin: 0 0 9px; font: 850 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; }
.search-row { display: grid; grid-template-columns: minmax(260px, 1fr) 170px 170px; gap: 8px; }
.query-wrap, .select-wrap { height: 58px; border: 2px solid var(--ink); background: #fff; }
.query-wrap { display: flex; align-items: center; padding: 0 16px; gap: 12px; }
.query-wrap svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.query-wrap input { width: 100%; border: 0; outline: none; background: transparent; color: var(--ink); font-weight: 750; }
.query-wrap input::placeholder { color: #979389; font-weight: 550; }
.select-wrap { position: relative; }
.select-wrap::after { content: "⌄"; position: absolute; right: 14px; top: 14px; font-size: 20px; pointer-events: none; }
.select-wrap select { width: 100%; height: 100%; border: 0; outline: 0; padding: 0 38px 0 14px; background: transparent; appearance: none; font-weight: 800; }
#submit-button { height: 58px; display: flex; align-items: center; justify-content: center; gap: 7px; color: #fff; background: var(--signal); border: 2px solid var(--ink); font-weight: 950; cursor: pointer; transition: transform .15s, background .15s; }
#submit-button:hover { transform: translate(-2px, -2px); background: #ff6435; box-shadow: 3px 3px 0 var(--ink); }
#submit-button:active { transform: translate(0); box-shadow: none; }
#submit-button:disabled { opacity: .65; cursor: wait; }
#submit-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding-top: 13px; }
.examples > span { margin-right: 3px; color: var(--muted); font: 800 10px/1 ui-monospace, monospace; letter-spacing: .08em; }
.examples button { border: 1px solid #bdb8ab; background: #f5f2e9; padding: 6px 9px; cursor: pointer; font-size: 11px; font-weight: 750; }
.examples button:hover { background: var(--acid); border-color: var(--ink); }
.retailer-strip { position: relative; z-index: 1; max-width: 1080px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 28px; }
.retailer-strip span { color: var(--muted); font: 800 10px/1 ui-monospace, monospace; letter-spacing: .12em; }
.retailer-strip b { font: 900 12px/1 Arial, sans-serif; letter-spacing: -.04em; }
.retailer-strip .yamada { color: #df0011; }.retailer-strip .bic { color: #bf151e; }.retailer-strip .yodobashi { color: #d70012; }

.status-region, .results, .empty-state { max-width: 1180px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.status-region { padding-top: 44px; }
.loading-card, .error-card { border: 2px solid var(--ink); background: var(--panel); padding: 24px; box-shadow: 5px 5px 0 var(--ink); }
.loading-card { display: flex; align-items: center; gap: 22px; }
.loading-card strong { display: block; font-size: 20px; }
.loading-card span { display: block; color: var(--muted); margin-top: 6px; font-size: 13px; }
.radar { position: relative; width: 46px; height: 46px; border: 2px solid var(--ink); border-radius: 50%; overflow: hidden; background: var(--acid); }
.radar::before, .radar::after { content: ""; position: absolute; background: var(--ink); opacity: .35; }
.radar::before { width: 1px; top: 0; bottom: 0; left: 50%; }.radar::after { height: 1px; left: 0; right: 0; top: 50%; }
.radar i { position: absolute; inset: 7px; border: 1px solid var(--ink); border-radius: 50%; }
.radar i:nth-child(2) { inset: 15px; }.radar i:nth-child(3) { inset: 50% 2px auto 50%; height: 2px; border: 0; border-radius: 0; background: var(--signal); transform-origin: left center; animation: spin 1.2s linear infinite; }
.error-card { color: var(--red); font-weight: 750; }

.results { padding-top: 64px; padding-bottom: 68px; }
.results-head { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 28px; border-bottom: 2px solid var(--ink); padding-bottom: 18px; }
.results-head h2 { margin: 0; font-size: clamp(36px, 5vw, 64px); letter-spacing: -.07em; line-height: 1; }
#result-meta { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.summary { display: flex; gap: 8px; flex-wrap: wrap; justify-content: end; }
.summary span { display: block; border: 1px solid var(--ink); background: var(--panel); padding: 8px 10px; font: 800 11px/1 ui-monospace, monospace; }
.summary strong { color: var(--signal-dark); }
.result-list { display: grid; gap: 16px; }
.retailer-card { border: 2px solid var(--ink); background: var(--panel); box-shadow: 5px 5px 0 var(--ink); overflow: hidden; }
.retailer-top { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px; }
.product-image { width: 96px; height: 96px; object-fit: contain; border: 1px solid var(--line); background: #fff; }
.product-placeholder { display: grid; place-items: center; color: #aaa; font: 900 11px/1 monospace; }
.retailer-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 950; font-size: 13px; }
.retailer-name i { width: 11px; height: 11px; background: var(--retailer); border: 1px solid var(--ink); }
.product-name { margin: 7px 0 0; font-size: clamp(16px, 2vw, 21px); line-height: 1.45; font-weight: 850; }
.product-name.muted { color: var(--muted); }
.price-box { text-align: right; min-width: 135px; }
.price-box small { display: block; color: var(--muted); font: 700 10px/1 ui-monospace, monospace; }
.price { display: block; margin-top: 6px; font-size: 27px; font-weight: 950; letter-spacing: -.05em; white-space: nowrap; }
.points { color: var(--muted); font-size: 11px; font-weight: 700; }
.stock-grid { display: grid; grid-template-columns: 1fr 1fr auto; border-top: 1px solid var(--ink); }
.stock-cell { padding: 14px 18px; border-right: 1px solid var(--ink); }
.stock-cell small { display: block; margin-bottom: 7px; color: var(--muted); font: 750 10px/1 ui-monospace, monospace; letter-spacing: .06em; }
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 900; font-size: 14px; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--ink); background: #aaa; }
.status.available::before { background: #35bf78; }.status.low::before { background: #ffc427; }.status.order::before { background: #73a9ff; }.status.unavailable::before, .status.not_found::before { background: #d2d0c9; }.status.unknown::before { background: #ff865f; }
.card-actions { display: flex; align-items: center; gap: 8px; padding: 10px 14px; }
.card-actions a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; padding: 10px 12px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font-size: 12px; font-weight: 850; }
.card-actions a.secondary { background: transparent; color: var(--ink); }
.stores { border-top: 1px solid var(--ink); background: #f2efe6; }
.store-toggle { width: 100%; border: 0; padding: 13px 18px; background: transparent; display: flex; justify-content: space-between; cursor: pointer; font-size: 12px; font-weight: 850; }
.store-toggle span:last-child { font-family: monospace; }
.store-list { margin: 0; padding: 0 18px 16px; list-style: none; display: grid; gap: 7px; }
.store-list[hidden] { display: none; }
.store-list li { display: grid; grid-template-columns: minmax(160px, 1fr) auto; gap: 14px; align-items: start; padding: 12px; border: 1px solid #c9c4b8; background: var(--panel); }
.store-list h4 { margin: 0; font-size: 13px; }.store-list p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }.store-list a { font-size: 11px; font-weight: 850; }
.retailer-note { padding: 10px 18px; border-top: 1px dashed #b9b4a8; color: var(--muted); font-size: 10px; }
.disclaimer { margin: 28px 0 0; color: var(--muted); font-size: 11px; text-align: center; }

.empty-state { padding-top: 68px; padding-bottom: 78px; }
.scope-line { border-top: 2px solid var(--ink); position: relative; }.scope-line span { position: relative; top: -8px; background: var(--paper); padding-right: 12px; font: 900 10px/1 ui-monospace, monospace; letter-spacing: .14em; }
.scope-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 28px; border: 2px solid var(--ink); }
.scope-grid article { padding: 24px; min-height: 180px; background: var(--panel); }.scope-grid article + article { border-left: 1px solid var(--ink); }
.scope-grid strong { color: var(--signal); font: 900 28px/1 ui-monospace, monospace; }.scope-grid h2 { margin: 25px 0 8px; font-size: 18px; }.scope-grid p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }

footer { min-height: 84px; border-top: 2px solid var(--ink); padding: 24px max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--ink); color: #fff; }
footer span { font-weight: 950; }footer p { margin: 0; color: #bdbbb4; font-size: 10px; }footer p a { color: #fff; font-weight: 800; text-underline-offset: 3px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .3; } }

@media (max-width: 820px) {
  .hero { padding-top: 64px; }
  .search-row { grid-template-columns: 1fr 145px; }
  .query-wrap { grid-column: 1 / -1; }
  #submit-button { min-width: 0; }
  .retailer-top { grid-template-columns: 72px minmax(0, 1fr); }.product-image { width: 72px; height: 72px; }.price-box { grid-column: 1 / -1; text-align: left; display: flex; align-items: baseline; gap: 10px; }
  .stock-grid { grid-template-columns: 1fr 1fr; }.card-actions { grid-column: 1 / -1; border-top: 1px solid var(--ink); }
  .scope-grid { grid-template-columns: 1fr; }.scope-grid article + article { border-left: 0; border-top: 1px solid var(--ink); }
}

@media (max-width: 560px) {
  .site-header { height: 64px; padding-inline: 18px; }
  .hero { padding: 50px 18px 40px; }
  h1 { font-size: clamp(54px, 18vw, 82px); }
  .lead br { display: none; }
  .search-panel { padding: 12px; box-shadow: 5px 5px 0 var(--ink); }
  .search-row { display: flex; flex-direction: column; }.query-wrap, .select-wrap, #submit-button { width: 100%; height: 54px; }
  .retailer-strip { gap: 11px; }
  .status-region, .results, .empty-state { padding-left: 18px; padding-right: 18px; }
  .results-head { align-items: start; flex-direction: column; }.summary { justify-content: start; }
  .retailer-top { gap: 12px; padding: 14px; }.stock-grid { grid-template-columns: 1fr; }.stock-cell { border-right: 0; border-bottom: 1px solid var(--ink); }.card-actions { flex-wrap: wrap; border-top: 0; }
  .store-list li { grid-template-columns: 1fr; }
  footer { align-items: start; flex-direction: column; padding: 22px 18px; }
}
