:root {
  color-scheme: light dark;
  --bg: #f6f7fa;
  --surface: #ffffff;
  --ink: #17202e;
  --muted: #4c5668;
  --line: #d3d9e3;
  --accent: #1d4e89;
  --button-bg: #1d4e89;
  --button-ink: #f3f6fb;
  --warn-bg: #fdf1d3;
  --bad: #a3322a;
  --field-bg: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151c;
    --surface: #1a2029;
    --ink: #e8ecf3;
    --muted: #a8b1c2;
    --line: #333b4a;
    --accent: #8cc4f0;
    --button-bg: #e8ecf3;
    --button-ink: #11151c;
    --warn-bg: #3d3216;
    --bad: #f2a29b;
    --field-bg: #11151c;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

a { color: var(--accent); }
img { max-width: 100%; height: auto; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.wrap.home { max-width: 1120px; }
.site-header { padding: 16px 0; }
.header-row { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; align-items: center; }
.header-row nav { display: flex; flex-wrap: wrap; gap: 0 16px; }
.header-row nav a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.logo { color: var(--ink); font-weight: 750; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; min-height: 44px; }
.soon { display: inline-block; margin: 0 0 14px; padding: 4px 10px; border-radius: 999px; background: var(--warn-bg); font-size: 15px; font-weight: 650; }

h1 { font-size: clamp(28px, 6vw, 42px); line-height: 1.12; letter-spacing: -0.02em; margin: 8px 0 12px; overflow-wrap: break-word; }
h2 { font-size: 23px; line-height: 1.2; margin: 40px 0 10px; }
h3 { font-size: 18px; margin: 24px 0 4px; }
.lead { color: var(--muted); max-width: 70ch; }
.small { font-size: 15px; color: var(--muted); margin: 0 0 12px; }
ul, ol { padding-left: 22px; }
li { margin: 6px 0; }
p, li { overflow-wrap: break-word; }

/* Buttons */
.cta { margin: 20px 0; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--button-bg);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--button-ink);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  max-width: 100%;
  text-align: center;
}
.button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.button:disabled { cursor: not-allowed; opacity: 0.55; }
.button:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.button.cws:disabled { opacity: 1; background: var(--surface); color: var(--muted); border-color: var(--line); border-style: dashed; }

/* Flyer maker */
.maker { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin: 20px 0 8px; }
@media (min-width: 900px) {
  .maker { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .preview { position: sticky; top: 12px; }
}
.maker-form { min-width: 0; }
.group { margin: 0 0 14px; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
.group legend { padding: 0 6px; font-weight: 750; }
.hint { margin: 0 0 8px; font-size: 15px; color: var(--muted); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { font-weight: 650; font-size: 15px; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}
.field textarea { resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.field [aria-invalid="true"] { border-color: var(--bad); border-width: 2px; }
.field-error { margin: 2px 0 0; color: var(--bad); font-size: 15px; font-weight: 600; }
.counter { margin: 0; font-size: 14px; color: var(--muted); text-align: right; }
.check, .choice { display: flex; gap: 8px; align-items: center; min-height: 44px; font-weight: 600; }
.check input, .choice input { width: 20px; height: 20px; margin: 0; flex: none; }
.choices { display: flex; flex-wrap: wrap; gap: 0 24px; }
@media (max-width: 480px) { .fields, .fields.three { grid-template-columns: minmax(0, 1fr); } }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.photo-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.photo-list li { margin: 0; display: flex; flex-direction: column; gap: 4px; width: 96px; }
.photo-list img { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.photo-list .remove { min-height: 32px; font: inherit; font-size: 14px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }

.download { margin: 6px 0 0; }
.download .button { width: 100%; font-size: 18px; min-height: 52px; }
.privacy-line { margin: 8px 0 0; font-size: 15px; color: var(--muted); text-align: center; }

.preview-label { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.preview-frame { position: relative; width: 100%; overflow: hidden; border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18), 0 6px 18px rgba(0, 0, 0, 0.08); background: #ffffff; }
.sheet { position: absolute; left: 0; top: 0; width: 612px; height: 792px; background: #ffffff; color: #1b1f24; transform-origin: 0 0; font-family: Helvetica, Arial, sans-serif; overflow: hidden; }
.sheet > * { position: absolute; }
.fl-text { line-height: 1; white-space: pre; }
.fl-text.ghost { color: #6b7280; }
.fl-photo { overflow: hidden; background: #e9edf2; }
.fl-photo img { position: absolute; max-width: none; }
.fl-add { display: flex; align-items: center; justify-content: center; border: 2px dashed #aab4c2; background: #f3f5f8; color: #5a6370; font: 600 16px Helvetica, Arial, sans-serif; cursor: pointer; padding: 0; }
.fl-add:hover { background: #e9edf2; }
.fl-qr { background: #ffffff; fill: #000000; }

/* Templates */
.templates { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.template-card { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 14px; align-items: start; padding: 12px; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.template-card:hover { border-color: var(--accent); }
.template-card img { grid-row: span 2; width: 110px; height: auto; border: 1px solid var(--line); border-radius: 4px; background: #ffffff; }
.template-name { font-weight: 750; font-size: 18px; }
.template-text { font-size: 15px; color: var(--muted); }

/* Pricing, notes */
.prices { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.prices li { margin: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.prices li:first-child { border-color: var(--accent); }
.needs li { margin: 10px 0; }
.legal { max-width: 720px; }
.data li { margin: 8px 0; }
.disclaimer { margin: 24px 0 0; padding: 12px 14px; border-left: 3px solid var(--line); color: var(--muted); font-size: 15px; }
.reviewed { margin-top: 24px; }

.site-footer { margin-top: 56px; padding: 24px 0 32px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.footer-row { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; }
.footer-note { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; }
