/* StructCalc shared UI — FrameCalc 2D visual baseline.
   Loaded after app-local styles so colour, typography and controls converge
   without changing each application's calculation layout. */
:root {
  --font-scale:1;
  --theme-accent:#1a6fc4;
  --theme-bg:#f0f0f0;
  --theme-panel:#ffffff;
  --theme-panel-2:#fafafa;
  --theme-toolbar:#e8e8e8;
  --theme-header:#e0e0e0;
  --theme-tab:#dddddd;
  --theme-tab-active:#ffffff;
  --theme-text:#111111;
  --theme-muted:#555555;
  --theme-border:#bbbbbb;
  --theme-border-strong:#aaaaaa;
  --theme-control-bg:#f7f7f7;
  --theme-control-hover:#ffffff;
  --theme-control-border:#b8b8b8;
  --theme-table-head:#d0d8e0;
  --theme-table-cell:#ffffff;
  --theme-table-hover:#f0f7ff;
  --theme-input-focus:#fffde7;
  --theme-selected:#fff4b8;
  --canvas-bg:#fafafa;
  --canvas-grid:#e4e4e4;
  --canvas-muted:#777777;
  --canvas-text:#111111;
  --canvas-member:#111111;
  --sc-pass-bg:#e6f4ea;
  --sc-pass:#176a35;
  --sc-fail-bg:#fdecec;
  --sc-fail:#b00020;
  --sc-warn-bg:#fff7df;
  --sc-warn:#8a5a00;
}

