/* HomeHub — домашняя книга учёта.
   Раскладка: липкая шапка, прокручиваемый лист, нижняя панель разделов.
   Один столбец до 720px, на планшете/десктопе — та же колонка по центру. */
:root {
  --bg: #f3f4f8;
  --surface: #ffffff;
  --surface2: #e9ecf3;
  --fg: #15171e;
  --muted: #6b7280;
  --faint: #a0a7b4;
  --line: #e1e4eb;
  --accent: #2f5bea;
  --indigo: #5b5fc7;
  --orange: #e8842a;
  --purple: #8b4fc2;
  --blue: #1f7ae0;
  --pink: #d6457f;
  --ok: #1f9d55;
  --warn: #d97706;
  --bad: #d13c3c;
  --gray: #8a919e;
  --radius: 16px;
  --display: "Manrope", "SF Pro Display", -apple-system, system-ui, sans-serif;
  --body: "Golos Text", "SF Pro Text", -apple-system, system-ui, sans-serif;
  --tabbar-h: 58px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1116; --surface: #181b22; --surface2: #232731; --fg: #eceef3; --muted: #9aa3b2;
    --faint: #6b7380; --line: #2a2f3a; --accent: #6b8cff; --indigo: #8285e0; --orange: #f09a4a;
    --purple: #ad7ae0; --blue: #4d9cf5; --pink: #ec6a9c; --ok: #3fbf74; --warn: #f0a030; --bad: #ef5c5c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1116; --surface: #181b22; --surface2: #232731; --fg: #eceef3; --muted: #9aa3b2;
  --faint: #6b7380; --line: #2a2f3a; --accent: #6b8cff; --indigo: #8285e0; --orange: #f09a4a;
  --purple: #ad7ae0; --blue: #4d9cf5; --pink: #ec6a9c; --ok: #3fbf74; --warn: #f0a030; --bad: #ef5c5c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.45 var(--body); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── оболочка ─────────────────────────────────────────── */
#app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar-in {
  max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 8px; min-height: 52px;
  padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px));
}
.title { font-size: 20px; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; gap: 6px; }
.iconbtn {
  width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--surface); color: var(--fg);
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.iconbtn:active { background: var(--surface2); }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn .dot { position: absolute; margin: -16px 0 0 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.view {
  flex: 1; max-width: 720px; width: 100%; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 8px calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom, 0px));
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: max(0px, env(safe-area-inset-left, 0px)); padding-right: max(0px, env(safe-area-inset-right, 0px));
}
.tabbar-in { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tabbar-h); }
.tab {
  border: 0; background: transparent; color: var(--faint); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 500;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--accent); }

/* ── общие элементы ───────────────────────────────────── */
.h-big { font-size: 28px; font-weight: 800; margin: 8px 0 12px; }
.sub { color: var(--muted); font-size: 14px; margin: -8px 0 14px; }
.section { margin-top: 18px; }
.section-title {
  font-size: 12.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  margin: 0 4px 8px; display: flex; align-items: center; gap: 8px;
}
.section-title .n { margin-left: auto; font-weight: 500; letter-spacing: 0; text-transform: none; }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; width: 100%; text-align: left;
  border: 0; background: transparent; color: var(--fg); border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row:active { background: var(--surface2); }
