/* Etude — оформление в стиле DrillHarmony: тёмная «приборная» тема, свой акцент (фиолетовый), светлая тема для печати */
:root {
  color-scheme: dark;
  --ground: #0d1316; --panel: #141c20; --panel-2: #1a242a; --panel-3: #202c33;
  --line: #26333a; --line-2: #37474f;
  --text: #dbe3e5; --muted: #8b9ca2; --faint: #5e6f75;
  --accent: #b98cf0; --accent-2: #d2b4f7; --accent-ink: #160b24; --accent-bg: rgba(185, 140, 240, .12);
  --ok: #6cbf79; --warn: #e3b341; --crit: #e5534b; --info: #4fc3d9;
  --f-label: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --f-mono: "JetBrains Mono", "Consolas", "DejaVu Sans Mono", monospace;
  --r: 4px; --side: 300px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --ground: #eceff1; --panel: #ffffff; --panel-2: #f3f5f7; --panel-3: #e9edf0;
  --line: #d7dde1; --line-2: #b9c4ca;
  --text: #182226; --muted: #52616a; --faint: #84929a;
  --accent: #7a3fc4; --accent-2: #5d2a9e; --accent-ink: #ffffff; --accent-bg: rgba(122, 63, 196, .08);
  --ok: #2b8a3a; --warn: #a06d00; --crit: #c9352d; --info: #0b85a0;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--ground); color: var(--text); font: 14px/1.45 var(--f-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--f-label); font-weight: 600; letter-spacing: .02em; margin: 0; text-wrap: balance; }
h1 { font-size: 26px; line-height: 1.15; } h2 { font-size: 20px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.lbl { font-family: var(--f-label); text-transform: uppercase; letter-spacing: .09em; font-size: 12px; color: var(--muted); }
[hidden] { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .row.tight { gap: 3px; }
.stack { display: grid; gap: 14px; min-width: 0; }
.spacer { flex: 1; }
.boot { display: grid; place-items: center; height: 100vh; font: 600 28px var(--f-label); letter-spacing: .2em; color: var(--accent); opacity: .5; }

/* кнопки и поля */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 5px 11px; cursor: pointer; font-family: var(--f-label); font-size: 14px; letter-spacing: .04em; min-height: 32px; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--panel-3); border-color: var(--muted); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 45%, var(--line-2)); }
.btn.ghost { background: transparent; border-color: transparent; } .btn.ghost:hover { border-color: var(--line-2); }
.btn.sm { padding: 2px 8px; min-height: 26px; font-size: 13px; }
.btn svg { flex: none; }
.icon-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r); border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; padding: 0; }
.icon-btn:hover { border-color: var(--line-2); color: var(--text); } .icon-btn:disabled { opacity: .3; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=text], input[type=password], input[type=email], input[type=search], select, textarea {
  background: var(--ground); border: 1px solid var(--line-2); border-radius: var(--r); padding: 5px 8px; min-height: 30px; width: 100%; min-width: 0; }
input.num { font-family: var(--f-mono); font-size: 13px; text-align: right; }
input:disabled, select:disabled { opacity: .75; background: transparent; border-color: var(--line); cursor: not-allowed; }
input.bad { border-color: var(--crit); background: color-mix(in srgb, var(--crit) 10%, var(--ground)); }
label.field { display: grid; gap: 4px; min-width: 0; } label.field.inline { display: flex; align-items: center; gap: 8px; }
label.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
label.mini { display: grid; gap: 1px; } label.mini > span { font-size: 10.5px; color: var(--faint); font-family: var(--f-label); letter-spacing: .05em; text-transform: uppercase; }
.with-unit { display: flex; align-items: center; gap: 4px; } .unit { color: var(--faint); font-size: 12px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 6px 14px; cursor: pointer; font-family: var(--f-label); letter-spacing: .05em; color: var(--muted); }
.seg button.on { background: var(--accent-bg); color: var(--accent); }

