:root {
    --bg: #03111d;
    --bg-2: #071a2b;
    --panel: #071d31;
    --panel-2: #0b2841;
    --panel-3: #0d3554;
    --line: #1c4e70;
    --line-soft: rgba(92, 157, 196, .34);
    --text: #e9f4fb;
    --muted: #91b3c9;
    --cyan: #69c7ff;
    --green: #28d45c;
    --amber: #ff9d22;
    --red: #ff503e;
    --ice: #eef6fb;
    --ink: #0c2b45;
    --shadow: 0 14px 40px rgba(0, 0, 0, .28);
    --radius: 6px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--text); background: #020b13; font-size: 12px; }
button, input, select, textarea { font: inherit; }
button, select, input, textarea { color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app-shell { min-height: 100vh; background: radial-gradient(circle at 48% 0, #0a2c48 0, #051726 35%, #020b13 100%); }
.topbar {
    min-height: 58px;
    display: grid;
    grid-template-columns: 285px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 6px 18px 6px 27px;
    border-bottom: 1px solid #214d6d;
    background: linear-gradient(180deg, rgba(4, 20, 34, .99), rgba(3, 15, 26, .99));
    box-shadow: 0 1px 0 rgba(130, 194, 232, .08), 0 8px 20px rgba(0, 0, 0, .22);
    position: relative;
    z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; letter-spacing: .16em; }
.brand img { filter: drop-shadow(0 0 8px rgba(80, 173, 235, .35)); }
.brand span { display: grid; }
.brand strong { font-size: 15px; font-weight: 500; line-height: 1.1; }
.brand small { font-size: 8px; margin-top: 3px; color: #c4d7e4; letter-spacing: .3em; }
.title-block { min-width: 0; padding-left: 2px; }
.title-block h1 { margin: 0; font-size: clamp(16px, 1.45vw, 23px); line-height: 1.08; letter-spacing: -.02em; font-weight: 800; }
.title-block p { margin: 4px 0 0; color: #9fc0d6; font-size: 10px; letter-spacing: .015em; }
.utility-nav { display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.utility-nav a, .utility-nav button { min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 0; border-left: 1px solid rgba(118, 169, 199, .18); background: transparent; color: #d5e7f2; text-decoration: none; font-size: 10px; }
.utility-nav a:hover, .utility-nav button:hover { background: rgba(55, 121, 164, .14); }
.utility-nav span { font-size: 18px; color: #b9d7e9; }
.utility-nav em { font-style: normal; }
.profile-link { margin-left: 6px; padding-left: 14px !important; gap: 9px !important; }
.profile-link b { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #1b5680, #0a2e4e); color: white; font-size: 9px; }
.profile-link i { font-style: normal; color: #8fb0c5; }

.dashboard {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(260px, 19.2vw) minmax(0, 1fr);
    align-items: start;
    background: #03111d;
}
.body-column {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(600px, 1fr) minmax(370px, 27.5vw);
    align-items: start;
    background: #03111d;
}
.left-rail, .right-rail { min-width: 0; background: linear-gradient(180deg, #071a2c, #041321 60%, #03101b); }
.left-rail { min-height: 100%; padding: 8px; border-right: 1px solid #17425f; }
.right-rail { padding: 8px; border-left: 1px solid #17425f; }
.center-column { min-width: 0; padding: 8px; background: linear-gradient(180deg, #061928 0, #04121f 68%, #061625 100%); }

.rail-card, .result-card, .viewport-card, .failure-playback-card, .reference-panel {
    border: 1px solid #184a6c;
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(8, 34, 56, .98), rgba(5, 24, 41, .98));
    box-shadow: inset 0 1px 0 rgba(170, 218, 244, .035), 0 5px 14px rgba(0, 0, 0, .13);
}
.rail-card { overflow: hidden; margin-bottom: 7px; }
.rail-heading { width: 100%; min-height: 21px; display: flex; justify-content: space-between; align-items: center; padding: 3px 7px; border: 0; border-bottom: 1px solid #17425f; background: linear-gradient(180deg, #0d3553, #09273f); color: #e2f1fa; font-size: 9px; font-weight: 850; text-align: left; }
.rail-heading b { color: #83b4d3; font-size: 10px; transition: transform .2s ease; }
.rail-card.collapsed .rail-heading { border-bottom: 0; }
.rail-card.collapsed .rail-heading b { transform: rotate(180deg); }
.rail-card.collapsed .rail-body { display: none; }
.rail-body { padding: 4px 6px; }
.field-row { min-height: 14px; display: grid; grid-template-columns: minmax(92px, 44%) minmax(0, 1fr); align-items: center; gap: 5px; color: #c9dce9; font-size: 7.4px; }
.field-row > span:first-child { line-height: 1.15; }
.field-row select, .field-row input { width: 100%; height: 16px; min-width: 0; border: 1px solid #275578; border-radius: 3px; padding: 1px 5px; background: linear-gradient(#08243c, #061b2e); color: #dcecf6; font-size: 7.2px; outline: none; }
.field-row select:focus, .field-row input:focus { border-color: #59bdf4; box-shadow: 0 0 0 2px rgba(77, 186, 246, .12); }
.field-row select option { background: #061829; }
.unit-input { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 35px; align-items: center; border: 1px solid #275578; border-radius: 3px; overflow: hidden; background: #061b2e; }
.unit-input input { border: 0; border-radius: 0; background: transparent; }
.unit-input em { height: 16px; display: grid; place-items: center; border-left: 1px solid rgba(80, 137, 176, .32); color: #8fb2c9; font-size: 7px; font-style: normal; }
.file-row { grid-template-columns: minmax(92px, 44%) minmax(0, 1fr); }
.upload-button { min-height: 16px; display: grid; place-items: center; padding: 3px 5px; border: 1px solid #2b678d; border-radius: 3px; background: linear-gradient(#154667, #0b2d49); color: #d9edf9; font-size: 7.5px; text-align: center; }
.upload-button:hover { border-color: #62c1f1; }
.dual-readout { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 3px; height: 16px; border: 1px solid #275578; border-radius: 3px; background: #061b2e; padding: 0 5px; }
.dual-readout strong { font-size: 7.6px; font-weight: 600; text-align: center; }
.dual-readout i { color: #4f7895; font-style: normal; }
.micro-status { margin-top: 4px; padding: 5px 6px; border: 1px solid rgba(67, 142, 190, .18); border-radius: 3px; background: rgba(23, 74, 108, .24); color: #8fb4ca; font-size: 7px; line-height: 1.35; }
.failure-card { margin-bottom: 0; }
.run-button { width: 100%; min-height: 38px; display: flex; align-items: center; justify-content: space-between; margin-top: 6px; padding: 0 17px; border: 1px solid #3ce371; border-radius: 5px; background: linear-gradient(180deg, #1a9a43, #08702d); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 0 20px rgba(32, 204, 87, .15); color: #fff; font-size: 10px; font-weight: 850; }
.run-button:hover { filter: brightness(1.08); }
.run-button:disabled { opacity: .65; cursor: progress; }
.run-button b { font-size: 17px; }
.progress-track { height: 4px; overflow: hidden; border-radius: 999px; margin: 7px 2px 4px; background: #03111e; }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #38dc6b, #77eca2); transition: width .15s ease; }
#analysis-status { display: block; color: #769eb8; font-size: 7px; text-align: center; }
.scope-rail-card { margin-top: 7px; }
.scope-rail-body { padding: 8px 8px 9px; }
.scope-rail-body > p { margin: 0 0 8px; color: #a9c5d7; font-size: 7.4px; line-height: 1.45; }
.scope-rail-body ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.scope-rail-body li { position: relative; padding-left: 13px; color: #8fb0c5; font-size: 6.9px; line-height: 1.38; }
.scope-rail-body li::before { content: ""; position: absolute; left: 1px; top: 4px; width: 5px; height: 5px; border-radius: 50%; background: #63c8fb; box-shadow: 0 0 0 2px rgba(99,200,251,.12); }
.scope-rail-body li b { display: block; margin-bottom: 1px; color: #d9edf8; font-size: 7.3px; }
.scope-rail-body li span { display: block; }
.scope-warning { margin-top: 9px; padding: 7px 8px; border: 1px solid rgba(255,157,34,.55); border-radius: 4px; background: rgba(134,71,12,.17); }
.scope-warning strong { display: block; color: #ffb95d; font-size: 7px; letter-spacing: .07em; }
.scope-warning span { display: block; margin-top: 3px; color: #cfb48e; font-size: 6.5px; line-height: 1.35; }

.viewport-card { overflow: hidden; position: relative; background: #020b13; }
.hud-row { min-height: 56px; display: grid; grid-template-columns: .8fr .9fr .9fr 1.35fr; gap: 8px; padding: 8px 135px 0 10px; position: absolute; z-index: 5; top: 0; left: 0; right: 0; pointer-events: none; }
.hud-row article { min-width: 0; padding: 7px 10px; border: 1px solid rgba(87, 159, 204, .42); border-radius: 5px; background: linear-gradient(145deg, rgba(18, 65, 98, .92), rgba(7, 34, 56, .91)); box-shadow: 0 5px 16px rgba(0,0,0,.22), inset 0 1px 0 rgba(189, 227, 248, .06); }
.hud-row span { display: block; color: #c2dbea; font-size: 8px; }
.hud-row strong { display: block; margin-top: 2px; color: white; font-size: clamp(17px, 1.35vw, 23px); line-height: 1; letter-spacing: -.03em; white-space: nowrap; }
.hud-row small { display: block; margin-top: 2px; color: #9ec2d9; font-size: 7px; }
.hud-row .mode-hud strong { font-size: clamp(13px, 1.1vw, 18px); }
.canvas-stage { position: relative; height: clamp(390px, 30vw, 430px); min-height: 390px; overflow: hidden; background: #020a12; }
#structural-canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#structural-canvas:active { cursor: grabbing; }
.drop-overlay[hidden] { display: none !important; }
.drop-overlay { position: absolute; inset: 70px 35px 35px; z-index: 12; display: grid; place-content: center; text-align: center; border: 2px dashed #60c8ff; border-radius: 9px; background: rgba(3, 24, 41, .93); color: white; }
.drop-overlay strong { font-size: 20px; }
.drop-overlay span { margin-top: 7px; color: #9fc4d9; }
.depth-scale { position: absolute; z-index: 4; left: 15px; top: 82px; bottom: 18px; width: 55px; display: flex; flex-direction: column; justify-content: space-between; color: #abc7d8; font-size: 7px; pointer-events: none; }
.depth-scale::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; border-left: 1px solid #60b6e5; opacity: .7; }
.depth-scale span { padding-left: 8px; position: relative; }
.depth-scale span::before { content: ""; position: absolute; left: -2px; top: 50%; width: 6px; border-top: 1px solid #60b6e5; }
.depth-scale i { position: absolute; left: -3px; top: 75%; width: 8px; height: 8px; border-radius: 50%; background: white; box-shadow: 0 0 0 3px rgba(86, 180, 233, .25); transform: translateY(-50%); transition: top .35s ease; }
.stress-legend { position: absolute; z-index: 5; top: 18px; right: 18px; width: 83px; height: 220px; padding: 8px; border: 1px solid rgba(90, 164, 209, .5); border-radius: 5px; background: rgba(4, 22, 37, .86); box-shadow: 0 6px 22px rgba(0,0,0,.24); pointer-events: none; }
.stress-legend b { display: block; margin-bottom: 8px; color: #dcecf6; font-size: 7px; text-align: center; }
.legend-bar { position: absolute; left: 15px; top: 34px; bottom: 16px; width: 17px; border: 1px solid rgba(255,255,255,.22); background: linear-gradient(180deg, #c50000, #ff5900 15%, #ffd91c 36%, #56d96b 55%, #00d7e9 70%, #075af6 85%, #1016bb); }
.stress-legend ol { list-style: none; margin: 0; padding: 25px 0 0 40px; height: 175px; display: flex; flex-direction: column; justify-content: space-between; color: #d5e7f2; font-size: 7px; }
.axis-widget { position: absolute; z-index: 5; left: 22px; bottom: 35px; width: 62px; height: 55px; pointer-events: none; }
.axis-widget span { position: absolute; left: 21px; top: 21px; width: 11px; height: 11px; border-radius: 50%; background: #9fb3c0; }
.axis-widget::before, .axis-widget::after { content: ""; position: absolute; left: 26px; top: 26px; width: 25px; height: 2px; transform-origin: left center; background: #ff3d35; }
.axis-widget::before { transform: rotate(-23deg); }
.axis-widget::after { background: #39ed62; transform: rotate(158deg); }
.axis-widget i { position: absolute; font-style: normal; font-size: 9px; font-weight: 800; }
.axis-widget .x { right: 0; bottom: 6px; color: #ff4c43; }
.axis-widget .y { left: 0; bottom: 15px; color: #4ef27a; }
.axis-widget .z { left: 26px; top: 0; color: #4e83ff; }
.deformation-badge { position: absolute; z-index: 5; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 5px 9px; border: 1px solid rgba(95, 161, 200, .38); border-radius: 4px; background: rgba(3, 19, 32, .82); color: #c6ddea; font-size: 7px; pointer-events: none; }
.viewport-tools { position: absolute; z-index: 5; right: 14px; bottom: 13px; display: flex; gap: 5px; }
.viewport-tools button { width: 29px; height: 27px; border: 1px solid #245477; border-radius: 4px; background: rgba(4, 25, 43, .86); color: white; }
.viewport-tools button:hover { background: #0d3a5d; }
.analysis-tabs { min-height: 34px; display: flex; align-items: stretch; gap: 0; border-top: 1px solid #17425f; background: linear-gradient(#08243a, #061a2c); }
.analysis-tabs button { min-width: 74px; padding: 0 13px; border: 0; border-right: 1px solid #173d58; background: transparent; color: #b9d0de; font-size: 8px; }
.analysis-tabs button:hover, .analysis-tabs button.active { color: white; background: linear-gradient(#164768, #0b2e4a); box-shadow: inset 0 -2px 0 #69c7ff; }
.analysis-tabs label { margin-left: auto; display: flex; align-items: center; gap: 7px; padding: 0 8px; color: #a4c1d3; font-size: 7px; }
.analysis-tabs select { height: 16px; border: 1px solid #275578; border-radius: 3px; background: #061b2e; color: #d8eaf5; font-size: 8px; }

.failure-playback-card { margin-top: 7px; display: grid; grid-template-columns: 1fr 20px 1fr 20px 1fr 20px 1fr; gap: 0; overflow: hidden; position: relative; padding-bottom: 31px; background: #041320; }
.failure-frame { min-width: 0; border-right: 1px solid #16425f; background: #061b2d; }
.failure-frame:last-of-type { border-right: 0; }
.failure-frame header { min-height: 43px; display: grid; align-content: center; padding: 5px 7px; background: linear-gradient(#0a2b46, #071e33); }
.failure-frame header b { font-size: 8px; }
.failure-frame header span, .failure-frame header small { color: #abc4d4; font-size: 6.5px; }
.failure-frame canvas { width: 100%; height: 104px; display: block; background: #020b13; }
.stage-arrow { display: grid; place-items: center; color: #b3d0e1; font-size: 12px; background: #061727; }
.playback-controls { position: absolute; left: 0; right: 0; bottom: 0; min-height: 31px; display: grid; grid-template-columns: 28px minmax(0, 1fr) 74px; align-items: center; gap: 7px; padding: 3px 8px; border-top: 1px solid #16425f; background: #061828; }
.playback-controls button { width: 25px; height: 25px; border: 0; background: transparent; color: #dceaf3; }
.playback-controls input { width: 100%; accent-color: #66bff3; }
.playback-controls span { color: #acc4d4; font-size: 7px; text-align: right; }

.bottom-grid { margin-top: 7px; display: block; }
.reference-panel { min-width: 0; min-height: 0; overflow: hidden; color: var(--ink); background: linear-gradient(#f8fbfd, #e6eff5); border-color: #9bb2c1; }
.reference-panel > header { min-height: 29px; display: flex; align-items: center; padding: 6px 9px; border-bottom: 1px solid #a8bdca; background: linear-gradient(#f8fbfd, #dce9f1); color: #0a2b46; font-size: 8px; font-weight: 850; }
.equation-grid { display: grid; grid-template-columns: 1fr 1fr; }
.equation-grid section { min-height: 75px; padding: 8px 10px; border-right: 1px solid #bdccd5; border-bottom: 1px solid #bdccd5; }
.equation-grid section:nth-child(2n) { border-right: 0; }
.equation-grid b { font-size: 7px; }
.formula { margin: 8px 0 5px; font-family: Georgia, "Times New Roman", serif; font-size: 14px; text-align: center; color: #0d2c44; }
.equation-grid p { margin: 0; color: #526b7c; font-size: 6.7px; line-height: 1.35; }
.equations-panel footer { padding: 7px 10px; color: #435e70; font-size: 6.5px; line-height: 1.35; }
.methodology-section {
    padding: 34px max(24px, 4vw) 38px;
    border-top: 1px solid #1a4a69;
    background: linear-gradient(180deg, #071b2c 0, #051522 100%);
}
.methodology-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 18px; }
.methodology-heading > div:first-child { max-width: 900px; }
.methodology-heading span { color: #63c8fb; font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.methodology-heading h2 { margin: 6px 0 7px; color: #f2f8fc; font-size: clamp(20px, 2vw, 30px); line-height: 1.1; letter-spacing: -.025em; }
.methodology-heading p { max-width: 820px; margin: 0; color: #9fbccd; font-size: 11px; line-height: 1.55; }
.methodology-status { min-width: 150px; display: grid; justify-items: end; gap: 3px; padding-bottom: 2px; }
.methodology-status b { color: #f0f8fd; font-size: 12px; }
.methodology-status span { color: #85a8bc; font-size: 8px; letter-spacing: .04em; }
.methodology-layout { display: block; }
.methodology-note-card, .methodology-pdf-card { overflow: hidden; border: 1px solid #245878; border-radius: 7px; box-shadow: 0 14px 30px rgba(0,0,0,.2); }
.methodology-note-card { color: #17364d; background: linear-gradient(#f9fcfe, #e7f0f5); }
.methodology-note-card > header, .methodology-pdf-card > header { min-height: 38px; display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; font-size: 9px; font-weight: 850; letter-spacing: .03em; }
.methodology-note-card > header { border-bottom: 1px solid #b2c5d1; color: #0a3555; background: linear-gradient(#f9fcfe, #dce9f1); }
.methodology-note-body { padding: 17px 18px 18px; }
.methodology-note-body > p { margin: 0 0 14px; color: #365a70; font-size: 10px; line-height: 1.6; }
.methodology-note-body ol { margin: 0; padding-left: 20px; color: #294b61; font-size: 9px; line-height: 1.55; }
.methodology-note-body li { margin-bottom: 10px; padding-left: 3px; }
.methodology-warning { margin-top: 14px; padding: 12px; border: 1px solid #d39a57; border-radius: 5px; background: #fff6e9; }
.methodology-warning strong { display: block; color: #a95505; font-size: 9px; letter-spacing: .06em; }
.methodology-warning span { display: block; margin-top: 5px; color: #755431; font-size: 8px; line-height: 1.45; letter-spacing: 0; }
.methodology-pdf-card { min-width: 0; background: #071827; }
.methodology-pdf-card > header { border-bottom: 1px solid #285b7d; color: #e7f4fb; background: linear-gradient(#0d3959, #082942); }
.methodology-pdf-card > header small { color: #8fb3c8; font-size: 8px; font-weight: 500; }
.methodology-viewer { background: #0a1e2e; }
.methodology-viewer-toolbar { min-height: 44px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 10px; border-bottom: 1px solid #2b5b79; background: linear-gradient(#0c2e48, #08233a); }
.viewer-page-controls, .viewer-zoom-controls { display: flex; align-items: center; gap: 6px; }
.methodology-viewer-toolbar button, .methodology-viewer-toolbar a, .methodology-viewer-toolbar select { min-height: 28px; border: 1px solid #32698d; border-radius: 4px; background: linear-gradient(#124466, #0a2d49); color: #e7f4fb; font-size: 9px; text-decoration: none; }
.methodology-viewer-toolbar button { min-width: 30px; padding: 0 9px; }
.methodology-viewer-toolbar a { display: inline-flex; align-items: center; padding: 0 11px; font-weight: 750; }
.methodology-viewer-toolbar label, .methodology-viewer-toolbar span { color: #b8d1df; font-size: 9px; }
.methodology-viewer-toolbar select { min-width: 48px; padding: 0 5px; }
.methodology-page-stage { height: min(74vh, 790px); overflow: auto; display: grid; place-items: start center; padding: 18px; background: #cbd3d9; scrollbar-color: #5b7890 #aebbc4; }
.methodology-page-stage img { width: min(100%, 980px); height: auto; display: block; background: white; box-shadow: 0 12px 34px rgba(0,0,0,.28); transform-origin: top center; transition: width .18s ease; }


.result-card { overflow: hidden; margin-bottom: 7px; }
.result-card > header, .cycle-panel > header, .notes-panel > header { min-height: 29px; display: flex; justify-content: space-between; align-items: center; padding: 6px 9px; border-bottom: 1px solid #17425f; background: linear-gradient(#0c3554, #082640); color: #e7f4fb; font-size: 8px; font-weight: 850; }
.collapse-grid { display: grid; grid-template-columns: 1.45fr .7fr .58fr; }
.collapse-grid > div { min-height: 53px; padding: 9px 10px; border-right: 1px solid #17425f; border-bottom: 1px solid #17425f; }
.collapse-grid > div:nth-child(3) { border-right: 0; }
.collapse-grid > div:nth-child(4) { grid-column: 1 / 2; border-bottom: 0; }
.collapse-grid > div:nth-child(5) { grid-column: 2 / 4; border-right: 0; border-bottom: 0; }
.collapse-grid span { display: block; color: #a7c1d1; font-size: 7px; }
.collapse-grid strong { display: block; margin-top: 5px; font-size: 14px; color: #f4fbff; }
.collapse-grid .primary-metric strong { color: #ff5746; font-size: 27px; letter-spacing: -.04em; }
.collapse-grid strong.safe { color: #39e568; font-size: 20px; }
.warning-banner { margin: 7px; padding: 8px; border: 1px solid #d15127; border-radius: 4px; background: rgba(145, 44, 15, .25); color: #ffad37; font-size: 8px; font-weight: 800; text-align: center; }
.warning-banner.safe-state { border-color: #21964d; background: rgba(24, 116, 58, .18); color: #54ec80; }
.failure-summary-card dl { margin: 0; padding: 7px 10px; }
.failure-summary-card dl div { min-height: 19px; display: grid; grid-template-columns: 42% 58%; align-items: center; gap: 4px; }
.failure-summary-card dt { color: #9db8c9; font-size: 7px; }
.failure-summary-card dd { margin: 0; color: #edf7fc; font-size: 7.3px; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.chart-grid figure { min-width: 0; margin: 0; padding: 7px 4px 3px; border-right: 1px solid #17425f; }
.chart-grid figure:last-child { border-right: 0; }
.chart-grid figcaption { color: #d3e3ed; font-size: 7px; text-align: center; }
.chart-grid svg { width: 100%; height: 145px; display: block; overflow: visible; }
.mini-grid-card { display: grid; grid-template-columns: 1.55fr .75fr; }
.cycle-panel { min-width: 0; border-right: 1px solid #17425f; }
.cycle-panel header small { margin-left: 4px; color: #9db9ca; font-size: 6px; font-weight: 500; }
.cycle-panel table { width: 100%; border-collapse: collapse; font-size: 6.5px; }
.cycle-panel th, .cycle-panel td { padding: 6px 5px; border-right: 1px solid #143b56; border-bottom: 1px solid #143b56; text-align: center; }
.cycle-panel th { color: #a9c3d3; font-weight: 700; }
.cycle-panel td { color: #e4f1f8; }
.notes-panel { min-width: 0; }
.notes-panel p { margin: 8px; color: #9eb9c9; font-size: 6.7px; line-height: 1.45; }
.notes-panel button { width: calc(100% - 14px); min-height: 28px; margin: 0 7px 7px; border: 1px solid #2d6a91; border-radius: 4px; background: linear-gradient(#174b6e, #0c3150); color: #dceaf3; font-size: 7px; }
.limit-bars { padding: 8px 10px 4px; }
.limit-bars label { min-height: 24px; display: grid; grid-template-columns: 85px minmax(0,1fr) 52px; align-items: center; gap: 7px; color: #b8cedb; font-size: 7px; }
.limit-bars b { height: 7px; overflow: hidden; border-radius: 999px; background: #03111d; }
.limit-bars i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #1d6fa4, #62c4f5, #ffbd30, #ff503e); }
.limit-bars em { color: #e7f4fb; font-style: normal; text-align: right; }

.community-section { padding: 36px max(24px, 5vw) 48px; border-top: 1px solid #153d59; background: linear-gradient(180deg, #061827, #020b13); }
.community-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.community-heading > div:first-child span { color: #5fc3f7; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.community-heading h2 { margin: 6px 0 0; font-size: 21px; }
.community-heading > div:last-child { display: grid; text-align: center; }
.community-heading strong { font-size: 24px; }
.community-heading > div:last-child span { color: #8facbf; font-size: 8px; }
.community-grid { display: grid; grid-template-columns: minmax(420px, .9fr) minmax(380px, 1.1fr); gap: 18px; }
.comment-form, .comment-list { border: 1px solid #1d4d6d; border-radius: 7px; background: rgba(7, 28, 46, .86); }
.comment-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
.comment-form label { display: grid; gap: 4px; color: #a9c5d6; font-size: 8px; }
.comment-form .wide { grid-column: 1 / -1; }
.comment-form input, .comment-form select, .comment-form textarea { width: 100%; border: 1px solid #2a5b7c; border-radius: 4px; padding: 7px; background: #041727; color: #e6f3fa; }
.comment-form textarea { resize: vertical; }
.comment-form button { min-height: 34px; border: 1px solid #2c8abf; border-radius: 4px; background: linear-gradient(#176391, #0a4165); color: white; font-weight: 700; }
.comment-form #comment-message { align-self: center; color: #93b5c9; font-size: 8px; }
.honeypot { position: absolute !important; left: -9999px !important; }
.comment-list { min-height: 240px; max-height: 480px; overflow: auto; padding: 10px; }
.empty-comments { height: 100%; min-height: 220px; display: grid; place-items: center; color: #7f9fb3; }
.comment-item { padding: 12px; border-bottom: 1px solid #17425f; }
.comment-item:last-child { border-bottom: 0; }
.comment-meta { display: flex; flex-wrap: wrap; gap: 8px; color: #86a8bd; font-size: 7px; }
.comment-meta strong { color: #e8f4fb; }
.comment-type { padding: 1px 5px; border-radius: 99px; background: #144261; color: #bde5fa; }
.comment-item p { margin: 8px 0 0; color: #c6dce8; line-height: 1.55; }
.comment-reference { margin-top: 7px; color: #78bce5; font-size: 7px; }

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(0, 6, 12, .78); backdrop-filter: blur(7px); }
.modal[hidden] { display: none; }
.modal-card { width: min(560px, 100%); position: relative; padding: 25px; border: 1px solid #39779f; border-radius: 9px; background: linear-gradient(145deg, #0c3452, #061a2b); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.modal-card h2 { margin: 0 0 14px; }
.modal-card p { color: #bbd2e0; line-height: 1.6; }
.modal-close { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border: 0; background: transparent; color: white; font-size: 22px; }
.report-progress-card { width: min(520px, calc(100vw - 30px)); padding: 28px 30px 25px; overflow: hidden; border-color: #4f94bc; background: linear-gradient(145deg, #0d3a5b, #061b2d 72%); }
.report-progress-card::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(139, 201, 235, .22); border-radius: 6px; pointer-events: none; }
.report-progress-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.report-progress-brand img { filter: drop-shadow(0 0 10px rgba(83, 183, 238, .35)); }
.report-progress-brand span { display: grid; gap: 2px; }
.report-progress-brand b { font-size: 12px; font-weight: 600; letter-spacing: .15em; }
.report-progress-brand small { color: #91b8cf; font-size: 7px; letter-spacing: .16em; }
.report-progress-card h2 { position: relative; margin: 0 0 8px; color: #f3f9fd; font-size: 20px; }
.report-progress-card p { position: relative; min-height: 22px; margin: 0 0 16px; color: #b9d3e2; font-size: 10px; }
.report-progress-track { position: relative; height: 11px; overflow: hidden; border: 1px solid #285d7f; border-radius: 999px; background: #03111e; box-shadow: inset 0 2px 5px rgba(0,0,0,.45); }
.report-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1f87c1, #64c9f7 58%, #43dc76); box-shadow: 0 0 14px rgba(82, 199, 246, .42); transition: width .28s ease; }
.report-progress-meta { position: relative; display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.report-progress-meta span { color: #e7f5fc; font-size: 10px; font-weight: 800; }
.report-progress-meta small { color: #7198b0; font-size: 8px; }
.report-progress-actions { position: relative; display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(112,175,211,.22); }
.report-progress-actions[hidden] { display: none !important; }
.report-download-button, .report-close-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 17px; border-radius: 4px; font-size: 10px; font-weight: 800; text-decoration: none; }
.report-download-button { border: 1px solid #53e285; background: linear-gradient(#1aa653,#087534); color: white; box-shadow: 0 0 18px rgba(45,214,103,.18); }
.report-close-button { border: 1px solid #376b8c; background: #0a2b45; color: #cce1ed; }
.report-download-button:hover, .report-close-button:hover { filter: brightness(1.08); }

@media (max-width: 1450px) {
    .dashboard { grid-template-columns: 250px minmax(0, 1fr); }
    .body-column { grid-template-columns: minmax(550px, 1fr) 350px; }
    .utility-nav a span:not(:first-child), .profile-link span { display: none; }
    .hud-row { padding-right: 108px; }
    .stress-legend { width: 72px; }
}

@media (max-width: 1180px) {
    .topbar { grid-template-columns: 190px minmax(0,1fr) auto; gap: 10px; padding-left: 16px; padding-right: 12px; }
    .utility-nav { display: flex; }
    .utility-nav > a { display: none; }
    .utility-nav button { padding: 0 8px; }
    .utility-nav button span { font-size: 16px; }
    .dashboard { grid-template-columns: 245px minmax(0, 1fr); align-items: start; }
    .body-column { display: block; min-width: 0; }
    .left-rail { align-self: start; }
    .right-rail { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; border-left: 0; border-top: 1px solid #17425f; padding: 8px; }
    .right-rail .result-card { margin-bottom: 0; }
}

@media (max-width: 820px) {
    .topbar { grid-template-columns: 1fr auto; min-height: auto; padding: 8px 14px; }
    .brand { display: none; }
    .utility-nav { grid-column: 2; grid-row: 1; }
    .utility-nav #open-help { display: none; }
    .title-block h1 { font-size: 17px; }
    .dashboard, .body-column { display: block; }
    .left-rail, .center-column, .right-rail { padding: 7px; border: 0; }
    .left-rail { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
    .rail-card { margin-bottom: 0; }
    .failure-card { grid-column: 1 / -1; }
    .hud-row { position: static; padding: 7px; grid-template-columns: 1fr 1fr; background: #05192a; }
    .canvas-stage { height: 440px; }
    .failure-playback-card { grid-template-columns: 1fr 1fr; gap: 1px; padding-bottom: 34px; }
    .stage-arrow { display: none; }
    .failure-frame { border-right: 0; }
    .bottom-grid, .right-rail, .community-grid, .methodology-layout { display: block; }
    .reference-panel, .result-card { margin-bottom: 7px; }
    .methodology-section, .community-section { padding: 24px 12px; }
    .methodology-heading { display: block; }
    .methodology-status { margin-top: 12px; justify-items: start; }
    .methodology-note-card { margin-bottom: 10px; }
    .methodology-page-stage { height: 620px; padding: 10px; }
    .community-grid > * { margin-bottom: 10px; }
}

@media (max-width: 540px) {
    .topbar { grid-template-columns: 1fr; }
    .utility-nav { grid-column: 1; grid-row: auto; justify-content: start; }
    .left-rail { display: block; }
    .rail-card { margin-bottom: 7px; }
    .hud-row { grid-template-columns: 1fr; }
    .canvas-stage { height: 380px; min-height: 380px; }
    .stress-legend { transform: scale(.82); transform-origin: top right; }
    .analysis-tabs { overflow-x: auto; }
    .analysis-tabs label { display: none; }
    .failure-playback-card { grid-template-columns: 1fr; }
    .failure-frame canvas { height: 125px; }
    .collapse-grid { grid-template-columns: 1fr 1fr; }
    .collapse-grid .primary-metric { grid-column: 1 / -1; }
    .collapse-grid > div:nth-child(3), .collapse-grid > div:nth-child(5) { border-right: 0; }
    .collapse-grid > div:nth-child(4), .collapse-grid > div:nth-child(5) { grid-column: auto; }
    .chart-grid, .mini-grid-card, .equation-grid, .comment-form { grid-template-columns: 1fr; }
    .comment-form .wide { grid-column: auto; }
    .chart-grid figure, .cycle-panel { border-right: 0; border-bottom: 1px solid #17425f; }
    .community-heading { align-items: start; }
    .methodology-viewer-toolbar { align-items: stretch; flex-direction: column; }
    .methodology-page-stage { height: 500px; padding: 7px; }
}
