/* =====================================================================
   FootAssess Pro — Global Stylesheet
   ===================================================================== */

/* ── Reset & Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #1565C0;
  --primary-dark: #0D47A1;
  --primary-lt:   #1976D2;
  --primary-bg:   #E3F2FD;
  --accent:       #1E88E5;

  --green:        #2E7D32;
  --green-lt:     #E8F5E9;
  --red:          #C62828;
  --red-lt:       #FFEBEE;
  --orange:       #E65100;
  --orange-lt:    #FFF3E0;
  --gold:         #F9A825;

  --text:         #1A237E;
  --text-body:    #37474F;
  --text-muted:   #78909C;
  --border:       #CFD8DC;
  --bg:           #F4F6F9;
  --white:        #FFFFFF;
  --card-shadow:  0 2px 12px rgba(21,101,192,0.10);
  --card-shadow-lg: 0 6px 32px rgba(21,101,192,0.14);

  --radius:   10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.55;
  font-size: 15px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Utilities ─────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.hidden    { display: none !important; }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px;
  border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .18s, box-shadow .18s, opacity .18s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { opacity: .92; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.btn-primary  { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(21,101,192,.3); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline  { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }
.btn-sm       { padding: 7px 14px; font-size: 13px; }
.btn-full     { width: 100%; justify-content: center; margin-bottom: 8px; }
.btn-report   { background: var(--green); font-size: 15px; padding: 13px 22px; }
.btn-report:hover { background: #1B5E20; }

/* ── Header ────────────────────────────────────────────────────────── */
.site-header {
  background: var(--primary-dark);
  color: #fff;
  padding: 12px 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { width: 38px; height: 38px; flex-shrink: 0; }
.brand-name  { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: .3px; }
.brand-sub   { font-size: 11px; color: #90CAF9; margin-top: 1px; }

.header-nav { display: flex; gap: 20px; }
.nav-link { color: #90CAF9; font-size: 14px; font-weight: 500; cursor: pointer; transition: color .15s; }
.nav-link:hover, .nav-link.active { color: #fff; text-decoration: none; }

.header-actions { display: flex; gap: 10px; }

/* ── Badges ────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-blue { background: rgba(255,255,255,.15); color: #fff; }

/* ── Alert ─────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 500; }
.alert-error { background: var(--red-lt); color: var(--red); border-left: 4px solid var(--red); }

/* ══════════════════════════════════════════════════════════════════════
   HOME PAGE
   ══════════════════════════════════════════════════════════════════════ */

/* ── Hero ──────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-lt) 100%);
  color: #fff; padding: 56px 0 48px;
}

.hero .container { display: flex; gap: 48px; align-items: center; flex-wrap: wrap; }

.hero-text { flex: 1; min-width: 280px; }
.hero-title { font-size: 34px; font-weight: 800; line-height: 1.15; margin-bottom: 16px; }
.hero-desc  { font-size: 16px; opacity: .88; max-width: 460px; margin-bottom: 20px; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; }

.hero-visual { flex-shrink: 0; }

.ref-card {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
  padding: 20px 24px;
  backdrop-filter: blur(6px);
  min-width: 280px;
}
.ref-card-title { color: #90CAF9; font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; margin-bottom: 12px; }

.ref-table { width: 100%; border-collapse: collapse; }
.ref-table th { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #90CAF9;
  padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,.15); text-align: left; }
.ref-table td { padding: 7px 10px; font-size: 13px; color: rgba(255,255,255,.9); }
.ref-table tr:not(:last-child) td { border-bottom: 1px solid rgba(255,255,255,.08); }

/* ── How it works ──────────────────────────────────────────────────── */
.how-it-works { padding: 52px 0; }

.section-title {
  font-size: 22px; font-weight: 700; color: var(--text);
  margin-bottom: 28px; position: relative; padding-bottom: 12px;
}
.section-title::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 40px; height: 3px; background: var(--primary); border-radius: 2px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
}

.step-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 20px 24px;
  box-shadow: var(--card-shadow);
  position: relative;
  border-top: 3px solid var(--primary);
  text-align: center;
}

.step-num {
  position: absolute; top: -14px; left: 20px;
  background: var(--primary); color: #fff;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}

.step-icon { font-size: 28px; margin-bottom: 12px; }
.step-card h4 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.step-card p  { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ── Upload Section ────────────────────────────────────────────────── */
.upload-section { padding: 48px 0; background: var(--white); border-top: 1px solid var(--border); }

.upload-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 8px;
  max-width: 620px; margin: 0 auto;
}

.drop-zone {
  border: 2.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  transition: border-color .2s, background .2s;
  cursor: pointer;
  background: var(--white);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.drop-zone.drag-over { border-style: solid; }

.drop-icon { margin-bottom: 16px; }
.drop-label { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.drop-sub   { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

.preview-wrap { margin-bottom: 16px; }
.preview-wrap img { max-height: 220px; max-width: 100%; border-radius: var(--radius-sm);
  box-shadow: var(--card-shadow); }

.upload-actions { margin-top: 16px; padding: 12px 0 4px; }
.selected-file { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.upload-btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.upload-note { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text-muted); }

/* ── Input Tabs ────────────────────────────────────────────────────── */
.input-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}

.tab-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px;
  border: none; background: transparent;
  font-size: 14px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.tab-btn:hover { background: var(--primary-bg); color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--white); }

.tab-pane { padding: 0; }

/* ── Camera Zone ───────────────────────────────────────────────────── */
.camera-zone {
  min-height: 280px;
  display: flex; flex-direction: column;
  background: var(--white);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Idle state */
.camera-idle {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 36px 24px; gap: 10px; text-align: center;
}
.camera-idle-icon { margin-bottom: 8px; }
.camera-https-note {
  font-size: 12px; color: var(--orange);
  background: var(--orange-lt); border-radius: var(--radius-sm);
  padding: 8px 14px; margin-top: 8px;
}
.camera-error-msg {
  font-size: 13px; color: var(--red);
  background: var(--red-lt); border-radius: var(--radius-sm);
  padding: 10px 14px; margin-top: 12px; text-align: center;
}

/* Viewfinder */
.camera-viewfinder {
  display: flex; flex-direction: column;
  background: #000;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.viewfinder-wrap {
  position: relative; overflow: hidden;
  flex: 1; min-height: 280px; max-height: 480px;
  background: #111;
  display: flex; align-items: center; justify-content: center;
}

#cameraVideo {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}

/* 3x3 rule-of-thirds grid */
.viewfinder-grid {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr 1fr;
  pointer-events: none;
}
.viewfinder-grid span {
  border: 0.5px solid rgba(255,255,255,.15);
}

/* Corner brackets */
.viewfinder-corners { position: absolute; inset: 0; pointer-events: none; }
.corner {
  position: absolute; width: 20px; height: 20px;
  border-color: #fff; border-style: solid; opacity: .8;
}
.corner.tl { top: 12px; left: 12px;   border-width: 2px 0 0 2px; }
.corner.tr { top: 12px; right: 12px;  border-width: 2px 2px 0 0; }
.corner.bl { bottom: 12px; left: 12px;  border-width: 0 0 2px 2px; }
.corner.br { bottom: 12px; right: 12px; border-width: 0 2px 2px 0; }

/* Flash overlay */
.capture-flash {
  position: absolute; inset: 0;
  background: #fff; opacity: 0; pointer-events: none;
  transition: opacity .08s;
}
.capture-flash.flash-active { opacity: 0.85; }

/* Viewfinder controls */
.viewfinder-controls {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  background: #111;
  gap: 12px;
}

/* Shutter button */
.shutter-btn {
  width: 64px; height: 64px; border-radius: 50%;
  background: #fff; border: 4px solid rgba(255,255,255,.4);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .1s, box-shadow .1s;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,.15);
}
.shutter-btn:hover  { transform: scale(1.06); box-shadow: 0 0 0 5px rgba(255,255,255,.25); }
.shutter-btn:active { transform: scale(.94); }

.shutter-inner {
  width: 48px; height: 48px; border-radius: 50%;
  background: #fff; border: 2px solid #ccc;
  display: block;
  transition: background .1s;
}
.shutter-btn:hover .shutter-inner { background: #E3F2FD; }

/* Override outline btn colors inside dark viewfinder */
.viewfinder-controls .btn-outline {
  border-color: rgba(255,255,255,.35); color: #fff;
  background: rgba(255,255,255,.08);
}
.viewfinder-controls .btn-outline:hover { background: rgba(255,255,255,.18); }

/* Captured preview */
.camera-captured {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px; gap: 16px; background: var(--white);
  border-radius: 0 0 var(--radius) var(--radius);
}
.captured-img-wrap { position: relative; display: inline-block; }
.captured-img-wrap img {
  max-height: 280px; max-width: 100%; border-radius: var(--radius);
  box-shadow: var(--card-shadow-lg); display: block;
}
.captured-badge {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  background: rgba(46,125,50,.9); color: #fff;
  font-size: 12px; font-weight: 700;
  padding: 5px 14px; border-radius: 20px; white-space: nowrap;
}
.captured-controls { display: flex; gap: 10px; }

/* Drop zone inside tab */
.tab-pane #dropZone {
  border-radius: 0 0 var(--radius) var(--radius);
  border-top: none;
}

/* Spinner */
.spinner {
  width: 16px; height: 16px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Arch Types ────────────────────────────────────────────────────── */
.arch-types { padding: 52px 0; }

.arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.arch-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--card-shadow);
  text-align: center;
}
.arch-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-muted); margin-bottom: 12px; }
.arch-name  { font-size: 16px; font-weight: 700; color: var(--text); margin-top: 12px; }
.arch-angle { font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 20px;
  display: inline-block; margin: 6px 0 12px; }
.arch-card p { font-size: 13px; color: var(--text-muted); }

.arch-flat   .arch-angle { background: var(--red-lt);    color: var(--red); }
.arch-normal .arch-angle { background: var(--green-lt);  color: var(--green); }
.arch-high   .arch-angle { background: var(--orange-lt); color: var(--orange); }

/* Arch diagram SVG-like shapes */
.arch-diagram {
  width: 120px; height: 60px; margin: 0 auto;
  border-radius: 0 0 60px 60px;
  position: relative; overflow: hidden;
}
.arch-diagram::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--primary-bg);
  border-radius: 0 0 60px 60px;
}
.arch-diagram.flat::before   { height: 90%; }
.arch-diagram.normal::before { height: 55%; }
.arch-diagram.high::before   { height: 20%; }

