:root {
  --red: #b3202f;
  --red-dark: #8c1824;
  --green: #1f6f4a;
  --cream: #fff8ec;
  --ink: #2b2230;
  --muted: #6b6270;
  --line: #eadfd0;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--cream);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.knit {
  height: 14px;
  background: repeating-linear-gradient(90deg, var(--red) 0 14px, #fff 14px 20px, var(--green) 20px 34px, #fff 34px 40px);
}
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; max-width: 880px; margin: 0 auto; }
.brand { font-weight: 800; font-size: 1.2rem; color: var(--red); text-decoration: none; }
.brand span { color: var(--green); margin: 0 2px; }
.nav { display: flex; gap: 14px; align-items: center; }
.nav a, a { color: var(--green); }
.wrap { max-width: 880px; margin: 0 auto; padding: 8px 16px 40px; display: grid; gap: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 2px 10px rgba(80, 40, 20, .06); }
.card.narrow { max-width: 560px; width: 100%; margin: 0 auto; }
.center { text-align: center; }
h1 { font-size: 1.5rem; margin: 0 0 8px; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 0 0 8px; }
.hero h1 em { color: var(--red); font-style: normal; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }
label, legend { display: block; font-weight: 600; margin: 14px 0 6px; }
.req { color: var(--red); }
.opt { color: var(--muted); font-weight: 400; font-size: .85rem; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=datetime-local], textarea {
  width: 100%; padding: 12px; font: inherit; color: inherit; background: #fff;
  border: 1.5px solid #cfc4b4; border-radius: 10px;
}
textarea { resize: vertical; }
input:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid #1f6f4a55; outline-offset: 1px; border-color: var(--green); }
fieldset { border: 0; padding: 0; margin: 0; }
.sizes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.size { margin: 0; font-weight: 500; }
.size input { position: absolute; opacity: 0; }
.size span { display: block; text-align: center; padding: 12px 8px; border: 1.5px solid #cfc4b4; border-radius: 10px; cursor: pointer; }
.size input:checked + span { background: var(--green); color: #fff; border-color: var(--green); }
.size input:focus-visible + span { outline: 3px solid #1f6f4a55; outline-offset: 1px; }
.field-err { color: var(--red-dark); font-size: .9rem; margin: 6px 0 0; font-weight: 600; }
.btn {
  display: inline-block; margin-top: 18px; padding: 12px 20px; font: inherit; font-weight: 700; text-align: center;
  color: #fff; background: var(--red); border: 2px solid var(--red); border-radius: 10px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.ghost { background: transparent; color: var(--red); }
.btn.ghost:hover { background: #fbe9eb; }
.btn.danger { background: transparent; color: var(--red-dark); border-color: #d9a3a9; }
.btn.small { padding: 6px 12px; margin: 0; font-size: .85rem; }
button.link { background: none; border: 0; color: var(--green); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
form.inline { display: inline; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn { margin-top: 8px; }
.actions-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.row-between .btn { margin: 0; }
.alert { padding: 12px 14px; border-radius: 10px; font-weight: 600; margin-bottom: 12px; }
.alert.ok { background: #e6f4ec; color: #14502f; border: 1px solid #b9dfc9; }
.alert.err { background: #fdecee; color: var(--red-dark); border: 1px solid #f3b9bf; }
.note { background: #f5f9f6; border-left: 4px solid var(--green); padding: 10px 12px; border-radius: 6px; margin: 12px 0; white-space: pre-wrap; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: #e8eef9; color: #234; }
.badge.open { background: #e8eef9; color: #1d3a6b; }
.badge.drawn { background: #e1f3e8; color: #14502f; }
.badge.insufficient { background: #fdecee; color: var(--red-dark); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 12px 0; }
.stats > div { background: var(--cream); border-radius: 12px; padding: 12px; text-align: center; display: grid; }
.stats .num { font-size: 2rem; font-weight: 800; color: var(--red); line-height: 1.1; }
.stats .num.small { font-size: 1.05rem; padding: 8px 0; }
.list { list-style: none; margin: 8px 0 0; padding: 0; }
.list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 14px; padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.list li:first-child { border-top: 0; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 18px 16px 30px; }
@media (min-width: 640px) {
  .wrap { padding-top: 16px; }
  .sizes { grid-template-columns: repeat(4, 1fr); }
  h1 { font-size: 1.8rem; }
}

.wishes { margin-top: 22px; }
.wishes legend { font-size: 1.05rem; }
.wish { margin-top: 14px; padding: 12px 14px 16px; border: 1.5px dashed #cfc4b4; border-radius: 12px; background: #fffdf8; }
.wish h3 { margin: 0 0 2px; font-size: 1rem; color: var(--green); }
input[type=file] { width: 100%; padding: 10px; font: inherit; border: 1.5px dashed #cfc4b4; border-radius: 10px; background: #fff; }
input[type=url] { width: 100%; padding: 12px; font: inherit; color: inherit; background: #fff; border: 1.5px solid #cfc4b4; border-radius: 10px; }
input[type=url]:focus, input[type=file]:focus-visible { outline: 3px solid #1f6f4a55; outline-offset: 1px; border-color: var(--green); }

.friend { border: 2px solid var(--green); background: #f6fbf8; }
.friend-name { font-size: 2rem; font-weight: 800; color: var(--red); margin: 0 0 8px; overflow-wrap: anywhere; }
.plain { list-style: none; padding: 0; margin: 8px 0; }
.plain li { margin: 6px 0; overflow-wrap: anywhere; }
.wish-view { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: grid; gap: 8px; }
.wish-img { max-width: 100%; height: auto; border-radius: 10px; }
.thumb { width: 140px; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 8px 0 0; }
label.check input { width: 18px; height: 18px; }
.code-input { font-size: 1.8rem; letter-spacing: 8px; text-align: center; }
