:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #16181d;
  --muted: #5b6270;
  --line: #d9dde3;
  --accent: #0b5fff;
  --accent-text: #ffffff;
  --error: #b42318;
  --ok: #067647;
  --focus: #0b5fff;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --card: #1a1d23;
    --text: #eceef2;
    --muted: #a3a9b5;
    --line: #2e333c;
    --accent: #5b8cff;
    --accent-text: #0b0d10;
    --error: #ff8a80;
    --ok: #6ee7a8;
    --focus: #8fb0ff;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

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

.skip { position: absolute; left: -999px; top: 0; background: var(--card); padding: 8px 12px; }
.skip:focus { left: 8px; top: 8px; z-index: 10; }

.top { border-bottom: 1px solid var(--line); background: var(--card); }
.top-row { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.brand { margin: 0; font-weight: 600; }
.top-actions { display: flex; gap: 12px; }

h1 { font-size: 1.6rem; margin: 28px 0 8px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }

section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  margin: 16px 0;
}

.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }

.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.status { min-height: 1.5em; margin: 0 0 8px; }
.status.error { color: var(--error); }
.status.ok { color: var(--ok); }

iframe#preview {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.field { margin: 0 0 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field.check { display: flex; align-items: center; gap: 8px; }
.field.check label { margin: 0; font-weight: 400; }
.hint { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }

input[type="text"], input[type="tel"], select, textarea {
  width: 100%;
  max-width: 420px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
textarea { max-width: none; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem; }
input[type="checkbox"] { width: 18px; height: 18px; }

.button {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button.secondary { background: transparent; color: var(--accent); }
.button[disabled] { opacity: 0.6; cursor: progress; }

.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 4px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 6px 12px; color: var(--text); font: inherit; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }

.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.report { margin: 12px 0 0; padding-left: 20px; color: var(--muted); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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