*{box-sizing:border-box}
body{margin:0;font-family:'Public Sans',system-ui,sans-serif;background:#f5f7fa;color:#0f172a;font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased}
.mono{font-family:'IBM Plex Mono',monospace}
.muted{color:#7b8494}.small{font-size:12px}
h1{font-size:24px;font-weight:800;letter-spacing:-.02em;margin:0}
h2{font-size:18px;font-weight:800;margin:0}
h3{font-size:14.5px;font-weight:700;margin:0}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes fadeUp{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}

.app{min-height:100vh;display:flex}
/* sidebar */
.sidebar{flex:none;width:248px;background:#fff;border-right:1px solid #e7eaf0;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.brand{display:flex;align-items:center;gap:9px;padding:20px 18px 16px}
.brand-mark{font-weight:800;font-size:18px;color:#2563eb}.brand-mark b{color:#0f172a}
.brand-logo{height:30px;width:auto;display:block}
.powered-logo{height:15px;width:auto;display:block;opacity:.9}
.brand-tag{font-family:'IBM Plex Mono',monospace;font-size:10px;color:#94a3b8;background:#f1f4f9;border:1px solid #e7eaf0;padding:2px 7px;border-radius:6px}
.nav{display:flex;flex-direction:column;gap:2px;padding:8px 12px;flex:1}
.nav-item{display:flex;align-items:center;gap:11px;width:100%;text-align:left;border:none;border-radius:8px;padding:10px 12px;cursor:pointer;font:inherit;font-size:13.5px;font-weight:500;background:transparent;color:#3f4757}
.nav-item:hover{background:#f1f4f9}
.nav-item.active{background:#eaf1ff;color:#1d4ed8;font-weight:700}
.nav-ico{flex:none;width:18px;height:18px;border-radius:5px;border:1.8px solid #b6bdc9}
.nav-item.active .nav-ico{border-color:#2563eb}
.soon-tag{margin-left:auto;font-size:9px;font-weight:700;color:#94a3b8;background:#f1f4f9;padding:2px 6px;border-radius:5px}
.user{padding:14px 16px;border-top:1px solid #eef1f6;display:flex;align-items:center;gap:10px}
.avatar{width:32px;height:32px;border-radius:50%;background:#dbe7ff;color:#1d4ed8;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:12.5px}
.user-meta{display:flex;flex-direction:column;line-height:1.25}.user-name{font-size:12.5px;font-weight:600}.user-org{font-size:10.5px;color:#94a3b8}
.powered{padding:14px 16px 18px;border-top:1px solid #eef1f6;display:flex;flex-direction:column;align-items:center;gap:4px;font-size:10px;color:#b6bdc9}
.powered b{color:#64748b;font-size:12px}

.main{flex:1;min-width:0;display:flex;flex-direction:column}
.screen{flex:1;display:flex;flex-direction:column;animation:fadeUp .3s ease}
/* The `hidden` attribute must win over `.screen{display:flex}` so only the
   active screen shows (class selectors otherwise override the UA [hidden] rule). */
.screen[hidden]{display:none}
[hidden]{display:none !important}

/* upload */
.upload-wrap{width:100%;max-width:720px;margin:0 auto;padding:56px 28px 64px}
.pill{display:inline-block;font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;padding:5px 11px;border-radius:20px}
.pill-blue{color:#1d4ed8;background:#eaf1ff}.pill-green{color:#15803d;background:#dcfce7}
.upload-wrap h1{margin:14px 0 8px}.sub{color:#5b6675;font-size:14.5px;margin:0 0 24px}
.dropzone{border:2px dashed #cdd6e3;background:#fbfcfe;border-radius:14px;padding:42px 28px;text-align:center;cursor:pointer;transition:.15s}
.dropzone.over{border-color:#2563eb;background:#f1f6ff}
.drop-ico{width:54px;height:54px;margin:0 auto 14px;border-radius:14px;background:#eaf1ff;color:#2563eb;display:flex;align-items:center;justify-content:center;font-size:24px}
.drop-title{margin:0 0 4px;font-weight:700;font-size:15px}.drop-sub{margin:0;color:#7b8494}.link{color:#2563eb;font-weight:600}
.chips{display:flex;gap:8px;justify-content:center;margin-top:16px}
.chip{font-size:11px;color:#5b6675;background:#fff;border:1px solid #e7eaf0;padding:4px 11px;border-radius:20px}
.file-list{display:flex;flex-direction:column;gap:10px;margin-top:18px}
.file-row{display:flex;align-items:center;gap:13px;background:#fff;border:1px solid #e7eaf0;border-radius:11px;padding:12px 15px;animation:fadeUp .25s}
.file-row .pdf-ico{flex:none}
.file-row .fn{flex:1;min-width:0;font-size:13.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.file-row .fm{font-size:11.5px;color:#94a3b8}
.file-row .rm{background:none;border:none;color:#b6bdc9;font-size:17px;cursor:pointer}
.mode-row{display:flex;gap:12px;margin:16px 0 0}
.mode-row label{flex:1;display:flex;flex-direction:column;gap:4px;font-size:11px;font-weight:600;color:#94a3b8;text-transform:uppercase;letter-spacing:.03em}
.mode-row select,.mode-row input{font:inherit;font-size:13px;padding:9px 10px;border:1px solid #e7eaf0;border-radius:8px;color:#1f2937;background:#fff}
.claim-meta{margin-top:18px;background:#fff;border:1px solid #e7eaf0;border-radius:11px;padding:6px 16px}
.claim-meta summary{cursor:pointer;font-weight:600;padding:8px 0;font-size:13px}
.claim-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px 18px;padding:10px 0 14px}
.claim-grid label{display:flex;flex-direction:column;gap:4px;font-size:11px;font-weight:600;color:#94a3b8;text-transform:uppercase;letter-spacing:.03em}
.claim-grid input,.claim-grid select{font:inherit;font-size:13px;padding:8px 10px;border:1px solid #e7eaf0;border-radius:8px;color:#1f2937}
.actions{display:flex;align-items:center;gap:16px;margin-top:24px}.actions.pad{padding:0 32px 40px}
.btn-primary{background:#2563eb;color:#fff;border:none;border-radius:10px;padding:13px 24px;font:inherit;font-size:14.5px;font-weight:700;cursor:pointer;box-shadow:0 3px 10px rgba(37,99,235,.28)}
.btn-primary:hover{background:#1d4ed8}.btn-primary:disabled{background:#b8c2d4;box-shadow:none;cursor:not-allowed}
.btn-ghost{background:transparent;color:#5b6675;border:1.5px solid transparent;border-radius:10px;padding:13px 18px;font:inherit;font-weight:600;cursor:pointer}.btn-ghost:hover{background:#eef1f6}
.hint{font-size:12.5px;color:#94a3b8}
.pdf-ico{width:34px;height:42px;border-radius:6px;background:#fdecec;border:1px solid #f6cccc;display:flex;align-items:flex-end;justify-content:center;padding-bottom:4px;font-size:8px;font-weight:800;color:#c0392b}

/* processing */
.proc-wrap{margin:auto;width:100%;max-width:480px;text-align:center;padding:48px 28px}
.spinner{width:74px;height:74px;margin:0 auto 22px;border-radius:50%;border:5px solid #e3e9f2;border-top-color:#2563eb;border-right-color:#2563eb;animation:spin .85s linear infinite;display:flex;align-items:center;justify-content:center}
.spinner span{font-family:'IBM Plex Mono',monospace;font-size:15px;font-weight:600;color:#2563eb;animation:spin .85s linear infinite reverse}
.proc-steps{background:#fff;border:1px solid #e7eaf0;border-radius:14px;padding:8px;margin-top:22px;text-align:left}
.proc-step{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:9px}
.proc-step.active{background:#f5f8ff}
.proc-dot{flex:none;width:22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800;background:#f1f4f9;color:#94a3b8}
.proc-step.done .proc-dot{background:#16a34a;color:#fff}.proc-step.active .proc-dot{background:#fff;color:#2563eb;border:2px solid #2563eb}
.proc-step .lbl{font-size:13.5px;color:#94a3b8}.proc-step.done .lbl,.proc-step.active .lbl{color:#1f2937;font-weight:600}
.bar{margin-top:16px;height:6px;border-radius:6px;background:#e3e9f2;overflow:hidden}.bar-fill{height:100%;width:0;background:linear-gradient(90deg,#2563eb,#3b82f6);transition:width .3s}
.bar-indeterminate{position:relative}
@keyframes indet{0%{left:-45%}100%{left:100%}}
.bar-indet{position:absolute;top:0;height:100%;width:45%;border-radius:6px;background:linear-gradient(90deg,#93c5fd,#2563eb,#93c5fd);animation:indet 1.15s ease-in-out infinite}

/* topbar */
.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 32px;background:#fff;border-bottom:1px solid #e7eaf0;flex-wrap:wrap}
.topbar-title{display:flex;align-items:center;gap:11px}
.status-pill{display:inline-flex;align-items:center;gap:8px;font-size:12.5px;font-weight:700;padding:7px 14px;border-radius:22px;background:#dcfce7;color:#15803d}
.status-pill i{width:7px;height:7px;border-radius:50%;background:#16a34a}

/* ocr review */
.ocr-grid{display:grid;grid-template-columns:1.05fr .95fr;gap:20px;align-items:start;padding:24px 32px;max-width:1200px}
.card{background:#fff;border:1px solid #e7eaf0;border-radius:14px;box-shadow:0 1px 3px rgba(15,23,42,.04);padding:18px 20px;margin-bottom:16px}
.card-head{display:flex;align-items:center;gap:9px;margin-bottom:12px}
.card-head h3{flex:1}
.ai{width:22px;height:22px;border-radius:6px;background:#eaf1ff;color:#2563eb;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800}
.doc-card{padding:0;overflow:hidden}
.doc-card .card-head{padding:14px 18px;border-bottom:1px solid #eef1f6;background:#fafbfd;margin:0}
.doc-tabs{display:flex;gap:6px;padding:10px 14px;flex-wrap:wrap;border-bottom:1px solid #eef1f6}
.doc-tab{font-size:11.5px;padding:5px 10px;border-radius:8px;border:1px solid #e7eaf0;background:#fff;cursor:pointer}
.doc-tab.active{background:#eaf1ff;border-color:#c7d6f5;color:#1d4ed8;font-weight:600}
.doc-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 14px;border-bottom:1px solid #eef1f6}
.doc-toolbar .doc-tabs{border-bottom:none;padding:10px 0;flex:1}
.view-toggle{display:flex;gap:4px;background:#f1f4f9;border-radius:8px;padding:3px;flex:none}
.view-btn{font:inherit;font-size:11.5px;font-weight:600;border:none;background:transparent;color:#64748b;padding:5px 11px;border-radius:6px;cursor:pointer}
.view-btn.active{background:#fff;color:#1d4ed8;box-shadow:0 1px 2px rgba(15,23,42,.08)}
.doc-frame{width:100%;height:560px;border:none;display:block}
.doc-text{width:100%;height:560px;margin:0;padding:18px 20px;overflow:auto;white-space:pre-wrap;word-break:break-word;font-family:'IBM Plex Mono',monospace;font-size:11.5px;line-height:1.55;color:#334155;background:#fafbfd}
.code-mini-list{display:flex;flex-direction:column;gap:3px}
.code-mini{display:flex;align-items:center;gap:11px;padding:8px;border-radius:8px}
.code-mini:hover{background:#f7f9fc}
.code-mini .code-chip{flex:none;min-width:52px;text-align:center;font-family:'IBM Plex Mono',monospace;font-size:12px;font-weight:600;padding:4px 8px;border-radius:6px}
.code-chip.icd10{color:#1d4ed8;background:#eaf1ff}.code-chip.icd9cm{color:#15803d;background:#dcfce7}
.code-mini .desc{flex:1;font-size:12.5px;color:#1f2937}

/* result */
.result-wrap{padding:24px 32px 24px;max-width:1080px;width:100%}
.hero-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:18px}
.hero{border-radius:16px;padding:22px 24px;position:relative;overflow:hidden;border:1px solid}
.hero-green{background:linear-gradient(180deg,#f3fcf6,#fff);border-color:#cdeed6}
.hero-orange{background:linear-gradient(180deg,#fff7f1,#fff);border-color:#f6d8bf}
.hero-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.04em}
.hero-green .hero-top{color:#15803d}.hero-orange .hero-top{color:#c2410c}
.tag{font-size:11px;font-weight:700;padding:4px 10px;border-radius:20px}.tag-green{color:#15803d;background:#dcfce7}.tag-orange{color:#c2410c;background:#ffedd5}
.hero-amt{font-family:'IBM Plex Mono',monospace;font-size:32px;font-weight:600;line-height:1}
.hero-green .hero-amt{color:#15803d}.hero-orange .hero-amt{color:#c2410c}
.split-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;font-size:12px;font-weight:700;text-transform:uppercase;color:#7b8494}
.split-head .mono{font-size:16px;color:#0f172a}
.split-bar{display:flex;width:100%;height:14px;border-radius:8px;overflow:hidden;background:#e3e9f2}
.seg-green{background:#16a34a}.seg-orange{background:#ea580c}
.split-legend{display:flex;gap:22px;margin-top:11px;font-size:12px;color:#5b6675}
.split-legend i{display:inline-block;width:9px;height:9px;border-radius:3px;margin-right:6px}
.dot-green{background:#16a34a}.dot-orange{background:#ea580c}

/* INA-CBGS + koding viewer */
.koding-head{border-bottom:1px solid #eef1f6;padding-bottom:12px;margin-bottom:16px}
.inacbg-box{border:1px solid #e7eaf0;border-radius:12px;padding:16px 18px;margin-bottom:18px}
.inacbg-title{font-size:16px;font-weight:800;margin-bottom:10px}
.inacbg-detail{border:1px solid #eef1f6;border-radius:10px;padding:12px 14px}
.inacbg-detail .grp{font-weight:600}.inacbg-detail .rp{color:#15803d;font-family:'IBM Plex Mono',monospace;margin-top:4px}
.inacbg-detail.empty{color:#94a3b8}
.kode-h{margin:6px 0 10px;font-size:13px;font-weight:700;color:#0f172a}
.code-list{display:flex;flex-direction:column;gap:10px}
.code-item{border:1px solid #eef1f6;border-left-width:3px;border-radius:10px;overflow:hidden}
.code-item.t-green{border-left-color:#16a34a}.code-item.t-yellow{border-left-color:#d4a72c}.code-item.t-red{border-left-color:#dc2626}.code-item.t-gray{border-left-color:#cbd5e1}
.code-row{display:flex;align-items:center;gap:11px;padding:13px 14px;cursor:pointer}
.code-row:hover{background:#fafbfd}
.tier-dot{flex:none;width:13px;height:13px;border-radius:50%}
.tier-dot.green{background:#16a34a}.tier-dot.yellow{background:#d4a72c}.tier-dot.red{background:#dc2626}.tier-dot.gray{background:#cbd5e1}
.code-row .code{font-weight:700;font-family:'IBM Plex Mono',monospace}
.code-row .cdesc{color:#475569}
.badge{font-size:9px;font-weight:800;letter-spacing:.04em;padding:2px 6px;border-radius:5px}
.badge.primary{color:#c2410c;background:#ffedd5}.badge.cdss{color:#92600a;background:#fde68a}
.chev{margin-left:auto;color:#94a3b8;transition:transform .2s}
.code-item.open .chev{transform:rotate(90deg)}
.code-body{display:none;padding:0 14px 14px;border-top:1px solid #f1f4f9}
.code-item.open .code-body{display:block;animation:fadeUp .2s}
.sumber{background:#f5f7fb;border-left:3px solid #6366f1;border-radius:8px;padding:12px 14px;margin:14px 0}
.sumber .lab{font-weight:700;font-size:12px;color:#334155}
.sumber .txt{color:#4f46e5;margin:4px 0 2px}.sumber .prov{font-size:11px;color:#94a3b8;font-family:'IBM Plex Mono',monospace}
.rule-block{border:1px solid #eef1f6;border-radius:10px;padding:12px;margin-bottom:12px}
.rule-block .rb-head{display:flex;gap:10px;align-items:flex-start;justify-content:space-between;font-weight:700;font-size:13px;color:#334155;margin-bottom:10px}
.rb-combo{font-size:9px;font-weight:800;color:#64748b;background:#eef1f6;padding:3px 7px;border-radius:5px;white-space:nowrap}
.cond{border:1px solid #eef1f6;border-radius:9px;margin-bottom:8px;overflow:hidden}
.cond-row{display:flex;align-items:center;gap:10px;padding:11px 12px;cursor:pointer}
.cond-row b{flex:1;font-weight:600;font-size:13px}
.cond-body{display:none;padding:0 12px 12px}.cond.open .cond-body{display:block}
.crit-lab{color:#6366f1;font-weight:700;font-size:11.5px;margin:6px 0 3px}
.crit-txt{font-size:12.5px;color:#334155;white-space:pre-wrap}
.var-row{display:flex;gap:12px;align-items:flex-start;padding:7px 0;border-top:1px solid #f5f7fb;font-size:12.5px}
.var-name{flex:none;width:200px;color:#64748b}
.var-val{flex:1;font-weight:600;color:#1f2937}
.var-val.miss{color:#dc2626;font-weight:500}
.var-val.ok{color:#15803d;font-weight:600}
.var-val.unknown{color:#94a3b8;font-weight:500}
.var-src-text{color:#4f46e5;font-weight:500}
.var-src{color:#6366f1;cursor:help}

/* toast */
.toast{position:fixed;bottom:26px;left:50%;transform:translateX(-50%);background:#0f172a;color:#fff;font-size:13px;padding:13px 20px;border-radius:11px;box-shadow:0 10px 30px rgba(15,23,42,.28);z-index:80}
@media(max-width:900px){.ocr-grid,.hero-grid,.claim-grid{grid-template-columns:1fr}.sidebar{display:none}}
