/* Vitals — device health copilot. One stylesheet for web, installed app and mobile. */
:root {
  --bg: #0a0e13;
  --bg-2: #0f141b;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-solid: #121820;
  --panel-hover: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e9eef4;
  --muted: #8d99a8;
  --faint: #5d6877;
  --accent: #3ef0b5;
  --accent-2: #5cc8ff;
  --accent-ink: #04261b;
  --warn: #ffb547;
  --bad: #ff6b6b;
  --good: #3ef0b5;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-w: 232px;
  --chat-w: 380px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f6f8;
  --bg-2: #eef1f4;
  --panel: rgba(255, 255, 255, 0.8);
  --panel-solid: #ffffff;
  --panel-hover: rgba(10, 20, 30, 0.04);
  --line: rgba(10, 20, 30, 0.09);
  --line-strong: rgba(10, 20, 30, 0.18);
  --text: #0f1720;
  --muted: #566272;
  --faint: #8b96a3;
  --accent: #0db083;
  --accent-2: #1a8fd6;
  --accent-ink: #ffffff;
  --shadow: 0 10px 30px rgba(15, 23, 32, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(62, 240, 181, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(92, 200, 255, 0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------------ shell */
.shell {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--chat-w);
  height: 100vh;
  height: 100dvh;
}
.shell.chat-collapsed { grid-template-columns: var(--nav-w) minmax(0, 1fr) 0; }

.nav {
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand-mark { width: 30px; height: 30px; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: 0.02em; }
.nav-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 10px; background: transparent;
  color: var(--muted); cursor: pointer; text-align: left; font-weight: 550;
  transition: background .15s, color .15s;
}
.nav-btn svg { width: 19px; height: 19px; flex: none; }
.nav-btn:hover { background: var(--panel-hover); color: var(--text); }
.nav-btn[aria-current="page"] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text); }
.nav-btn[aria-current="page"] svg { color: var(--accent); }
.nav-btn .badge { margin-left: auto; }
.nav-spacer { flex: 1; }
.nav-foot { font-size: 12px; color: var(--faint); padding: 10px 12px; }
.nav-foot button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; text-decoration: underline; }

