:root {
  --bg0: #07090d;
  --bg1: #0d1219;
  --panel: rgba(16, 22, 32, 0.82);
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8edf5;
  --muted: #8b96a8;
  --ember: #ff6b3d;
  --ember2: #ffb347;
  --cyan: #3ecfcf;
  --ok: #4ade80;
  --danger: #ff7b7b;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg0);
  position: relative;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(255, 107, 61, 0.18), transparent 55%),
    radial-gradient(900px 600px at 95% 10%, rgba(62, 207, 207, 0.12), transparent 50%),
    radial-gradient(800px 500px at 70% 100%, rgba(255, 179, 71, 0.08), transparent 55%),
    linear-gradient(180deg, #07090d 0%, #0a0f16 50%, #07090d 100%);
}
.bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, #000 35%, transparent 80%);
  animation: gridDrift 28s linear infinite;
}
.bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: float 14s ease-in-out infinite;
}
.bg__orb--a {
  width: 340px; height: 340px;
  left: -80px; top: 20%;
  background: radial-gradient(circle, rgba(255,107,61,0.55), transparent 70%);
}
.bg__orb--b {
  width: 420px; height: 420px;
  right: -120px; top: -40px;
  background: radial-gradient(circle, rgba(62,207,207,0.4), transparent 70%);
  animation-delay: -4s;
}
.bg__orb--c {
  width: 280px; height: 280px;
  right: 20%; bottom: 5%;
  background: radial-gradient(circle, rgba(255,179,71,0.28), transparent 70%);
  animation-delay: -8s;
}
.bg__scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.08) 3px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  opacity: 0.35;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-28px) scale(1.05); }
}
@keyframes gridDrift {
  from { transform: translateY(0); }
  to { transform: translateY(56px); }
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.top {
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  background: rgba(7, 9, 13, 0.55);
  position: sticky;
  top: 0;
  z-index: 20;
}
.top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 4px rgba(255,107,61,0.2), 0 0 18px rgba(255,107,61,0.7);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255,107,61,0.2), 0 0 18px rgba(255,107,61,0.7); }
  50% { box-shadow: 0 0 0 8px rgba(255,107,61,0.08), 0 0 28px rgba(255,107,61,0.9); }
}
.brand__name {
  font-family: Syne, sans-serif;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 15px;
}
.top__meta { color: var(--muted); font-size: 13px; }
.top__nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.top__nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.top__nav a:hover { color: var(--text); }
.top__nav a.is-active {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.settings-layout {
  padding: 24px 20px 56px;
  max-width: 900px;
}
.settings-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.settings-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
}
.settings-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}
.settings-table .num { text-align: right; }
.settings-input {
  width: 100%;
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  outline: none;
}
.settings-input--num {
  max-width: 140px;
  text-align: right;
  margin-left: auto;
  display: block;
  font-variant-numeric: tabular-nums;
}
.settings-input:focus {
  border-color: rgba(62, 207, 207, 0.55);
  box-shadow: 0 0 0 3px rgba(62, 207, 207, 0.12);
}
.mt-btn { margin-top: 12px; }
.ai-model-panel {
  margin: 4px 0 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}
.ai-model-panel__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.ai-model-panel__title {
  margin: 0;
  font-size: 16px;
}
.ai-model-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ai-model-option {
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ai-model-option:hover {
  border-color: rgba(62, 207, 207, 0.45);
}
.ai-model-option[aria-pressed="true"] {
  border-color: rgba(74, 222, 128, 0.55);
  background: rgba(74, 222, 128, 0.08);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.2);
}
.ai-model-option__name {
  font-weight: 700;
  font-size: 14px;
}
.ai-model-option__hint {
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 640px) {
  .ai-model-switch { grid-template-columns: 1fr; }
}
.ghost--small {
  padding: 6px 10px;
  font-size: 12px;
}
.settings-actions {
  margin-top: 22px;
  display: grid;
  gap: 8px;
}

