:root {
  --paper: #eef2ef;
  --surface: #ffffff;
  --ink: #1b2521;
  --muted: #55635c;
  --line: #cdd7d1;
  --field: #f7f9f8;
  --mat: #2b5b4e;
  --grid: rgba(255, 255, 255, 0.09);
  --grid-major: rgba(255, 255, 255, 0.2);
  --act: #2b5b4e;
  --focus: #3c8a72;
  --warn-bg: #fff4d6;
  --warn-ink: #5f4200;
  --round: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121815; --surface: #1a221e; --ink: #e4ebe7; --muted: #9caaa3; --line: #2e3a35; --field: #141b18;
    --mat: #1f463b; --act: #7cc4a9; --focus: #8fd6bb; --warn-bg: #3a2f12; --warn-ink: #f3d58a;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--text);
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 1.125rem/1.2 var(--round); }
.head-note { margin: 0; color: var(--muted); font-size: .9375rem; }

.hero { padding: 20px 0 32px; }
.hero h1 { font: 800 clamp(2.125rem, 5.2vw, 3.5rem)/1.04 var(--round); letter-spacing: -0.025em; margin: 0 0 14px; max-width: 14em; }
.hero p { margin: 0; color: var(--muted); font-size: 1.0625rem; max-width: 36rem; }

.bench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 24px; align-items: start; }

/* ---------------------------------------------------------------- form */
.form { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.kinds { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; margin-bottom: 18px; background: var(--field); border: 1px solid var(--line); border-radius: 10px; }
.kinds button { font: 600 .9375rem/1 var(--text); color: var(--muted); background: transparent; border: 0; border-radius: 7px; padding: 10px 14px; cursor: pointer; }
.kinds button[aria-selected="true"] { background: var(--ink); color: var(--paper); }

.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; margin-bottom: 14px; font-size: .875rem; color: var(--muted); }
.field > span { font-weight: 600; }
input[type=text], input[type=tel], input[type=email], input[type=url], textarea, select {
  width: 100%; font: 1rem/1.4 var(--text); color: var(--ink); background: var(--field);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
textarea { resize: vertical; min-height: 104px; }
.row { display: flex; flex-wrap: wrap; align-items: end; gap: 0 14px; }
.row .field { min-width: 180px; }
.check { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px; font-size: .9375rem; }
.check input { width: 18px; height: 18px; accent-color: var(--act); }
.hint { margin: 0 0 4px; color: var(--muted); font-size: .875rem; max-width: 34rem; }

.look { border: 0; border-top: 1px solid var(--line); margin: 22px 0 0; padding: 18px 0 0; min-width: 0; }
.look legend { float: left; width: 100%; padding: 0; margin-bottom: 12px; font: 700 1.0625rem/1.2 var(--round); color: var(--ink); }
.look .grid { clear: both; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 14px; }
input[type=color] { width: 100%; height: 44px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); cursor: pointer; }
input[type=range] { width: 100%; margin: 12px 0; accent-color: var(--act); }
output { font-variant-numeric: tabular-nums; }
button.quiet { font: 600 .875rem/1 var(--text); color: var(--muted); background: none; border: 0; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------------------------------------------------------------- cutting mat with the code */
.mat {
  position: sticky;
  top: 16px;
  padding: 40px 20px 20px;
  border-radius: 14px;
  color: #eef5f1;
  background-color: var(--mat);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  background-position: -1px -1px;
}
.mat :focus-visible { outline-color: #ffffff; }
.sticker {
  position: relative;
  width: max-content;
  margin: 0 auto;
  padding: 10px;
  background: #ffffff;
  border-radius: 14px;
  transform: rotate(-2deg);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 12px 24px -14px rgba(0, 0, 0, .6);
}
.sticker::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 1.5px dashed rgba(255, 255, 255, .75);
  border-radius: 20px;
  pointer-events: none;
}
#qr { display: block; image-rendering: pixelated; border-radius: 6px; }
.empty {
  display: grid; place-items: center; width: 220px; height: 220px; margin: 0; padding: 16px;
  text-align: center; color: #66756e; font-size: .9375rem;
  border: 2px dashed #c6d0cb; border-radius: 8px;
}
.meta { margin: 28px 0 0; text-align: center; font-size: .875rem; color: rgba(238, 245, 241, .88); font-variant-numeric: tabular-nums; }
.meta.small { margin-top: 10px; font-size: .8125rem; color: rgba(238, 245, 241, .72); }
.warn { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-size: .875rem; }
.actions { display: flex; gap: 10px; margin-top: 16px; }
.actions button { flex: 1; font: 700 .9375rem/1 var(--text); border-radius: 9px; padding: 13px 10px; cursor: pointer; }
.primary { background: #ffffff; color: #1f463b; border: 0; }
.secondary { background: transparent; color: #ffffff; border: 1.5px solid rgba(255, 255, 255, .7); }
.actions button:disabled { opacity: .45; cursor: default; }
.status { min-height: 1.4em; margin: 6px 0 0; text-align: center; font-size: .875rem; }
.raw { margin-top: 6px; font-size: .875rem; }
.raw summary { cursor: pointer; color: rgba(238, 245, 241, .88); }
.raw pre {
  max-height: 180px; overflow: auto; margin: 8px 0 0; padding: 10px; border-radius: 8px;
  white-space: pre-wrap; word-break: break-all; color: #ffffff; background: rgba(0, 0, 0, .25);
  font: .8125rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------------------------------------------------------------- questions, footer */
.noscript { margin: 24px 0 0; padding: 12px 14px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); }
.faq { max-width: 44rem; margin: 64px 0 0; }
.faq h2 { margin: 0 0 12px; font: 800 1.75rem/1.2 var(--round); letter-spacing: -0.01em; }
.faq details { padding: 14px 0; border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-size: 1.0625rem; font-weight: 650; }
.faq p { margin: 10px 0 0; color: var(--muted); }
.foot { padding-top: 32px; padding-bottom: 40px; color: var(--muted); font-size: .875rem; }

@media (max-width: 860px) {
  .bench { grid-template-columns: minmax(0, 1fr); }
  .mat { position: static; order: -1; }
}
@media (max-width: 480px) {
  .head-note { display: none; }
  .hero { padding-top: 8px; }
  .form { padding: 16px; }
  .kinds { display: flex; }
  .kinds button { flex: 1; padding: 10px 6px; }
}
