:root{
  --blue:#0b6fb8;--blue-deep:#07568f;--cyan:#18a7c9;--green:#1aa36f;
  --ink:#16324a;--muted:#6a7f91;--line:#dfeaf2;--bg:#f2f8fb;--white:#fff;
  --shadow:0 18px 50px rgba(13,76,120,.12);
}
*{box-sizing:border-box}body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;background:radial-gradient(circle at 10% 0%,#e4f6fb 0,transparent 30%),linear-gradient(180deg,#f6fbfd,#edf6fa);color:var(--ink);min-height:100vh}.app-shell{max-width:1560px;margin:0 auto;padding:0 26px 22px}.topbar{min-height:104px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(44,111,150,.12);gap:18px}
.brand{display:flex;gap:16px;align-items:center}.brand-mark{width:58px;height:58px;border-radius:18px;background:linear-gradient(145deg,#0a7ac2,#12a4bc);position:relative;box-shadow:0 10px 25px rgba(9,111,170,.24)}.cross-v,.cross-h{position:absolute;background:#fff;border-radius:3px;left:50%;top:50%;transform:translate(-50%,-50%)}.cross-v{width:12px;height:35px}.cross-h{width:35px;height:12px}.hospital-name{font-size:18px;font-weight:800;letter-spacing:.35px;color:#0d588f}.app-name{font-size:13px;margin-top:6px;color:#7590a4;font-weight:700;letter-spacing:1.2px}.header-statuses{display:flex;align-items:center;gap:9px}.status-pill{background:#eaf8f3;color:#167c58;padding:9px 14px;border-radius:999px;font-size:13px;font-weight:700}.status-pill span{display:inline-block;width:8px;height:8px;background:#19a670;border-radius:50%;margin-right:7px}.engine-pill{text-decoration:none;padding:9px 12px;border-radius:999px;font-size:11px;font-weight:900;letter-spacing:.5px}.engine-pill.ready{background:#e8f6ff;color:#0b6fa7}.engine-pill.warn{background:#fff4dc;color:#9b6a09}
.main-grid{display:grid;grid-template-columns:minmax(0,.95fr) minmax(520px,1.05fr);gap:24px;padding:28px 0}.panel{background:rgba(255,255,255,.95);border:1px solid #dceaf2;border-radius:26px;box-shadow:var(--shadow)}.panel-form{padding:34px 38px}.panel-preview{padding:28px;display:flex;flex-direction:column;min-width:0}.eyebrow{font-size:12px;font-weight:900;letter-spacing:1.6px;color:var(--cyan)}h1{font-size:32px;line-height:1.18;margin:9px 0 10px;color:#103b5a}h2{margin:6px 0 0;font-size:24px}.section-heading p{color:var(--muted);line-height:1.65;margin:0 0 24px}
.upload-zone{border:2px dashed #a9cedf;background:linear-gradient(180deg,#f6fcfe,#f8fbfd);border-radius:20px;min-height:160px;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;transition:.2s;padding:22px;text-align:center}.upload-zone.drag,.upload-zone:hover{border-color:#12a2c6;background:#eefafe;transform:translateY(-1px)}.upload-zone input{display:none}.upload-icon{width:48px;height:48px;border-radius:14px;background:#e2f4fa;color:#0c83ae;font-size:28px;display:grid;place-items:center;font-weight:800}.upload-title{font-weight:800;margin-top:12px}.upload-sub{font-size:13px;color:#7890a0;margin-top:5px}.file-chip{margin-top:12px;background:#eaf8f3;color:#117854;border-radius:10px;padding:8px 12px;font-size:13px;font-weight:700;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.control-grid{display:grid;gap:18px;margin-top:20px}.control-grid.two{grid-template-columns:1fr 1fr}.field label{font-size:13px;font-weight:800;color:#3c5b70;display:block;margin:0 0 8px}.field select{width:100%;height:48px;border:1px solid #cfe0e9;border-radius:12px;background:#fff;padding:0 13px;color:#23465e;font-size:14px;outline:none}.field select:focus{border-color:#41a9d0;box-shadow:0 0 0 3px rgba(47,155,199,.11)}.segmented{height:48px;display:grid;grid-template-columns:1fr 1fr;background:#eef5f8;padding:4px;border-radius:12px}.segmented input{display:none}.segmented label{margin:0}.segmented span{height:40px;display:grid;place-items:center;border-radius:9px;cursor:pointer;color:#607b8d;font-size:14px}.segmented input:checked+span{background:#fff;color:#0b6fb8;font-weight:800;box-shadow:0 3px 10px rgba(26,82,115,.12)}
.options-row{display:flex;flex-wrap:wrap;gap:10px 20px;margin:20px 0}.check{display:flex;align-items:center;gap:8px;font-size:13px;color:#456477;cursor:pointer}.check input{accent-color:#0b83b9;width:16px;height:16px}.primary-btn{width:100%;height:56px;border:0;border-radius:14px;background:linear-gradient(90deg,#0b72b8,#0f9cbf);color:white;font-weight:900;letter-spacing:.45px;cursor:pointer;box-shadow:0 12px 24px rgba(11,114,184,.22);display:flex;align-items:center;justify-content:center;gap:10px}.primary-btn:disabled{opacity:.55;cursor:not-allowed}.btn-icon{width:27px;height:27px;border-radius:8px;background:rgba(255,255,255,.18);display:grid;place-items:center}.pdf-requirement{margin-top:10px;border-radius:11px;padding:10px 12px;display:flex;flex-direction:column;gap:3px}.pdf-requirement strong{font-size:12px}.pdf-requirement span{font-size:11px}.pdf-requirement.ok{background:#eefaf5;color:#28745c}.pdf-requirement.warning{background:#fff7e8;color:#88651e}
.progress-card,.result-card,.error-card{margin-top:18px;border-radius:14px;padding:14px 16px}.progress-card{display:flex;gap:12px;align-items:center;background:#eef8fc;color:#24566f}.progress-card span,.result-body span{display:block;font-size:12px;margin-top:3px;color:#6c8798}.spinner{width:25px;height:25px;border:3px solid #c8e7f0;border-top-color:#159ac0;border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.result-card{background:#eefaf5;border:1px solid #ccefe0;display:flex;gap:12px;align-items:center}.result-icon{width:34px;height:34px;border-radius:10px;background:#24a875;color:#fff;display:grid;place-items:center;font-weight:900;flex:0 0 auto}.result-body{flex:1;min-width:0}.pdf-note{color:#3e735f!important}.result-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.download-btn{text-decoration:none;color:#fff;padding:10px 13px;border-radius:10px;font-size:13px;font-weight:800;white-space:nowrap}.download-btn.excel{background:#188b67}.download-btn.pdf{background:#d84b4b}.error-card{background:#fff1f1;color:#a04444;border:1px solid #f3cccc;font-size:14px}
.preview-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.preview-badges{display:flex;gap:7px;align-items:center}.auto-badge,.live-badge{font-size:10px;font-weight:900;padding:7px 9px;border-radius:999px}.auto-badge{color:#0e7aa2;background:#e5f6fb}.live-badge{color:#147251;background:#e8f8f0}.paper-stage{flex:1;min-height:530px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:28px;background:radial-gradient(circle at center,#fff 0,#f1f7fa 65%,#edf5f8 100%);border-radius:18px;margin-top:22px;overflow:hidden}.paper{background:white;box-shadow:0 18px 35px rgba(20,73,104,.18);transition:.25s;display:flex;padding:9%;border:1px solid #e4edf2}.paper.portrait{width:220px;height:312px}.paper.landscape{width:312px;height:220px}.paper-margin{border:1px dashed #c5d5df;width:100%;height:100%;padding:10%}.mock-title{height:9px;width:62%;background:#61acc9;border-radius:5px}.mock-sub{height:6px;width:36%;background:#d3e5ec;border-radius:4px;margin-top:7px}.mock-table{display:grid;grid-template-columns:1.3fr 1fr 1fr 1fr;margin-top:16px;border-top:1px solid #bdcfda;border-left:1px solid #bdcfda}.mock-table div{height:20px;border-right:1px solid #bdcfda;border-bottom:1px solid #bdcfda}.mock-table div:nth-child(-n+4){background:#e8f5f9}.preview-placeholder{text-align:center;max-width:380px;margin-top:22px}.preview-placeholder strong{display:block;font-size:14px;color:#3c5f75}.preview-placeholder span{display:block;font-size:12px;line-height:1.55;color:#8196a4;margin-top:5px}
.real-preview{margin-top:22px;border:1px solid #d7e7ef;border-radius:18px;overflow:hidden;background:#e9f0f4;min-height:530px}.pdf-toolbar{height:54px;background:#fff;border-bottom:1px solid #dce8ee;padding:9px 12px;display:flex;align-items:center;justify-content:space-between;gap:12px}.pdf-toolbar div{min-width:0}.pdf-toolbar strong{display:block;font-size:13px;color:#244b63}.pdf-toolbar span{display:block;font-size:11px;color:#7d93a1;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pdf-toolbar a{text-decoration:none;font-size:11px;font-weight:800;color:#0b74aa;background:#eaf6fb;padding:8px 10px;border-radius:9px;white-space:nowrap}.real-preview iframe{display:block;width:100%;height:650px;border:0;background:#cfd7dc}
.preview-info{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:20px}.preview-info div{background:#f5f9fb;border:1px solid #e3eef3;border-radius:12px;padding:12px}.preview-info span{display:block;font-size:11px;color:#7a909e}.preview-info strong{display:block;font-size:13px;margin-top:4px;color:#284c63}.tip-box{margin-top:14px;background:#fff9e9;border:1px solid #f3e6b8;color:#71612f;padding:12px 14px;border-radius:12px;font-size:12px;line-height:1.5}footer{text-align:center;color:#8298a7;font-size:12px;padding:5px 0 20px}
@media(max-width:1120px){.main-grid{grid-template-columns:1fr}.panel-preview{min-height:700px}.header-statuses .status-pill{display:none}}@media(max-width:680px){.app-shell{padding:0 12px}.panel-form,.panel-preview{padding:20px}.control-grid.two{grid-template-columns:1fr}.hospital-name{font-size:14px}.app-name{font-size:10px}h1{font-size:26px}.brand-mark{width:48px;height:48px}.preview-info{grid-template-columns:1fr}.topbar{padding:16px 0;min-height:auto}.engine-pill{display:none}.result-card{align-items:flex-start;flex-wrap:wrap}.result-actions{width:100%;justify-content:flex-start}.real-preview iframe{height:520px}.paper-stage{min-height:440px}}
