/* Цвета и шрифты из макета, одобренного 11.10.2026: светлый нейтральный фон, охристая главная кнопка
   с тёмным текстом, «чертёжный» синий для ссылок и подписей, шалфейный для удачи. */
:root {
  --bg: #F3F4F1;
  --card: #FFFFFF;
  --ink: #1E2422;
  --muted: #56605B;
  --line: #DADED8;
  --brand: #E8A93A;
  --accent: #2F5EA8;
  --accent-soft: #DCE6DE;
  --ok-ink: #263D31;
  --warn-bg: #FBEFD6;
  --warn-ink: #5C3F0B;
  --bad-bg: #FBE4DE;
  --bad-ink: #8A2F16;
  --display: 'Unbounded', 'Arial Black', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 'Manrope', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 20px 16px calc(100px + env(safe-area-inset-bottom));
}

h1 { font-size: 26px; line-height: 1.2; margin: 12px 0 8px; }
h2 { font-size: 20px; line-height: 1.25; margin: 0 0 4px; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); font-size: 14px; }
.logo { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 700; }

.btn {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad-ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .tap:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
.link:focus-visible, .card:focus-visible { outline: 3px solid #2F6FBF; outline-offset: 2px; }
.btn input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
label.btn { position: relative; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.link { background: none; border: 0; padding: 10px 0; color: var(--accent); font: inherit; font-weight: 600;
  text-decoration: underline; cursor: pointer; }

.card {
  display: block;
  width: 100%;
  background: var(--card);
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  text-align: left;
  font: inherit;
  color: inherit;
}
button.card { cursor: pointer; }
.card b { display: block; }

.note { border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px; }
.note ul { margin: 6px 0 0; padding-left: 18px; }
.note.ok { background: var(--accent-soft); color: #2E4C35; }
.note.warn { background: var(--warn-bg); color: var(--warn-ink); }
.note.bad { background: var(--bad-bg); color: var(--bad-ink); }

details { margin-bottom: 12px; }
summary { cursor: pointer; padding: 12px 0; min-height: 46px; font-weight: 600; color: var(--accent); }

.plan { background: var(--card); border-radius: 14px; padding: 6px; margin-bottom: 12px; }
.plan svg { display: block; width: 100%; height: auto; max-height: 62dvh; }
.plan .tap, .plan .tap-zone { cursor: pointer; }
.plan img { display: block; width: 100%; border-radius: 10px; }

.field { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.field input, .field select, .field textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 13px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: 400 17px/1.3 inherit;
  font-family: inherit;
}
.field textarea { min-height: 96px; resize: vertical; }
.field small { display: block; margin-top: 4px; font-weight: 400; color: var(--muted); }

.topbar { display: flex; align-items: center; justify-content: space-between; margin: -6px 0 8px; }

.steps {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  gap: 4px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.steps button { flex: 1; min-width: 0; min-height: 46px; padding: 6px 0 4px; border: 0; border-top: 4px solid var(--line);
  background: none; font: inherit; font-size: 11px; text-align: center; color: var(--muted); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.steps button.done { border-color: #A9C2AE; color: var(--ink); cursor: pointer; }
.steps button.on { border-color: var(--accent); color: var(--ink); font-weight: 700; }
.steps button:focus-visible { outline: 3px solid #2F6FBF; outline-offset: -3px; }

h3 { font-size: 16px; margin: 18px 0 8px; }
.question { border: 0; padding: 0; margin: 0 0 18px; }
.question legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
.chip:focus-visible { outline: 3px solid #2F6FBF; outline-offset: 2px; }
.chip[aria-pressed=true], .btn[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent);
  font-weight: 700; }
.card[aria-pressed=true] { box-shadow: inset 0 0 0 2px var(--accent); }
.proscons { margin: 8px 0 0; padding: 0; list-style: none; }
.editor .item { touch-action: none; }
.editor svg { max-height: none; }

.wait { text-align: center; padding: 48px 8px; }
.spinner { width: 44px; height: 44px; margin: 0 auto 18px; border: 4px solid var(--line);
  border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 4s; } }

#sheet-root:empty { display: none; }
.backdrop { position: fixed; inset: 0; background: rgba(20, 22, 26, .45); display: flex; align-items: flex-end;
  justify-content: center; z-index: 10; }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--bg);
  border-radius: 20px 20px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); }

#toast { position: fixed; left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 20;
  max-width: 528px; margin: 0 auto; padding: 14px 16px; border-radius: 12px; background: var(--ink); color: #fff;
  font-size: 15px; display: none; }
#toast.show { display: block; }

.sketch-example { background: var(--card); border-radius: 12px; padding: 8px; }
.sketch-example svg { display: block; width: 100%; height: auto; }

.photo { margin: 0 0 14px; }
.photo img { display: block; width: 100%; border-radius: 14px; background: var(--line); aspect-ratio: 3 / 2; object-fit: cover; }
.photo figcaption { margin-top: 6px; }
a.btn { text-decoration: none; }

/* ---------- строка аккаунта и код для второго устройства ---------- */
.account { margin: 20px 0 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); }
.account span { display: block; margin-bottom: 4px; }
.account .link { display: block; min-height: 44px; padding: 10px 0; text-align: left; }
.code { font-size: 34px; font-weight: 700; letter-spacing: .08em; text-align: center; margin: 8px 0 12px;
  font-variant-numeric: tabular-nums; }
.muted a { display: inline-block; padding: 12px 0; color: var(--accent); font-weight: 600; }

/* ---------- вид по макету ---------- */
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: 26px; line-height: 1.15; margin: 20px 0 10px; }
h2 { font-size: 19px; line-height: 1.25; margin: 22px 0 8px; }
.lead { font-size: 16px; color: var(--muted); }
.label { margin: 22px 0 10px; font: 500 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mono { font: 500 14px/1.3 var(--mono); color: #3B433F; font-variant-numeric: tabular-nums; }

.btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; border: 1.5px solid var(--ink);
  border-radius: 18px; font-weight: 700; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--ink); font-weight: 800; }
.btn.big { min-height: 64px; font-size: 18px; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--accent); text-decoration: underline; min-height: 48px; }
.btn.danger { border-color: var(--bad-ink); }
.btn[aria-pressed=true] { background: var(--accent-soft); border-color: var(--ink); }
.chip { border-color: var(--line); font-weight: 600; }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
.card { border-radius: 18px; }
.card[aria-pressed=true] { box-shadow: inset 0 0 0 2px var(--ink); }
.note { border-radius: 14px; font-weight: 600; line-height: 1.4; }
.note.ok { color: var(--ok-ink); }
.note.hello { display: flex; gap: 10px; align-items: center; }
.note.hello svg { flex: none; }
.spinner { border-top-color: var(--brand); }
.field input, .field select, .field textarea { border-color: #B7BDB8; }
.sheet { border-radius: 22px 22px 0 0; }

.apphead { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin: -6px 0 4px; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); text-decoration: none;
  font: 600 17px/1 var(--display); }