html,body { font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif; }
body { background:var(--theme-bg) !important; color:var(--theme-text); }
button,input,select,textarea { font-family:inherit; }
button,select,input[type="button"],input[type="submit"] {
  border-color:var(--theme-control-border);
  border-radius:3px;
  background:var(--theme-control-bg);
  color:var(--theme-text);
}
button { cursor:pointer; }
button:hover,select:hover,input[type="button"]:hover,input[type="submit"]:hover {
  background:var(--theme-control-hover);
  border-color:#888888;
}
button.primary,.primary:is(button,input),button.run,button.accent {
  background:var(--theme-accent);
  color:#ffffff;
  border-color:#155aa0;
  font-weight:700;
}
button.primary:hover,.primary:is(button,input):hover,button.run:hover,button.accent:hover { background:#155aa0; }
button:disabled,input:disabled,select:disabled { opacity:.58; cursor:not-allowed; }
input[type="text"],input[type="number"],input[type="search"],input[type="date"],select,textarea {
  background:var(--theme-table-cell);
  color:var(--theme-text);
  border-color:var(--theme-control-border);
}
input:focus,select:focus,textarea:focus {
  outline:2px solid var(--theme-accent);
  outline-offset:-1px;
  border-color:var(--theme-accent);
  background:var(--theme-input-focus);
}

.menubar,.topbar {
  background:linear-gradient(#ececec,#e1e1e1);
  color:var(--theme-text);
  border-bottom-color:var(--theme-border-strong);
}
.brand-title { color:#111111; font-weight:800; letter-spacing:.2px; }
.brand-sub,.top-control,.top-note,#status-top { color:#3e4b59; }
.theme-toggle-btn { min-width:80px; text-align:center; }
.sep,.header-sep { background:var(--theme-border); }

.tabbar,.tabs,.module-tabs { background:var(--theme-tab); border-bottom-color:var(--theme-border-strong); }
.tab,.module-tab,.left-tab {
  background:var(--theme-tab);
  color:var(--theme-muted);
  border-color:var(--theme-border);
  font-weight:600;
}
.tab:hover,.module-tab:hover,.left-tab:hover { background:#e8e8e8; color:var(--theme-text); }
.tab.active,.module-tab.active,.left-tab.active {
  background:var(--theme-tab-active);
  color:var(--theme-text);
  border-bottom-color:var(--theme-accent);
}

.card,.panel-section,.section-block,.output-card,.group,.grp,.pane,.method-frame,.view-panel {
  background-color:var(--theme-panel);
  border-color:var(--theme-border);
  color:var(--theme-text);
}
.card>h2,.card-header,.section-title,.grid-header,.pane-header,.panel-title,.view-title,
.load-section-title,.output-grid-title,.calc-block-title {
  background:var(--theme-header);
  color:var(--theme-text);
  border-color:var(--theme-border);
}
.section-title:hover { background:#e8e8e8; }
.canvas-toolbar,.canvas-bottom-toolbar,.profile-toolbar,.calc-toolbar,.toolbar,.bottom-toolbar,.bottombar {
  background:var(--theme-toolbar);
  color:var(--theme-muted);
  border-color:var(--theme-border);
}
.note,.hint,.muted,.smalltxt,.grid-note,.fieldNote,.calc-note,.info-help { color:var(--theme-muted); }

table { color:var(--theme-text); }
th,.sp-table th,.res-table th,.shore-table th {
  background:var(--theme-table-head);
  color:var(--theme-text);
  border-color:var(--theme-border);
}
td,.sp-table td,.res-table td,.shore-table td {
  background-color:var(--theme-table-cell);
  color:var(--theme-text);
  border-color:var(--theme-border);
}
tbody tr:hover td,.sp-table tr:hover td,.res-table tr:hover td { background-color:var(--theme-table-hover); }
td.cell-selected,td.selected,.selected-cell { background:var(--theme-selected); outline-color:var(--theme-accent); }
.unit,.u { color:var(--theme-muted); }

canvas,.canvas-wrap,.map-wrap,.profile-wrap { background-color:var(--canvas-bg); border-color:var(--theme-border); }
.status-bar,.statusbar,.status,.summary-banner { background:var(--theme-header); color:var(--theme-muted); border-color:var(--theme-border); }
.pass,.statusPass,.status.good,.status.ok,.verdict.pass { background-color:var(--sc-pass-bg); color:var(--sc-pass); border-color:#aedcbd; }
.fail,.statusFail,.status.bad,.status.err,.verdict.fail { background-color:var(--sc-fail-bg); color:var(--sc-fail); border-color:#f3c2c2; }
.warn,.status.warn,.warning { background-color:var(--sc-warn-bg); color:var(--sc-warn); border-color:#e4c978; }

.pdf-card,.example-dialog,.modal-card,.dialog-card { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border-strong); }
.pdf-card-head,.example-head,.modal-head { background:#263746; color:#ffffff; }

body:is(.theme-night,.theme-dark,.dark-mode,.night) {
  --theme-accent:#8bbcff;
  --theme-bg:#2f3437;
  --theme-panel:#363c40;
  --theme-panel-2:#30363a;
  --theme-toolbar:#3b4247;
  --theme-header:#454d53;
  --theme-tab:#3a4146;
  --theme-tab-active:#4b545a;
  --theme-text:#edf1f3;
  --theme-muted:#c3cbd1;
  --theme-border:#5a656d;
  --theme-border-strong:#707b84;
  --theme-control-bg:#4a5359;
  --theme-control-hover:#566168;
  --theme-control-border:#77838c;
  --theme-table-head:#515b63;
  --theme-table-cell:#343a3f;
  --theme-table-hover:#465158;
  --theme-input-focus:#4e5f6d;
  --theme-selected:#6a5f38;
  --canvas-bg:#31373b;
  --canvas-grid:#454d52;
  --canvas-muted:#a1aab1;
  --canvas-text:#f0f3f5;
  --canvas-member:#f0f3f5;
  --sc-pass-bg:#203b2a;
  --sc-pass:#7ee0a0;
  --sc-fail-bg:#4a2828;
  --sc-fail:#ff9e9e;
  --sc-warn-bg:#4b4029;
  --sc-warn:#ffe0a8;
  color-scheme:dark;
}
body:is(.theme-night,.theme-dark,.dark-mode,.night) .menubar,
body:is(.theme-night,.theme-dark,.dark-mode,.night) .topbar { background:var(--theme-toolbar); }
body:is(.theme-night,.theme-dark,.dark-mode,.night) .brand-title,
body:is(.theme-night,.theme-dark,.dark-mode,.night) .brand-sub { color:var(--theme-text); }
body:is(.theme-night,.theme-dark,.dark-mode,.night) button.primary,
body:is(.theme-night,.theme-dark,.dark-mode,.night) .primary:is(button,input) { color:#111111; border-color:var(--theme-accent); }
body:is(.theme-night,.theme-dark,.dark-mode,.night) .tab:hover,
body:is(.theme-night,.theme-dark,.dark-mode,.night) .module-tab:hover,
body:is(.theme-night,.theme-dark,.dark-mode,.night) .left-tab:hover { background:var(--theme-control-hover); }

@media print {
  body { background:#ffffff !important; color:#111111 !important; }
  .menubar,.topbar,.tabbar,.tabs,.module-tabs { print-color-adjust:exact; -webkit-print-color-adjust:exact; }
}
