/* Compact layout shared by the public and manager calculators and export pages. */
.hardware-calc {
  --calc-ink: #1e293b;
  --calc-muted: #647084;
  --calc-line: #e1e6ed;
  gap: 18px;
  padding: 24px clamp(16px, 2.5vw, 40px) 40px;
  font-family: Manrope, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  background: #f5f6f8;
  color: var(--calc-ink);
}

/* Regular body copy, with stronger weight only for hierarchy and actions. */
.hardware-calc *,
.hardware-calc input::file-selector-button {
  font-family: inherit !important;
  font-weight: 400 !important;
}

.hardware-calc-head {
  position: relative;
}

.hardware-calc-head--manager {
  padding-right: 190px;
}

.hardware-calc-head h1 {
  margin-bottom: 8px;
  font-size: clamp(25px, 2.4vw, 33px);
  line-height: 1.2;
  letter-spacing: -0.04em;
  text-transform: none;
  color: var(--calc-ink);
}

.hardware-calc-head p:not(.eyebrow) {
  max-width: 900px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--calc-muted);
}

.hardware-calc .eyebrow {
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #bb1724;
}

.hardware-calc .btn {
  min-height: 38px;
  padding: 9px 14px;
  font-size: 13px;
  line-height: 1.3;
  white-space: normal;
  border-radius: 8px;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.hardware-calc-head-actions {
  position: absolute;
  top: 18px;
  right: 0;
  gap: 8px;
  margin-top: 0;
}

.hardware-calc-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 20px;
}

.hardware-calc-main {
  gap: 16px;
}

.hardware-calc-panel {
  gap: 12px;
  padding: 14px;
  border-color: var(--calc-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(30, 41, 59, 0.035);
}

.hardware-calc-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hardware-calc-panel-head h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-transform: none;
}

.hardware-calc-step {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #fff0f1;
  color: #bb1724;
  font-size: 11px;
}

.hardware-calc-switch {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: 9px;
  background: #f0f2f5;
}

.hardware-calc-switch span {
  height: 100%;
  min-height: 52px;
  padding: 7px 8px;
  font-size: 12px;
  line-height: 1.3;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  color: #536075;
}

.hardware-calc-switch input:checked + span {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 2px 5px rgba(227, 6, 19, 0.14);
}

.hardware-calc-switch input:focus-visible + span,
.hardware-calc-fields .hardware-calc-checkbox input:focus-visible + span {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.hardware-calc-fields {
  gap: 10px;
}

.hardware-calc-fields label,
.hardware-calc-add label,
.hardware-export-panel label {
  gap: 4px;
  font-size: 12px;
  line-height: 1.35;
  text-transform: none;
  color: #586579;
}

.hardware-calc-fields input,
.hardware-calc-fields select,
.hardware-calc-add input,
.hardware-export-panel input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 14px;
  border-color: #dce2e9;
  border-radius: 7px;
  background-color: #fafbfc;
  color: var(--calc-ink);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.hardware-calc-fields select {
  padding-right: 28px;
  background-position: right 15px center, right 9px center;
  background-size: 6px 6px;
}

.hardware-calc-fields .hardware-calc-checkbox span {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 7px;
}

.hardware-calc-result {
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--calc-line);
  border-radius: 12px;
  background: #fff;
}

.hardware-calc-summary {
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom-width: 1px;
  border-color: var(--calc-line);
}

.hardware-calc-summary h2,
.hardware-order-head h2 {
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.025em;
  text-transform: none;
  color: var(--calc-ink);
}

.hardware-calc-size {
  max-width: 100%;
  padding: 7px 10px;
  font-size: 15px;
  border: 1px solid #e0e6ee;
  border-radius: 7px;
  background: #f1f4f8;
  color: #39485c;
}

.hardware-calc-alert {
  padding: 10px 12px;
  border-left-width: 3px;
  font-size: 13px;
  border-radius: 6px;
}

.hardware-calc-list {
  gap: 6px;
  max-height: clamp(112px, calc(100dvh - 640px), 360px);
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #c9d0db transparent;
}

.hardware-calc-item {
  grid-template-columns: 28px minmax(0, 1fr) 36px;
  gap: 10px;
  padding: 8px 10px;
  border-color: #e8ecf1;
  border-radius: 7px;
  transition: background 160ms ease, border-color 160ms ease;
}

.hardware-calc-item:hover {
  border-color: #d5dce5;
  background: #fafbfc;
}

.hardware-calc-item > span {
  width: 26px;
  height: 26px;
  font-size: 12px;
  border-radius: 6px;
  background: #f0f3f7;
  color: #7a8798;
}

.hardware-calc-item h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  color: #4b586b;
}

.hardware-calc-item p,
.hardware-calc-item-code {
  font-size: 12px;
  line-height: 1.3;
}

.hardware-calc-item strong {
  grid-column: auto;
  font-size: 14px;
  text-align: center;
  padding: 5px 2px;
  border-radius: 5px;
  background: #f2f5f9;
  color: #26354b;
}

.hardware-calc-note {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.4;
  color: #7d8796;
}

.hardware-calc-add {
  grid-template-columns: minmax(0, 170px) minmax(0, max-content);
  gap: 10px;
  padding-top: 0;
}

.hardware-order,
.hardware-export-panel {
  gap: 12px;
  top: 80px;
  padding: 14px;
  border-color: var(--calc-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(30, 41, 59, 0.035);
}

.hardware-order {
  position: sticky;
  max-height: calc(100dvh - 100px);
  border-top: 3px solid var(--red);
}

.hardware-order-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--calc-line);
}

.hardware-order-empty {
  padding: 12px;
  font-size: 13px;
  border-radius: 7px;
  border-color: #d8dfe9;
  background: #f8fafc;
  color: #788496;
}

