:root {
  --bg: #f5f7f6;
  --bg-soft: #eef2f0;
  --card: #ffffff;
  --ink: #0f1c1e;
  --ink-soft: #33474a;
  --muted: #6b7c7e;
  --line: #e3e9e6;
  --line-strong: #d3dcd8;
  --accent: #0d9488;
  --accent-deep: #0f766e;
  --accent-soft: #ccfbf1;
  --navy: #0f172a;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --violet: #6d28d9;
  --amber: #b45309;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 28, 30, 0.04), 0 10px 24px -18px rgba(15, 28, 30, 0.35);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

html { height: 100%; }

body {
  min-height: 100%;
  background:
    radial-gradient(900px 420px at 12% -12%, rgba(13, 148, 136, 0.16), transparent 62%),
    radial-gradient(700px 380px at 100% 0%, rgba(15, 23, 42, 0.06), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }

a { color: var(--accent-deep); text-decoration: none; }

button { font-family: inherit; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0; }
ol, ul { margin: 0; padding-left: 1.15em; }

.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 0.92em; letter-spacing: 0.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 11.5px; }
.bad-text { color: var(--bad); }
.ok-text { color: var(--ok); }
.center { text-align: center; }
.hint-line { color: var(--muted); font-size: 12px; text-align: center; padding: 4px 0 2px; }
.link { background: none; border: 0; padding: 0; color: var(--accent-deep); font-size: 13px; cursor: pointer; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 8px; }
.view-pad { padding: 16px 16px calc(96px + var(--safe-bottom)); max-width: 760px; margin: 0 auto; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- top bar ---------- */
#app { min-height: 100vh; }

#topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  max-width: 760px;
  margin: 0 auto;
  background: rgba(245, 247, 246, 0.82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}

.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }

.logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(140deg, #14b8a6, #0f172a);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px -8px rgba(13, 148, 136, 0.8);
}

.brand-name { font-weight: 700; font-size: 16px; letter-spacing: 0.04em; }

#top-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 132px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.top-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.top-status.ok { color: var(--ok); border-color: #bfe6cd; background: #f0fdf4; }
.top-status.warn { color: var(--warn); border-color: #f2dfc2; background: #fffbeb; }

/* ---------- tab bar ---------- */
#tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 6px 8px calc(6px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px 4px;
  border-radius: 12px;
  color: #8b9a9c;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.15s, background 0.15s;
}

.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--accent-deep); background: #e9f8f4; }
.tab:active { background: var(--bg-soft); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 20px 18px 16px;
  background:
    radial-gradient(420px 220px at 88% -10%, rgba(45, 212, 191, 0.45), transparent 70%),
    linear-gradient(150deg, #0f172a 0%, #113f3d 60%, #0d5f57 100%);
  color: #f8fafc;
  box-shadow: 0 22px 44px -30px rgba(15, 23, 42, 0.9);
}

.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hero-kicker { font-size: 11.5px; letter-spacing: 0.08em; color: #99f6e4; text-transform: uppercase; margin-bottom: 4px; }
.hero h1 { font-size: 21px; line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
.hero-sub { margin-top: 4px; font-size: 12px; color: #b9d7d3; }
.hero-score {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
}
.hero-score b { font-size: 22px; }
.hero-score span { font-size: 9px; color: #b9d7d3; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 18px; }
.kpi {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  padding: 9px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.kpi span { font-size: 9.5px; color: #b9d7d3; letter-spacing: 0.03em; }
.kpi b { font-size: 18px; font-weight: 650; }
.kpi b.small-num { font-size: 12.5px; line-height: 1.35; overflow-wrap: anywhere; }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card.flat { background: #fbfcfb; box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h2 { font-size: 15.5px; }
.card-head h3 { font-size: 14px; }

.pill {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
.pill.ghost { background: var(--bg-soft); color: var(--muted); }

.note {
  margin-top: 10px;
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  color: #115e59;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.55;
}
.note.warn { background: #fffbeb; border-color: #fde8c0; color: #92400e; }
.note code { background: rgba(15, 23, 42, 0.06); padding: 1px 5px; border-radius: 5px; font-size: 11px; }

.ticks { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 5px; }
.ticks li { position: relative; padding-left: 17px; font-size: 13px; }
.ticks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
}

.steps { padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-soft); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn.primary {
  background: linear-gradient(160deg, #0fa697, #0b7f74);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 20px -14px rgba(13, 148, 136, 0.9);
}
.btn.primary:hover { background: linear-gradient(160deg, #12b3a2, #0b7f74); }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-soft); }
.btn.danger { color: var(--bad); border-color: #f3c9c9; }
.btn.danger.ghost { background: transparent; }
.btn.tiny { min-height: 30px; padding: 4px 10px; font-size: 12px; border-radius: 9px; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn-row.wrap { flex-wrap: wrap; }
.btn-row .grow { flex: 1; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 0;
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  flex: none;
}
.icon-btn:active { background: var(--line); }

.fab {
  position: fixed;
  right: 18px;
  bottom: calc(78px + var(--safe-bottom));
  z-index: 35;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  border: 0;
  background: linear-gradient(160deg, #10b3a3, #0b7f74);
  color: #fff;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  box-shadow: 0 16px 28px -14px rgba(13, 148, 136, 0.9);
  cursor: pointer;
}
.fab:active { transform: scale(0.96); }
@media (min-width: 800px) { .fab { right: calc(50vw - 380px + 18px); } }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.grow { flex: 1; }
.field-label { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.field small { font-size: 11px; color: var(--muted); line-height: 1.4; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 16px;
  font-family: inherit;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 44px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 14px center, right 9px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 26px; }

.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: nowrap; }
.form-row > .field { flex: 1; min-width: 0; }
.form-row > .field.grow { flex: 1.4; }
.form-row .self-end { align-self: flex-end; }
@media (max-width: 420px) { .form-row { flex-wrap: wrap; gap: 8px; } }

.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink-soft); padding: 4px 0; }
.check input { width: 18px; height: 18px; flex: none; margin-top: 1px; accent-color: var(--accent); }
.check.self-end { align-self: flex-end; }

.details { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 8px 10px; }
.details > summary { font-size: 12.5px; color: var(--ink-soft); cursor: pointer; }
.details[open] > summary { margin-bottom: 8px; }
.details > textarea, .details > .stack { margin-top: 4px; }

.search input { background: #fff; }
.toolbar { display: flex; gap: 8px; align-items: stretch; }
.toolbar .search { flex: 1; }

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.model-list { display: flex; flex-wrap: wrap; gap: 8px; }
.model-pick { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }

.tag {
  display: inline-block;
  font-size: 10.5px;
  color: var(--accent-deep);
  background: #ecfdf5;
  border-radius: 6px;
  padding: 2px 7px;
  font-weight: 600;
}
.chip-mini {
  font-size: 10.5px;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: 6px;
  padding: 2px 6px;
  white-space: nowrap;
}

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }

.product-card, .lead-card, .follow-row, .rec-row, .hist-row, .file-row, .msg {
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 13px 14px;
  color: inherit;
  font-family: inherit;
  box-shadow: var(--shadow);
}
.product-card, .lead-card, .follow-row { cursor: pointer; }
.product-card:active, .lead-card:active, .follow-row:active { background: #fafcfb; }
.product-card { display: flex; flex-direction: column; gap: 6px; }
.pc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pc-name { font-size: 15px; font-weight: 650; line-height: 1.3; }
.pc-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pc-price { font-size: 14px; font-weight: 700; color: var(--accent-deep); white-space: nowrap; }
.pc-foot { display: flex; justify-content: space-between; gap: 8px; align-items: center; border-top: 1px dashed var(--line); padding-top: 7px; margin-top: 2px; }

.lead-card { display: flex; flex-direction: column; gap: 6px; }
.lc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.lc-title { font-size: 14.5px; font-weight: 650; line-height: 1.35; }
.lc-sub { font-size: 11.5px; color: var(--muted); }
.lc-need { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.lc-foot { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: 7px; margin-top: 2px; }

.score-none { font-size: 10.5px; color: var(--muted); background: var(--bg-soft); border-radius: 999px; padding: 4px 9px; white-space: nowrap; flex: none; }

.score {
  --p: 0;
  --sc: #64748b;
  width: 50px;
  height: 50px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--sc) calc(var(--p) * 1%), rgba(15, 28, 30, 0.08) 0);
  display: grid;
  place-items: center;
}
.score.hot { --sc: #059669; }
.score.warm { --sc: #d97706; }
.score.cool { --sc: #64748b; }
.score-inner {
  width: calc(100% - 7px);
  height: calc(100% - 7px);
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.score-inner b { font-size: 15px; }
.score-inner span { font-size: 8px; color: var(--muted); margin-top: 2px; }

.follow-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; box-shadow: none; margin-top: 8px; }
.follow-row > div { min-width: 0; }
.follow-row b { font-size: 13.5px; font-weight: 600; }
.chev { color: #b6c2c1; font-size: 18px; flex: none; }

.status {
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}
.status.blue { background: #eff6ff; color: #1d4ed8; }
.status.amber { background: #fffbeb; color: var(--amber); }
.status.violet { background: #f5f3ff; color: var(--violet); }
.status.green { background: #ecfdf5; color: var(--ok); }
.status.gray { background: #f3f4f6; color: #6b7280; }

.hist-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; box-shadow: none; margin-top: 7px; padding: 10px 12px; }
.rec-row { box-shadow: none; padding: 10px 12px; margin-top: 7px; }
.rec-row b { font-size: 13px; }

/* ---------- detail ---------- */
.detail-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.detail-title { font-size: 19px; line-height: 1.3; margin: 2px 0; }
.detail-price { font-size: 18px; font-weight: 700; color: var(--accent-deep); text-align: right; white-space: nowrap; }
.detail-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

.block { display: flex; flex-direction: column; gap: 6px; }
.block h4 { font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.block p { font-size: 13.5px; color: var(--ink-soft); white-space: pre-wrap; }
.block a.link { word-break: break-all; }

.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kv-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.kv-grid > div { background: #fbfcfb; border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px; min-width: 0; }
.kv-grid span { display: block; font-size: 10px; color: var(--muted); letter-spacing: 0.02em; }
.kv-grid b { display: block; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 560px) { .kv-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.pre {
  margin: 0;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 280px;
  overflow: auto;
  color: var(--ink-soft);
  font-family: "SFMono-Regular", Consolas, monospace;
}
.pre.tall { max-height: 60vh; }
.pre.small { font-size: 11px; }

.mailbox { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mail-subject { background: #f0fdfa; color: #115e59; font-size: 12.5px; font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.mailbox .pre { border: 0; border-radius: 0; background: #fff; max-height: 320px; }

.msg { box-shadow: none; padding: 9px 11px; }
.msg summary { font-size: 12px; color: var(--ink-soft); cursor: pointer; }
.msg .pre { margin-top: 8px; }

.file-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; box-shadow: none; margin-top: 7px; }
.file-main { min-width: 0; }
.file-name { font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.file-acts { display: flex; gap: 4px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.file-list { margin-top: 8px; }

/* ---------- score / empty / loading ---------- */
.empty { text-align: center; padding: 36px 16px; background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty-icon { font-size: 26px; color: var(--accent); opacity: 0.6; }
.empty h3 { margin: 6px 0 4px; font-size: 15px; }
.empty p { font-size: 12.5px; color: var(--muted); max-width: 300px; margin: 0 auto 14px; line-height: 1.6; }

.loading-block { display: grid; place-items: center; padding: 70px 0; }
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(13, 148, 136, 0.22);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-loading { display: flex; align-items: center; gap: 2px; font-size: 12.5px; color: var(--muted); padding: 10px 0; }

/* ---------- sheet ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(12, 22, 24, 0.42);
  opacity: 0;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(2px);
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  width: 100%;
  max-width: 760px;
  max-height: 92vh;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(28px);
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 -18px 40px -24px rgba(15, 23, 42, 0.6);
  overflow: hidden;
}
.sheet-backdrop.open .sheet { transform: translateY(0); }
.sheet.tall { height: 92vh; }
.sheet-grip { width: 38px; height: 4px; border-radius: 999px; background: #d3dcd8; margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 16px 8px; flex: none; }
.sheet-titles { min-width: 0; }
.sheet-titles h3 { font-size: 16.5px; line-height: 1.3; }
.sheet-titles p { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 6px 16px 28px; -webkit-overflow-scrolling: touch; }
.sheet-foot {
  flex: none;
  display: flex;
  gap: 8px;
  padding: 10px 16px calc(12px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.sheet-foot .btn { flex: 1; }

/* ---------- dashboard bits ---------- */
.checklist { display: flex; flex-direction: column; gap: 4px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; color: var(--ink-soft); font-size: 13.5px; border-bottom: 1px dashed var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-row.done { color: var(--muted); }
.check-row.done span:nth-child(2) { text-decoration: line-through; text-decoration-color: #c9d4d1; }
.check-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #fff;
  flex: none;
}
.check-row.done .check-dot { background: var(--accent); border-color: var(--accent); }

.pipe { display: flex; flex-direction: column; gap: 7px; }
.pipe-row { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.pipe-label { width: 44px; color: var(--ink-soft); flex: none; }
.pipe-bar { flex: 1; height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.pipe-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.4s; }
.pipe-bar i.blue { background: #3b82f6; }
.pipe-bar i.amber { background: #f59e0b; }
.pipe-bar i.violet { background: #8b5cf6; }
.pipe-bar i.green { background: #10b981; }
.pipe-bar i.gray { background: #94a3b8; }
.pipe-row b { width: 22px; text-align: right; font-weight: 650; }

.onb-step { display: flex; gap: 12px; align-items: flex-start; }
.onb-step > b {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  display: grid;
  place-items: center;
  font-size: 13px;
}
.onb-step h4 { font-size: 13.5px; }
.onb-step p { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.55; }

/* ---------- quote ---------- */
.quote-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quote-summary > div { background: #fbfcfb; border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px; min-width: 0; }
.quote-summary span { display: block; font-size: 10px; color: var(--muted); }
.quote-summary b { display: block; font-size: 13px; overflow-wrap: anywhere; }
.quote-summary b.big { font-size: 16px; color: var(--accent-deep); }

.calc-box { background: #f0fdfa; border: 1px solid #ccfbf1; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; }
.calc-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; color: #115e59; }
.calc-line.total { border-top: 1px dashed #99f6e4; padding-top: 6px; margin-top: 2px; font-size: 13.5px; }
.calc-line b { font-weight: 650; }

/* ---------- collect ---------- */
.logbox {
  background: #0f1c1e;
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 76px;
  max-height: 280px;
  overflow: auto;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.6;
  color: #cbd5d4;
}
.logbox .muted { color: #7b8f8d; }
.log-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.log-line.dim { color: #8fa3a1; }
.log-line.ok { color: #6ee7b7; }
.log-line.warn { color: #fcd34d; }
.log-line.bad { color: #fca5a5; }
.logbox .btn { margin-top: 8px; }
.progress-box { padding: 4px 0; }
.bar { height: 6px; background: #e6ece9; border-radius: 999px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s; }

/* ---------- toast ---------- */
#toast-host { position: fixed; left: 0; right: 0; bottom: calc(88px + var(--safe-bottom)); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; padding: 0 16px; }
.toast {
  max-width: 92%;
  background: rgba(15, 28, 30, 0.95);
  color: #f8fafc;
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 12.5px;
  line-height: 1.45;
  box-shadow: 0 12px 26px -16px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { background: #0f766e; }
.toast.bad { background: #991b1b; }
.toast.warn { background: #92400e; }

/* ---------- errors ---------- */
#boot-error {
  display: none;
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + var(--safe-bottom));
  z-index: 100;
  background: #7f1d1d;
  color: #fff;
  font-family: monospace;
  font-size: 11px;
  line-height: 1.45;
  padding: 9px 11px;
  border-radius: 10px;
  max-height: 40vh;
  overflow: auto;
  white-space: pre-wrap;
}
.fatal { position: fixed; inset: 0; z-index: 200; background: #fff; padding: 40px 24px; color: var(--bad); font-size: 14px; line-height: 1.7; }

/* ---------- print ---------- */
@media print {
  #topbar, #tabbar, .fab, .sheet-foot, #toast-host, #sheet-root { display: none !important; }
  body { background: #fff; }
  .sheet-backdrop { position: static; background: #fff; opacity: 1; }
  .sheet { max-height: none; box-shadow: none; border-radius: 0; }
  .sheet-body { overflow: visible; }
}

@media (max-width: 380px) {
  .brand-name { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 19px; }
}
