:root {
  color-scheme: dark;
  --bg: #070b12;
  --panel: #0d131d;
  --panel-2: #111925;
  --line: #243044;
  --line-soft: #182334;
  --text: #f3f6fb;
  --muted: #8998ad;
  --orange: #ff6b35;
  --orange-soft: rgba(255, 107, 53, .14);
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, .14);
  --lime: #b8f34b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
@media (min-width: 901px) { body { min-width: 1120px; } }
button, input, select { font: inherit; }
button, select, input[type="range"] { cursor: pointer; }
.topbar { height: 78px; display: flex; align-items: center; gap: 16px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(7,11,18,.93); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(16px); }
.brand-mark { width: 38px; height: 38px; border: 1px solid #334155; border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 3px; background: linear-gradient(145deg,#172131,#0b1019); }
.brand-mark span { display: block; width: 3px; border-radius: 3px; background: var(--orange); }
.brand-mark span:nth-child(1) { height: 12px; }.brand-mark span:nth-child(2) { height: 22px; }.brand-mark span:nth-child(3) { height: 16px; }
.eyebrow { margin: 0 0 3px; font-size: 10px; line-height: 1; letter-spacing: .16em; color: var(--muted); font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.header-status { margin-left: auto; display: flex; align-items: center; gap: 9px; color: #aebacc; font-size: 12px; }
.header-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px rgba(184,243,75,.65); }
.workspace { display: grid; grid-template-columns: 365px minmax(740px, 1fr); height: calc(100vh - 78px); min-height: 0; overflow: hidden; }
.control-panel { height: 100%; min-height: 0; border-right: 1px solid var(--line); background: var(--panel); padding: 24px 24px 34px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.panel-heading, .stage-header, .card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-heading h2, .stage-header h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.ghost-button { color: #9babc0; background: transparent; border: 1px solid var(--line); border-radius: 7px; padding: 7px 11px; font-size: 11px; }
.ghost-button:hover { color: white; border-color: #44516a; }
.control-section { padding: 21px 0; border-bottom: 1px solid var(--line-soft); }
.section-title { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.section-title span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 6px; background: #172131; color: var(--orange); font: 700 10px/1 monospace; }
.section-title h3 { margin: 0; font-size: 13px; letter-spacing: .02em; }
.field-grid { display: grid; gap: 9px; }.field-grid.three { grid-template-columns: repeat(3,1fr); }.field-grid.two { grid-template-columns: repeat(2,1fr); }
label { display: block; color: #a9b5c7; font-size: 11px; font-weight: 650; }
label > span { float: right; color: #596a81; font-weight: 500; }
input[type="number"], select { width: 100%; margin-top: 7px; padding: 10px 10px; color: var(--text); background: #090e16; border: 1px solid #263247; border-radius: 7px; outline: none; transition: .15s border-color,.15s box-shadow; }
input[type="number"], select { text-align: left; }
input[type="number"]:focus, select:focus { border-color: rgba(255,107,53,.7); box-shadow: 0 0 0 3px rgba(255,107,53,.08); }
.compact input { text-align: left; }
.select-label { margin-top: 12px; }
.primary-section { padding: 13px 0 15px; }
.primary-section:first-child { padding-top: 13px; }
.primary-section .section-title { margin-bottom: 12px; }
.primary-section .field-grid { gap: 10px; }
.primary-section label { line-height: 1.2; }
.primary-section input[type="number"] { margin-top: 7px; padding: 10px; }
.primary-section .select-label { margin-top: 12px; }
.primary-section .select-label select { margin-top: 7px; padding-top: 10px; padding-bottom: 10px; }
.geometry-section { padding-bottom: 15px; }
.point-section { padding-top: 15px; padding-bottom: 15px; }
.control-panel .eyebrow { font-size: 11px; }
.control-panel .panel-heading h2 { font-size: 21px; }
.control-panel .ghost-button { font-size: 12px; }
.control-panel .section-title span { font-size: 11px; }
.control-panel .section-title h3 { font-size: 14px; }
.control-panel label { font-size: 12px; }
.control-panel input[type="number"], .control-panel select { font-size: 12px; }
.control-panel .surface-help { font-size: 12px; }
.control-panel .surface-estimate-note { font-size: 11px; color: #8a8174; }
.control-panel .surface-control-head strong { font-size: 13px; }
.control-panel .advanced summary { font-size: 12px; }
.main-stage .eyebrow { font-size: 11px; }
.main-stage .stage-header h2 { font-size: 21px; }
.main-stage .view-tabs button { font-size: 12px; }
.main-stage .point-glyph text { font-size: 14px; }
.main-stage .point-glyph .coordinate { font-size: 11px; }
.main-stage .distance-label, .main-stage .axis-label { font-size: 11px; }
.main-stage .room-legend { font-size: 11px; }
.main-stage .empty-state h3 { font-size: 16px; }
.main-stage .empty-state p { font-size: 12px; }
.main-stage .metric-grid p, .main-stage .metric-grid span { font-size: 11px; }
.main-stage .card-title h3 { font-size: 14px; }
.main-stage .card-title > span { font-size: 11px; color: #8190a5; }
.main-stage .metrics-table { font-size: 13px; }
.main-stage .metrics-table thead th { font-size: 11px; }
.main-stage .result-footer p, .main-stage .result-footer span { font-size: 11px; }
.main-stage .metric-grid strong { font-variant-numeric: tabular-nums; }
.geometry-select { margin: 0 0 12px; }
.mesh-upload { display: grid; gap: 10px; padding: 11px; border: 1px solid var(--line-soft); border-radius: 8px; background: #0a1018; }
.mesh-upload input[type="file"] { width: 100%; margin-top: 7px; color: #8796aa; font-size: 10px; }
.mesh-upload input[type="file"]::file-selector-button { margin-right: 9px; padding: 7px 9px; border: 1px solid #304059; border-radius: 6px; background: #172131; color: #d5deea; }
.mesh-upload p { margin: 0; color: #708096; font-size: 9px; line-height: 1.5; }
.range-row { display: grid; grid-template-columns: 1fr 45px; align-items: center; gap: 7px 10px; margin-top: 14px; }
.range-row:first-of-type { margin-top: 0; }.range-row output { justify-self: end; font: 700 12px/1 monospace; color: var(--orange); }
.surface-help { margin: -4px 0 12px; color: #708096; font-size: 10px; line-height: 1.5; }
.uniform-toggle { display: flex; align-items: center; gap: 8px; margin: -4px 0 12px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 7px; background: #0a1018; }
.uniform-toggle input { accent-color: var(--orange); }
.uniform-toggle span { float: none; color: #a9b5c7; }
.uniform-field { margin: -4px 0 12px; }
.uniform-field[hidden] { display: none; }
.material-select:disabled { opacity: .45; cursor: not-allowed; }
.surface-estimate-note { margin: -6px 0 9px; color: #665f55; font-size: 8px; }
.surface-controls { display: grid; gap: 9px; }
.surface-control { padding: 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: #0a1018; }
.surface-control-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.surface-control-head strong { color: #b9c5d4; font-size: 10px; }
.surface-control-head label { display: flex; align-items: center; gap: 6px; font-size: 9px; }
.surface-control-head input[type="number"] { width: 58px; margin: 0; padding: 5px 6px; text-align: left; }
.surface-control select { margin-top: 8px; padding: 8px; font-size: 10px; }
.custom-absorption-button { padding: 5px 7px; border: 1px solid #304059; border-radius: 6px; background: transparent; color: #9dadc1; font-size: 11px; font-weight: 700; }
.custom-absorption-button:hover, .custom-absorption-button.active { border-color: var(--orange); color: #ff9a73; }
.absorption-band-grid, .custom-absorption-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin-top: 10px; }
.absorption-band-grid span { min-width: 0; padding: 7px 5px; border: 1px solid var(--line-soft); border-radius: 6px; background: #0d1520; text-align: center; }
.absorption-band-grid b { display: block; overflow: hidden; color: #8292a8; font: 700 11px/1.2 monospace; white-space: nowrap; }
.absorption-band-grid em { display: block; margin-top: 5px; color: #d5deea; font: 700 13px/1 monospace; font-style: normal; }
.custom-absorption-grid label { color: #8292a8; font-size: 11px; text-align: center; }
.custom-absorption-grid input[type="number"] { margin-top: 5px; padding: 8px 4px; font-size: 12px; text-align: left; }
input[type="range"] { grid-column: 1 / -1; appearance: none; height: 4px; border-radius: 4px; background: linear-gradient(90deg,var(--orange) var(--fill,20%),#273348 var(--fill,20%)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; border-radius: 50%; border: 3px solid #0d131d; background: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.advanced { margin: 18px 0; border: 1px solid var(--line-soft); border-radius: 8px; background: #0a1018; }
.advanced summary { padding: 12px; color: #98a7ba; font-size: 11px; font-weight: 700; user-select: none; }
.advanced-grid { padding: 0 12px 13px; }
.run-button { width: 100%; border: 0; border-radius: 9px; padding: 14px 15px; display: flex; align-items: center; gap: 11px; background: var(--orange); color: #120a06; font-weight: 800; box-shadow: 0 9px 28px rgba(255,107,53,.2); }
.run-button:hover { filter: brightness(1.08); transform: translateY(-1px); }.run-button:disabled { opacity: .55; cursor: wait; transform: none; }
.run-button small { margin-left: auto; opacity: .62; font: 600 10px monospace; }.run-icon { font-size: 10px; }
.form-error { min-height: 18px; margin: 10px 2px 0; color: #fb7185; font-size: 11px; line-height: 1.5; }
.main-stage { height: 100%; min-width: 0; min-height: 0; padding: 25px 27px 50px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.stage-header { align-items: center; margin-bottom: 15px; }.stage-header h2 { font-size: 20px; }
.view-tabs { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #090e16; }
.view-tabs button { border: 0; background: transparent; color: #8190a5; font-size: 10px; padding: 6px 13px; border-radius: 5px; }.view-tabs button.active { background: #202c3d; color: white; }
.view-tabs button.rays-active { background: rgba(34,211,238,.14); color: var(--cyan); }
.room-card { background: radial-gradient(circle at 50% 40%,#131e2c 0,#0a1018 68%); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; position: relative; }
#roomSvg { display: block; width: 100%; height: 440px; }
.room-boundary { fill: rgba(7,11,18,.3); stroke: #607086; stroke-width: 2; }.room-grid { fill: rgba(7,11,18,.28); opacity: .9; }
.coordinate-grid-line { stroke: rgba(112,132,158,.17); stroke-width: 1; vector-effect: non-scaling-stroke; }
.coordinate-tick { stroke: #607086; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.coordinate-label { fill: #8292a8; font-size: 11px; font-weight: 650; }
.coordinate-axis-title { fill: #a8b5c7; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.simulation-progress { --progress: 0%; position: absolute; top: 16px; right: 16px; z-index: 4; min-width: 235px; display: flex; align-items: center; gap: 11px; padding: 11px 13px 14px; overflow: hidden; border: 1px solid #3b4a61; border-radius: 9px; background: rgba(9,14,22,.9); box-shadow: 0 12px 35px rgba(0,0,0,.28); backdrop-filter: blur(12px); }
.simulation-progress::after { content: ''; position: absolute; left: 0; bottom: 0; width: var(--progress); height: 3px; background: linear-gradient(90deg,var(--orange),var(--cyan)); transition: width .25s linear; }
.simulation-progress > i { width: 20px; height: 20px; flex: none; border: 2px solid #35445b; border-top-color: var(--orange); border-right-color: var(--cyan); border-radius: 50%; animation: simulation-spin .8s linear infinite; }
.simulation-progress strong, .simulation-progress span { display: block; }
.simulation-progress strong { color: #e6edf7; font-size: 12px; }
.simulation-progress span { margin-top: 3px; color: #91a0b4; font-size: 11px; }
.simulation-progress button { margin-left: auto; padding: 7px 10px; border: 1px solid #72402f; border-radius: 6px; background: rgba(255,107,53,.12); color: #ff956e; font-size: 11px; font-weight: 800; }
.simulation-progress button:hover { border-color: var(--orange); background: rgba(255,107,53,.2); }
.simulation-progress button:disabled { opacity: .55; cursor: wait; }
@keyframes simulation-spin { to { transform: rotate(360deg); } }
.mesh-edges line { stroke: #63748a; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.point-glyph text { text-anchor: middle; fill: #dbe5f2; font-size: 12px; font-weight: 800; letter-spacing: .08em; }.point-glyph .coordinate { font-size: 10px; fill: #8292a8; font-weight: 600; letter-spacing: 0; }.point-glyph .pattern-name { font-size: 9px; fill: #718197; font-weight: 700; letter-spacing: .03em; }
.point-glyph .halo,.point-glyph .directivity-pattern { fill-opacity: .08; stroke-width: 2; stroke-opacity: .8; vector-effect: non-scaling-stroke; }.point-glyph .point { stroke: #fff; stroke-width: 2; }.point-glyph .axis-arrow { stroke-width: 2; vector-effect: non-scaling-stroke; }
.point-glyph.directional .halo { fill-opacity: 0; stroke-opacity: .25; stroke-dasharray: 3 4; }
.point-glyph.directional .directivity-pattern { fill-opacity: .14; stroke-opacity: 1; }
.source-glyph .halo,.source-glyph .directivity-pattern { fill: var(--orange); stroke: var(--orange); }.source-glyph .point { fill: var(--orange); }.source-glyph .axis-arrow { stroke: var(--orange); }
.receiver-glyph .halo,.receiver-glyph .directivity-pattern { fill: var(--cyan); stroke: var(--cyan); }.receiver-glyph .point { fill: var(--cyan); }.receiver-glyph .axis-arrow { stroke: var(--cyan); }
.direct-path { stroke: #738299; stroke-width: 1.5; stroke-dasharray: 5 7; }.distance-label { fill: #b7c3d4; font-size: 11px; text-anchor: middle; paint-order: stroke; stroke: #0d151f; stroke-width: 5px; }.axis-label { fill: #617086; font-size: 10px; }
.room-legend { position: absolute; left: 17px; bottom: 14px; display: flex; gap: 17px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: rgba(7,11,18,.75); font-size: 11px; color: #95a3b6; backdrop-filter: blur(8px); }.room-legend span { display: flex; align-items: center; gap: 6px; }.room-legend i { display: inline-block; }.source-dot,.receiver-dot { width: 7px; height: 7px; border-radius: 50%; }.source-dot { background: var(--orange); }.receiver-dot { background: var(--cyan); }.path-line { width: 18px; border-top: 1px dashed #718096; }
.results { margin-top: 18px; min-height: 170px; }
.empty-state[hidden], .result-content[hidden] { display: none !important; }
.empty-state { min-height: 170px; padding: 24px; border: 1px dashed #263247; border-radius: 12px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }.empty-state h3 { margin: 16px 0 6px; color: #cbd5e1; font-size: 15px; }.empty-state p { margin: 0; max-width: 450px; font-size: 11px; line-height: 1.6; }
.empty-wave { height: 34px; display: flex; align-items: center; gap: 4px; }.empty-wave i { width: 3px; height: 12px; background: #41516a; border-radius: 3px; }.empty-wave i:nth-child(2),.empty-wave i:nth-child(4){height:27px}.empty-wave i:nth-child(3){height:18px;background:var(--orange)}
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }.metric-grid article,.chart-card,.result-footer { border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }.metric-grid article { padding: 15px 16px; }.metric-grid p { margin: 0 0 8px; color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }.metric-grid strong { display: block; font-size: 20px; letter-spacing: -.03em; }.metric-grid span { display: block; margin-top: 5px; color: #7f8ea3; font-size: 9px; }
.convergence-notice { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 11px 14px; border: 1px solid #334155; border-radius: 8px; background: rgba(30,41,59,.55); font-size: 11px; }.convergence-notice[hidden]{display:none}.convergence-notice strong{flex:none;color:#dbeafe}.convergence-notice span{color:#a3b1c4;line-height:1.5}.convergence-notice.reliable{border-color:#246b55;background:rgba(16,185,129,.08)}.convergence-notice.usable{border-color:#7c6124;background:rgba(245,158,11,.08)}.convergence-notice.preview{border-color:#7f3d32;background:rgba(239,68,68,.08)}
.chart-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; margin-top: 10px; }.chart-card { padding: 16px; min-height: 280px; }.card-title h3 { margin: 0; font-size: 14px; }.card-title > span { color: #65758a; font-size: 9px; }
.band-chart { --plot-top: 22px; --plot-height: 150px; height: 205px; display: flex; gap: 8px; padding-top: 12px; }
.band-axis { position: relative; flex: none; width: 30px; height: var(--plot-height); margin-top: var(--plot-top); }
.band-axis span { position: absolute; right: 0; transform: translateY(50%); color: #8190a5; font: 500 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.band-columns { position: relative; flex: 1; min-width: 0; display: flex; justify-content: space-between; gap: 7px; }
.band-grid { position: absolute; left: 0; right: 0; top: var(--plot-top); height: var(--plot-height); pointer-events: none; }
.band-grid i { position: absolute; left: 0; right: 0; border-top: 1px solid rgba(112,132,158,.16); }
.band { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 0; }
.band-value { height: var(--plot-top); color: #c5d0df; font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.band-bar-wrap { position: relative; width: 100%; height: var(--plot-height); display: flex; align-items: end; justify-content: center; border-bottom: 1px solid #344156; }
.band-bar { width: 62%; min-height: 2px; background: linear-gradient(180deg,var(--orange),#c2410c); border-radius: 4px 4px 0 0; box-shadow: 0 0 14px rgba(255,107,53,.12); transition: height .35s ease; }
.band-label { margin-top: 8px; color: #8796aa; font-size: 11px; }
.band:hover .band-bar { filter: brightness(1.15); }
.card-title > div { flex: none; }

#decayChart { display: block; width: 100%; height: 220px; margin-top: 8px; }.chart-grid-line { stroke: #263247; stroke-width: 1; }.chart-axis-text { fill: #8190a5; font-size: 11px; font-variant-numeric: tabular-nums; }.decay-line { fill: none; stroke: var(--cyan); stroke-width: 2; vector-effect: non-scaling-stroke; }.decay-area { fill: url(#decayGradient); opacity: .22; }
.metric-unreliable { color: var(--warn, #f59e0b); cursor: help; }
.metrics-table th.keep-case { text-transform: none; }
.obstacle-editor { margin-top: 12px; }
.obstacle-head { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.obstacle-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.obstacle-list { display: grid; gap: 8px; margin-top: 8px; }
.obstacle-row { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.obstacle-row-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.obstacle-row-head button { border: 0; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; }
.obstacle-row-head button:hover { color: var(--text); }
.obstacle-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px 7px; }
.obstacle-fields label { display: grid; gap: 2px; font-size: 9px; color: var(--muted); }
.obstacle-fields .obstacle-tl { grid-column: 1 / -1; }
.mesh-tl { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 0.85em; }
.mesh-tl input { width: 7em; }
.obstacle-fields input { width: 100%; min-width: 0; padding: 5px 7px; font-size: 12px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.obstacle-fields input::-webkit-outer-spin-button, .obstacle-fields input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.obstacle-row select { width: 100%; margin-top: 6px; }
.obstacle-shapes rect { fill: rgba(148, 163, 184, .22); stroke: #9babc0; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.obstacle3d { stroke: #9babc0; stroke-width: 1.6; vector-effect: non-scaling-stroke; pointer-events: none; }
.obstacle-top3d { fill: rgba(148, 163, 184, .18); stroke: none; pointer-events: none; }
.map-card { margin-top: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.map-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin-top: 12px; font-size: 11px; color: var(--muted); }
.map-controls label { display: grid; gap: 4px; }
.map-controls input, .map-controls select { width: 110px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); font: inherit; }
.map-controls input { width: 70px; }
.map-sources { margin-top: 12px; }
.speaker-row { margin-top: 6px; grid-template-columns: 2fr 1fr 1fr !important; }
.speaker-row select { margin-top: 0; padding: 4px 6px; font-size: 11px; }
.map-sources .obstacle-head .ghost-button { margin-left: auto; text-transform: none; letter-spacing: 0; }
.map-source-list .obstacle-fields { grid-template-columns: repeat(5, 1fr); }
.map-plot .map-source.extra { stroke: #9ec5f4; }
.probe-controls { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.map-controls input.probe-heights { width: 120px; }
.map-input { display: inline-flex; align-items: center; gap: 6px; }
.map-run { padding: 8px 14px; border: 1px solid #2a78d6; border-radius: 7px; background: #184f95; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.map-run:disabled { opacity: .6; cursor: progress; }
.map-status { align-self: center; }
.map-body { margin-top: 14px; }
.map-plot { position: relative; }
.map-plot svg { display: block; width: 100%; height: auto; max-height: 460px; }
.map-plot .map-cell { stroke: var(--panel-2); stroke-width: 2; }
.map-plot .map-cell:hover { stroke: var(--text); }
.map-plot .map-wall { fill: none; stroke: #5b6b82; stroke-width: 1.5; }
.map-plot .map-source { fill: var(--panel-2); stroke: var(--text); stroke-width: 2; }
.map-plot .map-axis { fill: var(--muted); font-size: 10px; }
.map-tooltip { position: absolute; pointer-events: none; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); font-size: 11px; white-space: nowrap; transform: translate(-50%, -120%); }
.map-legend { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.map-legend .map-ramp { flex: 0 1 260px; height: 10px; border-radius: 4px; }
.map-table { margin-top: 10px; font-size: 11px; color: var(--muted); }
.map-download { display: inline-flex; margin-top: 12px; }
.rt-target-summary { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.select-label.room-use, .select-label.diffraction-mode { margin-top: 12px; }
.speech-fields { margin-top: 10px; }
.metrics-note { margin: 10px 0 0; font-size: 12px; color: var(--muted, #94a3b8); }
.metrics-table-card { margin-top: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.table-scroll { margin-top: 14px; overflow-x: auto; }
.metrics-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.metrics-table th,.metrics-table td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); text-align: right; font-variant-numeric: tabular-nums; }
.metrics-table thead th { color: #8190a5; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.metrics-table th:first-child { text-align: left; color: #c2cddd; }
.metrics-table tbody td { color: #b3bfce; }
.metrics-table tbody tr:nth-child(3),.metrics-table tbody tr:nth-child(4) { background: rgba(255,107,53,.045); }
.convolution-card { margin-top: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.convolution-controls { display: flex; align-items: center; gap: 12px; margin-top: 15px; }
.audio-file-button, .convolution-controls button { flex: none; margin: 0; padding: 10px 14px; border: 1px solid #304059; border-radius: 7px; background: #172131; color: #dbe5f2; font-size: 12px; font-weight: 750; cursor: pointer; }
.audio-file-button input { display: none; }
.convolution-controls > span { min-width: 0; overflow: hidden; color: #91a0b4; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.convolution-controls button { margin-left: auto; border-color: var(--orange); background: var(--orange); color: #160b06; }
.convolution-controls button:disabled { border-color: #304059; background: #172131; color: #6b7a8f; cursor: not-allowed; }
.convolution-status { margin: 12px 0 0; color: #78889d; font-size: 11px; line-height: 1.5; }
.convolution-player { display: flex; align-items: center; gap: 14px; margin-top: 13px; }
.convolution-player audio { min-width: 240px; width: 100%; height: 38px; }
.convolution-player .download-button { flex: none; margin-left: 0; }
.footer-metric { margin-left: 34px; padding-left: 34px; border-left: 1px solid var(--line); }
.result-footer { margin-top: 10px; display: flex; align-items: center; padding: 15px 17px; }.result-footer p { margin: 0 0 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }.result-footer strong { font-size: 15px; }.result-footer span { margin-left: 8px; color: #7f8ea3; font-size: 9px; }.download-button { margin-left: auto; padding: 10px 14px; border-radius: 7px; color: #071016; background: var(--cyan); text-decoration: none; font-size: 11px; font-weight: 800; }.download-button span { margin-left: 8px; color: inherit; font-size: 13px; }
@media (max-width: 1200px) { .workspace{grid-template-columns:340px 1fr}.main-stage{padding-left:20px;padding-right:20px} }

/* Stale results after inputs change */
.stale-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 10px 12px 10px 14px; border: 1px solid #7c6124; border-radius: 8px; background: rgba(245,158,11,.08); color: #e7d3a6; font-size: 12px; }
.stale-notice strong { color: #fbd38d; }
.stale-notice button { flex: none; padding: 7px 12px; border: 1px solid var(--orange); border-radius: 6px; background: var(--orange); color: #160b06; font-size: 12px; font-weight: 800; }
.stale-notice button:hover { filter: brightness(1.08); }
/* Invalid coordinates */
.control-panel input:invalid { border-color: rgba(251,113,133,.75); box-shadow: 0 0 0 3px rgba(251,113,133,.08); }
/* Metrics table: explain highlighted reference rows */
.reference-swatch { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 2px; background: rgba(255,107,53,.35); vertical-align: -1px; }
.metrics-table tbody tr:nth-child(3),.metrics-table tbody tr:nth-child(4) { background: rgba(255,107,53,.07); }

/* Air absorption switch */
.air-settings { padding: 0 12px 4px; }
.air-settings .uniform-toggle { margin: 0 0 10px; }
.air-fields { align-items: end; margin-bottom: 10px; }
.air-help { margin: 0 0 10px; color: #8190a5; font-size: 11px; line-height: 1.45; }
.air-fields .air-help { margin: 0; align-self: center; }
.advanced > .uniform-toggle { margin: 0 12px 12px; }

/* Direct manipulation on the plan view */
#roomSvg { touch-action: none; }
.point-glyph { cursor: grab; }
.point-glyph .halo { pointer-events: all; }
#roomSvg.dragging, #roomSvg.dragging * { cursor: grabbing; user-select: none; }
#roomSvg.dragging-length, #roomSvg.dragging-length * { cursor: ew-resize; }
#roomSvg.dragging-width, #roomSvg.dragging-width * { cursor: ns-resize; }
#roomSvg.dragging-source .source-glyph .halo, #roomSvg.dragging-receiver .receiver-glyph .halo { stroke-opacity: 1; fill-opacity: .2; }
.legend-hint { color: #6f7f94; }
.direct-path, .distance-label, .simulation-rays, .room-grid, .room-boundary, .coordinate-grid { pointer-events: none; }

/* Ray count mode */
.ray-mode { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px 12px; }
.ray-mode-title { color: #a9b5c7; font-size: 12px; font-weight: 650; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #090e16; }
.segmented label { display: block; margin: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { float: none; display: block; padding: 6px 12px; border-radius: 5px; color: #8190a5; font-size: 12px; font-weight: 700; cursor: pointer; }
.segmented input:checked + span { background: #202c3d; color: #fff; }
.segmented input:focus-visible + span { outline: 2px solid rgba(255,107,53,.6); outline-offset: 1px; }
.field-name { font-weight: inherit; }
.field-span { grid-column: 1 / -1; margin: 0; }
.advanced-grid .field-span { margin-top: -2px; }
/* Per-surface scattering */

/* Surfaces: independent absorption / scattering groups */
.surface-group { padding: 12px; border: 1px solid var(--line-soft); border-radius: 8px; background: #0a1018; }
.surface-group + .surface-group { margin-top: 10px; }
.surface-group[hidden] { display: none; }
.surface-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.surface-group-head h4 { margin: 0; color: #dbe5f2; font-size: 13px; }
.inline-toggle { display: inline-flex; align-items: center; gap: 6px; color: #a9b5c7; font-size: 11px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.inline-toggle input { margin: 0; accent-color: var(--orange); }
.inline-toggle span { float: none; color: inherit; font-weight: inherit; }
.surface-group .uniform-field { margin: 0 0 10px; }
.surface-group .surface-help { margin: 0 0 10px; }
.surface-group .surface-help:last-child { margin-bottom: 0; }
.surface-group .surface-control { background: #0d1520; }
.scatter-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px 10px; margin-bottom: 10px; }
.scatter-grid label { font-size: 11px; color: #8fa0b5; }
.scatter-grid input[type="number"] { margin-top: 5px; padding: 8px; }

/* Room views: Top / 3D / Split */
.room-views { display: grid; grid-template-columns: 1fr; }
.view-pane { position: relative; min-width: 0; }
.ray-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.room-card.view-top #pane3d, .room-card.view-3d #paneTop { display: none; }
.room-card.view-split .room-views { grid-template-columns: 1fr 1fr; }
.room-card.view-split #paneTop { border-right: 1px solid var(--line-soft); }
#room3d { display: block; width: 100%; height: 440px; cursor: grab; touch-action: none; user-select: none; }
#room3d.orbiting { cursor: grabbing; }
.room-card.view-split #roomSvg, .room-card.view-split #room3d { height: 360px; }
.floor3d { fill: rgba(96,112,134,.08); stroke: none; }
.grid3d { stroke: rgba(112,132,158,.16); stroke-width: 1; vector-effect: non-scaling-stroke; }
.edge3d { stroke: #7b8ba1; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.edge3d.back { stroke: #4a586c; stroke-dasharray: 4 5; }
.axis3d { stroke-width: 2.4; vector-effect: non-scaling-stroke; }
.axis3d.axis-x { stroke: #f2917a; } .axis3d.axis-y { stroke: #7fd8a6; } .axis3d.axis-z { stroke: #8ab4ff; }
.dim3d { font-size: 13px; font-weight: 800; paint-order: stroke; stroke: #0d151f; stroke-width: 5px; }
.dim3d.axis-x { fill: #f6b2a2; } .dim3d.axis-y { fill: #a6e6c2; } .dim3d.axis-z { fill: #b2ccff; }
.drop3d { stroke-width: 1.4; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.shadow3d { fill-opacity: .25; stroke: none; }
.halo3d { fill-opacity: .08; stroke-width: 2; stroke-opacity: .8; vector-effect: non-scaling-stroke; }
.dot3d { stroke: #fff; stroke-width: 2; }
.label3d { fill: #dbe5f2; font-size: 14px; font-weight: 800; letter-spacing: .08em; }
.coord3d { fill: #8292a8; font-size: 11px; font-weight: 600; }
.point3d.source .drop3d, .point3d.source .halo3d { stroke: var(--orange); } .point3d.source .halo3d, .point3d.source .dot3d, .point3d.source .shadow3d { fill: var(--orange); }
.point3d.receiver .drop3d, .point3d.receiver .halo3d { stroke: var(--cyan); } .point3d.receiver .halo3d, .point3d.receiver .dot3d, .point3d.receiver .shadow3d { fill: var(--cyan); }
.view3d-hint { fill: #6f7f94; font-size: 12px; }
.view-tabs button[aria-selected="true"] { background: #202c3d; color: white; }
.room-card.view-3d .legend-hint { display: none; }
.surface-group-head { flex-wrap: wrap; row-gap: 6px; }
.surface-group-head h4 { white-space: nowrap; }

.point3d { cursor: grab; }
.point3d .halo3d { pointer-events: all; }
.point3d text, .point3d .drop3d, .point3d .shadow3d { pointer-events: none; }
#room3d.moving-point, #room3d.moving-point * { cursor: grabbing; }
#room3d .edge3d, #room3d .grid3d, #room3d .floor3d, #room3d .ray3d, #room3d .axis3d, #room3d .dim3d, #room3d .direct-path, #room3d .distance-label { pointer-events: none; }

/* Confirm converting dry audio to 48 kHz */
.resample-confirm { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 10px 12px 10px 14px; border: 1px solid #7c6124; border-radius: 8px; background: rgba(245,158,11,.08); color: #e7d3a6; font-size: 12px; line-height: 1.45; }
.resample-confirm > div { display: flex; flex: none; gap: 8px; }
.resample-confirm button { padding: 7px 12px; border: 1px solid var(--orange); border-radius: 6px; background: var(--orange); color: #160b06; font-size: 12px; font-weight: 800; cursor: pointer; }
.resample-confirm button.secondary { border-color: #304059; background: transparent; color: #c5d0df; }
.resample-confirm button:hover { filter: brightness(1.1); }

/* Language switcher */
.lang-switch { display: inline-flex; gap: 2px; margin-left: 16px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #090e16; }
.lang-switch button { border: 0; border-radius: 5px; padding: 5px 10px; background: transparent; color: #8190a5; font-size: 12px; font-weight: 700; cursor: pointer; }
.lang-switch button:hover { color: #dbe5f2; }
.lang-switch button[aria-pressed="true"] { background: #202c3d; color: #fff; }
.room-legend b, .card-title span b { font-weight: inherit; }
:lang(zh) body, :lang(ja) body { font-family: Inter, "PingFang SC", "Hiragino Sans", "Noto Sans CJK SC", "Noto Sans JP", "Microsoft YaHei", system-ui, sans-serif; }
:lang(zh) .eyebrow, :lang(ja) .eyebrow { letter-spacing: .06em; }

/* Ray wavefront animation (comet tails, brightness = energy left after wall hits) */
.simulation-rays { pointer-events: none; }
.ray-tail, .ray-glow { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ray-tail { stroke: #9fd8ff; stroke-width: 1.1; }
.ray-glow { stroke: #e8f6ff; stroke-width: 1.9; }
.ray-head { fill: #ffffff; }

/* Hover highlight for everything that can be dragged */
.point-glyph:hover .halo { stroke-opacity: 1; fill-opacity: .22; stroke-width: 3; }
.point-glyph:hover .point { stroke-width: 3; }
.point3d:hover .halo3d { stroke-opacity: 1; fill-opacity: .24; stroke-width: 3; }
.point3d:hover .dot3d { stroke-width: 3; }
.dim-handle { cursor: grab; }
.axis-hit { stroke: transparent; stroke-width: 16; stroke-linecap: round; pointer-events: stroke; vector-effect: non-scaling-stroke; }
.handle3d { fill: #0d151f; stroke-width: 2; pointer-events: all; vector-effect: non-scaling-stroke; }
.dim-handle.axis-x .handle3d { stroke: #f2917a; } .dim-handle.axis-y .handle3d { stroke: #7fd8a6; } .dim-handle.axis-z .handle3d { stroke: #8ab4ff; }
.dim-handle:hover .axis-hit { stroke: rgba(255,255,255,.12); }
.dim-handle:hover .handle3d { stroke-width: 3.5; }
.dim-handle.axis-x:hover .handle3d { fill: rgba(242,145,122,.35); } .dim-handle.axis-y:hover .handle3d { fill: rgba(127,216,166,.35); } .dim-handle.axis-z:hover .handle3d { fill: rgba(138,180,255,.35); }
#room3d.dragging-length .dim-handle.axis-x .axis-hit, #room3d.dragging-width .dim-handle.axis-y .axis-hit, #room3d.dragging-height .dim-handle.axis-z .axis-hit { stroke: rgba(255,255,255,.16); }
#roomSvg .dim-handle .axis3d, #roomSvg .dim-handle .dim3d { pointer-events: none; }
#roomSvg .dim-handle.axis-x { cursor: ew-resize; } #roomSvg .dim-handle.axis-y { cursor: ns-resize; }
#roomSvg.dragging-length .dim-handle.axis-x .axis-hit, #roomSvg.dragging-width .dim-handle.axis-y .axis-hit { stroke: rgba(255,255,255,.16); }

/* ---- Layout pass: legend outside the plot, compact sidebar ---------------- */
.room-legend { position: static; margin: 0 16px 14px; width: fit-content; max-width: calc(100% - 32px); flex-wrap: wrap; row-gap: 6px; background: rgba(7,11,18,.55); }
.room-card { display: flex; flex-direction: column; }
#roomSvg, #room3d { height: 420px; }
.room-card.view-split #roomSvg, .room-card.view-split #room3d { height: 340px; }

.topbar { height: 64px; }
.workspace { height: calc(100vh - 64px); grid-template-columns: 330px minmax(720px, 1fr); }
.control-panel { padding: 16px 16px 24px; }
.control-panel .panel-heading { margin-bottom: 4px; }
.control-panel .panel-heading h2 { font-size: 19px; }
.control-panel .control-section { padding: 12px 0; }
.control-panel .primary-section, .control-panel .point-section, .control-panel .geometry-section { padding: 10px 0 12px; }
.control-panel .section-title { margin-bottom: 9px; }
.control-panel .primary-section .section-title { margin-bottom: 8px; }
.control-panel .field-grid, .control-panel .primary-section .field-grid { gap: 8px; }
.control-panel label { font-size: 11.5px; }
.control-panel input[type="number"], .control-panel select,
.control-panel .primary-section input[type="number"], .control-panel .primary-section .select-label select { margin-top: 5px; padding: 7px 9px; font-size: 12px; }
.control-panel .select-label, .control-panel .primary-section .select-label { margin-top: 8px; }
.control-panel .surface-group { padding: 10px; }
.control-panel .surface-group + .surface-group { margin-top: 8px; }
.control-panel .surface-group-head { flex-wrap: nowrap; margin-bottom: 8px; }
.control-panel .surface-group-head h4 { font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.control-panel .inline-toggle { font-size: 11px; flex: none; }
.control-panel .surface-group .uniform-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.control-panel .surface-group .uniform-field input[type="number"] { width: 96px; flex: none; margin-top: 0; }
.control-panel .surface-help { margin: 0 0 6px; font-size: 11px; line-height: 1.4; }
.control-panel .surface-estimate-note { margin: 0 0 6px; font-size: 10.5px; }
.control-panel .scatter-grid { gap: 6px 8px; margin-bottom: 8px; }
.control-panel .scatter-grid input[type="number"] { padding: 6px 8px; margin-top: 4px; }
.control-panel .advanced { margin: 12px 0; }
.control-panel .advanced summary { padding: 10px 12px; }
.control-panel .ray-mode { padding: 0 12px 10px; }
.control-panel .advanced-grid { padding: 0 12px 10px; }
.control-panel .air-settings .uniform-toggle { padding: 7px 10px; margin-bottom: 8px; }
.control-panel .air-help { font-size: 10.5px; line-height: 1.4; }
.control-panel .run-button { padding: 11px 14px; }
.control-panel .form-error { margin-top: 8px; }

.main-stage { padding: 18px 22px 40px; }
.stage-header { margin-bottom: 12px; }
.results { margin-top: 14px; }
.metric-grid article { padding: 13px 15px; }

/* Dry / convolved A/B players */
.ab-players { display: grid; gap: 8px; margin-top: 12px; }
.ab-player { display: flex; align-items: center; gap: 12px; }
.ab-player[hidden] { display: none; }
.ab-player audio { flex: 1; min-width: 200px; height: 36px; }
.ab-label { flex: none; width: 84px; padding: 5px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; text-align: center; letter-spacing: .04em; }
.ab-label.dry { background: #172131; color: #b9c5d4; border: 1px solid #304059; }
.ab-label.wet { background: rgba(34,211,238,.12); color: var(--cyan); border: 1px solid rgba(34,211,238,.35); }
.ab-player .download-button { flex: none; margin-left: 0; }
.control-panel .surface-group-head { flex-wrap: wrap; row-gap: 4px; }
.control-panel .surface-group-head h4 { flex: 1 0 100%; overflow: visible; }

.level-toggle { display: flex; margin-top: 10px; white-space: normal; line-height: 1.4; }
.level-toggle input { flex: none; }
/* Larger room view */
#roomSvg, #room3d { height: clamp(420px, 58vh, 560px); }
.room-card.view-split #roomSvg, .room-card.view-split #room3d { height: clamp(360px, 50vh, 480px); }

/* Info buttons and the floating explanation box */
.info-tip { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 6px; padding: 0; border: 1px solid #3a4a62; border-radius: 50%; background: transparent; color: #8fa0b5; font: 700 9.5px/1 ui-serif, Georgia, serif; font-style: italic; vertical-align: 1px; cursor: help; flex: none; }
.info-tip:hover, .info-tip:focus-visible { border-color: var(--cyan); color: var(--cyan); outline: none; background: rgba(34,211,238,.08); }
.tooltip { position: fixed; z-index: 1000; max-width: 320px; padding: 9px 11px; border: 1px solid #3a4a62; border-radius: 8px; background: rgba(12,18,28,.97); color: #dbe5f2; font-size: 12px; font-weight: 500; line-height: 1.5; letter-spacing: 0; text-transform: none; white-space: pre-line; box-shadow: 0 12px 32px rgba(0,0,0,.4); pointer-events: none; }
.tooltip[hidden] { display: none; }
.label-row { float: none !important; display: flex; align-items: center; color: inherit !important; font-weight: inherit !important; }
.ray-mode-title { display: inline-flex; align-items: center; }
.surface-group-head h4 { display: flex; align-items: center; }
.metric-grid article p { display: flex; align-items: center; }
.result-footer p { display: flex; align-items: center; }
.card-title h3, .stage-header h2 { display: flex; align-items: center; }
.stage-header h2 .info-tip, .card-title h3 .info-tip { width: 16px; height: 16px; }
.level-toggle .info-tip { margin-left: 4px; }
.air-settings .uniform-toggle .info-tip { margin-left: auto; }
.info-tip { text-transform: none; letter-spacing: 0; }

.download-button.report-button { margin-left: 8px; border: 0; cursor: pointer; font-family: inherit; }
.download-button.report-button:disabled { opacity: .6; cursor: progress; }

.geometry-switch { margin: 0 0 12px; }
.geometry-switch label { flex: 1; display: flex; justify-content: center; align-items: center; cursor: pointer; padding: 6px 10px; border-radius: 5px; color: #8190a5; font-size: 12px; }
.geometry-switch input { position: absolute; opacity: 0; pointer-events: none; }
.geometry-switch label:has(input:checked) { background: #202c3d; color: white; }
.geometry-switch label:has(input:focus-visible) { outline: 2px solid var(--cyan); }
.advanced > .select-label, .advanced > .speech-fields { margin-left: 12px; margin-right: 12px; }
.advanced > .uniform-toggle.feature-switch { margin: 8px 12px 0; }
.feature-switch .info-tip { margin-left: auto; }
.feature-switch:has(input:disabled) { opacity: .5; }
.obstacle-tl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.obstacle-tl > label:not(.transmit-toggle) { display: flex; align-items: center; gap: 6px; flex: 1; }
.transmit-toggle { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }
.transmit-toggle input { accent-color: var(--orange); width: auto; margin: 0; }
.mesh-tl > label:not(.transmit-toggle) { display: flex; align-items: center; gap: 6px; }
input.needs-value { border-color: var(--orange); }
input:disabled::placeholder { opacity: .6; }
.obstacle-fields .obstacle-tl label, .mesh-tl label { display: flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; }
.obstacle-fields .obstacle-tl label:not(.transmit-toggle) { flex: 1; justify-content: flex-end; }
.obstacle-fields .obstacle-tl input[type="number"], .mesh-tl input[type="number"] { width: 6.5em; flex: none; margin: 0; }
.obstacle-fields .obstacle-tl input[type="checkbox"], .mesh-tl input[type="checkbox"] { width: auto; margin: 0; }
.geometry-switch label:has(input:checked) span { color: white; }
.obstacle-tl .tl-preset, .mesh-tl .tl-preset { flex: 1 1 100%; min-width: 0; font-size: 11px; padding: 5px 7px; }
.tl-preset:disabled { opacity: .5; }

/* Narrow screens (phones, small tablets): panels stack, the page scrolls. */
@media (max-width: 900px) {
  html, body { height: auto; overflow: auto; }
  .topbar { height: auto; min-height: 58px; flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; position: sticky; }
  .header-status { order: 3; width: 100%; margin-left: 0; font-size: 11px; }
  .lang-switch { margin-left: auto; }
  .workspace { display: block; height: auto; overflow: visible; }
  .control-panel, .main-stage { height: auto; overflow: visible; padding: 16px; scrollbar-gutter: auto; }
  .control-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .run-button small { display: none; }
  /* The plan keeps its proportions instead of a fixed desktop height. */
  #roomSvg, .room-card.view-split #roomSvg { height: auto; aspect-ratio: 1000 / 600; }
  #room3d, .room-card.view-split #room3d { height: 320px; }
  .room-card.view-split .room-views { grid-template-columns: 1fr; }
  /* 16 px inputs: iOS does not zoom the page on focus. */
  input[type="number"], select { font-size: 16px; }
  .obstacle-fields input, .obstacle-tl .tl-preset, .mesh-tl .tl-preset { font-size: 16px; }
  /* Results: one column; wide tables scroll sideways instead of squeezing. */
  .chart-grid { grid-template-columns: minmax(0, 1fr); }
  .chart-card { min-width: 0; min-height: 0; }
  #decayChart { height: auto; aspect-ratio: 620 / 230; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-scroll { -webkit-overflow-scrolling: touch; }
  .metrics-table th, .metrics-table td { white-space: nowrap; padding: 8px 9px; }
  .result-footer { flex-wrap: wrap; gap: 12px 18px; }
  .result-footer > div { flex: 1 1 40%; min-width: 0; }
  .footer-metric { margin-left: 0; padding-left: 14px; }
  .result-footer .download-button { flex: 1 1 40%; margin-left: 0; text-align: center; white-space: nowrap; }
}

/* Brand: Cavora (Kejiact); Room Lab is the product. */
.brand-name { display: flex; align-items: baseline; gap: 9px; }
.product-tag { padding: 0; border: 0; border-radius: 0; color: #9fb0c6; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.copyright { margin: 14px 2px 0; color: #5f6f86; font-size: 10.5px; }
.module-note { margin: 16px 0 6px; padding-top: 12px; border-top: 1px dashed var(--line); color: #8190a5; font-size: 11px; letter-spacing: .02em; }
@media (max-width: 900px) {
  .brand-name { font-size: 18px; gap: 6px; }
  .product-tag { font-size: 10px; padding: 0; }
  .topbar .lang-switch button { padding: 5px 7px; }
}

/* Advanced settings in three groups. */
.advanced-group { margin: 16px 12px 8px; padding-top: 12px; border-top: 1px solid var(--line-soft); color: #7d8ca1; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.advanced > .advanced-group:first-of-type { margin-top: 2px; padding-top: 0; border-top: 0; }
.obstacle-material-label { display: grid; gap: 3px; margin-top: 6px; color: var(--muted); font-size: 9px; }
.obstacle-material-label select { margin-top: 0; }
.metric-grid article > p { min-height: 20px; display: flex; align-items: center; gap: 4px; }

/* ---- Folding panels and switched features (panels.js) ---------------------- */
.fold-card { margin-top: 8px; border: 1px solid var(--line-soft); border-radius: 8px; background: #0a1018; }
.fold-head { display: flex; align-items: center; padding-right: 10px; }
.fold-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 0; background: transparent; color: var(--text); font-size: 12px; font-weight: 650; text-align: left; cursor: pointer; }
.fold-toggle:hover .fold-title { color: #fff; }
.fold-title { color: #dbe5f2; white-space: nowrap; }
.fold-summary { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.chevron { flex: none; width: 6px; height: 6px; margin: 0 2px 2px 4px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .15s ease; }
[aria-expanded="true"] > .chevron { transform: rotate(45deg); margin-bottom: 4px; }
.fold-body { padding: 0 12px 12px; }
.feature-head { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; font-size: 12px; font-weight: 650; cursor: pointer; }
.feature-head input { margin: 0; accent-color: var(--orange); }
.feature-head .fold-title { float: none; }
.feature-head .info-tip { margin-left: 6px; flex: none; }
.feature-head .fold-summary { float: none; }
.feature-card .fold-body .select-label { margin-top: 0; }
.feature-card .fold-body .uniform-toggle.feature-switch { margin: 10px 0 0; }
.feature-card .speech-fields { margin-top: 10px; }
.feature-card .air-fields { margin-bottom: 0; }
.advanced-section .fold-card:first-of-type { margin-top: 0; }
.advanced-section .ray-mode, .advanced-section .advanced-grid { padding-left: 0; padding-right: 0; }
.control-panel .advanced-section .ray-mode, .control-panel .advanced-section .advanced-grid { padding-left: 0; padding-right: 0; }

/* Obstacles: the panel folds, and each obstacle folds to name + size. */
.obstacle-editor.fold-card { margin-top: 12px; }
.obstacle-editor .fold-title { text-transform: none; letter-spacing: 0; }
.obstacle-editor .obstacle-presets { margin-top: 0; }
.obstacle-fold { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 0; border: 0; background: transparent; color: var(--text); font-size: 12px; text-align: left; cursor: pointer; }
.obstacle-fold .chevron { margin-left: 0; }
.obstacle-size { margin-left: auto; padding-right: 8px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.obstacle-row.collapsed .obstacle-body { display: none; }
.obstacle-row.collapsed .obstacle-row-head { margin-bottom: 0; }

/* Pro switch: extra metrics and the listener map. */
.pro-switch { display: inline-flex; align-items: center; gap: 7px; margin-left: 16px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 7px; background: #090e16; color: #8190a5; font-size: 12px; font-weight: 700; cursor: pointer; }
.pro-switch i { width: 7px; height: 7px; border-radius: 50%; background: #3b4a61; }
.pro-switch:hover { color: #dbe5f2; }
.pro-switch[aria-pressed="true"] { color: #fff; border-color: rgba(255,107,53,.55); background: var(--orange-soft); }
.pro-switch[aria-pressed="true"] i { background: var(--orange); box-shadow: 0 0 10px rgba(255,107,53,.6); }
/* Features above the account's edition (tiers.js): usable to set up, tagged Basic / Pro
   next to their title, never over text. The room-shape tiles carry it on their top edge. */
.tier-chip { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid rgba(96,165,250,.55); border-radius: 999px; background: #0f1a2b; color: #a9cbff; font-size: 10px; font-weight: 800; letter-spacing: .03em; line-height: 16px; vertical-align: 1px; white-space: nowrap; text-transform: none; float: none; }
.tier-chip-pro { border-color: rgba(250,204,21,.55); background: #1d1a0c; color: #fde68a; }
.label-row .tier-chip { margin-left: 8px; }
.tier-tag { position: relative; }
.shape-picker .tier-tag::after { content: attr(data-tier-label); position: absolute; top: -7px; left: 50%; transform: translateX(-50%); z-index: 3; padding: 0 5px; border: 1px solid rgba(96,165,250,.55); border-radius: 999px; background: #0f1a2b; color: #a9cbff; font-size: 9px; font-weight: 800; line-height: 13px; white-space: nowrap; pointer-events: none; }
.metric-grid .tier-above > strong { filter: blur(6px); }

/* Upgrade dialog: opens on run / action when settings need another edition. */
.upgrade-dialog { width: min(440px, calc(100vw - 32px)); padding: 22px 22px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.upgrade-dialog::backdrop { background: rgba(3,6,10,.6); backdrop-filter: blur(2px); }
.upgrade-dialog h3 { margin: 0 0 8px; font-size: 16px; }
.upgrade-lead { margin: 0 0 14px; color: #aebacc; font-size: 13px; line-height: 1.5; }
.upgrade-list { display: grid; gap: 10px; }
.upgrade-group { padding: 10px 12px; border: 1px solid rgba(96,165,250,.35); border-radius: 8px; background: rgba(96,165,250,.06); }
.upgrade-pro { border-color: rgba(250,204,21,.35); background: rgba(250,204,21,.06); }
.upgrade-group strong { font-size: 12px; color: #a9cbff; }
.upgrade-pro strong { color: #fde68a; }
.upgrade-group ul { margin: 6px 0 0; padding-left: 18px; color: #dbe5f2; font-size: 13px; line-height: 1.6; }
.upgrade-dialog form { display: flex; justify-content: flex-end; margin: 16px 0 0; }
.upgrade-ok { padding: 8px 18px; border: 0; border-radius: 7px; background: var(--orange); color: #160b06; font-weight: 800; cursor: pointer; }
.edition-chip { margin-left: 16px; padding: 4px 10px; border: 1px solid rgba(255,107,53,.45); border-radius: 999px; background: var(--orange-soft); color: #ffd2bf; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tier-switch { display: inline-flex; gap: 2px; margin-left: 16px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #090e16; }
.tier-switch button { border: 0; border-radius: 5px; padding: 5px 10px; background: transparent; color: #8190a5; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.tier-switch button:hover { color: #dbe5f2; }
.tier-switch button[aria-pressed="true"] { background: var(--orange-soft); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,107,53,.55); }
@media (max-width: 900px) { .tier-switch { margin-left: auto; } .tier-switch button { padding: 5px 7px; } }

/* Design report: the last step, after the audition. */
.report-row { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 17px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.report-row .eyebrow { margin-bottom: 6px; }
.report-row strong { font-size: 13px; }
.report-row .download-button { margin-left: 0; }
@media (max-width: 900px) { .pro-switch { margin-left: auto; } .report-row { flex-wrap: wrap; } .report-row .download-button { flex: 1 1 100%; text-align: center; } }

/* Obstacles on the plan view (plan_obstacles.js): click to select, drag to move, handles to resize. */
.plan-obstacle rect[data-obstacle-drag="move"] { fill: rgba(148, 163, 184, .22); stroke: #9babc0; stroke-width: 1.5; vector-effect: non-scaling-stroke; cursor: move; }
.plan-obstacle:hover rect[data-obstacle-drag="move"] { fill: rgba(148, 163, 184, .32); stroke: #cbd5e1; }
.plan-obstacle.selected rect[data-obstacle-drag="move"] { fill: rgba(255, 107, 53, .16); stroke: var(--orange); stroke-width: 2; }
.plan-obstacle.overlapping rect[data-obstacle-drag="move"] { fill: rgba(239, 68, 68, .22); stroke: #ef4444; stroke-dasharray: 5 3; }
.obstacle-shapes .obstacle-handle { fill: #0d131d; stroke: var(--orange); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.obstacle-shapes .obstacle-handle:hover { fill: var(--orange); }
.obstacle-dim { fill: #fbd5c5; font-size: 12px; font-weight: 700; text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: #070b12; stroke-width: 3px; }
.obstacle-pos { fill: #aebacc; font-weight: 600; font-size: 11px; }
#roomSvg.dragging-obstacle, #roomSvg.dragging-obstacle * { cursor: grabbing !important; }
.obstacle-row.selected { border-color: rgba(255, 107, 53, .6); box-shadow: 0 0 0 1px rgba(255, 107, 53, .25); }

/* Obstacles in the 3D view (view3d_obstacles.js): click selects, drag moves, face handles push/pull. */
#room3d .obstacle-face3d { fill: rgba(148, 163, 184, .10); stroke: none; cursor: pointer; }
#room3d .obstacle-face3d.zmax { fill: rgba(148, 163, 184, .18); }
#room3d .obstacle3d-group:hover .obstacle-face3d { fill: rgba(148, 163, 184, .24); }
#room3d .obstacle3d-group.selected .obstacle-face3d { fill: rgba(255, 107, 53, .12); cursor: move; }
#room3d .obstacle3d-group.selected .obstacle-face3d.zmax { fill: rgba(255, 107, 53, .2); }
#room3d .obstacle3d-group.selected .obstacle3d { stroke: var(--orange); }
#room3d .obstacle3d-group.overlapping .obstacle-face3d { fill: rgba(239, 68, 68, .2); }
#room3d .obstacle3d-group.overlapping .obstacle3d { stroke: #ef4444; stroke-dasharray: 5 3; }
#room3d .face-handle3d { cursor: grab; }
#room3d .face-dot3d { fill: #0d131d; stroke: var(--orange); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
#room3d .face-arrow3d { stroke: var(--orange); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: none; }
#room3d .face-handle3d:hover .face-dot3d { fill: var(--orange); }
#room3d .obstacle-dim { pointer-events: none; }

/* Room shape picker (room_shape.js). */
.room-shape-editor { margin-top: 12px; }
.shape-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-top: 8px; }
.shape-picker label { display: block; margin: 0; }
.shape-picker input { position: absolute; opacity: 0; pointer-events: none; }
.shape-picker span { display: grid; justify-items: center; gap: 4px; padding: 7px 2px 6px; border: 1px solid var(--line); border-radius: 7px; background: #090e16; color: #8190a5; cursor: pointer; }
.shape-picker svg { width: 22px; height: 15px; fill: rgba(148,163,184,.12); stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }
.shape-picker b { font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.shape-picker span:hover { color: #dbe5f2; border-color: #44516a; }
.shape-picker input:checked + span { color: #fff; border-color: rgba(255,107,53,.6); background: var(--orange-soft); }
.shape-picker input:checked + span svg { fill: rgba(255,107,53,.25); stroke: var(--orange); }
.shape-picker input:focus-visible + span { outline: 2px solid rgba(255,107,53,.6); outline-offset: 1px; }
#shapeParams { margin-top: 8px; }
#shapeParams label[hidden] { display: none; }
.room-shape-outline { stroke-linejoin: round; }

/* Single / multiple sources (sources.js). */
.point-section .section-title { justify-content: flex-start; }
.source-mode { margin-left: auto; }
.source-mode span { padding: 4px 10px; font-size: 11px; }
.multi-source-panel { margin-top: 12px; }
.multi-source-panel .obstacle-head .ghost-button { margin-left: auto; text-transform: none; letter-spacing: 0; }
.control-panel .map-source-list .obstacle-fields { grid-template-columns: repeat(3, 1fr); }
.extra-source-glyph { cursor: grab; }
.extra-source-glyph .halo { fill: var(--orange); fill-opacity: .08; stroke: var(--orange); stroke-opacity: .7; stroke-width: 1.5; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; pointer-events: all; }
.extra-source-glyph .point { fill: var(--orange); stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.extra-source-glyph text { text-anchor: middle; fill: #fbd5c5; font-size: 12px; font-weight: 800; pointer-events: none; }
.extra-source-glyph .coordinate { fill: #8292a8; font-size: 10px; font-weight: 600; }
.extra-source-glyph:hover .halo { fill-opacity: .2; stroke-opacity: 1; }
#room3d .extra-source3d .halo3d { fill-opacity: .1; stroke-dasharray: 3 3; }
.section-title .source-mode span { display: block; width: auto; height: auto; place-items: initial; padding: 4px 10px; border-radius: 5px; background: transparent; color: #8190a5; font: 700 11px/1.2 inherit; font-family: inherit; white-space: nowrap; }
.section-title .source-mode input:checked + span { background: #202c3d; color: #fff; }

/* Section 05 opens and closes as a whole. */
.section-fold { width: 100%; margin-bottom: 0; padding: 0; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.section-fold .chevron { margin-left: auto; }
.section-fold[aria-expanded="true"] { margin-bottom: 12px; }
.section-fold:hover h3 { color: #fff; }

/* Surface rows fold (surfaces.js). */
.surface-fold { width: 100%; display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.surface-fold .chevron { margin-left: 0; }
.surface-fold strong { color: #dbe5f2; font-size: 13px; white-space: nowrap; }
.surface-summary { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.surface-control.collapsed .surface-body { display: none; }
.surface-body { margin-top: 10px; }
.surface-body-head { display: flex; gap: 8px; align-items: center; }
.surface-body-head select { flex: 1; min-width: 0; margin-top: 0 !important; }
.surface-controls { display: grid; gap: 6px; }

/* Obstacle rows: name, own absorption, reorder grip. */
.obstacle-grip { flex: none; margin-right: 4px; padding: 2px 3px; color: #56657a; font-size: 12px; letter-spacing: -2px; cursor: grab; user-select: none; }
.obstacle-grip:hover { color: #dbe5f2; }
.obstacle-row.dragging-row { opacity: .45; }
.obstacle-row.drop-before { box-shadow: 0 -2px 0 var(--orange); }
.obstacle-row.drop-after { box-shadow: 0 2px 0 var(--orange); }
.obstacle-name-label { display: grid; gap: 3px; margin-bottom: 6px; color: var(--muted); font-size: 9px; }
.obstacle-name-label input { width: 100%; padding: 5px 7px; font-size: 12px; }
.obstacle-material-label { display: grid; gap: 6px; }
.obstacle-material-label .absorption-band-grid, .obstacle-material-label .custom-absorption-grid { margin-top: 2px; }
.obstacle-row select.obstacle-material { margin-top: 0; }

/* Push / pull walls (room_edges.js). The L / W lines stay as dimensions only. */
#roomSvg #roomHandles { pointer-events: none; }
#roomSvg #roomHandles .handle3d { display: none; }
.room-edge-line { stroke: transparent; stroke-width: 2.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.room-edge-hit { stroke: transparent; stroke-width: 16; pointer-events: stroke; }
.room-edge-grip { fill: #0d131d; stroke: #607086; stroke-width: 1.4; vector-effect: non-scaling-stroke; opacity: .75; }
.room-edge:hover .room-edge-line, .room-edge.active .room-edge-line { stroke: var(--orange); }
.room-edge:hover .room-edge-grip, .room-edge.active .room-edge-grip { stroke: var(--orange); fill: var(--orange); opacity: 1; }
#room3d .wall-handle3d { cursor: grab; }
#room3d .wall-dot3d { fill: #0d131d; stroke: #8ab4ff; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
#room3d .wall-arrow3d { stroke: #8ab4ff; stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: none; }
#room3d .wall-handle3d:hover .wall-dot3d, #room3d .wall-handle3d.active .wall-dot3d { fill: #8ab4ff; }
.geometry-switch label span, .section-title .source-mode span { white-space: nowrap; }
.geometry-switch .tier-chip, .source-mode .tier-chip { margin-left: 5px; line-height: 14px; font-size: 9px; }
.section-title .source-mode span.tier-chip { display: inline-block; margin-left: 5px; padding: 0 5px; border: 1px solid rgba(250,204,21,.55); border-radius: 999px; background: #1d1a0c; color: #fde68a; font-size: 9px; font-weight: 800; line-height: 14px; }

/* G is a Pro result: its band-table column blurs below Pro, like the G card. */
body[data-tier="trial"] .metrics-table .g-cell { filter: blur(5px); user-select: none; }

/* Band table: chosen parameters as chips, more added on demand (results.js). */
.column-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 10px; }
.column-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid rgba(255,107,53,.5); border-radius: 999px; background: var(--orange-soft); color: #ffd2bf; font-size: 12px; font-weight: 700; cursor: pointer; }
.column-chip span { color: #ff9a73; font-size: 13px; line-height: 1; }
.column-chip:hover { border-color: var(--orange); }
.column-add { width: auto; padding: 4px 26px 4px 10px; border: 1px dashed #44516a; border-radius: 999px; background-color: transparent; color: #aebacc; font-size: 12px; font-weight: 700; cursor: pointer; }
.metrics-table [data-col][hidden] { display: none; }

/* Push / pull arrows (room_edges.js): plan double arrows across each wall, 3D outward arrows. */
.room-edge-arrow { fill: #607086; stroke: #0d131d; stroke-width: 1; vector-effect: non-scaling-stroke; opacity: .85; }
.room-edge:hover .room-edge-arrow, .room-edge.active .room-edge-arrow { fill: var(--orange); opacity: 1; }
#room3d .wall-hit3d { fill: transparent; pointer-events: all; }
#room3d .wall-arrow3d { fill: #8ab4ff; stroke: #0d131d; stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
#room3d .wall-handle3d:hover .wall-arrow3d, #room3d .wall-handle3d.active .wall-arrow3d { fill: #c7dbff; }
#room3d .wall-handle3d.ceiling .wall-arrow3d { fill: #8ab4ff; }

/* Obstacle title bar: the name is an inline field; transmission sits at the bottom. */
.obstacle-row-head .obstacle-fold { flex: none; width: 18px; justify-content: center; }
.obstacle-name { flex: 1; min-width: 0; margin: 0 6px 0 2px; padding: 2px 4px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--text); font-size: 14px; font-weight: 800; }
.obstacle-name::placeholder { color: var(--text); opacity: 1; }
.obstacle-name:hover { border-color: #304059; }
.obstacle-name:focus { border-color: var(--orange); background: #090e16; outline: none; }
.obstacle-name:focus::placeholder { color: var(--muted); }
.obstacle-size { cursor: pointer; }
.obstacle-transmission { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.obstacle-transmission label { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 11px; }
.obstacle-transmission > label:not(.transmit-toggle) { flex: 1; justify-content: flex-end; }
.obstacle-transmission input[type="number"] { width: 6.5em; flex: none; margin: 0; padding: 5px 7px; font-size: 12px; }
.obstacle-transmission input[type="checkbox"] { width: auto; margin: 0; }

/* Every section (01-05) opens and closes from its title (panels.js). */
.section-title .section-chevron { flex: none; margin-left: 10px; padding: 4px; border: 0; background: transparent; cursor: pointer; }
.section-title .source-mode + .section-chevron { margin-left: 8px; }
.section-title:not(:has(.source-mode)) .section-chevron { margin-left: auto; }
.section-title h3 { cursor: pointer; }
.control-section.section-closed > .section-title { margin-bottom: 0; }
.obstacle-list > .obstacle-row { min-width: 0; }
.obstacle-row-head .obstacle-name { width: 0; flex: 1 1 auto; }
.chevron { display: inline-block; vertical-align: middle; }

/* Obstacle handles: arrows on edges / faces, squares at plan corners. */
.obstacle-shapes .obstacle-handle-hit { fill: transparent; pointer-events: all; }
.obstacle-shapes .obstacle-handle-arrow { fill: var(--orange); stroke: #0d131d; stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.obstacle-shapes g[data-obstacle-drag]:hover .obstacle-handle-arrow { fill: #ffb08f; }
#room3d .face-hit3d { fill: transparent; pointer-events: all; }
#room3d .face-arrow3d { fill: var(--orange); stroke: #0d131d; stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
#room3d .face-handle3d:hover .face-arrow3d { fill: #ffb08f; }

/* 3D view: reset button. */
#pane3d { position: relative; }
.view-reset { position: absolute; top: 10px; right: 10px; z-index: 4; padding: 5px 10px; border: 1px solid var(--line); border-radius: 7px; background: rgba(9,14,22,.85); color: #aebacc; font-size: 11px; font-weight: 700; cursor: pointer; }
.view-reset:hover { color: #fff; border-color: #44516a; }
.speaker-polar3d { fill: rgba(255,107,53,.12); stroke: var(--orange); stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.speaker-axis3d { stroke: var(--orange); stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; pointer-events: none; }
#sourceChannelField.replaced { opacity: .45; }
.speaker-switch { margin-top: 10px; }

/* The surface being set (surfaces.js): marked in the plan and in 3D. */
.surface-mark-line { stroke: #fde68a; stroke-width: 6; stroke-linecap: round; opacity: .85; vector-effect: non-scaling-stroke; pointer-events: none; filter: drop-shadow(0 0 6px rgba(253,230,138,.6)); }
.surface-mark-fill { fill: rgba(253,230,138,.16); stroke: #fde68a; stroke-width: 2; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.surface-mark3d { fill: rgba(253,230,138,.22); stroke: #fde68a; stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; }
.surface-control:hover, .surface-control:focus-within { border-color: rgba(253,230,138,.45); }

/* Convolution audition: a key feature, right after the charts and set apart. */
.convolution-card.featured-audition { position: relative; margin-top: 10px; padding: 20px 20px 18px; border: 1px solid rgba(34,211,238,.45); background: linear-gradient(135deg, rgba(34,211,238,.10), rgba(255,107,53,.06) 60%, var(--panel-2)); box-shadow: 0 0 0 1px rgba(34,211,238,.08), 0 18px 40px rgba(0,0,0,.25); }
.featured-audition .card-title h3 { font-size: 17px; }
.featured-audition .eyebrow { color: #67e8f9; }
.audition-lead { margin: 2px 0 6px; color: #b7f3fb; font-size: 12px; }
.featured-audition .audio-file-button { border-color: rgba(34,211,238,.5); background: rgba(34,211,238,.12); color: #e0fbff; }
.featured-audition #convolveButton:not(:disabled) { border-color: var(--cyan); background: var(--cyan); color: #04161a; }

/* Section 05 title: obstacle count next to the title. */
.section-title .section-summary { margin-left: 8px; color: var(--muted); font-size: 11px; font-weight: 600; }

/* Ray count row: looks adjustable without shouting. */
.fold-card:has(#calcSummary) > .fold-head .fold-toggle { border-radius: 8px; }
#calcSummary { padding: 2px 9px; border: 1px dashed #3a4a62; border-radius: 999px; color: #aebacc; }
.fold-card:has(#calcSummary) > .fold-head:hover #calcSummary { border-style: solid; border-color: #607086; color: #e2e8f0; }
.fold-card:has(#calcSummary) > .fold-head:hover { background: rgba(148,163,184,.05); }
.section-title span.section-summary { display: inline; width: auto; height: auto; place-items: initial; border-radius: 0; background: transparent; color: var(--muted); font: 600 11px/1.2 inherit; font-family: inherit; white-space: nowrap; }
.section-title .tier-chip { display: inline-block; width: auto; height: auto; border-radius: 999px; font-family: inherit; }
.region-heights { margin-top: 10px; display: grid; gap: 8px; }
.region-heights label[hidden] { display: none; }
/* Trial: typed-in absorption is a Basic feature (tiers.js). */
body[data-tier="trial"] .custom-absorption-button::after { content: 'Basic'; display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid rgba(96,165,250,.55); border-radius: 999px; background: #0f1a2b; color: #a9cbff; font-size: 9px; font-weight: 800; line-height: 14px; }

/* Clearer section dividers. */
.control-panel .control-section { border-bottom: 1px solid #2a3850; padding-top: 16px; padding-bottom: 16px; }
.control-panel .control-section + .control-section { box-shadow: inset 0 1px 0 rgba(255,255,255,.02); }

/* Source: single / multiple inside the section, full width. */
.point-section .source-mode { display: flex; width: 100%; margin: 0 0 10px; }
.point-section .source-mode label { flex: 1; }
.point-section .source-mode span { display: block; text-align: center; white-space: nowrap; }
.point-section .source-mode span.tier-chip { display: inline-block; }

/* Scattering per surface: the same card rows as absorption. */
.scatter-grid { display: grid; gap: 6px; }
.scatter-grid label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: #0a1018; color: #dbe5f2; font-size: 13px; font-weight: 700; }
.scatter-grid label input { width: 86px; flex: none; margin: 0; }

/* One look for every Basic / Pro tag. */
.tier-chip, .section-title .tier-chip, .section-title span.tier-chip { padding: 0 6px; border: 1px solid rgba(96,165,250,.55); border-radius: 999px; background: #0f1a2b; color: #a9cbff; font-size: 10px; font-weight: 800; line-height: 16px; }
.tier-chip-pro, .section-title .tier-chip-pro, .section-title span.tier-chip-pro { border-color: rgba(250,204,21,.55); background: #1d1a0c; color: #fde68a; }
.shape-picker .tier-tag::after { font-size: 10px; line-height: 14px; }
.scatter-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; color: var(--muted); font-size: 12px; }
.scatter-field input { width: 96px; flex: none; margin: 0; }

/* ---- Polish ------------------------------------------------------------------ */

/* Source cards: framed like obstacles, name edited in the title bar. */
.source-card { padding: 0; border: 0; background: transparent; }
#mainSourceCard.multi, .map-source-list .source-card { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.source-card-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.source-name { flex: 1 1 auto; width: 0; min-width: 0; padding: 4px 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); font-size: 14px; font-weight: 800; }
.source-name::placeholder { color: #8fa0b8; opacity: 1; }
.source-name:hover { border-color: #304059; }
.source-name:focus { border-color: var(--orange); background: #090e16; outline: none; }
.source-card .speaker-switch { margin: 8px 0 0; }
.source-card .speaker-fields { margin-top: 8px; }
.multi-source-panel .obstacle-head { margin: 12px 0 8px; }

/* Results: one rhythm for every card. */
.results > .result-content > * + * { margin-top: 12px; }
.metric-grid article, .chart-card, .metrics-table-card, .map-card, .result-footer, .report-row, .convolution-card { border-radius: 12px; }
.metric-grid article { transition: border-color .15s ease; }
.metric-grid article:hover { border-color: #3a4a62; }

/* Calmer focus ring everywhere. */
.control-panel input:focus-visible, .control-panel select:focus-visible { outline: 2px solid rgba(255,107,53,.5); outline-offset: 1px; }

/* Settings panel: heading, scrolling settings, and a bottom bar with Run that never
   covers the settings. */
@media (min-width: 901px) {
  .control-panel { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
  .control-panel > #simulationForm { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -16px; padding: 0 16px 12px; scrollbar-gutter: stable; }
  .panel-actions { flex: none; margin: 0 -16px; padding: 12px 16px 14px; border-top: 1px solid #2a3850; background: var(--panel); box-shadow: 0 -12px 24px rgba(0,0,0,.25); }
}
.panel-actions .form-error:empty { display: none; }
.panel-actions .form-error { margin: 8px 0 0; }
.panel-actions .copyright { margin: 8px 0 0; }

/* ---- Viewports, SketchUp / Rhino style ---------------------------------------- */
/* Axis colours: X red, Y green, Z blue. */
:root { --axis-x: #e5484d; --axis-y: #46c46e; --axis-z: #4c8dff; }
.axis3d.axis-x, #roomSvg .axis3d.axis-x { stroke: var(--axis-x) !important; }
.axis3d.axis-y, #roomSvg .axis3d.axis-y { stroke: var(--axis-y) !important; }
.axis3d.axis-z { stroke: var(--axis-z) !important; }
.dim3d.axis-x { fill: #ff8a8d !important; } .dim3d.axis-y { fill: #86e3a5 !important; } .dim3d.axis-z { fill: #9fc1ff !important; }
/* Viewport title and tools in each pane's top-left corner. */
.view-pane { position: relative; }
.viewport-bar { position: absolute; top: 8px; left: 10px; right: 10px; z-index: 4; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.viewport-label { padding: 2px 8px; border: 1px solid #2a3850; border-radius: 5px; background: rgba(9,14,22,.82); color: #cbd5e1; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.viewport-tools { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; padding: 2px; border: 1px solid #2a3850; border-radius: 7px; background: rgba(9,14,22,.82); pointer-events: auto; }
.viewport-tools button { padding: 4px 9px; border: 0; border-radius: 5px; background: transparent; color: #9aa8bb; font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.viewport-tools button:hover { color: #fff; background: rgba(148,163,184,.12); }
.viewport-tools button[aria-pressed="true"] { color: #fff; background: #25344a; }
.viewport-tools .tool-sep { width: 1px; height: 16px; margin: 0 3px; background: #2a3850; }
.viewport-tools .view-reset { position: static; padding: 4px 9px; border: 0; background: transparent; }
#room3d.panning, #room3d.panning * { cursor: grabbing !important; }
/* Status strip under the views (Rhino command line / SketchUp status bar). */
.viewport-status { display: grid; grid-template-columns: minmax(150px, auto) 1fr auto; align-items: center; gap: 14px; margin-top: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: #0a1018; color: #94a3b8; font-size: 11px; min-height: 30px; }
.status-coords { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #cbd5e1; font-variant-numeric: tabular-nums; }
.status-hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-measure { padding: 2px 9px; border: 1px solid transparent; border-radius: 5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; color: #ffd2bf; white-space: nowrap; }
.status-measure:not(:empty) { border-color: rgba(255,107,53,.45); background: rgba(255,107,53,.08); }
@media (max-width: 900px) { .viewport-status { grid-template-columns: 1fr; } .viewport-tools button { padding: 4px 6px; } }
.viewport-bar { flex-wrap: wrap; row-gap: 6px; }
.viewport-label { white-space: nowrap; }
.viewport-tools { flex-wrap: nowrap; }
.viewport-tools .tool-icon { min-width: 26px; padding: 2px 7px; font-size: 14px; line-height: 18px; }

/* ---- Hover feedback on everything that can be dragged -------------------------- */
.room-edge-arrow, #room3d .wall-arrow3d, #room3d .face-arrow3d, .obstacle-shapes .obstacle-handle-arrow { transform-box: fill-box; transform-origin: center; transition: transform .12s ease, fill .12s ease, filter .12s ease; }
.room-edge:hover .room-edge-arrow, .room-edge.active .room-edge-arrow { transform: scale(1.35); filter: drop-shadow(0 0 5px rgba(255,107,53,.7)); }
.room-edge:hover .room-edge-line { stroke-width: 3.5; }
#room3d .wall-handle3d:hover .wall-arrow3d, #room3d .wall-handle3d.active .wall-arrow3d { transform: scale(1.4); fill: #fff; filter: drop-shadow(0 0 6px rgba(138,180,255,.9)); }
#room3d .face-handle3d:hover .face-arrow3d { transform: scale(1.4); filter: drop-shadow(0 0 6px rgba(255,107,53,.8)); }
.obstacle-shapes g[data-obstacle-drag]:hover .obstacle-handle-arrow { transform: scale(1.35); }
.obstacle-shapes .obstacle-handle:hover { fill: var(--orange); }
#room3d .wall-handle3d, #room3d .face-handle3d { cursor: grab; }
#room3d .obstacle3d-group .obstacle-face3d { transition: fill .12s ease; }
.point-glyph, .extra-source-glyph, #room3d .point3d { transition: filter .12s ease; }
.point-glyph:hover, .extra-source-glyph:hover, #room3d .point3d:hover { filter: drop-shadow(0 0 8px rgba(255,255,255,.35)); cursor: grab; }
/* The coordinates of a selected / hovered object read brighter than the cursor's. */
.status-coords.object { color: #fde68a; }
#room3d .room3d-highlight { pointer-events: none; }
#roomSvg #roomHandles, #roomSvg #roomHandles * { pointer-events: none !important; }   /* dimensions only; the wall arrows move the walls */

/* ---- Final polish ---------------------------------------------------------------- */
/* Info tips stay quiet until needed. */
.info-tip { opacity: .55; transition: opacity .15s ease, border-color .15s ease, color .15s ease; }
.info-tip:hover, .info-tip:focus-visible { opacity: 1; border-color: #8fa0b8; color: #e2e8f0; }
/* One look for inputs and selects: subtle border, clear hover and focus. */
.control-panel input[type="number"], .control-panel input[type="text"], .control-panel select { transition: border-color .15s ease, background-color .15s ease; }
.control-panel input[type="number"]:hover, .control-panel select:hover { border-color: #3a4a62; }
.control-panel input[type="number"]:focus, .control-panel select:focus { border-color: var(--orange); }
/* Secondary buttons: same height and hover everywhere. */
.ghost-button, .obstacle-presets .ghost-button, .multi-source-panel .ghost-button { transition: border-color .15s ease, color .15s ease, background-color .15s ease; }
.ghost-button:hover { background: rgba(148,163,184,.06); }
/* Dark, slim scrollbars. */
* { scrollbar-width: thin; scrollbar-color: #2a3850 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2a3850; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #3a4a62; }
::-webkit-scrollbar-track { background: transparent; }
/* Empty results: a calm card that says what to do next. */
.empty-state { border: 1px dashed #2a3850; border-radius: 12px; background: linear-gradient(180deg, rgba(17,25,37,.6), rgba(10,16,24,.6)); }
.empty-state p { color: #94a3b8; }
/* Section titles a touch stronger; numbers in the brand colour. */
.control-panel .section-title h3 { letter-spacing: .01em; }
.control-panel .control-section:hover > .section-title .section-chevron .chevron { border-color: #cbd5e1; }
/* Header: a little more air between the status, edition and language. */
.topbar .header-status { margin-right: 4px; }

/* ---- Accounts (auth.js): sign-in gate, account button and dialog ---------------- */
.edition-chip { cursor: default; }
body[data-accounts="1"] .edition-chip { cursor: pointer; }
.account-button { display: inline-flex; align-items: center; gap: 7px; max-width: 220px; margin-left: 10px; padding: 5px 11px 5px 7px; border: 1px solid var(--line); border-radius: 999px; background: #0b111a; color: #c5d0df; font-size: 12px; font-weight: 650; cursor: pointer; }
.account-button:hover { border-color: #3a4a62; color: #fff; }
.account-button i { flex: none; width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, var(--orange), #ffb38a); }
.account-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.auth-open .workspace { filter: blur(3px); pointer-events: none; user-select: none; }
.auth-gate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(3,6,10,.72); backdrop-filter: blur(6px); overflow-y: auto; }
.auth-card { width: min(400px, 100%); padding: 24px 24px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.auth-top { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-top .brand-name { margin: 0; font-size: 19px; }
.auth-lang { margin-left: auto; transform: scale(.9); transform-origin: right center; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin-bottom: 16px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #090e16; }
.auth-tabs button { padding: 8px 6px; border: 0; border-radius: 6px; background: transparent; color: #8190a5; font-size: 13px; font-weight: 700; }
.auth-tabs button[aria-pressed="true"] { background: var(--orange-soft); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,107,53,.55); }
.auth-form, .account-form { display: grid; gap: 11px; }
.auth-lead { margin: 0 0 3px; color: #aebacc; font-size: 13px; line-height: 1.5; }
.auth-form label, .account-form label { display: grid; gap: 5px; color: #9babc0; font-size: 12px; font-weight: 650; }
.auth-form input, .account-form input { width: 100%; padding: 10px 11px; border: 1px solid #2b3a52; border-radius: 7px; background: #090e16; color: var(--text); font-size: 14px; }
.auth-form input:focus, .account-form input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.auth-submit, .account-form button { padding: 10px 14px; border: 0; border-radius: 7px; background: var(--orange); color: #160b06; font-size: 14px; font-weight: 800; }
.auth-submit:disabled, .account-form button:disabled { opacity: .55; cursor: wait; }
.auth-status { min-height: 0; margin: 0; color: #b8f3c9; font-size: 13px; line-height: 1.5; }
.auth-status:empty { display: none; }
.auth-status.error { color: #ff9b85; }
.auth-link { justify-self: start; color: #8fb8ff; font-size: 12px; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
.account-dialog { width: min(420px, calc(100vw - 32px)); padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.account-dialog::backdrop { background: rgba(3,6,10,.6); backdrop-filter: blur(2px); }
.account-head { display: flex; align-items: center; justify-content: space-between; }
.account-head h3 { margin: 0; font-size: 16px; }
.account-email { margin: 10px 0 2px; font-size: 14px; font-weight: 700; word-break: break-all; }
.account-edition { margin: 0 0 16px; color: #9babc0; font-size: 13px; }
.account-edition strong { color: #ffd2bf; }
.account-form input[name="code"] { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; }
.account-password { margin-top: 16px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.account-password summary { color: #c5d0df; font-size: 13px; font-weight: 700; cursor: pointer; }
.account-password .account-form { margin-top: 11px; }
.account-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 18px; }
.account-actions .ghost-button { text-decoration: none; font-size: 12px; }
.account-actions .secondary, .upgrade-actions .secondary { padding: 8px 14px; border: 1px solid #304059; border-radius: 7px; background: transparent; color: #c5d0df; font-weight: 700; }
.upgrade-dialog form.upgrade-actions { gap: 10px; }
.account-notice { position: fixed; top: 90px; left: 50%; z-index: 40; transform: translateX(-50%); padding: 10px 16px; border: 1px solid rgba(184,243,75,.45); border-radius: 9px; background: #101a0c; color: #dff7b8; font-size: 13px; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
@media (max-width: 900px) { .account-button { max-width: 120px; margin-left: 6px; } }

/* Audition rows (audio.js): built-in samples for every edition, own audio from Basic. */
.convolution-controls .audio-row-label { flex: none; width: 116px; color: #9babc0; font-size: 12px; font-weight: 700; overflow: visible; }
.sample-controls select { min-width: 0; flex: 1 1 auto; max-width: 260px; padding: 9px 10px; border: 1px solid #304059; border-radius: 7px; background: #0b111a; color: #dbe5f2; font-size: 12px; }
.own-audio-controls { margin-top: 10px; }
.local-convolution-note { margin: 8px 0 0; color: #6f7e93; font-size: 11px; }
body[data-tier="trial"] .local-convolution-note { display: none; }
@media (max-width: 900px) { .convolution-controls { flex-wrap: wrap; } .convolution-controls .audio-row-label { width: 100%; } }

/* ---- Loading cover (boot.js): until the page is fully drawn -------------------- */
.app-loader { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: var(--bg); transition: opacity .35s ease, visibility .35s; }
.app-loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.app-loader-mark { transform: scale(1.35); margin-bottom: 8px; }
.app-loader-mark span { animation: loader-bar 1.1s ease-in-out infinite; transform-origin: center bottom; }
.app-loader-mark span:nth-child(2) { animation-delay: .15s; }
.app-loader-mark span:nth-child(3) { animation-delay: .3s; }
@keyframes loader-bar { 0%, 100% { transform: scaleY(.55); opacity: .6; } 50% { transform: scaleY(1); opacity: 1; } }
.app-loader-name { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.app-loader-name span { margin-left: 4px; color: var(--muted); font-size: 13px; font-weight: 700; }
.app-loader-text { min-height: 18px; margin: 0; color: var(--muted); font-size: 13px; text-align: center; max-width: min(420px, calc(100vw - 32px)); }
.app-loader.failed .app-loader-text { color: #ff9b85; }
.app-loader.failed .app-loader-mark span { animation: none; }
.app-loader button { margin-top: 6px; padding: 8px 16px; border: 0; border-radius: 7px; background: var(--orange); color: #160b06; font-weight: 800; cursor: pointer; }
body.app-loading { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .app-loader-mark span { animation: none; } .app-loader { transition: none; } }

/* ---- Edition tags: one look everywhere (tiers.js) ------------------------------
   Basic is blue, Pro is yellow, whatever the tag sits in (a selected segment, a
   section title, a switch); context rules above must not restyle them. */
span.tier-chip { display: inline-flex !important; align-items: center; flex: none; width: auto !important; height: 16px !important; margin: 0 0 0 6px !important; padding: 0 6px !important; border: 1px solid rgba(96,165,250,.55) !important; border-radius: 999px !important; background: #0f1a2b !important; color: #a9cbff !important; font-family: inherit !important; font-size: 10px !important; font-weight: 800 !important; line-height: 1 !important; letter-spacing: .03em; text-transform: none !important; vertical-align: middle; white-space: nowrap; box-shadow: none !important; float: none !important; }
span.tier-chip-pro { border-color: rgba(250,204,21,.55) !important; background: #1d1a0c !important; color: #fde68a !important; }

/* Single / Multiple sources: both labels centred on one line, the unselected one readable. */
.point-section .source-mode span:not(.tier-chip) { display: flex; align-items: center; justify-content: center; min-height: 30px; padding: 0 10px; }
.point-section .source-mode input:not(:checked) + span { color: #aab6c7; }

/* Visitors (auth.js): sign in / create account in the top bar; the sign-in card closes. */
.guest-buttons { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; }
.guest-buttons button { padding: 6px 12px; border-radius: 7px; font-size: 12px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.guest-sign-in { border: 1px solid var(--line); background: transparent; color: #dbe5f2; }
.guest-sign-in:hover { border-color: #3a4a62; color: #fff; }
.guest-register { border: 1px solid var(--orange); background: var(--orange); color: #160b06; }
.auth-top { position: relative; }
.auth-close { flex: none; width: 30px; height: 30px; margin-left: 6px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: #9babc0; font-size: 18px; line-height: 1; cursor: pointer; }
.auth-close:hover { color: #fff; border-color: #3a4a62; }
.auth-lang { margin-left: auto; }
.auth-needed { margin: -6px 0 14px; padding: 9px 11px; border: 1px solid rgba(255,107,53,.4); border-radius: 8px; background: var(--orange-soft); color: #ffd2bf; font-size: 13px; line-height: 1.5; }
@media (max-width: 900px) { .guest-buttons { margin-left: 6px; } .guest-buttons button { padding: 5px 8px; } }

/* Upgrade dialog: the activation code is a quiet link, OK stays the one button. */
.upgrade-dialog form.upgrade-actions { align-items: center; justify-content: space-between; }
.upgrade-dialog form.upgrade-actions:has(.upgrade-code-link[hidden]) { justify-content: flex-end; }
.upgrade-code-link { color: #7f8ea3; font-size: 12px; text-decoration: none; }
.upgrade-code-link:hover { color: #c5d0df; text-decoration: underline; }
.reset-dialog form.upgrade-actions { justify-content: flex-end; gap: 10px; }
.reset-cancel { padding: 8px 14px; border: 1px solid #304059; border-radius: 7px; background: transparent; color: #c5d0df; font-weight: 700; cursor: pointer; }

/* Per-surface scattering (Basic): a caption that carries the tag. */
.surface-scatter-block { margin-top: 6px; }
.surface-scatter-caption { display: flex; align-items: center; margin: 0 0 6px; color: #9babc0; font-size: 12px; font-weight: 700; }

/* Listening level: true level / matched to the dry peak. */
.audition-level { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.audition-level .segmented span { padding: 5px 12px; }
.audition-level .audio-row-label { width: 116px; flex: none; color: #9babc0; font-size: 12px; font-weight: 700; }
@media (max-width: 900px) { .audition-level { flex-wrap: wrap; } .audition-level .audio-row-label { width: 100%; } }
/* The close button sits in the card's corner so the header keeps one line. */
.auth-card { position: relative; }
.auth-card .auth-close { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; margin: 0; font-size: 16px; }
.auth-top { padding-right: 34px; }
.auth-top .brand-name, .auth-top .product-tag, .auth-lang button { white-space: nowrap; }
.source-level-note { margin: 8px 0 -2px; color: #7f8ea3; font-size: 11px; }
/* Extra sources: the (i) on "Level dB" stays on the label's line, so both inputs line up. */
.map-source-list .source-level label { white-space: nowrap; }
.map-source-list .source-level .info-tip { display: inline-grid; vertical-align: -2px; margin: 0 0 0 4px; }
/* Design report: printed from an off-screen frame (result_view.js printReport). */
.report-print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; opacity: 0; pointer-events: none; }
.map-source-list .source-level { align-items: end; }
.map-source-list .source-level .info-tip { width: 13px; height: 13px; margin-top: -2px; margin-bottom: -2px; font-size: 8.5px; }

/* ---- Sign-in card, final layout: brand left, close right; language at the foot. ---- */
.auth-top { display: flex; align-items: center; gap: 10px; padding-right: 0; margin-bottom: 18px; }
.auth-top .brand-name { flex: 1; min-width: 0; }
.auth-card .auth-close { position: static; display: grid; place-items: center; flex: none; width: 32px; height: 32px; margin: 0; padding: 0; font-size: 18px; line-height: 1; }
.auth-foot { display: flex; justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.auth-foot .auth-lang { margin: 0; transform: none; }
.auth-foot .lang-switch button { padding: 4px 9px; font-size: 11px; }

/* ---- Alignment pass (2026-11-10) ---------------------------------------------- */
/* The unit rule (label > span floats right, e.g. "m") must not shrink the shape tiles. */
.shape-picker label > span { float: none; width: 100%; box-sizing: border-box; color: #8190a5; font-weight: inherit; }
.shape-picker input:checked + span { color: #fff; }
.shape-picker { gap: 6px; margin-top: 10px; padding-top: 6px; }
/* Panel title and Reset share a centre line. */
.panel-heading { align-items: center; }
/* Audition rows: both action buttons in one column with the same width. */
.convolution-controls button { min-width: 132px; }
/* Computing actions are orange everywhere (run, listen, map, probes); downloads stay cyan. */
.map-run { border-color: var(--orange); background: var(--orange); color: #160b06; font-weight: 750; }
.map-run:hover:not(:disabled) { filter: brightness(1.06); }
