:root {
  --bg: #0a0e13;
  --bg2: #0e141b;
  --panel: #121a23;
  --panel2: #17212c;
  --panel3: #1d2935;
  --line: #253342;
  --line2: #31445a;
  --text: #e8eef4;
  --muted: #a3b3c2;
  --dim: #8496a8;
  --accent: #3cc8f5;
  --accent2: #7be0ff;
  --accent-ink: #031219;
  --amber: #f6b548;
  --ok: #43dd9b;
  --danger: #ff7a7a;
  --r: 10px;
  --sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", Consolas, "Roboto Mono", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 8% -10%, rgba(60, 200, 245, .10), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(246, 181, 72, .06), transparent 60%),
    linear-gradient(rgba(60, 200, 245, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 200, 245, .045) 1px, transparent 1px),
    linear-gradient(rgba(60, 200, 245, .02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 200, 245, .02) 1px, transparent 1px);
  background-size: auto, auto, 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent2); }
button, input, select, textarea { font: inherit; color: inherit; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- вход ---------- */
.login {
  min-height: 100%; display: grid; place-items: center; padding: 24px 16px;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cg fill='none' stroke='%233cc8f5' stroke-opacity='.07' stroke-width='3'%3E%3Cpath d='M0 7h14M14 21h14'/%3E%3Cpath d='M21 0v14M7 14v14'/%3E%3C/g%3E%3C/svg%3E");
}
.login-card {
  width: min(420px, 100%); background: linear-gradient(180deg, rgba(23, 33, 44, .92), rgba(18, 26, 35, .96));
  border: 1px solid var(--line2); border-radius: 16px; padding: 32px 28px 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .04);
  position: relative; overflow: hidden;
}
.login-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
/* логотип «Композит Расчёт» — как в brand/logo.html, вариант «на тёмном» */
@font-face{font-family:'LogoM';font-weight:800;src:url('/static/fonts/Montserrat-800-cyrillic.woff2') format('woff2');unicode-range:U+0400-045F,U+2116;}
@font-face{font-family:'LogoM';font-weight:800;src:url('/static/fonts/Montserrat-800-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+2000-206F;}
@font-face{font-family:'LogoM';font-weight:600;src:url('/static/fonts/Montserrat-600-cyrillic.woff2') format('woff2');unicode-range:U+0400-045F,U+2116;}
@font-face{font-family:'LogoM';font-weight:600;src:url('/static/fonts/Montserrat-600-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+2000-206F;}
.brand { display: flex; align-items: center; gap: 10px; font-family: 'LogoM', var(--sans); }
.brand-mark { width: 38px; height: 38px; flex: none; border-radius: 8px; }
.brand-name { font-weight: 800; letter-spacing: .03em; font-size: 14.5px; line-height: 1; text-transform: uppercase; white-space: nowrap; color: #fff; }
.brand-name b { font-weight: 800; color: #5FD3FF; }
.brand-sub { margin-top: 5px; color: #A9BCD0; font-weight: 600; font-size: 8.5px; letter-spacing: .17em; text-transform: uppercase; white-space: nowrap; }
.brand-sub i { font-style: normal; color: #5FD3FF; padding: 0 3px; }
.login .brand { gap: 12px; }
.login .brand-mark { width: 54px; height: 54px; border-radius: 11px; }
.login .brand-name { font-size: 22px; }
.login .brand-sub { font-size: 10.5px; }
@media (max-width: 420px) { .login .brand-mark { width: 44px; height: 44px; } .login .brand-name { font-size: 17px; } .login .brand-sub { font-size: 9px; } }
.login h1 { font-size: 22px; margin: 26px 0 4px; letter-spacing: -.01em; }
.login p.lead { color: var(--muted); margin: 0 0 20px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .lbl { color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.input, select.input, textarea.input {
  width: 100%; background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px;
  padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(60, 200, 245, .18); }
textarea.input { resize: vertical; min-height: 80px; }
.err { color: var(--danger); min-height: 20px; font-size: 13px; }
.login-foot { margin-top: 18px; color: var(--dim); font-size: 12px; display: flex; gap: 8px; align-items: center; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/* ---------- кнопки ---------- */
.btn {
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid var(--line2); background: var(--panel2); border-radius: 8px;
  padding: 9px 14px; cursor: pointer; font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--panel3); border-color: #3e566f; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent2); border-color: var(--accent2); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.wide { width: 100%; padding: 11px; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100%; }
.side {
  background: rgba(14, 20, 27, .86); border-right: 1px solid var(--line); padding: 20px 14px;
  display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; align-self: start;
  backdrop-filter: blur(6px);
}
.nav { display: grid; gap: 4px; }
.nav button {
  text-align: left; background: none; border: 1px solid transparent; border-radius: 8px; padding: 9px 12px;
  color: var(--muted); cursor: pointer; display: flex; gap: 10px; align-items: center; font-weight: 600;
}
.nav button svg { width: 18px; height: 18px; }
.nav button:hover { color: var(--text); background: var(--panel); }
.nav button.on { color: var(--text); background: var(--panel2); border-color: var(--line2); }
.nav button.on svg { color: var(--accent); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.who { font-size: 13px; color: var(--muted); }
.who b { color: var(--text); display: block; font-size: 14px; }
.main { padding: 26px 32px 60px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.topbar .sp { flex: 1; }
.crumb { color: var(--dim); font-size: 13px; cursor: pointer; background: none; border: 0; padding: 0; }
.crumb:hover { color: var(--accent2); }
.mobile-bar { display: none; }

/* ---------- карточки ---------- */
.panel {
  background: linear-gradient(180deg, rgba(23, 33, 44, .78), rgba(18, 26, 35, .86));
  border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 18px;
  backdrop-filter: blur(4px);
}
.panel-h { display: flex; align-items: center; gap: 12px; margin: -2px 0 14px; flex-wrap: wrap; }
.panel-h h3 { margin: 0; font-size: 15px; letter-spacing: .01em; }
.panel-h .sp { flex: 1; }
.stepno {
  font-family: var(--mono); font-size: 12px; color: var(--accent); border: 1px solid rgba(60, 200, 245, .45);
  border-radius: 6px; padding: 1px 7px; background: rgba(60, 200, 245, .08);
}
.hint { color: var(--muted); font-size: 13px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px;
  border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); background: var(--bg2); white-space: nowrap;
}
.chip.ai { color: var(--amber); border-color: rgba(246, 181, 72, .5); background: rgba(246, 181, 72, .08); }
.chip.ok { color: var(--ok); border-color: rgba(67, 221, 155, .45); background: rgba(67, 221, 155, .07); }
.chip.acc { color: var(--accent2); border-color: rgba(60, 200, 245, .45); background: rgba(60, 200, 245, .08); }
.chip.bad { color: var(--danger); border-color: rgba(255, 122, 122, .45); background: rgba(255, 122, 122, .07); }

/* шаги */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.step {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: rgba(14, 20, 27, .7);
  display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; font-weight: 600;
}
.step i { font-style: normal; font-family: var(--mono); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line2); font-size: 12px; flex: none; }
.step.done { color: var(--text); }
.step.done i { background: var(--ok); color: #04150d; border-color: var(--ok); }
.step.cur { color: var(--text); border-color: rgba(60, 200, 245, .5); box-shadow: inset 0 0 0 1px rgba(60, 200, 245, .15); }
.step.cur i { border-color: var(--accent); color: var(--accent); }

/* список заявок */
.jobs { display: grid; gap: 10px; }
.job-row {
  display: grid; grid-template-columns: 1fr auto auto auto auto; gap: 18px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer;
  background: rgba(18, 26, 35, .82); transition: border-color .15s, background .15s; text-align: left; width: 100%;
}
.job-row:hover { border-color: var(--line2); background: rgba(23, 33, 44, .92); }
.job-row .t { font-weight: 700; }
.job-row .c { color: var(--muted); font-size: 13px; }
.kv { color: var(--muted); font-size: 12px; text-align: right; }
.kv b { display: block; color: var(--text); font-family: var(--mono); font-size: 14px; font-weight: 600; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty svg { width: 56px; height: 56px; color: var(--line2); margin-bottom: 10px; }

/* зона загрузки */
.drop {
  display: block;
  border: 1.5px dashed #3a5168; border-radius: 12px; padding: 26px 16px; text-align: center; cursor: pointer;
  background:
    repeating-linear-gradient(45deg, rgba(60, 200, 245, .025) 0 10px, transparent 10px 20px),
    rgba(10, 14, 19, .55);
  transition: border-color .15s, background-color .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background-color: rgba(60, 200, 245, .06); }
.drop svg { width: 34px; height: 34px; color: var(--accent); }
.drop b { display: block; font-size: 15px; margin: 6px 0 2px; }
.drop .types { margin-top: 10px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.progress { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 12px; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .2s; }

.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 16px; }
.file {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg2); display: flex; flex-direction: column;
}
.file .thumb { aspect-ratio: 4 / 3; background: #0b1016; display: grid; place-items: center; position: relative; overflow: hidden; }
.file .thumb img { width: 100%; height: 100%; object-fit: contain; }
.file .thumb .kind { position: absolute; left: 8px; top: 8px; background: #0e141b; }
.file .thumb .ico { width: 42px; height: 42px; color: var(--line2); }
.file .meta { padding: 9px 10px; display: grid; gap: 6px; font-size: 12px; }
.file .nm { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .row { display: flex; gap: 6px; align-items: center; justify-content: space-between; color: var(--muted); }
.pages { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; }
.pages button {
  flex: none; width: 34px; height: 44px; border-radius: 4px; border: 1px solid var(--line2); padding: 0;
  background-size: cover; background-position: center; cursor: pointer; position: relative; opacity: .55;
}
.pages button.on { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pages button span { position: absolute; right: 1px; bottom: 0; font: 10px var(--mono); background: rgba(0, 0, 0, .75); padding: 0 2px; border-radius: 2px; }
.geo3d { font-family: var(--mono); font-size: 12px; color: var(--accent2); }

.ai-box { border: 1px solid rgba(246, 181, 72, .35); background: rgba(246, 181, 72, .05); border-radius: 10px; padding: 12px 14px; margin-top: 14px; }
.ai-box ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }

/* таблица позиций */
.tbl-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.items { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 1060px; }
table.items th {
  text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim);
  font-weight: 700; padding: 8px 6px; border-bottom: 1px solid var(--line2); white-space: nowrap;
}
table.items td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.items tr.proposed td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
table.items tr.confirmed td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
table.items .input { padding: 6px 8px; border-radius: 6px; font-size: 13px; }
table.items .num-in { width: 76px; font-family: var(--mono); }
.params { display: flex; gap: 6px; flex-wrap: wrap; }
.params label { display: grid; gap: 2px; font: 10px var(--mono); color: var(--dim); }
.basis { font-size: 12px; color: var(--muted); margin-top: 4px; max-width: 260px; }
.actions { display: flex; gap: 4px; }
.icon-btn { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--text); border-color: #3e566f; }
.icon-btn.ok:hover { color: var(--ok); }
.icon-btn.del:hover { color: var(--danger); }
.icon-btn svg { width: 16px; height: 16px; }

/* итоги */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; }
.res {
  border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: rgba(10, 14, 19, .6); display: grid; gap: 10px;
  min-width: 0; overflow: hidden;
}
.res-h { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.res-h .art { flex-basis: 100%; word-break: break-all; }
.res-h b { font-size: 14px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.metric { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg2); }
.metric span { display: block; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.metric b { font: 600 15px var(--mono); white-space: nowrap; }
.price-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 13px; color: var(--muted); }
.price-line > b, .price-line > .price-big { margin-left: auto; text-align: right; }
.price-line b { color: var(--text); font-family: var(--mono); }
.price-big { font: 700 22px var(--mono); color: var(--accent2); }
.flags { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.flags li { font-size: 12px; color: var(--amber); padding-left: 16px; position: relative; }
.flags li::before { content: "!"; position: absolute; left: 3px; font-weight: 800; }
.total-bar {
  display: flex; gap: 22px; align-items: center; flex-wrap: wrap; border: 1px solid rgba(60, 200, 245, .35);
  background: linear-gradient(90deg, rgba(60, 200, 245, .10), rgba(60, 200, 245, .02)); border-radius: 12px; padding: 16px 18px; margin-top: 14px;
}
.total-bar .sp { flex: 1; }
.total-bar .kv { text-align: left; }
.total-bar .kv b { font-size: 20px; }
.demo-flag { color: var(--danger); font-weight: 700; font-size: 12px; letter-spacing: .04em; }

/* ставки */
.rates { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.rates .panel { margin: 0; }
.rate { display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.rate:last-child { border-bottom: 0; }
.rate span { color: var(--muted); font-size: 13px; }
.rate .input { font-family: var(--mono); text-align: right; padding: 7px 9px; }

/* модальное окно 3D */
.modal { position: fixed; inset: 0; background: rgba(3, 6, 9, .72); display: grid; place-items: center; z-index: 50; padding: 16px; backdrop-filter: blur(3px); }
.modal-card { width: min(980px, 100%); max-height: 100%; overflow: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-h b { flex: 1; }
.viewer-wrap { display: grid; grid-template-columns: 1fr 300px; }
.viewer {
  height: 460px; position: relative; cursor: grab;
  background:
    linear-gradient(rgba(60, 200, 245, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 200, 245, .06) 1px, transparent 1px),
    radial-gradient(circle at 50% 40%, #16222e, #0a0e13 70%);
  background-size: 32px 32px, 32px 32px, auto;
}
.viewer canvas { display: block; width: 100%; height: 100%; }
.viewer .hud { position: absolute; left: 12px; bottom: 10px; font: 11px var(--mono); color: var(--muted); }
.viewer-side { padding: 16px; border-left: 1px solid var(--line); display: grid; gap: 10px; align-content: start; }

.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 60; background: var(--panel3); border: 1px solid var(--line2);
  padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); max-width: 420px;
}
.toast.bad { border-color: rgba(255, 122, 122, .6); }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .25); border-top-color: currentColor; border-radius: 50%; animation: s .8s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }
.scan { position: relative; overflow: hidden; }
.scan::after { content: ""; position: absolute; left: 0; right: 0; height: 40%; top: -40%; background: linear-gradient(180deg, transparent, rgba(60, 200, 245, .18), transparent); animation: sc 1.6s linear infinite; }
@keyframes sc { to { top: 100%; } }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .side.open { display: flex; position: fixed; inset: 0 30% 0 0; z-index: 40; height: 100%; }
  .mobile-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(14, 20, 27, .92); position: sticky; top: 0; z-index: 30; }
  .main { padding: 18px 16px 50px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .job-row { grid-template-columns: 1fr auto; }
  .job-row .kv.x { display: none; }
  .viewer-wrap { grid-template-columns: 1fr; }
  .viewer { height: 320px; }
  .viewer-side { border-left: 0; border-top: 1px solid var(--line); }
  .row2 { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
}
::placeholder { color: var(--dim); opacity: 1; }
@media (max-width: 900px) { .files { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.scroll-hint { display: none; }
@media (max-width: 900px) { .scroll-hint { display: block; margin-bottom: 8px; } }
.stale { border: 1px solid rgba(246, 181, 72, .5); background: rgba(246, 181, 72, .07); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; color: var(--amber); font-weight: 600; }
.res.old { opacity: .55; }

/* подсказки «i» */
.tip{display:inline-flex;align-items:center;justify-content:center;width:15px;height:15px;margin-left:4px;border-radius:50%;
  border:1px solid currentColor;color:var(--muted,#8a8f98);font:600 10px/1 Georgia,serif;font-style:italic;cursor:help;
  position:relative;vertical-align:middle;flex:none;text-transform:none;letter-spacing:0;opacity:.8}
.tip:hover,.tip:focus{opacity:1;outline:none;color:var(--accent,#3b82f6)}
.tip::after{content:attr(data-tip);position:absolute;left:50%;top:calc(100% + 8px);transform:translateX(-50%);z-index:50;
  width:max-content;max-width:280px;padding:9px 11px;border-radius:8px;background:#1f2329;color:#f3f4f6;
  font:400 12.5px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif;font-style:normal;text-align:left;white-space:normal;
  box-shadow:0 6px 24px rgba(0,0,0,.25);opacity:0;pointer-events:none;transition:opacity .12s}
.tip:hover::after,.tip:focus::after{opacity:1}
th .tip::after{left:-12px;right:auto;transform:none}

/* ---------- три шага заявки: свой цвет у каждого блока (v1.1, 03.11.2026) ---------- */
.panel.stage { --c: 60, 200, 245; position: relative; padding-left: 24px; margin-bottom: 26px;
  background: linear-gradient(135deg, rgba(var(--c), .10) 0%, rgba(23, 33, 44, .82) 38%, rgba(16, 23, 31, .92) 100%);
  border: 1px solid rgba(var(--c), .30); box-shadow: 0 10px 28px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .04); }
.panel.stage::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; border-radius: var(--r) 0 0 var(--r);
  background: linear-gradient(180deg, rgb(var(--c)), rgba(var(--c), .25)); }
.panel.stage > .panel-h { margin: -18px -18px 16px -24px; padding: 14px 18px 14px 24px; border-bottom: 1px solid rgba(var(--c), .25);
  background: linear-gradient(90deg, rgba(var(--c), .16), rgba(var(--c), 0) 70%); border-radius: var(--r) var(--r) 0 0; }
.panel.stage > .panel-h h3 { font-size: 16px; color: #fff; }
.panel.stage .stepno { font-size: 14px; font-weight: 700; padding: 3px 9px; color: rgb(var(--c));
  border-color: rgba(var(--c), .6); background: rgba(var(--c), .12); }
.panel.stage.s1 { --c: 60, 200, 245; }   /* материалы — голубой */
.panel.stage.s2 { --c: 167, 139, 250; }  /* позиции — сиреневый */
.panel.stage.s3 { --c: 67, 221, 155; }   /* расчёт и КП — зелёный */
.panel.stage.s1 .drop { border-color: rgba(var(--c), .45); }
.panel.stage.s3 .total-bar { border-color: rgba(var(--c), .4); }

.metric span.tip { display: inline-flex; font-size: 10px; color: var(--muted); margin-left: 4px; vertical-align: -2px; }

.metric span.tip::after { text-transform: none; letter-spacing: 0; }

.assumed { margin: 6px 0 4px; font-size: 12.5px; }
.assumed summary { cursor: pointer; color: var(--muted, #9aa7b4); }
.assumed ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.45; }
.assumed li { margin: 2px 0; }

/* ---------- v1.5 (03.11.2026): блоки отделены друг от друга и от фона ---------- */
.side { background: #0c1218; border-right: 1px solid var(--line2); box-shadow: 4px 0 18px rgba(0, 0, 0, .35); }
.panel.stage { margin-bottom: 40px; padding: 18px 22px 22px 28px;
  background: linear-gradient(180deg, rgba(var(--c), .07), rgba(var(--c), .02) 120px), #111921;
  border: 1.5px solid rgba(var(--c), .55);
  box-shadow: 0 0 0 4px rgba(var(--c), .06), 0 14px 34px rgba(0, 0, 0, .45); }
.panel.stage::before { width: 7px; background: rgb(var(--c)); }
.panel.stage > .panel-h { margin: -18px -22px 18px -28px; padding: 15px 22px 15px 28px;
  background: rgba(var(--c), .16); border-bottom: 1.5px solid rgba(var(--c), .45); }
.panel.stage > .panel-h h3 { font-size: 17px; letter-spacing: .01em; }
.panel.stage .stepno { background: rgb(var(--c)); color: #071016; border-color: rgb(var(--c)); }

/* внутренние блоки — отдельные карточки на тёмной подложке */
.panel.stage .drop { background-color: rgba(var(--c), .05); border-width: 2px; }
.panel.stage .field > textarea, .panel.stage textarea.input { background: #0a1016; border-color: var(--line2); }
.panel.stage .ai-box { border-width: 1.5px; background: rgba(246, 181, 72, .07); }

table.items { border-spacing: 0 10px; margin-top: -6px; }
table.items th { border-bottom: 0; padding-bottom: 0; }
table.items td { background: #17212c; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); padding: 10px 8px; }
table.items td:first-child { border-left: 1px solid var(--line2); border-radius: 10px 0 0 10px; }
table.items td:last-child { border-right: 1px solid var(--line2); border-radius: 0 10px 10px 0; }
table.items tr.proposed td:first-child { box-shadow: inset 5px 0 0 var(--amber); padding-left: 14px; }
table.items tr.confirmed td:first-child { box-shadow: inset 5px 0 0 var(--ok); padding-left: 14px; }
table.items td + td { box-shadow: inset 1px 0 0 rgba(255, 255, 255, .04); }
table.items tr:hover td { background: #1b2733; }

.res-grid { gap: 16px; }
.res { background: #17212c; border: 1.5px solid rgba(var(--c, 60, 200, 245), .35); border-radius: 12px; padding: 0 14px 14px; gap: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3); overflow: hidden; }
.res > * { margin-top: 10px; }
.res-h { margin: 0 -14px 4px; padding: 12px 14px; background: rgba(var(--c, 60, 200, 245), .12);
  border-bottom: 1px solid rgba(var(--c, 60, 200, 245), .3); align-items: center; }
.res .metric { background: #0e151c; border-color: var(--line2); }
.res .price-line { padding: 7px 0; margin-top: 0; border-bottom: 1px dashed rgba(255, 255, 255, .08); align-items: baseline; gap: 12px; }
.res .price-line b { text-align: right; }
.res .price-line.stack { flex-direction: column; gap: 3px; border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; background: #0e151c; margin-top: 10px; }
.res .price-line.stack b { margin-left: 0; text-align: left; font-size: 12.5px; line-height: 1.4; }
.res .price-line:last-of-type { border-bottom: 0; }
.res .assumed { border: 1px solid rgba(167, 139, 250, .35); background: rgba(167, 139, 250, .06); border-radius: 8px; padding: 8px 10px; }
.res .assumed summary { color: #cbbdfd; font-weight: 600; }
.res .flags { margin-top: 8px; }
.panel.stage .total-bar { border-width: 1.5px; background: rgba(var(--c), .10); margin-top: 20px; }

.btn-3d { color: #0b1016; background: #a08cf0; border-color: #a08cf0; font-weight: 700; white-space: nowrap; }
.btn-3d:hover { background: #b8a8f7; border-color: #b8a8f7; }
.res-h .btn-3d { padding: 3px 9px; font-size: 12px; margin-left: auto; }
.terms-card { width: min(640px, calc(100vw - 32px)); height: min(560px, calc(100vh - 48px)); max-height: none; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.terms-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 22px; line-height: 1.5; font-size: 12.5px; }
.terms-body h2 { margin: 0 0 4px; font-size: 17px; }
.terms-body h3 { margin: 14px 0 4px; font-size: 13px; color: var(--accent2); }
.terms-body p, .terms-body li { color: #d5dee7; }
.terms-body .tv { color: var(--muted); margin: 0 0 8px; }
.terms-foot { flex: 0 0 auto; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 26px; border-top: 1px solid var(--line2); background: var(--panel2); }
.terms-foot .sp { flex: 1; }

.ways { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: 10px; }
.ways .way { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border: 1px solid var(--line2); border-radius: 999px; font-size: 12.5px; color: #d5dee7; background: var(--panel2); }

.batch { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.batch #ylink { flex: 1 1 260px; min-width: 0; }
.meta .dir { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* доступ */
table.acc { width: 100%; border-collapse: collapse; margin-top: 10px; }
table.acc td { padding: 10px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.btn.danger { border-color: rgba(255, 122, 122, .45); }
