:root {
  --ink: #1c302c;
  --muted: #71807a;
  --line: #e2e8e4;
  --paper: #f5f7f5;
  --white: #ffffff;
  --green: #214f45;
  --green-2: #2f6a5b;
  --green-soft: #e8f1ed;
  --amber: #8d5b13;
  --amber-soft: #fff5e3;
  --red: #a63c38;
  --red-soft: #fff0ef;
  --shadow: 0 8px 26px rgba(26, 50, 42, .055);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; background: radial-gradient(circle at 50% 15%, #e5eee9 0, #f5f7f5 48%, #f3f5f3 100%); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: var(--green); color: #e1eee8; font: 700 25px Georgia, serif; box-shadow: 0 7px 16px rgba(33,79,69,.15); }
.brand-mark.small { width: 35px; height: 35px; font-size: 20px; border-radius: 10px; }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: .13em; color: var(--green); }
.brand-name span { color: #6f9286; }
.brand-subtitle { margin-top: 2px; color: #82928b; font-size: 9px; font-weight: 700; letter-spacing: .28em; }
.login-card { width: min(100%, 430px); padding: 36px; border: 1px solid var(--line); border-radius: 20px; background: var(--white); box-shadow: 0 18px 50px rgba(32, 60, 49, .08); }
.login-card h1 { margin: 7px 0 8px; font-family: Georgia, serif; font-size: 29px; font-weight: 500; letter-spacing: -.025em; }
.login-card > p { margin: 0 0 25px; font-size: 13px; }
.eyebrow { color: #82918a; font-size: 9px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 15px; }
label { display: grid; gap: 7px; color: #44554e; font-size: 12px; font-weight: 650; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid #dce4df; border-radius: 9px; outline: none; background: #fff; color: var(--ink); font-size: 13px; font-weight: 450; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: #6e9a89; box-shadow: 0 0 0 3px rgba(73,132,110,.12); }
textarea { resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #a3aea8; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; padding: 10px 15px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 750; transition: background .15s, transform .15s, opacity .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .43; }
.button.primary { background: var(--green); color: white; }
.button.primary:hover:not(:disabled) { background: #183e35; }
.button.secondary { border-color: #d7e3dc; background: #f3f7f4; color: var(--green); }
.button.secondary:hover:not(:disabled) { background: #e8f1eb; }
.button.ghost { border-color: transparent; background: transparent; color: #64756d; }
.button.full { width: 100%; }
.small-button { min-height: 32px; padding: 7px 10px; }
.login-foot { display: flex; align-items: center; gap: 7px; margin-top: 24px; padding-top: 17px; border-top: 1px solid #edf0ed; color: #82918a; font-size: 11px; }
.login-foot strong { color: var(--green); }
.status-dot { width: 7px; height: 7px; display: inline-block; flex: 0 0 7px; border-radius: 50%; background: #4b9b75; box-shadow: 0 0 0 3px rgba(75,155,117,.13); }
.legal-note { max-width: 420px; margin: 15px auto 0; color: #89958f; font-size: 10px; line-height: 1.5; text-align: center; }
.form-error { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 12px; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 3; display: flex; width: 236px; flex-direction: column; padding: 24px 16px 18px; border-right: 1px solid var(--line); background: #fbfcfb; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 9px 31px; }
.workspace-label { padding: 0 11px 10px; color: #99a59f; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.main-nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 0; border-radius: 8px; background: transparent; color: #687970; text-align: left; font-size: 12px; font-weight: 650; }
.nav-item:hover { background: #f1f5f2; }
.nav-item.active { background: var(--green-soft); color: var(--green); }
.nav-icon { width: 17px; color: #7e9c8e; font-size: 16px; text-align: center; }
.sidebar-bottom { margin-top: auto; }
.environment-card { display: flex; align-items: center; gap: 9px; padding: 12px 10px; border: 1px solid #e6ece8; border-radius: 10px; background: #f8faf8; }
.environment-card strong, .environment-card small { display: block; }
.environment-card strong { font-size: 10px; }
.environment-card small { margin-top: 3px; color: #89968f; font-size: 9px; }
.logout-button { width: 100%; margin-top: 8px; padding: 10px; border: 0; border-radius: 8px; background: transparent; color: #7c8983; text-align: left; font-size: 11px; }
.logout-button:hover { background: #f2f5f2; color: var(--red); }
.main-area { max-width: 1540px; min-height: 100vh; margin-left: 236px; padding: 0 34px 32px; }
.topbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; min-height: 75px; margin: 0 -34px 22px; padding: 12px 34px; border-bottom: 1px solid var(--line); background: rgba(250,252,250,.94); backdrop-filter: blur(12px); }
.page-title { margin-top: 4px; font-family: Georgia, serif; font-size: 19px; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: 11px; }
.user-chip small { margin-top: 3px; color: #87948d; font-size: 10px; text-transform: capitalize; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #e7efe9; color: var(--green); font-size: 10px; font-weight: 800; }
.development-banner { margin-bottom: 24px; padding: 10px 13px; border: 1px solid #eadbbd; border-radius: 8px; background: var(--amber-soft); color: #7e5a25; font-size: 11px; line-height: 1.5; }
.intro-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 7px 0 23px; }
.intro-row h1 { margin: 7px 0 6px; font-family: Georgia, serif; font-size: 31px; font-weight: 500; letter-spacing: -.035em; }
.intro-row p { max-width: 750px; margin: 0; font-size: 12px; line-height: 1.6; }
.mode-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid #dce8df; border-radius: 20px; background: #f9fcfa; color: #587268; white-space: nowrap; font-size: 10px; font-weight: 700; }
.overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-bottom: 17px; }
.metric-card { padding: 17px 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--white); box-shadow: var(--shadow); }
.metric-label, .metric-card small { display: block; color: #7d8b83; font-size: 10px; }
.metric-card strong { display: block; margin: 8px 0 4px; font-family: Georgia, serif; font-size: 29px; font-weight: 500; }
.metric-card .metric-text { font-family: inherit; font-size: 17px; font-weight: 750; }
.workspace-grid, .two-column { display: grid; grid-template-columns: minmax(270px, .75fr) minmax(420px, 1.25fr); gap: 15px; align-items: start; }
.panel { margin-bottom: 15px; padding: 19px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-heading h2 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.panel-heading p { margin: 4px 0 0; font-size: 11px; }
.count-badge, .step-badge { min-width: 27px; padding: 5px 8px; border-radius: 20px; background: #edf3ef; color: #567465; text-align: center; font-size: 10px; font-weight: 800; }
.step-badge { border-radius: 8px; font-size: 11px; }
.compact-form { display: grid; gap: 11px; padding-bottom: 15px; border-bottom: 1px solid #edf0ed; }
.compact-form label { font-size: 11px; }
.item-list { display: grid; gap: 8px; margin-top: 12px; }
.empty-state { color: #96a19b; font-size: 11px; line-height: 1.6; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; border: 1px solid #edf1ed; border-radius: 8px; background: #fcfdfc; }
.list-item strong, .list-item small { display: block; }
.list-item strong { font-size: 11px; }
.list-item small { margin-top: 4px; color: #8a9690; font-size: 10px; }
.list-item button { flex: 0 0 auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid label { font-size: 11px; }
.span-2 { grid-column: span 2; }
.form-hint { color: #8a9690; font-size: 10px; line-height: 1.5; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 9px 10px; border-bottom: 1px solid #edf0ed; color: #89958f; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
td { padding: 11px 10px; border-bottom: 1px solid #f0f3f0; color: #586860; font-size: 11px; }
td strong { color: var(--ink); }
.table-select { padding: 6px 9px; border: 1px solid #dbe6de; border-radius: 7px; background: #f7faf7; color: var(--green); font-size: 10px; font-weight: 700; }
.encounter-workspace { margin-top: 18px; scroll-margin-top: 90px; }
.workspace-head { align-items: flex-start; }
.workspace-head h2 { font-size: 23px; }
.workspace-head .muted { font-size: 11px; }
.sequence-note { margin: 0 0 8px; padding: 10px 12px; border-left: 3px solid #83a895; border-radius: 0 7px 7px 0; background: #f4f8f5; color: #5d7167; font-size: 11px; line-height: 1.5; }
.work-section { display: grid; grid-template-columns: 27px minmax(0, 1fr); gap: 12px; padding: 21px 0; border-bottom: 1px solid #edf0ed; }
.section-number { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #dfe9e2; border-radius: 50%; color: #668271; font-size: 10px; font-weight: 800; }
.section-content { min-width: 0; }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-title h3, .review-action-row h3 { margin: 0; font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.section-title p, .review-action-row p { margin: 4px 0 0; color: #87948c; font-size: 10px; line-height: 1.5; }
.section-status { padding: 5px 8px; border-radius: 20px; background: #f1f3f1; color: #89958d; white-space: nowrap; font-size: 9px; font-weight: 700; }
.section-status.saved { background: #eaf3ed; color: #4f775f; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.two-column { grid-template-columns: repeat(2, minmax(0,1fr)); }
.subpanel { padding: 15px; border: 1px solid #e8ede9; border-radius: 10px; background: #fbfcfb; }
.subpanel-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 1px; color: #344a40; font-size: 12px; }
.tiny-tag { padding: 4px 7px; border-radius: 12px; background: #eef4f0; color: #718c7d; font-size: 8px; font-weight: 800; }
.code-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.code-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 7px 5px 9px; border: 1px solid #e0e9e3; border-radius: 7px; background: #f6f9f6; color: #496458; font-size: 10px; font-weight: 750; }
.code-chip-remove { padding: 2px 5px; border: 1px solid #e7d8d5; border-radius: 5px; background: #fff; color: #9a5147; font-size: 9px; font-weight: 650; cursor: pointer; }
.code-chip-remove:disabled { opacity: .5; cursor: wait; }
.fact-list { display: grid; gap: 8px; margin-top: 12px; }
.fact-item { padding: 10px 12px; border: 1px solid #e7ede8; border-radius: 8px; background: #fbfcfb; }
.fact-item strong { display: block; font-size: 10px; }
.fact-item p { margin: 5px 0; color: #6e7c74; font-size: 10px; line-height: 1.5; }
.fact-item small { color: #8b9690; font-size: 9px; }
.review-action-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0 10px 39px; }
.report-panel { margin: 14px 0 5px 39px; padding: 18px; border: 1px solid #dfe9e2; border-radius: 11px; background: #fcfdfc; }
.report-summary { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 15px; }
.summary-pill { padding: 6px 9px; border: 1px solid #e4eae5; border-radius: 20px; background: #f4f7f4; color: #64746a; font-size: 9px; }
.findings-list { display: grid; gap: 8px; }
.finding { padding: 12px; border: 1px solid #e7ece8; border-left: 3px solid #8eaa98; border-radius: 8px; background: #fff; }
.finding[data-severity="critical"], .finding[data-severity="high"] { border-left-color: #c58c4c; }
.finding[data-status="SUPPORTED"] { border-left-color: #6d9a7a; }
.finding-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.finding h4 { margin: 0; font-size: 11px; }
.finding p { margin: 6px 0 0; color: #65756c; font-size: 10px; line-height: 1.55; }
.finding-meta { flex: 0 0 auto; color: #849087; font-size: 8px; font-weight: 800; text-align: right; }
.disclaimer { margin: 15px 0 0; padding-top: 12px; border-top: 1px solid #e9eee9; color: #89958d; font-size: 9px; line-height: 1.55; }
.notice-card { margin-bottom: 15px; padding: 13px 15px; border: 1px solid #dfe9e2; border-radius: 9px; background: #f6faf7; color: #587064; font-size: 11px; line-height: 1.6; }
.notice-card.warning { border-color: #eadbbd; background: var(--amber-soft); color: #7c5a27; }
.memory-grid, .payer-grid { grid-template-columns: minmax(280px, .85fr) minmax(400px, 1.15fr); }
.policy-card { padding: 12px; border: 1px solid #e8ede9; border-radius: 9px; }
.policy-card strong { display: block; font-size: 11px; }
.policy-card p { margin: 5px 0; color: #77847c; font-size: 10px; line-height: 1.5; }
.policy-card small { display: block; color: #8d9991; font-size: 9px; }
.approval-status { display: inline-block; margin-top: 6px; padding: 4px 7px; border-radius: 10px; background: #f3f4f3; color: #78847c; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.approval-status.approved, .approval-status.verified { background: #eaf3ed; color: #4e765e; }
.approval-status.pending { background: #fff5e3; color: #8b671f; }
.approval-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.approval-actions .button { min-height: 28px; padding: 5px 8px; font-size: 9px; }
.app-footer { display: flex; justify-content: space-between; gap: 10px; padding: 22px 2px 3px; color: #a0aaa4; font-size: 8px; letter-spacing: .05em; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: min(420px, calc(100vw - 32px)); padding: 12px 15px; border: 1px solid #dbe6de; border-radius: 9px; background: #fff; box-shadow: 0 10px 30px rgba(25,47,38,.14); color: #3e5b4b; font-size: 11px; line-height: 1.5; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: #efd1ce; color: var(--red); }
@media (max-width: 1060px) {
  .sidebar { width: 205px; }
  .main-area { margin-left: 205px; padding: 0 22px 26px; }
  .topbar { margin: 0 -22px 20px; padding: 12px 22px; }
  .workspace-grid, .memory-grid, .payer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sidebar { position: static; width: auto; min-height: auto; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand { padding: 0 4px 12px; }
  .workspace-label, .sidebar-bottom { display: none; }
  .main-nav { grid-template-columns: repeat(3,1fr); }
  .nav-item { justify-content: center; padding: 9px 5px; font-size: 9px; }
  .nav-icon { display: none; }
  .main-area { margin-left: 0; padding: 0 13px 22px; }
  .topbar { position: static; margin: 0 -13px 17px; padding: 12px 14px; }
  .user-chip strong { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
  .intro-row { display: block; }
  .mode-pill { margin-top: 12px; }
  .overview-grid { grid-template-columns: 1fr; }
  .form-grid, .two-column { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .work-section { grid-template-columns: 24px minmax(0,1fr); gap: 8px; }
  .review-action-row { display: block; padding-left: 32px; }
  .review-action-row .button { margin-top: 13px; width: 100%; }
  .report-panel { margin-left: 0; }
  .form-row { align-items: flex-start; flex-direction: column; }
  .app-footer { flex-direction: column; }
}

/* AI-assisted extraction review */
.ai-extraction-panel { margin-top: 17px; padding: 16px; border: 1px solid #dfe9e2; border-radius: 11px; background: #f9fcfa; }
.ai-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ai-panel-heading h3 { margin: 4px 0 5px; font-family: Georgia, serif; font-size: 19px; font-weight: 500; }
.ai-panel-heading p { max-width: 700px; margin: 0; }
.ai-consent { display: flex; grid-template-columns: auto 1fr; align-items: flex-start; gap: 9px; margin: 13px 0 10px; padding: 10px; border: 1px solid #e6ece8; border-radius: 8px; background: #fff; color: #64746a; font-size: 10px; line-height: 1.5; }
.ai-consent input { width: auto; margin: 1px 0 0; accent-color: var(--green); }
.ai-extraction-results { display: grid; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #e5ece7; }
.ai-extraction-results section { display: grid; gap: 8px; }
.ai-extraction-results h4 { margin: 0; color: #42584c; font-size: 11px; }
.ai-run-meta { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid #dfe9e2; border-radius: 8px; background: #fff; color: #728078; font-size: 10px; }
.ai-run-meta strong { color: var(--green); font-size: 12px; }
.ai-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ai-result-card { min-width: 0; padding: 10px 11px; border: 1px solid #e5ece7; border-radius: 8px; background: #fff; }
.ai-result-card strong { display: block; color: #344a40; font-size: 10px; }
.ai-result-card p { margin: 5px 0; color: #65756c; font-size: 10px; line-height: 1.45; }
.ai-result-card small { display: block; margin-top: 6px; color: #87948c; font-size: 9px; line-height: 1.5; }
.ai-result-card .button { margin-top: 9px; }
.ai-questions { margin: 0; padding-left: 18px; color: #68786e; font-size: 10px; line-height: 1.65; }
.fact-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-fact-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-fact-actions .button { min-height: 28px; padding: 5px 8px; font-size: 9px; }
@media (max-width: 720px) {
  .ai-panel-heading { display: grid; }
  .ai-panel-heading .button { width: 100%; }
  .ai-result-grid { grid-template-columns: 1fr; }
}

/* Jan-aligned extraction review: distinguish evidence, ambiguity and template context. */
.jan-status { display: inline-flex; width: fit-content; padding: 4px 7px; border-radius: 12px; background: #f1f3f1; color: #718078; font-size: 8px; font-weight: 750; }
.ai-warning-card { padding: 12px 13px; border: 1px solid #eadbbd; border-left: 3px solid #c58c4c; border-radius: 8px; background: #fff9ee; }
.ai-warning-card h4 { margin: 0 0 6px; color: #795a2d; font-size: 11px; }
.ai-warning-card p { margin: 0 0 7px; color: #7f6a4b; font-size: 10px; line-height: 1.5; }
.annotation-card { border-left: 3px solid #c6b28a; background: #fffdf8; }

/* Generalized multi-module AI review; no diagnosis or CPT-specific presentation is hard-coded. */
.ai-module-report { display: grid; gap: 13px; margin-top: 16px; padding: 15px; border: 1px solid #dfe9e2; border-radius: 10px; background: #f9fcfa; }
.ai-module-report > h3 { margin: 0; color: var(--green); font-family: Georgia, serif; font-size: 19px; font-weight: 500; }
.ai-module-report section { display: grid; gap: 8px; }
.ai-module-report .ai-result-card { background: #fff; }
.ai-module-report .ai-questions li { margin-bottom: 7px; }
.ai-module-report .ai-questions span { display: block; color: #89958d; }
.ai-module-report .ai-questions small { display: block; margin-top: 4px; color: #75837b; }
.candidate-list{display:grid;gap:12px;margin:12px 0 18px}.candidate-card{display:flex;justify-content:space-between;gap:20px;padding:16px;border:1px solid #dfe5e1;border-radius:12px;background:#fff}.candidate-main{min-width:0}.candidate-main strong{font-size:18px;margin-right:8px}.candidate-confidence{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:#68756f;border:1px solid #dfe5e1;border-radius:999px;padding:4px 7px}.candidate-main p{margin:7px 0 5px;font-weight:600}.candidate-main small{display:block;color:#69756f;line-height:1.45;margin-top:4px}.candidate-main blockquote{margin:8px 0 0;padding:7px 10px;border-left:3px solid #c9d6cf;background:#f7faf8;color:#4e5a55;font-size:12px}.candidate-actions{display:flex;align-items:center;flex:0 0 auto}.compact-title{margin-top:20px}
