:root {
  --bg: #ffffff;
  --band: #f6f7f9;
  --surface: #ffffff;
  --line: #eaecf0;
  --line-2: #d0d5dd;
  --ink: #111827;
  --ink-2: #4b5563;
  --ink-3: #858d9d;
  --brand: #3858e9;
  --brand-soft: #eef2ff;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --bad: #b91c1c;
  --bad-soft: #fef2f2;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-3); }
.text-brand { color: var(--brand); }
.text-bad { color: var(--bad); }
.nowrap { white-space: nowrap; }
.row-flex { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.surface { display: none; }
.surface.is-active { display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.btn:hover { background: var(--band); border-color: #9ca3af; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #ffffff; }
.btn-brand:hover { background: #2b47d1; border-color: #2b47d1; }
.btn-ink { background: var(--ink); border-color: var(--ink); color: #ffffff; }
.btn-ink:hover { background: #262f40; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); padding: 7px 12px; }
.btn-ghost:hover { background: var(--band); color: var(--ink); border-color: transparent; }
.btn-sm { padding: 6px 13px; font-size: 12.5px; }

/* ================= PUBLIC WEBSITE ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
}
.site-header-in {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: .01em;
  white-space: nowrap;
}
.logo-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--brand);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.logo-sep { color: var(--line-2); }
.logo-sub { color: var(--ink-3); font-size: 13px; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { font-size: 14px; color: var(--ink-2); }
.site-nav a:hover { color: var(--ink); }
.site-actions { display: flex; align-items: center; gap: 10px; }

/* Hero */
.hero {
  padding: 84px 0 68px;
  text-align: center;
  background: var(--bg);
}
.hero-kicker {
  display: inline-block;
  font-size: 13px;
  color: var(--brand);
  margin-bottom: 14px;
  letter-spacing: .02em;
}
.hero h1 {
  margin: 0 auto 18px;
  max-width: 780px;
  font-size: 46px;
  font-weight: 400;
  line-height: 1.24;
  letter-spacing: -.01em;
}
.hero-lede {
  margin: 0 auto 30px;
  max-width: 600px;
  font-size: 16.5px;
  color: var(--ink-2);
  line-height: 1.75;
}
.hero-cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 54px; }

/* Calm Live Comparison Stage */
.compare-stage {
  background: var(--band);
  border-radius: 16px;
  padding: 28px 32px;
  text-align: left;
}
.stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.seg {
  display: inline-flex;
  background: #ebedf2;
  padding: 3px;
  border-radius: 999px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.seg button.is-active { background: var(--surface); color: var(--ink); }
.stage-source {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.stage-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}
.stage-col h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-3);
}
.stage-col p { margin: 0; font-size: 15.5px; line-height: 1.85; color: var(--ink); }
.hl-bad { background: var(--bad-soft); color: var(--bad); padding: 1px 4px; border-radius: 4px; text-decoration: line-through; }
.hl-ok { background: var(--brand-soft); color: var(--brand); padding: 1px 5px; border-radius: 4px; }
.stage-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.stage-teaser {
  margin-top: 14px;
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-2);
}
.stage-teaser[hidden] { display: none; }
.stage-teaser-link { color: var(--brand); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.stage-teaser-link:hover { text-decoration: underline; }

/* Band Sections */
.band { padding: 76px 0; }
.band-gray { background: var(--band); }
.band-head { max-width: 620px; margin-bottom: 44px; }
.band-head h2 { margin: 0 0 10px; font-size: 30px; font-weight: 400; line-height: 1.3; }
.band-head p { margin: 0; font-size: 15px; color: var(--ink-2); }

.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}
.pillar-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.pillar h3 { margin: 0 0 8px; font-size: 17px; font-weight: 400; }
.pillar p { margin: 0; font-size: 14px; color: var(--ink-2); }

/* Commercial Packs */
.packs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.pack-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pack-tile.is-featured { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.packs-pro-note {
  margin: 22px 0 0;
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--band);
  font-size: 13.5px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.pack-tier { font-size: 12.5px; color: var(--brand); }
.pack-name { margin: 0; font-size: 20px; font-weight: 400; line-height: 1.35; }
.pack-desc { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.pack-nums {
  display: flex;
  gap: 24px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.pack-nums span { display: block; font-size: 12px; color: var(--ink-3); }
.pack-nums strong { font-size: 20px; font-weight: 400; color: var(--ink); }
.pack-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; flex: 1; font-size: 13.5px; color: var(--ink-2); }
.pack-list li { display: flex; align-items: flex-start; gap: 8px; }
.pack-list li i { color: var(--brand); margin-top: 3px; flex-shrink: 0; }

/* Public Term Lookup Bar */
.lookup-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--band);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 24px;
}
.band-gray .lookup-box { background: var(--surface); border: 1px solid var(--line); }
.lookup-box input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  padding: 6px 0;
  min-width: 0;
}
.term-rows { border-top: 1px solid var(--line); }
.term-row {
  display: grid;
  grid-template-columns: 180px 150px 1fr 130px;
  gap: 16px;
  align-items: baseline;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.term-row-note { font-size: 13.5px; color: var(--ink-2); }
.term-row-pack { font-size: 12.5px; color: var(--ink-3); text-align: right; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 40px;
  background: var(--bg);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 36px;
}
.footer-col h4 { margin: 0 0 12px; font-size: 13.5px; font-weight: 400; color: var(--ink); }
.footer-col a { display: block; font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ================= DEDICATED WORKSPACE ================= */
.app-body { background: var(--band); min-height: 100vh; }
.app-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.app-bar-in {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.app-tabs { display: flex; align-items: center; gap: 6px; }
.app-tab {
  border: 0;
  background: transparent;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.app-tab:hover { background: var(--band); color: var(--ink); }
.app-tab.is-active { background: var(--brand-soft); color: var(--brand); }
.app-main { padding: 32px 0 64px; }
.app-view { display: none; }
.app-view.is-active { display: block; }
.app-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.app-head h1 { margin: 0; font-size: 24px; font-weight: 400; }
.app-head p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); }

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px 22px;
}
.kpi-card span { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.kpi-card strong { font-size: 26px; font-weight: 400; color: var(--ink); }

.panel {
  background: var(--surface);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 20px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.panel-title { margin: 0; font-size: 15.5px; font-weight: 400; }
.table-scroll { overflow-x: auto; max-width: 100%; }
.table-scroll table { min-width: 560px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
tr:last-child td { border-bottom: 0; }
.field {
  border: 1px solid var(--line-2);
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  outline: 0;
  min-width: 0;
}
.field:focus { border-color: var(--brand); }
.field-textarea { width: 100%; min-height: 120px; resize: vertical; line-height: 1.75; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--band);
  font-size: 12.5px;
  color: var(--ink);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chk-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.chk-inline input { accent-color: var(--brand); margin: 0; }
.chk-group { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.panel-banner { background: var(--brand-soft); }
.panel-banner[hidden] { display: none; }
.panel-sub { font-size: 12.5px; color: var(--ink-3); }
.sub-pane[hidden] { display: none; }
.lint-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--band);
  margin: 16px 0 14px;
  font-size: 13.5px;
}
.grade-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
}
.grade-pill.is-bad { background: var(--bad-soft); color: var(--bad); }
.grade-pill.is-ok { background: var(--ok-soft); color: var(--ok); }
.issue-list { border-top: 1px solid var(--line); }
.issue-row {
  display: grid;
  grid-template-columns: 110px 1fr 1fr;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  align-items: baseline;
}
.issue-cat { font-size: 12px; color: var(--ink-3); }
.inline-promote { display: flex; align-items: center; gap: 6px; }
.inline-promote .field { width: 140px; padding: 5px 9px; font-size: 12.5px; }
.key-form-panel { display: flex; flex-direction: column; gap: 12px; }
.key-form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mcp-tools-note {
  margin: 0 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.mcp-tool-tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--band);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
}
.code-pre {
  margin: 0;
  background: #141821;
  color: #e5e7eb;
  border-radius: 10px;
  padding: 18px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  overflow-x: auto;
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: var(--ink);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 40;
}
.toast.is-show { opacity: 1; }

@media (max-width: 860px) {
  .wrap { padding: 0 16px; }
  .site-nav, .logo-sep, .logo-sub { display: none; }
  .site-header-in { gap: 10px; }
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 30px; }
  .compare-stage { padding: 18px; }
  .seg { flex-wrap: wrap; border-radius: 12px; }
  .stage-cols, .pillars, .packs-grid, .footer-grid, .kpi-strip { grid-template-columns: 1fr; gap: 18px; }
  .stage-cols > *, .pillars > *, .packs-grid > * { min-width: 0; }
  .term-row, .issue-row { grid-template-columns: 1fr; gap: 4px; }
  .term-row-pack { text-align: left; }
  .app-bar-in { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 10px; }
  .app-tabs { order: 3; width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-tab { text-align: center; padding: 7px 8px; font-size: 13px; }
}
