:root {
  --ink: #1c2430;
  --paper: #f3efe4;
  --card: #fffdf8;
  --line: #d9d0c1;
  --green: #1f7a4d;
  --green-bg: #e5f6ec;
  --amber: #8a5a00;
  --amber-bg: #fff1cc;
  --red: #8d2d2d;
  --navy: #1b2838;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.4;
  padding-bottom: env(safe-area-inset-bottom);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 16px 14px;
  background: var(--navy);
  color: #f4efe4;
  position: sticky;
  top: 0;
  z-index: 2;
}

.brand { font-weight: 700; letter-spacing: 0.02em; }
.brand span { font-weight: 400; opacity: 0.75; }

nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
nav a {
  color: #f4efe4;
  text-decoration: none;
  border: 1px solid transparent;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 0.92rem;
}
nav a.on { border-color: #f4efe4; }

main { padding: 16px; max-width: 640px; margin: 0 auto; }

h1 { font-size: 1.55rem; line-height: 1.15; margin: 8px 0; }
h2 { font-size: 1.1rem; margin: 18px 0 8px; }
.lede { margin-top: 0; color: #3e4a3a; }

.actions, .stack { display: grid; gap: 10px; }
.actions { grid-template-columns: 1fr 1fr; }
main > button { margin-top: 10px; }

button, .file-btn {
  font: inherit;
  border: 0;
  border-radius: 12px;
  padding: 14px 12px;
  background: var(--navy);
  color: white;
  text-align: center;
  width: 100%;
}

button.secondary, .file-btn { background: #31465f; }
button.amber {
  background: var(--amber);
  color: #fffaf0;
  width: 100%;
  font-size: 1.05rem;
}
button:disabled { opacity: 0.55; }

.file-btn { display: block; position: relative; overflow: hidden; }
.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  font-size: 2rem;
}

.stage {
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: 180px;
  position: relative;
  overflow: hidden;
}

.stage img { display: block; width: 100%; height: auto; }
.stage .empty { padding: 48px 16px; text-align: center; color: #6d6458; }

.countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(27, 40, 56, 0.72);
  color: white;
  font-size: 4rem;
  font-variant-numeric: tabular-nums;
}

.banner, .note, .flags {
  border-radius: 12px;
  padding: 10px 12px;
  margin: 12px 0;
}

.banner { background: #efe2c0; color: #5c4310; }
.note { background: white; border: 1px solid var(--line); }
.flags { color: #5c564c; font-size: 0.92rem; }

.field {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
}
.field.green { background: var(--green-bg); border-color: #b7e0c6; }
.field.yellow { background: var(--amber-bg); border-color: #efd392; }
.field label { display: block; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; }
.field input, .field textarea {
  width: 100%;
  font: inherit;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 4px 0;
}
.field .why { margin: 0; font-size: 0.85rem; color: var(--amber); }

.stamp {
  display: inline-block;
  border: 2px solid var(--green);
  color: var(--green);
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

label.block { display: block; margin: 12px 0; }
label.block span { display: block; font-size: 0.85rem; margin-bottom: 4px; }
input[type="tel"], input[type="email"], input[type="text"], select {
  width: 100%;
  font: inherit;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
}

.load {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  padding: 12px;
  margin: 8px 0;
  cursor: pointer;
}
.load.selected { border-color: var(--navy); box-shadow: inset 4px 0 0 var(--navy); }
.hint { color: #5c564c; font-size: 0.95rem; }
.load strong { font-size: 1.15rem; }
.load .meta { color: #4e5968; }

pre.mail {
  white-space: pre-wrap;
  background: white;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
}

.error { color: var(--red); }
.hidden { display: none !important; }

.cards { display: grid; gap: 10px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.card.pick { cursor: pointer; text-align: left; color: inherit; background: var(--card); }
.card.selected { border-color: var(--navy); box-shadow: inset 4px 0 0 var(--navy); }
.price { font-size: 1.7rem; margin: 4px 0; }
.muted { color: #5c564c; }
ol.steps { margin: 8px 0 16px; padding-left: 1.2rem; }
ol.steps li { margin: 8px 0; }
.summary {
  background: var(--navy);
  color: #f4efe4;
  border-radius: 16px;
  padding: 14px;
  margin: 12px 0;
}
.summary strong { font-size: 1.35rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.chip {
  border-radius: 999px;
  padding: 4px 10px;
  background: #efe2c0;
  font-size: 0.85rem;
}
.chip.on { background: var(--green-bg); color: var(--green); }
.chip.off { background: #f3e4e4; color: var(--red); }
.order { margin: 8px 0; }
@media (min-width: 800px) {
  .cards.two { grid-template-columns: 1fr 1fr; }
  main { max-width: 760px; }
}
