:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --link: #0645ad;
  --accent: #8b0000;
  --border: #767676;
  --flash-bg: #e8f4e8;
  --flash-border: #2e6b2e;
  --alert-bg: #fdecea;
  --alert-border: #8b0000;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --fg: #f2f2f2;
    --link: #8ab4f8;
    --accent: #ff8a80;
    --border: #9e9e9e;
    --flash-bg: #163216;
    --flash-border: #7bc67b;
    --alert-bg: #3a1210;
    --alert-border: #ff8a80;
  }
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  margin: 0;
}

header nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0.5rem;
  border-bottom: 2px solid var(--border);
}
header nav a {
  display: inline-block;
  padding: 0.75rem 1rem;   /* comfortably above 44px touch target */
  text-decoration: none;
  border-radius: 6px;
}
header nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 3px;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

footer {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 1rem;
}

a { color: var(--link); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}

h1 { font-size: 1.7rem; line-height: 1.3; }
h2 { font-size: 1.3rem; margin-top: 2rem; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--bg);
  padding: 0.75rem 1rem;
  z-index: 10;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.flash {
  background: var(--flash-bg);
  border: 2px solid var(--flash-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.alert-list { list-style: none; padding: 0; }
.alert-item {
  background: var(--alert-bg);
  border: 2px solid var(--alert-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.conditions div {
  display: flex;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.conditions dt { font-weight: 700; min-width: 9rem; }
.conditions dd { margin: 0; }

.link-list { padding-left: 0; list-style: none; }
.link-list li { margin: 0; border-bottom: 1px solid var(--border); }
.link-list a {
  display: block;
  padding: 0.8rem 0.25rem;
  text-decoration: none;
}
.link-list a:hover, .link-list a:focus { text-decoration: underline; }

.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

button {
  font: inherit;
  padding: 0.75rem 1.25rem;
  min-height: 48px;
  border: 2px solid var(--fg);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}
button:hover { text-decoration: underline; }

input[type="text"], input[type="email"], input[type="password"], select {
  font: inherit;
  width: 100%;
  max-width: 28rem;
  padding: 0.65rem;
  min-height: 48px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
}
input[type="checkbox"] {
  width: 1.4rem;
  height: 1.4rem;
  vertical-align: middle;
  margin-right: 0.4rem;
}
label { display: inline-block; margin-bottom: 0.3rem; font-weight: 600; }
fieldset { border: 2px solid var(--border); border-radius: 8px; margin: 1.25rem 0; }
legend { font-weight: 700; padding: 0 0.5rem; }

.product-text pre {
  white-space: pre-wrap;
  font-size: 1.05rem;
  line-height: 1.5;
}
.product-text p { margin: 0.9rem 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
