/* Sundew site, alpha. Shared styles for every page.
   Design direction (see the comment in index.html): quiet, exact, early-morning.
   Warm paper neutrals, navy ink, ONE amber accent; blue "dew" only in the illustration and drop markers.
   Rules kept from the unslop skill: 4px spacing grid, weights 400/500, no gradients on chrome,
   no glows, no looping animation, one easing curve. Credit: unslop by Damir Sokolovsky (@heydamir), CC BY 4.0. */

/* ---------- Fonts (self-hosted, SIL OFL; latin + cyrillic subsets) ---------- */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-sans-cyrillic-400.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-sans-cyrillic-500.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-mono-cyrillic-400.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-mono-cyrillic-500.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/source-serif-4-cyrillic-400.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/source-serif-4-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }

/* ---------- Tokens ---------- */
:root {
  --bg: #f7f4ee; --card: #fdfbf7; --raised: #efe9df;
  --text: #0c2f5a; --text-2: #46566e; --muted: #647084;
  --line: rgba(12, 47, 90, .10); --line-strong: rgba(12, 47, 90, .22);
  --accent: #ef9f27; --accent-hover: #f3ad45; --on-accent: #2b1a02;
  --dew: #2f7fd1; --ok: #16a34a; --bad: #c2362b;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/24px var(--sans); }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
:focus-visible { outline: 2px solid var(--dew); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Header and navigation ---------- */
.site-head { position: relative; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 500; }
.site-nav { display: flex; align-items: center; gap: 32px; font-size: 15px; color: var(--text-2); }
.site-nav a { transition: color 160ms var(--ease); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.menu-btn { display: none; width: 40px; height: 40px; padding: 0; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; }
.menu-btn:hover { background: var(--raised); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px;
  border-radius: 10px; font: 500 16px/1 var(--sans); cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-quiet { background: var(--card); color: var(--text); border-color: var(--line-strong); }
.btn-quiet:hover { background: var(--raised); }
.btn-nav { height: 36px; padding: 0 16px; font-size: 15px; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 14px; }
.btn-danger { background: var(--card); color: var(--bad); border-color: rgba(194, 54, 43, .35); }
.btn-danger:hover { background: #f8ebe7; }
.btn[disabled] { opacity: .55; cursor: default; }
.textlink { color: var(--text-2); font-size: 15px; border-bottom: 1px solid var(--line-strong); transition: color 160ms var(--ease); }
.textlink:hover { color: var(--text); }
.linkbtn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--text-2); font-size: 14px; line-height: 20px;
  border-bottom: 1px solid var(--line-strong); transition: color 160ms var(--ease); }
.linkbtn:hover { color: var(--text); }

/* ---------- Home: hero with the sky and the horizon ---------- */
.sky { position: relative; overflow: hidden; }
.sky-stars { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sky > .wrap { position: relative; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center;
  min-height: calc(100vh - 64px - 120px); padding: 32px 0 48px; }
h1 { font: 400 60px/1.05 var(--serif); letter-spacing: -.02em; margin: 0 0 24px; max-width: 11em; }
.lead { font-size: 19px; line-height: 28px; color: var(--text-2); max-width: 32rem; margin: 0 0 32px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.art svg { display: block; width: 100%; height: auto; }
.rise { animation: rise 420ms var(--ease) both; }
.rise.d2 { animation-delay: 50ms; } .rise.d3 { animation-delay: 100ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* The planet's limb: one hairline arc across the whole window, a fainter second one as its thin air */
.horizon { display: block; width: 100%; height: 72px; }

/* ---------- Home: facts, steps, devices preview ---------- */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fact { padding: 24px 32px 32px 0; }
.fact + .fact { padding-left: 32px; border-left: 1px solid var(--line); }
.fact h3 { margin: 0 0 8px; font: 500 17px/24px var(--sans); }
.fact p { font-size: 15px; line-height: 22px; color: var(--text-2); }

.how { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; align-items: start;
  padding: 96px 0; border-top: 1px solid var(--line); }
h2 { font: 400 36px/1.15 var(--serif); letter-spacing: -.01em; margin: 0 0 12px; }
.sub { color: var(--text-2); margin: 0 0 40px; }
.steps { list-style: none; margin: 0; padding: 0; position: relative; }
.steps::before { content: ""; position: absolute; left: 11px; top: 12px; bottom: 36px; border-left: 1px dashed var(--dew); opacity: .6; }
.steps li { position: relative; padding: 0 0 32px 44px; }
.steps li:last-child { padding-bottom: 0; }
.drop { position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--dew);
  color: #fff; font: 500 12px/24px var(--mono); text-align: center; }
.steps li:last-child .drop { background: var(--accent); color: var(--on-accent); }
.steps h3 { margin: 0 0 4px; font: 500 17px/24px var(--sans); }
.steps p { font-size: 15px; line-height: 22px; color: var(--text-2); }
.steps p + p { margin-top: 8px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px;
  box-shadow: 0 8px 24px rgba(12, 47, 90, .06); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 12px 16px; }
.panel-head b { font-weight: 500; }
.panel-head span { font: 400 12px/16px var(--mono); color: var(--muted); }
.dev { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center;
  padding: 12px 16px; border-radius: 8px; }
.dev + .dev { margin-top: 4px; }
.dev.new { background: var(--raised); }
.dev .name { font-weight: 500; font-size: 15px; overflow-wrap: anywhere; }
.dev .addr { font: 400 13px/20px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dev .state { font-size: 13px; line-height: 20px; color: var(--text-2); display: flex; align-items: center; gap: 8px; justify-content: flex-end; white-space: nowrap; }
.dev .state i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dev.new .state i { background: var(--accent); }
.dev.off .state i { background: var(--muted); }
.dev.off .name { color: var(--text-2); }
.dev .when { font: 400 12px/16px var(--mono); color: var(--muted); text-align: right; }
.key { display: inline-block; font: 400 12px/20px var(--mono); color: var(--text-2); background: var(--card);
  border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 8px; }
a.key, button.key { cursor: pointer; transition: background-color 160ms var(--ease); }
a.key:hover, button.key:hover { background: var(--raised); }

.last { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  padding: 64px 0; border-top: 1px solid var(--line); }
.last h2 { margin: 0; max-width: 18em; }
.last .actions { align-items: center; gap: 24px; }

.site-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 24px 0 40px;
  border-top: 1px solid var(--line); font-size: 14px; line-height: 20px; color: var(--muted); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-foot a { transition: color 160ms var(--ease); }
.site-foot a:hover { color: var(--text); }

/* ---------- Inner pages ---------- */
.page { padding: 48px 0 96px; min-height: calc(100vh - 64px - 88px); }
.page-head { max-width: 44rem; margin-bottom: 48px; }
.page-head h1 { font-size: 44px; line-height: 1.1; max-width: none; margin-bottom: 16px; }
.page-head .lead { margin: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; align-items: start; }
.block { padding: 48px 0; border-top: 1px solid var(--line); }
.block h2 { font-size: 28px; }
.block > .sub { margin-bottom: 24px; }
.prose { max-width: 44rem; }
.prose h2 { font-size: 24px; line-height: 32px; margin: 40px 0 8px; }
.prose p, .prose li { color: var(--text-2); font-size: 16px; line-height: 24px; }
.prose p + p { margin-top: 12px; }
.prose ul { margin: 8px 0 0; padding-left: 20px; }
.prose a { color: var(--text); border-bottom: 1px solid var(--line-strong); }
.note { background: var(--raised); border-radius: 10px; padding: 12px 16px; font-size: 14px; line-height: 20px; color: var(--text-2); }
.note b { font-weight: 500; color: var(--text); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Definition-style rows: where the setting lives, contacts, plan rows */
.rows { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 4px 32px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.row dt, .row .k { font-weight: 500; }
.row dd, .row .v { margin: 0; color: var(--text-2); font-size: 15px; line-height: 22px; }

/* FAQ (native details, no script) */
.faq { border-top: 1px solid var(--line); max-width: 44rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; cursor: pointer;
  font-weight: 500; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: 8px; height: 8px; flex: none; margin-right: 4px; border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform 160ms var(--ease); }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details p { padding: 0 32px 16px 0; color: var(--text-2); font-size: 15px; line-height: 22px; }

/* Status page */
.status-now { display: flex; align-items: center; gap: 16px; padding: 24px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; margin-bottom: 32px; }
.status-now .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); flex: none; }
.status-now .dot.warn { background: var(--accent); } .status-now .dot.down { background: var(--bad); }
.status-now b { display: block; font: 500 19px/28px var(--sans); }
.status-now span { font: 400 13px/20px var(--mono); color: var(--muted); }
.status-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.status-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.status-list .name { font-weight: 500; }
.status-list .note-line { grid-column: 1; color: var(--text-2); font-size: 14px; line-height: 20px; }
.state-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 24px; color: var(--text-2); white-space: nowrap; }
.state-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.state-tag.warn i { background: var(--accent); } .state-tag.down i { background: var(--bad); }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 14px; line-height: 20px; color: var(--text-2); margin-bottom: 4px; }
.input, .select { display: block; width: 100%; height: 44px; padding: 0 12px; background: var(--card); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 10px; transition: border-color 160ms var(--ease); }
.input:hover, .select:hover { border-color: rgba(12, 47, 90, .4); }
.input:focus-visible, .select:focus-visible { outline: 2px solid var(--dew); outline-offset: 1px; border-radius: 10px; }
.input::placeholder { color: var(--muted); }
.form-error { color: var(--bad); font-size: 14px; line-height: 20px; margin: 0 0 16px; }
.hint { font-size: 13px; line-height: 20px; color: var(--muted); }

.auth { max-width: 26rem; margin: 0 auto; }
.auth h1 { font-size: 36px; line-height: 1.15; margin-bottom: 8px; max-width: none; }
.auth .sub { margin-bottom: 24px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--raised); border-radius: 10px; margin-bottom: 24px; }
.tabs button { flex: 1; height: 36px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; font-size: 15px;
  color: var(--text-2); transition: background-color 160ms var(--ease), color 160ms var(--ease); }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(12, 47, 90, .08); }
.auth .btn { width: 100%; }
.auth .note { margin-top: 24px; }
.or { display: flex; align-items: center; gap: 12px; margin: 16px 0; font-size: 13px; line-height: 20px; color: var(--muted); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.code-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 16px; }
.code-form .field { flex: 1; margin: 0; }
.code-form .btn { height: 44px; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 16px; font-size: 14px; line-height: 20px; color: var(--text-2); }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--text); flex: none; }
.check a { color: var(--text); border-bottom: 1px solid var(--line-strong); }

/* ---------- Cabinet (app shell) ---------- */
.demo-strip { background: var(--raised); border-bottom: 1px solid var(--line); font-size: 13px; line-height: 20px; color: var(--text-2); }
.demo-strip .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding-top: 8px; padding-bottom: 8px; }
.demo-strip b { font-weight: 500; color: var(--text); }
.app .wrap { max-width: 1280px; }
.app-head { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.app-user { display: flex; align-items: center; gap: 16px; min-width: 0; font-size: 14px; color: var(--text-2); }
.app-user .mail { font-family: var(--mono); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-account { display: grid; min-width: 0; gap: 2px; }
.subscription-label { color: var(--text-2); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.app-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; padding: 32px 0 96px; align-items: start; }
.side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; }
.side a { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 0 12px; border-radius: 8px;
  font-size: 15px; color: var(--text-2); transition: background-color 160ms var(--ease), color 160ms var(--ease); }
.side a:hover { color: var(--text); background: rgba(12, 47, 90, .04); }
.side a[aria-current="page"] { background: var(--raised); color: var(--text); font-weight: 500; }
.side a span { font: 400 12px/16px var(--mono); color: var(--muted); }
.side a #dev-count { display: inline-flex; align-items: center; gap: 6px; }
.side a #dev-count i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.side a #dev-count i.none { background: var(--muted); }
.side .sep { height: 1px; background: var(--line); margin: 12px 0; }
.view { max-width: 760px; min-width: 0; }
.app-main { min-width: 0; max-width: 760px; }
.help-strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 40px; padding: 12px 16px;
  border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); font-size: 14px; line-height: 20px;
  transition: color 160ms var(--ease), border-color 160ms var(--ease); }
