/* ПРИЁМКА · админка v3. Работает в Safari, Chrome, Android WebView, Telegram Desktop:
   без color-mix()/inset, с запасными значениями для env(), сетки защищены от раздувания длинным текстом. */
:root {
  --bg: #f3f5fa; --bg-glass: rgba(243, 245, 250, .86); --surface: #ffffff; --surface-glass: rgba(255, 255, 255, .88); --surface2: #eef1f7;
  --line: rgba(17, 24, 39, .08); --text: #10131a; --muted: #6a7285; --faint: #9aa2b4;
  --a1: #4f6df5; --a2: #8b5cf6; --accent: #4f6df5; --accent-soft: rgba(79, 109, 245, .35);
  --good: #12b981; --bad: #ef4444; --warn: #f59e0b; --info: #3b82f6;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px -8px rgba(16, 24, 40, .12);
  --r: 18px; --nav-h: 68px;
}
:root[data-theme="dark"] {
  --bg: #0b0d12; --bg-glass: rgba(11, 13, 18, .86); --surface: #141822; --surface-glass: rgba(20, 24, 34, .9); --surface2: #1b2130;
  --line: rgba(255, 255, 255, .07); --text: #eef1f7; --muted: #8e97ab; --faint: #5e6678;
  --a1: #6d8bff; --a2: #a26bff; --accent: #6d8bff; --accent-soft: rgba(109, 139, 255, .38);
  --good: #34d399; --bad: #f87171; --warn: #fbbf24; --info: #60a5fa;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .55);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; overscroll-behavior-y: contain; }
button, input, textarea, select { font: inherit; color: inherit; }
button { -webkit-appearance: none; appearance: none; }
b, .num { font-variant-numeric: tabular-nums; }
#app { max-width: 780px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--nav-h) + 40px); padding-bottom: calc(var(--nav-h) + 40px + env(safe-area-inset-bottom)); }

/* --- шапка --- */
.appbar { position: -webkit-sticky; position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 10px; padding-top: calc(14px + env(safe-area-inset-top)); background: var(--bg); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) { .appbar { background: var(--bg-glass); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); } }
.appbar > div:first-child { min-width: 0; margin-right: 12px; }
.appbar h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; line-height: 1.15; }
.appbar small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar .right { display: flex; align-items: center; flex: none; }
.appbar .right > * + * { margin-left: 8px; }
.ibtn { width: 38px; height: 38px; border: 0; padding: 0; border-radius: 50%; background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s; }
.ibtn:active { transform: scale(.92); }
.ibtn.spin svg { animation: spin .8s linear infinite; }
.me { height: 38px; padding: 0 12px 0 4px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow); display: flex; align-items: center; font-size: 13px; font-weight: 600; max-width: 150px; }
.me .av { margin-right: 8px; }
.me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { display: none; }

main { padding: 6px 16px 16px; display: grid; grid-template-columns: minmax(0, 1fr); grid-gap: 16px; gap: 16px; }
main > * { min-width: 0; animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }

/* --- карточки и заголовки --- */
.card { background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 4px 16px; }
.sec { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 4px -6px; }
.sec h2 { margin: 0; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.sec a { color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; }
.ttl { font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.muted { color: var(--muted); } .good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.center { text-align: center; padding: 36px 12px; color: var(--muted); }
.empty { text-align: center; padding: 34px 12px; color: var(--muted); }
.empty i { display: block; font-style: normal; font-size: 38px; margin-bottom: 6px; }
.wrap { overflow-wrap: anywhere; word-break: break-word; }

/* --- главный блок --- */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 20px; color: #fff; background: #6d5cf6; background: -webkit-linear-gradient(315deg, var(--a1), var(--a2)); background: linear-gradient(135deg, var(--a1), var(--a2)); box-shadow: 0 18px 40px -16px rgba(120, 90, 240, .6); }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .13); }
.hero::before { width: 190px; height: 190px; right: -50px; top: -70px; }
.hero::after { width: 120px; height: 120px; right: 60px; bottom: -60px; background: rgba(255, 255, 255, .08); }
.hero > * { position: relative; z-index: 1; }
.hero .lbl { font-size: 13px; opacity: .9; display: flex; align-items: center; flex-wrap: wrap; }
.hero .lbl .delta { margin-left: 8px; }
.hero .big { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 6px 0 2px; overflow-wrap: anywhere; }
.hero .row { display: flex; margin-top: 14px; }
.hero .mini { flex: 1 1 0; min-width: 0; background: rgba(255, 255, 255, .16); border-radius: 14px; padding: 10px 12px; }
.hero .mini + .mini { margin-left: 10px; }
.hero .mini b { display: block; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero .mini span { font-size: 12px; opacity: .88; }
.delta { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .22); }

/* --- плитки --- */
.grid { display: grid; grid-gap: 12px; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { background: var(--surface); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.kpi .ic { position: relative; z-index: 0; width: 34px; height: 34px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 17px; margin-bottom: 8px; overflow: hidden; }
.kpi .ic::before { content: ""; position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; left: 0; background: var(--c, var(--accent)); opacity: .16; }
.kpi .v { font-size: 22px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.kpi .l { font-size: 12.5px; color: var(--muted); }
.kpi .s { font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }

/* --- предупреждения --- */
.alerts { display: grid; grid-template-columns: minmax(0, 1fr); grid-gap: 8px; gap: 8px; }
.alert { position: relative; z-index: 0; display: flex; align-items: center; padding: 11px 14px; border-radius: 14px; font-weight: 600; font-size: 14px; cursor: pointer; background: var(--surface); color: var(--text); overflow: hidden; }
.alert::before { content: ""; position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; left: 0; background: var(--c); opacity: .13; }
.alert::after { content: ""; position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; left: 0; border: 1px solid var(--c); opacity: .4; border-radius: 14px; }
.alert.bad { --c: var(--bad); } .alert.warn { --c: var(--warn); } .alert.good { --c: var(--good); }
.alert i { font-style: normal; margin-right: 10px; }
.alert .go { margin-left: auto; opacity: .5; padding-left: 8px; }

/* --- переключатели и фильтры --- */
.seg { display: flex; padding: 4px; background: var(--surface2); border-radius: 13px; }
.seg button { flex: 1 1 0; min-width: 0; border: 0; background: none; padding: 8px 6px; border-radius: 10px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: .18s; }
.seg button + button { margin-left: 2px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.chips { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.chips::-webkit-scrollbar { display: none; }
.chips > * + * { margin-left: 8px; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 99px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; transition: .15s; }
.chip.on { background: #6d5cf6; background: linear-gradient(135deg, var(--a1), var(--a2)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -8px var(--a2); }
.search { position: relative; }
.search input { padding-left: 40px; }
.search svg { position: absolute; left: 13px; top: 50%; margin-top: -9px; color: var(--faint); pointer-events: none; }

/* --- поля и кнопки --- */
input, textarea, select { width: 100%; background: var(--surface2); border: 1.5px solid transparent; border-radius: 13px; padding: 12px 14px; outline: none; transition: border-color .15s, background .15s; -webkit-appearance: none; appearance: none; }
input:focus, textarea:focus { border-color: var(--accent); background: var(--surface); }
textarea { resize: vertical; min-height: 84px; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 12px 2px 6px; }
.btn { border: 0; border-radius: 13px; padding: 12px 16px; font-weight: 700; cursor: pointer; color: #fff; background: #6d5cf6; background: linear-gradient(135deg, var(--a1), var(--a2)); box-shadow: 0 8px 18px -10px var(--a2); transition: transform .12s, opacity .15s; display: inline-flex; align-items: center; justify-content: center; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.alt { background: var(--surface2); color: var(--text); box-shadow: none; }
.btn.danger { background: var(--bad); box-shadow: 0 8px 18px -10px var(--bad); }
.btn.good { background: var(--good); box-shadow: 0 8px 18px -10px var(--good); }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 11px; }
.btn.block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; margin: 14px -4px -4px; }
.actions > * { margin: 4px; }
.switch { position: relative; width: 52px; height: 30px; flex: none; display: block; margin: 0; }
.switch input { opacity: 0; position: absolute; top: 0; left: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 99px; background: var(--faint); transition: .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: .2s; }
.switch input:checked + i { background: var(--good); }
.switch input:checked + i::after { transform: translateX(22px); }

/* --- списки --- */
.item { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; transition: opacity .15s; min-width: 0; }
.item > * + * { margin-left: 12px; }
.item:last-child { border-bottom: 0; }
.item:active { opacity: .6; }
.item .grow { flex: 1 1 0; min-width: 0; }
.item .t { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .d { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .end { flex: none; text-align: right; font-weight: 700; white-space: nowrap; max-width: 46%; }
.item .end .d { font-weight: 500; }
.item.stripe { position: relative; padding-left: 14px; }
.item.stripe::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 4px; background: var(--c, var(--faint)); }
.av { flex: none; width: 42px; height: 42px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 15px; background: #6d8bff; background: linear-gradient(135deg, var(--h1, #6d8bff), var(--h2, #a26bff)); }
.av.lg { width: 56px; height: 56px; border-radius: 18px; font-size: 20px; }
.av.sm { width: 34px; height: 34px; border-radius: 11px; font-size: 13px; }
.badge { position: relative; z-index: 0; display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; color: var(--c, var(--muted)); overflow: hidden; white-space: nowrap; }
.badge::before { content: ""; position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; left: 0; background: currentColor; opacity: .14; }
.badge.done { --c: var(--good); } .badge.cancelled, .badge.expired { --c: var(--bad); } .badge.active { --c: var(--info); } .badge.warn { --c: var(--warn); }
.badge.ban { background: var(--bad); color: #fff; } .badge.ban::before { display: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--info); position: relative; flex: none; }
.dot::after { content: ""; position: absolute; top: -4px; right: -4px; bottom: -4px; left: -4px; border-radius: 50%; border: 2px solid var(--info); opacity: 0; animation: ping 1.6s infinite; }

/* --- ключ-значение --- */
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-gap: 9px 14px; gap: 9px 14px; }
.kv > :nth-child(odd) { color: var(--muted); min-width: 0; }
.kv > :nth-child(even) { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }

/* --- графики --- */
.chart { position: relative; touch-action: pan-y; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .tip { position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; background: var(--text); color: var(--bg); border-radius: 10px; padding: 6px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; opacity: 0; transition: opacity .12s; z-index: 2; }
.chart .tip.show { opacity: 1; }
.donut-wrap { display: flex; align-items: center; }
.donut { position: relative; width: 120px; height: 120px; flex: none; border-radius: 50%; margin-right: 18px; }
.donut::after { content: ""; position: absolute; top: 18px; right: 18px; bottom: 18px; left: 18px; border-radius: 50%; background: var(--surface); }
.donut b { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1; font-size: 20px; line-height: 1.1; text-align: center; }
.donut b small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.legend { flex: 1 1 0; min-width: 0; font-size: 13.5px; }
.legend div { display: flex; align-items: center; margin: 6px 0; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; margin-right: 8px; }
.legend span { margin-left: auto; padding-left: 8px; font-weight: 700; }
.hours { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); grid-gap: 3px; gap: 3px; align-items: end; height: 74px; }
.hours i { background: var(--accent-soft); border-radius: 4px 4px 2px 2px; min-height: 3px; }
.hours i.hot { background: #6d5cf6; background: linear-gradient(180deg, var(--a1), var(--a2)); }
.hours-l { display: flex; justify-content: space-between; color: var(--faint); font-size: 11px; margin-top: 4px; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-gap: 5px 10px; gap: 5px 10px; margin: 11px 0; font-size: 14px; }
.bar .tr { grid-column: 1 / -1; height: 7px; border-radius: 7px; background: var(--surface2); overflow: hidden; }
.bar .tr i { display: block; height: 100%; border-radius: 7px; background: #6d5cf6; background: linear-gradient(90deg, var(--a1), var(--a2)); }

/* --- этапы и история заявки --- */
.steps { display: flex; align-items: flex-start; margin: 14px 0 6px; }
.steps .st { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; font-size: 10.5px; color: var(--faint); position: relative; text-align: center; }
.steps .st::before { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 3px; background: var(--surface2); z-index: 0; }
.steps .st:first-child::before { display: none; }
.steps .st i { width: 20px; height: 20px; margin-bottom: 4px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 11px; font-style: normal; z-index: 1; color: var(--muted); }
.steps .st.on { color: var(--text); } .steps .st.on i { background: #6d5cf6; background: linear-gradient(135deg, var(--a1), var(--a2)); color: #fff; } .steps .st.on::before { background: var(--a1); }
.tl { position: relative; margin: 4px 0 0; padding-left: 22px; }
.tl::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl .ev { position: relative; padding: 7px 0 9px; }
.tl .ev::before { content: ""; position: absolute; left: -21px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 3px var(--surface); }
.tl .ev.good::before { background: var(--good); } .tl .ev.bad::before { background: var(--bad); } .tl .ev.info::before { background: var(--info); } .tl .ev.warn::before { background: var(--warn); }
.tl .ev .h { display: flex; justify-content: space-between; font-weight: 650; }
.tl .ev .h span { color: var(--muted); font-weight: 500; font-size: 12.5px; white-space: nowrap; margin-left: 10px; }
.tl .ev .s { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-gap: 8px; gap: 8px; margin-top: 12px; }
.facts div { background: var(--surface); border-radius: 14px; padding: 10px; text-align: center; box-shadow: var(--shadow); }
.facts b { display: block; font-size: 15px; } .facts span { font-size: 11.5px; color: var(--muted); }
.secret { font-size: 17px; font-weight: 700; letter-spacing: .02em; }
.copy { font-size: 12px; color: var(--accent); cursor: pointer; margin-left: 8px; font-weight: 600; }

/* --- чат --- */
.chat { background: var(--surface2); border-radius: 18px; padding: 12px 10px; margin: 12px 0 0; }
.msg { display: flex; margin: 4px 0; }
.msg.in { justify-content: flex-end; }
.bub { max-width: 82%; padding: 8px 12px; border-radius: 16px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
.msg.out .bub { background: var(--surface); border-bottom-left-radius: 5px; }
.msg.in .bub { color: #fff; background: #6d5cf6; background: linear-gradient(135deg, var(--a1), var(--a2)); border-bottom-right-radius: 5px; }
.msg.in.button .bub { background: var(--surface); color: var(--text); border: 1px dashed var(--faint); box-shadow: none; font-size: 13px; }
.bub small { display: block; font-size: 10.5px; opacity: .6; margin-top: 3px; text-align: right; }
.day { text-align: center; margin: 12px 0 6px; } .day span { display: inline-block; background: var(--surface); color: var(--muted); font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 99px; }

/* --- нижнее меню --- */
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 9; width: calc(100% - 24px); max-width: 520px; display: flex; padding: 6px; border-radius: 24px; background: var(--surface); box-shadow: 0 12px 40px -10px rgba(0, 0, 0, .35), 0 0 0 1px var(--line); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) { .nav { background: var(--surface-glass); -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5); } }
.nav button { flex: 1 1 0; min-width: 0; border: 0; background: none; color: var(--muted); padding: 8px 0 6px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; font-size: 11px; font-weight: 600; cursor: pointer; transition: .2s; position: relative; }
.nav button svg { margin-bottom: 3px; }
.nav button.on { color: #fff; background: #6d5cf6; background: linear-gradient(135deg, var(--a1), var(--a2)); box-shadow: 0 8px 18px -8px var(--a2); }
.nav .pip { position: absolute; top: 5px; right: 24%; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--surface); }

/* --- нижние окна --- */
.sheet-bg { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 30; background: rgba(5, 8, 15, .55); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
.sheet { position: relative; width: 100%; max-width: 780px; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--bg); border-radius: 26px 26px 0 0; padding: 12px 16px 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); animation: up .26s cubic-bezier(.2, .8, .2, 1); overscroll-behavior: contain; }
.sheet .grab { width: 44px; height: 5px; border-radius: 5px; background: var(--line); margin: 0 auto 14px; }
.sheet h3 { margin: 0; font-size: 20px; letter-spacing: -.01em; overflow-wrap: anywhere; padding-right: 44px; }
.sheet .block { background: var(--surface); border-radius: var(--r); padding: 14px 16px; margin-top: 12px; box-shadow: var(--shadow); min-width: 0; }
.sheet .block .ttl { margin-bottom: 8px; }
.sheet .head { display: flex; align-items: center; }
.sheet .head .av { margin-right: 14px; }
.sheet .head > div:last-child { min-width: 0; }
.sheet .x { position: absolute; right: 14px; top: 14px; }
.sheet .sec { margin-top: 18px; }

.toast { position: fixed; left: 50%; bottom: 100px; bottom: calc(var(--nav-h) + 34px + env(safe-area-inset-bottom)); transform: translate(-50%, 14px); z-index: 60; width: max-content; max-width: 92vw; padding: 12px 18px; border-radius: 16px; background: var(--text); color: var(--bg); font-weight: 600; text-align: center; opacity: 0; pointer-events: none; transition: .22s; box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .5); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--bad); color: #fff; }

.sk { background: var(--surface); background-image: -webkit-linear-gradient(left, var(--surface) 0%, var(--surface2) 50%, var(--surface) 100%); background-image: linear-gradient(90deg, var(--surface) 0%, var(--surface2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r); }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 2px 0; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 7px; background: var(--surface2); font-size: 12px; color: var(--muted); font-weight: 600; }
.ac-list { margin-top: 6px; }
.ac-list:not(:empty) { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.ac-item { display: flex; align-items: center; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line); min-width: 0; }
.ac-item:last-child { border-bottom: 0; }
.ac-item:active { opacity: .6; }
.ac-item .av { margin-right: 10px; }
.ac-item .grow { flex: 1 1 0; min-width: 0; }
.ac-item .t { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-item .d { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-item .tag { margin-left: 8px; flex: none; }
.login-card { max-width: 420px; margin: 40px auto; text-align: center; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(60px); opacity: .5; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 359px) { .hero .big { font-size: 32px; } .kpi .v { font-size: 19px; } .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .donut { width: 96px; height: 96px; margin-right: 12px; } .donut::after { top: 14px; right: 14px; bottom: 14px; left: 14px; } }
@media (min-width: 700px) { main { padding-left: 24px; padding-right: 24px; } .grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .chips { margin: 0; padding: 2px 0; } }

/* --- компьютер: боковое меню, окна по центру --- */
@media (min-width: 1000px) {
  #app { max-width: none; margin: 0; padding-left: 232px; padding-bottom: 40px; }
  .appbar, main { max-width: 880px; margin-left: auto; margin-right: auto; }
  .nav { top: 0; left: 0; bottom: 0; transform: none; width: 232px; max-width: none; flex-direction: column; justify-content: flex-start; border-radius: 0; padding: 18px 14px; box-shadow: 1px 0 0 var(--line); background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nav .brand { display: flex; align-items: center; font-weight: 800; letter-spacing: .04em; font-size: 16px; padding: 4px 8px 20px; }
  .nav .brand b { margin-left: 10px; }
  .nav .brand .lg { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, var(--a1), var(--a2)); }
  .nav button { flex: none; flex-direction: row; justify-content: flex-start; padding: 12px 14px; margin-bottom: 4px; font-size: 14.5px; }
  .nav button svg { margin: 0 12px 0 0; }
  .nav .pip { top: 14px; right: 14px; }
  .toast { bottom: 28px; }
  .sheet-bg { align-items: center; }
  .sheet { max-width: 640px; max-height: 88vh; border-radius: 26px; padding-bottom: 24px; }
  .grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
