:root {
    --navy-950: #030b18;
    --navy-900: #07152c;
    --navy-850: #0a1d3a;
    --navy-800: #0d2749;
    --navy-700: #12365f;
    --blue-500: #2677c9;
    --blue-400: #42a4e9;
    --cyan-400: #50d6e8;
    --gold-500: #c59a4a;
    --gold-400: #efc96e;
    --paper: #f7f8fa;
    --paper-blue: #eef4fa;
    --ink: #10233b;
    --muted: #5f6f81;
    --line: #ccd7e2;
    --white: #ffffff;
    --danger: #bb3d50;
    --success: #2ca76a;
    --shadow: 0 18px 45px rgba(5, 19, 39, .14);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shell: min(1500px, calc(100% - 40px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button, select, input[type="range"], input[type="checkbox"] { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(66, 164, 233, .65);
    outline-offset: 3px;
}
a { color: inherit; }
img, canvas, iframe { display: block; max-width: 100%; }
canvas { touch-action: none; }

.skip-link {
    position: fixed;
    left: 12px;
    top: -100px;
    z-index: 1000;
    background: var(--white);
    color: var(--ink);
    padding: 10px 14px;
    border-radius: 6px;
    box-shadow: var(--shadow);
}
.skip-link:focus { top: 12px; }

.shell { width: var(--shell); margin: 0 auto; }
.section { padding: 88px 0; }
.section-dark { background: var(--navy-950); color: var(--white); }
.section-tinted { background: var(--paper-blue); }

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    color: var(--white);
    background: rgba(3, 11, 24, .94);
    border-bottom: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(18px);
}
.header-inner {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    text-decoration: none;
    flex: 0 0 auto;
}
.brand-mark {
    position: relative;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
}
.brand-mark::before,
.brand-mark::after,
.brand-mark span::before,
.brand-mark span::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 31px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
    transform-origin: center;
}
.brand-mark::before { transform: translate(-50%,-50%) rotate(0deg); }
.brand-mark::after { transform: translate(-50%,-50%) rotate(90deg); }
.brand-mark span::before { transform: translate(-50%,-50%) rotate(45deg); }
.brand-mark span::after { transform: translate(-50%,-50%) rotate(-45deg); }
.brand-mark span { width: 6px; height: 6px; background: var(--gold-400); border-radius: 50%; box-shadow: 0 0 15px rgba(239,201,110,.7); }
.brand-copy { display: flex; flex-direction: column; letter-spacing: .14em; }
.brand-copy strong { font-family: Georgia, "Times New Roman", serif; font-size: 17px; font-weight: 500; }
.brand-copy small { margin-top: 2px; color: #a8bbd2; font-size: 9px; }
.primary-nav { display: flex; align-items: center; justify-content: flex-end; gap: clamp(13px, 1.7vw, 27px); }
.primary-nav a {
    position: relative;
    color: #dbe7f3;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}
.primary-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: -9px;
    height: 2px;
    background: var(--gold-400);
    transition: right .2s ease;
}
.primary-nav a:hover::after { right: 0; }
.menu-toggle { display: none; color: var(--white); background: transparent; border: 1px solid rgba(255,255,255,.3); border-radius: 7px; padding: 8px 11px; }

.hero {
    position: relative;
    min-height: 640px;
    display: grid;
    align-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 70% 18%, rgba(38,119,201,.27), transparent 28%),
        radial-gradient(circle at 18% 72%, rgba(197,154,74,.16), transparent 30%),
        linear-gradient(135deg, #020712 0%, #07152c 58%, #0d2749 100%);
}
.hero::after {
    content: "";
    position: absolute;
    inset: auto -10% -210px 34%;
    height: 430px;
    border-radius: 50%;
    border: 1px solid rgba(239,201,110,.18);
    box-shadow: 0 0 120px rgba(38,119,201,.22);
    transform: rotate(-7deg);
}
.hero-stars {
    position: absolute;
    inset: 0;
    opacity: .68;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(255,255,255,.8) 0 1px, transparent 1.6px),
        radial-gradient(circle at 42% 31%, rgba(255,255,255,.55) 0 1px, transparent 1.6px),
        radial-gradient(circle at 76% 12%, rgba(255,255,255,.7) 0 1px, transparent 1.6px),
        radial-gradient(circle at 89% 60%, rgba(255,255,255,.5) 0 1px, transparent 1.6px),
        radial-gradient(circle at 54% 74%, rgba(255,255,255,.45) 0 1px, transparent 1.6px);
    background-size: 280px 240px, 350px 280px, 420px 310px, 260px 320px, 500px 410px;
}
.hero-grid {
    position: relative;
    z-index: 2;
    padding: 96px 0;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(330px, .7fr);
    gap: clamp(50px, 8vw, 120px);
    align-items: center;
}
.eyebrow, .mini-label {
    margin: 0 0 10px;
    color: var(--blue-400);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .17em;
    text-transform: uppercase;
}
.hero .eyebrow, .light .eyebrow, .comparative-section .eyebrow { color: var(--gold-400); }
.hero h1 {
    margin: 0;
    max-width: 900px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(54px, 7vw, 104px);
    font-weight: 400;
    line-height: .96;
    letter-spacing: -.04em;
}
.hero-lede { max-width: 760px; margin: 28px 0 0; color: #c8d8e9; font-family: Georgia, "Times New Roman", serif; font-size: clamp(19px, 2vw, 28px); line-height: 1.45; }
.feature-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.feature-row span { border: 1px solid rgba(239,201,110,.32); background: rgba(7,21,44,.55); color: #e5edf6; border-radius: 999px; padding: 8px 12px; font-size: 12px; }
.hero-actions, .button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button {
    min-height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 7px;
    padding: 10px 17px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--blue-500); color: var(--white); border-color: var(--blue-500); }
.button-primary:hover { background: #1f68b4; }
.button-ghost { color: var(--white); border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.04); }
.button-outline { color: var(--navy-800); border-color: #9eb2c7; background: var(--white); }
.hero-note {
    border: 1px solid rgba(255,255,255,.16);
    border-top-color: rgba(239,201,110,.65);
    border-radius: var(--radius-lg);
    padding: 30px;
    background: rgba(4, 14, 30, .72);
    box-shadow: 0 24px 60px rgba(0,0,0,.3);
    backdrop-filter: blur(12px);
}
.hero-note h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 400; }
.hero-note > p:not(.mini-label) { color: #b8c9dc; }
.hero-note dl { margin: 24px 0 0; display: grid; gap: 0; }
.hero-note dl div { display: flex; justify-content: space-between; gap: 24px; padding: 11px 0; border-top: 1px solid rgba(255,255,255,.1); }
.hero-note dt { color: #9fb1c5; }
.hero-note dd { margin: 0; color: var(--white); font-weight: 700; }

.section-heading { max-width: 870px; margin-bottom: 34px; }
.section-heading-inline { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.section-heading h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 4vw, 58px); font-weight: 400; line-height: 1.06; color: var(--navy-900); }
.section-heading p:not(.eyebrow) { margin: 13px 0 0; color: var(--muted); font-size: 17px; }
.section-heading.light h2, .section-heading.light p:not(.eyebrow) { color: var(--white); }
.section-heading.light p:not(.eyebrow) { color: #b9c8d9; }
.status-pill { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: var(--white); color: var(--muted); font-size: 12px; }
.status-pill span:first-child { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-500); box-shadow: 0 0 0 4px rgba(197,154,74,.15); }
.status-pill.running span:first-child { background: var(--success); box-shadow: 0 0 0 4px rgba(44,167,106,.15); }

.lab-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    border: 1px solid #28415f;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--navy-950);
    box-shadow: var(--shadow);
}
.scene-panel { min-width: 0; }
.scene-toolbar {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 18px;
    color: var(--white);
    border-bottom: 1px solid rgba(255,255,255,.12);
    background: #061327;
}
.scene-toolbar > div:first-child { min-width: 0; display: flex; flex-direction: column; }
.scene-toolbar strong { font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 500; }
.scene-toolbar span { color: #8fa8c2; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-badges { display: flex; gap: 7px; flex: 0 0 auto; }
.scene-badges span { color: #bcd2e8; border: 1px solid rgba(255,255,255,.16); border-radius: 5px; padding: 5px 8px; background: rgba(255,255,255,.04); }
.scene-badges span.active { color: #8fe3ba; border-color: rgba(44,167,106,.35); }
.scene-wrap { position: relative; height: clamp(520px, 55vw, 730px); overflow: hidden; background: #020813; }
#glCanvas, #labelCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#labelCanvas { pointer-events: none; }
.scene-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 50% 20%, rgba(42,119,201,.17), transparent 28%),
        linear-gradient(to bottom, transparent 67%, rgba(8,31,56,.48));
    pointer-events: none;
}
.scene-fallback { position: absolute; inset: 25%; z-index: 4; display: grid; place-content: center; text-align: center; color: var(--white); border: 1px solid rgba(255,255,255,.2); background: rgba(3,11,24,.9); border-radius: 12px; padding: 24px; }
.scene-overlay { position: absolute; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 20px; pointer-events: none; color: #bdd0e3; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.scene-overlay-top { top: 14px; left: 15px; right: 15px; }
.scene-overlay-bottom { bottom: 13px; left: 15px; right: 15px; justify-content: center; }
.scene-overlay-bottom p { max-width: 720px; margin: 0; padding: 6px 10px; text-align: center; background: rgba(3,11,24,.55); border-radius: 999px; color: #90a8c0; font-size: 10px; text-transform: none; letter-spacing: normal; }
.transport { min-height: 70px; display: flex; align-items: center; gap: 8px; padding: 11px 15px; border-top: 1px solid rgba(255,255,255,.12); background: #061327; }
.transport button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: #cfe0f1; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.16); border-radius: 7px; padding: 8px 12px; font-size: 12px; }
.transport .transport-primary { background: var(--blue-500); border-color: var(--blue-400); color: var(--white); }
.control-panel { padding: 18px; color: #e3edf7; border-left: 1px solid rgba(255,255,255,.12); background: #061327; }
.control-group { margin-bottom: 15px; }
.control-title, .range-label { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 7px; color: #a9bed3; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.control-title output, .range-label output { color: var(--gold-400); }
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.segmented button { min-height: 38px; color: #d9e6f3; background: #0a1c35; border: 1px solid #2a4564; border-radius: 5px; }
.segmented button.active { color: var(--gold-400); background: rgba(197,154,74,.13); border-color: var(--gold-500); }
.field-label { display: block; margin: 12px 0 6px; color: #9fb6cc; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.control-panel select, .control-panel input[type="number"] { width: 100%; min-height: 40px; color: #e5edf5; background: #091a31; border: 1px solid #2d4967; border-radius: 6px; padding: 7px 9px; }
.field-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.custom-scale { margin-top: 10px; padding: 10px; border: 1px solid #2d4967; border-radius: 8px; background: rgba(255,255,255,.025); }
.custom-offset-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.control-panel input[type="range"] { width: 100%; accent-color: var(--blue-400); }
.range-label { margin-top: 15px; }
.switch-list { margin-top: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.switch-list label { display: flex; align-items: center; gap: 8px; color: #b6c9dc; font-size: 11px; }
.switch-list input { width: 16px; height: 16px; accent-color: var(--blue-400); }
.metric-grid { display: grid; gap: 10px; margin-top: 12px; }
.metric-grid-six { grid-template-columns: repeat(6, 1fr); }
.metric { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); }
.metric span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.metric strong { display: block; margin-top: 5px; color: var(--navy-900); font-family: Georgia, "Times New Roman", serif; font-size: clamp(20px, 2vw, 28px); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric small { display: block; margin-top: 4px; color: #7d8b99; font-size: 10px; }

.formula-band { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #b9cadd; border-radius: var(--radius-md); overflow: hidden; background: var(--white); box-shadow: 0 10px 30px rgba(7,21,44,.05); }
.formula-band > div { padding: 17px; border-right: 1px solid var(--line); }
.formula-band > div:last-child { border-right: 0; }
.formula-band span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.formula-band code { display: block; margin-top: 7px; color: var(--navy-800); font-family: Georgia, "Times New Roman", serif; font-size: 17px; }
.math-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; margin-top: 18px; }
.table-panel, .plot-panel, .pitch-wheel-panel, .scale-data-panel, .annotation-form, .annotation-log {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: 0 10px 28px rgba(7,21,44,.05);
}
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.panel-heading h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 23px; font-weight: 400; }
.panel-heading .mini-label { margin-bottom: 3px; }
.small-button { min-height: 34px; color: var(--navy-800); background: #f5f8fb; border: 1px solid #adc0d2; border-radius: 6px; padding: 6px 10px; font-size: 11px; font-weight: 700; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #dce5ed; white-space: nowrap; }
th { color: #4f6479; background: #f2f6fa; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
td { color: var(--ink); font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
.note-swatch { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; box-shadow: 0 0 8px currentColor; }
.plot-panel { min-width: 0; }
#phaseCanvas { width: 100%; height: 360px; }
.legend-note { color: var(--muted); font-size: 11px; }
.chart-caption { margin: 0; padding: 0 18px 16px; color: var(--muted); font-size: 11px; }
.callout { margin-top: 18px; display: grid; grid-template-columns: 220px 1fr; gap: 22px; padding: 21px 24px; border-left: 4px solid var(--gold-500); background: #e4edf6; }
.callout strong { color: var(--navy-800); }
.callout p { margin: 0; color: #4e6174; }

.scale-layout { display: grid; grid-template-columns: minmax(320px,.72fr) minmax(0,1.28fr); gap: 18px; }
.pitch-wheel-panel { display: grid; place-items: center; padding: 18px; background: linear-gradient(180deg, #07162c, #0c2442); }
#pitchWheelCanvas { width: min(100%, 620px); height: auto; aspect-ratio: 1; }
.scale-data-panel { padding: 24px; }
.active-scale-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.active-scale-header h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 32px; font-weight: 400; }
.active-scale-header > span { color: var(--blue-500); border: 1px solid #bad0e4; border-radius: 999px; padding: 7px 11px; background: #f3f8fc; font-size: 12px; }
.note-card-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 20px 0; }
.note-card { position: relative; overflow: hidden; min-width: 0; padding: 16px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafcfe; }
.note-card::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--note-color); }
.note-card strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 400; }
.note-card span, .note-card small { display: block; color: var(--muted); font-size: 10px; }
.note-card span { margin-top: 5px; color: var(--blue-500); font-weight: 700; }
.keyboard { height: 150px; display: grid; grid-template-columns: repeat(7, 1fr); position: relative; padding: 0 1px; }
.key-white { position: relative; border: 1px solid #b3c0ce; border-radius: 0 0 6px 6px; background: linear-gradient(180deg, #fff, #edf2f7); }
.key-white.active { background: linear-gradient(180deg, #f5dfaa, #fff4d4); }
.key-white span { position: absolute; bottom: 7px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 10px; }
.key-black { position: absolute; z-index: 2; top: 0; width: 8%; height: 88px; border-radius: 0 0 5px 5px; background: #08182c; box-shadow: 0 3px 6px rgba(0,0,0,.25); transform: translateX(-50%); }
.key-black.active { background: linear-gradient(180deg, #2c79bd, #0c365d); box-shadow: 0 0 14px rgba(66,164,233,.65); }
.scale-note { margin-top: 20px; padding: 17px 18px; border-left: 3px solid var(--blue-500); background: #edf4fa; }
.scale-note h4 { margin: 0 0 7px; }
.scale-note p { margin: 0; color: var(--muted); font-size: 13px; }

.comparative-section { background: linear-gradient(135deg, #030a16, #071a33 58%, #0a2545); }
.model-tabs { display: grid; grid-template-columns: repeat(10, minmax(90px,1fr)); gap: 7px; margin-bottom: 12px; }
.model-tabs button { min-height: 60px; color: #aebfd1; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.15); border-radius: 7px; padding: 8px 6px; font-size: 10px; line-height: 1.25; }
.model-tabs button.active { color: var(--gold-400); border-color: var(--gold-500); background: rgba(197,154,74,.12); }
.model-workbench { display: grid; grid-template-columns: minmax(0,1fr) 310px; border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius-md); overflow: hidden; background: rgba(1,7,16,.7); }
.model-canvas-wrap { min-width: 0; min-height: 530px; }
#modelCanvas { width: 100%; height: 100%; min-height: 530px; }
.model-copy { padding: 25px; color: #dbe8f5; border-left: 1px solid rgba(255,255,255,.15); background: rgba(5,17,34,.92); }
.model-copy h3 { margin: 0; color: var(--white); font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 400; }
.model-copy > p:not(.mini-label,.limitation) { color: #a9bed2; }
.model-values { display: grid; gap: 8px; margin: 22px 0; }
.model-values div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 12px; }
.model-values span { color: #8fa8c0; }
.model-values strong { color: var(--white); }
.model-copy input[type="range"] { width: 100%; accent-color: var(--gold-400); }
.limitation { margin-top: 18px; padding: 13px; border: 1px solid rgba(239,201,110,.2); border-radius: 7px; background: rgba(197,154,74,.07); color: #c6d5e3; font-size: 11px; }

.output-layout { display: grid; grid-template-columns: .72fr 1.28fr; gap: 18px; }
.output-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.output-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); }
.output-card span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.output-card strong { display: block; margin-top: 7px; color: var(--navy-900); font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 400; }
.output-card small { display: block; margin-top: 4px; color: #758595; }
.json-panel { min-width: 0; border-radius: var(--radius-md); overflow: hidden; background: #07162b; box-shadow: var(--shadow); }
.json-panel pre { max-height: 570px; margin: 0; overflow: auto; padding: 22px; color: #bfe2ff; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

.method-grid { display: grid; grid-template-columns: 390px minmax(0,1fr); gap: 18px; }
.method-summary { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--white); }
.method-summary h3 { margin-top: 0; font-family: Georgia, "Times New Roman", serif; font-size: 29px; font-weight: 400; }
.method-summary ol { padding-left: 22px; color: #526477; }
.method-summary li { margin: 9px 0; }
.document-meta { margin: 24px 0; border-top: 1px solid var(--line); }
.document-meta div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.document-meta span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.document-meta strong { display: block; margin-top: 3px; font-size: 13px; }
.pdf-frame-wrap { min-height: 760px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: #d5dce3; box-shadow: var(--shadow); }
.pdf-frame-wrap iframe { width: 100%; height: 760px; border: 0; }

.annotation-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 18px; align-items: start; }
.annotation-form { padding: 22px; }
.annotation-form input, .annotation-form textarea { width: 100%; color: var(--ink); background: var(--white); border: 1px solid #aebdcc; border-radius: 7px; padding: 10px 12px; }
.annotation-form textarea { resize: vertical; }
.form-footer { margin-top: 15px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.form-footer p { margin: 0; color: var(--muted); font-size: 11px; }
.annotation-log { overflow: hidden; }
#annotationList { max-height: 540px; overflow: auto; padding: 10px 18px 18px; }
.annotation-entry { padding: 15px 0; border-bottom: 1px solid var(--line); }
.annotation-entry:last-child { border-bottom: 0; }
.annotation-entry header { display: flex; justify-content: space-between; gap: 15px; }
.annotation-entry strong { color: var(--navy-800); }
.annotation-entry time { color: var(--muted); font-size: 10px; }
.annotation-entry .topic { display: inline-block; margin-top: 5px; color: var(--blue-500); font-size: 11px; font-weight: 700; }
.annotation-entry p { margin: 8px 0 0; color: #506175; white-space: pre-wrap; }
.empty-state { padding: 30px 10px; color: var(--muted); text-align: center; }

.site-footer { color: #c2d1df; background: #030b18; border-top: 1px solid rgba(255,255,255,.1); }
.footer-inner { min-height: 120px; display: grid; grid-template-columns: 1fr 1.3fr auto; align-items: center; gap: 28px; }
.footer-inner div { display: flex; flex-direction: column; }
.footer-inner strong { color: var(--white); font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 400; }
.footer-inner span, .footer-inner p, .footer-inner a { color: #879db2; font-size: 11px; }
.footer-inner p { text-align: center; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 500; max-width: 340px; padding: 12px 15px; color: var(--white); background: #102b49; border: 1px solid #3b6e9b; border-radius: 8px; box-shadow: var(--shadow); opacity: 0; transform: translateY(15px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #642739; border-color: #ac5269; }

@media (max-width: 1260px) {
    .primary-nav { gap: 13px; }
    .primary-nav a { font-size: 11px; }
    .metric-grid-six { grid-template-columns: repeat(3, 1fr); }
    .model-tabs { grid-template-columns: repeat(5, 1fr); }
    .formula-band { grid-template-columns: 1fr 1fr; }
    .formula-band > div:nth-child(2) { border-right: 0; }
    .formula-band > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 1020px) {
    :root { --shell: min(100% - 28px, 960px); }
    .menu-toggle { display: inline-flex; }
    .primary-nav { position: absolute; left: 14px; right: 14px; top: calc(100% + 8px); display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 10px; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; background: #061327; box-shadow: var(--shadow); }
    .primary-nav.open { display: flex; }
    .primary-nav a { padding: 11px 10px; font-size: 13px; }
    .primary-nav a::after { display: none; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-note { max-width: 700px; }
    .lab-shell { grid-template-columns: 1fr; }
    .control-panel { border-left: 0; border-top: 1px solid rgba(255,255,255,.12); display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
    .control-panel .switch-list, .control-panel .control-group, .control-panel .range-label, .control-panel > input[type="range"], .custom-scale { grid-column: 1 / -1; }
    .math-layout, .scale-layout, .method-grid, .annotation-layout, .output-layout, .model-workbench { grid-template-columns: 1fr; }
    .model-copy { border-left: 0; border-top: 1px solid rgba(255,255,255,.15); }
    .pitch-wheel-panel { max-height: 630px; }
    .method-summary { order: 2; }
    .pdf-frame-wrap { order: 1; }
}

@media (max-width: 720px) {
    .scene-fallback { inset: 10% 7%; }
    :root { --shell: calc(100% - 22px); }
    .section { padding: 62px 0; }
    .header-inner { min-height: 66px; }
    .brand-copy strong { font-size: 14px; }
    .brand-copy small { font-size: 7px; }
    .hero { min-height: auto; }
    .hero-grid { padding: 74px 0; gap: 38px; }
    .hero h1 { font-size: clamp(50px, 16vw, 78px); }
    .hero-lede { font-size: 18px; }
    .hero-note { padding: 22px; }
    .section-heading-inline { align-items: flex-start; flex-direction: column; }
    .scene-toolbar { align-items: flex-start; }
    .scene-badges { display: none; }
    .scene-wrap { height: min(72vh, 570px); min-height: 430px; }
    .transport { display: grid; grid-template-columns: repeat(3, 1fr); }
    .transport button { padding: 7px; }
    .control-panel { grid-template-columns: 1fr; }
    .control-panel .switch-list, .control-panel .control-group, .control-panel .range-label, .control-panel > input[type="range"], .custom-scale { grid-column: auto; }
    .field-grid-two { grid-template-columns: 1fr; }
    .switch-list { grid-template-columns: 1fr 1fr; }
    .metric-grid-six { grid-template-columns: repeat(2, 1fr); }
    .metric strong { font-size: 22px; }
    .formula-band { grid-template-columns: 1fr; }
    .formula-band > div { border-right: 0; border-bottom: 1px solid var(--line); }
    .formula-band > div:last-child { border-bottom: 0; }
    .callout { grid-template-columns: 1fr; gap: 7px; }
    .note-card-grid { grid-template-columns: repeat(2, 1fr); }
    .note-card-grid .note-card:last-child { grid-column: 1 / -1; }
    .model-tabs { display: flex; overflow-x: auto; padding-bottom: 5px; }
    .model-tabs button { flex: 0 0 120px; }
    .model-canvas-wrap, #modelCanvas { min-height: 420px; }
    .output-summary { grid-template-columns: 1fr 1fr; }
    .pdf-frame-wrap, .pdf-frame-wrap iframe { min-height: 600px; height: 600px; }
    .form-footer { align-items: stretch; flex-direction: column; }
    .footer-inner { grid-template-columns: 1fr; padding: 28px 0; text-align: center; }
    .footer-inner div { align-items: center; }
    .footer-inner p { margin: 0; }
}

@media (max-width: 460px) {
    .feature-row { gap: 7px; }
    .feature-row span { font-size: 10px; }
    .hero-actions, .button-row { width: 100%; }
    .hero-actions .button, .button-row .button { flex: 1 1 auto; }
    .metric-grid-six, .output-summary { grid-template-columns: 1fr; }
    .switch-list { grid-template-columns: 1fr; }
    .transport { grid-template-columns: repeat(2, 1fr); }
    .active-scale-header { flex-direction: column; }
    .keyboard { height: 130px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* v1.1.4 fidelity + evidence pass */
.hero { min-height: 390px; }
.hero-grid { padding: 66px 0; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: clamp(36px, 6vw, 84px); }
.hero h1 { font-size: clamp(48px, 5.7vw, 82px); }
.hero-lede { font-size: clamp(17px, 1.7vw, 23px); margin-top: 20px; }
.hero-actions { margin-top: 24px; }
.hero-note { padding: 24px; }

.lab-shell { grid-template-columns: 300px minmax(0, 1fr); border-color: #1e3d63; box-shadow: 0 26px 70px rgba(2, 10, 24, .20); }
.control-panel { order: 1; border-left: 0; border-right: 1px solid rgba(255,255,255,.12); background: linear-gradient(180deg, #07162a 0%, #061327 52%, #051121 100%); }
.scene-panel { order: 2; }
.control-intro { margin: -2px -2px 16px; padding: 0 2px 16px; border-bottom: 1px solid rgba(255,255,255,.12); }
.control-intro .mini-label { margin-bottom: 6px; color: var(--gold-400); }
.control-intro h3 { margin: 0 0 7px; color: #f1d79a; font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 400; }
.control-intro p:last-child { margin: 0; color: #adc0d3; font-size: 11px; line-height: 1.55; }
.scene-wrap { height: clamp(570px, 51vw, 735px); background: #010711; }
.scene-wrap::before { z-index: 0; background: radial-gradient(circle at 52% 22%, rgba(36,119,214,.19), transparent 27%), radial-gradient(ellipse at 50% 92%, rgba(31,90,144,.22), transparent 43%), linear-gradient(to bottom, rgba(0,8,23,.15), rgba(0,3,11,.85)); }
#glCanvas { z-index: 1; }
#labelCanvas { z-index: 2; }
.scene-note-legend { position: absolute; z-index: 3; top: 56px; right: 13px; display: grid; gap: 5px; min-width: 88px; padding: 9px 10px; border: 1px solid rgba(155,188,224,.22); border-radius: 7px; background: rgba(2,10,24,.68); backdrop-filter: blur(7px); pointer-events: none; }
.scene-note-legend .legend-row { display: grid; grid-template-columns: 8px 1fr; align-items: center; gap: 7px; color: #cbd9e7; font-size: 10px; }
.scene-note-legend i { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 9px currentColor; }
.scene-badges { flex-wrap: wrap; justify-content: flex-end; }
.scene-badges span { font-size: 9px; }
.instrument-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: stretch; }
.instrument-row select { min-width: 0; }
.preview-button { min-height: 40px; padding: 0 10px; border: 1px solid #395a7b; border-radius: 6px; background: #102742; color: #dbe9f5; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.preview-button:hover { border-color: var(--gold-500); color: var(--gold-400); }
.control-help { margin: 6px 0 10px; color: #718da8; font-size: 9px; line-height: 1.45; }

.evidence-section { background: linear-gradient(180deg, #fff 0%, #f4f8fc 100%); }
.evidence-count { flex: 0 0 auto; min-width: 132px; padding: 13px 16px; border: 1px solid #b8cadc; border-radius: 9px; background: #fff; text-align: center; }
.evidence-count strong { display: block; color: var(--navy-900); font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 400; line-height: 1; }
.evidence-count span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.evidence-layout { display: grid; grid-template-columns: 1.05fr .95fr; gap: 18px; align-items: start; }
.evidence-capture-panel, .evidence-log-panel { border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; box-shadow: 0 10px 30px rgba(7,21,44,.06); }
.evidence-capture-panel { padding: 22px; }
.evidence-capture-panel input, .evidence-capture-panel textarea { width: 100%; border: 1px solid #b8cadc; border-radius: 7px; background: #fbfdff; color: var(--ink); padding: 10px 11px; font: inherit; }
.evidence-capture-panel textarea { resize: vertical; min-height: 58px; }
.evidence-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.evidence-help { margin: 14px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.evidence-log-panel { overflow: hidden; }
.evidence-list { max-height: 680px; overflow: auto; padding: 12px; background: #f8fbfe; }
.evidence-entry { margin-bottom: 10px; overflow: hidden; border: 1px solid #c9d7e5; border-radius: 8px; background: #fff; }
.evidence-entry:last-child { margin-bottom: 0; }
.evidence-entry figure { position: relative; margin: 0; background: #020914; }
.evidence-entry img { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; }
.evidence-entry .evidence-copy { padding: 11px 12px 12px; }
.evidence-entry header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.evidence-entry header strong { color: var(--navy-900); font-size: 12px; }
.evidence-entry time { color: var(--muted); font-size: 9px; }
.evidence-entry .evidence-meta { margin: 5px 0 0; color: #567089; font-size: 10px; }
.evidence-entry p { margin: 7px 0 0; color: #40566b; font-size: 11px; line-height: 1.48; }
.evidence-export-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }

@media (min-width: 1021px) {
    .visualizer-section .shell { width: min(1600px, calc(100% - 38px)); }
}

@media (max-width: 1020px) {
    .lab-shell { grid-template-columns: 1fr; }
    .scene-panel { order: 1; }
    .control-panel { order: 2; border-right: 0; border-top: 1px solid rgba(255,255,255,.12); }
    .evidence-layout { grid-template-columns: 1fr; }
    .scene-note-legend { top: 48px; }
}

@media (max-width: 720px) {
    .hero { min-height: 0; }
    .hero-grid { padding: 48px 0; }
    .scene-note-legend { display: none; }
    .evidence-count { width: 100%; }
    .evidence-actions .button { flex: 1 1 180px; }
}

/* Evidence record rendering */
.evidence-record { display: grid; grid-template-columns: minmax(150px, .42fr) minmax(0, .58fr); gap: 0; margin-bottom: 10px; overflow: hidden; border: 1px solid #c9d7e5; border-radius: 8px; background: #fff; }
.evidence-record:last-child { margin-bottom: 0; }
.evidence-frame { min-height: 118px; display: grid; place-items: center; background: #020914; color: #71869c; font-size: 10px; }
.evidence-frame img { display: block; width: 100%; height: 100%; min-height: 118px; object-fit: cover; }
.evidence-record > div:last-child { min-width: 0; padding: 12px; }
.evidence-record-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.evidence-record-head strong { color: var(--navy-900); font-size: 12px; }
.evidence-record-head time { color: var(--muted); font-size: 9px; white-space: nowrap; }
.evidence-record p { margin: 8px 0 0; color: #40566b; font-size: 11px; line-height: 1.48; }
.evidence-record small { display: block; margin-top: 8px; color: #567089; font-size: 9px; line-height: 1.45; }
@media (max-width: 620px) { .evidence-record { grid-template-columns: 1fr; } .evidence-frame img { aspect-ratio: 16/9; } }

/* v1.1.5 responsive/runtime stabilization */
html, body { max-width: 100%; overflow-x: hidden; }
main { min-width: 0; }
.scene-fallback[hidden] { display: none !important; }
.scene-fallback {
    inset: auto 14px 14px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    place-content: initial;
    max-width: 520px;
    padding: 10px 12px;
    text-align: left;
    color: #d7e7f5;
    border: 1px solid rgba(143,190,225,.28);
    border-radius: 8px;
    background: rgba(3,14,30,.82);
    box-shadow: 0 10px 30px rgba(0,0,0,.22);
    backdrop-filter: blur(8px);
}
.scene-fallback h3 { flex: 0 0 auto; margin: 0; color: #f0d28e; font-family: inherit; font-size: 10px; line-height: 1.45; text-transform: uppercase; letter-spacing: .08em; }
.scene-fallback p { margin: 0; color: #9fb7cd; font-size: 10px; line-height: 1.45; }
.section { padding: 70px 0; }
.model-canvas-wrap, #modelCanvas { min-height: 430px; }
.pdf-frame-wrap { min-height: 560px; }
.pdf-frame-wrap iframe { height: 560px; }
#annotationList { max-height: 420px; }
.evidence-list { max-height: 500px; }
.footer-inner { min-height: 96px; }

@media (max-width: 1020px) {
    .hero-grid {
        grid-template-columns: minmax(0,1fr) !important;
        gap: 28px !important;
        padding: 48px 0 !important;
    }
    .hero-copy, .hero-note { min-width: 0; }
    .hero-note { max-width: none; }
    .lab-shell { grid-template-columns: minmax(0,1fr) !important; }
    .scene-panel { order: 1 !important; }
    .control-panel {
        order: 2 !important;
        border-right: 0 !important;
        border-left: 0 !important;
        border-top: 1px solid rgba(255,255,255,.12) !important;
    }
    .scene-wrap { height: clamp(460px, 68svh, 620px); min-height: 0; }
    .pdf-frame-wrap, .pdf-frame-wrap iframe { min-height: 500px; height: 500px; }
}

@media (max-width: 720px) {
    :root { --shell: calc(100% - 20px); }
    .section { padding: 42px 0; }
    .hero-grid { padding: 36px 0 40px !important; gap: 22px !important; }
    .hero h1 { font-size: clamp(42px, 12vw, 60px) !important; line-height: .98; }
    .hero-lede { margin-top: 14px; font-size: 16px !important; line-height: 1.42; }
    .feature-row { margin-top: 18px; }
    .hero-actions { margin-top: 18px; }
    .hero-note { padding: 18px; }
    .hero-note h2 { font-size: 25px; }
    .hero-note dl { margin-top: 16px; }
    .hero-note dl div { padding: 8px 0; }
    .section-heading { margin-bottom: 22px; }
    .section-heading h2 { font-size: clamp(31px, 9vw, 42px); }
    .section-heading p:not(.eyebrow) { font-size: 14px; }
    .status-pill { width: 100%; justify-content: center; }
    .scene-toolbar { min-height: 58px; padding: 10px 12px; }
    .scene-toolbar strong { font-size: 15px; }
    .scene-wrap { height: clamp(350px, 61svh, 480px); min-height: 0 !important; }
    .scene-overlay-top { top: 10px; left: 10px; right: 10px; }
    .scene-overlay-bottom { bottom: 10px; left: 10px; right: 10px; }
    .scene-overlay-bottom p { max-width: calc(100% - 12px); }
    .scene-fallback { left: 10px; right: 10px; bottom: 10px; max-width: none; }
    .transport { grid-template-columns: repeat(5, minmax(0,1fr)) !important; gap: 5px; min-height: 58px; padding: 8px 10px; }
    .transport button { min-width: 0; min-height: 40px; padding: 5px 4px; font-size: 9px; }
    .control-panel { display: block !important; padding: 14px; }
    .control-group { margin-bottom: 13px; }
    .field-grid-two { grid-template-columns: 1fr 1fr; }
    .switch-list { grid-template-columns: 1fr 1fr; }
    .metric-grid-six { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 8px; }
    .metric { padding: 12px; }
    .metric strong { font-size: 19px; }
    .formula-band { border-radius: 9px; }
    .math-layout, .scale-layout, .method-grid, .annotation-layout, .output-layout, .model-workbench, .evidence-layout { grid-template-columns: minmax(0,1fr) !important; }
    #phaseCanvas { height: 260px; }
    .plot-panel, .table-panel, .pitch-wheel-panel, .scale-data-panel { min-width: 0; }
    .pitch-wheel-panel { padding: 10px; max-height: 390px; }
    #pitchWheelCanvas { width: min(100%, 360px); max-height: 360px; }
    .note-card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .keyboard { height: 112px; }
    .key-black { height: 66px; }
    .model-tabs { gap: 6px; }
    .model-tabs button { flex-basis: 108px; min-height: 48px; }
    .model-canvas-wrap, #modelCanvas { min-height: 310px !important; }
    .model-copy { padding: 16px; }
    .output-summary { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
    .json-panel pre { max-height: 340px; }
    .evidence-capture-panel { padding: 16px; }
    .evidence-list { max-height: 380px; }
    .pdf-frame-wrap, .pdf-frame-wrap iframe { min-height: 420px !important; height: 420px !important; }
    .annotation-form { padding: 16px; }
    #annotationList { max-height: 340px; }
    .footer-inner { min-height: 0 !important; padding: 24px 0 !important; gap: 12px; }
}

@media (max-width: 460px) {
    .field-grid-two { grid-template-columns: minmax(0,1fr); }
    .transport { grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
    .transport button:nth-child(n+4) { grid-column: span 1; }
    .metric-grid-six, .output-summary { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
    .switch-list { grid-template-columns: 1fr 1fr !important; }
    .scene-wrap { height: clamp(330px, 56svh, 430px); }
    #phaseCanvas { height: 230px; }
    .pdf-frame-wrap, .pdf-frame-wrap iframe { min-height: 360px !important; height: 360px !important; }
}

/* v1.1.5 visual fallback canvas and hard height guards */
#glCanvas[hidden] { display: none !important; }
.runtime-fallback-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}
#labelCanvas { z-index: 2; pointer-events: none; }
.scene-wrap, .model-canvas-wrap, .pdf-frame-wrap { overflow: hidden; }
.method-grid, .annotation-layout, .evidence-layout { align-items: start; }
@media (max-width: 720px) {
    .switch-list { grid-template-columns: minmax(0,1fr) !important; }
    .control-panel { max-height: none !important; }
    .method-grid, .annotation-layout, .evidence-layout { gap: 16px !important; }
}

/* v1.1.5 density pass: keep the full research stack without an artificially endless page */
@media (min-width: 1021px) {
    .section { padding: 54px 0; }
    .section-heading { margin-bottom: 24px; }
    .scene-wrap { height: 590px !important; }
    .control-panel { padding: 14px 15px; }
    .control-intro { margin-bottom: 11px; padding-bottom: 11px; }
    .control-intro h3 { font-size: 20px; }
    .control-group { margin-bottom: 10px; }
    .field-label { margin: 8px 0 5px; }
    .range-label { margin-top: 10px; }
    .switch-list { margin-top: 10px; gap: 6px 10px; }
    #phaseCanvas { height: 280px; }
    .formula-band > div { padding: 14px 16px; }
    .callout { padding: 16px 20px; }
    .pitch-wheel-panel { max-height: 500px; }
    #pitchWheelCanvas { width: min(100%, 460px); max-height: 460px; }
    .scale-data-panel { padding: 19px; }
    .note-card-grid { margin: 14px 0; }
    .note-card { padding: 12px 10px; }
    .keyboard { height: 118px; }
    .key-black { height: 72px; }
    .scale-note { margin-top: 14px; padding: 13px 15px; }
    .model-canvas-wrap, #modelCanvas { min-height: 350px !important; }
    .model-copy { padding: 20px; }
    .model-values { margin: 15px 0; }
    .json-panel pre { max-height: 410px; }
    .evidence-capture-panel { padding: 18px; }
    .evidence-capture-panel textarea { min-height: 46px; }
    .evidence-list { max-height: 390px; }
    .method-summary { padding: 20px; }
    .document-meta { margin: 17px 0; }
    .pdf-frame-wrap, .pdf-frame-wrap iframe { min-height: 440px !important; height: 440px !important; }
    #annotationList { max-height: 360px; }
}

@media (max-width: 720px) {
    .section { padding: 34px 0; }
    .section-heading { margin-bottom: 17px; }
    .hero-grid { padding-top: 28px !important; padding-bottom: 30px !important; }
    .hero-note { padding: 15px; }
    .scene-wrap { height: clamp(330px, 52svh, 405px) !important; }
    .control-panel { padding: 12px !important; }
    .control-intro { margin-bottom: 10px; padding-bottom: 10px; }
    .control-group { margin-bottom: 10px; }
    .field-label { margin-top: 8px; }
    .range-label { margin-top: 10px; }
    .metric { padding: 9px 10px; }
    .formula-band > div { padding: 12px; }
    #phaseCanvas { height: 210px !important; }
    .callout { margin-top: 12px; padding: 14px; }
    .pitch-wheel-panel { max-height: 320px; }
    #pitchWheelCanvas { width: min(100%, 292px); max-height: 292px; }
    .scale-data-panel { padding: 15px; }
    .note-card-grid { margin: 12px 0; gap: 7px; }
    .note-card { padding: 10px; }
    .keyboard { height: 94px; }
    .key-black { height: 56px; }
    .scale-note { margin-top: 12px; padding: 12px 13px; }
    .model-tabs button { min-height: 42px; }
    .model-canvas-wrap, #modelCanvas { min-height: 270px !important; }
    .model-copy { padding: 13px; }
    .model-values { margin: 12px 0; }
    .json-panel pre { max-height: 250px; padding: 14px; }
    .evidence-capture-panel { padding: 13px; }
    .evidence-actions { margin-top: 12px; gap: 7px; }
    .evidence-list { max-height: 300px; }
    .method-summary { padding: 15px; }
    .document-meta { margin: 14px 0; }
    .pdf-frame-wrap, .pdf-frame-wrap iframe { min-height: 300px !important; height: 300px !important; }
    .annotation-form { padding: 13px; }
    #annotationList { max-height: 280px; }
}

@media (max-width: 720px) {
    .scene-fallback { left: 10px !important; right: auto !important; bottom: 10px !important; max-width: min(270px, calc(100% - 20px)) !important; padding: 8px 9px; gap: 7px; }
    .scene-fallback h3, .scene-fallback p { font-size: 9px; }
}