/* каркас */
.shell { display: grid; grid-template-rows: auto 1fr auto; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 7px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark { color: var(--accent); display: inline-flex; } .brand-mark.big svg { width: 64px; height: 64px; }
.brand b { font-family: var(--f-label); font-size: 21px; letter-spacing: .06em; color: var(--accent); }
.brand span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 8px; cursor: pointer; color: var(--text); }
.user-btn:hover { border-color: var(--line-2); }
.menu { position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); padding: 4px; display: grid; min-width: 220px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.menu button { display: flex; align-items: center; gap: 10px; background: transparent; border: 0; padding: 7px 10px; text-align: left; cursor: pointer; border-radius: 3px; color: var(--text); }
.menu button:hover { background: var(--panel-2); }
.body { display: grid; grid-template-columns: var(--side) 1fr; min-height: 0; }
.side { border-right: 1px solid var(--line); background: var(--panel); display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.side-head { padding: 10px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.search { position: relative; } .search i { position: absolute; left: 8px; top: 6px; color: var(--faint); } .search input { padding-left: 32px; }
.tree { overflow: auto; padding: 6px 0 20px; }
.tr { display: flex; align-items: center; gap: 4px; padding: 3px 8px 3px 6px; cursor: pointer; white-space: nowrap; border-left: 2px solid transparent; font-size: 13.5px; }
.tr:hover { background: var(--panel-2); }
.tr.cur { background: var(--accent-bg); border-left-color: var(--accent); }
.tr .tog { width: 18px; height: 18px; display: inline-grid; place-items: center; background: none; border: 0; color: var(--faint); cursor: pointer; padding: 0; flex: none; }
.tr .tog svg { width: 14px; height: 14px; }
.tr .ic { display: inline-grid; color: var(--muted); flex: none; } .tr .ic svg { width: 16px; height: 16px; }
.tr .ic.k-plan { color: var(--accent); } .tr .ic.k-survey { color: var(--info); } .tr .ic.k-site { color: #e0d36a; }
.tr .nm { overflow: hidden; text-overflow: ellipsis; }
.tr .star { color: var(--warn); font-size: 11px; }
.tr .lk { display: inline-grid; margin-left: auto; } .tr .lk svg { width: 14px; height: 14px; } .tr .lk.other { color: var(--warn); } .tr .lk.mine { color: var(--accent); }
.empty { padding: 16px; color: var(--muted); font-size: 13px; }
.work { overflow: auto; min-width: 0; display: flex; flex-direction: column; }
.work > * { flex: none; }
.work-head { padding: 14px 20px 8px; display: grid; gap: 6px; }
.crumbs { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; } .crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--accent); } .crumbs .sep { color: var(--faint); }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kind { font-family: var(--f-label); text-transform: uppercase; letter-spacing: .12em; font-size: 11.5px; color: var(--accent); }
.acts { display: flex; gap: 6px; flex-wrap: wrap; }
.lock { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 3px 4px 3px 9px; border-radius: var(--r); width: fit-content; }
.lock i { display: inline-grid; } .lock svg { width: 15px; height: 15px; }
.lock.mine { background: var(--accent-bg); color: var(--accent); } .lock.other { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); } .lock.free { color: var(--faint); }
.tabs { display: flex; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--ground); z-index: 5; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px 7px; cursor: pointer; font-family: var(--f-label); font-size: 14.5px; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.tabs button:hover { color: var(--text); } .tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.work-body { padding: 16px 20px 40px; display: grid; gap: 14px; align-content: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-width: 0; }
.panel > h3:first-child { margin-top: -2px; }
.plots2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.statusbar { display: flex; align-items: center; gap: 16px; padding: 4px 14px; border-top: 1px solid var(--line); background: var(--panel); font-size: 12px; color: var(--muted); }
.st { display: inline-flex; align-items: center; gap: 6px; } .st .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.st.saving .dot { background: var(--warn); } .st.error .dot, .st.offline .dot { background: var(--crit); }
.welcome { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 80px 20px; max-width: 560px; margin: 0 auto; }