.systems { padding: 8px 20px 0; }
.systems__list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.sys-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(16, 22, 32, 0.65);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.sys-btn:hover {
  border-color: rgba(62, 207, 207, 0.4);
  transform: translateY(-1px);
}
.sys-btn.is-active {
  border-color: rgba(255, 107, 61, 0.65);
  box-shadow: 0 0 0 3px rgba(255, 107, 61, 0.12), 0 12px 28px rgba(0, 0, 0, 0.25);
  background: rgba(255, 107, 61, 0.08);
}
.sys-btn__name {
  font-family: Syne, sans-serif;
  font-weight: 700;
  font-size: 15px;
}
.sys-btn__meta {
  color: var(--muted);
  font-size: 12px;
}
.h2-sub {
  color: var(--muted);
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}
.eq-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}
.eq-toolbar__meta {
  color: var(--muted);
  font-size: 12px;
}
.eq-toolbar__meta strong {
  color: var(--text);
  font-weight: 600;
}
.eq-toolbar__meta a {
  color: var(--ember2);
}
.eq-toolbar__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.eq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.eq-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.eq-row__name {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.eq-row__prices {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}
.eq-row__date {
  opacity: 0.85;
}
.eq-row__role {
  margin-left: 2px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 107, 61, 0.12);
  color: var(--ember2);
  font-size: 11px;
}
.eq-row__src {
  margin-left: 4px;
  font-size: 11px;
  color: var(--ember2);
  text-decoration: none;
}
.eq-row__src:hover {
  text-decoration: underline;
}
.eq-row--material {
  border-color: rgba(62, 207, 207, 0.25);
}
.eq-section-title {
  margin-top: 28px !important;
}
.eq-row--price {
  border-color: rgba(255, 107, 61, 0.2);
}
.eq-row__sep { opacity: 0.5; margin: 0 4px; }
.price-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px 8px 2px 4px;
  background: rgba(255, 107, 61, 0.08);
}
.price-edit__input {
  width: 84px;
  border: none !important;
  background: transparent;
  color: var(--ember2);
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 4px 2px;
  text-align: right;
  -moz-appearance: textfield;
  appearance: textfield;
}
.price-edit__input:focus {
  outline: none;
  color: var(--text);
}
.price-edit__input::-webkit-outer-spin-button,
.price-edit__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.price-edit__cur {
  color: var(--muted);
  font-size: 12px;
}
.price-edit--lg {
  padding: 8px 16px 8px 12px;
  border-radius: 12px;
  background: rgba(255, 107, 61, 0.1);
  border-color: rgba(255, 107, 61, 0.3);
}
.price-edit--lg .price-edit__input {
  width: 120px;
  font-size: 19px;
  padding: 6px 2px;
}
.price-edit--lg .price-edit__cur {
  font-size: 15px;
  font-weight: 600;
}
.add-eq-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  background: #16181f;
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.add-eq-dialog::backdrop {
  background: rgba(6, 8, 12, 0.65);
}
.add-eq-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.add-eq-dialog__head h3 {
  margin: 0;
  font-family: Syne, sans-serif;
  font-size: 18px;
}
.add-eq-dialog__hint {
  margin: 0;
  padding: 10px 16px 0;
  color: var(--muted);
  font-size: 12px;
}
.add-eq-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px 16px;
  overflow: auto;
  max-height: 50vh;
}
.add-eq-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.add-eq-item:hover {
  border-color: rgba(255, 107, 61, 0.45);
  background: rgba(255, 107, 61, 0.08);
}
.add-eq-item__name {
  font-size: 13px;
  font-weight: 600;
}
.add-eq-item__price {
  font-size: 12px;
  color: var(--muted);
}
.table-note {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}
.qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}
.qty__btn {
  width: 34px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.qty__btn:hover {
  background: rgba(255, 107, 61, 0.18);
  color: var(--ember2);
}
.qty__btn:active {
  background: rgba(255, 107, 61, 0.28);
}
.qty__input {
  width: 52px;
  margin: 0;
  border: none !important;
  border-left: 1px solid var(--line) !important;
  border-right: 1px solid var(--line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-align: center;
  padding: 10px 4px;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}
.qty__input::-webkit-outer-spin-button,
.qty__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.eq-empty {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px dashed rgba(255, 179, 71, 0.35);
  border-radius: 12px;
  color: var(--ember2);
  font-size: 13px;
  line-height: 1.45;
}

.hero { padding: 42px 20px 10px; }
.hero__eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding: 5px 12px;
  border: 1px solid rgba(255,107,61,0.35);
  border-radius: 999px;
  color: var(--ember2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0 0 12px;
  font-family: Syne, sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.hero__lead {
  margin: 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
  padding: 24px 20px 56px;
}
.layout--single {
  grid-template-columns: minmax(0, 820px);
  justify-content: start;
}
.eq-meta {
  margin: -8px 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.eq-meta strong {
  color: var(--text);
  font-weight: 600;
}
.eq-meta a {
  color: var(--ember2);
}
.smeta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}
.smeta-inline {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.smeta-actions--bottom {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.spec-import {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.spec-report {
  width: 100%;
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
}
.spec-report__title {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.spec-report__sub {
  margin-top: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}
.spec-report__list {
  margin: 0;
  padding-left: 18px;
  color: #c5cedb;
}
.spec-report__list--dim {
  opacity: 0.75;
}
.spec-report .muted {
  color: var(--muted);
  font-weight: 400;
}
.settings-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.settings-topbar__title {
  margin: 0 0 4px !important;
}
.settings-topbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.settings-auth {
  max-width: 420px;
  margin: 24px auto 0;
}
.settings-auth__lead {
  margin: 0 0 16px;
  font-size: 14px;
}
.password-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px 16px;
}
.mt-btn {
  margin-top: 8px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  backdrop-filter: blur(16px);
}
.panel h2 {
  margin: 0 0 16px;
  font-family: Syne, sans-serif;
  font-size: 18px;
  font-weight: 700;
}
.mt { margin-top: 22px !important; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}
input, select {
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
  color-scheme: dark;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input:focus, select:focus {
  border-color: rgba(62, 207, 207, 0.55);
  box-shadow: 0 0 0 3px rgba(62, 207, 207, 0.12);
}
select option { background: #121821; color: var(--text); }

.checks { display: grid; gap: 10px; margin: 16px 0; }
.check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.check input { width: auto; accent-color: var(--ember); }

.cta {
  width: 100%;
  margin-top: 8px;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  color: #140b08;
  cursor: pointer;
  background: linear-gradient(135deg, var(--ember2), var(--ember));
  box-shadow: 0 10px 30px rgba(255, 107, 61, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.cta:hover { filter: brightness(1.05); transform: translateY(-1px); }
.cta:disabled { opacity: 0.65; cursor: wait; transform: none; }

.hint { min-height: 1.3em; color: var(--danger); font-size: 13px; font-weight: 500; }
.hint.is-ok { color: var(--ok); }
.hint.is-loading {
  color: var(--ok);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.spec-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(74, 222, 128, 0.28);
  border-top-color: var(--ok);
  border-radius: 50%;
  flex: 0 0 auto;
  animation: spec-spin 0.7s linear infinite;
}
@keyframes spec-spin {
  to { transform: rotate(360deg); }
}
.spec-auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.result__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}
.ghost:hover { border-color: rgba(62,207,207,0.5); }
.empty { color: var(--muted); line-height: 1.55; }

.summary { color: #c5cedb; line-height: 1.55; margin: 0 0 14px; }
.block-title {
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table td {
  padding: 9px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
}
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.note { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.totals {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  text-align: right;
  color: #c5cedb;
}
.totals .total {
  margin-top: 6px;
  font-family: "Roboto", "DM Sans", sans-serif;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: var(--ember2);
}
.lists { margin-top: 16px; }
.lists h3 { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.lists ul { margin: 0 0 12px; padding-left: 18px; color: #c5cedb; font-size: 13px; }

.foot {
  padding: 8px 20px 40px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 960px) {
  .layout, .grid2, .grid3, .systems__list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .systems__list { grid-template-columns: 1fr; }
}

@media print {
  .bg, .top, .hero, .form, .foot, .ghost { display: none !important; }
  body { background: #fff; color: #111; }
  .layout { display: block; padding: 0; }
  .panel { background: #fff; border: none; box-shadow: none; color: #111; }
  .summary, .totals, .lists ul, .table td { color: #111; }
  .totals .total, .block-title { color: #000; }
}