.pill { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; }
.pill:focus-visible, .back:focus-visible, .brand:focus-visible, .device-link:focus-visible, .tabs2 button:focus-visible {
  outline: 3px solid #2F6FBF; outline-offset: 2px; }
.topbar { gap: 8px; min-height: 48px; }
.topbar > div { display: flex; align-items: center; gap: 4px; min-width: 0; }
.back { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent;
  color: var(--ink); font: 400 30px/1 inherit; text-decoration: none; cursor: pointer; }
dl.usage { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 4px 0 16px; }
dl.usage dt { color: var(--muted); }
dl.usage dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

.fits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.fits figure { margin: 0; display: grid; gap: 6px; align-content: start; }
.fit { height: 96px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); display: grid; place-items: center; }
.fits figcaption { font-size: 13px; font-weight: 600; line-height: 1.3; }
.device-link { display: flex; align-items: center; gap: 8px; min-height: 48px; margin: 8px 0; color: var(--accent); font-weight: 700;
  font-size: 15px; text-decoration: none; }

.steps { gap: 6px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
.steps button { font-size: 12px; border-top-width: 4px; border-radius: 0; padding-top: 8px; }
.steps button.done { border-color: #8FAE9A; color: #3B433F; }
.steps button.on { border-color: var(--ink); color: var(--ink); font-weight: 800; }

.wait .queue { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; text-align: left;
  background: var(--ink); color: #E6EAE7; border-radius: 18px; padding: 18px; margin-bottom: 20px; }
.wait .queue div { display: grid; justify-items: center; }
.wait .queue b { font: 600 40px/1 var(--display); color: var(--brand); }
.wait .queue span { font-size: 12px; color: #C9D0CC; padding-top: 4px; }
.wait .queue p { margin: 0; font-size: 14px; line-height: 1.5; }

.tabs2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: #E3E6E1;
  margin-bottom: 18px; }
.tabs2 button { min-height: 44px; border: 0; border-radius: 11px; background: transparent; color: var(--ink); font: inherit; font-weight: 700;
  font-size: 15px; cursor: pointer; }
.tabs2 button[aria-selected=true] { background: var(--card); }
.qr-card { display: grid; justify-items: center; gap: 10px; background: var(--card); border-radius: 22px; padding: 22px;
  box-shadow: 0 8px 24px rgba(30, 36, 34, .10); margin-bottom: 18px; }
.qr-card svg { max-width: 100%; height: auto; }
.qr-card p { margin: 0; }
.qr-card .code { font: 500 26px/1.2 var(--mono); letter-spacing: .06em; }
.scan { height: 200px; border-radius: 22px; background: var(--ink); display: grid; place-items: center; margin-bottom: 18px; }
.numbered { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; font-size: 15px; line-height: 1.45; }
.numbered li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; }
.numbered span { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: var(--brand); display: grid; place-items: center;
  font: 500 13px/1 var(--mono); }

/* ---------- компьютер: предложение открыть приложение в телефоне ---------- */
.gate .qr-card { margin-top: 20px; }
@media (min-width: 900px) {
  #app:has(.gate) { max-width: 980px; }
  .gate { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: center; margin-top: 6vh; }
  .gate h1 { font-size: 34px; }
  .gate .btn { width: auto; padding: 0 24px; display: inline-flex; }
  .gate .qr-card { margin-top: 0; }
}
