/* Домашние счётчики — дизайн-система.
   Нейтральная тёплая база, один тёмный акцент для действий, цвет — только у ресурсов (сквозной: иконка, график, чип).
   Порядок ресурсов в стопке графика (свет, ХВС, газ, стоки, взнос, ГВС) проверен на различимость при дальтонизме. */
:root {
  color-scheme: light;
  --bg: #f4f4f1; --surface: #ffffff; --surface-2: #f8f8f6; --surface-3: #efefeb;
  --ink: #15181c; --ink-2: #4b525b; --muted: #80868e; --line: #e6e6e1; --line-2: #d9d9d3;
  --primary: #15181c; --primary-ink: #ffffff; --focus: #2a63d6; --link: #2156c2;
  --good: #137a37; --good-bg: #e7f4ea; --warn: #8d5a00; --warn-bg: #fdf1d8; --bad: #b42318; --bad-bg: #fdebe9;
  --grid: #ececE7; --axis: #cfcfc8;
  --r-power: #eda100; --r-cold: #2a78d6; --r-gas: #eb6834; --r-drain: #1baf7a; --r-fee: #6250d6; --r-hot: #e34948;
  --shadow: 0 1px 2px rgb(20 24 28 / .04), 0 2px 8px rgb(20 24 28 / .04);
  --shadow-lg: 0 10px 30px rgb(20 24 28 / .10), 0 2px 6px rgb(20 24 28 / .06);
  --radius: 16px; --radius-sm: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1115; --surface: #171b21; --surface-2: #1c2128; --surface-3: #232932;
    --ink: #eef1f4; --ink-2: #b6bdc6; --muted: #8a939d; --line: #262c34; --line-2: #313844;
    --primary: #eef1f4; --primary-ink: #111418; --focus: #6aa0ff; --link: #7fb0ff;
    --good: #4cc77a; --good-bg: #13291c; --warn: #f2b84b; --warn-bg: #33270f; --bad: #ff8a7f; --bad-bg: #3a1916;
    --grid: #232932; --axis: #39414c;
    --r-power: #c98500; --r-cold: #3987e5; --r-gas: #d95926; --r-drain: #199e70; --r-fee: #9085e9; --r-hot: #e66767;
    --shadow: 0 1px 2px rgb(0 0 0 / .3); --shadow-lg: 0 12px 32px rgb(0 0 0 / .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1115; --surface: #171b21; --surface-2: #1c2128; --surface-3: #232932;
  --ink: #eef1f4; --ink-2: #b6bdc6; --muted: #8a939d; --line: #262c34; --line-2: #313844;
  --primary: #eef1f4; --primary-ink: #111418; --focus: #6aa0ff; --link: #7fb0ff;
  --good: #4cc77a; --good-bg: #13291c; --warn: #f2b84b; --warn-bg: #33270f; --bad: #ff8a7f; --bad-bg: #3a1916;
  --grid: #232932; --axis: #39414c;
  --r-power: #c98500; --r-cold: #3987e5; --r-gas: #d95926; --r-drain: #199e70; --r-fee: #9085e9; --r-hot: #e66767;
  --shadow: 0 1px 2px rgb(0 0 0 / .3); --shadow-lg: 0 12px 32px rgb(0 0 0 / .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 28px 0 10px; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.num, .tab { font-variant-numeric: tabular-nums; }
.num { text-align: right; white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.pad { padding: 16px; }
.hide { display: none !important; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }

/* ---------- оболочка ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; }
.nav { display: flex; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 9px; color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none; }
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.nav a svg { width: 17px; height: 17px; }
.top .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); color: var(--ink-2); display: grid; place-items: center; font-weight: 650; font-size: 13px; }
main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }
.page-h { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-h .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* выбор месяца */
.month { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); height: 38px; }
.month button { border: 0; background: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--ink-2); padding: 0; }
.month button:hover { background: var(--surface-3); color: var(--ink); }
.month b { min-width: 128px; text-align: center; font-weight: 600; font-size: 14px; }
.month .now { font-size: 12px; color: var(--link); border-left: 1px solid var(--line); border-radius: 0 11px 11px 0; width: auto; padding: 0 12px; }

@media (max-width: 1120px) { .who .name { display: none; } }
@media (max-width: 980px) { .nav a span { display: none; } .nav a { padding: 8px 10px; } }

/* нижняя навигация на телефоне */
.tabbar { display: none; }
@media (max-width: 760px) {
  .top .nav, .who .name { display: none; }
  .top-in { padding: 10px 16px; }
  main { padding: 16px 16px 100px; }
  h1 { font-size: 22px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); text-decoration: none; padding: 4px 0; border-radius: 10px; }
  .tabbar a.on { color: var(--ink); font-weight: 600; }
  .tabbar a svg { width: 22px; height: 22px; }
}

/* ---------- поверхности ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-objs { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
@media (max-width: 1000px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .g-4 { grid-template-columns: 1fr 1fr; gap: 10px; } .card { padding: 16px; } }

/* показатели */
.hero { grid-column: span 2; display: flex; flex-direction: column; justify-content: space-between; min-height: 150px; background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.hero .lbl { opacity: .7; font-size: 13px; }
.hero .val { font-size: 46px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; margin-top: 8px; }
.hero .val small { font-size: 22px; font-weight: 600; opacity: .7; margin-left: 4px; }
.hero .delta { font-size: 13px; opacity: .8; margin-top: 10px; }
@media (max-width: 520px) { .hero .val { font-size: 36px; } }
.stat .lbl { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .val { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; line-height: 1.15; }
.stat .val small { font-size: 15px; color: var(--muted); font-weight: 600; }
.stat .foot { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.meter-bar { height: 6px; border-radius: 99px; background: var(--surface-3); margin-top: 12px; overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: 99px; background: var(--ink); transition: width .4s ease; }
.meter-bar.ok i { background: var(--good); }

/* ресурс: иконка в плашке своего цвета */
.res { --c: var(--muted); }
.res-power { --c: var(--r-power); } .res-cold { --c: var(--r-cold); } .res-gas { --c: var(--r-gas); }
.res-drain { --c: var(--r-drain); } .res-fee { --c: var(--r-fee); } .res-hot { --c: var(--r-hot); }
.res-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.res-ic svg { width: 21px; height: 21px; }
.res-ic.sm { width: 28px; height: 28px; border-radius: 8px; }
.res-ic.sm svg { width: 16px; height: 16px; }
.dot { width: 9px; height: 9px; border-radius: 3px; background: var(--c); display: inline-block; flex: none; }

/* чипы, бейджи */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 550; padding: 2px 9px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; line-height: 1.6; }
.badge svg { width: 13px; height: 13px; }
.badge.ok { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 9px 3px 7px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }

/* ---------- объекты на обзоре ---------- */
.obj { display: flex; flex-direction: column; gap: 14px; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.obj:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.obj .amt { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.obj .progress { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.obj .progress .meter-bar { flex: 1; margin: 0; }
.issues { display: flex; flex-direction: column; gap: 6px; }
.issue { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.issue svg { color: var(--warn); margin-top: 2px; }

/* ---------- график ---------- */
.chart-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .tick.on { fill: var(--ink); font-weight: 650; }
.chart .gl { stroke: var(--grid); stroke-width: 1; }
.chart .base { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover, .chart .hit.on { fill: color-mix(in srgb, var(--ink) 5%, transparent); }
.tip { position: absolute; pointer-events: none; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 12.5px; min-width: 190px; opacity: 0; transition: opacity .12s; }
.tip.on { opacity: 1; }
.tip .t { font-weight: 650; margin-bottom: 6px; }
.tip .r { display: flex; align-items: center; gap: 8px; padding: 1px 0; }
.tip .r b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.tip .sum { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }

/* ---------- таблицы ---------- */
.tbl-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
th, td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
tr.cur td { background: color-mix(in srgb, var(--focus) 6%, transparent); }
td.sticky, th.sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; }
tbody tr:hover td.sticky { background: var(--surface-2); }
td.cell { cursor: pointer; }
td.cell .v { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.st { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; }
.st svg { width: 12px; height: 12px; stroke-width: 2.6; }
.st.ok { background: var(--good-bg); color: var(--good); }
.st.warn { background: var(--warn-bg); color: var(--warn); }
.st.none { border: 1.5px dashed var(--line-2); }

/* ---------- формы ---------- */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 9px 11px; min-width: 0; width: 100%; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line-2)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
input:disabled { background: var(--surface-2); color: var(--muted); }
::placeholder { color: var(--muted); opacity: .7; }
input.changed { border-color: var(--focus); background: color-mix(in srgb, var(--focus) 5%, var(--surface)); }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
button { border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--radius-sm); padding: 8px 14px; cursor: pointer; white-space: nowrap; font-weight: 550; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background .12s, border-color .12s, transform .05s; }
a.btn { border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--radius-sm); padding: 8px 14px; white-space: nowrap; font-weight: 550; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; color: var(--ink); text-decoration: none; }
a.btn:hover { background: var(--surface-2); text-decoration: none; }
a.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
a.btn.icon { width: 34px; height: 34px; padding: 0; justify-content: center; }
button:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--ink) 25%, var(--line-2)); }
button:active { transform: translateY(1px); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button.pri { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
button.pri:hover { background: color-mix(in srgb, var(--primary) 86%, var(--bg)); }
button.ghost { border-color: transparent; background: none; color: var(--ink-2); }
button.ghost:hover { background: var(--surface-3); }
button.link { border: 0; background: none; color: var(--link); padding: 2px 4px; font-weight: 500; }
button.link:hover { text-decoration: underline; background: none; }
button.danger { color: var(--bad); }
button.icon { width: 34px; height: 34px; padding: 0; }
button:disabled { opacity: .5; cursor: default; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }

/* ---------- показания ---------- */
.objtabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin-bottom: 14px; scrollbar-width: none; }
.objtabs button { border-radius: 12px; padding: 9px 14px; gap: 9px; background: var(--surface); box-shadow: var(--shadow); border-color: var(--line); flex: none; }
.objtabs button.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.objtabs .cnt { font-size: 12px; opacity: .65; font-weight: 500; }
.ring { width: 16px; height: 16px; flex: none; }
.mrow { display: grid; grid-template-columns: 40px minmax(170px, 1.1fr) minmax(220px, 1.6fr) minmax(150px, .9fr); gap: 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.mrow:first-of-type { border-top: 0; padding-top: 4px; }
.mrow .ttl b { font-weight: 650; display: block; }
.mrow .ttl .xs { color: var(--muted); }
.mrow .ins { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.mrow .ins label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.mrow .ins input { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 9px 11px; }
.mrow .ins-wrap { display: flex; flex-direction: column; gap: 8px; }
.mrow .ins.start { padding: 8px; margin: -8px -8px 0; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-2); }
.mrow .ins.start input { font-weight: 500; }
.mrow .ttl .hist { display: block; padding: 2px 0 0; font-size: 12px; color: var(--link); }
.mrow .res-out { text-align: right; }
.mrow .res-out .amt { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.mrow .res-out .use { font-size: 12.5px; color: var(--muted); }
.mrow .calcline { grid-column: 2 / -1; font-size: 12.5px; color: var(--muted); margin-top: -6px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
@media (max-width: 760px) {
  .mrow { grid-template-columns: 40px 1fr auto; gap: 10px 12px; }
  .mrow .ins-wrap { grid-column: 1 / -1; order: 3; }
  .mrow .ins.start { margin: 0; }
  .mrow .calcline { grid-column: 1 / -1; order: 4; margin-top: 0; }
}
.savebar { position: sticky; bottom: 16px; z-index: 10; margin-top: 16px; display: flex; align-items: center; gap: 12px; background: var(--primary); color: var(--primary-ink); padding: 10px 10px 10px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); transform: translateY(8px); opacity: 0; pointer-events: none; transition: all .18s ease; }
.savebar.on { transform: none; opacity: 1; pointer-events: auto; }
.savebar button { background: var(--primary-ink); color: var(--primary); border: 0; }
.savebar button.ghost { background: transparent; color: var(--primary-ink); opacity: .75; }
@media (max-width: 760px) { .savebar { bottom: calc(76px + env(safe-area-inset-bottom)); } }
.obj-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 16px; }
.obj-foot .total { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }

/* ---------- уведомления ---------- */
.note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--warn-bg); color: var(--ink); margin-bottom: 16px; font-size: 14px; border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.note > svg { color: var(--warn); margin-top: 1px; }
.note.info { background: var(--surface); border-color: var(--line); }
.note.info > svg { color: var(--link); }
.note ul { margin: 6px 0 10px; padding-left: 18px; }

/* ---------- тарифы и объекты ---------- */
.sec-h { display: flex; align-items: center; gap: 10px; margin: 30px 0 12px; }
.sec-h h2 { font-size: 16px; }
.plan .card-h { margin-bottom: 8px; }
.plan table td, .plan table th { padding: 8px 10px; }
.plan tr.old td { color: var(--muted); }
.mlist { display: flex; flex-direction: column; }
.medit { display: grid; grid-template-columns: 28px 150px 100px 1fr 1fr 1.6fr auto; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.medit.add { border-top: 1px dashed var(--line-2); }
.medit.off { opacity: .55; }
.medit select, .medit input { padding: 7px 9px; font-size: 13.5px; }
.medit .acts { display: flex; gap: 4px; align-items: center; }
@media (max-width: 900px) { .medit { grid-template-columns: 28px 1fr 1fr; } .medit > :nth-child(6) { grid-column: 1 / -1; } .medit .acts { grid-column: 1 / -1; justify-content: flex-end; } }
.objhead { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 8px; }
.objhead input.title { font-size: 17px; font-weight: 650; }
@media (max-width: 760px) { .objhead { grid-template-columns: 1fr; } }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.switch input { width: auto; accent-color: var(--ink); }

/* ---------- вход и быстрый ввод ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--r-cold) 10%, transparent), transparent 60%), var(--bg); }
.auth .card { width: 100%; max-width: 400px; padding: 28px; box-shadow: var(--shadow-lg); }
.auth .brand { margin-bottom: 22px; font-size: 16px; }
.auth h1 { font-size: 22px; margin-bottom: 6px; }
.auth p.lead { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.auth form { display: flex; flex-direction: column; gap: 12px; }
.auth button.pri { width: 100%; padding: 12px; font-size: 15px; margin-top: 4px; }
.auth button.link { width: auto; margin: 0; padding: 2px 0; align-self: flex-start; }
.auth .code { font-size: 26px; letter-spacing: 10px; text-align: center; font-weight: 700; padding: 12px; }
.quick .res-ic { width: 56px; height: 56px; border-radius: 16px; }
.quick .res-ic svg { width: 28px; height: 28px; }
.quick input.big { font-size: 28px; font-weight: 700; padding: 12px 14px; font-variant-numeric: tabular-nums; }
.err { color: var(--bad); font-size: 13.5px; min-height: 1em; }

dialog { border: 1px solid var(--line); border-radius: 20px; padding: 0; background: var(--surface); color: var(--ink); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgb(10 12 16 / .45); backdrop-filter: blur(3px); }
#dlgBody { padding: 22px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 10px); background: var(--primary); color: var(--primary-ink); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: all .2s; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg); z-index: 50; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 760px) { #toast { bottom: calc(84px + env(safe-area-inset-bottom)); } }
.appaddr { display: flex; gap: 20px; align-items: flex-start; }
.appaddr img { width: 132px; height: 132px; border-radius: 12px; background: #fff; padding: 6px; border: 1px solid var(--line); flex: none; }
.url-row { display: flex; gap: 8px; }
.url-row input { font-weight: 600; }
@media (max-width: 560px) { .appaddr { flex-direction: column; } .appaddr img { align-self: center; } }

/* ---------- приложение на телефоне ---------- */
.app-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 0 0; margin-top: 14px; border-top: 1px solid var(--line); }
.app-row b { font-weight: 600; }
.scanv { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; background: #000; display: block; }
#netbar { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 24px);
  background: var(--warn-bg); color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: 99px; padding: 6px 6px 6px 14px; font-size: 13px; box-shadow: var(--shadow-lg); }
#netbar svg { color: var(--warn); }
#netbar button { padding: 5px 12px; border-radius: 99px; font-size: 13px; }
#netbar:not(:has(button)) { padding-right: 14px; }
@media (display-mode: standalone) { .top { padding-top: env(safe-area-inset-top); } }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
