/* Пульт: вид — дизайн-система app-core «Свет» (токены из template/web/src/styles.css, 0.11.0). */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f4f6;
  --ink: #1d1d1f;
  --ink-2: #3c3c43;
  --muted: #68686d;
  --line: #e6e6ea;
  --line-strong: #d1d1d6;
  --check: #8e8e93;
  --accent: #0066d6;
  --accent-ink: #ffffff;
  --accent-soft: #e5f0fc;
  --accent-soft-ink: #0058b9;
  --danger: #d70015;
  --danger-soft: #fde8ea;
  --ok: #1e7a35;
  --warn: #b25000;
  --warn-soft: #fdf0e3;
  --hover: rgba(0, 0, 0, 0.045);
  --scrim: rgba(0, 0, 0, 0.32);
  --shadow-sm: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.18);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter Variable', 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1c1e;
  --surface: #2c2c2e;
  --surface-2: #262628;
  --ink: #f5f5f7;
  --ink-2: #d2d2d7;
  --muted: #98989f;
  --line: #38383a;
  --line-strong: #48484a;
  --check: #8e8e93;
  --accent: #3b8cff;
  --accent-ink: #04122a;
  --accent-soft: rgba(59, 140, 255, 0.17);
  --accent-soft-ink: #8fbcff;
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.14);
  --ok: #4cd17a;
  --warn: #ffa94d;
  --warn-soft: rgba(255, 169, 77, 0.14);
  --hover: rgba(255, 255, 255, 0.06);
  --scrim: rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 14px/1.45 var(--font); letter-spacing: -0.006em; -webkit-text-size-adjust: 100%; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.app { max-width: 640px; margin: 0 auto; min-height: 100vh; }
.scroll { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }

h1 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.sub { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.note { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.35; background: var(--surface-2); color: var(--ink-2); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note svg { flex: none; width: 16px; height: 16px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.stat { background: var(--surface); box-shadow: var(--shadow-sm); border-radius: 16px; padding: 12px 14px; }
.stat .l { display: block; font-size: 12.5px; color: var(--muted); }
.stat .v { display: block; margin-top: 2px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.stat .h { display: block; font-size: 12px; color: var(--muted); }

.gh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 22px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.gt { font-size: 13.5px; font-weight: 650; }
.gt.a { color: var(--accent); } .gt.d { color: var(--danger); } .gt.w { color: var(--warn); }
.gn { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.row { display: flex; align-items: stretch; min-height: 56px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.chk { flex: none; width: 44px; display: flex; align-items: center; }
.chk span { display: block; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--check); }
.chk:hover span { border-color: var(--accent); }
.main { flex: 1; min-width: 0; display: block; padding: 8px 4px 8px 0; }
.main:hover { background: var(--hover); }
.r1 { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.t { min-width: 0; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.n { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.r2 { display: block; margin-top: 1px; font-size: 12.5px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.r2.soon { color: var(--accent); } .r2.late { color: var(--danger); font-weight: 550; } .r2.warn { color: var(--warn); }
.meter { display: block; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; }

.ok-line { margin: 0; padding: 12px 0; color: var(--ok); font-size: 13.5px; }
.empty { margin-top: 18px; padding: 18px 16px; border-radius: 16px; background: var(--surface-2); }
.empty b { display: block; font-size: 15px; font-weight: 600; }
.empty p { margin: 4px 0 12px; color: var(--ink-2); }
.more { display: block; width: 100%; padding: 12px 0; color: var(--accent); font-weight: 500; font-size: 13.5px; }

.seg { display: flex; gap: 6px; margin-top: 14px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 999px; font-size: 13.5px; font-weight: 500; text-align: center; }
.btn.pri { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.sec { box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.danger { color: var(--danger); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.small { min-height: 36px; padding: 0 14px; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.link { color: var(--accent); font-weight: 500; min-height: 44px; }
.link.danger { color: var(--danger); }

.card { margin-top: 12px; background: var(--surface); box-shadow: var(--shadow-sm); border-radius: 16px; padding: 14px; }
.card .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.012em; }
.prov { font-size: 12.5px; color: var(--muted); }
.line { display: flex; gap: 8px; align-items: baseline; margin-top: 7px; font-size: 13.5px; }
.line b { flex: none; width: 8px; height: 8px; border-radius: 50%; transform: translateY(-1px); background: var(--muted); }
.line.ok b { background: var(--ok); } .line.warn b { background: var(--warn); } .line.bad b { background: var(--danger); }
.line.bad span { color: var(--danger); } .line.warn span { color: var(--warn); }

.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; width: 100%; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 640px; margin: 0 auto; max-height: 88vh; overflow-y: auto; padding: 18px 16px calc(22px + env(safe-area-inset-bottom)); background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: var(--shadow-lg); }
.sheet h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -0.015em; padding-right: 44px; }
.close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.kv { margin: 14px 0 0; padding: 6px 12px; border-radius: 12px; background: var(--surface-2); }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.lab { margin: 14px 0 3px; font-size: 13px; font-weight: 600; }
.lab.d { color: var(--danger); }
.txt { margin: 0; color: var(--ink-2); }
.acts { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.acts .btn { flex: 1 1 140px; }

.fld { display: block; margin-top: 12px; font-size: 13px; font-weight: 550; }
.fld input, .fld select { display: block; width: 100%; height: 44px; margin-top: 4px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 400; font-size: 16px; }
.fld input:focus, .fld select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fld.err input, .fld.err select { border-color: var(--danger); }
.fld .msg { display: block; margin-top: 4px; color: var(--danger); font-weight: 500; font-size: 12.5px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; }
.tick { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 8px; font-size: 14px; }
.tick input { width: 20px; height: 20px; accent-color: var(--accent); }

.toast { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 15; max-width: 616px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); font-size: 13.5px; }
.toast button { flex: none; min-height: 36px; color: var(--accent); font-weight: 600; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 640px; margin: 0 auto; padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
.tabbar button { min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11.5px; font-weight: 500; text-align: center; }
.tabbar button[aria-current="page"] { color: var(--accent); font-weight: 600; }
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.full { padding: 48px 8px; text-align: center; }
.full b { display: block; font-size: 17px; font-weight: 650; }
.full p { color: var(--ink-2); margin: 6px 0 16px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
