/* НПО Хелп — the look every tool shares, "Linen & Pine" (apps/DESIGN.md).
   A warm linen page, white surfaces that rest a little above it, pine for the one action that moves
   the work forward, and marigold as the single signature: the current step, the guide's ring, a seal.
   Literata (a letter-like serif) for titles and big numbers, Onest for everything else. Few words:
   explanations live in the on-demand guide (tour.css) and the "Как?" drawer. A tool adds only its own
   screens on top (the letters tool: mail/css/app.css); the block editor's look is builder.css. */
:root {
  --linen: #f4f0e6;
  --surface: #ffffff;
  --well: #faf7f0;
  --line: #e7e0d1;
  --line-strong: #d4cab6;
  --field-line: #d9d0bd;
  --ink: #18211d;
  --ink-2: #4b5650;
  --ink-3: #66706a;
  --pine: #1f5a49;
  --pine-hover: #174a3b;
  --on-pine: #ffffff;
  --pine-soft: #e3eee8;
  --pine-deep: #164537;
  --marigold: #f0a63c;
  --marigold-soft: #fcecd2;
  --marigold-deep: #7d4c00;
  --ok: #2c7a4d; --ok-soft: #e2f1e7;
  --warn: #935600; --warn-soft: #fbecd4;
  --bad: #b23a26; --bad-soft: #fbe6e1;
  --night: #15201b;
  --night-glass: rgb(21 32 27 / 93%);
  --scrim: rgb(18 26 22 / 58%);
  --glass-1: rgb(255 255 255 / 8%); --glass-2: rgb(255 255 255 / 15%); --glass-3: rgb(255 255 255 / 28%);
  --mint: #8fe0b5;
  --sh-card: 0 1px 2px rgb(52 40 14 / 5%), 0 10px 28px -16px rgb(52 40 14 / 18%);
  --sh-lift: 0 2px 5px rgb(52 40 14 / 7%), 0 18px 38px -16px rgb(52 40 14 / 26%);
  --sh-float: 0 8px 22px rgb(20 26 22 / 22%);
  --sh-overlay: 0 26px 60px -20px rgb(10 16 13 / 55%);
  --r-1: 6px; --r-2: 10px; --r-3: 14px; --r-4: 20px; --r-5: 26px; --r-pill: 999px;
  --font-display: "Literata", Georgia, "Times New Roman", serif;
  --font-ui: "Onest", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --d-instant: 100ms; --d-fast: 160ms; --d-base: 200ms; --d-slow: 280ms; --d-glide: 360ms; --d-spring: 520ms;
  --ease-out: cubic-bezier(.22, .8, .32, 1);
  --ease-in: cubic-bezier(.5, 0, .75, .2);
  --ease-std: cubic-bezier(.4, 0, .2, 1);
  --ease-spring: linear(0, .24 8%, .64 18%, .92 28%, 1.04 38%, 1.046 46%, 1.03 56%, 1.006 70%, 1);
  --z-sticky: 5; --z-sheet: 15; --z-menu: 20; --z-drawer: 30; --z-tour: 40; --z-toast: 50;
  --gutter-l: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --top-h: 64px;
  /* Older names other modules read (the builder's canvas, the sign-up form preview). */
  --accent: var(--pine); --accent-ink: var(--on-pine); --accent-soft: var(--pine-soft);
  --paper: var(--linen); --sheet: var(--surface); --stamp: var(--marigold);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --linen: #111614; --surface: #1a201d; --well: #151a18; --line: #29322d; --line-strong: #3a4540; --field-line: #3c4741;
    --ink: #e8ece9; --ink-2: #b3bdb7; --ink-3: #939d97;
    --pine: #72c6a6; --pine-hover: #8ad3b7; --on-pine: #0b1f17; --pine-soft: #1b3029; --pine-deep: #a3e2c8;
    --marigold: #f2b45a; --marigold-soft: #3a2b12; --marigold-deep: #f6c97f;
    --ok: #6ccf96; --ok-soft: #15301f; --warn: #f0b45c; --warn-soft: #36280f; --bad: #ff8e78; --bad-soft: #3a1b16;
    --scrim: rgb(0 0 0 / 62%);
    --sh-card: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 28px -16px rgb(0 0 0 / 55%);
    --sh-lift: 0 2px 5px rgb(0 0 0 / 35%), 0 18px 38px -16px rgb(0 0 0 / 65%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --linen: #111614; --surface: #1a201d; --well: #151a18; --line: #29322d; --line-strong: #3a4540; --field-line: #3c4741;
  --ink: #e8ece9; --ink-2: #b3bdb7; --ink-3: #939d97;
  --pine: #72c6a6; --pine-hover: #8ad3b7; --on-pine: #0b1f17; --pine-soft: #1b3029; --pine-deep: #a3e2c8;
  --marigold: #f2b45a; --marigold-soft: #3a2b12; --marigold-deep: #f6c97f;
  --ok: #6ccf96; --ok-soft: #15301f; --warn: #f0b45c; --warn-soft: #36280f; --bad: #ff8e78; --bad-soft: #3a1b16;
  --scrim: rgb(0 0 0 / 62%);
  --sh-card: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 28px -16px rgb(0 0 0 / 55%);
  --sh-lift: 0 2px 5px rgb(0 0 0 / 35%), 0 18px 38px -16px rgb(0 0 0 / 65%);
  color-scheme: dark;
}

/* ---- Base ---- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--linen); color: var(--ink); font: 400 16px/1.55 var(--font-ui); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--linen); }
.app { min-height: 100vh; }
h1, h2 { font-family: var(--font-display); font-weight: 650; line-height: 1.12; text-wrap: balance; margin: 0; letter-spacing: -.015em; }
h1 { font-size: clamp(2rem, 1.55rem + 1.5vw, 2.75rem); }
h2 { font-size: 1.3rem; }
p { margin: 0; }
code, pre { font-family: var(--font-mono); }
code { font-size: .85em; background: var(--well); border: 1px solid var(--line); padding: .05em .35em; border-radius: var(--r-1); }
a { color: var(--pine); text-underline-offset: 3px; }
.muted { color: var(--ink-2); }
.hint { display: block; color: var(--ink-3); font-size: .86rem; line-height: 1.45; margin-top: 2px; }
.hint:empty { display: none; }
.fine { color: var(--ink-3); font-size: .88rem; max-width: 56ch; }
.eyebrow { font-size: .76rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.opt { font-weight: 400; font-size: .84rem; color: var(--ink-3); margin-left: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--pine); outline-offset: 2px; border-radius: var(--r-1); }
svg { flex: none; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 20px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font: 600 .97rem/1.2 var(--font-ui); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background var(--d-fast) var(--ease-std), border-color var(--d-fast) var(--ease-std), transform var(--d-instant) var(--ease-std), box-shadow var(--d-fast) var(--ease-std); }
.btn:hover { border-color: var(--ink-3); background: var(--well); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--pine); border-color: var(--pine); color: var(--on-pine); box-shadow: 0 1px 2px rgb(0 0 0 / 8%); }
.btn.primary:hover { background: var(--pine-hover); border-color: var(--pine-hover); }
.btn.small { min-height: 36px; padding: 5px 14px; font-size: .9rem; }
.btn.big { min-height: 52px; padding: 12px 28px; font-size: 1.06rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.file { position: relative; overflow: hidden; }
.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 2px; color: var(--pine); font: 600 .95rem var(--font-ui); cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--pine) 40%, transparent); text-underline-offset: 4px; border-radius: var(--r-1); }
.link:hover { color: var(--pine-hover); text-decoration-color: currentColor; }
.link.small { font-size: .88rem; }
.link.spark { text-decoration: none; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--ink); font: 600 1.15rem/1 var(--font-ui); cursor: pointer; transition: background var(--d-fast) var(--ease-std), border-color var(--d-fast) var(--ease-std), transform var(--d-instant) var(--ease-std); }
.icon-btn:hover { background: var(--well); border-color: var(--ink-3); }
.icon-btn:active { transform: scale(.94); }
.icon-link { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--ink-3); }
.icon-link:hover { color: var(--pine); background: var(--pine-soft); }
.how { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 10px; border: 0; border-radius: var(--r-pill); background: var(--pine-soft); color: var(--pine-deep); font: 600 .8rem/1.6 var(--font-ui); letter-spacing: 0; text-transform: none; cursor: pointer; vertical-align: 2px; }
.how::before { content: "?"; display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--pine); color: var(--on-pine); font-size: .7rem; font-weight: 700; }
.how:hover { filter: brightness(.97); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- Top bar: the brand, three tabs, the guide and the account ---- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: var(--z-sticky); background: color-mix(in srgb, var(--linen) 88%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner, .main { max-width: 1240px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.topbar-inner { min-height: var(--top-h); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 24px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { flex: none; overflow: visible; }
.brand-org { font: 700 1.08rem/1 var(--font-display); letter-spacing: -.01em; white-space: nowrap; }
.brand-tool { font: 500 .95rem/1 var(--font-ui); color: var(--ink-3); padding-left: 10px; border-left: 1px solid var(--line-strong); }
.tabs { display: inline-flex; justify-self: start; gap: 2px; padding: 4px; border-radius: var(--r-pill); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.tab { min-height: 36px; padding: 6px 16px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-2); font: 600 .94rem var(--font-ui); cursor: pointer; transition: background var(--d-fast) var(--ease-std), color var(--d-fast) var(--ease-std); }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { background: var(--pine-soft); color: var(--pine-deep); }
.top-tools { display: flex; align-items: center; gap: 10px; justify-self: end; }
.demo-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border-radius: var(--r-pill); background: var(--marigold-soft); color: var(--marigold-deep); font-size: .85rem; }
.demo-chip b { font-weight: 700; }
.demo-chip .link { color: var(--marigold-deep); font-size: .85rem; padding: 2px 8px; text-decoration-color: currentColor; }
.help-btn { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 6px 14px 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font: 600 .92rem var(--font-ui); cursor: pointer; transition: border-color var(--d-fast) var(--ease-std), background var(--d-fast) var(--ease-std); }
.help-btn svg { color: var(--pine); }
.help-btn:hover { border-color: var(--pine); background: var(--pine-soft); }
/* Until the guide has been opened once on this device, a marigold dot says it is there. Nothing opens by itself. */
.help-btn[data-fresh]::after { content: ""; position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--marigold); box-shadow: 0 0 0 2px var(--linen); animation: fresh 2.4s var(--ease-out) infinite; }
@keyframes fresh { 0%, 60%, 100% { transform: scale(1); } 30% { transform: scale(1.35); } }
.account { position: relative; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--pine-soft); color: var(--pine-deep); font: 700 .95rem var(--font-ui); cursor: pointer; }
.avatar:hover { box-shadow: 0 0 0 2px var(--pine); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: var(--z-menu); min-width: 220px; display: grid; gap: 2px; padding: 8px; border-radius: var(--r-3); background: var(--surface); box-shadow: var(--sh-lift), 0 0 0 1px var(--line); transform-origin: top right; animation: pop var(--d-fast) var(--ease-out); }
.menu-who { padding: 8px 10px 10px; color: var(--ink-3); font-size: .88rem; overflow-wrap: anywhere; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu button { text-align: left; padding: 9px 10px; border: 0; border-radius: var(--r-2); background: none; color: var(--ink); font: 600 .95rem var(--font-ui); cursor: pointer; }
.menu button:hover { background: var(--well); }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }

.main { padding-block: 36px 88px; }
.screen { display: grid; gap: 28px; align-content: start; }
.screen > *, .step > * { min-width: 0; }
.narrow { max-width: 760px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 14px 20px; flex-wrap: wrap; }
.head-main { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.head-tools { display: flex; align-items: center; gap: 14px; }
.section-title { font-size: 1.25rem; margin-bottom: -12px; }
.save-state { font-size: .84rem; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.save-state:not(:empty)::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.save-state.error { color: var(--bad); }
.save-state.error::before { background: var(--bad); }

/* ---- Surfaces: one card look everywhere ---- */
fieldset.group, .card, .table-wrap {
  background: var(--surface); border: 0; border-radius: var(--r-4); box-shadow: var(--sh-card), 0 0 0 1px var(--line);
}
fieldset.group { padding: 22px 24px 24px; margin: 0; display: grid; gap: 18px; min-width: 0; }
/* The legend reads as the card's title (a floated legend is ordinary content in the grid). */
legend { float: left; width: 100%; padding: 0; margin: 0; font: 650 1.15rem/1.2 var(--font-display); letter-spacing: -.01em; display: flex; align-items: center; }

/* ---- Fields ---- */
.field { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px 2px; font-weight: 600; font-size: .92rem; color: var(--ink); }
.field > :is(input, textarea, select, .hint, div, .ideas, .swatches) { flex: 1 1 100%; }
.field.inline { display: inline-flex; align-items: center; gap: 8px; }
input[type="text"], input[type="email"], input[type="url"], input:not([type]), textarea, select {
  width: 100%; min-width: 0; min-height: 46px; padding: 11px 14px; border: 1px solid var(--field-line); border-radius: var(--r-2);
  background: var(--surface); color: var(--ink); font: 400 1rem/1.45 var(--font-ui);
  transition: border-color var(--d-fast) var(--ease-std), box-shadow var(--d-fast) var(--ease-std);
}
textarea { resize: vertical; min-height: 0; }
select { padding-right: 34px; appearance: none; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2366706a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.field.inline select { width: auto; max-width: 14rem; }
input:hover, textarea:hover, select:hover { border-color: var(--ink-3); }
input:focus, textarea:focus, select:focus { border-color: var(--pine); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pine) 22%, transparent); outline: none; }
::placeholder { color: color-mix(in srgb, var(--ink-3) 80%, transparent); }
.check { display: inline-flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--pine); flex: none; }
/* A switch: still a checkbox, drawn as a toggle. */
.switch { display: flex; gap: 14px; align-items: center; cursor: pointer; }
.switch input { appearance: none; position: relative; width: 44px; height: 26px; margin: 0; flex: none; border-radius: var(--r-pill); background: var(--line-strong); cursor: pointer; transition: background var(--d-fast) var(--ease-std); }
.switch input::before { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #ffffff; box-shadow: 0 1px 3px rgb(0 0 0 / 25%); transition: transform var(--d-slow) var(--ease-spring); }
.switch input:checked { background: var(--pine); }
.switch input:checked::before { transform: translateX(18px); }
.switch span { display: grid; gap: 1px; }
.switch b { font-weight: 650; }
.switch small { color: var(--ink-3); font-size: .86rem; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.inline-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-weight: 500; }
.inline-row.spread { justify-content: space-between; }
.label-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.confirm { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--marigold-soft); border-radius: var(--r-3); padding: 12px 16px; }
.confirm[hidden] { display: none; }
.notice { background: var(--marigold-soft); color: var(--ink); border-radius: var(--r-3); padding: 12px 16px; }
details.more summary, .aud-more summary { cursor: pointer; font-weight: 600; color: var(--pine); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.more summary::before, .aud-more summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform var(--d-fast) var(--ease-std); }
details.more[open] summary::before, .aud-more[open] summary::before { transform: rotate(45deg); }
details.more summary::-webkit-details-marker, .aud-more summary::-webkit-details-marker { display: none; }
details.more[open] { display: grid; gap: 12px; }