/* таблицы */
.scroll { overflow: auto; max-width: 100%; } .scroll.tall { max-height: 68vh; }
.tbl { border-collapse: collapse; width: 100%; font-size: 13px; }
.tbl th { text-align: left; font-family: var(--f-label); font-weight: 500; letter-spacing: .05em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; position: sticky; top: 0; background: var(--panel); z-index: 1; }
.tbl td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.num, .num-tbl td { font-family: var(--f-mono); font-size: 12.5px; text-align: right; white-space: nowrap; }
.num-tbl th { text-align: right; }
.tbl tr.link { cursor: pointer; } .tbl tr.link:hover td { background: var(--panel-2); }
.tbl.edit td { padding: 3px 4px; } .tbl tr.err td { background: color-mix(in srgb, var(--crit) 9%, transparent); }
.tbl td.idx { color: var(--faint); font-family: var(--f-mono); font-size: 12px; text-align: right; }
.tbl tr.bad td { background: color-mix(in srgb, var(--crit) 10%, transparent); } .tbl tr.warnrow td { background: color-mix(in srgb, var(--warn) 9%, transparent); }
.params { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-end; }
.tbl select, .params select { width: auto; max-width: 260px; }
table.grid { border-collapse: collapse; } table.grid th { font: 500 12px var(--f-label); letter-spacing: .05em; color: var(--muted); text-align: right; padding: 4px; }
table.grid td { padding: 1px 2px; } table.grid td .calc { display: block; text-align: right; padding: 0 6px; color: var(--muted); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 5px 18px; margin: 0; font-size: 13.5px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; font-family: var(--f-mono); font-size: 13px; }
dl.kv dd.ok { color: var(--ok); } dl.kv dd.warn { color: var(--warn); } dl.kv dd.crit { color: var(--crit); }

/* метки и примечания */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.chip.crit { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 55%, transparent); background: color-mix(in srgb, var(--crit) 10%, transparent); }
.note { font-size: 12.5px; color: var(--muted); border-left: 2px solid var(--line-2); padding: 4px 10px; margin-top: 8px; }
.note.crit { color: var(--crit); border-left-color: var(--crit); background: color-mix(in srgb, var(--crit) 7%, transparent); }
.note.warn { color: var(--warn); border-left-color: var(--warn); } .note.ok { color: var(--ok); border-left-color: var(--ok); }

/* графики */
.chart { position: relative; } svg.plot { width: 100%; height: auto; display: block; user-select: none; touch-action: none; }
svg.plot .ax { fill: var(--muted); font: 11px var(--f-mono); }
svg.plot .axl { fill: var(--muted); font: 12px var(--f-label); letter-spacing: .06em; }
svg.plot .lab { font: 12px var(--f-label); letter-spacing: .03em; }
svg.plot .halo { paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.chart-tip { position: absolute; pointer-events: none; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 5px 8px; font-size: 12px; font-family: var(--f-mono); white-space: nowrap; z-index: 3; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; } .legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 20px; }

/* окна и уведомления */
.modal-bg { position: fixed; inset: 0; background: rgba(5, 8, 10, .7); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s ease both; }
:root[data-theme="light"] .modal-bg { background: rgba(30, 40, 46, .4); }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; width: 100%; max-width: 560px; max-height: 92vh; display: grid; grid-template-rows: auto 1fr auto; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.modal-body { padding: 8px 16px 14px; overflow: auto; display: grid; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.toasts { position: fixed; right: 16px; bottom: 36px; display: grid; gap: 8px; z-index: 70; max-width: 420px; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--info); border-radius: var(--r); padding: 9px 12px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: up .2s ease both; }
.toast.ok { border-left-color: var(--ok); } .toast.warn { border-left-color: var(--warn); } .toast.error { border-left-color: var(--crit); }
.toast.out { opacity: 0; transform: translateY(6px); transition: .3s; }
@keyframes fade { from { opacity: 0; } } @keyframes up { from { opacity: 0; transform: translateY(8px); } }

/* вход */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 70% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%), var(--ground); }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 24px; display: grid; gap: 16px; }
.auth-card form { display: grid; gap: 12px; }
.auth-brand { display: flex; gap: 12px; align-items: center; } .auth-brand svg { width: 40px; height: 40px; }
.auth-brand b { display: block; font: 600 26px var(--f-label); letter-spacing: .06em; color: var(--accent); } .auth-brand span { color: var(--muted); font-size: 13px; }
.auth-err { color: var(--crit); font-size: 13px; min-height: 1em; }
.auth-actions { display: flex; justify-content: flex-end; }

