@font-face { font-family: 'Montserrat'; font-weight: 300 800; font-display: swap;
  src: url('/static/fonts/montserrat-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Montserrat'; font-weight: 300 800; font-display: swap;
  src: url('/static/fonts/montserrat-latin.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: dark;
  --bg: #0d0d0e; --bg2: #151517; --panel: #1b1b1e; --line: #2a2a2e; --hair: #ffffff10;
  --text: #ececec; --text2: #d6d6d6; --muted: #9a9aa0; --gold: #c9a24a; --gold2: #e2c06e; --on-gold: #141414;
  --ok: #4cc38a; --bad: #e5675e; --warn: #e0a84a; --info: #6ea8e0;
  --header: #0d0d0ecc; --code: #0000004d; --out: #00000080; --track: #3a3a3f; --knob: #dddddd;
  --hero-img: url('/static/img/hero.webp'); --hero-pos: center 40%;
  --hero-fade: linear-gradient(180deg, #0d0d0e00 30%, #0d0d0e 100%);
  --hero-side: linear-gradient(90deg, #0d0d0ee6 0%, #0d0d0e66 55%, #0d0d0e00 100%);
  --alice-bg: linear-gradient(120deg, #1d1a12, #151517 60%);
  --auth-glow: radial-gradient(ellipse at top, #2a2416 0%, transparent 60%);
  --r: 14px;
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { color-scheme: light;
    --bg: #f7f5f1; --bg2: #efece6; --panel: #ffffff; --line: #e3dfd7; --hair: #00000012;
    --text: #1d1d1f; --text2: #3a3a3c; --muted: #6e6e73; --gold: #b08a35; --gold2: #8f6d22; --on-gold: #ffffff;
    --ok: #23935e; --bad: #c8463c; --warn: #b9781a; --info: #2f6fb0;
    --header: #f7f5f1d9; --code: #0000000d; --out: #00000008; --track: #d6d2ca; --knob: #ffffff;
    --hero-img: url('/static/img/octa9.webp'); --hero-pos: center 30%;
    --hero-fade: linear-gradient(180deg, #f7f5f100 35%, #f7f5f1 100%);
    --hero-side: linear-gradient(90deg, #f7f5f1f2 0%, #f7f5f1aa 50%, #f7f5f100 100%);
    --alice-bg: linear-gradient(120deg, #f3e9d2, #ffffff 65%);
    --auth-glow: radial-gradient(ellipse at top, #f1e4c4 0%, transparent 60%); } }
:root[data-theme="light"] { color-scheme: light;
    --bg: #f7f5f1; --bg2: #efece6; --panel: #ffffff; --line: #e3dfd7; --hair: #00000012;
    --text: #1d1d1f; --text2: #3a3a3c; --muted: #6e6e73; --gold: #b08a35; --gold2: #8f6d22; --on-gold: #ffffff;
    --ok: #23935e; --bad: #c8463c; --warn: #b9781a; --info: #2f6fb0;
    --header: #f7f5f1d9; --code: #0000000d; --out: #00000008; --track: #d6d2ca; --knob: #ffffff;
    --hero-img: url('/static/img/octa9.webp'); --hero-pos: center 30%;
    --hero-fade: linear-gradient(180deg, #f7f5f100 35%, #f7f5f1 100%);
    --hero-side: linear-gradient(90deg, #f7f5f1f2 0%, #f7f5f1aa 50%, #f7f5f100 100%);
    --alice-bg: linear-gradient(120deg, #f3e9d2, #ffffff 65%);
    --auth-glow: radial-gradient(ellipse at top, #f1e4c4 0%, transparent 60%); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.55 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif; }
a { color: var(--gold2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0 0 .6em; }
h2 { font-size: clamp(24px, 3.2vw, 34px); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code { font: 13px/1.4 ui-monospace, Consolas, monospace; background: var(--code); padding: 2px 6px; border-radius: 6px; }

/* шапка */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px); background: var(--header); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand b { font-weight: 700; letter-spacing: .14em; font-size: 17px; color: var(--text); }
.brand span { font-weight: 300; letter-spacing: .18em; text-transform: uppercase; font-size: 14px; color: var(--gold2); }
.top nav { display: flex; gap: 22px; margin-left: 12px; }
.top nav a { color: var(--muted); font-size: 14px; }
.top nav a:hover { color: var(--text); text-decoration: none; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.link { color: var(--gold2); font-size: 14px; }
.theme-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); cursor: pointer; font-size: 16px; line-height: 1; display: grid; place-items: center; padding: 0; }
.theme-btn:hover { border-color: var(--gold); }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid transparent; border-radius: 999px; padding: 9px 20px;
  font-family: inherit; font-weight: 600; font-size: 14px; line-height: 1;
  color: var(--text); background: transparent; transition: .15s; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background: var(--gold2); }
.btn-ghost { border-color: var(--muted); }
.btn-ghost:hover { border-color: var(--gold2); color: var(--gold2); }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; padding: 13px; }

/* главная */
.hero { position: relative; min-height: min(86vh, 760px); display: flex; align-items: flex-end;
  background: var(--hero-fade), var(--hero-img) var(--hero-pos) / cover no-repeat; }
.hero::before { content: ''; position: absolute; inset: 0; background: var(--hero-side); }
.hero-inner { position: relative; max-width: 1180px; width: 100%; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 9vh; }
.eyebrow { color: var(--gold2); letter-spacing: .25em; text-transform: uppercase; font-size: 13px; margin: 0 0 18px; }
.hero h1 { font-size: clamp(32px, 5.4vw, 62px); font-weight: 600; max-width: 820px; }
.lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--text2); max-width: 600px; margin: 0 0 32px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 72px clamp(16px, 4vw, 48px); }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1040px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 26px; }
.card .ico { font-size: 28px; margin-bottom: 14px; }
.card p { color: var(--muted); margin: 0; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.steps li { display: flex; gap: 18px; background: var(--bg2); border-radius: var(--r); padding: 26px; border: 1px solid var(--line); }
.steps li > span { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--gold); color: var(--gold2); font-weight: 600; }
.steps p { color: var(--muted); margin: 0; }

.devices { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.device { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.device img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.device > div:last-child { padding: 22px 24px 26px; }
.device p { color: var(--muted); }
.lamp-art { aspect-ratio: 4 / 3; background:
  radial-gradient(circle at 50% 38%, #f6d58b 0 7%, #f6d58b55 12%, #c9a24a22 30%, transparent 55%),
  linear-gradient(var(--panel), var(--bg2)); position: relative; }
.lamp-art::after { content: ''; position: absolute; left: 50%; top: 0; width: 2px; height: 30%; background: var(--muted); transform: translateX(-50%); }
.tag { display: inline-block; vertical-align: middle; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--gold2); border: 1px solid var(--gold); border-radius: 999px; padding: 2px 8px; margin-left: 6px; }

.alice { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap;
  background: var(--alice-bg); border-radius: 20px; border: 1px solid color-mix(in srgb, var(--gold) 25%, transparent);
  margin-bottom: 72px; padding: 48px clamp(20px, 4vw, 56px); }
.phrases { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.phrases li { color: var(--text2); font-size: 17px; }
.phrases li::before { content: '“'; color: var(--gold); margin-right: 6px; }

.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 26px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* вход */
.auth-box { min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 40px 16px;
  background: var(--auth-glow); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 26px; }
.auth-box .panel { width: min(400px, 100%); padding: 34px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0; }
input, select { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; }
input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--gold) 40%, transparent); border-color: var(--gold); }
input[type=range] { padding: 0; accent-color: var(--gold); background: none; border: 0; }
.err { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.switch { text-align: center; margin: 18px 0 0; font-size: 14px; }
.fine { font-size: 12px; color: var(--muted); text-align: center; }

/* кабинет */
.cab-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.cab-head p { margin: 0; }
.claim { display: flex; gap: 10px; flex-wrap: wrap; }
.claim input { margin: 0; width: min(340px, 100%); }
.msg { padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.msg.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.hubs { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 18px; }
.chip { font-size: 13px; padding: 5px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.chip.on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.tile.off { opacity: .55; }
.tile header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.tile h3 { margin: 0 0 2px; font-size: 18px; }
.tile header p { margin: 0; }
.tile-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--hair); font-size: 14px; }
.tile-row input[type=range] { width: 52%; margin: 0; }
.tile-row select { width: 80px; margin: 0; padding: 6px 10px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--track); vertical-align: middle; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px color-mix(in srgb, var(--ok) 60%, transparent); }
.sw { position: relative; margin: 0; width: 44px; height: 24px; }
.sw input { position: absolute; opacity: 0; }
.sw i { position: absolute; inset: 0; background: var(--track); border-radius: 999px; transition: .15s; cursor: pointer; }
.sw i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--knob); box-shadow: 0 1px 2px #0003; transition: .15s; }
.sw input:checked + i { background: var(--gold); }
.sw input:checked + i::after { left: 23px; background: var(--on-gold); }
.empty { grid-column: 1 / -1; text-align: center; padding: 56px 20px; border: 1px dashed var(--line); border-radius: var(--r); }
.empty p { color: var(--muted); }

/* админка */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 130px); }
.side { border-right: 1px solid var(--line); padding: 24px 14px; display: flex; flex-direction: column; gap: 4px; }
.side-title { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .15em; margin: 0 10px 10px; }
.side a { color: var(--text); padding: 9px 12px; border-radius: 10px; font-size: 15px; }
.side a:hover { background: var(--panel); text-decoration: none; }
.side a.active { background: var(--panel); color: var(--gold2); }
.side-ver { margin: auto 12px 0; padding-top: 20px; font-size: 12px; color: var(--muted); }
.side a.dev { margin-top: 10px; border: 1px dashed color-mix(in srgb, var(--gold) 45%, transparent); }
.admin-main { padding: 28px clamp(16px, 3vw, 40px); min-width: 0; }
.admin-main h2 { font-size: 20px; margin-top: 28px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.stat b { display: block; font-size: 30px; font-weight: 600; color: var(--gold2); }
.stat span { color: var(--muted); font-size: 14px; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { color: var(--muted); font-weight: 500; background: var(--bg2); }
.tbl tr:last-child td { border-bottom: 0; }
.dev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.dev-grid h2 { margin-top: 0; font-size: 18px; }
.dev-grid p { margin: 6px 0; }
.row { display: flex; gap: 8px; }
.row input { margin: 0; }
.out { background: var(--out); border-radius: 10px; padding: 12px; font-size: 12px; min-height: 60px; overflow: auto; margin: 12px 0 0; }
.issued { margin-top: 16px; padding: 14px; border-radius: 10px; background: color-mix(in srgb, var(--gold) 10%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); }
.secret { word-break: break-all; }
.st { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.st-stand { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.st-work { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.st-plan { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.st-idea { background: var(--hair); color: var(--muted); }

@media (max-width: 560px) {
  .top-actions .link { display: none; }
  .brand span { font-size: 12px; }
  .top-actions { gap: 10px; }
  .top .btn { padding: 9px 16px; }
}
@media (max-width: 760px) {
  .top { gap: 12px; }
  .top nav { display: none; }
  .hero { min-height: 78vh; }
  .wrap { padding-top: 52px; padding-bottom: 52px; }
  .admin-layout { grid-template-columns: 1fr; }
  .side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .side-title, .side-ver { display: none; }
  .side a { white-space: nowrap; }
  .side a.dev { margin-top: 0; }
}
