/* Lumen demo. Base tokens and components copied from Lumen_Wireframes_3.html. */

:root {
  --bg: #F6F3ED;
  --paper: #FFFFFF;
  --sunk: #FAF8F4;
  --ink: #0E1B2C;
  --ink-soft: #3D4A5C;
  --muted: #667085;
  --line: #E4DED2;
  --line-soft: #EEE9E0;
  --primary: #1B3A6B;
  --primary-hover: #152E56;
  --primary-soft: #EAF0F8;
  --accent: #B4472F;
  --accent-soft: #FBEBE5;
  --success: #2F6F4F;
  --success-soft: #E6F1EA;
  --warn: #8F5B0F;
  --warn-soft: #FBF1DC;

  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'Inter Tight', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --frame-shadow: 0 1px 2px rgba(14,27,44,0.06), 0 12px 32px -8px rgba(14,27,44,0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button, input { font: inherit; color: inherit; }
a { color: inherit; }
.serif { font-family: var(--serif); }

/* Icons */
.i {
  width: 16px; height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.i-sm { width: 14px; height: 14px; }

/* ===== App chrome ===== */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 720px; }
.sidebar {
  background: var(--sunk);
  border-right: 1px solid var(--line-soft);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 0 10px 20px; }
.logo-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 15px;
}
.logo-text { font-family: var(--serif); font-weight: 500; font-size: 18px; }
.nav-section { font-size: 12px; color: var(--muted); padding: 20px 10px 6px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  margin-bottom: 2px;
}
.nav-item .i { color: var(--muted); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.nav-item.active .i { color: var(--primary); }
.sidebar-foot {
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 600;
}
.avatar-meta { font-size: 13px; line-height: 1.3; }
.avatar-meta strong { display: block; font-weight: 500; }
.avatar-meta span { color: var(--muted); font-size: 12px; }

.main { padding: 24px 32px 40px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; min-height: 34px; }
.crumb { font-size: 13px; color: var(--muted); }
.crumb strong { color: var(--ink); font-weight: 500; }
.topbar-actions { display: flex; gap: 8px; }

.btn {
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--r-md);
  background: var(--paper);
  border: 1px solid var(--line);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn:hover { background: var(--sunk); }
.btn .i { color: var(--muted); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary .i { color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.link { color: var(--primary); font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--line-soft);
  color: var(--ink-soft);
  white-space: nowrap;
}
.tag.lab { background: var(--primary-soft); color: var(--primary); }
.tag.img { background: #F1ECF6; color: #5B3B7A; }
.tag.visit { background: var(--success-soft); color: var(--success); }
.tag.rx { background: var(--warn-soft); color: var(--warn); }
.tag.due { background: var(--accent-soft); color: var(--accent); }
.tag.ok { background: var(--success-soft); color: var(--success); }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.card-title { font-weight: 600; font-size: 15px; }

/* ===== 01 Onboarding ===== */
.onb { min-height: 720px; display: grid; grid-template-columns: 1fr 1fr; }
.onb-left {
  padding: 56px;
  background: var(--sunk);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
}
.steps { display: flex; gap: 6px; margin-bottom: 10px; }
.steps span { height: 4px; width: 40px; border-radius: 2px; background: var(--line); }
.steps span.on { background: var(--primary); }
.step-label { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.onb-h {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-bottom: 16px;
  max-width: 13em;
}
.onb-lede { color: var(--ink-soft); font-size: 16px; max-width: 28em; margin-bottom: 36px; }
.onb-checklist { list-style: none; display: grid; gap: 18px; }
.onb-check { display: flex; gap: 14px; color: var(--ink-soft); }
.onb-check .num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  flex-shrink: 0;
}
.onb-check strong { color: var(--ink); display: block; font-weight: 500; }
.onb-note { margin-top: auto; display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }

.onb-right { padding: 48px 48px 32px; display: flex; flex-direction: column; }
.section-label { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 10px; }
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--muted);
}
.search:focus-within { border-color: var(--primary); }
.search input { border: 0; outline: 0; flex: 1; background: transparent; color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.provider-list { list-style: none; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.provider {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.provider:last-child { border-bottom: 0; }
.prov-logo {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
}
.prov-logo.a { background: #1F4E79; }
.prov-logo.b { background: #5B3B7A; }
.prov-logo.c { background: #884A39; }
.prov-logo.d { background: #2E6F40; }
.prov-logo.e { background: #9E3B38; }
.prov-name { font-weight: 500; }
.prov-meta { font-size: 12.5px; color: var(--muted); }
.prov-status { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; color: var(--success); }
.onb-actions { margin-top: auto; padding-top: 24px; display: flex; justify-content: space-between; align-items: center; }

/* ===== 02 Dashboard ===== */
.dash-hello { font-family: var(--serif); font-weight: 400; font-size: 28px; letter-spacing: -0.01em; margin-bottom: 4px; }
.dash-date { font-size: 13px; color: var(--muted); margin-bottom: 24px; }

.summary-card { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 28px; margin-bottom: 20px; }
.summary-label { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 10px; }
.summary-text { font-family: var(--serif); font-size: 19px; line-height: 1.5; max-width: 42em; }
.summary-text mark { background: var(--warn-soft); color: inherit; padding: 1px 2px; margin: 0 -2px; border-radius: 3px; }
.summary-foot { display: flex; gap: 20px; margin-top: 16px; align-items: center; }
.summary-foot .src { font-size: 12.5px; color: var(--muted); margin-right: auto; }

.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.row-list { list-style: none; }
.row-list li {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.row-list li:first-child { padding-top: 0; }
.row-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.row-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  background: var(--sunk);
  color: var(--ink-soft);
  display: grid; place-items: center;
}
.row-title { font-weight: 500; }
.row-meta { font-size: 12.5px; color: var(--muted); }
.row-aside { font-size: 12.5px; color: var(--muted); }
.date-chip { width: 32px; text-align: center; line-height: 1.1; }
.date-chip strong { display: block; font-size: 17px; font-weight: 600; }
.date-chip span { font-size: 11px; color: var(--muted); }

.vitals-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.vital { padding: 4px 20px; border-left: 1px solid var(--line-soft); }
.vital:first-child { border-left: 0; padding-left: 0; }
.vital-label { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.vital-num { font-size: 24px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }
.vital-unit { font-size: 12px; color: var(--muted); font-weight: 400; }
.vital-trend { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.vital-trend.flag { color: var(--accent); }
.spark { display: block; margin-top: 10px; width: 100%; height: 24px; }
.spark polyline { fill: none; stroke: var(--primary); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; opacity: 0.55; }
.spark circle { fill: var(--primary); }
.spark.flag polyline { stroke: var(--accent); }
.spark.flag circle { fill: var(--accent); }

/* ===== 03 Records ===== */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab {
  padding: 8px 12px;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: flex;
  gap: 6px;
  align-items: center;
  cursor: pointer;
}
.tab .count { font-size: 12px; color: var(--muted); }
.tab.active { color: var(--ink); border-bottom-color: var(--primary); font-weight: 500; }

.filters { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; }
.chip {
  font-size: 13px;
  padding: 5px 10px;
  border-radius: var(--r-md);
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.chip .i { color: var(--muted); }
.filters .search { margin-left: auto; padding: 5px 10px; width: 240px; font-size: 13px; }

.table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.table-wrap .table { border: 0; border-radius: 0; }
.table th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--sunk);
  padding: 9px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--sunk); }
.table .num { text-align: right; }
.table .date { color: var(--ink-soft); white-space: nowrap; }
.cell-title { font-weight: 500; }
.cell-meta { font-size: 12.5px; color: var(--muted); }
.cell-meta.flag { color: var(--accent); }
.src-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; opacity: 0.55; }
.table tbody tr:hover .row-actions { opacity: 1; }
.icon-btn {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  background: transparent;
  border: 0;
  display: grid; place-items: center;
  color: var(--ink-soft);
  cursor: pointer;
}
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }

/* ===== 04 Ask ===== */
.chat-wrap { display: grid; grid-template-columns: 1fr 272px; gap: 20px; }
.chat { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.chat-h {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}
.chat-h strong { color: var(--ink); font-weight: 500; }
.chat-body { flex: 1; padding: 24px; display: flex; flex-direction: column; gap: 22px; }
.msg-user {
  align-self: flex-end;
  max-width: 70%;
  background: var(--primary-soft);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 14px 14px 4px 14px;
}
.msg-ai { max-width: 88%; display: grid; grid-template-columns: 26px 1fr; gap: 12px; }
.msg-ai .mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 14px;
}
.msg-ai p { line-height: 1.6; }
.msg-ai p + p, .msg-ai p + ul, .msg-ai ul + p { margin-top: 10px; }
.msg-ai ul { padding-left: 18px; }
.msg-ai li { line-height: 1.6; }
.cite {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 4px;
  margin-left: 2px;
  vertical-align: 2px;
}
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  background: var(--paper);
}
.source b { color: var(--primary); font-weight: 600; }
.chat-foot { padding: 14px 18px 12px; border-top: 1px solid var(--line-soft); }
.composer {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 6px 6px 6px 14px;
}
.composer input { flex: 1; border: 0; outline: 0; background: transparent; }
.composer input::placeholder { color: var(--muted); }
.send-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  background: var(--primary);
  border: 0;
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
}
.chat-note { font-size: 12px; color: var(--muted); margin-top: 8px; text-align: center; }

.side-stack { display: flex; flex-direction: column; gap: 16px; }
.suggest-list { list-style: none; display: grid; gap: 6px; }
.suggest {
  width: 100%;
  text-align: left;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  background: var(--sunk);
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.4;
}
.suggest:hover { border-color: var(--line); background: var(--paper); }
.scope-card { font-size: 13px; color: var(--ink-soft); line-height: 1.55; }
.scope-card .card-title { font-size: 14px; margin-bottom: 8px; color: var(--ink); display: flex; gap: 8px; align-items: center; }

/* ===== 05 Insurance ===== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.stat-label { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.stat-num { font-size: 26px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.1; }
.stat-num small { font-size: 14px; color: var(--muted); font-weight: 400; }
.stat-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 8px; }
.stat.flag .stat-num { color: var(--accent); }
.meter { margin-top: 12px; height: 4px; background: var(--line-soft); border-radius: 2px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--primary); border-radius: 2px; }
.muted { color: var(--muted); }
.paid { color: var(--success); }
.owed { color: var(--accent); font-weight: 500; }

/* ===== 06 Send ===== */
.send-layout { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: start; }
.send-panel { display: grid; gap: 28px; }
.step-h { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.step-h .n { font-size: 13px; color: var(--muted); }
.step-h h3 { font-family: var(--serif); font-weight: 500; font-size: 19px; }
.panel-sub { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

.recipient { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.recipient-h { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; }
.recipient-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 13px;
}
.recipient-name { font-weight: 500; }
.verified { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--success); }
.recipient-addr { padding: 12px 16px; background: var(--sunk); border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--muted); }
.recipient-addr code { font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.recipient-addr .how { margin-top: 4px; }
.fallback { margin-top: 10px; font-size: 13px; }
.fallback summary { cursor: pointer; color: var(--primary); font-weight: 500; list-style: none; display: inline-flex; gap: 4px; align-items: center; }
.fallback summary::-webkit-details-marker { display: none; }
.fallback[open] summary .i { transform: rotate(180deg); }
.fallback-body { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); display: grid; gap: 12px; }
.fallback-note { color: var(--ink-soft); line-height: 1.55; }
.fallback-note code { font-family: var(--mono); font-size: 12px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  outline: 0;
}
.input:focus { border-color: var(--primary); }
.input::placeholder { color: var(--muted); }
.field-help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
}
.option.on { border-color: var(--primary); background: var(--primary-soft); }
.option-title { font-weight: 500; }
.option-meta { font-size: 12.5px; color: var(--muted); }
.option.on .option-meta { color: var(--ink-soft); }
.option .count { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.radio, .box {
  width: 16px; height: 16px;
  margin-top: 2px;
  border: 1.5px solid #A3A9B4;
  flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--paper);
}
.radio { border-radius: 50%; }
.box { border-radius: 4px; }
.on > .radio { border-color: var(--primary); }
.on > .radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.on > .box { background: var(--primary); border-color: var(--primary); color: #fff; }
.options.compact .option { padding: 10px 12px; align-items: center; }
.options.compact .box { margin-top: 0; }

.picker { margin-top: 16px; }
.picker-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.picker-h strong { font-weight: 500; }
.picker-list { list-style: none; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-top: 8px; }
.picker-list li {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.picker-list li:last-child { border-bottom: 0; }
.picker-list li.on { background: var(--primary-soft); }
.picker-list .box { margin-top: 0; }
.picker-list .cell-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-foot { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

.select {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
}
.select .i { color: var(--muted); }

.send-preview { position: sticky; top: 20px; display: grid; gap: 16px; }
.preview-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.preview-doc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px; }
.preview-h { font-family: var(--serif); font-weight: 600; font-size: 16px; padding-bottom: 10px; border-bottom: 1.5px solid var(--ink); margin-bottom: 6px; }
.preview-sub { font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.preview-section { margin-bottom: 14px; }
.preview-section:last-child { margin-bottom: 0; }
.preview-section-h { font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.preview-item { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.summary-list { list-style: none; }
.summary-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.summary-list li:last-child { border-bottom: 0; }
.summary-list span { color: var(--muted); }
.summary-list strong { font-weight: 500; }


/* ===================================================================
   Demo additions
   =================================================================== */
html, body { height: 100%; }
body { overflow: hidden; }
button { background: none; border: 0; cursor: pointer; text-align: inherit; }
select { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.search input:focus-visible, .composer input:focus-visible, .input:focus-visible { outline: none; }
.search:focus-within, .composer:focus-within, .input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
[hidden] { display: none !important; }

/* Demo bar */
.demo-bar {
  height: 40px; display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--ink); color: #D9E0EA; font-size: 13px; position: relative; z-index: 60;
}
.demo-bar .demo-dot { width: 8px; height: 8px; border-radius: 50%; background: #7FB69A; flex-shrink: 0; }
.demo-bar strong { color: #fff; font-weight: 500; }
.demo-bar .spacer { margin-left: auto; }
.bar-btn {
  color: #fff; font-size: 12.5px; font-weight: 500; padding: 4px 10px; border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,0.24); display: inline-flex; align-items: center; gap: 6px;
}
.bar-btn:hover { background: rgba(255,255,255,0.1); }
.bar-btn:focus-visible { outline-color: #fff; }

.stage { height: calc(var(--vh, 100vh) - 40px); position: relative; overflow: hidden; }

/* App chrome */
.app { height: 100%; min-height: 0; }
.sidebar { overflow-y: auto; }
.logo { text-decoration: none; }
.nav-item { width: 100%; font-size: 14px; text-align: left; }
.nav-item:hover { background: var(--line-soft); color: var(--ink); }
.nav-item.active:hover { background: var(--primary-soft); }
.main { height: 100%; overflow-y: auto; }
.main-ask { display: flex; flex-direction: column; padding-bottom: 24px; }
.crumb { font-weight: 400; }
.dash-hello { outline: none; }

/* Buttons */
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-primary[aria-disabled="true"]:hover { background: var(--primary); }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }
.btn-lg { padding: 10px 18px; font-size: 14px; }
.btn-danger { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger:hover { background: #9A3B27; }
.btn-danger .i { color: #fff; }
.btn-ghost:hover { background: var(--line-soft); }
.link { background: none; border: 0; padding: 0; display: inline-flex; align-items: center; gap: 4px; }
.cell-btn { font-weight: 500; text-align: left; padding: 0; }
.cell-btn:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.btn .spin, .send-btn .spin { width: 14px; height: 14px; border-width: 2px; }

/* Spinner and progress */
.spin { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; flex-shrink: 0; }
.spin-lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.meter span { transition: width 0.25s ease; }
.meter.ok span { background: var(--success); }
@media (prefers-reduced-motion: reduce) {
  .spin { animation-duration: 2.4s; }
  .toast, .drawer, .modal { animation: none !important; }
}

/* Empty states and notices */
.empty { text-align: center; padding: 48px 24px; border: 1px dashed var(--line); border-radius: var(--r-lg); background: var(--sunk); }
.empty-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin: 0 auto 14px; }
.empty-icon .i { width: 20px; height: 20px; }
.empty h2, .empty h3 { font-family: var(--serif); font-weight: 500; font-size: 20px; margin-bottom: 6px; }
.empty p { color: var(--ink-soft); max-width: 32em; margin: 0 auto 18px; }
.empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.card-empty { font-size: 13px; color: var(--muted); line-height: 1.5; }
.card-empty .link { margin-top: 6px; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--warn-soft); color: var(--warn); font-size: 13px; align-items: flex-start; line-height: 1.5; }
.notice .i { margin-top: 2px; }
.notice.info { background: var(--primary-soft); color: var(--primary); }
.notice.ok { background: var(--success-soft); color: var(--success); }
.notice.urgent { background: var(--accent-soft); color: var(--accent); }
.notice .link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.field-error { font-size: 12.5px; color: var(--accent); margin-top: 6px; display: flex; gap: 6px; align-items: flex-start; }
.field-error .i { margin-top: 2px; }
.input[aria-invalid="true"] { border-color: var(--accent); }
.field + .field { margin-top: 14px; }
select.input { appearance: none; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='1.75' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; padding-right: 34px; cursor: pointer; }
select.chip { appearance: none; padding-right: 28px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='1.75' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px; }

/* Welcome and end screens */
.center-screen { height: 100%; overflow-y: auto; display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.hero { max-width: 560px; text-align: center; }
.hero .logo-mark { width: 52px; height: 52px; border-radius: 14px; font-size: 28px; margin: 0 auto 22px; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 14px; }
.hero .lede { font-size: 17px; color: var(--ink-soft); margin-bottom: 28px; }
.hero .fine { font-size: 13px; color: var(--muted); margin-top: 18px; display: flex; gap: 8px; justify-content: center; align-items: center; }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.recap { text-align: left; list-style: none; display: grid; gap: 10px; margin: 0 auto 28px; max-width: 30em; }
.recap li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; color: var(--ink-soft); }
.recap .i { color: var(--success); margin-top: 3px; }

/* Onboarding */
.onb { height: 100%; min-height: 0; }
.onb-left, .onb-right { overflow-y: auto; }
.onb-right .section-label { display: block; }
.prov-logo.f { background: #3C4F8A; }
.prov-logo.g { background: #6B5A2A; }
.prov-logo.h { background: #2F5F6F; }
.prov-logo.i { background: #24527A; }
.prov-logo.sm { width: 28px; height: 28px; font-size: 11px; border-radius: var(--r-sm); }
.provider-actions { display: flex; gap: 8px; align-items: center; }
.list-empty { padding: 20px 16px; text-align: center; color: var(--ink-soft); font-size: 13px; }
.list-empty strong { color: var(--ink); font-weight: 500; }
.hint { font-size: 12.5px; color: var(--muted); }
.onb-actions .left { display: flex; gap: 6px; }
.onb-actions .right { display: flex; gap: 12px; align-items: center; }
.form-card { max-width: 420px; }
.form-card h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin-bottom: 6px; }
.form-card .panel-sub { margin-bottom: 22px; }
.passkey-note { display: flex; gap: 10px; margin-top: 20px; padding: 14px; background: var(--sunk); border: 1px solid var(--line-soft); border-radius: var(--r-md); font-size: 13px; color: var(--ink-soft); }
.passkey-note .i { color: var(--primary); margin-top: 2px; }
.build-list { list-style: none; display: grid; gap: 12px; }
.build-item { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: grid; grid-template-columns: 36px 1fr auto; gap: 14px; align-items: center; }
.build-item .meter { margin-top: 8px; }
.build-status { font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.build-status.done { color: var(--success); font-weight: 500; }
.ready { margin-top: 24px; padding: 20px; border-radius: var(--r-lg); background: var(--success-soft); display: flex; gap: 14px; align-items: flex-start; }
.ready .i { color: var(--success); width: 20px; height: 20px; margin-top: 3px; }
.ready h2 { font-family: var(--serif); font-weight: 500; font-size: 20px; }
.ready p { color: var(--ink-soft); font-size: 13px; margin: 2px 0 14px; }

/* Home */
.summary-note { margin-top: 14px; }
.row-list li.wide { grid-template-columns: 32px 1fr auto; }
.row-right { display: flex; gap: 8px; align-items: center; }
.vital .vital-empty { font-size: 13px; color: var(--muted); padding-top: 6px; }

/* Records */
.filters .chip { font: inherit; font-size: 13px; }
.table tbody tr { cursor: pointer; }
.table tbody tr:focus-within .row-actions { opacity: 1; }
.results-note { font-size: 12.5px; color: var(--muted); margin: -4px 0 10px; }
.tab { background: none; border-top: 0; border-left: 0; border-right: 0; font-size: 14px; }

/* Drawer */
.scrim { position: fixed; inset: 0; background: rgba(14,27,44,0.38); z-index: 70; display: grid; place-items: center; padding: 24px; animation: fade 0.15s ease; }
.scrim.soft { background: rgba(14,27,44,0.22); display: block; padding: 0; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 100%; background: var(--paper); box-shadow: -16px 0 40px -12px rgba(14,27,44,0.28); z-index: 71; display: flex; flex-direction: column; animation: slide 0.18s ease; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-h { padding: 20px 22px 16px; border-bottom: 1px solid var(--line-soft); display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.drawer-h h2 { font-family: var(--serif); font-weight: 500; font-size: 21px; line-height: 1.25; margin: 8px 0 4px; }
.drawer-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; flex-wrap: wrap; }
.detail-list { list-style: none; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 16px; }
.detail-list li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.detail-list li:last-child { border-bottom: 0; }
.detail-list .k { color: var(--muted); }
.detail-list .v small { display: block; color: var(--muted); font-size: 12px; }
.detail-list .v.flag small { color: var(--accent); }
.drawer-note { font-size: 13px; color: var(--ink-soft); line-height: 1.55; margin-bottom: 16px; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; font-size: 13px; }
.meta-grid dt { color: var(--muted); font-size: 12px; }

/* Modal */
.modal { background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--frame-shadow); width: 100%; max-width: 460px; max-height: calc(var(--vh, 100vh) - 48px); overflow-y: auto; animation: pop 0.16s ease; }
.modal.wide { max-width: 520px; }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } }
.modal-h { padding: 22px 24px 0; }
.modal-title { font-family: var(--serif); font-weight: 500; font-size: 21px; line-height: 1.25; }
.modal-body { padding: 10px 24px 4px; color: var(--ink-soft); }
.modal-body p + p { margin-top: 10px; }
.modal-foot { padding: 20px 24px 22px; display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.modal-foot .left { margin-right: auto; }
.modal-center { text-align: center; padding: 34px 24px 26px; }
.modal-center .spin-lg, .modal-center .big-icon { margin: 0 auto 16px; }
.modal-center .modal-title { margin-bottom: 6px; }
.big-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
.big-icon .i { width: 24px; height: 24px; }
.big-icon.warn { background: var(--accent-soft); color: var(--accent); }
.big-icon.neutral { background: var(--primary-soft); color: var(--primary); }
.portal-bar { display: flex; align-items: center; gap: 10px; padding: 12px 24px; background: var(--sunk); border-bottom: 1px solid var(--line-soft); font-size: 12.5px; color: var(--muted); }
.portal-bar strong { color: var(--ink); font-weight: 500; font-size: 13px; }
.portal-bar .sim { margin-left: auto; }
.scope-list { list-style: none; display: grid; gap: 6px; margin-top: 12px; }
.check-row { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; color: var(--ink); font-size: 13.5px; position: relative; }
.check-row.on { border-color: var(--primary); background: var(--primary-soft); }
.check-row .box { margin-top: 0; }
.option input, .check-row input, .picker-list input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.option:has(input:focus-visible), .check-row:has(input:focus-visible), .picker-list li:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.option { position: relative; }
.option.disabled { opacity: 0.55; cursor: not-allowed; }
.choice-list { display: grid; gap: 8px; margin-top: 14px; }
.choice-list .option { align-items: flex-start; }
.passkey-face { width: 56px; height: 56px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin: 0 auto 16px; }
.passkey-face .i { width: 28px; height: 28px; }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; font-size: 13px; padding: 10px 14px; border-radius: var(--r-md); box-shadow: var(--frame-shadow); max-width: 460px; animation: toastIn 0.18s ease; transition: opacity 0.3s, transform 0.3s; display: flex; gap: 8px; align-items: center; }
.toast .i { color: #9FD0B5; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* Ask */
.main-ask .chat-wrap { flex: 1; min-height: 0; }
.main-ask .chat { min-height: 0; background: var(--paper); }
.main-ask .chat-body { overflow-y: auto; min-height: 0; }
.main-ask .side-stack { overflow-y: auto; min-height: 0; }
.chat-empty { margin: auto; text-align: center; max-width: 30em; }
.chat-empty .logo-mark { margin: 0 auto 14px; width: 36px; height: 36px; font-size: 20px; border-radius: 10px; }
.chat-empty h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin-bottom: 6px; }
.chat-empty p { color: var(--ink-soft); margin-bottom: 18px; }
.starter { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.starter .suggest { width: auto; background: var(--paper); border-color: var(--line); }
.msg-user { white-space: pre-wrap; word-break: break-word; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.source { cursor: pointer; font: inherit; font-size: 12.5px; }
.source:hover { border-color: var(--primary); color: var(--primary); }
.msg-ai.urgent .body { border-left: 3px solid var(--accent); padding-left: 12px; }
.msg-ai.urgent .mark { background: var(--accent); }
.typing { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.suggest-group { font-size: 12.5px; color: var(--muted); margin: 14px 0 6px; }
.composer .send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Insurance */
.stat.done .stat-num { color: var(--success); }
.claims-actions { display: inline-flex; gap: 8px; align-items: center; justify-content: flex-end; }

/* Send */
.dir-list { list-style: none; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.dir-item { width: 100%; display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.dir-list li:last-child .dir-item { border-bottom: 0; }
.dir-item:hover { background: var(--sunk); }
.dir-item .recipient-avatar { width: 36px; height: 36px; font-size: 12px; }
.recipient-avatar.plain { background: var(--line-soft); color: var(--ink-soft); }
.nodirect { color: var(--warn); font-size: 12.5px; font-weight: 500; }
.step-block.has-error .recipient, .step-block.has-error .search { border-color: var(--accent); }
.success-wrap { max-width: 560px; margin: 16px auto 0; }
.success-head { text-align: center; margin-bottom: 24px; }
.success-head .big-icon { margin: 0 auto 14px; }
.success-head h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; letter-spacing: -0.01em; margin-bottom: 4px; }
.success-head p { color: var(--ink-soft); }
.link-box { display: flex; gap: 8px; align-items: center; margin-top: 16px; }
.link-box input { font-family: var(--mono); font-size: 12.5px; }
.success-actions { display: flex; gap: 8px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.preview-empty { font-size: 12.5px; color: var(--muted); }

/* Providers and privacy */
.page-h { font-family: var(--serif); font-weight: 400; font-size: 28px; letter-spacing: -0.01em; margin-bottom: 4px; }
.page-sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; max-width: 46em; }
.section { margin-bottom: 28px; }
.section-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.section-h h2 { font-weight: 600; font-size: 15px; }
.log-list { list-style: none; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--paper); }
.log-list li { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.log-list li:last-child { border-bottom: 0; }
.log-when { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.row-icon.ok { background: var(--success-soft); color: var(--success); }
.row-icon.warn { background: var(--accent-soft); color: var(--accent); }
.row-icon.info { background: var(--primary-soft); color: var(--primary); }
.onb { min-height: 0; }
.app { background: var(--paper); }
.picker-list li.on .box { background: var(--primary); border-color: var(--primary); color: #fff; }
.main > .topbar { position: sticky; top: -24px; z-index: 5; background: var(--paper); margin: -24px -32px 24px; padding: 24px 32px 12px; }
.main-ask > .topbar { position: static; }
body.has-drawer .toasts { left: calc((100% - 440px) / 2); }
.hero h1, .onb-h, .page-h, .modal-title, .empty h2 { text-wrap: balance; } .hero .lede, .empty p, .onb-lede { text-wrap: pretty; }
