/* HIGOLD — форма спецификации */
.spec-hero {
  background: linear-gradient(160deg, #0d1116 0%, #16202b 60%, #1d2b38 100%);
  color: #fff;
  padding: 58px 0 46px;
}
.spec-hero h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
  margin: 14px 0 16px;
  max-width: 18ch;
}
.spec-hero h1 em { font-style: normal; color: #c9a227; }
.spec-hero p { max-width: 62ch; color: rgba(255,255,255,.78); font-size: 16px; line-height: 1.6; }

.spec-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding: 34px 0 70px;
}
.spec-side {
  position: sticky;
  top: 92px;
  background: #fff;
  border: 1px solid #e4e8ec;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(16,24,32,.06);
}
.spec-side h3 { font-size: 16px; margin: 0 0 4px; }
.spec-side p.hint { font-size: 13px; color: #6b7783; margin: 0 0 14px; line-height: 1.5; }
.spec-side input[type="search"] {
  width: 100%; padding: 11px 12px; border: 1px solid #d7dde3; border-radius: 9px; font: inherit;
}
.spec-results { list-style: none; margin: 12px 0 0; padding: 0; max-height: 46vh; overflow: auto; }
.spec-results li {
  border-bottom: 1px solid #eef1f4; padding: 9px 4px; cursor: pointer; font-size: 14px;
  transition: background .15s ease;
}
.spec-results li:hover { background: #f6f8fa; }
.spec-results b { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: #c9a227; }
.spec-results span { color: #4a5763; }
.spec-results em { font-style: normal; color: #8b97a3; font-size: 12px; }
.spec-results .empty { color: #8b97a3; cursor: default; }
.spec-side .note { margin-top: 14px; font-size: 12px; color: #8b97a3; line-height: 1.5; }

.spec-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 14px;
}
.spec-toolbar .grow { flex: 1; }
.btn-ghost {
  background: #fff; color: #1b2530; border: 1px solid #d7dde3; border-radius: 9px;
  padding: 10px 16px; font: inherit; cursor: pointer; font-weight: 500;
}
.btn-ghost:hover { border-color: #1b2530; }
.btn-ghost.on { background: #1b2530; color: #fff; border-color: #1b2530; }
.btn-ghost.danger:hover { border-color: #b03030; color: #b03030; }

.spec-doc {
  background: #fff; border: 1px solid #e4e8ec; border-radius: 14px;
  padding: 34px 32px 40px; box-shadow: 0 12px 30px rgba(16,24,32,.06);
}
.spec-head { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; margin-bottom: 18px; }
.spec-head .org { font-weight: 700; font-size: 17px; letter-spacing: .01em; }
.spec-head .app { text-align: right; font-size: 13px; line-height: 1.5; color: #4a5763; }
.spec-title {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  border-top: 1px solid #d7dde3; border-bottom: 1px solid #d7dde3;
  padding: 12px 0; margin-bottom: 16px;
}
.spec-title label { font-size: 14px; color: #4a5763; }
.spec-title input {
  font: inherit; padding: 7px 10px; border: 1px solid #d7dde3; border-radius: 8px;
}
.spec-title input[type="text"] { width: 130px; }
.spec-title input[type="date"] { width: 165px; }
.spec-title .chip {
  margin-left: auto; font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: #c9a227; border: 1px solid #e3d3a0; border-radius: 999px; padding: 5px 12px;
}

.spec-table-wrap { overflow-x: auto; }
table.spec { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.spec th, table.spec td {
  border: 1px solid #dfe4e9; padding: 7px 8px; vertical-align: middle; text-align: left;
}
table.spec thead th {
  background: #f4f6f8; font-weight: 600; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .04em; color: #4a5763; white-space: nowrap;
}
table.spec td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.spec td.center { text-align: center; }
table.spec td .mono { font-family: 'IBM Plex Mono', monospace; font-size: 12px; }
table.spec img.ph { width: 46px; height: 46px; object-fit: contain; display: block; }
table.spec .ph-box {
  width: 46px; height: 46px; display: grid; place-items: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: #9aa6b2; text-align: center;
}
table.spec input, table.spec select {
  width: 100%; font: inherit; font-size: 12.5px; padding: 5px 7px;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
}
table.spec input:hover, table.spec select:hover { border-color: #e4e8ec; }
table.spec input:focus, table.spec select:focus { border-color: #1b2530; outline: none; }
table.spec input.qty { text-align: right; width: 62px; }
table.spec .row-del {
  border: 0; background: none; color: #b03030; cursor: pointer; font-size: 15px; line-height: 1;
}
table.spec tbody tr:nth-child(even) { background: #fbfcfd; }
td.price, th.price { text-align: right; }
body.hide-prices .price { display: none; }

.spec-totals { display: flex; flex-wrap: wrap; gap: 26px; align-items: baseline; margin-top: 16px; }
.spec-totals .t { font-size: 14px; color: #4a5763; }
.spec-totals .t b { display: block; font-size: 20px; color: #1b2530; }
.spec-notes { margin-top: 20px; font-size: 12.5px; color: #4a5763; line-height: 1.7; }
.spec-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 28px; font-size: 13px; }
.spec-sign .role { color: #8b97a3; font-size: 12px; }
.spec-sign .line { border-bottom: 1px solid #c9d1d9; height: 26px; margin-bottom: 6px; }
.spec-status { margin-top: 14px; font-size: 13px; min-height: 20px; }
.spec-status.ok { color: #2f7d5e; }
.spec-status.err { color: #b03030; }

@media (max-width: 1080px) {
  .spec-layout { grid-template-columns: 1fr; }
  .spec-side { position: static; }
}
@media (max-width: 720px) {
  .spec-doc { padding: 20px 14px 26px; }
  .spec-head, .spec-sign { grid-template-columns: 1fr; }
  .spec-head .app { text-align: left; }
}

/* ---------- печать ---------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; }
  .topbar, .header, .footer, .spec-hero, .spec-side, .spec-toolbar, .spec-status, .no-print { display: none !important; }
  .spec-layout { display: block; padding: 0; }
  .spec-doc { border: 0; box-shadow: none; padding: 0; border-radius: 0; }
  table.spec { font-size: 9px; }
  table.spec th, table.spec td { padding: 3px 4px; }
  table.spec input, table.spec select { border: 0; padding: 0; }
  table.spec img.ph { width: 26px; height: 26px; }
  table.spec .ph-box { width: 26px; height: 26px; font-size: 7px; }
  .spec-totals .t b { font-size: 14px; }
}

#send-form {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e4e8ec;
}
#send-form input, #send-form textarea {
  font: inherit; padding: 10px 12px; border: 1px solid #d7dde3; border-radius: 9px; width: 100%;
}
#send-form textarea { grid-column: 1 / -1; min-height: 80px; }
@media (max-width: 720px) { #send-form { grid-template-columns: 1fr; } }

#send-form { display: grid; }
#send-form .label { grid-column: 1 / -1; margin-bottom: 2px; }


/* ---------- гейт B2B ---------- */
.spec-gate { padding: 56px 0 80px; background: var(--l-bg, #E8EBEF); }
.gate-card { max-width: 780px; background: #fff; border: 1px solid var(--l-line); padding: 40px; }
.gate-card h2 { margin: 12px 0 12px; font-size: clamp(24px, 2.6vw, 34px); line-height: 1.15; }
.gate-card > p { color: var(--l-muted); max-width: 60ch; }
.gate-note { display: block; margin-top: 12px; font-size: 13px; color: var(--l-muted); }
.gate-login { margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--l-line); }
.gate-login h3 { margin: 0 0 12px; font-size: 17px; }
.gate-login-row { display: flex; gap: 10px; flex-wrap: wrap; }
.gate-login-row input { flex: 1 1 220px; padding: 12px 14px; border: 1px solid var(--l-line); font: inherit; }

/* ---------- режим розницы ---------- */
body.retail-mode .price-opt { display: none; }
body.retail-mode .spec-title .chip::after { content: " · розничные цены"; }
body.retail-mode .spec-totals .t.price:nth-of-type(1) { }