.row .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .name { font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.row .meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta.wrap { white-space: normal; }
.row .warn { font-size: 12.5px; color: var(--bad); }
.row .aside { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.row .aside b { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
.row .aside small { font-size: 11.5px; color: var(--muted); }
.row .chev { flex: none; color: var(--faint); width: 16px; height: 16px; }
.ava {
  flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: flex; align-items: center;
  justify-content: center; color: #fff; font-family: var(--display); font-weight: 700; font-size: 14px; background: var(--indigo);
}
.ava img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.ava.sq { border-radius: 10px; }
.ava.lg { width: 56px; height: 56px; }
.ava svg { width: 22px; height: 22px; }
.thumb { flex: none; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--surface2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge { display: inline-flex; align-items: center; min-width: 20px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; justify-content: center; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface2); color: var(--muted); }
.pill.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.pill.blue { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; margin: 0 -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 0;
  background: var(--surface); color: var(--fg); font-size: 14px; font-weight: 500;
}
.chip .n { color: var(--muted); font-weight: 400; }
.chip[aria-pressed="true"] { background: var(--accent); color: #fff; }
.chip[aria-pressed="true"] .n { color: rgba(255,255,255,.8); }
.chip svg { width: 15px; height: 15px; }
.search { position: relative; margin: 2px 0 12px; }
.search input {
  width: 100%; padding: 11px 14px 11px 40px; border: 0; border-radius: 12px; background: var(--surface); color: var(--fg); font-size: 16px;
}
.search input::placeholder { color: var(--faint); }
.search svg { position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; color: var(--faint); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty h3 { font-size: 18px; margin-bottom: 6px; color: var(--fg); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12.5px; padding: 4px 10px; border-radius: 8px; background: var(--surface2); color: var(--fg); }

/* ── плитки главной ───────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.tile {
  background: var(--surface); border-radius: var(--radius); padding: 16px; min-height: 134px; text-align: left; border: 0; color: var(--fg);
  display: flex; flex-direction: column; gap: 10px; position: relative;
}
.tile:active { background: var(--surface2); }
a.tile, a.tab, a.item { text-decoration: none; }
.tile .ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; }
.tile .ic svg { width: 24px; height: 24px; }
.tile h3 { font-size: 17px; font-weight: 700; margin-top: auto; }
.tile p { margin: 0; font-size: 12.5px; color: var(--muted); }
.tile .badge { position: absolute; top: 16px; right: 16px; }
.today { display: flex; flex-direction: column; gap: 8px; }
.today .item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 14px; }
.today .item .ic { flex: none; width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; }
.today .item .ic svg { width: 16px; height: 16px; }
.today .item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today .item small { color: var(--muted); flex: none; }

/* ── карточка (детали) ────────────────────────────────── */
.hero { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 10px 0 18px; }
.hero .ava { width: 132px; height: 132px; font-size: 44px; box-shadow: 0 12px 30px rgba(0,0,0,.16); }
.hero .ava.sq { border-radius: 24px; }
.hero .photo { width: 100%; aspect-ratio: 16/10; border-radius: var(--radius); overflow: hidden; background: var(--surface2); }
.hero .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero .label { width: min(60%, 220px); aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: var(--surface2); box-shadow: 0 12px 30px rgba(0,0,0,.16); }
.hero .label img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero h2 { font-size: 24px; font-weight: 800; margin-top: 6px; }
.hero .role { color: var(--muted); font-size: 15px; }
.hero .big { font-family: var(--display); font-size: 30px; font-weight: 800; }
.hero .plate { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; padding: 4px 10px; border-radius: 6px; background: var(--surface2); letter-spacing: .04em; }
.hero .line { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; flex-wrap: wrap; justify-content: center; }
.kv { display: flex; flex-direction: column; }
.kv .r { display: flex; justify-content: space-between; gap: 14px; padding: 11px 14px; border-top: 1px solid var(--line); font-size: 15px; }
.kv .r:first-child { border-top: 0; }
.kv .r .k { color: var(--fg); flex: none; display: inline-flex; align-items: center; gap: 8px; }
.kv .r .k svg { width: 18px; height: 18px; color: var(--muted); }
.kv .r .v { color: var(--muted); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.kv .r .v.ok { color: var(--ok); } .kv .r .v.warn { color: var(--warn); } .kv .r .v.bad { color: var(--bad); } .kv .r .v.pink { color: var(--pink); }
.kv .r.col { flex-direction: column; gap: 3px; }
.kv .r.col .k { font-size: 12.5px; color: var(--muted); }
.kv .r.col .v { text-align: left; color: var(--fg); font-size: 14.5px; white-space: pre-wrap; }
.kv .r a.v { color: var(--accent); }
.kv .r .copy { flex: none; border: 0; background: transparent; color: var(--faint); padding: 0 0 0 6px; }
.kv .r .copy svg { width: 16px; height: 16px; }
.kv .r .copy.ok { color: var(--ok); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; border-radius: 8px; background: transparent; padding: 8px 4px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.twin { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn {
  border: 0; border-radius: 12px; padding: 13px 14px; font-weight: 600; font-size: 15px; display: flex; align-items: center;
  justify-content: center; gap: 8px; background: var(--surface2); color: var(--fg); width: 100%;
}
.btn svg { width: 20px; height: 20px; }
.btn.tint-ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.btn.tint-warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.btn.tint-purple { background: color-mix(in srgb, var(--purple) 14%, transparent); color: var(--purple); }
.btn.tint-blue { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.btn.danger { background: transparent; color: var(--bad); }
.btn:disabled { opacity: .45; }
.note { font-size: 12.5px; color: var(--muted); text-align: center; margin: 6px 4px 0; }

/* ── дашборд склада ───────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.kpi { background: var(--surface); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.kpi .k { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .k svg { width: 15px; height: 15px; }
.kpi .v { font-family: var(--display); font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 11.5px; color: var(--warn); }
.bars { background: var(--surface); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; }
.bars h3 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.bar { display: grid; grid-template-columns: 120px 1fr 44px; gap: 8px; align-items: center; font-size: 12.5px; }
.bar .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .t { height: 10px; border-radius: 4px; background: var(--surface2); overflow: hidden; }
.bar .t i { display: block; height: 100%; background: var(--orange); border-radius: 4px; }
.bar .n { text-align: right; font-variant-numeric: tabular-nums; }

/* ── лист (модальная форма) ───────────────────────────── */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet .scrim { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.sheet-body {
  position: relative; width: 100%; max-width: 720px; max-height: 92%; background: var(--bg); border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column; overflow: hidden; animation: up .22s ease-out;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@keyframes up { from { transform: translateY(30px); opacity: 0 } to { transform: none; opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .sheet-body { animation: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.sheet-head b { font-family: var(--display); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; padding: 0 8px; }
.link { border: 0; background: transparent; color: var(--accent); font-size: 16px; padding: 4px 2px; flex: none; }
.link.strong { font-weight: 700; }
.link:disabled { color: var(--faint); }
.sheet-form {
  overflow-y: auto; padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 14px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.fs { display: flex; flex-direction: column; gap: 1px; background: var(--surface); border-radius: 12px; overflow: hidden; }
.fs > legend, .fs-title { font-size: 12.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 0 4px 6px; }
.field { display: flex; align-items: center; gap: 12px; padding: 0 14px; min-height: 46px; border-top: 1px solid var(--line); }
.field:first-child { border-top: 0; }
.field label { flex: none; width: 120px; font-size: 14.5px; }
.field input, .field select, .field textarea {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 0; font-size: 16px; text-align: right;
}
.field textarea { text-align: left; resize: vertical; min-height: 70px; line-height: 1.4; }
.field.col { flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 6px; }
.field.col label { width: auto; padding-top: 10px; font-size: 12.5px; color: var(--muted); }
.field.col input { text-align: left; padding: 6px 0 8px; }
.field input[type="checkbox"] { flex: none; width: 22px; height: 22px; margin-left: auto; }
.field .stepper { margin-left: auto; display: flex; align-items: center; gap: 0; background: var(--surface2); border-radius: 9px; }
.field .stepper button { border: 0; background: transparent; width: 40px; height: 34px; font-size: 20px; color: var(--accent); }
.field .stepper output { min-width: 40px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.field .stars { margin-left: auto; display: flex; gap: 4px; }
.field .stars button { border: 0; background: transparent; font-size: 22px; color: var(--faint); padding: 0 2px; }
.field .stars button[aria-pressed="true"] { color: var(--warn); }
.hint { font-size: 12.5px; color: var(--muted); margin: -6px 4px 0; }
.confirm { background: var(--surface); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; text-align: center; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px));
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; max-width: 90vw;
}
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lightbox button { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px)); }

@media (min-width: 600px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .sheet { align-items: center; }
  .sheet-body { border-radius: 20px; max-height: 86%; max-width: 560px; }
}

/* ── внешний сайт внутри ───────────────────────────────── */
.embed-wrap { margin: 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px))) 0 calc(-1 * max(16px, env(safe-area-inset-right, 0px))); }
.embed { display: block; width: 100%; border: 0; background: var(--surface);
  height: calc(100dvh - 52px - var(--tabbar-h) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
.embed-note { padding: 10px 16px 0; }

/* ── экран входа ───────────────────────────────────────── */
.lock { min-height: 100svh; display: flex; align-items: center; justify-content: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); }
.lock-box { width: 100%; max-width: 380px; background: var(--surface); border-radius: 18px; padding: 28px 22px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.lock-mark { width: 48px; height: 48px; margin: 0 auto; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.lock-mark svg { width: 24px; height: 24px; }
.lock-box h1 { font-size: 22px; font-weight: 800; }
.lock-box p { margin: 0; color: var(--muted); font-size: 14px; }
.lock-form { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.lock-form input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg); font-size: 17px; text-align: center; letter-spacing: .06em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.lock-btn { background: var(--accent); color: #fff; }
.lock-btn:disabled { opacity: .6; }
.lock-msg { min-height: 20px; font-size: 13px; color: var(--bad); }
.lock-note { font-size: 12.5px; color: var(--faint); }
.offline { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); font-size: 13px; padding: 8px 12px; border-radius: 10px; margin-bottom: 12px; text-align: center; }

/* ── фон главной: небо и поле, как на «умном доме» ───────── */
:root {
  --wall-sky: linear-gradient(180deg, #6f9bd0 0%, #a9c4e2 34%, #e4dcc6 52%, #dcb86c 64%, #c58c3c 100%);
  --wall-blob-1: rgba(255,255,255,.55);
  --wall-blob-2: rgba(255,214,130,.55);
  --wall-ray: rgba(255,250,235,.45);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wall-sky: linear-gradient(180deg, #1d2a40 0%, #2b3b58 36%, #3a3446 55%, #4a3722 70%, #2a1f14 100%);
    --wall-blob-1: rgba(120,150,210,.28);
    --wall-blob-2: rgba(230,160,70,.22);
    --wall-ray: rgba(255,240,210,.16);
  }
}
:root[data-theme="dark"] {
  --wall-sky: linear-gradient(180deg, #1d2a40 0%, #2b3b58 36%, #3a3446 55%, #4a3722 70%, #2a1f14 100%);
  --wall-blob-1: rgba(120,150,210,.28);
  --wall-blob-2: rgba(230,160,70,.22);
  --wall-ray: rgba(255,240,210,.16);
}
.wallpaper {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: var(--wall-sky);
}
.wallpaper::before, .wallpaper::after { content: ""; position: absolute; border-radius: 50%; filter: blur(70px); }
.wallpaper::before {   /* свет в небе */
  width: 120vmax; height: 60vmax; left: -20vmax; top: -22vmax; background: radial-gradient(closest-side, var(--wall-blob-1), transparent);
}
.wallpaper::after {    /* тёплый блик над полем */
  width: 90vmax; height: 50vmax; right: -30vmax; bottom: -10vmax; background: radial-gradient(closest-side, var(--wall-blob-2), transparent);
}
.wallpaper i { position: absolute; display: block; }
.wallpaper i.ray {     /* тонкий светящийся луч, как на референсе */
  left: 58%; bottom: -10%; width: 26px; height: 130%; transform: rotate(14deg); transform-origin: bottom;
  background: linear-gradient(180deg, transparent, var(--wall-ray) 60%, transparent); filter: blur(10px);
}
.wallpaper i.grain { inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.02) 0 1px, transparent 1px 3px); opacity: .5; }

/* ── приветствие при входе ─────────────────────────────── */
.splash {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  padding: 24px max(24px, env(safe-area-inset-left, 0px));
  background: var(--bg); transition: opacity .6s ease, visibility .6s;
}
.splash.out { opacity: 0; visibility: hidden; }
.splash-line { margin: 0; font-family: var(--display); font-size: clamp(28px, 8vw, 40px); font-weight: 800; text-align: center; letter-spacing: -.02em; text-wrap: balance; }
.splash-line .w { display: inline-block; opacity: 0; transform: translateY(14px) scale(.98); filter: blur(6px);
  animation: wordIn .7s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--i) * 120ms + 150ms); }
.splash-line .w.name { color: var(--accent); }
@keyframes wordIn { to { opacity: 1; transform: none; filter: none; } }
.splash-line .sub { display: block; margin-top: 10px; font-size: 15px; font-weight: 500; color: var(--muted); opacity: 0; animation: fadeIn .8s ease forwards; animation-delay: 1s; }
@keyframes fadeIn { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .splash-line .w, .splash-line .sub { animation: none; opacity: 1; transform: none; filter: none; } }

/* строка приветствия на главной */
.greet { margin: 4px 4px 14px; font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,.25); }
.greet small { display: block; margin-top: 2px; font-family: var(--body); font-size: 14px; font-weight: 500; color: rgba(255,255,255,.85); text-shadow: 0 1px 8px rgba(0,0,0,.2); }
:root[data-dark] .greet { color: var(--fg); text-shadow: none; }

/* ── главная: прозрачные шапка и панель, тёмное стекло для блоков ── */
body.home-wall, body.home-wall #app { background: transparent; }
body.home-wall .topbar { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 0; }
body.home-wall .title { color: #fff; text-shadow: 0 1px 10px rgba(0,0,0,.25); }
body.home-wall .iconbtn { background: rgba(20,24,34,.38); color: #fff; box-shadow: none;
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%); }
body.home-wall .tabbar { background: rgba(16,20,30,.42); border-top: 1px solid rgba(255,255,255,.14);
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%); }
body.home-wall .tab { color: rgba(255,255,255,.6); }
body.home-wall .tab[aria-current="page"] { color: #fff; }
body.home-wall .tile, body.home-wall .card {
  background: rgba(22,26,36,.5); color: #fff; border: 1px solid rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
body.home-wall .tile:active, body.home-wall .row:active { background: rgba(255,255,255,.12); }
body.home-wall .tile h3 { color: #fff; }
body.home-wall .tile p, body.home-wall .row .meta, body.home-wall .section-title { color: rgba(255,255,255,.72); }
body.home-wall .section-title { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; }
body.home-wall .row { color: #fff; border-top-color: rgba(255,255,255,.12); }
body.home-wall .row .name { color: #fff; }
body.home-wall .row .warn { color: #ff9b8f; }
body.home-wall .row .chev { color: rgba(255,255,255,.5); }
body.home-wall .badge { background: rgba(255,80,70,.9); }
body.home-wall .card.today .row { background: transparent; }
body.home-wall .note { color: rgba(255,255,255,.7); }
body.home-wall .greet { color: #fff; }
body.home-wall .greet small { color: rgba(255,255,255,.8); }
html:has(body.home-wall) { background: #8db0d8; }

/* ── стеклянная тема на всех экранах (обои, тёмные блоки) ─── */
body.home-wall .chip, body.home-wall .search input, body.home-wall .seg, body.home-wall .kpi, body.home-wall .bars,
body.home-wall .kv .r, body.home-wall .card, body.home-wall .fs, body.home-wall .confirm, body.home-wall .empty,
body.home-wall .sheet-body, body.home-wall .sheet-head, body.home-wall .field {
  color: #fff;
}
body.home-wall .chip { background: rgba(22,26,36,.5); border: 1px solid rgba(255,255,255,.12); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
body.home-wall .chip .n { color: rgba(255,255,255,.65); }
body.home-wall .chip[aria-pressed="true"] { background: var(--accent); border-color: transparent; }
body.home-wall .search input { background: rgba(22,26,36,.5); color: #fff; border: 1px solid rgba(255,255,255,.12); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
body.home-wall .search input::placeholder { color: rgba(255,255,255,.5); }
body.home-wall .search svg { color: rgba(255,255,255,.6); }
body.home-wall .seg { background: rgba(22,26,36,.5); border: 1px solid rgba(255,255,255,.12); }
body.home-wall .seg button { color: rgba(255,255,255,.7); }
body.home-wall .seg button[aria-pressed="true"] { background: rgba(255,255,255,.18); color: #fff; box-shadow: none; }
body.home-wall .kpi, body.home-wall .bars { background: rgba(22,26,36,.5); border: 1px solid rgba(255,255,255,.12); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
body.home-wall .bar .l, body.home-wall .bar .n { color: rgba(255,255,255,.85); }
body.home-wall .bar .t { background: rgba(255,255,255,.14); }
body.home-wall .kpi small { color: #ffb36b; }
body.home-wall .card, body.home-wall .kv .r, body.home-wall .row { border-color: rgba(255,255,255,.12); }
body.home-wall .kv .r .v, body.home-wall .kv .r .k, body.home-wall .kv .r.col .v { color: #fff; }
body.home-wall .kv .r .v { color: rgba(255,255,255,.72); }
body.home-wall .kv .r.col .k { color: rgba(255,255,255,.6); }
body.home-wall .kv .r .copy { color: rgba(255,255,255,.55); }
body.home-wall .btn { background: rgba(22,26,36,.5); color: #fff; border: 1px solid rgba(255,255,255,.12); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
body.home-wall .btn.danger { color: #ff8a80; }
body.home-wall .empty { color: rgba(255,255,255,.7); }
body.home-wall .empty h3 { color: #fff; }
body.home-wall .tag { background: rgba(255,255,255,.14); color: #fff; }
body.home-wall .pill { background: rgba(255,255,255,.14); color: rgba(255,255,255,.85); }
body.home-wall .hero .plate { background: rgba(255,255,255,.14); color: #fff; }
body.home-wall .hero .line, body.home-wall .hero .role, body.home-wall .hero .big { color: #fff; }
body.home-wall .hero .role, body.home-wall .hero .line { color: rgba(255,255,255,.75); }
body.home-wall .ava { box-shadow: 0 6px 18px rgba(0,0,0,.25); }
body.home-wall .thumb { background: rgba(255,255,255,.12); }
body.home-wall .toast { background: rgba(20,24,34,.9); color: #fff; }
body.home-wall .offline { background: rgba(255,170,80,.18); color: #ffd49a; }
body.home-wall .link { color: #9fc0ff; }
body.home-wall .sheet .scrim { background: rgba(5,8,14,.5); }
body.home-wall .sheet-body { background: rgba(18,22,32,.82); border: 1px solid rgba(255,255,255,.12); -webkit-backdrop-filter: blur(28px) saturate(150%); backdrop-filter: blur(28px) saturate(150%); }
body.home-wall .sheet-head { background: transparent; border-bottom: 1px solid rgba(255,255,255,.1); }
body.home-wall .sheet-head b { color: #fff; }
body.home-wall .fs { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); }
body.home-wall .fs > legend, body.home-wall .fs-title { color: rgba(255,255,255,.6); }
body.home-wall .field { border-top-color: rgba(255,255,255,.1); }
body.home-wall .field label { color: rgba(255,255,255,.9); }
body.home-wall .field.col label { color: rgba(255,255,255,.6); }
body.home-wall .field input, body.home-wall .field select, body.home-wall .field textarea { color: #fff; color-scheme: dark; }
body.home-wall .field input::placeholder, body.home-wall .field textarea::placeholder { color: rgba(255,255,255,.4); }
body.home-wall .field .stepper { background: rgba(255,255,255,.12); }
body.home-wall .field .stepper button { color: #9fc0ff; }
body.home-wall .field .stars button { color: rgba(255,255,255,.3); }
body.home-wall .field .stars button[aria-pressed="true"] { color: #ffc35c; }
body.home-wall .confirm { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); }
body.home-wall .hint, body.home-wall .note { color: rgba(255,255,255,.6); }
body.home-wall .sub { color: rgba(255,255,255,.7); }
body.home-wall .h-big, body.home-wall h1, body.home-wall h2, body.home-wall h3 { color: #fff; }
body.home-wall .section-title .n { color: rgba(255,255,255,.6); }
body.home-wall .title { color: #fff; }
body.home-wall .tab { color: rgba(255,255,255,.6); }
body.home-wall .tab[aria-current="page"] { color: #fff; }

/* ── как в оригинале «Дом»: крупные стеклянные плитки, плавающая панель ── */
body.home-wall .greet { font-size: 32px; margin: 2px 4px 18px; }
body.home-wall .tiles { gap: 12px; }
body.home-wall .tile {
  border-radius: 28px; padding: 16px 16px 18px; min-height: 150px; gap: 0;
  background: rgba(40,46,60,.52); border: 1px solid rgba(255,255,255,.10);
  -webkit-backdrop-filter: blur(30px) saturate(150%); backdrop-filter: blur(30px) saturate(150%);
  box-shadow: 0 14px 34px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.08);
}
body.home-wall .tile .ic { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.12); color: var(--c); }
body.home-wall .tile .ic svg { width: 21px; height: 21px; }
body.home-wall .tile h3 { font-size: 18px; font-weight: 700; margin-top: auto; padding-top: 22px; }
body.home-wall .tile p { font-size: 13px; color: rgba(255,255,255,.62); margin-top: 3px; }
body.home-wall .tile .badge { top: 18px; right: 18px; background: rgba(255,90,80,.95); }
body.home-wall .today { gap: 0; }
body.home-wall .today .item { border-radius: 0; background: transparent; }
body.home-wall .today .item .ic { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.12); color: var(--c); }
body.home-wall .card.today { border-radius: 26px; }
/* плавающая стеклянная панель навигации */
body.home-wall .tabbar { left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  border: 1px solid rgba(255,255,255,.12); border-radius: 30px; background: rgba(24,28,38,.5);
  box-shadow: 0 12px 30px rgba(0,0,0,.25); }
body.home-wall .tabbar-in { height: 62px; }
body.home-wall .tab { position: relative; font-size: 11px; color: rgba(255,255,255,.6); }
body.home-wall .tab[aria-current="page"] { color: #fff; }
body.home-wall .tab[aria-current="page"]::before { content: ""; position: absolute; inset: 7px 8px; border-radius: 22px; background: rgba(255,255,255,.14); z-index: -1; }
body.home-wall .tab { z-index: 0; }
/* заголовок экрана крупнее, как «Работа» */
body.home-wall .topbar-in { min-height: 60px; }
body.home-wall .title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
body.home-wall .section-title { font-size: 17px; font-weight: 700; color: #fff; text-transform: none; letter-spacing: -.01em; margin: 22px 6px 10px; }
body.home-wall .section-title::after { content: "›"; font-size: 20px; color: rgba(255,255,255,.6); }
body.home-wall .view { padding-bottom: calc(var(--tabbar-h) + 44px + env(safe-area-inset-bottom, 0px)); }
body.home-wall .tile .ic, body.home-wall .today .item .ic { filter: brightness(1.6) saturate(1.3); }
body.home-wall .tile .ic { background: rgba(255,255,255,.16); }

/* ── панель навигации: компактная, по центру, у нижнего края ── */
body.home-wall .tabbar { left: 50%; right: auto; transform: translateX(-50%);
  width: min(calc(100% - 48px), 330px); bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  padding: 0; border-radius: 30px; }
body.home-wall .tabbar-in { height: 58px; max-width: none; }
body.home-wall .tab { font-size: 10px; gap: 2px; }
body.home-wall .tab svg { width: 22px; height: 22px; }
body.home-wall .view { padding-bottom: calc(var(--tabbar-h) - 18px + 36px + env(safe-area-inset-bottom, 0px)); }

/* ── заголовок: крупный слева, при прокрутке плавно в центр; шапка размыта ── */
.topbar-in { position: relative; min-height: 60px; }
.title { position: absolute; left: 16px; right: 110px; top: 50%; transform: translateY(-50%); text-align: left;
  font-size: 26px; font-weight: 800; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: left .42s cubic-bezier(.2,.7,.2,1), right .42s cubic-bezier(.2,.7,.2,1), font-size .42s cubic-bezier(.2,.7,.2,1), text-align .42s, opacity .3s; }
.topbar.scrolled .title { left: 64px; right: 64px; text-align: center; font-size: 17px; font-weight: 700; }
#back[hidden] ~ .title { left: 16px; }
.topbar { transition: background .35s ease, box-shadow .35s ease, backdrop-filter .35s ease, -webkit-backdrop-filter .35s ease; }
.topbar .actions { position: relative; z-index: 1; margin-left: auto; }
.topbar .iconbtn { position: relative; z-index: 1; }
#back { position: relative; z-index: 1; }
body.home-wall .topbar.scrolled { background: rgba(26,31,44,.42); -webkit-backdrop-filter: blur(26px) saturate(160%); backdrop-filter: blur(26px) saturate(160%);
  box-shadow: 0 1px 0 rgba(255,255,255,.08); }
body.home-wall .topbar.scrolled .title { color: #fff; text-shadow: none; }
body.home-wall .topbar.scrolled .iconbtn { background: rgba(255,255,255,.12); }
/* иконки плиток и списков — светлые */
body.home-wall .tile .ic, body.home-wall .today .item .ic { color: #fff; filter: none; background: rgba(255,255,255,.18); }

/* панель ниже: отступ от низа — лишь часть зоны «домашней полоски» */
body.home-wall .tabbar { bottom: calc(env(safe-area-inset-bottom, 0px) * .4 + 2px); }
