:root {
  --bg: #fafaf7;
  --fg: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #b45309;
  --accent-soft: #fef3c7;
  --link: #2563eb;
  --good: #15803d;
  --card: #ffffff;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Header ===== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.hwrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brand {
  font-size: 17px;
  font-weight: 700;
  color: var(--fg);
}
.brand:hover { text-decoration: none; }
.back {
  font-size: 13px;
  color: var(--muted);
}

/* ===== Container / Lede ===== */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
.lede h1 {
  font-size: 28px;
  margin: 0 0 8px;
}
.lede .sub {
  margin: 0 0 12px;
  color: var(--fg);
}
.lede .meta {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}
.lede .meta .dot {
  margin: 0 6px;
}
.lede .notice {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  margin: 16px 0 0;
}

.lede .wip {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin: 12px 0;
  color: #7f1d1d;
}

.wip-tag {
  display: inline-block;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 8px;
  letter-spacing: 0.05em;
}

/* ===== Filter ===== */
.filter {
  margin: 24px 0 16px;
}
.filter input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.filter input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ===== Products ===== */
.products {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.loading {
  text-align: center;
  color: var(--muted);
  padding: 32px 0;
}

.product {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.product-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border: 0;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  text-align: left;
  font-family: inherit;
  color: var(--fg);
  font-weight: 500;
  gap: 12px;
}
.product-header:hover {
  background: #f9fafb;
}
.product-header .pname {
  flex: 1;
  min-width: 0;
}
.product-header .pmeta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.product-header .chev {
  color: var(--muted);
  transition: transform .2s;
  font-size: 12px;
}
.product[open] .chev {
  transform: rotate(180deg);
}

.product-body {
  display: none;
  border-top: 1px solid var(--line);
  padding: 0;
  background: #fdfdfb;
}
.product[open] .product-body {
  display: block;
}

.empty {
  padding: 14px 16px;
  color: var(--muted);
  font-size: 14px;
}

/* ===== Items table ===== */
.items {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.items thead th {
  position: sticky;
  top: 56px;
  background: #f3f4f6;
  text-align: left;
  padding: 8px 10px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.items thead th .arrow {
  color: var(--muted);
  margin-left: 4px;
  font-size: 11px;
}
.items thead th.active {
  color: var(--accent);
}
.items tbody tr {
  border-bottom: 1px solid #f0eee8;
}
.items tbody tr:hover {
  background: #fff8e1;
}
.items td {
  padding: 8px 10px;
  vertical-align: top;
}
.items td.col-name {
  min-width: 240px;
}
.items td.col-price {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.items td.col-unit {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--good);
  font-weight: 600;
}
.items td.col-cap {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--muted);
}
.items td.col-shop {
  color: var(--muted);
  font-size: 12px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-link {
  color: var(--fg);
  text-decoration: none;
}
.item-link:hover {
  color: #bf0000;
  text-decoration: underline;
}
.qty-mini {
  color: var(--muted);
  font-size: 11px;
  margin-left: 6px;
}

/* ===== Request form ===== */
.request-form {
  margin: 40px 0 24px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.request-form h2 {
  margin: 0 0 8px;
  font-size: 18px;
}
.request-form p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}
.rfrow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.rfrow input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}
.rfrow input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  background: #fff;
}
.rfrow button {
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.rfrow button:hover {
  background: #92400e;
}
.note-small {
  font-size: 12px !important;
  margin-top: 10px !important;
  color: var(--muted) !important;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 20px 16px 32px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.site-footer .attr {
  margin-top: 8px;
}

/* ===== Mobile ===== */
@media (max-width: 720px) {
  .lede h1 { font-size: 22px; }
  .items thead { display: none; }
  .items, .items tbody, .items tr, .items td {
    display: block;
    width: 100%;
  }
  .items tbody tr {
    padding: 12px 14px;
    border-bottom: 8px solid #f0ede5;
  }
  .items td {
    padding: 2px 0;
    text-align: left !important;
  }
  .items td.col-name {
    font-weight: 500;
    margin-bottom: 4px;
  }
  .items td.col-price::before { content: "価格: "; color: var(--muted); }
  .items td.col-unit::before { content: "単価: "; color: var(--muted); }
  .items td.col-cap::before { content: "容量単価: "; color: var(--muted); }
  .items td.col-shop::before { content: "店舗: "; }
}