.arch-flat   .arch-diagram { border: 2px solid var(--red);    }
.arch-normal .arch-diagram { border: 2px solid var(--green);  }
.arch-high   .arch-diagram { border: 2px solid var(--orange); }

/* ── Footer ────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--primary-dark); color: #90CAF9;
  text-align: center; padding: 20px 0; font-size: 12px;
}

/* ══════════════════════════════════════════════════════════════════════
   ASSESS PAGE
   ══════════════════════════════════════════════════════════════════════ */

.page-assess { background: #1A1A2E; }
.page-assess .site-header { background: #0D1117; }

.assess-layout {
  display: flex;
  height: calc(100vh - 62px);
  overflow: hidden;
}

/* ── Left Panel ────────────────────────────────────────────────────── */
.assess-panel {
  width: 300px;
  min-width: 280px;
  background: #161B22;
  border-right: 1px solid #30363D;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.panel-section {
  padding: 16px;
  border-bottom: 1px solid #30363D;
}

.panel-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .9px; color: #7D8590; margin-bottom: 12px;
}

/* Mode toggle */
.mode-toggle { display: flex; flex-direction: column; gap: 8px; }

.mode-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: #21262D; border: 1.5px solid #30363D; border-radius: var(--radius-sm);
  color: #C9D1D9; font-size: 13px; cursor: pointer; width: 100%;
  text-align: left; transition: border-color .15s, background .15s;
}
.mode-btn:hover { border-color: var(--primary); background: #1C2128; }
.mode-btn.active { border-color: var(--primary-lt); background: rgba(21,101,192,.2); color: #fff; }
.mode-icon { font-size: 18px; }
.mode-btn small { color: #7D8590; font-size: 11px; display: block; margin-top: 2px; }

/* Step list */
.step-list { display: flex; flex-direction: column; gap: 8px; }

.step-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #21262D; color: #8B949E; font-size: 12px;
  line-height: 1.45;
}
.step-item.step-done    { background: rgba(46,125,50,.15); color: #56D364; }
.step-item.step-current { background: rgba(21,101,192,.2); color: #79B8FF; border: 1px solid rgba(21,101,192,.4); }
.step-icon-num { flex-shrink: 0; font-size: 14px; }

/* Result section */
.result-section { }

.angle-display { text-align: center; margin-bottom: 8px; }
.angle-value { font-size: 40px; font-weight: 800; color: #F9A825; line-height: 1; }
.angle-label { font-size: 11px; color: #7D8590; margin-top: 4px; }

.perp-display { text-align: center; margin: 4px 0 8px; }
.perp-value   { font-size: 24px; font-weight: 700; color: #9FC5E8; }

.classification-badge {
  display: block; text-align: center;
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700;
  background: #21262D; color: #7D8590;
  margin-bottom: 14px;
}
.classification-badge.badge-flat   { background: rgba(198,40,40,.2); color: #FF5252; }
.classification-badge.badge-normal { background: rgba(46,125,50,.2); color: #56D364; }
.classification-badge.badge-cavus  { background: rgba(230,81,0,.2);  color: #FFB74D; }

.ref-mini-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ref-mini-table th { color: #7D8590; padding: 5px 8px; text-align: left; border-bottom: 1px solid #30363D; }
.ref-mini-table td { padding: 5px 8px; color: #8B949E; border-bottom: 1px solid #21262D; }
.ref-mini-table tr.ref-active td { color: #F9A825; font-weight: 700; }

/* Controls */
.control-btns .btn-outline {
  background: #21262D; border-color: #30363D; color: #8B949E; font-size: 12px;
}
.control-btns .btn-outline:hover { border-color: var(--primary-lt); color: #fff; }

/* ── Canvas area ───────────────────────────────────────────────────── */
.assess-main {
  flex: 1;
  display: flex; flex-direction: column;
  background: #0D1117;
  overflow: hidden;
  min-width: 0;
}

.canvas-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px;
  background: #161B22; border-bottom: 1px solid #30363D;
  font-size: 12px; color: #8B949E;
}
.toolbar-hint { flex: 1; }
.toolbar-coords { font-family: 'Courier New', monospace; color: #6E7681; }

.canvas-container {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  overflow: auto; padding: 16px;
  position: relative;
  cursor: crosshair;
}

#assessCanvas {
  display: block;
  box-shadow: 0 4px 32px rgba(0,0,0,.6);
  border-radius: 4px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.canvas-overlay-msg {
  position: absolute;
  color: #7D8590; font-size: 16px;
}

.canvas-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 16px;
  background: #161B22; border-top: 1px solid #30363D;
  font-size: 11px; color: #6E7681;
}

/* ══════════════════════════════════════════════════════════════════════
   REPORT PAGE
   ══════════════════════════════════════════════════════════════════════ */

.page-report { background: #ECEFF1; }

.report-actions {
  background: var(--primary-dark);
  padding: 10px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.action-btns { display: flex; gap: 10px; }

.report-wrapper {
  max-width: 900px; margin: 32px auto; padding: 0 20px 48px;
}

.report-doc {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow-lg);
  overflow: hidden;
}

/* ── Report Header ─────────────────────────────────────────────────── */
.report-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 28px 32px 20px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-lt) 100%);
  color: #fff;
}
.report-header-left { display: flex; align-items: center; gap: 14px; }
.report-clinic-name { font-size: 22px; font-weight: 800; }
.report-clinic-sub  { font-size: 12px; color: #90CAF9; margin-top: 3px; }

.report-header-right { text-align: right; }
.report-meta-row { display: flex; gap: 10px; justify-content: flex-end;
  font-size: 13px; color: rgba(255,255,255,.85); margin-bottom: 4px; }
.report-meta-row span { opacity: .7; }
.report-id { font-size: 11px; color: #90CAF9; margin-top: 6px; font-family: monospace; }

.report-divider { height: 1px; background: var(--border); margin: 0 24px; }

/* ── Report Sections ───────────────────────────────────────────────── */
.report-section { padding: 24px 32px; }

.report-section-title {
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .7px; color: var(--primary); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.report-section-title::before {
  content: '';
  width: 3px; height: 18px; background: var(--primary);
  border-radius: 2px; display: inline-block;
}

/* Patient grid */
.patient-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 20px; }
.patient-field-full { grid-column: 1 / -1; }
.patient-field label { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.patient-line { border-bottom: 1.5px solid var(--border); height: 22px; }
.patient-line.short { max-width: 120px; }

/* Analysis grid */
.analysis-grid { display: flex; gap: 24px; flex-wrap: wrap; }
.analysis-image-wrap { flex: 0 0 auto; max-width: 380px; }
.img-caption { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; font-style: italic; }
.analysis-image { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); display: block; }
.img-legend { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); }
.legend-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.analysis-data { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 16px; }

.big-angle-card {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-lt));
  color: #fff; border-radius: var(--radius); padding: 20px 24px; text-align: center;
}
.big-angle-value { font-size: 52px; font-weight: 900; line-height: 1; color: #FFD600; }
.big-angle-label { font-size: 13px; opacity: .8; margin-top: 6px; }
.big-angle-perp  { font-size: 14px; color: #90CAF9; margin-top: 8px; }

.result-classification-block {
  background: var(--bg); border-radius: var(--radius); padding: 16px;
  border-left: 4px solid currentColor;
}
.result-class-label { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.result-class-note  { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.ref-compare-table h4 { font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: var(--text-muted); letter-spacing: .5px; margin-bottom: 8px; }
.ref-compare-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ref-compare-table th { background: var(--primary-dark); color: #fff; padding: 8px 12px;
  text-align: left; font-size: 11px; }
.ref-compare-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.ref-compare-table tr.ref-row-normal td { background: var(--green-lt); }
.ref-compare-table tr.ref-row-flat   td { background: var(--red-lt); }
.ref-compare-table tr.ref-row-cavus  td { background: var(--orange-lt); }
.table-note { font-size: 11px; color: var(--text-muted); margin-top: 6px; font-style: italic; }

/* Full reference table */
.report-table-caption { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }

.full-ref-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.full-ref-table th {
  background: var(--primary-dark); color: #fff;
  padding: 10px 16px; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
}
.full-ref-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); }
.full-ref-table tr:hover td { background: var(--primary-bg); }
.full-ref-table tr.ref-row-normal td { background: var(--green-lt); font-weight: 600; color: var(--green); }
.full-ref-table tr.ref-row-flat   td { background: var(--red-lt);   font-weight: 600; color: var(--red); }

/* Arch visual row */
.arch-visual-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}

.arch-visual-item {
  background: var(--bg); border-radius: var(--radius); padding: 20px 16px;
  text-align: center; border: 2px solid transparent; transition: border-color .2s;
}
.arch-visual-item.arch-active { border-color: var(--primary); background: var(--primary-bg); }

.arch-visual-diagram {
  width: 80px; height: 50px; border-radius: 0 0 40px 40px;
  margin: 0 auto 12px; position: relative; overflow: hidden; border: 2px solid;
}
.arch-visual-diagram::before {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; border-radius: 0 0 40px 40px;
  background: var(--primary-bg);
}
.arch-vis-flat   { border-color: var(--red);    }
.arch-vis-normal { border-color: var(--green);  }
.arch-vis-high   { border-color: var(--orange); }
.arch-vis-flat::before   { height: 90%; }
.arch-vis-normal::before { height: 55%; }
.arch-vis-high::before   { height: 20%; }

.arch-vis-name  { font-size: 14px; font-weight: 700; color: var(--text); }
.arch-vis-latin { font-size: 11px; color: var(--text-muted); font-style: italic; }
.arch-vis-range {
  font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: 20px; display: inline-block; margin-top: 6px;
}
.arch-vis-flat   .arch-vis-range { background: var(--red-lt);    color: var(--red); }
.arch-vis-normal .arch-vis-range { background: var(--green-lt);  color: var(--green); }
.arch-vis-high   .arch-vis-range { background: var(--orange-lt); color: var(--orange); }

/* Conclusion */
.conclusion-box {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 20px 24px; border-radius: var(--radius);
  border: 2px solid; background: var(--bg);
}
.conclusion-icon { font-size: 32px; flex-shrink: 0; line-height: 1; }
.conclusion-text h3 { font-size: 18px; margin-bottom: 6px; }
.conclusion-text p  { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin-bottom: 6px; }
.conclusion-measure { font-size: 14px; color: var(--text-body) !important; }

/* Recommendations */
.recs-list { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.recs-list li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; line-height: 1.55; color: var(--text-body);
  padding: 10px 14px; background: var(--bg); border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}
.recs-list li::before { content: '›'; color: var(--primary); font-weight: 700; font-size: 16px; flex-shrink: 0; }

/* Disclaimer */
.report-disclaimer { background: #FAFAFA; }
.report-disclaimer p { font-size: 11.5px; color: var(--text-muted); line-height: 1.55; margin-bottom: 6px; }
.report-sig { text-align: right; font-style: italic; margin-top: 12px !important; }

/* ── Print Styles ──────────────────────────────────────────────────── */
@media print {
  .report-wrapper { margin: 0; padding: 0; }
  .report-doc { box-shadow: none; border-radius: 0; }
  .report-section { padding: 16px 24px; }
  .report-header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .full-ref-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .assess-layout { flex-direction: column; height: auto; }
  .assess-panel { width: 100%; min-width: unset; }
  .assess-main { height: 60vh; }
  .report-header { flex-direction: column; gap: 16px; }
  .patient-grid { grid-template-columns: 1fr 1fr; }
  .analysis-grid { flex-direction: column; }
  .arch-visual-row { grid-template-columns: 1fr; }
  .hero .container { flex-direction: column; }
  .hero-title { font-size: 26px; }
}
