:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #12263f;
  --muted: #5a6b7d;
  --border: #d8e1ea;
  --teal: #0b8a9a;
  --teal-soft: #d6eef1;
  --amber: #e08a1e;
  --focus: #0b8a9a;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(18, 38, 63, 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.45;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--teal);
  color: #fff;
  padding: 0.6rem 1rem;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.site-header {
  flex: 0 0 auto;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  max-width: 1440px;
  margin: 0 auto;
}

.brand-mark {
  width: 12px;
  height: 36px;
  margin-top: 0.15rem;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--teal), #066a76);
  flex-shrink: 0;
}

.brand-name {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 650;
}

.site-header h1 {
  margin: 0.1rem 0 0;
  font-size: clamp(0.95rem, 2.2vw, 1.25rem);
  font-weight: 650;
  line-height: 1.25;
}

.app {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.68fr) minmax(280px, 1fr);
  min-height: 0;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.viewer-pane {
  position: relative;
  min-width: 0;
  min-height: 0;
  background:
    radial-gradient(ellipse at 40% 30%, #ffffff 0%, transparent 55%),
    linear-gradient(165deg, #eef3f7 0%, #f5f7fa 45%, #e8eef4 100%);
  border-right: 1px solid var(--border);
}

.viewer {
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

.viewer:active {
  cursor: grabbing;
}

.viewer canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.viewer-toolbar {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  z-index: 5;
}

.view-btn,
.seg-btn,
.btn,
.size-btn {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.view-btn {
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
  box-shadow: var(--shadow);
}

.view-btn:hover,
.seg-btn:hover,
.size-btn:hover,
.btn-secondary:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.hotspot-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

.hotspot {
  position: absolute;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--teal);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(18, 38, 63, 0.25);
  display: grid;
  place-items: center;
  padding: 0;
}

.hotspot:hover,
.hotspot[aria-pressed="true"] {
  background: #066a76;
  transform: scale(1.08);
}

.caption-card {
  position: absolute;
  right: 0.85rem;
  top: 0.85rem;
  width: min(280px, calc(100% - 1.7rem));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem 1rem 1rem;
  z-index: 8;
}

.caption-card[hidden] {
  display: none;
}

.caption-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  border: none;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.caption-num {
  margin: 0;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.caption-card h2 {
  margin: 0.2rem 0 0.45rem;
  font-size: 1rem;
}

.caption-card p:last-child {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.control-panel {
  background: var(--panel);
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.panel-scroll {
  overflow: auto;
  padding: 1rem 1.1rem 1.25rem;
  overscroll-behavior: contain;
}

.control-group {
  margin-bottom: 1.15rem;
  padding-bottom: 1.05rem;
  border-bottom: 1px solid var(--border);
}

.control-group:last-of-type {
  border-bottom: none;
}

.control-group h2 {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.radio-list {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.radio-list label,
.check-grid label,
.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  cursor: pointer;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.35rem;
}

.seg-btn {
  padding: 0.55rem 0.35rem;
  font-size: 0.72rem;
  line-height: 1.2;
}

.seg-btn[aria-pressed="true"] {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.hint,
.note,
.disclaimer {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.note {
  color: var(--amber);
  font-weight: 560;
}

.size-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.size-btn {
  flex: 1 1 auto;
  min-width: 4.5rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

.size-btn[aria-pressed="true"] {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
  font-weight: 650;
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.75rem;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.info-box {
  background: var(--teal-soft);
  border: 1px solid #b7e0e6;
  border-radius: var(--radius);
  padding: 0.85rem 0.9rem !important;
  border-bottom: none !important;
}

.info-box h2 {
  color: var(--teal);
}

.info-box p {
  margin: 0;
  font-size: 0.88rem;
}

.actions {
  display: grid;
  gap: 0.5rem;
  border-bottom: none !important;
  padding-bottom: 0.4rem !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.btn-primary:hover {
  background: #066a76;
  border-color: #066a76;
  color: #fff;
}

.disclaimer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.site-footer {
  flex: 0 0 auto;
  padding: 0.55rem 1rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background: #fff;
  font-size: 0.78rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 55dvh minmax(0, 1fr);
  }

  .viewer-pane {
    border-right: none;
    border-bottom: 1px solid var(--border);
    height: 55dvh;
  }

  .control-panel {
    height: auto;
  }

  .segmented {
    grid-template-columns: 1fr;
  }

  .seg-btn {
    font-size: 0.82rem;
    padding: 0.55rem 0.7rem;
  }
}

@media (max-width: 375px) {
  .site-header,
  .panel-scroll,
  .site-footer {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .viewer-toolbar {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
  }

  .view-btn {
    font-size: 0.72rem;
    padding: 0.35rem 0.5rem;
  }

  .caption-card {
    right: 0.5rem;
    top: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
select { width:100%; margin:8px 0 16px; padding:10px; border:1px solid var(--border); border-radius:8px; background:white; color:var(--text); font:inherit; }
button:disabled, select:disabled, input:disabled { opacity:.45; cursor:not-allowed; }
#plate-spec { line-height:1.65; font-variant-numeric:tabular-nums; }
/* Product storytelling presentation */
:root { --text:#153b41; --muted:#687f83; --teal:#087f8c; --border:#dce6e5; }
.site-header {display:flex;align-items:center;justify-content:space-between;padding:18px 28px;background:#fff;}
.brand {margin:0;max-width:none;align-items:center;}
.brand-mark {height:32px;width:5px;border-radius:0;}
.brand-name {font-size:10px;letter-spacing:.14em;}
.site-header h1 {font-size:21px;letter-spacing:-.04em;}
.brand-sub {font-size:13px;color:var(--muted);font-weight:400;letter-spacing:0;}
.concept-badge {font-size:10px;letter-spacing:.04em;border:1px solid var(--border);padding:7px 10px;border-radius:30px;color:var(--muted);}
.app {max-width:none;grid-template-columns:minmax(0,1fr) 365px;height:calc(100dvh - 115px);min-height:600px;flex:1;}
.viewer-pane {min-height:600px;}
.scene-heading {position:absolute;left:30px;top:27px;z-index:3;pointer-events:none;}
.eyebrow {font-size:10px;letter-spacing:.14em;font-weight:700;color:var(--teal);}
.scene-heading h2 {font-size:clamp(25px,3vw,43px);font-weight:500;letter-spacing:-.055em;margin:7px 0 3px;}
.scene-heading p {font-size:13px;color:var(--muted);margin:0;}
.scene-status {position:absolute;right:24px;bottom:74px;background:#fff9;padding:7px 12px;border-radius:30px;font-size:11px;color:var(--teal);z-index:3;}
.scene-legend {position:absolute;left:28px;bottom:73px;display:flex;gap:13px;z-index:3;font-size:10px;color:var(--muted);}
.scene-legend span {display:flex;align-items:center;gap:5px;}.scene-legend i {width:7px;height:7px;border-radius:50%;display:inline-block;}
.bone-key {background:#cabd9e;}.plate-key{background:#6d7780;}.tissue-key{background:#d59278;}.route-key{background:#168cc5;}
.orbit-hint {position:absolute;right:25px;bottom:20px;font-size:10px;color:var(--muted);margin:0;}
.viewer-toolbar {left:26px;bottom:22px;}.view-btn{box-shadow:none;border-radius:20px;font-size:11px;}
.panel-scroll {padding:26px 24px;}.story-intro h2{font-size:27px;letter-spacing:-.04em;font-weight:500;line-height:1.15;margin:10px 0;}.story-intro>p:last-child{font-size:13px;line-height:1.7;color:var(--muted);}
.story-steps {display:grid;gap:3px;margin:23px 0 18px;}.story-steps button {font:inherit;display:flex;align-items:center;gap:12px;text-align:left;border:0;border-radius:7px;background:transparent;padding:10px;color:var(--muted);cursor:pointer;font-size:12px;}.story-steps button span{font-size:10px;opacity:.7;font-variant-numeric:tabular-nums;}.story-steps button[aria-pressed=true]{color:var(--teal);background:#e9f3f1;font-weight:650;}.story-steps button:hover{background:#f0f5f4;}
.story-card {border-left:2px solid var(--teal);padding:0 0 0 15px;min-height:160px;}.story-card h3{font-size:18px;font-weight:500;letter-spacing:-.025em;margin:7px 0;}.story-card>p:not(.eyebrow){font-size:12px;line-height:1.7;color:var(--muted);}.story-card .route-caption{font-size:10px!important;color:var(--teal)!important;}
.tour-actions {display:grid;grid-template-columns:35px 1fr 35px;gap:7px;margin:20px 0 12px;}.tour-actions button,.presentation-actions>button {border:1px solid var(--border);background:white;border-radius:6px;min-height:36px;color:var(--text);cursor:pointer;font:inherit;font-size:12px;}#tour-play{background:var(--teal);border-color:var(--teal);color:white;}
.presentation-actions {display:grid;gap:12px;font-size:11px;}.presentation-actions label{display:flex;align-items:center;gap:7px;color:var(--muted);}.presentation-actions>button[aria-pressed=true]{background:#e9f3f1;}
.advanced-controls {margin:22px 0;border-top:1px solid var(--border);border-bottom:1px solid var(--border);padding:16px 0;}.advanced-controls summary{font-size:12px;cursor:pointer;font-weight:650;}.advanced-controls summary span{display:block;font-size:10px;color:var(--muted);font-weight:400;margin:3px 0 0 15px;}.advanced-controls[open] summary{margin-bottom:22px;}
.actions .btn{font-size:12px;min-height:38px;padding:9px;}.disclaimer{font-size:10px;line-height:1.7;}.site-footer{font-size:9px;padding:8px;}.site-footer a{color:var(--muted);}.caption-card{top:150px;max-width:235px;}.hotspot{width:24px;height:24px;margin:-12px;font-size:10px;opacity:.9;}
@media(max-width:1100px){.scene-heading{left:22px;}.orbit-hint{display:none;}.scene-status{bottom:109px;left:22px;right:auto;}.scene-legend{left:22px;font-size:9px;gap:9px;}}
@media(min-width:741px) and (max-width:900px){.app{grid-template-columns:minmax(0,1fr) 330px;grid-template-rows:1fr;}.viewer-pane{height:auto;border-right:1px solid var(--border);}.panel-scroll{padding:22px 18px;}.segmented{grid-template-columns:repeat(3,1fr);}}
@media(max-width:740px){.site-header{padding:13px 16px;}.concept-badge{display:none;}.app{height:auto;min-height:0;display:flex;flex-direction:column;}.viewer-pane{height:62dvh;min-height:450px;}.scene-heading{top:20px;}.scene-heading h2{font-size:30px;}.control-panel{height:auto;}.panel-scroll{overflow:visible;padding:24px;}.scene-status{left:auto;right:18px;bottom:74px;}.scene-legend{bottom:106px;}.story-steps{grid-template-columns:1fr 1fr;}.story-steps button:last-child{grid-column:1 / -1;}.story-card{min-height:0;}.caption-card{top:135px;}.site-footer{line-height:1.8;}}
.scene-heading {padding:0 0 18px;}.scene-heading h2,.scene-heading p {text-shadow:0 1px 8px #f1f5f3;}.scene-legend {background:#f1f5f3db;padding:8px 10px;border-radius:20px;}.scene-heading{background:linear-gradient(90deg,#f1f5f3ed,#f1f5f300);padding-right:30px;}
#export-dialog {max-width:min(760px,92vw);max-height:92dvh;border:1px solid var(--border);border-radius:14px;padding:20px;color:var(--text);box-shadow:0 25px 90px #1238;}
#export-dialog::backdrop {background:#163c4666;backdrop-filter:blur(4px);}.export-header {display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;}.export-header h2 {font-size:18px;margin:0;}.export-header button {background:none;border:0;font-size:26px;cursor:pointer;color:var(--text);}#export-preview{display:block;max-width:100%;max-height:65dvh;margin:0 auto 16px;}#export-download {display:flex;}