/* ---- Settings ---- */
.logo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo-box { width: 128px; height: 76px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-3); display: grid; place-items: center; color: var(--ink-3); font-size: .85rem; background: var(--well); overflow: hidden; }
.logo-box.has { background: #ffffff; border-style: solid; border-color: var(--line); }
.logo-box img { max-width: 100%; max-height: 100%; }
.logo-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; transition: transform var(--d-instant) var(--ease-std); }
.swatch:active { transform: scale(.92); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--ink); }
.swatches input[type="color"] { width: 46px; height: 38px; border: 1px solid var(--field-line); border-radius: var(--r-2); background: var(--surface); padding: 3px; cursor: pointer; }

/* ---- Editor head and the four steps ---- */
.editor-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.name-field { flex: 1 1 18rem; min-width: 0; }
.name-field input { font: 650 1.55rem/1.2 var(--font-display); letter-spacing: -.01em; border-color: transparent; background: transparent; padding-inline: 8px; }
.name-field input:hover { border-color: var(--line-strong); }
.stepper { list-style: none; margin: 0; padding: 6px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--sh-card), 0 0 0 1px var(--line); }
.stepper button { position: relative; width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 12px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-3); font: 600 .96rem var(--font-ui); cursor: pointer; transition: background var(--d-fast) var(--ease-std), color var(--d-fast) var(--ease-std); }
.stepper button:hover { color: var(--ink); background: var(--well); }
.stepper .num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; font-size: .82rem; font-variant-numeric: tabular-nums; flex: none; }
.stepper .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper .dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex: none; }
.stepper button[aria-current="step"] { background: var(--pine-soft); color: var(--pine-deep); }
.stepper button[aria-current="step"] .num { background: var(--marigold); box-shadow: none; color: #3a2400; }
.stepper button[data-state="ok"] .dot { background: var(--ok); }
.stepper button[data-state="warn"] .dot { background: var(--warn); }
.stepper button[data-state="error"] .dot { background: var(--bad); }
.step { display: grid; gap: 22px; animation: rise var(--d-slow) var(--ease-out); }
.step-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.step-foot .btn.primary { margin-left: auto; padding-inline: 24px 18px; }

/* ---- A table of rows (a list from a Sheet) ---- */
.table-wrap { overflow: auto; max-height: 460px; }
table.rows { width: 100%; border-collapse: collapse; font-size: .92rem; }
.rows th, .rows td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.rows th { position: sticky; top: 0; background: var(--well); font-weight: 650; color: var(--ink-3); font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; }
.rows tr:last-child td { border-bottom: 0; }
.rows td.num { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rows tr.skip td:not(.st) { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }

/* ---- Segmented switch ---- */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-pill); background: var(--well); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-3); padding: 6px 14px; font: 600 .88rem var(--font-ui); cursor: pointer; transition: background var(--d-fast) var(--ease-std), color var(--d-fast) var(--ease-std); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 10%), 0 0 0 1px var(--line); }