/* мастер профиля */
.wiz { display: grid; gap: 14px; }
.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kind-card { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 8px 12px; cursor: pointer; color: var(--muted); text-align: left; font-family: var(--f-label); font-size: 15px; letter-spacing: .03em; }
.kind-card:hover { border-color: var(--muted); } .kind-card.on { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.wiz-out { display: grid; grid-template-columns: 420px 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .wiz-out, .kinds { grid-template-columns: 1fr; } }

/* печать: отчёты */
@media print {
  .topbar, .side, .statusbar, .tabs, .acts, .lock, .no-print, .work-head .crumbs { display: none !important; }
  .body { display: block; } .shell { display: block; height: auto; } .work { overflow: visible; }
  body { background: #fff; color: #000; }
}
@media (max-width: 860px) { :root { --side: 240px; } .plots2 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .body { grid-template-columns: 1fr; } .side { max-height: 36vh; border-right: 0; border-bottom: 1px solid var(--line); } }

/* сближение */
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: middle; }
tr.dim td { color: var(--muted); }

/* отчёты */
.report-paper { background: #fff; border-radius: 6px; padding: 18px; box-shadow: 0 1px 0 var(--line); }
.report-frame { width: 100%; min-height: 900px; border: 0; background: #fff; display: block; }
.cols-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px; }

/* импорт */
.imp-list { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
.imp-list.warn b { color: var(--warn, #f2a541); } .imp-list.info b { color: var(--muted); }
#imp-report h4 { margin: 6px 0; font-family: var(--f-label); letter-spacing: .04em; text-transform: uppercase; font-size: 13px; color: var(--muted); }

/* проект одной таблицей: заданное — жирным, рассчитанное — серым; плотные строки */
.pgrid td { padding: 1px 2px; } .pgrid th { padding: 5px 4px; font-size: 12px; white-space: normal; line-height: 1.15; vertical-align: bottom; min-width: 64px; }
.pgrid input[type=text] { width: 72px; padding: 3px 5px; height: 26px; border-radius: 2px; }
.pgrid input.given { font-weight: 700; color: var(--text); background: var(--panel); border-color: var(--line-2); }
.pgrid input.calc { color: var(--muted); background: transparent; border-color: transparent; }
.pgrid input.calc:hover { border-color: var(--line); }
.pgrid input:focus { border-color: var(--accent); background: var(--panel); color: var(--text); outline: none; box-shadow: 0 0 0 2px var(--accent-bg); }
.pgrid td.ro { color: var(--muted); padding-right: 7px; }
.pgrid tr.tie td { background: var(--panel-2); } .pgrid tr.new td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.pgrid td.meth { font-size: 12px; color: var(--muted); white-space: nowrap; } .pgrid .errmark { color: var(--crit); font-weight: 700; }
.pgrid select { padding: 2px 4px; height: 26px; max-width: 140px; }
.stack.tight { gap: 6px; }
.disp-bar { margin-top: 8px; gap: 14px; } .disp-bar select { padding: 3px 6px; height: 28px; width: auto; }
canvas.v3d { width: 100%; display: block; border: 1px solid var(--line); border-radius: var(--r); cursor: grab; touch-action: none; }
canvas.v3d:active { cursor: grabbing; }

/* ======================================================= рабочий стол: значки, меню, ярлыки, окна */
:root { --ic-blue: #5b8fd6; --ic-blue2: #8fb3e8; --ic-green: #5fae6b; --ic-green2: #9fd0a6; --ic-red: #e0614f; --ic-amber: #e3a93a; --ic-steel: #7d8d96; --ic-steel2: #a7b3ba;
  --ic-violet: #a879ec; --ic-cyan: #3fb4cc; --ic-paper: #1e2a30;
  --sc-sky1: #1b2a33; --sc-sky2: #26363f; --sc-earth1: #3a3127; --sc-earth2: #463a2c; --sc-earth3: #3b3a30; --sc-pay: #5a5a2a; --sc-pad: #8d7d63; --sc-rig: #c9d2d6; --sc-cone: #b98cf0; --sc-lab: #d9dfe2;
  --desk-bg: #10181c; --win-bar: #1b262c; --win-bar-on: #2a2140; }
:root[data-theme="light"] { --ic-paper: #ffffff; --ic-steel: #5f707a; --ic-steel2: #8796a0; --ic-violet: #7a3fc4; --ic-cyan: #1491ac;
  --sc-sky1: #d9e9f5; --sc-sky2: #eef5fa; --sc-earth1: #d9c4a3; --sc-earth2: #ccb38c; --sc-earth3: #bfa47a; --sc-pay: #a9a25a; --sc-pad: #8a7656; --sc-rig: #3c4a52; --sc-cone: #7a3fc4; --sc-lab: #2c3439;
  --desk-bg: #dfe4e8; --win-bar: #eef1f4; --win-bar-on: #e6dcf6; }
.dk-ic { width: 20px; height: 20px; display: block; }
.shell { grid-template-rows: auto 1fr auto; } .heads { display: grid; }
.dk-chrome { background: var(--panel); border-bottom: 1px solid var(--line); }
.menubar { display: flex; gap: 0; padding: 0 6px; border-bottom: 1px solid var(--line); }
.mb-item { background: none; border: 0; padding: 4px 10px; font-size: 13px; cursor: pointer; border-radius: 3px; color: var(--text); }
.mb-item:hover, .mb-item.open { background: var(--accent-bg); color: var(--accent); }
.dk-menu { position: fixed; min-width: 260px; z-index: 1000; padding: 4px 0; }
.dk-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 14px 6px 8px; text-align: left; }
.dk-menu button[disabled] { opacity: .45; cursor: default; }
.dk-menu .mi { width: 20px; height: 20px; display: inline-grid; flex: none; } .dk-menu .sep { height: 1px; background: var(--line); margin: 4px 0; }
.toolbar { display: flex; align-items: center; gap: 2px; padding: 4px 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tb-btn { width: 32px; height: 30px; display: inline-grid; place-items: center; border: 1px solid transparent; background: transparent; border-radius: 4px; cursor: pointer; padding: 0; }
.tb-btn:hover:not([disabled]) { background: var(--panel-2); border-color: var(--line-2); } .tb-btn:active:not([disabled]) { background: var(--accent-bg); }
.tb-btn[disabled] { opacity: .35; cursor: default; } .tb-btn .dk-ic { width: 22px; height: 22px; }
.tb-sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 6px; }
.dk-row2 { display: flex; align-items: center; gap: 14px; padding: 4px 10px; font-size: 12.5px; flex-wrap: wrap; }
.dk-field { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); } .dk-field select { height: 26px; padding: 2px 6px; width: auto; font-size: 12.5px; }
.dk-static { color: var(--muted); } .dk-cur { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 500; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dk-cur .dk-ic { width: 18px; height: 18px; }
.work.desk-host { overflow: hidden; position: relative; padding: 0; }
.desk { position: absolute; inset: 0; background: var(--desk-bg); background-image: radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1px); background-size: 22px 22px; overflow: hidden; }
.win { position: absolute; display: flex; flex-direction: column; background: var(--ground); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: 0 8px 28px rgba(0, 0, 0, .28); overflow: hidden; min-width: 300px; }
.win.max { inset: 0; width: auto !important; height: auto !important; border-radius: 0; }
.win-bar { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 8px; background: var(--win-bar); border-bottom: 1px solid var(--line); cursor: move; user-select: none; flex: none; }
.win.active .win-bar { background: var(--win-bar-on); }
.win-ic .dk-ic { width: 18px; height: 18px; } .win-title { font-size: 13px; font-weight: 600; white-space: nowrap; }
.win-path { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.win-btn { width: 26px; height: 24px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: 3px; cursor: pointer; color: var(--muted); padding: 0; }
.win-btn .dk-ic { width: 16px; height: 16px; } .win-btn:hover { background: var(--panel-3); color: var(--text); } .win-btn.close:hover { background: var(--crit); color: #fff; }
.win > .work-head { padding: 6px 12px 0; } .win > .work-head h1 { font-size: 17px; } .win > .work-head .crumbs { display: none; }
.win > .tabs { padding: 0 10px; position: static; flex: none; } .win > .tabs button { padding: 6px 10px; font-size: 13px; }
.win > .work-body { flex: 1; overflow: auto; padding: 10px 12px 18px; min-height: 0; }
.win > .work-body.plot-body { padding: 6px; display: block; } .win > .work-body.plot-body .chart { height: 100%; }
.win-grip { position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, var(--line-2) 50%, var(--line-2) 60%, transparent 60%, transparent 70%, var(--line-2) 70%, var(--line-2) 80%, transparent 80%); }
.dk-start { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; overflow: auto; }
.dk-start-card { width: min(920px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.dk-start-art { border-bottom: 1px solid var(--line); line-height: 0; } .dk-start-body { padding: 18px 22px 22px; display: grid; gap: 10px; }
.dk-start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 6px; }
.dk-start-btn { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 10px; text-align: left; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel-2); cursor: pointer; }
.dk-start-btn:hover { border-color: var(--accent); background: var(--accent-bg); } .dk-start-btn i { grid-row: span 2; } .dk-start-btn i .dk-ic { width: 28px; height: 28px; }
.dk-start-btn span { font-size: 12px; color: var(--muted); }
.dk-scene .sc-lab { font: 500 11px var(--f-body); fill: var(--sc-lab); } .dk-scene .sc-amber { fill: var(--ic-amber); }
.tr .ic .dk-ic { width: 17px; height: 17px; }
.win > .work-head .title-row { display: none; } .win > .work-head:empty { display: none; } .win > .work-head { padding: 0 12px; }

/* ======================================================= классическая тема: вид настольной инженерной программы
   серый каркас, белые таблицы с сеткой, заданные значения — зелёным фоном, выделение — синим, плотные строки, без скруглений */
:root[data-theme="classic"] {
  color-scheme: light;
  --ground: #ffffff; --panel: #f0f0f0; --panel-2: #e8e8e8; --panel-3: #dadada;
  --line: #d0d0d0; --line-2: #a0a0a0;
  --text: #000000; --muted: #3c3c3c; --faint: #6e6e6e;
  --accent: #0063b1; --accent-2: #004a85; --accent-ink: #ffffff; --accent-bg: #cce4f7;
  --ok: #107c10; --warn: #9a6700; --crit: #c42b1c; --info: #0067a8;
  --f-label: "Segoe UI", Tahoma, "MS Sans Serif", Arial, sans-serif;
  --f-body: "Segoe UI", Tahoma, "MS Sans Serif", Arial, sans-serif;
  --f-mono: "Segoe UI", Tahoma, Arial, sans-serif;
  --r: 0px;
  --ic-paper: #ffffff; --ic-steel: #4d5b63; --ic-steel2: #7f8d95; --ic-violet: #6a2fb8; --ic-cyan: #0b8aa6; --ic-blue: #2f6fc2; --ic-blue2: #79a7e3;
  --sc-sky1: #d6e8f7; --sc-sky2: #eef6fc; --sc-earth1: #d8c29d; --sc-earth2: #c9ae84; --sc-earth3: #bb9f74; --sc-pay: #a8a057; --sc-pad: #84705a; --sc-rig: #333d43; --sc-cone: #6a2fb8; --sc-lab: #222;
  --desk-bg: #ababab; --win-bar: #ffffff; --win-bar-on: #dcebfb;
}
[data-theme="classic"] body { font-size: 12.5px; line-height: 1.35; }
[data-theme="classic"] h1 { font-size: 20px; font-weight: 600; letter-spacing: 0; }
[data-theme="classic"] h3, [data-theme="classic"] .lbl, [data-theme="classic"] label.mini > span { text-transform: none; letter-spacing: 0; font-size: 12px; color: #000; font-weight: 600; }
[data-theme="classic"] .lbl { font-weight: 400; color: #333; }
[data-theme="classic"] .panel { border: 1px solid #a0a0a0; border-radius: 0; background: #fff; box-shadow: none; padding: 8px 10px; }
[data-theme="classic"] .topbar { background: #fff; padding: 4px 10px; }
[data-theme="classic"] .menubar { background: #fff; border-bottom: 1px solid #e0e0e0; }
[data-theme="classic"] .mb-item { font-size: 12.5px; border-radius: 0; padding: 3px 9px; }
[data-theme="classic"] .mb-item:hover, [data-theme="classic"] .mb-item.open { background: #cce4f7; color: #000; outline: 1px solid #99c9ef; }
[data-theme="classic"] .toolbar { background: linear-gradient(#fbfbfb, #ececec); border-bottom: 1px solid #c8c8c8; padding: 2px 6px; }
[data-theme="classic"] .tb-btn { border-radius: 0; width: 28px; height: 26px; }
[data-theme="classic"] .tb-btn:hover:not([disabled]) { background: #e5f1fb; border-color: #0078d7; }
[data-theme="classic"] .dk-row2 { background: #f0f0f0; border-bottom: 1px solid #a0a0a0; padding: 3px 8px; }
[data-theme="classic"] .dk-field select, [data-theme="classic"] select, [data-theme="classic"] input[type=text], [data-theme="classic"] input[type=search], [data-theme="classic"] input[type=password], [data-theme="classic"] input[type=email], [data-theme="classic"] textarea {
  border-radius: 0; border: 1px solid #7a7a7a; background: #fff; height: 22px; padding: 1px 4px; font-size: 12.5px; box-shadow: none; }
[data-theme="classic"] textarea { height: auto; }
[data-theme="classic"] input:focus, [data-theme="classic"] select:focus { outline: none; border-color: #0078d7; box-shadow: none; }
[data-theme="classic"] .btn { border-radius: 2px; background: linear-gradient(#fdfdfd, #e6e6e6); border: 1px solid #adadad; color: #000; padding: 3px 10px; font-size: 12.5px; }
[data-theme="classic"] .btn:hover { background: #e5f1fb; border-color: #0078d7; }
[data-theme="classic"] .btn.primary { background: linear-gradient(#fdfdfd, #e6e6e6); color: #000; border-color: #0078d7; box-shadow: inset 0 0 0 1px #0078d7; }
[data-theme="classic"] .seg { border-radius: 0; border-color: #adadad; } [data-theme="classic"] .seg button { font-family: var(--f-body); letter-spacing: 0; padding: 3px 10px; color: #000; }
[data-theme="classic"] .seg button.on { background: #cce4f7; color: #000; box-shadow: inset 0 0 0 1px #0078d7; }
[data-theme="classic"] .side { background: #fff; } [data-theme="classic"] .side-head { background: #f0f0f0; padding: 6px; }
[data-theme="classic"] .tr { font-size: 12.5px; padding-top: 1px; padding-bottom: 1px; border-left: 0; }
[data-theme="classic"] .tr:hover { background: #e5f3ff; }
[data-theme="classic"] .tr.cur { background: #0078d7; color: #fff; } [data-theme="classic"] .tr.cur .tog { color: #fff; }
[data-theme="classic"] .tabs { background: #f0f0f0; border-bottom: 1px solid #a0a0a0; gap: 0; padding: 2px 6px 0; }
[data-theme="classic"] .tabs button { border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; padding: 3px 10px; font-family: var(--f-body); letter-spacing: 0; color: #000; font-size: 12.5px; border-radius: 0; }
[data-theme="classic"] .tabs button.on { background: #fff; border-color: #a0a0a0; color: #000; box-shadow: none; }
[data-theme="classic"] .tabs button.on::after { display: none; }
[data-theme="classic"] .tbl { font-size: 12.5px; border: 1px solid #a0a0a0; }
[data-theme="classic"] .tbl th { background: linear-gradient(#ffffff, #ebebeb); color: #000; font-family: var(--f-body); font-weight: 400; letter-spacing: 0; text-align: center; border: 1px solid #c8c8c8; padding: 2px 4px; vertical-align: middle; }
[data-theme="classic"] .tbl td { border: 1px solid #e2e2e2; padding: 1px 4px; }
[data-theme="classic"] .tbl td.num, [data-theme="classic"] .num-tbl td { font-family: var(--f-body); font-size: 12.5px; }
[data-theme="classic"] .tbl td.idx { background: #f0f0f0; color: #000; text-align: center; }
[data-theme="classic"] .tbl tr.cur td, [data-theme="classic"] .tbl tbody tr:focus-within td { background: #e5f3ff; }
[data-theme="classic"] .tbl tbody tr:focus-within td.idx { background: #0078d7; color: #fff; }
[data-theme="classic"] .pgrid input[type=text] { border: 0; height: 20px; background: transparent; width: 74px; font-family: var(--f-body); font-size: 12.5px; padding: 0 3px; }
[data-theme="classic"] .pgrid input.given { background: #b8f0b8; font-weight: 400; color: #000; }
[data-theme="classic"] .pgrid input.calc { color: #000; }
[data-theme="classic"] .pgrid input:focus { background: #fff; outline: 2px solid #0078d7; outline-offset: -2px; box-shadow: none; }
[data-theme="classic"] .pgrid td { padding: 0 1px; } [data-theme="classic"] .pgrid td.ro { color: #000; }
[data-theme="classic"] .pgrid tr.tie td { background: #e8e8e8; } [data-theme="classic"] .pgrid tr.new td { background: #fff; }
[data-theme="classic"] .pgrid td.meth { color: #333; } [data-theme="classic"] .pgrid select { border: 0; height: 20px; background: transparent; }
[data-theme="classic"] .chip { border-radius: 0; }
[data-theme="classic"] .note { border-radius: 0; }
[data-theme="classic"] .statusbar { background: #f0f0f0; border-top: 1px solid #a0a0a0; color: #000; padding: 2px 6px; gap: 4px; }
[data-theme="classic"] .statusbar .st { border: 1px solid; border-color: #a0a0a0 #fff #fff #a0a0a0; padding: 0 8px; }
[data-theme="classic"] .desk { background-image: none; }
[data-theme="classic"] .win { border-radius: 0; border: 1px solid #7a7a7a; box-shadow: 2px 2px 8px rgba(0, 0, 0, .35); }
[data-theme="classic"] .win-bar { padding: 2px 4px 2px 6px; border-bottom: 1px solid #c8c8c8; }
[data-theme="classic"] .win:not(.active) .win-title { color: #777; }
[data-theme="classic"] .win > .work-body { padding: 6px 8px 12px; background: #fff; }
[data-theme="classic"] .work-body { gap: 8px; padding: 8px 10px 30px; }
[data-theme="classic"] .dk-menu { border-radius: 0; border: 1px solid #a0a0a0; box-shadow: 2px 2px 4px rgba(0, 0, 0, .25); background: #f2f2f2; }
[data-theme="classic"] .dk-menu button:hover:not([disabled]) { background: #91c9f7; }
[data-theme="classic"] .dk-start-card, [data-theme="classic"] .dk-start-btn { border-radius: 0; }
[data-theme="classic"] .modal { border-radius: 0; }
:root { --target: #e0d36a; } :root[data-theme="light"] { --target: #a87b00; } :root[data-theme="classic"] { --target: #9a6a00; }
[data-theme="classic"] .search input { padding-left: 26px; }
[data-theme="classic"] .icon-btn { width: 20px; height: 20px; } [data-theme="classic"] .icon-btn svg { width: 14px; height: 14px; }
[data-theme="classic"] .tbl.edit td { padding: 0 2px; }
[data-theme="classic"] input[type=text], [data-theme="classic"] input[type=search], [data-theme="classic"] input[type=password], [data-theme="classic"] input[type=email], [data-theme="classic"] select { min-height: 22px; }
[data-theme="classic"] .pgrid input[type=text], [data-theme="classic"] .pgrid select { min-height: 0; height: 19px; }
[data-theme="classic"] .btn { min-height: 24px; } [data-theme="classic"] .btn.sm { min-height: 22px; padding: 1px 8px; }
.win-tools { display: flex; align-items: center; gap: 1px; padding: 2px 6px; border-bottom: 1px solid var(--line); background: var(--panel); flex: none; flex-wrap: wrap; }
.tb-btn.sm { width: 26px; height: 24px; } .tb-btn.sm .dk-ic { width: 18px; height: 18px; }
.nolab .lab, .nolab text.lab { display: none; }
[data-theme="classic"] .win-tools { background: linear-gradient(#fbfbfb, #ededed); border-bottom-color: #c8c8c8; }
.win > .work-body.plot-body > svg.plot { width: 100%; height: 100%; display: block; }