.main { overflow-y: auto; overflow-x: hidden; padding: 22px 28px 120px; scroll-behavior: smooth; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.topbar h1 { font-size: 24px; margin: 0; letter-spacing: -0.02em; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .grow { flex: 1; }

/* ------------------------------------------------------------- primitives */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card h2 { font-size: 15px; margin: 0 0 4px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.card h2 .hint { font-weight: 500; color: var(--muted); font-size: 12px; }
.card .lede { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.small { font-size: 12.5px; }
.right { margin-left: auto; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-strong); background: var(--panel-solid);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px;
  transition: transform .06s, background .15s, border-color .15s, opacity .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn svg { width: 16px; height: 16px; }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 10px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; background: var(--panel-hover); color: var(--muted); white-space: nowrap;
}
.badge.safe { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.badge.review { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.badge.info { background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: var(--accent-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot.live { background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 20%, transparent); animation: pulse 2s infinite; }
.dot.warn { background: var(--warn); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }

.mode-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); font-size: 12.5px; font-weight: 600; cursor: pointer;
}

.bar { height: 8px; border-radius: 99px; background: var(--panel-hover); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad); }

.notice {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px;
  background: color-mix(in srgb, var(--accent-2) 7%, transparent);
}
.notice.warn { background: color-mix(in srgb, var(--warn) 9%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.notice.bad { background: color-mix(in srgb, var(--bad) 9%, transparent); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }

/* ------------------------------------------------------------- overview */
.hero { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; }
.orb-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; position: relative; }
.orb { width: 240px; height: 240px; }
.orb .track { stroke: var(--panel-hover); }
.orb text { fill: var(--text); }
.orb .score { font-size: 54px; font-weight: 750; letter-spacing: -0.04em; }
.orb .label { font-size: 12px; fill: var(--muted); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.orb-band { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; margin: -4px 0 8px; }
.orb-band.ok { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.orb-band.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.orb-band.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.orb-legend { display: grid; grid-template-columns: repeat(2, auto); gap: 4px 16px; font-size: 12px; color: var(--muted); }
.orb-legend span { display: inline-flex; align-items: center; gap: 6px; }
.orb-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.why-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.why-list li { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; }
.why-list .pts { font-family: var(--mono); font-weight: 700; min-width: 42px; text-align: right; }
.why-list .pts.neg { color: var(--bad); }
.why-list .pts.zero { color: var(--good); }

.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 26px; font-weight: 720; letter-spacing: -0.03em; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.stat .s { font-size: 12.5px; color: var(--muted); }
.spark { width: 100%; height: 38px; display: block; }

.fix { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.fix + .fix { margin-top: 8px; }
.fix .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--panel-hover); }
.fix .ico svg { width: 18px; height: 18px; }
.fix.high .ico { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.fix.med .ico { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.fix.low .ico { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.fix h3 { margin: 0; font-size: 14px; }
.fix p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.fix .act { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ---------------------------------------------------------------- clean */
.goal { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.goal input[type=number] { width: 90px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--panel-solid); }
.goal select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--panel-solid); }
.progress-ring { display: flex; align-items: center; gap: 12px; }

.cat { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.cat + .cat { margin-top: 8px; }
.cat-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; }
.cat-head:hover { background: var(--panel-hover); }
.cat-head .name { font-weight: 650; font-size: 14px; }
.cat-head .why { font-size: 12.5px; color: var(--muted); }
.cat-head .size { font-family: var(--mono); font-weight: 700; font-size: 13.5px; }
.cat-body { border-top: 1px solid var(--line); padding: 10px 14px 12px; display: none; }
.cat.open .cat-body { display: block; }
.cat .after { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 5px 0; font-size: 12.5px; }
.item + .item { border-top: 1px dashed var(--line); }
.item .path { font-family: var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }

.action-bar {
  position: sticky; bottom: 12px; margin-top: 16px; z-index: 5;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--panel-solid) 92%, transparent); backdrop-filter: blur(14px); box-shadow: var(--shadow);
}
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 6px 12px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--panel-hover); color: var(--text); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.num { font-family: var(--mono); text-align: right; white-space: nowrap; }
.table { table-layout: fixed; }
.table th.num, .table td.num { width: 82px; }
.table th.act, .table td:last-child:not(.num) { width: 64px; }
.table .namecell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chart { width: 100%; height: 160px; display: block; }
.chart .grid-line { stroke: var(--line); }
.chart .axis { fill: var(--faint); font-size: 10px; }

.gauge-big { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.cells { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; width: 220px; }
.cells i { height: 22px; border-radius: 4px; background: var(--panel-hover); }
.cells i.on { background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--accent-2))); }
.cells.warn i.on { background: var(--warn); }
.cells.bad i.on { background: var(--bad); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .tl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--accent); }
.timeline .tl-dot.restore { background: var(--accent-2); }
.timeline .tl-dot.purge { background: var(--warn); }

.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.check-list li:last-child { border-bottom: 0; }
.check-list .path { font-family: var(--mono); font-size: 12px; color: var(--accent-2); }
.check-list .gain { font-size: 12px; color: var(--good); font-weight: 650; }
.check-list li.done .t { text-decoration: line-through; color: var(--muted); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { border: 1px solid var(--line); background: var(--panel); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: transparent; }

.code-block { font-family: var(--mono); font-size: 12.5px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow-x: auto; white-space: pre; }
.pair-code { font-family: var(--mono); font-size: 34px; font-weight: 750; letter-spacing: .18em; }

.empty { text-align: center; padding: 26px 10px; color: var(--muted); font-size: 13.5px; }
.empty svg { width: 34px; height: 34px; opacity: .6; margin-bottom: 6px; }

/* ----------------------------------------------------------------- chat */
.chat {
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: color-mix(in srgb, var(--bg-2) 80%, transparent); backdrop-filter: blur(12px);
}
.chat-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 0; font-size: 15px; }
.chat-head .sub { font-size: 12px; color: var(--muted); }
.chat-log { flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 10px 12px; border-radius: 14px; font-size: 13.8px; line-height: 1.5; animation: rise .22s ease-out; }
.msg p { margin: 0 0 6px; }
.msg p:last-child { margin: 0; }
.msg ul { margin: 4px 0 6px; padding-left: 18px; }
.msg li { margin: 2px 0; }
.msg code { font-family: var(--mono); font-size: 12px; background: var(--panel-hover); padding: 1px 5px; border-radius: 5px; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--panel-solid); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .src { margin-top: 6px; font-size: 11px; color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line-strong); background: transparent; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.plan { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.plan-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; font-size: 12.5px; }
.plan-row + .plan-row { border-top: 1px solid var(--line); }
.plan-total { background: var(--panel-hover); font-weight: 700; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
.chat-suggest { display: flex; gap: 6px; padding: 6px 14px; overflow-x: auto; scrollbar-width: none; }
.chat-suggest::-webkit-scrollbar { display: none; }
.chat-suggest .chip { white-space: nowrap; }
.chat-form { display: flex; gap: 8px; padding: 10px 14px 16px; }
.chat-form textarea {
  flex: 1; resize: none; min-height: 42px; max-height: 120px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--panel-solid); outline: none;
}
.chat-form textarea:focus { border-color: var(--accent); }
.chat-fab {
  display: none; position: fixed; right: 18px; bottom: 18px; z-index: 30;
  width: 56px; height: 56px; border-radius: 18px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow);
}
.chat-fab svg { width: 26px; height: 26px; }

