/* Lokeo Web и Management: каркас (боковая панель, топбар), вход, канбан, чат, план цифровизации, главная. */
:root { --side-bg: #12231b; --side-bg-2: #183026; --side-text: #d5e2da; --side-muted: #7f978a; --side-hover: rgba(255, 255, 255, .06); --side-active: rgba(255, 255, 255, .1); --side-accent: #f2b24c; --side-line: rgba(255, 255, 255, .07); }
body.mgmt { --side-bg: #1b1830; --side-bg-2: #25213f; --side-text: #dcd8ef; --side-muted: #8d87ad; --side-accent: #ff9f7a; --accent: #4a3fb0; --accent-hover: #3d3396; --accent-weak: #ebe8fa; --accent-ink: #362d8c; --brand-mark: #4a3fb0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body.mgmt { --accent: #9d93f2; --accent-hover: #b1a8f7; --accent-weak: #25213f; --accent-ink: #c4bdfb; --on-accent: #15122a; --brand-mark: #5a4fc4; } }
:root[data-theme="dark"] body.mgmt { --accent: #9d93f2; --accent-hover: #b1a8f7; --accent-weak: #25213f; --accent-ink: #c4bdfb; --on-accent: #15122a; --brand-mark: #5a4fc4; }

.layout { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--side-bg-2), var(--side-bg) 40%); color: var(--side-text); }
.sidebar .contours { top: auto; height: 260px; color: #9fd0b5; opacity: .9; }
body.mgmt .sidebar .contours { color: #b9b0ff; }
/* Management: шапка сайдбара и топбар одной высоты — нижние линии на одном уровне. */
body.mgmt .sidebar .brand { height: 60px; flex: none; padding-block: 0; margin-bottom: 0; }
body.mgmt .topbar { height: 60px; min-height: 60px; padding-block: 0; }
body.mgmt .side-scroll { padding-top: 10px; }
.side-scroll { position: relative; flex: 1; overflow-y: auto; padding: 4px 12px 24px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.brand { display: flex; align-items: center; gap: 11px; font: 600 19px/1.1 var(--display); padding: 18px 20px 16px; letter-spacing: -.01em; }
.brand small { display: block; font: 400 12px/1.3 var(--font); color: var(--muted); margin-top: 3px; letter-spacing: 0; }
.sidebar .brand { color: #fff; border-bottom: 1px solid var(--side-line); margin-bottom: 8px; }
.sidebar .brand small { color: var(--side-muted); max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-group { margin-top: 6px; }
.nav-group > .nav-title { display: flex; align-items: center; justify-content: space-between; width: 100%; border: none; background: none; font: 600 10.5px var(--font); text-transform: uppercase; letter-spacing: .12em; color: var(--side-muted); padding: 12px 10px 6px; }
.nav-group > button.nav-title:hover { color: var(--side-text); }
.nav-group > .nav-title .ico { transition: transform .2s var(--ease); }
.nav-group.collapsed > .nav-title .ico { transform: rotate(-90deg); }
.nav-group.collapsed > .nav { display: none; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 9px; color: var(--side-text); font-weight: 450; transition: background .12s, color .12s; }
.nav a .ico { color: var(--side-muted); transition: color .12s; }
.nav a .label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav a:hover { background: var(--side-hover); text-decoration: none; color: #fff; }
.nav a:hover .ico { color: var(--side-text); }
.nav a.active { background: var(--side-active); color: #fff; font-weight: 600; }
.nav a.active .ico { color: var(--side-accent); }
.nav a.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--side-accent); }
.nav a .stub { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--side-muted); border: 1px solid var(--side-line); border-radius: 999px; padding: 0 6px; }
.side-foot { position: relative; padding: 12px 20px 16px; border-top: 1px solid var(--side-line); font-size: 12px; color: var(--side-muted); display: flex; align-items: center; gap: 8px; }
.side-foot .dot { width: 7px; height: 7px; border-radius: 50%; background: #5fd08f; box-shadow: 0 0 0 3px rgba(95, 208, 143, .18); }

/* Lokeo Web, навигация «D+»: разделы в топбаре, пункты раздела в сайдбаре, посёлок — над страницей. */
/* Узор горизонталей — на всю высоту сайдбара: тихий фон, чуть ярче у низа, под эмблемой почти исчезает. */
body.mgmt .sidebar .contours, .sidebar.dplus .contours { inset: 0; height: auto; opacity: 1; -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .35), rgba(0, 0, 0, .7) 40%, #000); mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .35), rgba(0, 0, 0, .7) 40%, #000); }
.brand-bar { position: relative; display: flex; align-items: center; height: 60px; flex: none; border-bottom: 1px solid var(--side-line); }
.brand-bar .brand { flex: 1; min-width: 0; height: 100%; padding: 0 18px; margin: 0; border: 0; color: #fff; }
.brand-bar .brand:hover { text-decoration: none; background: var(--side-hover); }
.tenant-switch { position: relative; display: grid; place-items: center; width: 32px; height: 32px; margin-right: 10px; border-radius: 9px; color: var(--side-muted); flex: none; }
.tenant-switch:hover { background: var(--side-hover); color: #fff; }
.tenant-switch select { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sidebar.dplus .sec-head { position: relative; display: grid; gap: 2px; padding: 14px 20px 6px; }
.sidebar.dplus .sec-head .eyebrow { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--side-muted); }
.sidebar.dplus .sec-head h2 { margin: 0; font-size: 17px; color: #fff; }
.sidebar.dplus .side-scroll { display: flex; flex-direction: column; gap: 2px; padding: 4px 12px 16px; }
.sidebar.dplus .side-scroll.slide-l { animation: side-in-l .24s var(--ease); }
.sidebar.dplus .side-scroll.slide-r { animation: side-in-r .24s var(--ease); }
@keyframes side-in-l { from { transform: translateX(14px); opacity: 0; } }
@keyframes side-in-r { from { transform: translateX(-14px); opacity: 0; } }
.sidebar.dplus .sec-title { font: 600 10.5px var(--font); text-transform: uppercase; letter-spacing: .12em; color: var(--side-muted); padding: 10px 10px 4px; }
.nav-item { position: relative; display: flex; align-items: center; min-width: 0; }
.sidebar.dplus .nav-item > .row { flex: 1; }
.sidebar.dplus .nav-item > .row:only-child { padding-right: 10px; }
.sidebar.dplus .row { position: relative; display: flex; align-items: center; gap: 11px; flex: none; min-width: 0; min-height: 32px; padding: 6px 34px 6px 10px; border: 0; border-radius: 9px; background: none; color: var(--side-text); font: inherit; font-weight: 450; text-align: left; cursor: pointer; transition: background .12s, color .12s; }
.sidebar.dplus .row .ico { flex: none; color: var(--side-muted); transition: color .12s, transform .2s var(--ease); }
.sidebar.dplus .row .label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar.dplus .row:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.sidebar.dplus .row:hover .ico { color: var(--side-text); }
.nav-item.active > .row { background: var(--side-active); color: #fff; font-weight: 600; }
.nav-item.active > .row .ico { color: var(--side-accent); }
.nav-item.active > .row::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--side-accent); }
.sub .nav-item.active > .row::before { left: -17px; }
.nav-item .pin { position: absolute; right: 6px; display: none; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 6px; background: none; color: var(--side-muted); cursor: pointer; }
.nav-item:hover .pin, .nav-item .pin:focus-visible, .nav-item .pin.on { display: grid; }
.nav-item .pin:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item .pin.on { color: var(--side-accent); }
.nav-item .pin.on svg { fill: currentColor; }
.sidebar.dplus .row .tag { font-size: 10.5px; color: var(--side-muted); border: 1px solid var(--side-line); border-radius: 6px; padding: 0 5px; white-space: nowrap; }
.sidebar.dplus .row .cnt { min-width: 22px; padding: 0 7px; border-radius: 999px; background: rgba(242, 178, 76, .16); color: var(--side-accent); font-size: 11.5px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.sidebar.dplus .row .cnt.zero { background: none; color: var(--side-muted); font-weight: 400; }
.sidebar.dplus .row .stub { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--side-muted); border: 1px solid var(--side-line); border-radius: 999px; padding: 0 6px; }
.sidebar.dplus .row.cluster { padding-right: 10px; font-weight: 500; }
.sidebar.dplus .row.cluster .count { font-size: 11px; color: var(--side-muted); font-variant-numeric: tabular-nums; }
.sidebar.dplus .row.cluster .chev { transform: rotate(-90deg); }
.sidebar.dplus .row.cluster.open { color: #fff; }
.sidebar.dplus .row.cluster.open .chev { transform: none; }
.sidebar.dplus .row.cluster.has-active:not(.open) .label::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: var(--side-accent); vertical-align: middle; }
.sidebar.dplus .sub { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; margin-left: 18px; padding-left: 12px; border-left: 1px solid var(--side-line); animation: side-drop .2s var(--ease); }
@keyframes side-drop { from { opacity: 0; transform: translateY(-4px); } }
.sidebar.dplus .side-foot { display: grid; gap: 2px; padding: 4px 12px 12px; font-size: inherit; }
.sidebar.dplus .side-foot .sec-title { padding-top: 8px; }
.sidebar.dplus .empty-note { padding: 0 10px 6px; font-size: 12px; line-height: 1.4; color: var(--side-muted); }
.sub-status { display: flex; align-items: center; gap: 8px; padding: 10px 8px 0; margin-top: 6px; border-top: 1px solid var(--side-line); font-size: 12px; color: var(--side-muted); }
.sub-status a { color: inherit; }
.sub-status .dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #5fd08f; box-shadow: 0 0 0 3px rgba(95, 208, 143, .18); }
.mobile-secs { display: none; }
.sidebar.dplus .row.quick .plus { flex: none; width: 26px; height: 26px; margin-left: -3px; display: grid; place-items: center; border-radius: 8px; background: rgba(242, 178, 76, .14); color: var(--side-accent); }
.sidebar.dplus .row.quick:hover .plus { background: rgba(242, 178, 76, .24); }
.soon { margin-bottom: 22px; }
.soon h2, .ideas-title { font-size: 17px; margin: 0 0 12px; }
.soon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.soon-card { display: grid; gap: 4px; padding: 14px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: color-mix(in srgb, var(--sun-weak) 45%, var(--surface)); color: var(--text); }
.soon-card:hover { text-decoration: none; border-color: var(--sun); }
.soon-ico { width: 36px; height: 36px; margin-bottom: 6px; display: grid; place-items: center; border-radius: 10px; background: var(--sun-weak); color: var(--warn); }
.soon-card small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.brand-bar .brand { gap: 11px; }
.brand-gear { margin-left: auto; display: grid; place-items: center; color: var(--side-muted); opacity: 0; transition: opacity .15s; }
.brand-bar .brand:hover .brand-gear, .sidebar.org-mode .brand-gear { opacity: 1; }
.sidebar.org-mode .brand-bar .brand { background: rgba(242, 178, 76, .1); box-shadow: inset 3px 0 0 var(--side-accent); }
.sidebar.org-mode .brand-gear { color: var(--side-accent); }
.sidebar.org-mode .sec-head .eyebrow { color: var(--side-accent); }
.side-note { display: flex; align-items: center; gap: 6px; margin: 2px 10px 4px 41px; font-size: 12px; color: var(--side-muted); }
.side-note:hover { color: var(--side-text); }

/* Режим «Управляющая компания»: рабочие разделы скрыты, в топбаре — заголовок режима и возврат к работе. */
.orgbar { display: none; align-items: center; gap: 12px; }
.topbar.org-mode .topnav { display: none; }
.topbar.org-mode .orgbar { display: flex; }
.orgbar b { display: block; font: 600 15px var(--display); }
.orgbar small { color: var(--muted); font-size: 12px; }
.orgbar .btn { margin-left: 8px; }
.org-ico { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--sun-weak); color: var(--warn); }
.tn-home { padding: 7px 9px; }
.tn-wrap.current .tn-home { background: var(--accent-weak); }

/* Обзор УК */
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.org-grid > .org-card { display: grid; gap: 14px; margin: 0; }
.org-card-head { display: flex; align-items: center; gap: 12px; }
.org-card-head h2 { flex: 1; margin: 0; font-size: 16px; }
.org-more { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; }
.org-villages { display: grid; gap: 8px; }
.org-village { display: grid; grid-template-columns: 1fr 120px; grid-template-rows: auto auto; column-gap: 14px; row-gap: 3px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.org-village:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.org-village b { font-weight: 600; }
.org-village .org-bar { grid-row: 1 / 3; grid-column: 2; }
.org-village small { color: var(--muted); font-size: 12px; }
.org-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.org-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.org-list, .org-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.org-list li { display: grid; gap: 1px; }
.org-list small { color: var(--muted); font-size: 12.5px; }
.org-links li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.org-links li:last-child { border-bottom: 0; padding-bottom: 0; }
.org-links small { color: var(--muted); font-size: 12.5px; }
.org-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.org-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.org-status.on { color: var(--ok); }
.org-status.on i { background: var(--ok); }
.org-nums { display: flex; gap: 28px; }
.org-nums > * { display: grid; color: var(--text); }
.org-nums b { font: 600 26px var(--display); font-variant-numeric: tabular-nums; }
.org-nums span { color: var(--muted); font-size: 13px; }
.org-sub { display: grid; gap: 2px; }
.org-sub b { font-weight: 600; }
.org-sub small { color: var(--muted); }

.topbar.dplus { height: 60px; min-height: 60px; padding-block: 0; gap: 8px; }
.topnav { display: flex; align-items: center; gap: 2px; min-width: 0; }
.tn-wrap { position: relative; display: inline-flex; }
.tn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.tn .ico { color: var(--muted); }
.tn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.tn-wrap.current .tn { background: var(--accent-weak); color: var(--accent-ink); font-weight: 600; }
.tn-wrap.current .tn .ico { color: var(--accent); }
.tn .bdg[hidden] { display: none; }
.tn .bdg { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 9px; background: var(--sun); color: #2a1d05; font: 600 10.5px var(--font); }
.peek { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; width: 460px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  visibility: hidden; opacity: 0; transform: translateY(4px); transition: opacity .14s, transform .14s var(--ease), visibility 0s linear .14s; }
.peek::before { content: ''; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.peek.wide { width: 640px; }
.peek.narrow { width: 260px; }
.peek.narrow .peek-cols { columns: 1; }
.tn-wrap:nth-last-child(-n+2) .peek { left: auto; right: 0; }
.tn-wrap:not(.current):hover .peek, .tn-wrap:not(.current):focus-within .peek { visibility: visible; opacity: 1; transform: none; transition-delay: .12s, .12s, 0s; }
.topnav.nopeek .peek { display: none; }
.peek-cols { columns: 2 190px; column-gap: 10px; }
.peek.wide .peek-cols { columns: 3 190px; }
.peek-g { break-inside: avoid; margin-bottom: 6px; }
.peek .grp { font: 600 10px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 6px 8px 3px; }
.peek .opt { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 8px; color: var(--text); font-size: 13.5px; }
.peek .opt .ico { color: var(--muted); flex: none; }
.peek .opt:hover { background: var(--surface-2); text-decoration: none; }

.scope-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.scope-row .muted { font-size: 12.5px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { padding: 5px 12px; border: 0; border-radius: 9px; background: none; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.seg button.on::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.scope-org { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; border: 1px dashed var(--border-strong); background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 500; }
.scope-org .ico { color: var(--muted); }
@media (max-width: 1280px) { .topbar.dplus .user-chip .who { display: none; } .tn { padding: 7px 8px; } }
@media (max-width: 1100px) { .tn span:not(.bdg) { display: none; } .tn { padding: 8px; } }
@media (prefers-reduced-motion: reduce) { .sidebar.dplus .side-scroll, .sidebar.dplus .sub, .peek { animation: none; transition: none; } }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; gap: 10px; align-items: center; padding: 10px 28px; min-height: 60px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar select { width: auto; min-width: 210px; border-radius: 999px; padding: 7px 34px 7px 36px; font-weight: 500; background-color: var(--surface); box-shadow: var(--shadow-sm); }
.select-ico { position: relative; display: inline-flex; align-items: center; }
.select-ico > .ico { position: absolute; left: 12px; pointer-events: none; color: var(--accent); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; }
.user-chip .who { line-height: 1.2; text-align: right; }
.user-chip .who b { display: block; font-size: 13px; }
.user-chip .who small { color: var(--muted); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--muted); transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.content { padding: 26px 28px 48px; max-width: 1480px; width: 100%; animation: pop .25s var(--ease); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 26px; }
.page-head .row .btn { box-shadow: var(--shadow-sm); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search], .toolbar .search { max-width: 340px; padding-left: 36px; background: var(--surface) no-repeat 11px center / 17px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d766f' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4.5 4.5'/%3E%3C/svg%3E"); }
.toolbar select { width: auto; }
.split { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 16px; align-items: start; }
.split > .list-pane { border-radius: var(--radius); }
.menu-toggle { display: none; }

/* Вход */
.auth-page { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); min-height: 100vh; }
.auth-art { position: relative; overflow: hidden; color: #fff; background: radial-gradient(900px 500px at 85% 0%, #2c7a5a 0%, transparent 60%), linear-gradient(160deg, #1b3a2d, #0f1f18 70%); padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between; }
body.mgmt .auth-art { background: radial-gradient(900px 500px at 85% 0%, #5a4fc4 0%, transparent 60%), linear-gradient(160deg, #272146, #15122a 70%); }
.auth-art .contours { color: #bfe6cf; }
.auth-art .forest { height: 120px; color: #0b1712; opacity: .9; }
body.mgmt .auth-art .forest { color: #100d20; }
.auth-art .brand { padding: 0; color: #fff; position: relative; font-size: 22px; }
.auth-art .brand small { color: rgba(255, 255, 255, .6); }
.auth-art .pitch { position: relative; max-width: 480px; margin-bottom: 110px; }
.auth-art .pitch h1 { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.12; margin-bottom: 16px; letter-spacing: -.02em; }
.auth-art .pitch h1 em { font-style: normal; color: #f2b24c; }
.auth-art .pitch p { color: rgba(255, 255, 255, .72); font-size: 15px; max-width: 420px; }
.auth-art .facts { display: flex; gap: 28px; margin-top: 26px; }
.auth-art .facts b { display: block; font: 600 22px var(--display); color: #fff; }
.auth-art .facts span { font-size: 12px; color: rgba(255, 255, 255, .6); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth { width: 100%; max-width: 420px; }
.auth > .brand { display: none; }
.auth h2 { font: 600 22px/1.2 var(--display); margin-bottom: 6px; }
.auth .form-grid { grid-template-columns: 1fr; }
.auth .form-grid .span2 { grid-column: span 1; }
.auth .card { padding: 28px; border-radius: 20px; box-shadow: var(--shadow); }
.auth .card form .btn.primary { width: 100%; justify-content: center; padding: 11px; }
.auth .card .actions { margin-top: 20px; }
.demo-hint { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--sun-weak); color: var(--text-2); font-size: 13px; }
.demo-hint .ico { color: var(--sun); margin-top: 1px; }
.demo-hint code { font: 500 12.5px var(--mono); background: var(--surface); padding: 1px 6px; border-radius: 6px; cursor: pointer; }

/* Канбан */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kanban .col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 220px; }
.kanban .col h3 { margin: 2px 4px 10px; font-size: 11.5px; display: flex; align-items: center; gap: 8px; }
.kanban .col h3::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.kanban .col:nth-child(1) h3::before { background: var(--info); }
.kanban .col:nth-child(2) h3::before { background: var(--sun); }
.kanban .col:nth-child(3) h3::before { background: var(--warn); }
.kanban .col:nth-child(4) h3::before { background: var(--ok); }
.kanban .item { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .12s, transform .12s var(--ease), box-shadow .12s; }
.kanban .item:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: translateY(-1px); box-shadow: var(--shadow); }

/* Чат обращений */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 460px; overflow: auto; padding: 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.msg { padding: 9px 13px; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--border); max-width: 80%; box-shadow: var(--shadow-sm); }
.msg.staff { align-self: flex-end; background: var(--accent-weak); border-color: color-mix(in srgb, var(--accent) 20%, transparent); border-radius: 14px 14px 4px 14px; }
.msg.internal { align-self: flex-end; background: var(--sun-weak); border: 1px dashed color-mix(in srgb, var(--sun) 60%, transparent); border-radius: 14px 14px 4px 14px; }
.msg.system { align-self: center; background: none; border: none; box-shadow: none; color: var(--muted); font-size: 12px; padding: 2px 10px; }
.msg .meta { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; font-weight: 500; }

/* План цифровизации */
/* План цифровизации — маршрут запуска посёлка на одном экране */
.plan-top { display: flex; align-items: center; gap: 22px; padding: 18px 22px; margin-bottom: 14px; }
.plan-ring { --p: 0; flex: none; width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(closest-side, #1a3d2f 80%, transparent 81% 100%), conic-gradient(#f2b24c calc(var(--p) * 1%), rgba(255, 255, 255, .15) 0); }
.plan-ring b { font: 600 17px var(--display); letter-spacing: -.03em; color: #fff; font-variant-numeric: tabular-nums; }
.plan-ring b small { font-size: 11px; margin-left: 1px; color: rgba(255, 255, 255, .75); }
.plan-top-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.plan-top-text h1 { margin: 0; font-size: 24px; }
.plan-top-text p { font-size: 13.5px; }
.plan-next { flex: none; display: inline-flex; align-items: center; gap: 14px; max-width: 360px; padding: 10px 14px 10px 16px; border-radius: 14px; border: 0; background: #fff; color: #173327; text-align: left; font: inherit; cursor: pointer; box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .5); transition: transform .15s var(--ease); }
.plan-next:hover { text-decoration: none; transform: translateY(-1px); }
.plan-next span { display: grid; gap: 1px; min-width: 0; }
.plan-next small { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #a5620a; }
.plan-next b { font-size: 14px; line-height: 1.3; }
.plan-next .ico { flex: none; color: #1f5c46; }
.plan-next.done small { color: #2b7a4b; }

.plan-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: stretch; }
.plan-list { list-style: none; margin: 0; padding: 6px; display: grid; align-content: start; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); position: relative; }
.plan-list button { position: relative; display: grid; grid-template-columns: 32px 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 6px; align-items: center; width: 100%; padding: 9px 10px; border: 0; border-radius: 11px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.plan-list button:hover { background: var(--surface-2); }
.plan-list button.sel { background: var(--accent-weak); }
.plan-list .num { grid-row: 1 / 3; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-strong); background: var(--surface); color: var(--muted); font: 600 13px var(--display); }
.plan-list .done .num { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.plan-list .current .num { border-color: var(--sun); background: var(--sun-weak); color: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sun) 20%, transparent); }
.plan-list li + li::before { content: ''; position: absolute; margin: -12px 0 0 25px; width: 2px; height: 14px; background: var(--border-strong); }
.plan-list li { position: relative; }
.plan-list .name { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.plan-list .name b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-list .name small { flex: none; font-size: 12px; color: var(--muted); }
.plan-list .current .name small { color: var(--warn); font-weight: 600; }
.plan-list .bar { height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.plan-list .bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.plan-detail { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
/* Высоту карточки подгоняет fitToViewport; прокручиваются только шаги, шапка и переходы остаются на месте. */
.plan-detail.fit { overflow: hidden; }
.plan-detail-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.plan-detail-head .num { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--sun-weak); color: var(--warn); font: 600 15px var(--display); }
.plan-detail.done .plan-detail-head .num { background: var(--accent-weak); color: var(--accent); }
.plan-detail-head h2 { margin: 0; font-size: 18px; }
.plan-detail-head small { color: var(--muted); font-size: 12.5px; }
.plan-detail-body { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; display: grid; align-content: start; gap: 12px; padding: 14px 20px; }
.plan-detail-foot { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); }
.plan-qs { display: grid; gap: 8px; }
.plan-q { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); }
.plan-q .ico { color: var(--accent); flex: none; }
.plan-q .text { flex: 1; font-weight: 500; }
.plan-q.need { background: var(--sun-weak); }
.plan-q.need .ico { color: var(--warn); }
.plan-steps { list-style: none; margin: 0; padding: 0; display: grid; }
.plan-step { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.plan-step:first-child { border-top: 0; }
.plan-step .st { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-strong); }
.plan-step.ok .st { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.plan-step.off .st { border-style: dashed; }
.plan-step.next .st { border-color: var(--sun); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sun) 20%, transparent); }
.plan-step .body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.plan-step .title { font-weight: 500; color: var(--text); }
.plan-step.ok .title { color: var(--text-2); }
.plan-step.off .title { color: var(--muted); }
.plan-step small { font-size: 12.5px; color: var(--muted); }
.plan-step.next small { color: var(--warn); font-weight: 600; }
@media (max-width: 960px) {
  .plan-top { flex-wrap: wrap; }
  .plan-next { max-width: none; width: 100%; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-step { flex-wrap: wrap; }
}
.progress { height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--sun))); transition: width .6s var(--ease); }
.stale { color: var(--warn); font-size: 12px; }

/* Главная */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 26px 30px 30px; margin-bottom: 18px; color: #fff; background: radial-gradient(700px 300px at 100% 0%, #2f8062 0%, transparent 65%), linear-gradient(135deg, #1e4a39, #13291f); box-shadow: var(--shadow); }
body.mgmt .hero { background: radial-gradient(700px 300px at 100% 0%, #6457d0 0%, transparent 65%), linear-gradient(135deg, #2f2860, #1a1633); }
.hero .contours { color: #c9ecd8; }
.hero .forest { height: 54px; color: rgba(5, 15, 10, .45); }
.hero > *:not(.contours):not(.forest) { position: relative; }
.hero .eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #f2b24c; font-weight: 600; }
.hero h1 { font-size: 30px; margin: 6px 0 4px; color: #fff; }
.hero p { color: rgba(255, 255, 255, .72); margin: 0; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px 34px; margin-top: 22px; }
.hero-stats div b { display: block; font: 600 24px var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.hero-stats div span { font-size: 12.5px; color: rgba(255, 255, 255, .66); }
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.dash > .card { margin: 0; }
.dash .c8 { grid-column: span 8; } .dash .c7 { grid-column: span 7; } .dash .c6 { grid-column: span 6; } .dash .c5 { grid-column: span 5; } .dash .c4 { grid-column: span 4; } .dash .c12 { grid-column: span 12; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 9px; }
.card-head h2 .ico { color: var(--accent); }
.big-num { font: 600 30px var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.delta.up { color: var(--ok); background: var(--ok-weak); } .delta.down { color: var(--bad); background: var(--bad-weak); }
.attn { display: flex; flex-direction: column; gap: 6px; }
.attn a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text); border: 1px solid var(--border); background: var(--surface); transition: border-color .12s, background .12s, transform .12s var(--ease); }
.attn a:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-weak); }
.attn a .ico-wrap { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.attn a.hot .ico-wrap { background: var(--sun-weak); color: var(--sun); }
.attn a .n { margin-left: auto; font: 600 18px var(--display); font-variant-numeric: tabular-nums; }
.attn a.zero { opacity: .55; }
.attn a.zero .n { color: var(--muted); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-stats > div { padding: 12px; border-radius: 12px; background: var(--surface-2); }
.mini-stats b { display: block; font: 600 20px var(--display); font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: 12px; color: var(--muted); }
.appeal-row { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px dashed var(--border); color: var(--text); }
.appeal-row:last-child { border-bottom: none; }
.appeal-row:hover { text-decoration: none; }
.appeal-row:hover .t { color: var(--accent); }
.appeal-row .num { font: 600 12px var(--mono); color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 3px 7px; align-self: start; }
.appeal-row .t { font-weight: 600; }
.appeal-row .txt { grid-column: 2 / 4; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appeal-row small { grid-column: 2 / 4; color: var(--muted); }

.stub-page { position: relative; overflow: hidden; text-align: center; padding: 64px 24px 90px; }
.stub-page .contours { color: var(--accent); }
.stub-page .forest { height: 60px; color: var(--surface-3); }
.stub-page > *:not(.contours):not(.forest) { position: relative; }
.stub-page .big-ico { width: 72px; height: 72px; border-radius: 22px; display: inline-grid; place-items: center; background: var(--accent-weak); color: var(--accent); margin-bottom: 14px; }
.stub-page p { max-width: 460px; margin: 0 auto 8px; color: var(--muted); }

.fin-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(220px, 1fr); gap: 24px; align-items: end; }
@media (max-width: 640px) { .fin-grid { grid-template-columns: 1fr; } .big-num { font-size: 26px; } }
@media (max-width: 1100px) { .dash .c8, .dash .c7, .dash .c6, .dash .c5, .dash .c4 { grid-column: span 12; } }
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; width: 280px; transform: translateX(-100%); transition: transform .25s var(--ease); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-toggle { display: inline-grid; }
  .topnav { display: none; }
  .mobile-secs { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 0; }
  .mobile-secs a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--side-line); color: var(--side-text); font-size: 12.5px; }
  .split { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .topbar { padding: 8px 12px; }
  .topbar select { min-width: 0; max-width: 46vw; }
  .user-chip .who { display: none; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 24px; min-height: 0; }
  .auth-art .pitch { margin-bottom: 70px; }
  .auth-art .facts { display: none; }
  .hero { padding: 20px; }
  .hero h1 { font-size: 24px; }
}
.split > *, .grid2 > *, .main { min-width: 0; }
.card .row.between > div:first-child { min-width: 0; flex: 1 1 260px; }

/* ---------- Анимации входа (public/shared/auth-fx.js) ---------- */
@property --r { syntax: '<length>'; inherits: false; initial-value: 0px; }
.auth-art > *:not(.scene) { position: relative; z-index: 1; }
.auth-art .pitch h1, .auth-art .pitch p { text-shadow: 0 2px 18px rgba(5, 12, 9, .55); }
body.mgmt .auth-art .pitch h1, body.mgmt .auth-art .pitch p { text-shadow: 0 2px 18px rgba(10, 8, 25, .6); }
.scene { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.scene .contours { color: #bfe6cf; }
body.mgmt .scene .contours { color: #b9b0ff; }
.scene .contours g { stroke-width: .55; }
.auth-art:has(.scene) .pitch { margin-bottom: clamp(150px, 26vh, 240px); }
.scene .contours path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: topo-draw 2.8s cubic-bezier(.6, .1, .2, 1) forwards; animation-delay: calc(var(--i) * 70ms); }
.scene .contours svg { animation: topo-breathe 18s ease-in-out infinite alternate; transform-origin: 70% 20%; }
@keyframes topo-draw { to { stroke-dashoffset: 0; } }
@keyframes topo-breathe { to { transform: scale(1.06) rotate(1.2deg); } }
.scene-sky { position: absolute; inset: 0; width: 100%; height: 100%; animation: fade 2s ease both; }
.scene-moon { position: absolute; top: 11%; right: 13%; width: 58px; height: 58px; border-radius: 50%; box-shadow: inset -14px 6px 0 0 #f6ecd2; transform: rotate(-18deg); filter: drop-shadow(0 0 18px rgba(246, 236, 210, .45)); animation: moon-rise 2.4s cubic-bezier(.2, .8, .2, 1) both .3s; }
@keyframes moon-rise { from { opacity: 0; transform: translateY(40px) rotate(-40deg); } }
.scene-land { position: absolute; left: -4%; right: -4%; bottom: 0; height: clamp(170px, 31%, 290px); }
.scene-land .layer { position: absolute; inset: 0; will-change: transform; animation: land-up 1.6s cubic-bezier(.2, .8, .2, 1) both; }
.scene-land .layer svg { display: block; }
.scene-land .far { color: #1d4435; animation-delay: .1s; }
.scene-land .vil { color: #132e23; animation-delay: .25s; }
.scene-land .mid { color: #0c1d16; animation-delay: .4s; }
.scene-land .front { color: #06100b; animation-delay: .55s; }
.scene-land .front svg { transform-origin: 50% 100%; animation: sway 7s ease-in-out infinite alternate; }
.scene-land path, .scene-land rect.v-house { fill: currentColor; }
body.mgmt .scene-land .far { color: #2b2458; opacity: .8; }
body.mgmt .scene-land .mid { color: #1b1740; }
body.mgmt .scene-land .front { color: #0e0b22; }
@keyframes land-up { from { transform: translateY(40%); opacity: 0; } }
@keyframes sway { from { transform: skewX(-.8deg); } to { transform: skewX(.9deg); } }
.scene-land .win { fill: #f2b24c; opacity: .07; transition: opacity .9s ease; }
.scene-land .win.on { opacity: 1; filter: drop-shadow(0 0 4px #f2b24c); }
.scene-land .win.flash { animation: win-flash .7s ease; }
@keyframes win-flash { 0% { fill: #fff6dc; } 100% { fill: #f2b24c; } }
.scene-land .smoke circle { fill: #9fb8ad; opacity: 0; filter: blur(1.5px); transform-box: fill-box; transform-origin: center; animation: smoke 4.5s ease-out infinite; animation-delay: calc(var(--d) + var(--k) * 1.5s); }
@keyframes smoke { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 20% { opacity: .22; } 100% { opacity: 0; transform: translate(14px, -46px) scale(2.2); } }

/* Появление текста и знака */
.auth-art .brand { animation: fade .8s ease both .2s; }
.auth-art .brand .logo-mark path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: topo-draw 1.1s ease forwards .5s; }
.auth-art .brand .logo-mark circle { transform-box: fill-box; transform-origin: center; animation: sun-pop .7s cubic-bezier(.3, 1.8, .5, 1) both 1.3s; }
@keyframes sun-pop { from { transform: scale(0); } }
.auth-art .pitch h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.auth-art .pitch h1 .w > span { display: inline-block; animation: word-up .9s cubic-bezier(.2, .9, .2, 1) both; animation-delay: calc(.45s + var(--i) * 65ms); }
.auth-art .pitch h1 em .w > span { animation-name: word-up, shimmer-text; animation-duration: .9s, 5s; animation-delay: calc(.45s + var(--i) * 65ms), 2.2s; animation-iteration-count: 1, infinite;
  background: linear-gradient(100deg, #f2b24c 40%, #ffe7b0 50%, #f2b24c 60%) 0 0 / 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes word-up { from { transform: translateY(105%) rotate(4deg); } }
@keyframes shimmer-text { 0% { background-position: 100% 0; } 40%, 100% { background-position: 0 0; } }
.auth-art .pitch p { animation: rise .9s ease both 1.1s; }
.auth-art .facts > div { animation: rise .8s ease both; }
.auth-art .facts > div:nth-child(1) { animation-delay: 1.3s; } .auth-art .facts > div:nth-child(2) { animation-delay: 1.42s; } .auth-art .facts > div:nth-child(3) { animation-delay: 1.54s; }

/* Карточка входа: каскад, наклон за курсором, подсветка края */
.auth .card { position: relative; transition: transform .25s ease-out; transform-style: preserve-3d; animation: card-in .9s cubic-bezier(.2, .9, .2, 1) backwards .15s; }
.auth .card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), var(--accent), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.auth .card:hover::after { opacity: 1; }
.auth .card > * { animation: rise .7s cubic-bezier(.2, .9, .2, 1) both; animation-delay: calc(.35s + var(--i, 0) * 90ms); }
.auth .card .form-grid > * { animation: rise .6s ease both; animation-delay: calc(.55s + var(--j, 0) * 80ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(30px) scale(.96); filter: blur(6px); } }
.auth .card.shake { animation: shake .5s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake { 20%, 80% { transform: translateX(-3px); } 30%, 50%, 70% { transform: translateX(7px); } 40%, 60% { transform: translateX(-7px); } }
.auth .card form .btn.primary { position: relative; overflow: hidden; }
.auth .card form .btn.primary::before { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-100%); }
.auth .card form .btn.primary:hover::before { transition: transform .8s ease; transform: translateX(100%); }
.auth .card form .btn.primary.busy { color: transparent; }
.auth .card form .btn.primary.busy::after { content: ''; position: absolute; width: 18px; height: 18px; left: calc(50% - 9px); top: calc(50% - 9px); border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Переход в приложение: общий каркас */
.entry { position: fixed; inset: 0; z-index: 1000; overflow: hidden; color: #fff; clip-path: circle(0 at var(--ox) var(--oy)); transition: clip-path .6s cubic-bezier(.7, 0, .3, 1);
  background: radial-gradient(900px 520px at 50% 38%, #2c7a5a 0%, transparent 65%), linear-gradient(180deg, #0c1a14, #16322a 45%, #0a1510); }
.entry.in { clip-path: circle(150vmax at var(--ox) var(--oy)); }
.entry.out { clip-path: none; -webkit-mask: radial-gradient(circle at 50% 46%, transparent var(--r), #000 calc(var(--r) + 60px)); mask: radial-gradient(circle at 50% 46%, transparent var(--r), #000 calc(var(--r) + 60px)); animation: entry-hole .9s cubic-bezier(.7, 0, .3, 1) forwards; }
@keyframes entry-hole { from { --r: 0px; } to { --r: 150vmax; } }
.entry-hello { position: absolute; left: 0; right: 0; top: 46%; transform: translateY(-50%); display: grid; justify-items: center; gap: 10px; text-align: center; opacity: 0; }
.entry-hello .logo-mark { margin-bottom: 8px; filter: drop-shadow(0 10px 30px rgba(242, 178, 76, .35)); }
.entry-hello .logo-mark path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.entry-hello h2 { font: 600 clamp(26px, 4vw, 40px)/1.1 var(--display); letter-spacing: -.02em; }
.entry-hello p { color: rgba(255, 255, 255, .7); }
.entry.push .entry-hello { animation: hello-in .8s cubic-bezier(.2, .9, .2, 1) forwards; }
.entry.push .entry-hello .logo-mark path { animation: topo-draw .9s ease forwards .15s; }
.entry.out .entry-hello { animation: hello-out .6s ease forwards; }
@keyframes hello-in { from { opacity: 0; transform: translateY(-50%) scale(.85); filter: blur(8px); } to { opacity: 1; transform: translateY(-50%); filter: none; } }
@keyframes hello-out { from { opacity: 1; transform: translateY(-50%); } to { opacity: 0; transform: translateY(-50%) scale(1.25); filter: blur(6px); } }

/* Посёлок: въезд через КПП (сцена на холсте) + HUD распознавания номера */
.entry-village { background: #08120e; }
.entry-village .entry-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.entry-village.push .entry-canvas { transition: opacity 1s ease .3s; }
.kpp-hud { position: absolute; left: 50%; bottom: 9%; transform: translate(-50%, 16px); display: grid; justify-items: center; gap: 10px; opacity: 0; transition: opacity .35s ease, transform .5s cubic-bezier(.2, .9, .2, 1); font-size: 13px; }
.entry.scan .kpp-hud { opacity: 1; transform: translate(-50%, 0); }
.entry.go .kpp-hud { opacity: 0; transform: translate(-50%, 24px) scale(.96); transition-duration: .4s; }
.kpp-hud .plate { position: relative; display: flex; align-items: stretch; background: #f4f4ef; color: #111; border: 2px solid #111; border-radius: 6px; font: 600 26px/1 var(--mono); letter-spacing: .06em; box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), 0 12px 40px rgba(0, 0, 0, .5); }
.kpp-hud .plate .num { padding: 7px 14px 6px; white-space: nowrap; }
.kpp-hud .hud-line, .kpp-hud .hud-who { white-space: nowrap; }
@media (max-width: 520px) { .kpp-hud { font-size: 12px; } .kpp-hud .plate { font-size: 21px; } }
.kpp-hud .plate .reg { display: grid; place-items: center; padding: 3px 8px; border-left: 2px solid #111; font-size: 17px; line-height: 1; }
.kpp-hud .plate .reg small { font: 600 8px var(--font, sans-serif); letter-spacing: .1em; }
/* Рамка распознавания и бегущая строка сканера */
.kpp-hud .plate::before { content: ''; position: absolute; inset: -12px -16px; border: 2px solid transparent; border-radius: 10px; pointer-events: none;
  background: linear-gradient(#5fe39a, #5fe39a) top left / 18px 2px no-repeat, linear-gradient(#5fe39a, #5fe39a) top left / 2px 18px no-repeat, linear-gradient(#5fe39a, #5fe39a) top right / 18px 2px no-repeat, linear-gradient(#5fe39a, #5fe39a) top right / 2px 18px no-repeat,
    linear-gradient(#5fe39a, #5fe39a) bottom left / 18px 2px no-repeat, linear-gradient(#5fe39a, #5fe39a) bottom left / 2px 18px no-repeat, linear-gradient(#5fe39a, #5fe39a) bottom right / 18px 2px no-repeat, linear-gradient(#5fe39a, #5fe39a) bottom right / 2px 18px no-repeat;
  filter: drop-shadow(0 0 6px rgba(95, 227, 154, .8)); animation: hud-lock .5s cubic-bezier(.2, .9, .2, 1) both; }
.entry.scan .kpp-hud .plate::before { animation-name: hud-lock; }
@keyframes hud-lock { from { inset: -40px -60px; opacity: 0; } }
.kpp-hud .plate::after { content: ''; position: absolute; left: -6px; right: -6px; height: 2px; top: 0; background: #5fe39a; box-shadow: 0 0 12px 3px rgba(95, 227, 154, .8); animation: hud-scan .45s ease-in-out infinite alternate; }
.entry.ok .kpp-hud .plate::after { animation: none; opacity: 0; transition: opacity .2s; }
@keyframes hud-scan { from { top: 0; } to { top: calc(100% - 2px); } }
.kpp-hud .hud-line { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: rgba(8, 18, 14, .6); border: 1px solid rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; font-weight: 500; }
.kpp-hud .dot { width: 8px; height: 8px; border-radius: 50%; background: #f2b24c; box-shadow: 0 0 10px #f2b24c; animation: hud-blink .5s steps(2) infinite; }
.entry.ok .kpp-hud .dot { background: #5fe39a; box-shadow: 0 0 12px #5fe39a; animation: none; }
@keyframes hud-blink { 50% { opacity: .3; } }
.kpp-hud .st.ok, .entry.ok .kpp-hud .st.scan { display: none; }
.entry.ok .kpp-hud .st.ok { display: inline; animation: fade .3s ease; }
.kpp-hud .hud-who { color: rgba(255, 255, 255, .6); font-size: 12px; }

/* Management: облёт контура, частицы собираются в знак */
.entry-network { background: #0b0920; }
.entry-canvas { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform 1.2s cubic-bezier(.6, 0, .3, 1), opacity 1s ease; }
.entry-network.out .entry-canvas { transform: scale(1.4); opacity: 0; }
/* Знак не анимируется трансформами: частицы собираются точно в его прямоугольник, затем он проявляется */
.entry-network .entry-hello { opacity: 1; top: 44%; }
.entry-network .entry-hello .logo-mark { --brand-mark: #5a4fc4; opacity: 0; transition: opacity .5s ease, filter .8s ease; filter: drop-shadow(0 0 0 rgba(170, 160, 255, 0)); }
.entry-network .entry-hello .logo-mark path { stroke-dashoffset: 0; }
.entry-network.push .entry-hello .logo-mark { opacity: 1; filter: drop-shadow(0 14px 50px rgba(170, 160, 255, .6)); transition-delay: .12s; }
.entry-network.push .entry-hello { animation: none; }
.entry-network .entry-hello h2, .entry-network .entry-hello p { opacity: 0; }
.entry-network.push .entry-hello h2 { animation: mg-text .8s cubic-bezier(.2, .9, .2, 1) forwards .2s; }
.entry-network.push .entry-hello p { animation: mg-text .8s cubic-bezier(.2, .9, .2, 1) forwards .32s; }
.entry-network.push .entry-hello .logo-mark path { animation: none; }
@keyframes mg-text { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.entry-network.out .entry-hello { animation: hello-out .6s ease forwards; }
.mg-hud { position: absolute; left: 32px; bottom: 32px; width: 290px; padding: 16px 18px; border-radius: 16px; color: #ecebff; font-size: 13px; background: rgba(16, 13, 38, .62); border: 1px solid rgba(185, 176, 255, .22); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  opacity: 0; transform: translateY(14px); transition: opacity .4s ease, transform .6s cubic-bezier(.2, .9, .2, 1); }
.entry.hud .mg-hud { opacity: 1; transform: none; }
.entry.go .mg-hud { opacity: 0; transform: translateY(18px); }
.mg-hud .mg-title { display: flex; align-items: center; gap: 8px; font: 600 10.5px var(--mono); letter-spacing: .12em; color: #b9b0ff; margin-bottom: 10px; }
.mg-hud .dot { width: 7px; height: 7px; border-radius: 50%; background: #f2b24c; box-shadow: 0 0 10px #f2b24c; animation: hud-blink .5s steps(2) infinite; }
.entry.linked .mg-hud .dot { background: #5fe39a; box-shadow: 0 0 10px #5fe39a; animation: none; }
.mg-hud ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.mg-hud li { display: flex; align-items: center; gap: 9px; color: rgba(236, 235, 255, .45); transition: color .3s; }
.mg-hud .tick { position: relative; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid rgba(185, 176, 255, .35); flex: none; transition: background .3s, border-color .3s, box-shadow .3s; }
.mg-hud .tick::after { content: ''; position: absolute; left: 4.5px; top: 2px; width: 4px; height: 7px; border: solid #0b0920; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .3s cubic-bezier(.3, 1.8, .5, 1); }
.entry.s1 .mg-hud li:nth-child(1), .entry.s2 .mg-hud li:nth-child(2), .entry.s3 .mg-hud li:nth-child(3), .entry.s4 .mg-hud li:nth-child(4) { color: #ecebff; }
.entry.s1 .mg-hud li:nth-child(1) .tick, .entry.s2 .mg-hud li:nth-child(2) .tick, .entry.s3 .mg-hud li:nth-child(3) .tick, .entry.s4 .mg-hud li:nth-child(4) .tick { background: #b9b0ff; border-color: #b9b0ff; box-shadow: 0 0 12px rgba(185, 176, 255, .7); }
.entry.s1 .mg-hud li:nth-child(1) .tick::after, .entry.s2 .mg-hud li:nth-child(2) .tick::after, .entry.s3 .mg-hud li:nth-child(3) .tick::after, .entry.s4 .mg-hud li:nth-child(4) .tick::after { transform: rotate(45deg) scale(1); }
.mg-hud .mg-status { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(185, 176, 255, .16); font-weight: 500; }
.mg-hud .st.ok, .entry.linked .mg-hud .st.scan { display: none; }
.entry.linked .mg-hud .st.ok { display: inline; color: #5fe39a; animation: fade .3s ease; }
.mg-hud .mg-who { margin-top: 4px; color: rgba(236, 235, 255, .5); font-size: 12px; }
@media (max-width: 520px) { .mg-hud { left: 16px; right: 16px; bottom: 16px; width: auto; } }

/* Приложение «приземляется» после перехода */
.app-landing .sidebar { animation: side-in-r .8s cubic-bezier(.2, .9, .2, 1) both .1s; }
.app-landing .topbar { animation: land-top .7s cubic-bezier(.2, .9, .2, 1) both .2s; }
.app-landing .content { animation: rise .8s cubic-bezier(.2, .9, .2, 1) both .3s; }
@keyframes land-top { from { opacity: 0; transform: translateY(-16px); } }

@media (max-width: 860px) {
  .auth-art:has(.scene) .pitch { margin: 28px 0 120px; }
  .scene-land { height: 150px; }
  .scene-moon { top: 20px; right: 20px; width: 34px; height: 34px; box-shadow: inset -8px 4px 0 0 #f6ecd2; }
}
@media (prefers-reduced-motion: reduce) {
  .scene *, .scene, .auth-art *, .auth .card, .auth .card > *, .auth .card .form-grid > *, .app-landing * { animation: none !important; transition: none !important; }
  .scene .contours path { stroke-dashoffset: 0; }
  .auth-art .brand .logo-mark path { stroke-dashoffset: 0; }
}