/* ---- Toast ---- */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: var(--z-toast); display: flex; gap: 14px; align-items: center; max-width: min(560px, calc(100vw - 32px)); padding: 13px 18px; border-radius: var(--r-3); background: var(--night); color: #ffffff; box-shadow: var(--sh-float); font-weight: 500; animation: toast-in var(--d-slow) var(--ease-out); }
.toast .link { color: var(--marigold); text-decoration-color: currentColor; }
.toast.bad { background: var(--bad); }
.toast.bad .link { color: #ffffff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---- The "Как?" drawer: how-tos that happen outside the tool ---- */
.drawer { position: fixed; inset: 0; z-index: var(--z-drawer); }
.drawer-scrim { position: absolute; inset: 0; background: var(--scrim); animation: fade var(--d-base) var(--ease-out); }
.drawer-sheet { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(440px, calc(100vw - 24px)); display: grid; grid-template-rows: auto minmax(0, 1fr); border-radius: var(--r-5); background: var(--surface); box-shadow: var(--sh-overlay); animation: slide-in var(--d-slow) var(--ease-out); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 22px 8px 26px; }
.drawer-body { overflow-y: auto; padding: 8px 26px 26px; display: grid; gap: 14px; align-content: start; }
.drawer-body ol { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.drawer-body ol li { counter-increment: s; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; }
.drawer-body ol li::before { content: counter(s); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--pine-soft); color: var(--pine-deep); font: 700 .85rem var(--font-ui); }
.drawer-body .tip { padding: 12px 14px; border-radius: var(--r-3); background: var(--well); color: var(--ink-2); font-size: .92rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } }

/* ---- Status chip ---- */
.status-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: var(--r-pill); background: var(--well); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font-size: .86rem; font-weight: 600; }
.status-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.status-chip[data-state="live"] { background: var(--ok-soft); box-shadow: none; color: var(--ok); }
.status-chip[data-state="live"]::before { background: var(--ok); }
.status-chip[data-state="changed"] { background: var(--marigold-soft); box-shadow: none; color: var(--marigold-deep); }
.status-chip[data-state="changed"]::before { background: var(--marigold); }
.status-chip:empty { display: none; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---- Narrower screens ---- */
@media (max-width: 860px) {
  .topbar-inner { grid-template-columns: minmax(0, 1fr) auto; }
  .tabs { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .stepper { display: flex; gap: 2px; }
  .stepper li { flex: 0 0 auto; }
  .stepper li:has([aria-current="step"]) { flex: 1 1 auto; min-width: 0; }
  .stepper button { padding: 6px 8px; gap: 6px; }
  .stepper .label, .stepper .dot { display: none; }
  .stepper button[aria-current="step"] .label { display: inline; }
  .stepper button[aria-current="step"] .dot { display: block; }
}
@media (max-width: 600px) {
  .topbar { position: static; }
  .topbar-inner { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "brand help acct" "tabs tabs tabs" "demo demo demo"; gap: 10px; }
  .top-tools { display: contents; }
  .brand { grid-area: brand; }
  .tabs { grid-area: tabs; grid-row: auto; }
  .help-btn { grid-area: help; }
  .account { grid-area: acct; }
  .demo-chip { grid-area: demo; justify-self: start; }
  .main { padding-block: 22px 64px; }
  .brand-tool, .help-label, .demo-note { display: none; }
  .help-btn { padding: 6px; width: 38px; justify-content: center; }
  .pair { grid-template-columns: minmax(0, 1fr); }
  fieldset.group { padding: 18px 18px 20px; }
  .drawer-sheet { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 86vh; border-radius: var(--r-5) var(--r-5) 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); animation-name: sheet-in; }
  .head-tools { width: 100%; justify-content: space-between; }
  .editor-head .name-field { flex-basis: 12rem; }
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
