@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1a1a1a;
  background: #f5f5f5;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* -- nav -- */
.nav { background:#fff; border-bottom:1px solid #ddd; padding:0 24px; height:52px;
       display:flex; align-items:center; justify-content:space-between; }
.nav-brand { display:flex; align-items:center; gap:8px; text-decoration:none; color:#1a1a1a; }
.nav-mark { width:28px; height:28px; background:#2a7d6e; border-radius:6px;
            display:flex; align-items:center; justify-content:center;
            font-weight:700; font-size:14px; color:#fff; }
.nav-name { font-size:0.88rem; font-weight:600; }
.nav-links { display:flex; gap:4px; }
.nav-links a { text-decoration:none; color:#555; font-size:0.82rem; font-weight:500;
               padding:5px 12px; border-radius:4px; }
.nav-links a:hover { background:#f0f0f0; }
.nav-links a.on { color:#2a7d6e; background:#eef8f6; }

/* -- page -- */
.page { max-width:820px; margin:0 auto; padding:24px 16px; }
.page-report { max-width:1200px; margin:0 auto; padding:24px 16px;
               display:grid; grid-template-columns:1fr 320px; gap:20px; align-items:start; }
.page-report .main-col { min-width:0; }

/* -- report sheet -- */
.sheet { background:#fff; border:1px solid #ddd; padding:32px 28px; margin-bottom:24px; }

/* -- report header -- */
.rpt-header { border-bottom:2px solid #1a1a1a; padding-bottom:14px; margin-bottom:18px;
              display:flex; justify-content:space-between; align-items:flex-start; }
.rpt-header h1 { font-size:1.15rem; font-weight:700; letter-spacing:-0.01em; }
.rpt-header .clinic { font-size:0.75rem; color:#666; margin-top:2px; }
.rpt-date { font-size:0.75rem; color:#666; text-align:right; }
.rpt-date strong { color:#1a1a1a; display:block; }

/* -- panel header -- */
.panel-title { font-size:0.92rem; font-weight:700; color:#1a1a1a; margin:28px 0 4px;
               padding:8px 0; border-bottom:1px solid #bbb; text-transform:uppercase;
               letter-spacing:0.03em; }
.panel-title:first-of-type { margin-top:0; }

/* -- data table -- */
.lab-table { width:100%; border-collapse:collapse; font-size:0.78rem; margin-bottom:8px; }
.lab-table th { text-align:left; font-weight:600; color:#555; font-size:0.64rem;
                text-transform:uppercase; letter-spacing:0.03em; padding:5px 6px;
                border-bottom:1px solid #ccc; white-space:nowrap; }
.lab-table td { padding:7px 6px; border-bottom:1px solid #eee; vertical-align:middle; white-space:nowrap; }
.lab-table tbody tr:last-child td { border-bottom:1px solid #ccc; }
.lab-table .marker { font-weight:500; color:#1a1a1a; white-space:nowrap; }
.lab-table .unit { color:#888; font-size:0.7rem; }

/* -- tooltip icon -- */
.tip-wrap { display:inline-flex; align-items:center; gap:5px; }
.tip-icon { display:inline-flex; align-items:center; justify-content:center;
            width:15px; height:15px; border-radius:50%; border:1px solid #ccc;
            font-size:0.6rem; color:#888; cursor:pointer; flex-shrink:0;
            font-weight:600; line-height:1; font-style:italic; font-family:Georgia,serif;
            transition: all 0.15s; }
.tip-icon:hover { border-color:#2a7d6e; color:#2a7d6e; background:#eef8f6; }
.tip-icon.active { border-color:#2a7d6e; color:#fff; background:#2a7d6e; }

/* -- side panel -- */
.info-panel { position:sticky; top:72px; background:#fff; border:1px solid #ddd;
              padding:0; font-size:0.78rem; line-height:1.55; color:#333;
              overflow:hidden; transition:all 0.2s; }
.info-panel-empty { display:flex; align-items:center; justify-content:center;
                    height:200px; color:#aaa; font-size:0.82rem; text-align:center;
                    padding:24px; line-height:1.6; }
.info-panel-header { background:#f8f8f8; border-bottom:1px solid #eee;
                     padding:12px 16px; }
.info-panel-header h3 { font-size:0.82rem; font-weight:700; color:#1a1a1a;
                        margin:0; letter-spacing:-0.01em; }
.info-panel-content { padding:16px; }
.info-section { margin-bottom:12px; }
.info-section:last-child { margin-bottom:0; }
.info-label { font-weight:700; font-size:0.65rem; text-transform:uppercase;
              letter-spacing:0.04em; margin-bottom:3px; padding:2px 0; }
.info-label-about { color:#555; }
.info-label-high { color:#c0392b; }
.info-label-low { color:#2874a6; }
.info-label-opt { color:#2a7d6e; }
.info-text { color:#444; }

@media (max-width:900px) {
  .page-report { grid-template-columns:1fr; }
  .info-panel { position:fixed; bottom:0; left:0; right:0; top:auto;
                max-height:50vh; overflow-y:auto; z-index:200;
                border-radius:12px 12px 0 0; box-shadow:0 -4px 20px rgba(0,0,0,0.15); }
  .info-panel-empty { height:auto; padding:16px; }
}
@media print { .tip-icon, .info-panel { display:none !important; }
               .page-report { grid-template-columns:1fr; } }
.lab-table .val { font-variant-numeric:tabular-nums; font-weight:500; white-space:nowrap; }
.lab-table .flag { font-weight:700; font-size:0.72rem; text-align:center; white-space:nowrap; padding-left:4px; padding-right:4px; }
.lab-table .opt-divider { border-left:1px solid #f0f0f0; padding-left:14px; }
.flag-h { color:#c0392b; }
.flag-b { color:#1565c0; font-weight:700; }
.flag-ok { color:#27ae60; }

/* -- range bar (inline) -- */
.rbar { position:relative; width:100%; height:14px; }
.rbar-track { position:absolute; top:3px; left:0; right:0; height:8px;
              background:#f0f0f0; border-radius:4px; }
.rbar-std { position:absolute; top:0; bottom:0; background:#dbeafe; border-radius:4px; }
.rbar-opt { position:absolute; top:0; bottom:0; background:#d1fae5; border-radius:4px; }
.rbar-pin { position:absolute; top:0; width:3px; height:14px; border-radius:1.5px;
            transform:translateX(-1.5px); }
.rbar-cur { background:#2a7d6e; }
.rbar-prev { background:#aaa; opacity:0.5; height:10px; top:2px; }

/* -- percent change -- */
.pct { font-size:0.75rem; font-weight:400; font-variant-numeric:tabular-nums; }
.pct-good { color:#6a9e6e; }
.pct-bad { color:#c48a8a; }
.pct-flat { color:#888; }

/* -- flags section -- */
.flags { margin-top:20px; padding-top:16px; border-top:1px solid #bbb; }
.flags h3 { font-size:0.78rem; font-weight:700; text-transform:uppercase;
            letter-spacing:0.04em; color:#555; margin-bottom:12px; }
.flag-group { margin-bottom:14px; }
.flag-group:last-child { margin-bottom:0; }
.flag-group-label { font-size:0.7rem; font-weight:600; text-transform:uppercase;
                    letter-spacing:0.03em; margin-bottom:4px; }
.flag-row { font-size:0.8rem; padding:5px 0; display:flex; gap:8px;
            align-items:flex-start; line-height:1.45; }
.flag-row strong { font-weight:600; }
.flag-dot { display:inline-block; width:7px; height:7px; border-radius:50%;
            flex-shrink:0; margin-top:6px; }

/* -- footer -- */
.rpt-footer { font-size:0.68rem; color:#999; margin-top:24px; padding-top:12px;
              border-top:1px solid #ddd; line-height:1.7; }

/* -- demo banner -- */
.demo-bar { background:#fef9e7; border:1px solid #f9e79f; padding:8px 16px;
            font-size:0.78rem; color:#7d6608; margin-bottom:16px; display:flex;
            align-items:center; gap:6px; }
.demo-bar a { color:#7d6608; font-weight:600; }

/* -- tabs -- */
.tabs { display:flex; gap:0; margin-bottom:0; border-bottom:1px solid #ddd; }
.tab { padding:10px 20px; font-size:0.82rem; font-weight:500; color:#666;
       text-decoration:none; border-bottom:2px solid transparent; margin-bottom:-1px; }
.tab:hover { color:#1a1a1a; }
.tab.active { color:#2a7d6e; border-bottom-color:#2a7d6e; font-weight:600; }

/* -- upload page -- */
.upload-wrap { max-width:520px; margin:48px auto; }
.upload-wrap h1 { font-size:1.25rem; font-weight:700; margin-bottom:4px; }
.upload-wrap p { font-size:0.88rem; color:#666; margin-bottom:24px; }
.upload-box { background:#fff; border:1px solid #ddd; padding:32px; margin-bottom:16px; }
.field-label { font-size:0.72rem; font-weight:600; text-transform:uppercase;
               letter-spacing:0.04em; color:#555; margin-bottom:4px; }
.field-label span { font-weight:400; color:#999; text-transform:none; letter-spacing:0; }
.dropzone { border:2px dashed #ccc; padding:24px; text-align:center; cursor:pointer;
            position:relative; margin-bottom:16px; background:#fafafa; }
.dropzone:hover { border-color:#2a7d6e; background:#f0faf8; }
.dropzone input { position:absolute; inset:0; opacity:0; cursor:pointer; }
.dz-text { font-size:0.85rem; color:#666; }
.dz-text strong { color:#2a7d6e; }
.dz-hint { font-size:0.72rem; color:#999; margin-top:4px; }
.file-name { font-size:0.78rem; color:#27ae60; margin-top:4px; display:none; }
.btn { display:inline-block; padding:10px 24px; font-size:0.88rem; font-weight:600;
       border:none; cursor:pointer; font-family:inherit; }
.btn-primary { background:#2a7d6e; color:#fff; }
.btn-primary:hover { background:#236b5e; }
.btn-outline { background:transparent; color:#2a7d6e; border:1px solid #2a7d6e; }
.btn-outline:hover { background:#eef8f6; }
.sep { height:1px; background:#eee; margin:16px 0; }

/* -- print -- */
@media print {
  .nav, .demo-bar, .tabs, .header-actions { display:none !important; }
  body { background:#fff; }
  .page { max-width:100%; padding:0; }
  .sheet { border:none; padding:24px 0; box-shadow:none; }
  .lab-table { font-size:9pt; }
}
