:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #657282;
  --line: #d8e0e8;
  --panel: #ffffff;
  --paper: #f4f7f8;
  --accent: #0f7f8c;
  --accent-dark: #0a5962;
  --warn: #b44b35;
}

.insulation-panel { grid-column: 1 / -1; min-width: 0; padding: 16px; }
.insulation-panel table { min-width: 0; }
.insulation-panel td { white-space: normal; }
.insulation-choice, #materialThicknessChoice { min-width:0; align-content:start; }
.insulation-choice[hidden], #spiroInsulationChoice:empty { display:none; }
.insulation-choice select { width:100%; min-width:0; }
.insulation-choice small { font-size:11px; color:var(--muted); font-weight:400; }
.insulation-choice select:disabled { cursor:default; }
.ceiling-gap-choice { grid-column:1 / -1; }
.ceiling-gap-choice input { width:100%; min-width:0; }
.ceiling-gap-choice input:disabled { cursor:default; }
.insulation-panel button:disabled, .insulation-panel input:disabled, .insulation-panel select:disabled { cursor: default; }
.insulation-options { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: end; margin-top: 16px; }
.insulation-options label { display: grid; gap: 6px; min-width: 0; }
.insulation-options select { width: 100%; min-width: 0; }
.insulation-result { padding: 12px; background: #e9f4f4; border-radius: 8px; }
.insulation-result span, .insulation-result strong { display: block; }
.insulation-result span { font-size: 12px; color: var(--muted); }
.insulation-result strong { font-size: 24px; color: var(--accent-dark); }
.insulation-status { margin: 12px 0 6px; font-size: 13px; }
.insulation-warning { color: #a3361c; font-weight: 700; }
.insulation-note { font-size: 12px; line-height: 1.5; color: var(--muted); }
.insulation-breakdown summary { padding: 10px 0; cursor: pointer; font-size: 13px; }
.insulation-panel td small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; white-space: normal; }
.insulation-manual-label { font-size: 12px; display: grid; gap: 4px; }
.insulation-manual-label input { width: 120px; min-height: 42px; }
@media (max-width: 700px) {
  .insulation-options { grid-template-columns: 1fr; gap: 10px; }
  .insulation-result { grid-column: 1 / -1; }
  .insulation-options select { font-size: 14px; }
  .insulation-panel { padding: 12px; }
  .insulation-panel thead { display: none; }
  .insulation-panel table, .insulation-panel tbody { display: block; }
  .insulation-panel tr { display: grid; grid-template-columns: 36px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .insulation-panel td { display: block; border: 0; padding: 0; font-size: 13px; }
  .insulation-panel td:first-child { grid-column: 1 / -1; }
  .insulation-panel td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
  .insulation-manual-label input { width: 100%; }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(244, 247, 248, 0.78), rgba(244, 247, 248, 0.84)),
    url("./assets/background.png") center top / cover fixed;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.primary {
  width: 100%;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
}

.compact-brand {
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  flex: 0 0 auto;
  mix-blend-mode: multiply;
}

.brand-text {
  display: grid;
  gap: 0;
}

.eyebrow {
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  line-height: 0.95;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: var(--accent-dark);
  font-size: 42px;
  font-weight: 900;
  line-height: 0.95;
}

h1 span {
  display: inline-block;
  margin-left: 8px;
  color: var(--muted);
  font-size: 22px;
  font-weight: 800;
  vertical-align: baseline;
}

h2 {
  font-size: 18px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.module-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.module-tab {
  min-height: 40px;
  border-color: transparent;
  background: rgba(15, 127, 140, 0.08);
  color: var(--accent-dark);
  font-weight: 800;
  white-space: nowrap;
}

.module-tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.order-kind-nav {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.order-kind-tab {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 50px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.order-kind-tab small {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.order-kind-tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

body.order-kind-niczuk [data-order-kind-section="ducts"] {
  display: none;
}

body.order-kind-niczuk [data-order-kind-section="mounting-menu"] {
  display: none;
}

[data-order-kind-section="spiro"] {
  display: none;
}

body.order-kind-spiro [data-order-kind-section="ducts"] {
  display: none;
}

body.order-kind-spiro [data-order-kind-section="spiro"] {
  display: block;
}

body.order-kind-niczuk .materials-close-button,
body.order-kind-niczuk .mounting-material-search,
body.order-kind-niczuk .materials-estimator,
body.order-kind-niczuk #mountingMaterialTypeField {
  display: none;
}

body.order-kind-niczuk .mounting-material-form {
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr);
}

.pdf-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pdf-status:empty {
  display: none;
}

.pdf-status a,
.pdf-status button {
  border: 0;
  min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-dark);
  font-size: inherit;
  font-weight: 800;
  text-decoration: none;
}

.pdf-status a:hover,
.pdf-status button:hover {
  text-decoration: underline;
}

.app-shell {
  display: grid;
  grid-template-columns: 340px minmax(360px, 1fr);
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px;
}

.hvac-module {
  height: calc(100vh - 125px);
  padding: 12px;
}

.hvac-frame {
  width: 100%;
  height: 100%;
  min-height: 720px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(23, 33, 43, 0.08);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 16px 42px rgba(23, 33, 43, 0.08);
  backdrop-filter: blur(4px);
}

.input-panel {
  align-self: start;
}

.preview-panel,
.order-panel,
.materials-panel {
  min-width: 0;
}

.order-panel,
.materials-panel {
  grid-column: 1 / -1;
}

.mounting-materials-menu {
  grid-column: 1 / -1;
}

.mounting-materials-menu-button {
  width: 100%;
  min-height: 52px;
  border: 2px solid var(--accent);
  background: #fff;
  color: var(--accent-dark);
  font-size: 16px;
  font-weight: 800;
}

.mounting-materials-menu-button[aria-expanded="true"] {
  background: rgba(15, 127, 140, 0.08);
}

.mounting-materials-menu-button:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: #f3f6f7;
  color: var(--muted);
  opacity: 0.72;
}

.mounting-materials-hint {
  margin: 6px 4px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.order-meta-panel {
  grid-column: 1 / -1;
}

.order-picker {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(220px, 1fr) minmax(290px, 1.35fr) minmax(130px, auto);
  gap: 14px;
  align-items: end;
  padding: 16px;
}

.order-picker label > span {
  font-weight: 800;
}

.order-picker select {
  min-height: 46px;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-weight: 700;
}

.order-picker select:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(15, 127, 140, 0.14);
  outline-offset: 1px;
}

.order-state {
  display: grid;
  justify-items: start;
  gap: 4px;
  max-width: 220px;
  padding: 4px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.order-state small {
  font-size: 11px;
}

.order-delivery-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef2f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.order-delivery-status[data-status="sent"] {
  background: #def5e7;
  color: #176b3a;
}

.order-delivery-status[data-status="failed"] {
  background: #fde8e5;
  color: #b42318;
}

.order-delivery-status[data-status="pending"] {
  background: #fff1cf;
  color: #8a5b00;
}

.send-panel {
  grid-column: 1 / -1;
  display: grid;
  justify-items: stretch;
  gap: 10px;
  padding: 8px 0 28px;
}

.send-order-button {
  min-height: 56px;
  border-radius: 8px;
  font-size: 18px;
}

.send-panel .pdf-status {
  text-align: center;
}

.empty-order-row {
  padding: 28px 16px !important;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.drawing-legend {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.drawing-legend span {
  display: inline-block;
  width: 28px;
  border-top: 2px dashed #d8a600;
}

form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.order-meta-grid,
.saved-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(140px, 0.6fr) minmax(260px, 1.4fr) auto;
  gap: 12px;
  padding: 16px;
  align-items: end;
}

.order-name-field {
  min-width: 0;
}

.order-meta-actions {
  display: flex;
  gap: 10px;
  align-items: end;
}

.order-meta-actions button {
  white-space: nowrap;
}

.saved-orders {
  border-top: 1px solid var(--line);
}

.saved-controls {
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.4fr) auto auto;
  padding-bottom: 10px;
}

.saved-preview {
  margin: 0 16px 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.saved-preview strong {
  color: var(--ink);
}

label,
.field-control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

input,
select {
  min-height: 40px;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(15, 127, 140, 0.16);
}

.stepper-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
}

.stepper-control input {
  min-width: 0;
}

.stepper-buttons {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
}

.stepper-buttons button {
  min-height: 18px;
  padding: 0;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grid-2.is-right-to-left {
  direction: rtl;
}

.grid-2.is-right-to-left > * {
  direction: ltr;
}

.drawing-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 18px;
}

.drawing-stage > svg.is-content-fitted {
  width: min(100%, 820px);
  max-height: 560px;
}

.preview-order-controls {
  display: grid;
  grid-template-columns: minmax(96px, 0.35fr) minmax(160px, 1fr);
  align-items: end;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: rgba(239, 248, 249, 0.5);
}

.preview-order-controls .add-shape-button {
  min-height: 40px;
}

.reduction-views {
  display: grid;
  gap: 16px;
  width: 100%;
}

.reduction-view {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.reduction-view-front {
  background: rgba(239, 248, 249, 0.7);
}

.reduction-view-heading {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--ink);
  text-align: center;
}

.reduction-view-heading strong {
  font-size: 15px;
}

.reduction-view-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.reduction-secondary-views {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.reduction-view > svg {
  width: 100%;
  margin: 0 auto;
}

.reduction-view-front > svg {
  width: min(100%, 720px);
}

.projection-labels text {
  fill: #111;
  font: 700 22px/1 system-ui, sans-serif;
  dominant-baseline: middle;
  text-anchor: middle;
}

.projection-labels .projection-offset {
  fill: #9a7400;
  font-size: 20px;
}

.projection-labels .projection-axis {
  fill: var(--muted);
  font-size: 17px;
  text-anchor: start;
}

.drawing-table-hidden {
  display: none !important;
}

.drawing-dimension-control {
  overflow: visible;
}

.drawing-dimension-control label {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: var(--dimension-label-width, 40px) minmax(96px, 1fr);
  align-items: center;
  width: 100%;
  height: 46px;
  padding: 0;
  overflow: hidden;
  color: #0a5962;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid #0a5962;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(17, 33, 43, 0.2);
  font: 700 16px/1 system-ui, sans-serif;
}

.drawing-dimension-control span {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  align-self: stretch;
  padding: 0 7px;
  background: rgba(10, 89, 98, 0.06);
  border-right: 1px solid #a9b9c3;
  white-space: nowrap;
}

.drawing-dimension-control input,
.drawing-dimension-control select {
  box-sizing: border-box;
  width: 100%;
  min-width: 96px;
  height: 100%;
  padding: 3px 8px;
  color: #17212b;
  background: transparent;
  border: 0;
  border-radius: 0;
  font: 700 16px/1 system-ui, sans-serif;
  text-align: center;
}

.drawing-dimension-control input:focus,
.drawing-dimension-control select:focus {
  background: rgba(216, 166, 0, 0.12);
  outline: none;
}

.drawing-dimension-control label:has(input:focus),
.drawing-dimension-control label:has(select:focus) {
  border-color: #d8a600;
  box-shadow: 0 0 0 3px rgba(216, 166, 0, 0.25), 0 2px 8px rgba(17, 33, 43, 0.2);
}

.drawing-input-hint {
  fill: #657282;
  font: 600 15px/1 system-ui, sans-serif;
}

svg {
  width: min(100%, 720px);
  height: auto;
  display: block;
}

.channel-info {
  display: grid;
  place-items: center;
  gap: 10px;
  width: min(100%, 520px);
  min-height: 260px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-align: center;
}

.channel-info strong {
  color: var(--accent-dark);
  font-size: 42px;
}

.channel-info span {
  color: var(--accent-dark);
  font-size: 22px;
  font-weight: 800;
}

.channel-info p {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.channel-info small {
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
}

.part path,
.part polyline,
.part line {
  fill: none;
  stroke: #111;
  stroke-width: var(--stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dims line,
.dims path,
.guides line,
.guides polyline {
  fill: none;
  stroke: #111;
  stroke-width: 1.4;
}

.dims polygon {
  fill: #111;
  stroke: none;
}

.guides line,
.guides polyline {
  stroke-width: 1;
}

.is-disabled {
  opacity: 0.62;
}

.is-hidden {
  display: none;
}

.labels text {
  fill: #111;
  font-size: 34px;
  font-weight: 400;
  dominant-baseline: middle;
  text-anchor: middle;
}

.labels .dim-code {
  fill: #087bb8;
  font-size: 33px;
  font-style: italic;
}

.labels .badge {
  text-anchor: start;
  font-size: 46px;
}

.labels .system,
.labels .area {
  text-anchor: start;
  fill: var(--accent-dark);
  font-size: 30px;
}

.labels .area {
  fill: var(--muted);
  font-size: 26px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
}

.summary div {
  padding: 14px 16px;
}

.summary div + div {
  border-left: 1px solid var(--line);
}

.summary dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary dd {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1140px;
}

.materials-table {
  min-width: 620px;
  table-layout: auto;
}

.materials-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mounting-material-search {
  display: grid;
  gap: 6px;
  margin: 0 12px 14px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.niczuk-catalog-launcher {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 12px 14px;
}

.niczuk-catalog-launcher[hidden],
.niczuk-catalog-panel[hidden] {
  display: none;
}

.niczuk-catalog-toggle {
  flex: 1 1 320px;
  min-height: 52px;
  font-size: 16px;
  font-weight: 900;
}

.niczuk-catalog-launcher > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.niczuk-catalog-panel {
  display: grid;
  gap: 12px;
  margin: 0 12px 18px;
  padding: 14px;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: #f5fafb;
}

.niczuk-catalog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.niczuk-catalog-head h3,
.niczuk-catalog-head p,
.niczuk-catalog-status,
.niczuk-catalog-selection {
  margin: 0;
}

.niczuk-catalog-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.niczuk-image-browser {
  display: grid;
  gap: 8px;
}

.niczuk-image-browser h4,
.niczuk-image-browser p {
  margin: 0;
}

.niczuk-image-browser h4 {
  color: var(--ink);
  font-size: 16px;
}

.niczuk-image-browser p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.niczuk-image-groups {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.niczuk-image-group {
  display: grid;
  flex: 0 0 190px;
  gap: 5px;
  padding: 7px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  scroll-snap-align: start;
}

.niczuk-image-group:hover,
.niczuk-image-group:focus-visible,
.niczuk-image-group.is-active {
  border-color: var(--accent);
  background: rgba(15, 127, 140, 0.08);
}

.niczuk-image-group img {
  width: 100%;
  height: 112px;
  border-radius: 7px;
  object-fit: contain;
  background: #fff;
}

.niczuk-image-group span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

.niczuk-image-group small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.niczuk-catalog-filters {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(210px, 1fr);
  gap: 10px;
}

.niczuk-catalog-filters input,
.niczuk-catalog-filters select {
  min-height: 50px;
  border: 2px solid var(--accent);
  font-size: 16px;
  font-weight: 700;
}

.niczuk-catalog-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.niczuk-catalog-results {
  display: grid;
  gap: 7px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.niczuk-catalog-item {
  display: block;
  width: 100%;
  min-height: 0;
  height: max-content;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  text-align: left;
}

.niczuk-catalog-item-layout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.niczuk-catalog-item-layout > img {
  flex: 0 0 88px;
  width: 88px;
  height: 72px;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 7px;
  object-fit: contain;
  background: #fff;
}

.niczuk-catalog-item-copy {
  display: grid;
  flex: 1 1 auto;
  align-self: start;
  gap: 4px;
  min-width: 0;
}

.niczuk-catalog-item:hover,
.niczuk-catalog-item:focus-visible {
  border-color: var(--accent);
  background: rgba(15, 127, 140, 0.08);
}

.niczuk-catalog-item-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.niczuk-catalog-item-main strong {
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-size: 16px;
}

.niczuk-catalog-item-main b {
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.niczuk-catalog-item-copy > span:not(.niczuk-catalog-item-main),
.niczuk-catalog-item-copy small,
.niczuk-catalog-item-copy em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.niczuk-catalog-item em {
  color: var(--accent-dark);
  font-weight: 800;
}

.niczuk-catalog-selection {
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(15, 127, 140, 0.1);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.mounting-material-search-control {
  position: relative;
}

.mounting-material-search input {
  min-height: 52px;
  padding: 10px 14px;
  border: 2px solid var(--accent);
  font-size: 17px;
  font-weight: 700;
}

.mounting-material-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: 330px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(23, 33, 43, 0.18);
}

.mounting-material-suggestion {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border: 0;
  text-align: left;
}

.mounting-material-suggestion:hover,
.mounting-material-suggestion.is-active {
  background: rgba(15, 127, 140, 0.1);
}

.mounting-material-suggestion strong {
  color: var(--accent-dark);
}

.mounting-material-suggestion span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.mounting-material-no-results {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.materials-estimator {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(220px, 0.8fr);
  gap: 12px;
  align-items: end;
  margin: 0 12px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f5f9fa;
}

.materials-estimator[hidden],
.suggested-materials-section[hidden] {
  display: none;
}

.materials-estimator-copy {
  grid-column: 1 / -1;
}

.materials-estimator-copy h3,
.materials-estimator-copy p {
  margin: 0;
}

.materials-estimator-copy p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.materials-estimator button {
  min-height: 48px;
}

.suggested-materials-section {
  margin: 0 12px 18px;
  padding: 14px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: rgba(15, 127, 140, 0.04);
}

.suggested-materials-head {
  margin: 0 0 10px;
}

.suggested-materials-head h3,
.suggested-materials-head p {
  margin: 0;
}

.suggested-materials-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.suggested-materials-actions {
  display: grid;
  justify-items: end;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.suggested-materials-actions button {
  min-height: 34px;
  padding: 6px 10px;
}

.suggested-materials-list {
  display: grid;
  gap: 7px;
}

.suggested-material-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 48px;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.suggested-material-row.is-unselected {
  opacity: 0.58;
}

.suggested-material-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.suggested-material-check input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}

.suggested-material-check span {
  display: grid;
  min-width: 0;
}

.suggested-material-check small {
  margin-top: 2px;
  color: var(--muted);
}

.suggested-material-product-block {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.suggested-material-product {
  display: grid;
  gap: 3px;
  margin-left: 30px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.suggested-material-product select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 5px 7px;
  font-size: 12px;
}

.suggested-material-quantity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.suggested-material-quantity input {
  min-height: 38px;
  padding: 6px 8px;
}

.suggested-material-unit {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 700px) {
  .niczuk-catalog-launcher,
  .niczuk-catalog-head {
    align-items: stretch;
    flex-direction: column;
  }

  .niczuk-catalog-toggle {
    flex-basis: auto;
    width: 100%;
  }

  .niczuk-catalog-filters {
    grid-template-columns: 1fr;
  }

  .niczuk-catalog-results {
    max-height: 440px;
  }

  .niczuk-catalog-panel {
    margin-inline: 0;
    padding: 10px;
  }

  .niczuk-catalog-item-main {
    gap: 2px 7px;
  }

  .niczuk-image-group {
    flex-basis: 158px;
  }

  .niczuk-image-group img {
    height: 96px;
  }

  .niczuk-catalog-item {
    padding: 8px;
  }

  .niczuk-catalog-item-layout {
    gap: 8px;
  }

  .niczuk-catalog-item-layout > img {
    flex-basis: 58px;
    width: 58px;
    height: 58px;
  }

  .materials-estimator {
    grid-template-columns: 1fr;
  }

  .suggested-materials-head {
    align-items: flex-start;
  }

  .suggested-materials-actions {
    justify-items: start;
  }

  .suggested-material-row {
    grid-template-columns: minmax(0, 1fr) 105px 36px;
    gap: 7px;
  }

  .suggested-material-quantity {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .suggested-material-product {
    margin-left: 0;
  }
}

.materials-close-button {
  min-height: 34px;
  color: var(--muted);
}

.mounting-material-form {
  grid-template-columns: minmax(220px, 1.4fr) minmax(130px, 0.65fr) minmax(130px, 0.65fr) minmax(130px, 0.65fr);
  align-items: end;
}

.mounting-material-add-button {
  grid-column: 1 / -1;
  min-height: 48px;
}

.material-symbol-preview {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.material-symbol-preview output {
  display: flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #eef5f6;
  color: var(--accent-dark);
  font: 900 16px/1 Arial, Helvetica, sans-serif;
}

.materials-order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 8px;
  border-top: 1px solid var(--line);
}

.materials-order-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.materials-table td code {
  color: var(--accent-dark);
  font: 900 14px/1.2 Arial, Helvetica, sans-serif;
}

.materials-table th,
.materials-table td {
  padding: 7px 8px;
  border-right: 1px solid var(--line);
  text-align: center;
  white-space: normal;
}

.materials-table th {
  font-size: 10px;
  line-height: 1.15;
  letter-spacing: 0;
}

.materials-table td strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.1;
}

.materials-table td span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td button {
  width: 32px;
  min-height: 32px;
  padding: 0;
  color: var(--warn);
  font-size: 22px;
  line-height: 1;
}

.pdf-sheet {
  display: none;
}

.pdf-materials {
  margin-top: 24px;
}

.pdf-materials h3 {
  margin: 0 0 10px;
}

.pdf-materials table {
  min-width: 0;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .order-meta-grid,
  .saved-controls {
    grid-template-columns: 1fr;
  }

  .order-picker {
    grid-template-columns: 1fr 1fr;
  }

  .investment-picker {
    grid-column: 1 / -1;
  }

  .order-state {
    grid-column: 1 / -1;
    max-width: none;
  }

  .order-meta-actions {
    width: 100%;
  }

  .order-meta-actions button,
  .saved-controls button {
    width: 100%;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
  }

  .module-nav {
    width: 100%;
    margin-left: 0;
  }

  .module-tab {
    flex: 1;
  }

  .hvac-module {
    height: calc(100vh - 220px);
    padding: 10px;
  }

  .brand-logo {
    width: 74px;
    height: 74px;
  }

  .eyebrow {
    font-size: 24px;
  }

  h1 {
    font-size: 34px;
  }

  h1 span {
    font-size: 18px;
  }

  .top-actions {
    width: auto;
    margin-left: auto;
  }

  .top-actions button {
    min-height: 34px;
    padding: 0 10px;
  }

  .mounting-material-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .order-kind-nav {
    grid-template-columns: 1fr;
  }

  .mounting-material-search {
    margin-inline: 0;
  }

  .mounting-material-suggestion {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .drawing-stage {
    min-height: 0;
    padding: 6px;
  }

  .order-picker {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding: 14px;
  }

  .investment-picker,
  .order-state {
    grid-column: 1 / -1;
  }

  .order-picker select {
    font-size: 12px;
  }

  .app-shell {
    padding: 10px;
    gap: 10px;
  }

  .compact-brand {
    font-size: 16px;
  }

  #adminBtn,
  #installBtn,
  .user-badge {
    display: none;
  }

  #logoutBtn {
    border: 0;
    min-height: 32px;
    padding: 0 4px;
    color: var(--muted);
    background: transparent;
    font-size: 13px;
  }

  .brand-lockup {
    align-items: flex-start;
    gap: 12px;
  }

  .brand-logo {
    width: 62px;
    height: 62px;
  }

  .eyebrow {
    font-size: 20px;
  }

  h1 {
    font-size: 30px;
  }

  .mounting-material-form {
    grid-template-columns: 1fr;
  }

  .mounting-material-add-button {
    grid-column: auto;
  }

  .materials-panel .table-wrap {
    overflow: visible;
    padding: 0 10px 12px;
  }

  .materials-table {
    min-width: 0;
  }

  .materials-table thead {
    display: none;
  }

  .materials-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .materials-table tbody td {
    padding: 0;
    border: 0;
    text-align: left;
    white-space: nowrap;
  }

  .materials-table tbody td:first-child {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .materials-table .empty-order-row {
    grid-column: 1 / -1;
    white-space: normal;
  }
}

@media print {
  body * {
    visibility: hidden !important;
  }

  body::before {
    content: "Drukowanie i zapisywanie zamówień do PDF jest wyłączone.";
    visibility: visible !important;
    display: block;
    padding: 24px;
    color: #111;
    font: 700 16px/1.4 sans-serif;
  }
}
 .login-gate {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 24px;
  background: linear-gradient(135deg, #063f45 0%, #0a5962 52%, #102d34 100%);
}

.login-gate[hidden] {
  display: none;
}

.login-card {
  width: min(100%, 390px);
  padding: 34px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}

.login-card[hidden] {
  display: none;
}

.registration-card {
  width: min(100%, 640px);
  margin: 20px 0;
}

.registration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.registration-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.login-logo {
  display: block;
  width: 112px;
  max-height: 52px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 22px;
}

.login-card h1 {
  margin: 2px 0 8px;
  color: #17212b;
  font-size: 30px;
}

.login-copy {
  margin: 0 0 22px;
  color: #657282;
}

.login-card label {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  color: #17212b;
  font-size: 14px;
  font-weight: 700;
}

.login-card input {
  min-height: 44px;
}

.login-error {
  margin: 16px 0 0;
  color: #b42318;
  font-size: 14px;
  font-weight: 700;
}

.login-info {
  margin: 16px 0 0;
  color: #12633b;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.login-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 22px;
}

.login-link {
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font-weight: 800;
}

.login-link:hover {
  text-decoration: underline;
}

.history-view .input-panel,
.history-view .preview-panel,
.history-view .send-panel {
  display: none;
}

.spiro-order-panel {
  grid-column: 1 / -1;
}

.spiro-fields-grid {
  margin-top: 14px;
}

.spiro-drawing-stage {
  min-height: 390px;
}

.spiro-static-drawing {
  display: block;
  width: min(100%, 760px);
  height: auto;
  margin: auto;
}

.spiro-source-drawing {
  display: block;
  width: min(100%, 820px);
  max-height: 560px;
  height: auto;
  margin: auto;
  object-fit: contain;
  background: #fff;
  user-select: none;
}

.spiro-part {
  fill: rgba(20, 142, 152, 0.08);
  stroke: #17212b;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spiro-part circle,
.spiro-part rect,
.spiro-part path,
.spiro-part line {
  vector-effect: non-scaling-stroke;
}

.spiro-dim,
.spiro-angle {
  fill: none;
  stroke: #0a5962;
  stroke-width: 2;
}

.spiro-dim text,
.spiro-symbol,
.spiro-fixed-angle,
.spiro-dimension-chip text {
  fill: #17212b;
  stroke: none;
  font-family: Arial, sans-serif;
  font-weight: 800;
  text-anchor: middle;
}

.spiro-dim text,
.spiro-fixed-angle {
  font-size: 22px;
}

.spiro-symbol {
  fill: #0a5962;
  font-size: 28px;
}

.spiro-dimension-chip rect {
  fill: #eef7f8;
  stroke: #a8cbd0;
}

.spiro-dimension-chip text {
  font-size: 18px;
}

.spiro-order-table {
  min-width: 720px;
}

.spiro-order-table th:nth-child(3),
.spiro-order-table td:nth-child(3) {
  width: 68%;
}

.spiro-dimensions-cell {
  line-height: 1.55;
}

@media (max-width: 620px) {
  .spiro-drawing-stage {
    min-height: 270px;
  }

  .spiro-order-table {
    min-width: 620px;
  }
}

.cloud-status,
.user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.cloud-status {
  background: rgba(255, 255, 255, .12);
  color: #e3f5f6;
}

.cloud-status.is-online {
  background: #d9f5e5;
  color: #12633b;
}

.cloud-status.is-offline {
  background: #fff0cc;
  color: #815c00;
}

.user-badge {
  max-width: 220px;
  overflow: hidden;
  background: rgba(255, 255, 255, .92);
  color: #063f45;
  text-overflow: ellipsis;
}

.admin-overlay {
  position: fixed;
  z-index: 1200;
  inset: 0;
  overflow-y: auto;
  padding: 32px;
  background: rgba(7, 25, 30, .72);
  backdrop-filter: blur(4px);
}

.admin-overlay[hidden] {
  display: none;
}

.admin-card {
  width: min(1120px, 100%);
  margin: 0 auto;
  border-radius: 20px;
  padding: 26px;
  background: #f5f8f9;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .34);
}

.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.admin-head h2 {
  margin: 3px 0 0;
  font-size: 27px;
}

#adminCloseBtn {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 28px;
  line-height: 1;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-section {
  align-content: start;
  display: grid;
  gap: 14px;
  border: 1px solid #d8e0e4;
  border-radius: 14px;
  padding: 18px;
  background: #fff;
}

.admin-section h3 {
  margin: 0 0 2px;
  color: #12383d;
  font-size: 18px;
}

.admin-section label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.admin-section fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid #d8e0e4;
  border-radius: 10px;
  padding: 10px;
}

.admin-section legend {
  padding: 0 6px;
  color: #52636b;
  font-size: 12px;
  font-weight: 700;
}

.admin-checklist {
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
}

.admin-checklist label {
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 8px;
  padding: 8px;
  background: #f5f8f9;
  font-weight: 600;
}

.admin-checklist input {
  width: 18px;
  min-height: 18px;
}

.admin-count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  min-height: 26px;
  margin-left: 6px;
  border-radius: 999px;
  padding: 0 7px;
  background: #fff0cc;
  color: #815c00;
  font-size: 12px;
}

.admin-requests-section select[size] {
  min-height: 150px;
}

.admin-request-details {
  min-height: 58px;
  border: 1px solid #d8e0e4;
  border-radius: 10px;
  padding: 11px 12px;
  background: #f5f8f9;
  color: #52636b;
  font-size: 13px;
  line-height: 1.45;
}

.admin-request-details strong {
  color: #17212b;
}

.admin-inline-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#adminDeleteRequestBtn,
#adminDeleteUserBtn {
  border-color: #e5b7b2;
  background: #fff5f4;
  color: #a12c23;
}

.admin-hint,
.admin-status {
  margin: 0;
  color: #657282;
  font-size: 13px;
}

.admin-status {
  min-height: 22px;
  margin-top: 16px;
  font-weight: 700;
}

.admin-status.is-error {
  color: #b42318;
}

.admin-status.is-success {
  color: #12633b;
}

@media (max-width: 980px) {
  .admin-grid {
    grid-template-columns: 1fr 1fr;
  }

}

@media (max-width: 720px) {
  .admin-overlay {
    padding: 0;
    background: #f5f8f9;
  }

  .admin-card {
    min-height: 100%;
    border-radius: 0;
    padding: 18px;
    box-shadow: none;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .registration-grid,
  .admin-inline-actions {
    grid-template-columns: 1fr;
  }

  .drawing-stage {
    padding: 10px;
  }

  .reduction-secondary-views {
    grid-template-columns: 1fr;
  }

  .reduction-view-heading {
    flex-direction: column;
    gap: 2px;
  }

  .cloud-status,
  .user-badge {
    display: none;
  }
}