/* -------------------------------------------------------------- dialogs */
dialog {
  border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel-solid); color: var(--text);
  padding: 22px; width: min(480px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
dialog::backdrop { background: rgba(5, 8, 12, .6); backdrop-filter: blur(3px); }
dialog h3 { margin: 0 0 6px; font-size: 18px; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast-wrap { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; animation: rise .2s ease-out; }
.toast button { background: none; border: 0; color: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; padding: 0; }

.tabbar { display: none; }

/* ----------------------------------------------------------- responsive */
@media (max-width: 1320px) {
  .shell { grid-template-columns: var(--nav-w) minmax(0, 1fr); }
  .chat { position: fixed; right: 0; top: 0; bottom: 0; width: min(var(--chat-w), 100vw); z-index: 40; transform: translateX(100%); transition: transform .25s ease; box-shadow: var(--shadow); }
  .shell.chat-open .chat { transform: none; }
  .chat-fab { display: grid; place-items: center; }
  .shell.chat-open .chat-fab { display: none; }
}
@media (max-width: 1080px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
}
/* Phone layout: applied by app.js on narrow screens, and always on mobile.html */
body.m { --nav-w: 0px; }
body.m .shell { grid-template-columns: minmax(0, 1fr); }
body.m .nav { display: none; }
body.m .main { padding: 14px 14px 110px; }
body.m .g-2, body.m .g-3 { grid-template-columns: minmax(0, 1fr); }
body.m .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.m .hero { grid-template-columns: 1fr; }
body.m .span-2 { grid-column: auto; }
body.m .orb { width: 210px; height: 210px; }
body.m .topbar h1 { font-size: 21px; }
body.m .tabbar {
  display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px);
}
body.m .tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 650; color: var(--muted); padding: 6px 0; cursor: pointer; }
body.m .tabbar button svg { width: 22px; height: 22px; }
body.m .tabbar button[aria-current="page"] { color: var(--accent); }
body.m .chat { position: fixed; right: 0; top: 0; bottom: 0; width: 100vw; z-index: 40; transform: translateX(100%); transition: transform .25s ease; }
body.m .shell.chat-open .chat { transform: none; }
body.m .chat-fab { display: grid; place-items: center; bottom: calc(76px + env(safe-area-inset-bottom)); }
body.m .shell.chat-open .chat-fab { display: none; }
body.m .cat-head { grid-template-columns: auto minmax(0, 1fr) auto; }
body.m .cat-head .badge { display: none; }
body.m .fix { flex-wrap: wrap; }
body.m .fix .act { margin-left: 46px; justify-content: flex-start; }
body.m .action-bar { bottom: calc(80px + env(safe-area-inset-bottom)); }
body.m .hide-mobile { display: none !important; }
body.m[data-layout="mobile"] .main { max-width: 560px; margin: 0 auto; width: 100%; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
