:root {
  --ink: #2b211b;
  --muted: #76675c;
  --paper: #fdf8f2;
  --card: #ffffff;
  --line: #eadfd3;
  --accent: #c2541b;
  --accent-ink: #ffffff;
  --danger-bg: #fdecea;
  --danger-ink: #8a1c12;
  --notice-bg: #fff6dc;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

main { max-width: 880px; margin: 0 auto; padding: 24px 16px 96px; }

.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand-mark { color: var(--accent); }
.site-header nav { display: flex; gap: 18px; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.site-footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 24px 16px; }

h1 { font-size: 1.8rem; margin: 8px 0 16px; }

.hero { padding: 24px 0 8px; }
.hero p { color: var(--muted); }

.products { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.product { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; }
.product h2 { margin: 0 0 6px; font-size: 1.15rem; }
.product p { margin: 0 0 12px; color: var(--muted); }
.product .price { color: var(--ink); font-weight: 600; margin-top: auto; }
.product .button { align-self: flex-start; }

.button {
  display: inline-block; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--accent);
  color: var(--accent); background: transparent; text-decoration: none; font: inherit; cursor: pointer;
}
.button.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.checkout { display: grid; gap: 16px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 16px 18px; margin: 0; display: grid; gap: 12px; }
legend { font-weight: 600; padding: 0 6px; }
label { display: grid; gap: 4px; font-weight: 500; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.hint { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
input, select { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
input[type="checkbox"] { width: auto; }
.field-error { color: var(--danger-ink); font-size: 0.9rem; font-weight: 400; }

.alert { background: var(--danger-bg); color: var(--danger-ink); border: 1px solid #f3c4bd; border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; }
.alert p { margin: 6px 0 0; }
.alert-message { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.95rem; overflow-wrap: anywhere; }
.notice { background: var(--notice-bg); border-radius: 12px; padding: 12px 18px; margin-bottom: 16px; }

.confirmation { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.confirmation table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.confirmation th { text-align: left; font-weight: 400; }
.confirmation td { text-align: right; }
.confirmation th, .confirmation td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.confirmation .total th, .confirmation .total td { font-weight: 700; }
.muted { color: var(--muted); }

.demo-panel {
  position: fixed; left: 12px; bottom: 12px; display: flex; gap: 4px; align-items: center;
  padding: 4px 6px; border-radius: 8px; background: #fff; border: 1px solid var(--line); opacity: 0.6; font-size: 0.75rem;
}
.demo-panel:hover, .demo-panel:focus-within { opacity: 1; }
.demo-title { color: var(--muted); padding: 0 4px; }
.demo-panel button { font: inherit; border: 0; border-radius: 6px; padding: 3px 8px; background: var(--paper); color: var(--ink); cursor: pointer; }
.demo-panel button.active { background: var(--ink); color: #fff; }