.help-strip:hover { color: var(--text-2); border-color: var(--text-2); }
.help-strip .help-go { color: var(--text-2); white-space: nowrap; }
.help-strip[hidden] { display: none; }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.view-head h1 { font-size: 32px; line-height: 40px; margin: 0; max-width: none; letter-spacing: -.01em; }
.view-head p { color: var(--text-2); font-size: 15px; line-height: 22px; margin-top: 4px; }
.view h2 { font: 500 17px/24px var(--sans); letter-spacing: 0; margin: 32px 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.card + .card { margin-top: 16px; }
.card > h2:first-child { margin-top: 0; }
.card p { color: var(--text-2); font-size: 15px; line-height: 22px; }

/* Device list in the cabinet: same rows as the home preview, plus an action line */
.devlist { padding: 8px; }
.devlist .dev { padding: 16px; }
.devlist .dev + .dev { margin-top: 0; border-top: 1px solid var(--line); border-radius: 0; }
.devlist .dev.new { border-radius: 8px; border-top-color: transparent; }
.devlist .dev.new + .dev { border-top-color: transparent; }
.dev-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.dev.new .btn-quiet { background: var(--card); }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; z-index: 5; right: 0; top: 40px; min-width: 200px; padding: 4px; background: var(--card);
  border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 8px 24px rgba(12, 47, 90, .10); }
