
/* High-contrast dark mode — UI only; calculation logic and report print styling are unchanged. */
:root{
  --bg:#0b1220;--panel:#111a2b;--line:#2b3a52;--text:#eef4ff;--muted:#9eacc2;
  --accent:#62a0ff;--accent-dark:#3b7ddd;--accent2:#1b3152;--warn:#f4b860;--danger:#ff7b72;--ok:#52d6a0;
  --ribbon:#0f1828;--shadow:0 12px 30px rgba(0,0,0,.42);--shadow-sm:0 3px 9px rgba(0,0,0,.30);
}
html,body{background:var(--bg);color:var(--text);color-scheme:dark}
.titlebar{background:linear-gradient(180deg,#111d35,#09111f);border-bottom-color:#263650}
.titlebar .brand span{color:#aab9d2}.titlebar .file{color:#d2def1;background:rgba(255,255,255,.09)}
.ribbon,.tabs,.tools,.tools.tools-active{background:var(--ribbon);border-color:var(--line)}
.tab{color:#aab6ca}.tab:hover{color:var(--accent)}.tab.active{background:var(--panel);color:var(--accent);box-shadow:0 -1px 0 var(--line) inset}
.tool,.item,.panel,.bottom,.dialog,.template-card,.secondary,.field input,.field select,.field textarea,.struct-item,.struct-item input,.search input,.view3d-controls button,.view3d-controls select,.sphere-animation-panel button,.sphere-animation-panel select,.sphere-animation-panel input{background:#121d30;color:var(--text);border-color:var(--line)}
.tool:hover,.item:hover,.struct-item:hover,.template-card:hover,.secondary:hover{background:#182844;border-color:var(--accent)}
.tool small{color:#b7c3d6}.tool.tool-active,.struct-item.active,.bottom-tabs button.active{background:var(--accent2);color:var(--accent);border-color:var(--accent)}
.panel h3,.section h4,.bottom-tabs,th{background:#0f192a;color:#dbe6f7;border-color:var(--line)}
.group-title,.field label,.struct-item .struct-head span,.struct-item .struct-fields label,.template-card small,.sphere-animation-panel label,.sphere-animation-panel .anim-status,.view3d-group-title,.scale-control label,.scale-value{color:var(--muted)}
.item{border-color:#263650}.item .ico{background:#1b3152}.section,.struct-item,.kpi{border-color:#263650}
.canvas-wrap,.canvas-wrap.canvas-expanded,.canvas-wrap:fullscreen,.canvas-wrap:-webkit-full-screen,#threeCanvas{background:#08111f!important}
#canvas{background:#0b1524}
.canvas-toolbar,.view3d-controls,.sphere-animation-panel{background:rgba(15,25,42,.96);border-color:#34445f;box-shadow:0 8px 24px rgba(0,0,0,.38)}
.canvas-toolbar>button,.canvas-toolbar .view-switch button,.view3d-controls button{color:#d5e1f3}
.canvas-toolbar>button:hover,.canvas-toolbar .view-switch button:hover,.view3d-controls button:hover{background:#1a2b48!important;color:var(--accent)}
.canvas-toolbar .view-switch{background:#0d1727}.canvas-toolbar .view-switch button.active{background:#1b3152!important;color:var(--accent)!important}
.canvas-wrap>.view-switch{background:#101b2d;border-color:var(--line)}
.canvas-wrap>.view-switch button{color:#b9c7da!important}.canvas-wrap>.view-switch button.active{background:#2e6fbb!important;color:#fff!important}
#fit3D{background:#132036!important;border-color:#34445f!important}
.scale-bar{background:rgba(15,25,42,.92);border-color:var(--line)}.scale-bar .scale-label{color:#d4deed}
.legend,.statusbar,.view3d-hint{background:rgba(5,12,24,.90);color:#d9e4f4;border-color:rgba(255,255,255,.12)}
.properties .prop-content,.items,.bottom-body,.dialog .body{background:#111a2b}
/* Right-pane readability: make editable property fields dark with green text. */
.properties .field input,
.properties .field select,
.properties .field textarea,
.properties .struct-item .struct-fields input{
  background:#08131b!important;
  color:#7CFC7C!important;
  border-color:#2f5e3a!important;
  caret-color:#7CFC7C;
  -webkit-text-fill-color:#7CFC7C;
}
.properties .field input::placeholder,
.properties .field textarea::placeholder,
.properties .struct-item .struct-fields input::placeholder{color:#55c76a!important;opacity:1}
.properties .field select option{background:#08131b;color:#7CFC7C}
.properties .field input:focus,
.properties .field select:focus,
.properties .field textarea:focus,
.properties .struct-item .struct-fields input:focus{
  border-color:#52d66b!important;
  box-shadow:0 0 0 3px rgba(82,214,107,.18)!important;
}
.properties input:-webkit-autofill,
.properties select:-webkit-autofill,
.properties textarea:-webkit-autofill{
  -webkit-box-shadow:0 0 0 1000px #08131b inset!important;
  -webkit-text-fill-color:#7CFC7C!important;
}
.bottom-tabs button{color:#aebbd0}.bottom-tabs button:hover{color:var(--accent)}
.kpi{background:linear-gradient(180deg,#152138,#101a2c)}.kpi b,.calc-result{color:#edf4ff}
.calc-result{background:#152138;border-color:var(--line)}.calc-result.warn{background:#3b1e25;border-color:#7d3940;color:#ffb3ad}
table,td,th{color:var(--text)}td{border-color:#263650}tbody tr:hover{background:#172640}
.badge.ok,.ok{background:#153b30;color:#72e1b2}.badge.warn,.warn{background:#43341c;color:#ffd28a}.badge.danger,.danger{background:#442328;color:#ffaaa3}.badge.info,.info{background:#17354a;color:#8bd7ff}
.modal{background:rgba(0,0,0,.72)}.dialog h2,.dialog .actions{border-color:var(--line)}
.sphere-animation-panel{background:#101b2d}.sphere-animation-panel .progress{background:#263650}
.canvas-wrap.three-resizing::after{background:rgba(15,25,42,.95);border-color:var(--line);color:var(--muted)}
/* Canvas readability adjustments */
#canvas{filter:none}
/* Keep generated reports and print output white for professional printing. */
.report{background:#fff;color:#111;padding:12px;border-radius:8px}.report *{color:inherit}.report-box,.report .cover{background:#fff}
@media print{body{background:#fff!important}.report{padding:0}.modal,.dialog,.dialog .body{background:#fff!important;color:#111!important}}
