@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;650;700;750;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg-base: #f3f5f8;
  --bg-surface: #f7f9fc;
  --bg-card: #fff;
  --bg-raised: #fff;
  --border: #e2e7ee;
  --border-bright: #bac7d7;
  --accent: #c65012;
  --accent-hot: #e97532;
  --accent-soft: #fff2e9;
  --accent-cool: #285d8c;
  --accent-green: #15745c;
  --text-primary: #172c45;
  --text-secondary: #52657c;
  --text-muted: #66768a;
  --shadow-card: 0 3px 14px #17304b05, 0 1px 3px #17304b03;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-padding-top: 20px; }
body { margin: 0; background: var(--bg-base); color: var(--text-primary); font-family: 'Inter', system-ui, sans-serif; font-size: 14px; line-height: 1.6; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button, a { touch-action: manipulation; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, .radio-card:focus-within { outline: 3px solid #eea579; outline-offset: 3px; }
[hidden], .hidden { display: none !important; }
.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; }
.icon { width: 19px; height: 19px; flex: 0 0 auto; vertical-align: middle; pointer-events: none; }
.workspace-bar { background: #14273e; color: #ecf1f8; border-bottom: 1px solid #253950; }
.workspace-bar-inner { max-width: 1440px; margin: auto; min-height: 82px; padding: 14px 32px; display: flex; align-items: center; justify-content: space-between; gap: 26px; }
.brand-link { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; background: #f28a48; color: #14273e; border-radius: 12px; }
.brand-mark .icon { width: 25px; height: 25px; }
.brand-name { display: block; font-size: 17px; font-weight: 800; letter-spacing: 1.6px; line-height: 1.4; }
.brand-caption { display: block; font-size: 10px; color: #acbbcc; letter-spacing: 1.6px; }
.page-nav { display: flex; gap: 5px; background: #0c1d306b; border: 1px solid #314258; padding: 5px; border-radius: 11px; }
.page-nav a { display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 7px; color: #bfccdc; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.page-nav a:hover { background: #273e58; color: #fff; }
.page-nav a[aria-current='page'] { background: #fff; color: #20364f; box-shadow: 0 2px 5px #0002; }
.workspace-units { display: flex; align-items: center; gap: 8px; color: #b4c4d7; font-size: 11px; white-space: nowrap; }
.workspace-units .icon { width: 16px; height: 16px; color: #f2a26d; }
.main-container { max-width: 1440px; margin: 0 auto; padding: 32px 32px 44px; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-bottom: 28px; min-height: 150px; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 750; letter-spacing: 1.7px; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.eyebrow::before { content: ''; display: block; width: 22px; height: 2px; background: currentColor; }
.app-title { font-size: clamp(26px, 3vw, 38px); font-weight: 750; line-height: 1.22; letter-spacing: -1.3px; }
.app-title span { color: var(--accent); }
.app-subtitle { color: var(--text-secondary); font-size: 13px; margin-top: 12px; max-width: 650px; line-height: 1.8; }
.header-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 500; color: var(--text-secondary); }
.pill + .pill { border-left: 1px solid #cfd8e3; padding-left: 12px; margin-left: 4px; }
.pill .icon { width: 15px; height: 15px; color: var(--accent); }
.hero-art { flex: 0 0 225px; width: 225px; color: #8697aa; }
.hero-art svg { width: 100%; display: block; }
.main-grid { display: grid; grid-template-columns: 390px minmax(0,1fr); gap: 24px; align-items: start; margin-bottom: 24px; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-card); min-width: 0; }
.panel-card, .manual-card { padding: 24px; }
.card-header { display: flex; align-items: center; gap: 11px; margin-bottom: 23px; }
.card-icon { display: grid; place-items: center; width: 36px; height: 36px; background: var(--accent-soft); border: 1px solid #f5dfd0; border-radius: 10px; color: var(--accent); flex-shrink: 0; }
.card-title { font-size: 15px; font-weight: 700; letter-spacing: -.3px; }
.card-kicker { font-size: 10px; line-height: 1.5; color: var(--text-muted); }
.section-tag { margin-left: auto; font-size: 9px; letter-spacing: .9px; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.field-group { margin-bottom: 24px; }
.field-label { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--text-primary); }
.field-label .icon { width: 15px; height: 15px; color: var(--text-muted); }
.input-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.input-grid > *, .manual-target-fields > * { min-width: 0; }
.input-sub-label, .dimension-label { display: block; font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; }
.input-field { width: 100%; min-width: 0; min-height: 43px; border: 1px solid #dce3ec; border-radius: 8px; padding: 10px 11px; background: #f8fafc; color: var(--text-primary); font-size: 13px; font-weight: 500; transition: border-color .16s, box-shadow .16s; }
.input-field:hover { border-color: #bbc8d7; }
.input-field:focus { background: #fff; border-color: #dd824f; box-shadow: 0 0 0 3px #df814d12; }
.input-field:disabled, .input-field[readonly] { background: #edf1f5; color: #63758c; }
select.input-field { padding-right: 24px; }
.preset-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.preset-btn { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 38px; padding: 8px 4px; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--text-secondary); font-size: 11px; font-weight: 600; }
.preset-btn .icon { width: 14px; height: 14px; }
.preset-btn:hover { border-color: #e2a17a; }
.preset-btn.active { border-color: #e9a47e; color: #ad480f; background: var(--accent-soft); }
.volume-display { display: grid; width: 100%; grid-template-columns: 1fr auto; text-align: left; margin-top: 12px; padding: 17px; border: 1px solid #e6eaf0; border-radius: 10px; background: #f7f9fc; }
.volume-number { display: block; font-family: var(--mono); font-size: 27px; font-weight: 500; letter-spacing: -1.4px; color: #223f5c; grid-column: 1; line-height: 1.4; }
.volume-label { grid-column: 1; font-size: 10px; color: var(--text-secondary); margin-top: 3px; }
.volume-expand { grid-column: 2; grid-row: 1 / 3; display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--accent); }
#containerInputs { margin-top: 12px; }
.pattern-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.radio-card { position: relative; border: 1px solid var(--border); border-radius: 9px; padding: 13px 11px; cursor: pointer; background: #fff; }
.radio-card:hover { border-color: #d5a184; }
.radio-card.selected, .radio-card:has(input:checked) { background: var(--accent-soft); border-color: #e6a17b; }
.radio-content { display: grid; grid-template-columns: 23px 1fr; column-gap: 8px; align-items: center; }
.pattern-icon { grid-row: 1 / 3; color: #798aa0; display: flex; }
.selected .pattern-icon, .radio-card:has(input:checked) .pattern-icon { color: var(--accent); }
.pattern-icon .icon { width: 21px; height: 21px; }
.pattern-name { font-size: 12px; font-weight: 650; }
.pattern-desc { font-size: 9px; color: var(--text-secondary); margin-top: 2px; }
.toggle-row { display: flex; align-items: center; gap: 15px; justify-content: space-between; padding: 13px; background: #f7f9fb; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; }
.toggle-title { display: block; font-size: 11px; font-weight: 600; }
.toggle-sub { display: block; font-size: 10px; color: var(--text-secondary); margin-top: 3px; }
.toggle-switch { position: relative; display: inline-flex; width: 36px; height: 21px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.toggle-track { width: 36px; height: 21px; border-radius: 20px; background: #c4ceda; padding: 3px; pointer-events: none; }
.toggle-thumb { display: block; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0002; transition: transform .18s; }
.toggle-switch input:checked + .toggle-track { background: var(--accent); }
.toggle-switch input:checked + .toggle-track .toggle-thumb { transform: translateX(15px); }
.toggle-switch:focus-within .toggle-track { outline: 3px solid #eea579; outline-offset: 3px; }
.cta-btn, .viz-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; min-height: 40px; padding: 10px 14px; font-size: 11px; font-weight: 600; line-height: 1.5; transition: background .16s, border-color .16s; }
.cta-btn { width: 100%; min-height: 46px; background: var(--accent); color: #fff; box-shadow: 0 3px 7px #c650121a; font-size: 12px; }
.cta-btn:hover:not(:disabled) { background: #a8420e; }
.viz-btn { background: #fff; color: var(--text-secondary); border-color: #dce3ec; }
.viz-btn:hover:not(:disabled) { background: #f4f7fa; border-color: #b4c2d3; color: var(--text-primary); }
.viz-btn.primary { background: #edf2f8; border-color: #dbe5f0; color: #244b72; }
.viz-btn.primary:hover:not(:disabled) { background: #e2ebf5; }
.viz-btn .icon { width: 16px; height: 16px; }
.viz-btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.results-empty, .viz-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; background: radial-gradient(ellipse at center,#eaf0f78c,transparent 70%); }
.results-empty { min-height: 440px; padding: 30px; border: 1px dashed #dce4ee; border-radius: 12px; }
.empty-icon, .viz-icon { width: 80px; height: 80px; border: 1px solid #dbe4ee; border-radius: 23px; background: #fff; box-shadow: 0 8px 25px #1c3b5810; display: grid; place-items: center; color: #557494; margin-bottom: 10px; }
.empty-icon .icon, .viz-icon .icon { width: 38px; height: 38px; stroke-width: 1.2; }
.results-empty h3, .viz-empty h3 { font-size: 16px; font-weight: 650; }
.results-empty p, .viz-empty p { max-width: 340px; font-size: 12px; color: var(--text-secondary); line-height: 1.8; }
.empty-step { color: var(--accent); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; margin-top: 10px; }
.results-summary { background: #f4f8fb; border: 1px solid #dce6ef; border-radius: 12px; padding: 19px; margin-bottom: 16px; }
.result-heading { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 650; margin-bottom: 18px; }
.result-heading .icon { color: var(--accent-green); }
.result-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.stat-block { min-width: 0; }
.stat-value { display: block; font-family: var(--mono); font-size: 23px; color: #1f4465; font-weight: 500; letter-spacing: -1px; line-height: 1.4; overflow-wrap: anywhere; }
.stat-label { display: block; font-size: 10px; color: var(--text-secondary); margin-top: 5px; }
.efficiency-bar { margin-top: 20px; height: 5px; background: #dce5ee; border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; background: #278a76; border-radius: inherit; }
.metrics-section { margin: 22px 0; }
.subsection-title { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 650; margin-bottom: 13px; }
.subsection-title .icon { width: 16px; height: 16px; color: var(--text-muted); }
.metrics-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.metric-card { padding: 12px 14px; background: #fafbfd; border: 1px solid #e7ecf2; border-radius: 8px; }
.metric-card .stat-value { font-size: 16px; letter-spacing: -.5px; }
.scenario-list { display: grid; gap: 8px; }
.scenario-card { border: 1px solid var(--border); border-radius: 9px; padding: 13px; }
.scenario-card.is-optimal { border-color: #acd5c8; background: #f3faf7; }
.scenario-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; font-size: 11px; font-weight: 600; }
.scenario-card .stat-value { font-size: 16px; }
.scenario-card .stat-label { font-size: 9px; }
.result-badge { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #c1dfd5; background: #e5f3ed; color: #176d53; padding: 3px 7px; border-radius: 5px; font-size: 9px; white-space: nowrap; }
.result-badge .icon { width: 12px; height: 12px; }
#editManualBtn { width: 100%; margin-bottom: 18px; }
.viz-panel { margin-top: 24px; }
.viz-empty { min-height: 310px; background-color: #f8fafc; border: 1px dashed #dce4ef; border-radius: 12px; }
.viz-empty .viz-icon { box-shadow: none; }
.control-panel { background: #f8fafc; border: 1px solid #e4eaf1; border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.control-panel h4 { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 650; margin-bottom: 10px; }
.control-panel h4 .icon { width: 16px; height: 16px; color: #6b819a; }
.control-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.control-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.layer-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; max-height: 140px; overflow-y: auto; }
.layer-tab { background: #fff; border: 1px solid #dce4ee; padding: 6px 12px; border-radius: 6px; color: var(--text-secondary); font-size: 10px; font-weight: 600; }
.layer-tab.active { background: #264862; color: #fff; border-color: #264862; }
.opacity-50 { opacity: .5; }
.control-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.control-label { font-size: 11px; color: var(--text-secondary); }
.control-slider { flex: 1; min-width: 0; height: 4px; accent-color: var(--accent); cursor: pointer; }
.control-value { font-family: var(--mono); font-size: 11px; color: #28516e; white-space: nowrap; }
.check-label { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-secondary); cursor: pointer; }
input[type='checkbox'], input[type='radio'] { accent-color: var(--accent); }
.check-label input { width: 15px; height: 15px; margin: 0; }
.tip-box { display: flex; align-items: center; gap: 7px; font-size: 10px; line-height: 1.7; color: var(--text-secondary); }
.tip-box .icon { width: 15px; height: 15px; color: #617e99; }
#threejs-container, #manualScene { overflow: hidden; border: 1px solid #e0e7ee; border-radius: 12px; background: #f8fafc; }
#threejs-container canvas, #manualScene canvas { display: block; width: 100%; }
.workspace-footer { margin-top: 28px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 10px; color: var(--text-muted); }
.workspace-footer span { display: flex; align-items: center; gap: 6px; }
.workspace-footer .icon { width: 14px; height: 14px; }

/* Manual planning workspace */
.manual-grid { display: grid; grid-template-columns: 340px minmax(0,1fr); gap: 24px; align-items: start; }
.manual-sidebar, .manual-content { display: grid; gap: 20px; min-width: 0; }
.manual-sidebar .manual-card { padding: 22px; }
.manual-fields { margin: 14px 0; }
.manual-fields label, .manual-target-fields label, .manual-drag-options label { display: grid; gap: 6px; font-size: 11px; font-weight: 500; color: var(--text-secondary); min-width: 0; }
.manual-note { font-size: 11px; color: var(--text-secondary); line-height: 1.8; margin: 10px 0; }
.manual-full { width: 100%; margin-top: 9px; }
.manual-message { font-size: 11px; color: var(--accent-green); line-height: 1.8; margin-top: 13px; overflow-wrap: anywhere; }
.manual-message:empty { margin: 0; }
.manual-message.is-error { color: #b13d35; }
.manual-history-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); padding: 12px 16px; border-radius: 11px; margin-bottom: 22px; }
.manual-history-bar .viz-btn { min-height: 34px; padding: 6px 10px; font-size: 10px; }
.manual-history-bar .manual-note { flex: 1 1 250px; margin: 0 0 0 6px; font-size: 10px; }
.manual-move-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.manual-target-fields { display: grid; grid-template-columns: 2fr repeat(4,minmax(0,1fr)); gap: 10px; }
.manual-target-fields .input-field { padding: 9px; font-size: 12px; }
.manual-drag-options { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 10px; margin-top: 16px; }
.manual-drag-options .input-field { padding: 9px; font-size: 11px; }
#manualDragStatus { height: 4.8em; overflow: auto; }
#manualScene canvas { touch-action: none; }
#manualScene[data-interaction='move'] canvas { cursor: grab; }
#manualScene.is-dragging canvas { cursor: grabbing; }
.manual-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.manual-stats .card { position: relative; padding: 20px; display: grid; gap: 5px; }
.manual-stats .stat-icon { position: absolute; top: 20px; right: 17px; color: #7b91a9; }
.manual-stats strong { font-family: var(--mono); font-size: 28px; font-weight: 500; color: #21425e; letter-spacing: -1.3px; line-height: 1.5; overflow-wrap: anywhere; }
.manual-stats span { font-size: 10px; color: var(--text-secondary); }
.manual-table-wrap { width: 100%; overflow-x: auto; border: 1px solid #e5eaf0; border-radius: 9px; margin-top: 12px; }
.manual-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.manual-table th, .manual-table td { text-align: left; padding: 12px; border-bottom: 1px solid #e9edf3; vertical-align: middle; }
.manual-table th { background: #f7f9fc; color: #62758d; font-size: 10px; font-weight: 600; white-space: nowrap; }
.manual-table td:first-child { font-weight: 500; overflow-wrap: anywhere; max-width: 180px; }
.manual-table td:last-child { white-space: nowrap; }
.manual-table tbody tr:last-child td, .manual-table tfoot tr:last-child td, .manual-table tfoot tr:last-child th { border-bottom: 0; }
.manual-table tbody tr:hover { background: #f9fbfd; }
.manual-table tfoot { background: #f7f9fc; font-weight: 600; }
.manual-table .viz-btn { min-height: 30px; padding: 5px 8px; margin-right: 4px; font-size: 10px; }
.manual-table .viz-btn .icon { width: 13px; height: 13px; }
.manual-table .is-selected { background: #fff3ea !important; }
.manual-quantity-table th { white-space: normal; }
.manual-quantity-table td:nth-child(n+3), .manual-quantity-table th:nth-child(n+3), .manual-quantity-table tfoot td { text-align: right; }
.status-badge { display: inline-flex; border: 1px solid #dee5ee; background: #f5f7fa; padding: 3px 7px; border-radius: 5px; font-size: 9px; white-space: nowrap; color: #5f7085; }
.status-badge.complete { color: #17654c; background: #edf8f2; border-color: #cde6da; }
.status-badge.pending { color: #975015; background: #fff6e9; border-color: #f0ddbf; }
.jiffy-alert { position: fixed; top: 20px; right: 20px; z-index: 100; display: flex; align-items: flex-start; gap: 10px; max-width: min(420px,calc(100vw - 32px)); background: #fff; border: 1px solid #dae3ed; border-left: 4px solid #527391; padding: 16px; border-radius: 10px; box-shadow: 0 12px 40px #15314920; font-size: 12px; animation: enter .2s ease; }
.jiffy-alert.success { border-left-color: #288365; }
.jiffy-alert.success > .icon { color: #288365; }
.jiffy-alert.error { border-left-color: #bd4b44; }
.jiffy-alert.error > .icon { color: #bd4b44; }
.jiffy-alert.warning { border-left-color: #c77e27; }
.jiffy-alert.warning > .icon { color: #c77e27; }
.jiffy-fade-out { opacity: 0; transition: opacity .2s; }
.loading-state { display: grid; place-items: center; gap: 18px; min-height: 350px; color: var(--text-secondary); font-size: 12px; }
.loading-spinner { width: 30px; height: 30px; border: 2px solid #e4eaf0; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes enter { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.icon.is-spinning { animation: spin 1s linear infinite; }

@media (max-width: 1100px) {
  .workspace-units { display: none; }
  .main-grid { grid-template-columns: 360px minmax(0,1fr); }
  .manual-grid { grid-template-columns: 310px minmax(0,1fr); }
  .panel-card, .manual-card, .manual-sidebar .manual-card { padding: 20px; }
  .manual-stats .stat-icon { display: none; }
  .manual-stats strong { font-size: 22px; }
  .result-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .scenario-card .result-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .manual-target-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .manual-target-name { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .main-container { padding: 24px 18px 32px; }
  .workspace-bar-inner { padding: 14px 18px; gap: 14px; }
  .hero-art { flex-basis: 160px; width: 160px; }
  .main-grid, .manual-grid { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .results-empty { min-height: 280px; }
  .result-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .manual-stats strong { font-size: 25px; }
  .manual-drag-options { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .manual-target-fields { grid-template-columns: 2fr repeat(4,minmax(0,1fr)); }
  .manual-target-name { grid-column: auto; }
}
@media (max-width: 540px) {
  .workspace-bar-inner { flex-wrap: wrap; padding: 16px; }
  .brand-mark { width: 35px; height: 35px; border-radius: 9px; }
  .brand-name { font-size: 15px; }
  .brand-caption { font-size: 9px; }
  .page-nav { width: 100%; }
  .page-nav a { flex: 1; padding: 9px 7px; font-size: 11px; }
  .page-nav a .icon { width: 16px; height: 16px; }
  .main-container { padding: 24px 12px 30px; }
  .app-header { min-height: 0; margin-bottom: 24px; gap: 12px; }
  .app-title { font-size: 28px; letter-spacing: -.9px; }
  .app-subtitle { font-size: 12px; }
  .hero-art { display: none; }
  .pill { font-size: 9px; }
  .pill + .pill { padding-left: 7px; margin-left: 0; }
  .header-pills { gap: 7px; margin-top: 14px; }
  .panel-card, .manual-card, .manual-sidebar .manual-card { padding: 18px; }
  .card { border-radius: 12px; }
  .card-title { font-size: 14px; }
  .card-header { margin-bottom: 18px; }
  .card-icon { width: 32px; height: 32px; border-radius: 8px; }
  .section-tag { display: none; }
  .volume-number { font-size: 26px; }
  .control-columns { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .control-panel { padding: 13px; }
  .control-panel-header { align-items: flex-start; }
  .control-panel .viz-btn { font-size: 10px; }
  .result-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
  .scenario-card .result-stats { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
  .scenario-card .stat-value { font-size: 13px; }
  .stat-value { font-size: 24px; }
  .manual-history-bar { padding: 11px; }
  .manual-history-bar .manual-note { font-size: 9px; margin: 3px 0 0; }
  .manual-stats { gap: 7px; }
  .manual-stats .card { padding: 14px 10px; }
  .manual-stats strong { font-size: 20px; letter-spacing: -1px; }
  .manual-stats span { font-size: 9px; }
  .manual-target-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .manual-target-name { grid-column: 1 / -1; }
  .manual-drag-options { grid-template-columns: minmax(0,1fr); }
  .input-field, .manual-target-fields .input-field, .manual-drag-options .input-field { font-size: 16px; }
  .manual-table th, .manual-table td { padding: 10px 8px; }
  .manual-quantity-table { font-size: 10px; }
  .manual-quantity-table th { font-size: 9px; }
  .workspace-footer { font-size: 9px; }
  .jiffy-alert { top: 12px; right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
