:root {
  --bg:#f0f2f5; --surface:#fff; --border:#dfe3e8; --border-light:#eef0f3;
  --text:#1a202c; --text2:#4a5568; --text3:#8896a6;
  --blue:#2c6fad; --blue-dark:#1e4f7f; --blue-light:#e6f0fa;
  --green:#1b8a4a; --green-bg:#e6f7ed; --green-border:#34c36e;
  --orange:#cc6d1a; --orange-bg:#fef3e6; --orange-border:#e8922e;
  --red:#b7302a; --red-bg:#fceae9; --red-border:#dc4a44;
  --gray-bg:#f7f8fa;
  --font:'Apple SD Gothic Neo','Malgun Gothic','Noto Sans KR',-apple-system,sans-serif;
}
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}
html{font-size:15px}
body{font-family:var(--font);background:var(--bg);color:var(--text);line-height:1.5;-webkit-font-smoothing:antialiased}

/* ═══ Screens ═══ */
.screen{display:none}.screen.active{display:block}

/* ═══ Upload ═══ */
.upload-container{max-width:600px;margin:0 auto;padding:80px 24px 60px}
.app-header{text-align:center;margin-bottom:36px}
.app-header h1{font-size:1.6rem;font-weight:800;color:var(--text)}
.app-sub{color:var(--text2);font-size:.85rem;margin-top:6px}
.drop-zone{border:2px dashed var(--border);border-radius:10px;padding:52px 24px;text-align:center;cursor:pointer;transition:all .2s;background:var(--surface);position:relative}
.drop-zone:hover,.drop-zone.dragover{border-color:var(--blue);background:var(--blue-light)}
.drop-zone-content svg{width:44px;height:44px;color:var(--text3);margin-bottom:14px}
.drop-zone:hover svg{color:var(--blue)}
.drop-zone-content p{font-size:.95rem;color:var(--text2);margin-bottom:4px}
.drop-hint{font-size:.78rem;color:var(--text3)}
.drop-zone input[type="file"]{position:absolute;inset:0;opacity:0;cursor:pointer}
.file-list{margin-top:16px}
.file-item{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;background:var(--surface);border:1px solid var(--border);border-radius:6px;margin-bottom:6px;font-size:.88rem}
.file-item .file-name{font-weight:600}.file-item .file-size{color:var(--text3);font-size:.78rem}
.file-item .file-remove{background:none;border:none;color:var(--text3);cursor:pointer;font-size:1.1rem;padding:0 4px}
.file-item .file-remove:hover{color:var(--red)}
.btn-primary,.btn-secondary{display:inline-flex;align-items:center;gap:6px;padding:11px 24px;border-radius:6px;font-size:.88rem;font-weight:700;cursor:pointer;border:none;transition:all .15s;font-family:var(--font)}
.btn-primary{background:var(--blue);color:#fff;width:100%;justify-content:center;margin-top:16px}
.btn-primary:hover:not(:disabled){background:var(--blue-dark)}.btn-primary:disabled{opacity:.4;cursor:default}
.btn-secondary{background:var(--surface);color:var(--text2);border:1px solid var(--border)}
.btn-secondary:hover{background:var(--bg)}.btn-sm{padding:8px 14px;font-size:.8rem}

/* ═══ Results ═══ */
.results-header{display:flex;align-items:center;justify-content:space-between;padding:12px 28px;background:var(--surface);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:100}
.results-header .btn-primary{width:auto;margin:0}
.patient-tabs{display:flex;gap:0;padding:0 28px;background:var(--surface);border-bottom:1px solid var(--border);overflow-x:auto}
.patient-tab{padding:12px 22px;font-size:.85rem;font-weight:600;color:var(--text2);cursor:pointer;border:none;background:none;border-bottom:2px solid transparent;white-space:nowrap;font-family:var(--font)}
.patient-tab:hover{color:var(--text)}.patient-tab.active{color:var(--blue);border-bottom-color:var(--blue)}
.report-container{max-width:780px;margin:0 auto;padding:24px 20px 60px}

/* ═══════════════════════════════
   REPORT STYLES
   ═══════════════════════════════ */

.rpt{background:#fff;width:760px;font-family:'Apple SD Gothic Neo','Malgun Gothic','Noto Sans KR',sans-serif;color:#1a202c;line-height:1.5}

/* Header */
.rpt-header{background:linear-gradient(135deg,#2c6fad 0%,#1e4f7f 100%);color:#fff;padding:22px 28px 18px}
.rpt-title-row{display:flex;align-items:baseline;justify-content:space-between}
.rpt-title{font-size:1.45rem;font-weight:800;letter-spacing:-.02em}
.rpt-subtitle{font-size:.92rem;font-weight:600;opacity:.9}
.rpt-meta{display:flex;justify-content:flex-end;gap:16px;margin-top:6px;font-size:.78rem;opacity:.82;flex-wrap:wrap}
.rpt-meta span{white-space:nowrap}

/* History Alert */
.rpt-alert{margin:0;padding:12px 28px;font-size:.82rem;line-height:1.7;border-bottom:1px solid #eef0f3}
.rpt-alert.high{background:#fceae9;border-left:4px solid #dc4a44}
.rpt-alert.medium{background:#fef3e6;border-left:4px solid #e8922e}
.rpt-alert.low{background:#e6f0fa;border-left:4px solid #2c6fad}
.rpt-alert.none{background:#f7f8fa;border-left:4px solid #dfe3e8;color:#8896a6}
.rpt-alert-item{padding:1px 0}
.rpt-alert-dot{display:inline-block;width:6px;height:6px;border-radius:50%;margin-right:6px;vertical-align:middle}
.rpt-alert-dot.high{background:#dc4a44}.rpt-alert-dot.medium{background:#e8922e}.rpt-alert-dot.low{background:#2c6fad}

/* Section */
.rpt-section{border-top:1px solid #eef0f3}
.rpt-sec-head{display:flex;align-items:center;gap:10px;padding:16px 28px 12px}
.rpt-sec-title{font-size:1.15rem;font-weight:800;color:#1a202c}
.rpt-badge{font-size:.6rem;font-weight:800;width:28px;height:28px;border-radius:50%;color:#fff;display:inline-flex;align-items:center;justify-content:center;padding:0;flex-shrink:0}
.rpt-badge.excellent{background:#2c6fad}.rpt-badge.good{background:#1b8a4a}.rpt-badge.caution{background:#e8922e}.rpt-badge.warning{background:#dc4a44}
.rpt-healer-badge{display:inline-block;margin-left:6px;padding:2px 8px;background:#f0f2f5;border:1px solid #dfe3e8;border-radius:10px;font-size:.7rem;color:#4a5568;font-weight:700}

/* ═══ Laser Stat Bar (one line, 3 items, uniform font size) ═══ */
.rpt-stat-bar{display:flex;align-items:center;padding:16px 28px;background:#f8f9fb;border-bottom:1px solid #eef0f3}
.rpt-stat-item{flex:1;display:flex;align-items:baseline;gap:0;justify-content:center;font-size:1rem}
.rpt-stat-label{font-weight:700;color:#1a202c;margin-right:4px}
.rpt-stat-val{font-weight:900}
.rpt-stat-val.blue{color:#2c6fad}
.rpt-stat-val.green{color:#1b8a4a}
.rpt-stat-val.orange{color:#cc6d1a}
.rpt-stat-val.red{color:#b7302a}
.rpt-stat-unit{font-weight:600;color:#1a202c}
.rpt-stat-sep{width:1px;height:24px;background:#d0d5dd;flex-shrink:0}

/* Chart - no title */
.rpt-chart-wrap{padding:6px 28px 8px}
.rpt-chart svg{width:100%;display:block}

/* Analysis box with donut stamp */
.rpt-analysis-wrap{position:relative;margin:0 28px 16px}
.rpt-analysis{padding:16px 20px;padding-right:110px;background:#f7f8fa;border-radius:8px;font-size:.86rem;line-height:1.9;color:#4a5568}
.rpt-analysis b{font-weight:800}
.rpt-donut-stamp{position:absolute;top:50%;right:8px;transform:translateY(-50%)}

/* Highlight colors */
.hl-b{color:#2c6fad;font-weight:800}
.hl-g{color:#1b8a4a;font-weight:800}
.hl-o{color:#cc6d1a;font-weight:800}
.hl-r{color:#b7302a;font-weight:800}

/* ═══ Podologe ═══ */
.rpt-podo-head{display:flex;align-items:center;gap:10px;padding:16px 28px 12px}

/* Podologe: boxes + phase bar row */
.rpt-podo-row{display:flex;align-items:stretch;gap:12px;padding:0 28px 14px}
.rpt-podo-boxes{display:flex;gap:4px;flex-shrink:0}
.rpt-pbox{width:72px;height:72px;border:2px solid #eef0f3;border-radius:8px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#fff}
.rpt-pbox-val{font-size:1.3rem;font-weight:900;color:#1a202c;line-height:1.1}
.rpt-pbox-sub{font-size:.62rem;color:#8896a6;font-weight:600}
.rpt-pbox-label{font-size:.62rem;font-weight:700;color:#1a202c;margin-top:3px}

/* Phase area next to boxes */
.rpt-podo-phase-area{flex:1;display:flex;flex-direction:column;justify-content:center;min-width:0}
.rpt-phase-now{font-size:.88rem;font-weight:700;color:#4a5568;display:flex;align-items:center;gap:6px;margin-bottom:8px}
.rpt-phase-dot{width:10px;height:10px;border-radius:3px;flex-shrink:0}
.rpt-phase-bar{display:flex;height:10px;border-radius:5px;overflow:hidden}
.rpt-ps{height:100%}
.rpt-ps.p1{background:#d94535}.rpt-ps.p2{background:#d4a017}.rpt-ps.p3{background:#28a745}.rpt-ps.p4{background:#3a7bc8}.rpt-ps.empty{background:#e8eaed}
.rpt-phase-labels{display:flex;justify-content:space-between;margin-top:3px;font-size:.58rem;color:#8896a6;font-weight:600}

/* Side-by-side: Toe map LEFT + Timeline RIGHT */
.rpt-podo-body{display:flex;padding:14px 28px;gap:16px;border-top:1px solid #eef0f3}
.rpt-podo-left{flex:0 0 210px;display:flex;flex-direction:column;align-items:center}
.rpt-podo-right{flex:1;min-width:0}

/* Toe map */
.rpt-toes{text-align:center}
.rpt-toes-label{font-size:.75rem;color:#8896a6;margin-bottom:8px;font-weight:600}
.rpt-toes svg.rpt-toe-svg{width:200px;display:block;margin:0 auto}

/* Half circle */
.rpt-half-circle{display:inline-block}

/* Flat timeline */
.rpt-podo-tl{position:relative;padding-left:20px}
.rpt-podo-tl::before{content:'';position:absolute;left:6px;top:4px;bottom:4px;width:2px;background:#dfe3e8}
.rpt-ptl-item{position:relative;padding:4px 0 4px 12px;display:flex;align-items:center;gap:6px;font-size:.76rem}
.rpt-ptl-dot{position:absolute;left:-18px;top:8px;width:8px;height:8px;border-radius:50%;border:2px solid}
.rpt-ptl-item.sf .rpt-ptl-dot{background:#2c6fad;border-color:#2c6fad;width:10px;height:10px;left:-19px;top:7px}
.rpt-ptl-item.sn .rpt-ptl-dot{background:#1b8a4a;border-color:#1b8a4a}
.rpt-ptl-item.sd .rpt-ptl-dot{background:#e8922e;border-color:#e8922e}
.rpt-ptl-num{font-weight:800;color:#8896a6;width:16px;text-align:right;font-size:.68rem}
.rpt-ptl-date{font-weight:700;color:#1a202c;font-size:.76rem}
.rpt-ptl-foot{color:#8896a6;font-size:.68rem}
.rpt-ptl-tag{font-size:.66rem;font-weight:700;padding:1px 6px;border-radius:8px;margin-left:auto;white-space:nowrap}
.rpt-ptl-tag.normal{background:#e6f7ed;color:#1b8a4a}
.rpt-ptl-tag.delayed{background:#fef3e6;color:#cc6d1a}
.rpt-ptl-tag.first{background:#e6f0fa;color:#2c6fad}

.rpt-next{padding:14px 28px;font-size:.9rem;font-weight:700;color:#4a5568;border-top:1px solid #eef0f3}
.rpt-next b{color:#2c6fad;font-size:1rem}

/* Footer */
.rpt-footer{padding:10px 28px;font-size:.65rem;color:#b0b8c4;text-align:right;border-top:1px solid #eef0f3}

/* ═══ Print ═══ */
@media print{body{background:#fff}.results-header,.patient-tabs,.download-btn-row,.btn-primary,.btn-secondary{display:none!important}.report-container{padding:0}}
@media(max-width:640px){html{font-size:14px}.report-container{padding:12px}.rpt{width:100%}}