.menu-list button { display: block; width: 100%; height: 36px; padding: 0 12px; text-align: left; background: transparent; border: 0;
  border-radius: 8px; cursor: pointer; font-size: 14px; }
.menu-list button:hover { background: var(--raised); }
.menu-list .danger { color: var(--bad); }
.empty { padding: 40px 24px; text-align: center; }
.empty p { margin: 0 auto 16px; max-width: 24rem; }

/* Copy field: address in mono + a button */
.copy { display: flex; align-items: stretch; gap: 8px; margin: 8px 0 4px; }
.copy code { flex: 1; min-width: 0; display: flex; align-items: center; min-height: 40px; padding: 8px 12px; background: var(--raised);
  border-radius: 8px; font: 400 13px/20px var(--mono); color: var(--text); overflow-wrap: anywhere; }
.copy .btn { height: auto; min-height: 40px; }
.setup-pick { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.setup-pick .field { margin: 0; flex: 1; min-width: 200px; max-width: 320px; }
.setup-pick .hint { padding-bottom: 12px; }

/* Check result */
.result { display: flex; gap: 16px; align-items: flex-start; margin-top: 24px; padding: 16px; background: var(--raised); border-radius: 10px; }
.result .dot { width: 12px; height: 12px; margin-top: 6px; border-radius: 50%; background: var(--ok); flex: none; }
.result .dot.wait { background: var(--accent); }
.result b { display: block; font-weight: 500; }
.result p { font-size: 14px; line-height: 20px; }

/* Support chat in the cabinet */
.chat { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px 24px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.chat-head b { display: block; font-weight: 500; }
.chat-head span { font-size: 13px; line-height: 20px; color: var(--muted); }
.chat-contacts { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 14px; }
.chat-log { display: flex; flex-direction: column; gap: 12px; min-height: 240px; max-height: 420px; overflow-y: auto; padding: 20px; background: var(--bg); }
.chat-empty { margin: auto 0; color: var(--text-2); font-size: 15px; line-height: 22px; max-width: 32rem; }
.msg { max-width: 80%; align-self: flex-start; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.msg.mine { align-self: flex-end; background: var(--raised); border-color: transparent; }
.msg p { margin: 0; font-size: 15px; line-height: 22px; color: var(--text); overflow-wrap: anywhere; }
.msg span { display: block; margin-top: 4px; font: 400 12px/16px var(--mono); color: var(--muted); }
.msg.mine span { text-align: right; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line); }
.chat-form textarea { flex: 1; min-width: 0; height: auto; min-height: 44px; padding: 10px 12px; resize: vertical; line-height: 22px; }
.chat-form .btn { height: 44px; }
.app .site-foot { margin-top: 0; }

/* First-device wizard */
.progress { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 24px; padding: 0; font-size: 14px; line-height: 24px; color: var(--muted); }
.progress li { display: flex; align-items: center; gap: 8px; }
.progress .drop { position: static; flex: none; background: var(--raised); color: var(--muted); }
.progress .done .drop { background: var(--dew); color: #fff; }
.progress .now { color: var(--text); font-weight: 500; }
.progress .now .drop { background: var(--accent); color: var(--on-accent); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-size: 14px; line-height: 20px; color: var(--text-2); }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-bottom: 24px; }
.pick legend { grid-column: 1 / -1; }
.pick-item { position: relative; display: flex; align-items: center; min-height: 48px; padding: 0 16px; background: var(--card);
  border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; font-size: 15px;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease); }
.pick-item:hover { background: var(--raised); }
.pick-item input { position: absolute; opacity: 0; pointer-events: none; }
.pick-item:has(input:checked) { border-color: var(--text); background: var(--raised); font-weight: 500; }
.pick-item:has(input:focus-visible) { outline: 2px solid var(--dew); outline-offset: 2px; }
.wizard-next { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px 16px; margin-top: 16px; }

/* Shared-address warning */
/* Sales notice on the home page and in the cabinet (2026-11-24) */
.buy-strip { display: flex; align-items: center; gap: 12px; margin: 8px 0 0; padding: 12px 16px; border-radius: 10px;
  background: #fbefe0; border: 1px solid rgba(239, 159, 39, .45); font-size: 15px; line-height: 22px; color: var(--text-2);
  transition: border-color 160ms var(--ease); }
.buy-strip:hover { border-color: var(--accent); }
.buy-strip b { font-weight: 500; color: var(--text); }
.buy-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.buy-text { flex: 1; }
.buy-go { flex: none; font-weight: 500; color: var(--text); white-space: nowrap; }
.app-head + .buy-strip { margin-top: 16px; }
@media (max-width: 600px) { .buy-strip { flex-wrap: wrap; align-items: baseline; } .buy-text { flex-basis: calc(100% - 20px); } .buy-go { margin-left: 20px; } }
.alert { margin-bottom: 16px; padding: 16px; border-radius: 10px; background: #fbefe0; border: 1px solid rgba(239, 159, 39, .45); }
.alert b { display: block; font-weight: 500; margin-bottom: 4px; }
.alert p { font-size: 14px; line-height: 20px; color: var(--text-2); }
.dev-warn { grid-column: 1 / -1; font-size: 13px; line-height: 20px; color: #9a5b06; }

/* QR card */
.tips { border-left: 4px solid var(--accent); }
.tips h2 { margin: 0 0 8px; }
.tips ul { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 15px; line-height: 22px; }
.tips li + li { margin-top: 8px; }
.tips b { font-weight: 500; color: var(--text); }
.qr-card { display: flex; gap: 24px; align-items: center; }
.qr { flex: none; width: 128px; height: 128px; padding: 8px; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.qr svg { display: block; width: 100%; height: 100%; }
.qr-card h2 { margin: 0 0 4px; }

/* Settings: reminders, sign-ins */
.remind .check { margin-bottom: 8px; }
.remind fieldset { margin-top: 16px; }
.logins { list-style: none; margin: 0 0 16px; padding: 0; border-top: 1px solid var(--line); }
.logins li { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.logins b { display: block; font-weight: 500; font-size: 15px; }
.logins .hint { display: block; }

/* Outage history */
.incidents { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.incidents li { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 4px 24px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.incidents .mono { font-size: 13px; line-height: 22px; color: var(--muted); }
.incidents b { font-weight: 500; font-size: 15px; }
.incidents p { margin: 0; font-size: 14px; line-height: 20px; color: var(--text-2); }

/* Plans as rows, not three equal cards */
.plan { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.plan:first-of-type { border-top: 0; padding-top: 0; }
.plan:last-of-type { padding-bottom: 0; }
.plan b { font-weight: 500; display: block; }
.plan small { font-size: 14px; line-height: 20px; color: var(--text-2); }
.plan .price { font: 400 13px/20px var(--mono); color: var(--muted); }
.figure { font: 400 28px/36px var(--serif); letter-spacing: -.01em; color: var(--text); }

/* Switch */
.switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.switch { position: relative; flex: none; width: 44px; height: 24px; margin-top: 2px; border: 0; padding: 0; border-radius: 12px;
  background: rgba(12, 47, 90, .22); cursor: pointer; transition: background-color 160ms var(--ease); }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(12, 47, 90, .25); transition: transform 160ms var(--ease); }
.switch[aria-checked="true"] { background: var(--text); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch:focus-visible { border-radius: 12px; }

/* Dialog and toast */
dialog { width: min(440px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line-strong); border-radius: 16px;
  background: var(--card); color: var(--text); box-shadow: 0 8px 24px rgba(12, 47, 90, .12); }
dialog::backdrop { background: rgba(12, 47, 90, .28); }
dialog[open] { animation: rise 200ms var(--ease) both; }
dialog h2 { font: 500 19px/28px var(--sans); letter-spacing: 0; margin: 0 0 8px; }
dialog p { color: var(--text-2); font-size: 15px; line-height: 22px; margin-bottom: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.dialog-actions .btn { height: 40px; font-size: 15px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translate(-50%, 8px); max-width: calc(100vw - 32px);
  padding: 12px 16px; background: var(--text); color: #fff; border-radius: 10px; font-size: 14px; line-height: 20px;
  opacity: 0; pointer-events: none; transition: opacity 180ms var(--ease), transform 180ms var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 404 */
.lost { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 48px; align-items: center; padding: 64px 0; }
.lost h1 { font-size: 44px; line-height: 1.1; }
.lost .code { font: 400 13px/20px var(--mono); color: var(--muted); margin-bottom: 12px; }

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
  .wrap { padding: 0 20px; }
  .menu-btn { display: inline-flex; }
  .site-nav { display: none; position: absolute; z-index: 10; top: 60px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px; background: var(--card); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 8px 24px rgba(12, 47, 90, .10); }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { display: flex; align-items: center; height: 44px; padding: 0 12px; border-radius: 8px; font-size: 16px; }
  .site-nav .btn { height: 44px; margin-top: 8px; }
  .hero { grid-template-columns: 1fr; gap: 32px; min-height: 0; padding: 40px 0 24px; }
  h1 { font-size: 40px; }
  .art { max-width: 400px; }
  .horizon { height: 40px; }
  .facts { grid-template-columns: 1fr; }
  .fact, .fact + .fact { padding: 24px 0; border-left: 0; }
  .fact + .fact { border-top: 1px solid var(--line); }
  .how, .cols { grid-template-columns: 1fr; gap: 40px; }
  .how { padding: 64px 0; }
  h2 { font-size: 28px; }
  .last { padding: 48px 0; }
  .page { padding: 32px 0 64px; }
  .page-head { margin-bottom: 32px; }
  .page-head h1, .lost h1 { font-size: 34px; }
  .row { grid-template-columns: 1fr; }
  .lost { grid-template-columns: 1fr; gap: 32px; padding: 32px 0; }
  .lost .art { max-width: 240px; }

  .app-body { grid-template-columns: 1fr; gap: 24px; padding: 16px 0 64px; }
  .side { position: static; flex-direction: row; gap: 4px; overflow-x: auto; margin: 0 -20px; padding: 0 20px 4px; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .side a { flex: none; height: 40px; }
  .side a span, .side a #dev-count, .side .sep { display: none; }
  .app-user .mail { font-size: 11px; }
  .view-head h1 { font-size: 28px; line-height: 36px; }
  .card { padding: 20px; }
  .plan { grid-template-columns: minmax(0, 1fr) auto; }
  .plan .price { grid-column: 1; grid-row: 2; }
  .plan .btn { grid-column: 2; grid-row: 1 / span 2; }
  .copy { flex-direction: column; }
  .incidents li { grid-template-columns: 1fr; }
  .qr-card { display: none; }
  .wizard-next { justify-content: stretch; }
  .wizard-next .btn { width: 100%; }
  .card.chat { padding: 0; }
  .chat-head { padding: 12px 16px; }
  .chat-contacts { align-items: flex-start; }
  .chat-log { padding: 16px; min-height: 200px; }
  .msg { max-width: 90%; }
  .menu-list { right: auto; left: 0; }
}
@media (max-width: 420px) {
  .actions .btn { width: 100%; }
}
@media (max-width: 340px) {
  .dev { grid-template-columns: 1fr; }
  .dev .state { justify-content: flex-start; }
  .dev .when { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .rise, dialog[open] { animation: none; }
  * { transition-duration: 0ms !important; }
}