.hardware-order-list {
  gap: 12px;
}

.hardware-order-item {
  gap: 6px;
  padding-bottom: 12px;
  border-color: var(--calc-line);
}

.hardware-order-item h3 {
  font-size: 15px;
  line-height: 1.35;
  color: #26354b;
}

.hardware-order-item-head {
  gap: 6px;
}

.hardware-order-item-head button {
  min-height: 28px;
  padding: 3px 6px;
  font-size: 11px;
  text-transform: none;
  border-radius: 5px;
  border-color: var(--calc-line);
}

.hardware-order-item p {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 4px;
  background: #f1f4f8;
  color: #65728a;
  font-size: 12px;
}

.hardware-order-item ul {
  gap: 5px;
}

.hardware-order-item li {
  grid-template-columns: minmax(0, 1fr) minmax(72px, 0.6fr) 24px;
  gap: 6px;
  font-size: 12px;
  overflow-wrap: anywhere;
  color: #657084;
}

.hardware-order-item li b,
.hardware-order-item li strong {
  font-size: 12px;
  color: #35445a;
}

.hardware-export-layout {
  grid-template-columns: minmax(260px, 0.35fr) minmax(0, 1fr);
  gap: 20px;
}

.hardware-export-layout-single {
  max-width: 520px;
  grid-template-columns: minmax(0, 1fr);
}

.hardware-offer-upload {
  gap: 8px;
  padding-top: 12px;
  min-width: 0;
  border-color: var(--calc-line);
}

.hardware-offer-upload select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #dce2e9;
  border-radius: 7px;
  background: #fafbfc;
  color: #26354b;
  font: inherit;
  font-size: 14px;
}

.hardware-offer-upload input[type="file"] {
  padding: 8px;
  font-size: 12px;
  border-style: dashed;
  background: #f8fafc;
}

.hardware-offer-upload p {
  font-size: 12px;
}

.hardware-export-order {
  gap: 14px;
}

.hardware-calc .btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 3px 8px rgba(227, 6, 19, 0.12);
  transform: none;
}

.hardware-calc .btn-primary:hover {
  background: #c90012;
  box-shadow: 0 4px 12px rgba(227, 6, 19, 0.18);
}

.hardware-calc .btn-secondary {
  border: 1px solid #d9e0e9;
  background: #fff;
  color: #4b586b;
  box-shadow: none;
  transform: none;
}

.hardware-calc .btn-secondary:hover {
  border-color: #bfc9d8;
  background: #f8fafc;
}

.hardware-calc .btn:disabled {
  border-color: transparent;
  background: #e9edf2;
  color: #929cab;
  box-shadow: none;
  transform: none;
}

.hardware-calc input:focus,
.hardware-calc select:focus {
  outline: none;
  border-color: #e77b83;
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.07);
  background-color: #fff;
}

.hardware-calc-head h1,
.hardware-calc-panel-head h2,
.hardware-calc-summary h2,
.hardware-order-head h2,
.hardware-calc .btn,
.hardware-calc .hardware-calc-item-code,
.hardware-calc-item strong,
.hardware-order-item li b,
.hardware-order-item li strong {
  font-weight: 700 !important;
}

.hardware-calc .eyebrow,
.hardware-calc-step,
.hardware-calc-switch input:checked + span,
.hardware-calc-size,
.hardware-order-item h3 {
  font-weight: 700 !important;
}

.hardware-calc .hardware-calc-item-code {
  margin-bottom: 3px;
  color: #bb1724;
  letter-spacing: 0.02em;
}

@media (max-width: 1200px) {
  .hardware-calc-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hardware-calc-list {
    max-height: clamp(100px, calc(100dvh - 710px), 300px);
  }
}

@media (max-width: 980px) {
  .hardware-calc-workspace,
  .hardware-export-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .hardware-order,
  .hardware-export-panel {
    position: static;
    max-height: none;
  }

  .hardware-calc-list {
    max-height: none;
    overflow: visible;
    scrollbar-gutter: auto;
  }
}

@media (max-width: 760px) {
  .hardware-calc {
    gap: 16px;
    padding: 20px 16px 32px;
  }

  .hardware-calc-head h1 {
    font-size: 26px;
  }

  .hardware-calc-head--manager {
    padding-right: 0;
  }

  .hardware-calc-head-actions {
    position: static;
    margin-top: 12px;
  }

  .hardware-calc-switch,
  .hardware-calc-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hardware-calc-switch label:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .hardware-calc-fields input,
  .hardware-calc-fields select,
  .hardware-calc-add input,
  .hardware-export-panel input {
    min-height: 40px;
    font-size: 16px;
  }

  .hardware-calc-summary {
    display: flex;
    flex-wrap: wrap;
  }

  .hardware-calc-summary h2,
  .hardware-order-head h2 {
    font-size: 19px;
  }

  .hardware-order-item-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .hardware-order-item li strong {
    text-align: right;
  }

  .hardware-calc-add {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }

  .hardware-calc .btn {
    min-height: 40px;
    padding: 9px 10px;
  }
}

@media (max-width: 360px) {
  .hardware-calc-fields,
  .hardware-calc-add {
    grid-template-columns: minmax(0, 1fr);
  }
}

[data-hardware-form][data-hardware-mode="provedal-tilt-turn"] .hardware-calc-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 520px;
}

/* Door parameters are independent of window dimensions. */
[data-crm-doors-enabled="true"] .hardware-calc-switch { grid-template-columns:repeat(auto-fit,minmax(135px,1fr)); }
[data-hardware-form][data-hardware-mode="doors"] .hardware-calc-fields { grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); }
[data-crm-doors-enabled="true"] [hidden] { display:none !important; }
