:root {
  --bg: #f7f4ef;
  --bg-2: #efeae3;
  --card: #ffffff;
  --hover: #f3eee8;
  --line: #e4ddd4;
  --line-2: #d4cbc0;
  --gold: #b42318;
  --gold-2: #c63a2f;
  --gold-d: #8a1a12;
  --blue: #102a4a;
  --blue-2: #1e4a7a;
  --on-accent: #ffffff;
  --ink: #102a4a;
  --muted: #5c6a7a;
  --dim: #8a93a0;
  --ok: #2f7d4a;
  --danger: #b42318;
  --warn: #b45309;
  --info: #1e4a7a;
  --pole: repeating-linear-gradient(
    90deg,
    #b42318 0 14px,
    #f7f4ef 14px 20px,
    #102a4a 20px 34px,
    #f7f4ef 34px 40px
  );
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 42, 74, 0.05), 0 8px 24px rgba(16, 42, 74, 0.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  font-weight: 400;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }
a { color: var(--blue-2); text-decoration: none; }
body.bp-app .wrap {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}
.sidebar {
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
}
.sidebar::before {
  content: "";
  display: block;
  height: 3px;
  background: var(--pole);
  flex-shrink: 0;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 24px; color: var(--ink); font-weight: 700; letter-spacing: 0.12em;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(180deg, var(--gold) 0 36%, #ffffff 36% 48%, var(--blue) 48%);
  color: var(--on-accent);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.side-nav { display: grid; gap: 2px; padding: 0 12px; flex: 1; align-content: start; }
.side-label {
  margin: 16px 0 6px; font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--dim); font-weight: 500;
}
.side-pick { margin: 0 12px 8px; }
.side-pick select { height: 36px; font-size: 13px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); padding: 10px 12px; border-radius: 8px;
  border-left: 2px solid transparent; transition: 150ms ease;
}
.side-nav a:hover { background: var(--hover); color: var(--ink); }
.side-nav a.active { background: rgba(16, 42, 74, 0.06); color: var(--blue); border-left-color: var(--gold); }
.side-foot {
  border-top: 1px solid var(--line); padding: 16px;
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 999px; background: var(--bg-2);
  color: var(--blue); display: grid; place-items: center; font-weight: 600; font-size: 12px;
}
.side-foot small { display: block; color: var(--muted); font-size: 12px; }
.workspace { min-width: 0; display: flex; flex-direction: column; overflow: auto; }
.topbar {
  height: 56px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--card);
}
.topbar-titles { display: flex; align-items: baseline; gap: 12px; min-width: 0; flex: 1; }
.topbar h1 { margin: 0; font-size: 16px; font-weight: 600; }
.topbar .shop { color: var(--muted); font-size: 13px; }
.topbar .clock { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.menu-btn, .dock, .nav-scrim { display: none; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.page { padding: 24px 32px 48px; }
.kicker { margin: 0 0 16px; font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stats-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  position: relative; transition: border-color 200ms; box-shadow: var(--shadow);
}
.stat-card:hover { border-color: var(--line-2); }
.stat-label { display: block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stat-value { display: block; margin-top: 8px; font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-top: 16px;
  box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.sub { margin: 0; color: var(--muted); }
label { display: grid; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); margin: 8px 0; }
input, select, textarea, button { font: inherit; border-radius: 8px; }
input, select, textarea {
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  height: 40px; padding: 0 12px; width: 100%;
}
textarea { height: auto; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border: 1.5px solid var(--blue); }
input::placeholder { color: var(--dim); }
button {
  background: var(--gold); color: var(--on-accent); border: 0; height: 36px; padding: 0 20px;
  font-weight: 600; cursor: pointer; transition: 150ms ease;
}
button:hover { background: var(--gold-2); }
button:active { transform: scale(0.98); }
button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.secondary:hover { background: var(--hover); }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
button.danger:hover { background: rgba(239, 68, 68, 0.15); }
button.ghost { background: transparent; color: var(--muted); border: 0; }
.form-grid { display: grid; gap: 8px 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.split { display: grid; gap: 16px; grid-template-columns: 1.1fr 0.9fr; }
.company-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.company-list li {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px;
  border-left: 3px solid var(--blue);
}
.company-list li.ok { border-left-color: var(--ok); }
.company-list li.warn { border-left-color: var(--warn); }
.company-list li.bad { border-left-color: var(--danger); }
.company-list small { display: block; color: var(--muted); }
.agenda-roll {
  display: grid;
  gap: 18px;
  margin-top: 1rem;
  max-height: min(70vh, 720px);
  overflow: auto;
  padding-right: 4px;
  scroll-behavior: smooth;
}
.agenda-hour {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px 14px;
  align-items: start;
}
.agenda-hour h3 {
  margin: 0;
  padding-top: 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.agenda-hour.now h3 { color: var(--blue); }
.agenda-hour ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.agenda-hour li {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px;
  border-left: 3px solid var(--blue);
}
.agenda-hour li.warn { border-left-color: var(--warn); }
.agenda-hour li.ok { border-left-color: var(--ok); }
.agenda-hour li small { display: block; color: var(--muted); }
.agenda-item .when {
  font-variant-numeric: tabular-nums;
  color: var(--blue);
}
.agenda-item.next { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mini-form { display: grid; gap: 8px; margin-top: 12px; }
.msg { min-height: 1.2rem; font-size: 13px; color: var(--muted); }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--danger); }
.empty { color: var(--muted); }
.dash-table { width: 100%; border-collapse: collapse; }
.dash-table th {
  text-align: left; background: var(--bg-2); color: var(--muted); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; height: 40px; padding: 0 16px;
}
.dash-table td { height: 52px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.dash-table tbody tr:nth-child(even) { background: var(--bg-2); }
.dash-table tbody tr:hover { background: var(--hover); }
.table-wrap { overflow-x: auto; margin-top: 8px; }
.pay-track { height: 6px; border-radius: 99px; background: var(--bg-2); margin-top: 6px; overflow: hidden; }
.pay-fill { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.rel-kpi-note { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.badge { display: inline-block; border-radius: 6px; padding: 4px 10px; font-size: 11px; font-weight: 500; background: var(--bg-2); color: var(--muted); }
.badge.on { background: rgba(34, 197, 94, 0.15); color: var(--ok); }
.badge.warn { background: rgba(245, 158, 11, 0.15); color: var(--warn); }
.badge.bad { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge.info { background: rgba(57, 130, 246, 0.15); color: var(--info); }
.row-appt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg-2); border-radius: 8px; margin-bottom: 6px; }
.row-appt .t { color: var(--blue); font-weight: 600; width: 52px; }
footer { margin-top: 24px; color: var(--dim); font-size: 12px; }
body.auth { display: grid; place-items: center; min-height: 100vh; background: var(--bg); }
body.auth .card button[type="submit"] { width: 100%; height: 44px; margin-top: 8px; }
.card {
  width: min(420px, calc(100% - 32px)); background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 32px; box-shadow: var(--shadow);
}
.hidden { display: none !important; }
.landing-hero { padding: 80px 32px 40px; max-width: 880px; margin: 0 auto; }
.landing-hero h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 600; margin: 0 0 16px; letter-spacing: -0.04em; }
.landing-hero p { color: var(--muted); max-width: 520px; }
.landing-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.landing-actions a { padding: 0 20px; height: 40px; display: inline-flex; align-items: center; border-radius: 8px; font-weight: 600; }
.landing-actions .go { background: var(--gold); color: var(--on-accent); }
.landing-actions .ghost { border: 1px solid var(--line); color: var(--ink); }
body.lp { background: var(--bg); }
.lp-nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding: 16px 32px;
  border-bottom: 1px solid var(--line); background: rgba(247,244,239,.94);
  backdrop-filter: blur(10px);
}
.lp-nav::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--pole);
}
.lp-hero {
  padding: 72px 32px 48px; max-width: 920px; margin: 0 auto;
}
.lp-hero h1, .lp-section h2, .lp-cta h2, .lp-jarvis-copy h2 {
  font-size: clamp(28px, 4.6vw, 48px); font-weight: 800; letter-spacing: -0.04em;
  margin: 0 0 16px; line-height: 1.15;
}
.lp-kicker {
  margin: 0 0 12px; font-size: 12px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--blue);
}
.lp-lead { color: var(--muted); max-width: 640px; font-size: 16px; margin: 0; }
.lp-note { margin: 16px 0 0; color: var(--dim); font-size: 13px; }
.lp-section { padding: 24px 32px 56px; max-width: 1100px; margin: 0 auto; }
.lp-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 28px;
}
.lp-grid-3 { grid-template-columns: repeat(3, 1fr); }
.lp-grid article {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 20px; border-top: 2px solid transparent; box-shadow: var(--shadow);
}
.lp-grid article:hover { border-top-color: var(--blue); }
.lp-grid h3 { margin: 0 0 8px; font-size: 15px; }
.lp-grid p { margin: 0; color: var(--muted); font-size: 13px; }
.lp-jarvis {
  max-width: 1100px; margin: 0 auto 16px; padding: 0 32px 48px;
  display: grid; gap: 28px; grid-template-columns: 1.05fr 0.95fr; align-items: start;
}
.lp-exclusive {
  display: inline-block; margin-bottom: 12px;
  background: rgba(180, 35, 24, 0.08); color: var(--gold);
  border: 1px solid rgba(180, 35, 24, 0.22); border-radius: 999px;
  padding: 4px 12px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lp-jarvis-copy p { color: var(--muted); font-size: 16px; }
.lp-jarvis-copy em { color: var(--blue); font-style: normal; font-weight: 600; }
.lp-checks { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.lp-checks li {
  padding-left: 22px; position: relative; color: var(--ink); font-size: 14px;
}
.lp-checks li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 8px; height: 8px; border-radius: 99px; background: var(--blue);
}
.lp-chat {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; border-left: 3px solid var(--blue); box-shadow: var(--shadow);
}
.lp-chat-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.lp-chat-head .mark {
  width: 28px; height: 28px; border-radius: 999px;
  background: linear-gradient(180deg, var(--gold) 0 36%, #ffffff 36% 48%, var(--blue) 48%);
  color: var(--on-accent);
  display: grid; place-items: center; font-size: 13px;
}
.lp-chat-head small { color: var(--muted); font-weight: 500; margin-left: auto; font-size: 11px; }
.lp-bubble {
  max-width: 92%; padding: 10px 12px; border-radius: 12px;
  font-size: 13px; margin-bottom: 8px; line-height: 1.45;
}
.lp-bubble.me { background: var(--gold); color: var(--on-accent); margin-left: auto; border-bottom-right-radius: 4px; }
.lp-bubble.bot { background: var(--hover); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.lp-cta {
  max-width: 920px; margin: 0 auto 32px; padding: 40px 32px;
  text-align: center; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow);
}
.lp-cta p { color: var(--muted); max-width: 560px; margin: 0 auto; }
.lp-cta .landing-actions { justify-content: center; }
.lp-foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 24px 32px 40px; color: var(--dim); font-size: 12px;
  border-top: 1px solid var(--line);
}
@media (max-width: 900px) {
  .lp-nav, .lp-hero, .lp-section, .lp-jarvis, .lp-foot { padding-left: 16px; padding-right: 16px; }
  .lp-grid, .lp-grid-3, .lp-jarvis { grid-template-columns: 1fr; }
  .lp-cta { margin-left: 16px; margin-right: 16px; padding: 32px 16px; }
}
.chart-grid { display: grid; gap: 16px; grid-template-columns: 1.2fr 0.8fr; margin-top: 16px; }
.chart-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 8px; box-shadow: var(--shadow); }
.chart-box h2 { margin: 0 0 4px; font-size: 14px; }
.chart-box svg { width: 100%; height: 220px; display: block; }
.delta { font-size: 13px; font-weight: 600; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.pw-cell { display: flex; align-items: center; gap: 8px; font-family: ui-monospace, Consolas, monospace; }
.pw-cell code { background: var(--bg-2); padding: 4px 8px; border-radius: 6px; }
.pw-cell button { height: 28px; padding: 0 10px; font-size: 12px; }
.jv-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--blue); color: var(--blue);
  border-radius: 50px; padding: 12px 20px; font-weight: 600; cursor: pointer;
  transition: 150ms ease; box-shadow: 0 8px 24px rgba(15,23,42,.12);
}
.jv-fab:hover { background: var(--hover); transform: scale(1.05); }
.jv-fab .mark, .jv-head .mark {
  width: 28px; height: 28px; border-radius: 999px;
  background: linear-gradient(180deg, var(--gold) 0 36%, #ffffff 36% 48%, var(--blue) 48%);
  color: var(--on-accent);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.jv-fab .dot, .dock-jv .dot {
  min-width: 18px; height: 18px; border-radius: 999px; background: var(--danger);
  color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 5px;
}
.jv-panel {
  position: fixed; right: 24px; bottom: 84px; z-index: 41;
  width: min(380px, calc(100vw - 32px)); height: min(520px, calc(100vh - 120px));
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  display: none; flex-direction: column; overflow: hidden;
  box-shadow: 0 18px 50px rgba(15,23,42,.15);
}
.jv-panel.open { display: flex; }
.jv-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--line); font-weight: 600;
  background: var(--bg-2);
}
.jv-head-txt { display: grid; line-height: 1.2; min-width: 0; }
.jv-head-txt strong { font-size: 14px; }
.jv-head small, .jv-head-txt small { color: var(--muted); font-weight: 400; font-size: 11px; }
.jv-head .sp { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.jv-head .jv-full, #jvClose {
  height: 32px; padding: 0 10px; font-size: 12px; display: inline-flex; align-items: center;
}
.jv-msgs { flex: 1; overflow: auto; padding: 14px 12px; display: grid; gap: 10px; align-content: start; }
.jv-msg { max-width: 90%; padding: 10px 12px; border-radius: 12px; white-space: pre-wrap; font-size: 13px; }
.jv-msg.bot { background: var(--bg-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.jv-msg.bot.rich { max-width: 100%; font-variant-numeric: tabular-nums; }
.jv-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.jv-link {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px;
  background: var(--blue); color: #fff; border-radius: 8px; font-size: 13px; font-weight: 600;
}
.jv-link:hover { color: #fff; background: var(--blue-2); }
.jv-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; }
.jv-chips button {
  height: 28px; padding: 0 10px; font-size: 12px; background: transparent;
  color: var(--ink); border: 1px solid var(--line);
}
.jv-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--bg); align-items: center; }
.jv-input input { flex: 1; }
.jv-input button { height: 40px; }
.jv-mic {
  width: 40px; height: 40px; padding: 0; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--bg); color: var(--blue); border: 1px solid var(--line);
}
.jv-mic:hover { background: var(--hover); }
.jv-mic.on {
  background: var(--danger); color: #fff; border-color: var(--danger);
  animation: jvPulse 1.1s ease-in-out infinite;
}
.jv-mic.off { opacity: .4; }
@keyframes jvPulse {
  50% { transform: scale(1.08); }
}
.jv-cards { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.jv-card {
  min-width: 260px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; border-left: 3px solid var(--info); box-shadow: var(--shadow);
}
.jv-card.crit { border-left-color: var(--danger); }
.jv-card.warn { border-left-color: var(--warn); }
.jv-card.ok { border-left-color: var(--ok); }
.jv-card p { margin: 0 0 10px; }
.jv-page { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; min-height: 60vh; }
.jv-intel .item { cursor: pointer; margin-bottom: 8px; }
button.gold { background: var(--gold); color: var(--on-accent); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.tabs button {
  height: 32px; padding: 0 14px; font-size: 12px; font-weight: 500;
  background: transparent; color: var(--muted); border: 1px solid var(--line);
}
.tabs button.on { background: var(--blue); color: var(--on-accent); border-color: var(--blue); }
.panel-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 12px;
}
.panel-head h2 { margin: 0; }
.link-muted { color: var(--muted); font-size: 13px; text-decoration: none; }
.link-muted:hover { color: var(--blue); }
.demand-split h3, .demand-title {
  font-size: 14px; font-weight: 600; margin: 0 0 10px;
}
.demand-title.demand-top { color: var(--blue); }
.demand-title.demand-low { color: var(--gold); }
.demand-split .company-list li.bad { border-left-color: var(--danger); }
.rel-barber-head label { display: block; max-width: 320px; }
.rel-barber-head select { width: 100%; }
.slots { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.slots button {
  height: 32px; padding: 0 10px; font-size: 12px; background: var(--bg-2);
  color: var(--ink); border: 1px solid var(--line);
}
.slots button:hover, .slots button.on { border-color: var(--blue); color: var(--blue); }
.slots button.busy {
  opacity: 0.4;
  text-decoration: line-through;
  cursor: not-allowed;
  pointer-events: none;
}
.slots-legend { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.drawer {
  position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.55);
  display: none; place-items: center; padding: 16px;
}
.drawer.open { display: grid; }
.drawer .box {
  width: min(720px, 100%); max-height: 90vh; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px;
}
.pre {
  white-space: pre-wrap; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px; font-size: 13px; font-family: ui-monospace, Consolas, monospace;
}
.tips { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 12px; padding: 16px 20px; margin-bottom: 16px; }
.tips ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
@media (max-width: 900px) {
  html { -webkit-text-size-adjust: 100%; }
  body.bp-app .wrap { display: block; min-height: 100dvh; }
  body.bp-app {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
  body.nav-open { overflow: hidden; }
  .menu-btn {
    display: grid; place-items: center; flex-shrink: 0;
    width: 44px; height: 44px; padding: 0; margin: 0;
    background: var(--card); color: var(--ink); border: 1px solid var(--line);
    font-size: 20px; line-height: 1;
  }
  .topbar {
    height: auto; min-height: 56px;
    padding: 8px 12px;
    padding-top: max(8px, env(safe-area-inset-top, 0px));
    gap: 10px; position: sticky; top: 0; z-index: 25;
  }
  .topbar-titles { flex-direction: column; gap: 0; align-items: flex-start; }
  .topbar h1 { font-size: 15px; }
  .topbar .clock { display: none; }
  .page { padding: 16px 12px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: min(300px, 86vw); z-index: 55;
    transform: translateX(-105%);
    transition: transform 200ms ease;
    min-height: 100dvh; max-height: 100dvh;
    flex-direction: column; flex-wrap: nowrap;
    overflow: auto;
    border-right: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--card);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .side-nav { display: grid; flex: 1; }
  .side-nav a { min-height: 44px; }
  .side-foot { border-top: 1px solid var(--line); padding: 12px; flex-wrap: wrap; }
  .nav-scrim {
    display: none; position: fixed; inset: 0; z-index: 50;
    background: rgba(0,0,0,.55);
  }
  body.nav-open .nav-scrim { display: block; }
  .dock {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--card); border-top: 1px solid var(--line);
  }
  .dock a, .dock-more, .dock-jv {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: var(--muted); font-size: 11px; font-weight: 600;
    height: 64px; background: transparent; border: 0; padding: 0; border-radius: 0;
    position: relative;
  }
  .dock a.active, .dock-more:active, .dock-jv.active { color: var(--blue); }
  .dock-jv .dot {
    position: absolute; top: 6px; right: calc(50% - 18px);
  }
  .dock-ico {
    width: 22px; height: 22px; display: grid; place-items: center;
    font-size: 12px; font-weight: 700;
  }
  .dock-ico.jv {
    width: 22px; height: 22px; border-radius: 6px;
    background: linear-gradient(180deg, var(--gold) 0 36%, #ffffff 36% 48%, var(--blue) 48%);
    color: var(--on-accent);
  }
  .jv-fab { display: none; }
  body.jv-open { overflow: hidden; }
  .jv-panel {
    display: flex;
    left: 0; right: 0; top: 0; bottom: 0;
    width: 100%; height: 100dvh;
    border-radius: 0; border: 0;
    z-index: 70;
    transform: translateY(110%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 280ms ease, visibility 280ms;
    padding-top: env(safe-area-inset-top, 0px);
  }
  .jv-panel.open {
    display: flex;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }
  .jv-head { min-height: 56px; padding: 10px 12px; }
  .jv-head .jv-full, #jvClose { min-height: 36px; height: 36px; }
  .jv-msgs { padding: 16px 14px; gap: 12px; }
  .jv-msg { font-size: 15px; max-width: 88%; }
  .jv-chips {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding: 0 12px 10px;
  }
  .jv-chips button {
    flex-shrink: 0; min-height: 36px; height: 36px;
  }
  .jv-input {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .jv-input input { font-size: 16px; min-height: 44px; height: 44px; }
  .jv-input button { min-height: 44px; height: 44px; }
  .jv-mic { width: 44px; height: 44px; min-height: 44px; }
  .jv-page {
    display: flex; flex-direction: column;
    min-height: calc(100dvh - 140px);
  }
  .jv-page .jv-intel { order: 2; }
  .jv-page > .panel:last-of-type {
    order: 1; flex: 1; min-height: 58vh;
    position: sticky; top: 56px;
  }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 22px; }
  .split, .chart-grid, .jv-page { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .actions-row { gap: 8px; }
  .actions-row button, .actions-row a, button {
    min-height: 44px;
  }
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tabs button { min-height: 40px; flex-shrink: 0; }
  .slots button { min-height: 40px; }
  .row-appt { flex-wrap: wrap; gap: 8px; }
  .row-appt small { margin-left: 0 !important; width: 100%; }
  .drawer { padding: 0; align-items: end; }
  .drawer .box {
    width: 100%; max-height: 92dvh; border-radius: 16px 16px 0 0;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .dash-table th, .dash-table td { padding: 10px 12px; height: auto; white-space: nowrap; }
  .jv-page { min-height: 50vh; }
  body.auth { padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
  .card { padding: 24px 20px; }
  input, select, textarea { font-size: 16px; min-height: 44px; height: 44px; }
  textarea { height: auto; min-height: 88px; }
}
@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
}

.top-m-btn {
  flex-shrink: 0;
  height: 32px; padding: 0 12px;
  display: inline-flex; align-items: center;
  background: var(--blue); color: #fff; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
}
.top-m-btn:hover { color: #fff; background: var(--blue-2); }
.m-launch {
  display: flex; flex-direction: column; gap: 4px;
  margin: 0 0 20px; padding: 18px 20px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--gold); border-radius: var(--radius);
  box-shadow: var(--shadow); color: inherit;
}
.m-launch-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gold);
}
.m-launch strong { font-size: 18px; color: var(--ink); }
.m-launch span:last-child { color: var(--muted); font-size: 13px; }

body.m-root {
  background: var(--bg);
  padding: 0;
}
body.m-root .jv-fab { display: none !important; }
.m-app {
  min-height: 100dvh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}
.m-head {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px 14px;
  padding-top: max(14px, calc(env(safe-area-inset-top, 0px) + 10px));
  background: var(--card); border-bottom: 1px solid var(--line);
}
.m-head::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0;
  height: 3px; background: var(--pole);
}
.m-shop { margin: 0; font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.m-head h1 { margin: 2px 0 0; font-size: 22px; }
.m-head .ghost { height: 36px; padding: 0 12px; font-size: 12px; }
.m-view { display: none; padding: 16px 16px 96px; }
.m-view[data-view="casa"] label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.m-view[data-view="casa"] button { width: 100%; margin: 8px 0 16px; }
.m-view.on { display: block; }
.m-hello { margin: 0 0 16px; color: var(--muted); }
.m-next {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.m-next small { color: var(--muted); display: block; margin-bottom: 4px; }
.m-next strong { font-size: 20px; display: block; }
.m-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.m-tile {
  min-height: 108px; padding: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: flex-end;
  gap: 6px; text-align: left; color: var(--ink);
}
.m-tile em { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 600; }
.m-tile strong { font-size: 18px; }
.m-tile.pri { background: var(--blue); color: #fff; border-color: var(--blue); }
.m-tile.pri em { color: rgba(255,255,255,.7); }
.m-cashline {
  margin-top: 16px; padding: 14px 16px; background: var(--card);
  border-radius: 12px; border: 1px solid var(--line);
  display: flex; justify-content: space-between; font-weight: 700;
}
.m-daybar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.m-daybar input { flex: 1; }
.m-daybar button { min-width: 44px; padding: 0; }
.m-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.m-card .when { font-size: 22px; font-weight: 700; color: var(--blue); }
.m-card .who { font-size: 17px; font-weight: 600; margin: 4px 0; }
.m-card small { color: var(--muted); display: block; }
.m-card .m-act { width: 100%; min-height: 48px; margin-top: 12px; }
.m-more { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.m-more button { min-height: 40px; }
.m-fab {
  position: fixed; right: 16px;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  z-index: 15; min-height: 48px; border-radius: 999px; padding: 0 20px;
}
.m-sheet {
  display: none; position: fixed; inset: 0; z-index: 40;
  background: rgba(16,42,74,.45); place-items: end;
}
.m-sheet.open { display: grid; }
.m-sheet .box {
  background: var(--card); border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  max-height: 88dvh; overflow: auto; width: 100%;
}
.m-sheet h2 { margin: 0 0 12px; }
.m-sheet label { margin: 0 0 10px; }
.m-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(68px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--card); border-top: 1px solid var(--line);
}
.m-nav button {
  height: 68px; background: transparent; color: var(--muted);
  border: 0; border-radius: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; font-weight: 700; padding: 0;
}
.m-view[data-view="jarvis"].on {
  display: flex;
  flex-direction: column;
  padding: 0;
  height: calc(100dvh - 58px - 68px - env(safe-area-inset-bottom, 0px));
  height: calc(100dvh - 58px - 68px - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px));
}
.m-jv { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.m-jv-intel {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px 0;
  -webkit-overflow-scrolling: touch;
}
.m-jv-intel .jv-card {
  min-width: 220px; text-align: left; font-size: 13px; font-weight: 500;
  padding: 12px; margin: 0; color: var(--ink); background: var(--card);
}
.m-jv-msgs { flex: 1; min-height: 0; }
.m-jv-form {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  background: var(--card);
}
.m-nav-jv .dock-ico.jv { margin-bottom: 2px; }
.m-search { margin-bottom: 12px; }
.m-msg { min-height: 1.2em; font-size: 13px; color: var(--muted); margin: 8px 0; }
@media (min-width: 901px) {
  .m-app { max-width: 430px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
