:root {
  color-scheme: light;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --paper: #ffffff;
  --danger: #b42318;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  min-height: 100vh;
}

button, input { font: inherit; }

/* iOSの「ダブルタップ拡大」の誤発動を防ぐ(+/-ボタン連打対策) */
button, input, label { touch-action: manipulation; }

.shell {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 24px 16px 48px;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.45;
  margin: 0 0 12px;
  text-align: center;
}

.lead {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  margin: 0 auto 24px;
  max-width: 440px;
  text-align: center;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}

.panel + .panel { margin-top: 14px; }

.panel-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
}

.price-main {
  font-size: 37px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 6px 0 4px;
  text-align: center;
}

.price-main small {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.consent {
  align-items: flex-start;
  background: #f6f6f6;
  border-radius: 12px;
  display: flex;
  font-size: 13px;
  gap: 10px;
  line-height: 1.65;
  margin: 18px 0;
  padding: 14px;
}

.consent input { margin-top: 4px; }

.primary {
  background: var(--ink);
  border: 0;
  border-radius: 13px;
  color: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  min-height: 52px;
  padding: 14px 18px;
  width: 100%;
}

.primary:disabled { cursor: default; opacity: 0.42; }

.status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  min-height: 22px;
  padding-top: 12px;
  text-align: center;
}

.status.error { color: var(--danger); }

.products {
  display: grid;
  gap: 10px;
}

.product {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  padding: 13px 14px;
}

.product-info {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.product-thumb {
  border: 1px solid var(--line);
  border-radius: 10px;
  flex: none;
  height: 56px;
  object-fit: cover;
  width: 56px;
}

.product-name { font-size: 15px; font-weight: 700; }

.product-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.quantity {
  align-items: center;
  display: grid;
  grid-template-columns: 36px 44px 36px;
}

.quantity button {
  align-items: center;
  background: white;
  border: 1px solid #cfcfcf;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-size: 20px;
  height: 36px;
  justify-content: center;
  padding: 0;
}

.quantity button:first-child { border-radius: 9px 0 0 9px; }
.quantity button:last-child { border-radius: 0 9px 9px 0; }

.quantity input {
  appearance: textfield;
  border: solid #cfcfcf;
  border-width: 1px 0;
  height: 36px;
  min-width: 0;
  padding: 0;
  text-align: center;
  width: 44px;
}

.quantity input::-webkit-inner-spin-button,
.quantity input::-webkit-outer-spin-button { appearance: none; margin: 0; }

.subscribe {
  background: var(--ink);
  border: 0;
  border-radius: 11px;
  color: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  min-height: 38px;
  padding: 8px 14px;
  white-space: nowrap;
}

.subscribe:disabled { cursor: default; opacity: 0.42; }

.summary {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 14px;
}

.summary-row {
  display: flex;
  font-size: 14px;
  justify-content: space-between;
  line-height: 1.9;
}

.summary-row.total {
  font-size: 18px;
  font-weight: 800;
  margin-top: 4px;
}

.sticky-action {
  background: linear-gradient(to top, var(--paper) 74%, transparent);
  bottom: 0;
  margin: 0 -16px;
  padding: 22px 16px 14px;
  position: sticky;
}

.complete {
  margin-top: 18vh;
  text-align: center;
}

.complete-mark {
  align-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  display: flex;
  font-size: 30px;
  height: 64px;
  justify-content: center;
  margin: 0 auto 18px;
  width: 64px;
}

.secondary-link {
  color: var(--ink);
  display: inline-block;
  font-size: 13px;
  margin-top: 14px;
}

@media (max-width: 380px) {
  .shell { padding-left: 12px; padding-right: 12px; }
  .panel { padding: 15px; }
  .product { gap: 7px; padding: 12px 10px; }
  .product-info { gap: 8px; }
  .product-thumb { height: 44px; width: 44px; }
  .quantity { grid-template-columns: 34px 40px 34px; }
  .quantity input { width: 40px; }
}
