﻿:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9dee7;
  --input: #f9fafb;
  --primary: #18645a;
  --primary-strong: #0d4f47;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --ok: #237a45;
  --ok-bg: #ecfdf3;
  --warn: #9a5b00;
  --warn-bg: #fff6df;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10151a;
  --surface: #182027;
  --ink: #e7edf3;
  --muted: #a9b5c1;
  --line: #394550;
  --input: #11181e;
  --primary: #267d71;
  --primary-strong: #2f8d80;
  --danger: #ff938a;
  --danger-bg: #3a2021;
  --ok: #72cf91;
  --ok-bg: #173323;
  --warn: #f0bd62;
  --warn-bg: #392d17;
}

html {
  scrollbar-gutter: stable;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Poppins", Arial, Helvetica, sans-serif;
  font-size: 16px;
}

body.index-page,
body.kusovnik-page,
body.export-page {
  display: flex;
  flex-direction: column;
}

@supports (min-height: 100dvh) {
  body {
    min-height: 100dvh;
  }
}

@media screen {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }
}

button,
input,
select {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.topbar {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 1fr minmax(260px, 380px);
  gap: 24px;
  align-items: end;
  padding: 28px clamp(16px, 4vw, 48px);
  background: #000000;
  border-bottom: 1px solid #222;
}

.theme-toggle {
  position: fixed;
  top: calc(50% - 60px);
  right: 0;
  z-index: 59;
  display: inline-flex;
  width: 46px;
  min-width: 46px;
  height: 52px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-right: 0;
  border-radius: 999px 0 0 999px;
  background: #101820;
  color: #ffffff;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.26);
  transform: translateY(-50%);
  transition: background 160ms ease, transform 160ms ease;
}

.theme-toggle:hover {
  background: #22313b;
}

.theme-toggle:active {
  transform: translateY(calc(-50% + 1px));
}

.theme-toggle:focus-visible {
  outline: 3px solid rgba(245, 181, 44, 0.58);
  outline-offset: 2px;
}

.theme-toggle-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.theme-toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:root[data-theme="light"] .theme-toggle-icon--sun,
:root[data-theme="dark"] .theme-toggle-icon--moon {
  display: none;
}

.topbar > * {
  min-width: 0;
}

.eyebrow {
  margin: 0;
  transform: translateX(-2px) scaleX(1.08) scaleY(0.9);
  transform-origin: left bottom;
  color: #ff0000;
  font-family: "Anton", "Oswald", Arial, sans-serif;
  font-size: clamp(54px, 7.4vw, 88px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.eyebrow-link {
  display: inline-flex;
  width: fit-content;
  text-decoration: none;
}

.topbar h1 {
  margin-top: 4px;
  color: #ffffff;
  font-size: clamp(13px, 2vw, 20px);
  font-weight: 400;
  text-align: left;
}

.program-name {
  margin: 0;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-align: left;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

.workspace {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(320px, 520px) 1fr;
  gap: 24px;
  padding: 24px clamp(16px, 4vw, 48px) 40px;
}

.entry-panel,
.order-panel {
  min-width: 0;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.order-column {
  min-width: 0;
  align-self: start;
}

.saved-orders-panel {
  min-width: 0;
  margin: 0 clamp(16px, 4vw, 48px) 65px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

body.index-page .saved-orders-panel {
  margin-top: auto;
}

.app-credit {
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  padding: 0 12px 7px;
  color: #b8bec6;
  font-size: 9px;
  line-height: 1.35;
  opacity: 0.72;
  text-align: center;
}

.app-credit a {
  color: inherit;
  text-decoration-color: transparent;
}

.app-credit a:hover {
  color: #929aa4;
  text-decoration-color: currentColor;
}

.saved-orders-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  margin-top: 18px;
}

.saved-orders-footer > button {
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.saved-orders-footer > .import-button {
  background: #e6f1ed;
  color: #0d4f47;
}

.saved-orders-footer > .import-button:hover {
  background: #d6ebe4;
}

.saved-orders-footer > .export-name-button {
  font-weight: 400;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

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

.order-actions > button {
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.order-actions #saveOrderButton {
  background: var(--primary);
  color: #ffffff;
}

.order-actions #saveOrderButton:hover {
  background: var(--primary-strong);
}

.order-actions #saveOrderButton.is-new-order-action {
  background: #fec941;
  color: #322400;
}

.order-actions #saveOrderButton.is-new-order-action:hover {
  background: #ffe033;
}

.order-actions .danger-button {
  background: #fde8e7;
  color: #b42318;
}

.order-actions .unify-button {
  background: #e6f1ed;
  color: #0d4f47;
}

.order-actions .unify-button:hover {
  background: #d6ebe4;
}

.project-field,
.field {
  display: grid;
  gap: 7px;
}

label {
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.order-label {
  color: #ffffff;
}

.project-field {
  justify-items: start;
  align-self: end;
  padding-bottom: 4px;
}

.project-meta-actions {
  justify-self: end;
  display: inline-grid;
  grid-template-columns: auto minmax(0, auto);
  align-content: end;
  align-items: center;
  column-gap: 8px;
  row-gap: 6px;
  min-width: 0;
  max-width: 100%;
  min-height: 66px;
}

.project-meta-row {
  display: contents;
}

.project-meta-label {
  color: #ffffff;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}

.author-button {
  justify-self: stretch;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
  min-height: 30px;
  padding: 2px 10px 2px 4px;
  border: 1px solid #cfd6df;
  border-radius: 999px;
  background: #eef1f4;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.author-button-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.author-button:hover {
  background: #e4e9ef;
}

.project-manager-button--unknown {
  border-color: #f6b23b;
  background: #fff4d6;
  color: #8a4f00;
  box-shadow: 0 0 0 3px rgba(246, 178, 59, 0.22), 0 0 18px rgba(246, 178, 59, 0.38);
  animation: project-manager-attention 1.7s ease-in-out infinite;
}

.project-manager-button--unknown:hover {
  background: #ffe9ad;
}

@keyframes project-manager-attention {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(246, 178, 59, 0.18), 0 0 12px rgba(246, 178, 59, 0.28);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(246, 178, 59, 0.32), 0 0 24px rgba(246, 178, 59, 0.5);
  }
}

.author-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  flex: 0 0 28px;
}

.author-button-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  stroke: none;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c7cfda;
  border-radius: 6px;
  background: var(--input);
  color: var(--ink);
  padding: 9px 11px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 100, 90, 0.15);
}

.unit-input {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid #c7cfda;
  border-radius: 6px;
  background: var(--input);
}

.unit-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 100, 90, 0.15);
}

.unit-input input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.unit-input span {
  padding: 0 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

textarea {
  width: 100%;
  min-height: 88px;
  border: 1px solid #c7cfda;
  border-radius: 6px;
  background: var(--input);
  color: var(--ink);
  padding: 9px 11px;
  resize: vertical;
  font: inherit;
}

textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 100, 90, 0.15);
  outline: none;
}

.note-attention,
.note-attention:focus {
  border-color: #f0b90b;
  background: #fffdf4;
  box-shadow: 0 0 0 4px rgba(240, 185, 11, 0.3);
}

.notes-field {
  margin-top: 12px;
}

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

.results div {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.results span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.results strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.25;
}

.messages {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.message {
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.35;
}

.message.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f5b7b1;
}

.message.warning {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid #f3cf81;
}

.message.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f5b7b1;
}

.message.ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid #abefc6;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

.primary-button {
  background: var(--primary);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--primary-strong);
}

.secondary-button {
  background: #e9eef4;
  color: #26323f;
}

.secondary-button:hover {
  background: #dfe6ee;
}

.door-mode-selector {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.door-mode-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

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

.door-mode-button {
  min-width: 0;
  border: 1px solid var(--line);
  background: #e9eef4;
  color: #26323f;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.door-mode-button:hover {
  background: #dfe6ee;
}

.door-mode-button[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(24, 100, 90, 0.2);
}

.door-mode-button[aria-pressed="true"]:hover {
  background: var(--primary-strong);
}

.import-button {
  background: #e9eef4;
  color: #26323f;
}

.import-button:hover {
  background: #dfe6ee;
}

.danger-button {
  background: #fde8e7;
  color: #b42318;
}

.danger-button:hover {
  background: #fbd5d3;
}

.quiet-button {
  border: 1px solid transparent;
  background: transparent;
  color: #667085;
}

.quiet-button:hover {
  background: #f3f5f8;
  color: #344054;
}

.project-manager-unknown-button {
  margin-left: auto;
  padding-inline: 8px;
  font-size: 13px;
  font-weight: 500;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.status-pill.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-pill.neutral {
  background: #eef2f7;
  color: #475467;
}

.saved-order-active td {
  background: #fff8e6;
}

.saved-order-recently-saved td {
  animation: savedOrderRowFlash 5s ease-out forwards;
}

.saved-orders-title-cell {
  vertical-align: middle;
}

.saved-orders-title-layout {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.saved-orders-title-name {
  min-width: 0;
  color: #0b5b50;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.saved-orders-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.saved-orders-title-actions .secondary-button {
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.saved-orders-actions-cell {
  vertical-align: middle;
  padding-left: 8px;
  padding-right: 12px;
}

.saved-order-load-button {
  background: #e6f1ed;
  color: #0d4f47;
}

.saved-order-load-button:hover {
  background: #d6ebe4;
}

.saved-order-save-button {
  background: var(--primary);
  color: #ffffff;
}

.saved-order-save-button:hover {
  background: var(--primary-strong);
}

.saved-orders-table {
  table-layout: fixed;
  min-width: 0;
  --saved-orders-actions-width: 320px;
  --saved-orders-spacer-width: 42px;
  --saved-orders-status-width: 110px;
}

.saved-orders-table:not(.saved-orders-with-editor) .saved-orders-title-header,
.saved-orders-table:not(.saved-orders-with-editor) .saved-orders-title-cell,
.saved-orders-table:not(.saved-orders-with-editor) .saved-orders-actions-header,
.saved-orders-table:not(.saved-orders-with-editor) .saved-orders-actions-cell,
.saved-orders-table:not(.saved-orders-with-editor) .saved-orders-count-header,
.saved-orders-table:not(.saved-orders-with-editor) .saved-orders-count-cell,
.saved-orders-table:not(.saved-orders-with-editor) .saved-orders-version-header,
.saved-orders-table:not(.saved-orders-with-editor) .saved-orders-version-cell,
.saved-orders-table:not(.saved-orders-with-editor) .saved-orders-date-header,
.saved-orders-table:not(.saved-orders-with-editor) .saved-orders-date-cell {
  width: calc((100% - var(--saved-orders-status-width) - var(--saved-orders-actions-width) - var(--saved-orders-spacer-width)) / 4);
}

.saved-orders-table.saved-orders-with-editor .saved-orders-title-header,
.saved-orders-table.saved-orders-with-editor .saved-orders-title-cell,
.saved-orders-table.saved-orders-with-editor .saved-orders-actions-header,
.saved-orders-table.saved-orders-with-editor .saved-orders-actions-cell,
.saved-orders-table.saved-orders-with-editor .saved-orders-count-header,
.saved-orders-table.saved-orders-with-editor .saved-orders-count-cell,
.saved-orders-table.saved-orders-with-editor .saved-orders-version-header,
.saved-orders-table.saved-orders-with-editor .saved-orders-version-cell,
.saved-orders-table.saved-orders-with-editor .saved-orders-date-header,
.saved-orders-table.saved-orders-with-editor .saved-orders-date-cell,
.saved-orders-table.saved-orders-with-editor .saved-orders-editor-header,
.saved-orders-table.saved-orders-with-editor .saved-orders-editor-cell {
  width: calc((100% - var(--saved-orders-status-width) - var(--saved-orders-actions-width) - var(--saved-orders-spacer-width)) / 5);
}

.saved-orders-table .saved-orders-actions-header,
.saved-orders-table .saved-orders-actions-cell {
  width: var(--saved-orders-actions-width);
}

.saved-orders-table .saved-orders-spacer-header,
.saved-orders-table .saved-orders-spacer-cell {
  width: var(--saved-orders-spacer-width);
}

.saved-orders-table .saved-orders-status-header,
.saved-orders-table .saved-orders-status-cell {
  width: var(--saved-orders-status-width);
  text-align: left;
}

.saved-orders-status-cell {
  padding-left: 8px;
  padding-right: 12px;
}

.saved-orders-status-cell .row-status {
  display: inline-flex;
  margin: 0;
}

@keyframes savedOrderRowFlash {
  0% {
    background: #f4fff5;
    box-shadow: inset 0 0 0 9999px rgba(35, 122, 69, 0.08);
  }
  30% {
    background: #eefdf1;
    box-shadow: inset 0 0 0 9999px rgba(35, 122, 69, 0.05);
  }
  100% {
    background: transparent;
    box-shadow: inset 0 0 0 9999px rgba(35, 122, 69, 0);
  }
}

.table-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

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

th,
td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

td {
  min-height: 54px;
  vertical-align: middle;
}

tbody tr {
  border-bottom: 1px solid var(--line);
}

tbody td {
  white-space: pre-line;
}

th {
  background: #eef2f7;
  color: #344054;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.opening-column-header {
  min-width: 150px;
}

.wall-thickness-display-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid #9abcf4;
  border-radius: 999px;
  background: #dceaf7;
  color: #1f5f8b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: none;
  white-space: nowrap;
}

.kusovnik-page .wall-thickness-display-toggle {
  border: 0;
}

.wall-thickness-display-toggle:hover,
.wall-thickness-display-toggle:focus-visible {
  background: #c8dff5;
  border-color: #86b0f0;
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 95, 139, 0.12);
}

.wall-thickness-display-toggle.is-active {
  border-color: #9abcf4;
  background: #dceaf7;
  color: #1f5f8b;
}

.wall-thickness-display-toggle.is-active:hover,
.wall-thickness-display-toggle.is-active:focus-visible {
  background: #c8dff5;
  border-color: #86b0f0;
}

.wall-thickness-display-dock {
  width: 100%;
  min-width: 0;
  height: auto;
  margin-top: 8px;
  padding-left: var(--wall-thickness-toggle-left, 0px);
  overflow: visible;
}

.wall-thickness-display-dock .wall-thickness-display-toggle {
  position: static;
}

.order-table-sticky-shell {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  overflow: visible;
  background: transparent;
  pointer-events: none;
  will-change: top, left, width;
}

.order-table-sticky-shell[hidden] {
  display: none !important;
}

.order-table-sticky-bottom-edge {
  position: absolute;
  z-index: 2;
  right: 0;
  left: 0;
  height: 8px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  pointer-events: none;
}

.order-table-sticky-bottom-edge[hidden] {
  display: none !important;
}

.order-table-sticky-cover {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  left: 0;
  height: 12px;
  background: var(--surface);
}

.order-table-sticky-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px var(--order-table-sticky-roundness, 0px) var(--order-table-sticky-roundness, 0px);
  background: var(--surface);
}

.order-table-sticky-shell table {
  width: max-content;
  min-width: 1100px;
  border-collapse: collapse;
  table-layout: fixed;
  background: transparent;
}

.order-table-sticky-shell th {
  white-space: nowrap;
}

.order-table-sticky-active thead {
  visibility: hidden;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr.editing-row td {
  background: #fff8e6;
}

tbody tr.recently-updated-row td {
  animation: recentlyUpdatedRowFade 3s ease-out forwards;
  background: #fff8e6;
}

@keyframes recentlyUpdatedRowFade {
  0% {
    background: #fff2b8;
  }
  35% {
    background: #fff8e6;
  }
  100% {
    background: transparent;
  }
}

.empty-row td {
  color: var(--muted);
  text-align: center;
  padding: 28px 12px;
}

.row-status {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.row-status.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.row-status.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.row-actions-cell {
  vertical-align: middle;
}

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  white-space: nowrap;
  width: 100%;
}

.row-actions-cell {
  padding-right: 6px;
  padding-left: 6px;
}

.table-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  background: #dfe6ee;
  color: #344054;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.icon-button {
  color: #ffffff;
}

.icon-button svg {
  display: block;
  width: 26px;
  height: 26px;
  fill: currentColor;
  stroke: none;
  flex: 0 0 auto;
  transform-box: fill-box;
  transform-origin: center;
}

.icon-button.edit-icon {
  background: #3c9b6f;
}

.icon-button.edit-icon svg {
  transform: translate(1.25px, -1.25px) scale(0.96);
}

.icon-button.delete-icon {
  background: #e14a39;
}

.icon-button.delete-icon svg {
  transform: translateY(-3.5%) scale(0.98);
}

.icon-button.note-icon {
  background: #fec941;
}

.icon-button.note-icon svg {
  width: 25px;
  height: 25px;
  transform: translate(2.75%, -6%) scale(0.98);
}

.surface-help {
  min-width: 180px;
  width: auto;
  padding: 0 14px;
}

.note-popover {
  position: absolute;
  z-index: 50;
  padding: 10px 12px;
  border: 1px solid #d5dde6;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  font-size: 14px;
  line-height: 1.45;
  box-sizing: border-box;
  max-width: none;
  overflow-wrap: anywhere;
}

.validation-note-popover {
  position: absolute;
  z-index: 60;
  padding: 10px 12px;
  border: 1px solid #f3cf81;
  border-radius: 8px;
  background: #fff6df;
  color: #9a5b00;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  transform-origin: bottom left;
  animation: validation-note-popover-in 0.32s cubic-bezier(0.18, 0.78, 0.22, 1);
}

.validation-note-popover.is-hiding {
  animation: validation-note-popover-out 0.32s ease forwards;
}

@keyframes validation-note-popover-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes validation-note-popover-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.delete-popover {
  position: absolute;
  z-index: 50;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 10px 12px 12px;
  border: 1px solid #d5dde6;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  font-size: 14px;
  line-height: 1.45;
  box-sizing: border-box;
}

.delete-popover-text {
  margin: 0;
  font-weight: 600;
}

.delete-confirm-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #e14a39;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.delete-confirm-button:hover {
  background: #cf3d2d;
}

.delete-confirm-button svg {
  display: block;
  width: 20px;
  height: 20px;
}

.next-step-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(13, 79, 71, 0.28);
}

.next-step-button:hover {
  background: var(--primary-strong);
}

.back-button {
  right: auto;
  left: 24px;
}

.export-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
}

.export-modal-overlay:has(.material-import-dialog) {
  --material-import-dialog-top: max(24px, calc((100vh - 460px) / 2));
  align-items: flex-start;
  padding-top: var(--material-import-dialog-top);
}

.export-modal-overlay:has(.material-import-dialog) .material-import-dialog {
  max-height: calc(100vh - var(--material-import-dialog-top) - 24px);
}

.export-modal {
  width: min(460px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.24);
}

.compare-modal {
  width: min(760px, 100%);
}

.export-modal h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.material-import-dialog {
  width: min(460px, 100%);
  transition: width 0.18s ease;
}

.material-import-dialog.is-help-open {
  width: min(620px, 100%);
}

.material-import-box {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.material-import-box > strong {
  display: block;
  margin-bottom: 8px;
}

.material-import-box ol {
  margin: 0;
  padding-left: 18px;
}

.material-import-box li + li {
  margin-top: 4px;
}

.material-import-visuals {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}

.material-import-visuals figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
}

.material-import-visuals img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  background: #f8fafc;
  cursor: zoom-in;
}

.material-import-visuals img:hover {
  opacity: 0.92;
}

.material-import-visuals img:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -3px;
}

.material-import-visuals figcaption {
  padding: 8px 10px;
  border-top: 1px solid #e2e8f0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.material-image-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.76);
}

.material-image-lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.38);
  cursor: zoom-out;
}

.material-image-lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 121;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
}

.material-image-lightbox-close:hover,
.material-image-lightbox-close:focus-visible {
  background: #f8fafc;
}

.material-import-materials {
  margin: 0 0 16px;
}

.material-import-materials > strong {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.material-import-materials h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.material-import-codes {
  margin: 0;
  color: var(--ink);
}

.material-import-codes::before {
  content: "– ";
}

.material-import-codes span {
  display: inline;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.material-import-codes span + span::before {
  content: ", ";
}

.material-import-help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.material-import-help-button {
  width: fit-content;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid #b9c7d6;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.material-import-help-button:hover,
.material-import-help-button[aria-expanded="true"] {
  border-color: var(--primary);
  background: #eef6f4;
  color: var(--primary-strong);
}

.material-import-help-panel {
  box-sizing: border-box;
  width: 100%;
  margin: 14px 0 0;
  padding: 0;
}

.material-import-help-panel h4 {
  margin: 0 0 10px;
  padding: 0;
  font-size: 16px;
}

.material-import-help-panel > .material-import-box,
.material-import-help-panel > .material-import-instructions {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
}

.material-import-instructions {
  position: relative;
}

.material-import-instructions.is-collapsed .material-import-instructions-content {
  max-height: 118px;
  overflow: hidden;
}

.material-import-instructions.is-collapsed::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  height: 74px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(248, 250, 252, 0), #f8fafc 72%);
}

.material-import-instructions-toggle {
  position: relative;
  z-index: 2;
  margin: 8px 0 14px;
}

.material-import-instructions.is-collapsed .material-import-instructions-toggle {
  position: absolute;
  right: 10px;
  bottom: 0;
  margin: 0 0 9px;
}

.export-description {
  margin: 0 0 16px;
  color: var(--ink);
  line-height: 1.45;
}

.confirm-dialog-subnote {
  display: block;
  margin-left: 13px;
  color: var(--muted);
  font-size: 0.95em;
}

.compare-intro {
  margin-bottom: 14px;
}

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

.compare-summary-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.compare-summary-label {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.compare-summary-name {
  color: #0b5b50;
  font-size: 15px;
  font-weight: 700;
}

.compare-summary-meta {
  color: var(--muted);
  font-size: 13px;
}

.compare-diff-box {
  max-height: min(48vh, 360px);
  overflow: auto;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.compare-diff-box h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.compare-diff-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.compare-diff-item {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.compare-diff-field {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-weight: 700;
}

.compare-diff-change-list {
  display: grid;
  gap: 8px;
}

.compare-diff-change-row {
  display: grid;
  gap: 6px;
}

.compare-diff-change-label {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.compare-diff-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.compare-diff-comparison-single {
  margin-top: 2px;
}

.compare-diff-value-chip {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d7dee9;
  border-radius: 8px;
  line-height: 1.35;
  word-break: break-word;
}

.compare-diff-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  color: #64748b;
  font-size: 16px;
  font-weight: 700;
}

.compare-diff-value-before {
  background: #f0fdf4;
  color: #166534;
}

.compare-diff-value-after {
  background: #fff7f7;
  color: #9f1239;
}

.compare-diff-empty {
  margin: 0;
  color: var(--muted);
}

.export-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.export-actions--cutrite-material-choice {
  display: flex;
  width: max-content;
  max-width: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.export-actions-secondary-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.export-actions--cutrite-material-choice .primary-button {
  width: fit-content;
  padding-right: 10px;
  padding-left: 10px;
}

.version-history-modal {
  width: min(480px, 100%);
}

.version-history-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.version-history-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.version-history-version {
  color: #0b5b50;
  font-size: 14px;
}

.version-history-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.version-history-item {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.version-history-label {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.version-history-value {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.version-history-more-wrap {
  display: flex;
  justify-content: flex-start;
  margin: -4px 0 16px;
}

.version-history-more {
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.order-picker-list {
  display: grid;
  gap: 8px;
  max-height: min(48vh, 320px);
  overflow: auto;
  margin: 0 0 16px;
  padding-right: 2px;
}

.order-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef1f4;
  color: #26323f;
  text-align: left;
}

.order-picker-item:hover {
  background: #e4e9ef;
}

.order-picker-name {
  min-width: 0;
  font-weight: 700;
}

.order-picker-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.info-actions {
  justify-content: flex-end;
}

.unify-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
}

.unify-modal {
  width: min(520px, 100%);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.24);
}

.unify-modal-wide {
  width: min(700px, 100%);
}

.unify-modal h3 {
  margin-bottom: 10px;
  font-size: 20px;
}

.unify-summary,
.unify-range,
.unify-note {
  margin: 0 0 12px;
  color: var(--ink);
  line-height: 1.45;
}

.unify-emphasis {
  font-weight: 700;
}

.unify-field {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.unify-field span {
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.unify-field input {
  min-height: 42px;
}

.unify-error {
  min-height: 20px;
  margin-top: 6px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.4;
}

.unify-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.unify-group-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.unify-group {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.unify-group-title {
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

.unify-group-entry-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.unify-group-entry {
  display: grid;
  gap: 2px;
  flex: 0 0 auto;
  width: max-content;
  padding: 6px 8px;
  border: 1px solid #dce3ec;
  border-radius: 6px;
  background-color: rgb(34 197 94 / var(--unify-thickness-grade, 0%));
}

.unify-group-entry-door {
  overflow: hidden;
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unify-group-entry-value {
  color: #1d2939;
  font-size: 13px;
  line-height: 1.2;
}

.unify-group-marks,
.unify-group-values,
.unify-unchanged-values {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.unify-unchanged-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fcfcfd;
}

.unify-unchanged-heading {
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.kusovnik-page {
  background: var(--bg);
}

.kusovnik-workspace {
  display: flex;
  /*
   * Start from the available viewport space, not from the content height.
   * The former `auto` flex basis made the `margin-top: auto` below depend on
   * a late font/layout recalculation, so its bottom space could vary after
   * refresh.  A zero basis reserves one stable flexible page area instead.
   */
  flex: 1 0 0;
  flex-direction: column;
  gap: 18px;
  padding: 24px clamp(16px, 4vw, 48px) 65px;
}

.kusovnik-overview,
.kusovnik-door-page {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.kusovnik-overview {
  padding: 18px;
}

.kusovnik-overview-card {
  display: grid;
  gap: 12px;
}

.kusovnik-overview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
}

.kusovnik-overview-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.kusovnik-overview-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.kusovnik-door-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.kusovnik-door-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: auto;
  height: auto;
  padding: 8px 10px;
  box-sizing: border-box;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  text-decoration: none;
  text-align: center;
}

.kusovnik-door-chip:hover {
  background: #eef1f4;
}

.kusovnik-print-chip {
  margin-left: auto;
  flex: 0 0 auto;
  cursor: pointer;
  padding: 0;
}

.kusovnik-print-chip.is-wrapped {
  margin-left: 0;
}

.kusovnik-print-chip svg {
  display: block;
  width: 42%;
  height: 42%;
}

.kusovnik-door-chip strong {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.kusovnik-door-chip span {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.kusovnik-empty-chip {
  color: var(--muted);
  font-size: 13px;
}

.kusovnik-top-toggle-anchor {
  height: 1px;
  margin: 0;
  padding: 0;
}

.kusovnik-top-toggle-anchor + .kusovnik-section {
  margin-top: 10px;
}

.kusovnik-info-card.kusovnik-note-card {
  grid-column: 1 / -1;
  min-height: 0;
  border-color: #f2c94c;
  background: #fff7da;
}

.kusovnik-info-card.kusovnik-cladding-card {
  border-color: #9fd0c8;
  background: #e8f3f0;
}

.kusovnik-info-card.kusovnik-cladding-card span {
  color: var(--primary);
}

.kusovnik-info-card.kusovnik-note-placeholder {
  display: none;
}

.kusovnik-info-card.kusovnik-note-card span {
  color: #8a5d00;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.kusovnik-info-card.kusovnik-note-card .kusovnik-note-value {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400 !important;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.kusovnik-top-button {
  position: fixed;
  left: clamp(16px, 4vw, 48px);
  top: clamp(16px, 4vw, 48px);
  z-index: 45;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #18645a;
  color: #ffffff;
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.2);
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.kusovnik-top-button.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.kusovnik-top-button:hover,
.kusovnik-top-button:focus-visible {
  background: #185f51;
}

.kusovnik-top-icon {
  display: block;
  width: 24px;
  height: 24px;
}

.kusovnik-pages {
  flex: none;
  display: grid;
  gap: 18px;
  margin-top: auto;
}

.kusovnik-door-page {
  position: relative;
  padding: 18px;
  overflow: visible;
  break-after: page;
  page-break-after: always;
}

.kusovnik-door-page:last-child {
  break-after: auto;
  page-break-after: auto;
}

.kusovnik-door-page.is-target-flash {
  animation: kusovnikDoorFlash 1.5s ease-out forwards;
}

.kusovnik-page-footer {
  display: none;
}

@keyframes kusovnikDoorFlash {
  0% {
    background: #f4fff5;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05), inset 0 0 0 9999px rgba(35, 122, 69, 0.08);
  }
  30% {
    background: #f7fff8;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05), inset 0 0 0 9999px rgba(35, 122, 69, 0.05);
  }
  100% {
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  }
}

.kusovnik-section {
  padding-top: 16px;
}

.kusovnik-info-section {
  padding-top: 14px;
}

.kusovnik-section + .kusovnik-section {
  margin-top: 10px;
}

.kusovnik-section h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
}

.kusovnik-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.kusovnik-info-card {
  display: grid;
  gap: 6px;
  min-height: 70px;
  padding: 11px 12px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fbff;
}

.kusovnik-info-card span {
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.kusovnik-info-card strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 700;
}

.kusovnik-info-card-value {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 700;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.kusovnik-cutlist-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.kusovnik-cutlist-table th,
.kusovnik-cutlist-table td {
  border: 0;
  height: 42px;
  padding: 0 8px;
  border-bottom: 1px solid #e5eaf1;
  vertical-align: middle;
  line-height: 1.2;
  white-space: nowrap;
}

.kusovnik-cutlist-table thead th {
  background: #f5f7fb;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
}

.kusovnik-cutlist-table td {
  font-size: 14px;
  min-height: 0;
  overflow: visible;
}

.kusovnik-cutlist-table .cutlist-dimension-cell {
  overflow: visible;
}

.kusovnik-cutlist-table td.is-menu-open {
  position: relative;
  z-index: 30;
  overflow: visible;
}

.cutlist-dimension-control {
  display: inline-flex;
  align-items: center;
  max-width: max-content;
  min-width: 0;
  position: relative;
  line-height: 1.2;
  white-space: nowrap;
  vertical-align: middle;
}

/* Ručně upravené rozměry v jedné tabulce se srovnají podle přirozeně
   nejdelší hodnoty; nepoužívá se žádná pevná šířka. */
.cutlist-dimension-control.is-manual {
  width: var(--cutlist-dimension-control-width, max-content);
  min-width: 0;
  max-width: none;
}

/* Ikona úpravy zůstává hned u hodnoty. Akce vpravo začínají ve stejné
   pozici, kterou určí nejdelší ručně upravený rozměr v tabulce. */
.cutlist-dimension-control.is-manual .cutlist-dimension-actions {
  position: absolute;
  top: 50%;
  left: calc(100% + 4px);
  transform: translateY(-50%);
  margin-left: 0;
}

.cutlist-dimension-control.is-manual .cutlist-dimension-reset-pill,
.cutlist-dimension-control.is-manual .cutlist-dimension-all-prompt {
  position: static;
  transform: none;
}

.cutlist-dimension-value {
  min-width: 0;
  flex: 0 0 auto;
}

.cutlist-dimension-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: absolute;
  top: 50%;
  left: calc(100% + 4px);
  transform: translateY(-50%);
}

.cutlist-dimension-edit-button {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-left: 4px;
  color: #4b5563;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.16s ease, color 0.16s ease;
}

.cutlist-dimension-control:hover .cutlist-dimension-edit-button,
.cutlist-dimension-control:focus-within .cutlist-dimension-edit-button {
  opacity: 1;
}

.cutlist-dimension-edit-button:hover,
.cutlist-dimension-edit-button:focus-visible {
  color: #2f3742;
  outline: none;
}

.cutlist-dimension-edit-button svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: currentColor;
  stroke: none;
  transform: translate(0.5px, -0.5px) scale(0.96);
}

.cutlist-dimension-reset-pill {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  min-height: 18px;
  padding: 0 7px;
  border: 1px solid #7a8492;
  border-radius: 999px;
  background: #f8fafc;
  color: #344054;
  font-family: "Poppins", Arial, Helvetica, sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  cursor: pointer;
}

.cutlist-dimension-reset-pill:hover,
.cutlist-dimension-reset-pill:focus-visible {
  background: #eef2f6;
  outline: none;
}

.cutlist-dimension-all-prompt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cutlist-dimension-all-button {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff7e6;
  color: #6f4a00;
  font-family: "Poppins", Arial, Helvetica, sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.cutlist-dimension-all-button:hover,
.cutlist-dimension-all-button:focus-visible {
  background: #ffefc2;
  outline: none;
  box-shadow: 0 0 0 3px rgba(24, 100, 90, 0.12);
}

.cutlist-dimension-all-button--primary {
  background: var(--primary);
  color: #ffffff;
}

.cutlist-dimension-all-button--primary:hover,
.cutlist-dimension-all-button--primary:focus-visible {
  background: var(--primary-strong);
}

.cutlist-dimension-inline-editor {
  display: inline-block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  height: auto;
  max-height: none;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  white-space: nowrap;
  transform: none;
}

.cutlist-dimension-input {
  box-sizing: border-box;
  display: inline;
  min-width: 1ch;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: inherit;
  white-space: nowrap;
}

.cutlist-dimension-input:focus {
  outline: none;
}

.cutlist-dimension-separator,
.cutlist-dimension-unit {
  color: inherit;
  font: inherit;
  line-height: inherit;
}

.cutlist-dimension-ok-button {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  min-height: 18px;
  max-height: 18px;
  margin-left: 4px;
  padding: 0 4px;
  border: 1px solid #7a8492;
  border-radius: 2px;
  background: #f8fafc;
  color: #344054;
  font-family: "Poppins", Arial, Helvetica, sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  vertical-align: middle;
  cursor: pointer;
}

.cutlist-dimension-ok-button:hover,
.cutlist-dimension-ok-button:focus-visible {
  background: #eef2f6;
  outline: none;
}

.cutlist-dimension-control.is-editing .cutlist-dimension-value {
  visibility: hidden;
}

.cutlist-dimension-control.is-editing .cutlist-dimension-edit-button {
  display: none;
}

.cutlist-dimension-control.is-editing .cutlist-dimension-reset-pill {
  display: none;
}

.cutlist-dimension-control.is-editing .cutlist-dimension-all-prompt {
  display: none;
}

.kusovnik-cutlist-table tbody tr {
  height: 42px;
}

.kusovnik-cutlist-table tbody tr.has-cutlist-note {
  height: 48px;
}

.kusovnik-cutlist-table th:nth-child(1),
.kusovnik-cutlist-table td:nth-child(1) {
  width: calc(48% - 0.5px);
}

.kusovnik-cutlist-table th:nth-child(2),
.kusovnik-cutlist-table td:nth-child(2) {
  width: calc(5.33% - 0.25px);
  padding-left: 86px;
  padding-right: 0;
  text-align: left;
}

.kusovnik-cutlist-table th:nth-child(3),
.kusovnik-cutlist-table td:nth-child(3) {
  width: calc(6.67% - 0.25px);
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}

.kusovnik-cutlist-table th:nth-child(4),
.kusovnik-cutlist-table td:nth-child(4) {
  width: 1px;
  padding: 0;
}

.kusovnik-cutlist-table th:nth-child(5),
.kusovnik-cutlist-table td:nth-child(5) {
  width: 40%;
  padding-left: 4px;
}

.kusovnik-cutlist-table .cutlist-note-cell {
  white-space: normal;
  overflow: hidden;
}

.kusovnik-cutlist-table .cutlist-note-content {
  display: -webkit-box;
  overflow: hidden;
  max-height: 2.5em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #475467;
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.kusovnik-cutlist-table .cutlist-overage-note {
  display: inline-block;
  margin-right: 3px;
  padding: 1px 5px;
  border: 1px solid #e9b894;
  border-radius: 4px;
  background: #fff3e8;
  color: #9a3412;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
}

.kusovnik-cutlist-table .cutlist-note-detail {
  color: #475467;
}

.kusovnik-cutlist-table .material-row td {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  padding: 0 8px;
}

.kusovnik-cutlist-table .material-subrow-inner {
  display: flex;
  min-height: 18px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px 1px;
  line-height: 18px;
}

.kusovnik-cutlist-table .material-subrow-control,
.kusovnik-cutlist-table .kusovnik-mdf-control {
  display: inline-flex;
  height: 18px;
  align-items: center;
  gap: 4px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.kusovnik-cutlist-table .kusovnik-mdf-pill-value {
  color: #445163 !important;
  -webkit-text-fill-color: #445163 !important;
  font-family: "Poppins", Arial, Helvetica, sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  font-synthesis: none;
  text-rendering: geometricPrecision;
}

.kusovnik-cutlist-table .kusovnik-mdf-control.is-pending .kusovnik-mdf-pill {
  border-color: #0d4f47;
  background: #eef8f4;
  box-shadow: 0 0 0 3px rgba(24, 100, 90, 0.12);
}

.kusovnik-cutlist-table .material-subrow-control {
  flex: 0 0 auto;
}

.kusovnik-cutlist-table .kusovnik-mdf-control {
  --kusovnik-picker-width: 4em;
  position: relative;
  flex: 0 0 auto;
  z-index: 1;
}

.kusovnik-cutlist-table .kusovnik-mdf-control--door-shell {
  --kusovnik-picker-width: 3.5em;
}

.kusovnik-cutlist-table .kusovnik-massive-control {
  --kusovnik-picker-width: 2.5em;
}

.kusovnik-cutlist-table .kusovnik-mdf-control--oblozky,
.kusovnik-cutlist-table .kusovnik-mdf-control--protioblozky {
  flex-wrap: wrap;
  white-space: normal;
}

.kusovnik-cutlist-table .kusovnik-mdf-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: 4px;
}

.kusovnik-cutlist-table .kusovnik-mdf-actions--oblozky {
  row-gap: 4px;
}

.kusovnik-cutlist-table .kusovnik-mdf-action-button {
  min-height: 18px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: "Poppins", Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.kusovnik-cutlist-table .kusovnik-mdf-action-button:hover,
.kusovnik-cutlist-table .kusovnik-mdf-action-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(24, 100, 90, 0.12);
}

.kusovnik-cutlist-table .kusovnik-mdf-action-button--single {
  background: var(--primary);
  color: #ffffff;
}

.kusovnik-cutlist-table .kusovnik-mdf-action-button--single:hover,
.kusovnik-cutlist-table .kusovnik-mdf-action-button--single:focus-visible {
  background: var(--primary-strong);
}

.kusovnik-cutlist-table .kusovnik-mdf-action-button--all {
  background: #e6f1ed;
  color: #0d4f47;
}

.kusovnik-cutlist-table .kusovnik-mdf-action-button--all:hover,
.kusovnik-cutlist-table .kusovnik-mdf-action-button--all:focus-visible {
  background: #d6ebe4;
}

.kusovnik-cutlist-table .kusovnik-mdf-action-button--all-with-protioblozky {
  border: 1px solid transparent;
  background: #dceaf7;
  color: #1f5f8b;
}

.kusovnik-cutlist-table .kusovnik-mdf-action-button--all-with-protioblozky:hover,
.kusovnik-cutlist-table .kusovnik-mdf-action-button--all-with-protioblozky:focus-visible {
  background: #c8dff5;
  border-color: transparent;
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 95, 139, 0.12);
}

.kusovnik-cutlist-table .kusovnik-mdf-action-button--optional {
  border-color: transparent;
  background: #fff7e6;
  color: #6f4a00;
}

.kusovnik-cutlist-table .kusovnik-mdf-action-button--optional:hover,
.kusovnik-cutlist-table .kusovnik-mdf-action-button--optional:focus-visible {
  background: #ffefc2;
}

.kusovnik-cutlist-table .kusovnik-mdf-action-button--cancel {
  background: #edf1f5;
  color: #445163;
}

.kusovnik-cutlist-table .kusovnik-mdf-action-button--cancel:hover,
.kusovnik-cutlist-table .kusovnik-mdf-action-button--cancel:focus-visible {
  background: #dfe5eb;
}

.kusovnik-cutlist-table .kusovnik-mdf-pill {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: var(--kusovnik-picker-width);
  height: 18px;
  min-height: 18px;
  margin-left: 0;
  padding: 0 5px 0 5px;
  border: 1px solid #5f6d84;
  border-radius: 4px;
  background: #ffffff;
  color: #445163;
  -webkit-text-fill-color: #445163;
  font-family: "Poppins", Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.kusovnik-cutlist-table .kusovnik-mdf-pill:hover,
.kusovnik-cutlist-table .kusovnik-mdf-pill:focus-visible {
  border-color: #344054;
  outline: none;
  box-shadow: 0 0 0 3px rgba(95, 109, 132, 0.12);
}

.kusovnik-cutlist-table .kusovnik-mdf-pill-value {
  letter-spacing: 0;
}

.kusovnik-cutlist-table .kusovnik-mdf-menu {
  position: absolute;
  left: 0;
  z-index: 25;
  display: grid;
  box-sizing: border-box;
  width: var(--kusovnik-picker-width);
  min-width: var(--kusovnik-picker-width);
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: none;
  overflow: hidden;
}

.kusovnik-cutlist-table .kusovnik-mdf-menu::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid #5f6d84;
  border-radius: inherit;
  pointer-events: none;
}

.kusovnik-cutlist-table .kusovnik-mdf-control.is-flipped .kusovnik-mdf-menu {
  top: auto;
  bottom: calc(100% - 1px);
}

.kusovnik-cutlist-table .kusovnik-mdf-menu[data-mdf-current="28"] {
  top: 0;
}

.kusovnik-cutlist-table .kusovnik-mdf-menu[data-mdf-current="25"] {
  top: -18px;
}

.kusovnik-cutlist-table .kusovnik-mdf-menu[data-mdf-current="22"] {
  top: -36px;
}

.kusovnik-cutlist-table .kusovnik-massive-menu[data-massive-current="SM"] {
  top: 0;
}

.kusovnik-cutlist-table .kusovnik-massive-menu[data-massive-current="DB"] {
  top: -18px;
}

.kusovnik-cutlist-table .kusovnik-massive-menu[data-massive-current="BK"] {
  top: -36px;
}

.kusovnik-cutlist-table .kusovnik-mdf-control.is-flipped .kusovnik-mdf-menu[data-mdf-current="28"] {
  bottom: 0;
}

.kusovnik-cutlist-table .kusovnik-mdf-control.is-flipped .kusovnik-mdf-menu[data-mdf-current="25"] {
  bottom: -18px;
}

.kusovnik-cutlist-table .kusovnik-mdf-control.is-flipped .kusovnik-mdf-menu[data-mdf-current="22"] {
  bottom: -36px;
}

.kusovnik-cutlist-table .kusovnik-massive-control.is-flipped .kusovnik-massive-menu[data-massive-current="SM"] {
  bottom: 0;
}

.kusovnik-cutlist-table .kusovnik-massive-control.is-flipped .kusovnik-massive-menu[data-massive-current="DB"] {
  bottom: -18px;
}

.kusovnik-cutlist-table .kusovnik-massive-control.is-flipped .kusovnik-massive-menu[data-massive-current="BK"] {
  bottom: -36px;
}

.kusovnik-cutlist-table .kusovnik-mdf-menu[hidden] {
  display: none;
}

.kusovnik-cutlist-table .kusovnik-mdf-menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 18px;
  min-height: 18px;
  padding: 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #445163;
  font-family: "Poppins", Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.kusovnik-cutlist-table .kusovnik-mdf-menu-item:hover,
.kusovnik-cutlist-table .kusovnik-mdf-menu-item:focus-visible {
  background: #f2f5f9;
  outline: none;
}

.kusovnik-cutlist-table .formula-cell {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.kusovnik-cutlist-table .material-subrow td {
  background: #fbfdff;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 18px;
  padding: 0 8px;
  white-space: normal;
}

@media screen {
  .kusovnik-pages,
  .kusovnik-door-page,
  .kusovnik-section {
    min-width: 0;
  }

  .kusovnik-cutlist-section {
    overflow-x: auto;
  }

  .kusovnik-cutlist-section .kusovnik-cutlist-table {
    min-width: 900px;
  }
}

.kusovnik-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.kusovnik-page .project-field input:disabled,
.export-page .project-field input:disabled {
  background: var(--input);
  border-color: #c7cfda;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  opacity: 1;
  cursor: default;
}

.kusovnik-page .project-manager-button:disabled,
.export-page .project-manager-button:disabled {
  opacity: 1;
  cursor: default;
}

.kusovnik-page .project-manager-button:disabled:hover,
.export-page .project-manager-button:disabled:hover {
  background: #eef1f4;
}

.kusovnik-page .project-manager-button--unknown:not(:disabled),
.export-page .project-manager-button--unknown:not(:disabled) {
  cursor: pointer;
}

.kusovnik-page .project-manager-button--unknown:disabled:hover,
.export-page .project-manager-button--unknown:disabled:hover {
  background: #fff4d6;
}

.kusovnik-page .project-field input:disabled::placeholder,
.export-page .project-field input:disabled::placeholder {
  color: #667085;
  -webkit-text-fill-color: #667085;
  opacity: 1;
}

.export-page {
  background: var(--bg);
}

.export-workspace {
  display: flex;
  /*
   * Keep the empty space below short export tables stable, just like on the
   * parts-list page. This prevents the fixed navigation buttons from sitting
   * directly against the last table row on taller viewports.
   */
  flex: 1 0 0;
  flex-direction: column;
  gap: 18px;
  padding: 24px clamp(16px, 4vw, 48px) 65px;
}

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

.export-summary-card,
.export-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.export-summary-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px 16px;
  text-align: center;
  justify-items: center;
}

.export-summary-card span {
  justify-self: start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
}

.export-summary-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.export-summary-card:not(.export-materials-summary-card) strong {
  font-size: 36px;
}

.export-materials-summary-card {
  justify-items: stretch;
  text-align: left;
}

.export-materials-summary-card span {
  justify-self: stretch;
}

.export-summary-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.export-library-help {
  display: grid;
  gap: 5px;
}

.export-library-file {
  color: var(--ink);
  font-weight: 800;
}

.export-library-path {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.export-library-path code {
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 4px 6px;
  border: 1px solid #d6e2ef;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.export-library-copy-button {
  box-sizing: border-box;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid #d6e2ef;
  border-radius: 6px;
  background: #eef2f7;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

.export-library-copy-button:hover,
.export-library-copy-button:focus-visible {
  border-color: #b8c8d8;
  background: #e2e8f0;
  color: var(--ink);
}

.export-library-copy-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.export-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.export-summary-actions .secondary-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.export-summary-actions .secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.export-summary-card-warn {
  border-color: #f2c94c;
  background: #fff8df;
}

.export-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: auto;
}

.export-panel {
  min-width: 0;
  padding: 16px;
}

.export-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.export-panel-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.export-panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.material-dialog-field input,
.material-dialog-field textarea,
.material-input {
  width: 100%;
  min-width: 0;
  border: 1px solid #cfd6e2;
  border-radius: 8px;
  background: var(--input);
  color: var(--ink);
  font: inherit;
}

.material-dialog-field input,
.material-input {
  min-height: 38px;
  padding: 8px 10px;
}

.material-dialog-field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.material-dialog-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.material-dialog-field textarea {
  min-height: 130px;
  padding: 10px;
  resize: vertical;
}

.material-dialog-dimensions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 10px;
  row-gap: 4px;
  margin-bottom: 14px;
}

.material-dialog-dimensions h4 {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.material-dialog-dimension {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 6px;
  row-gap: 4px;
  align-items: center;
  min-width: 0;
}

.material-dialog-dimension > span {
  grid-column: 1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.material-dialog-dimension input {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cfd6e2;
  border-radius: 8px;
  background: var(--input);
  color: var(--ink);
  font: inherit;
}

.material-dialog-dimension em {
  grid-column: 2;
  grid-row: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
}

@media (max-width: 520px) {
  .material-dialog-dimensions {
    grid-template-columns: 1fr;
  }
}

.export-muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.export-table-panel {
  overflow: visible;
}

.export-table-head {
  align-items: center;
}

.export-copy-button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.export-alert {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.export-alert.is-hiding {
  opacity: 0;
}

.export-alert[data-type="ok"] {
  border-color: #b7e2c6;
  background: var(--ok-bg);
  color: var(--ok);
}

.export-alert[data-type="warn"] {
  border-color: #f2c94c;
  background: var(--warn-bg);
  color: var(--warn);
}

.export-material-override-warning {
  margin-bottom: 12px;
  padding: 11px 12px;
  border: 1px solid #f1a29b;
  border-radius: 8px;
  background: #fff1f0;
  color: #b42318;
  font-size: 14px;
  font-weight: 700;
}

.export-button-warning {
  position: fixed;
  right: 24px;
  bottom: 82px;
  z-index: 21;
  max-width: min(360px, calc(100vw - 48px));
  padding: 10px 12px;
  border: 1px solid #f2c94c;
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 10px 24px rgba(111, 73, 0, 0.18);
  transform-origin: right bottom;
}

.export-button-warning::after {
  position: absolute;
  right: 28px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  border-right: 1px solid #f2c94c;
  border-bottom: 1px solid #f2c94c;
  background: var(--warn-bg);
  content: "";
  transform: rotate(45deg);
}

.export-button-warning.is-popping {
  animation: export-button-warning-pop 0.22s ease-out;
}

@keyframes export-button-warning-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.export-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: fixed;
}

.export-col-door-code {
  width: var(--export-door-code-width, 72px);
}

.export-col-designation {
  width: var(--export-designation-width, 220px);
}

.export-col-material {
  width: 180px;
}

.export-col-length,
.export-col-width {
  width: 64px;
}

.export-col-qty {
  width: 78px;
}

.export-col-label {
  width: auto;
}

.export-table th,
.export-table td {
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
}

.export-table tbody tr {
  height: auto;
  min-height: 0;
}

.export-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 7px 8px;
  background: #eef1f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.export-table td {
  padding: 1px 8px;
  height: auto;
  min-height: 0;
  font-size: 13px;
  line-height: 18px;
  white-space: normal;
}

.export-table th:nth-child(1),
.export-table td:nth-child(1),
.export-table th:nth-child(2),
.export-table td:nth-child(2) {
  white-space: nowrap;
}

.export-table th:nth-child(4),
.export-table td:nth-child(4) {
  white-space: nowrap;
}

.export-table th:nth-child(5),
.export-table td:nth-child(5) {
  white-space: nowrap;
}

.export-door-code-cell {
  font-weight: 700;
}

.export-door-code {
  display: inline-block;
  width: var(--export-door-code-tab-width, 28px);
}

.export-door-code-separator {
  display: inline-block;
  width: 14px;
  text-align: center;
  font-weight: 400;
}

.export-table .material-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 18px;
  padding: 0 24px 0 4px;
  border-radius: 4px;
  appearance: none;
  font-size: 13px;
  line-height: 18px;
}

.export-table .material-input:disabled {
  cursor: not-allowed;
  background: #eef1f4;
  color: #98a2b3;
}

.export-table .material-input.is-missing {
  border-color: #d92d20;
  background: #fff2f0;
}

.material-combobox {
  position: relative;
  display: block;
}

.material-combobox-toggle {
  position: absolute;
  top: 50%;
  right: 2px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 16px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.material-combobox-toggle::before {
  content: "";
  width: 0;
  height: 0;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-top: 5px solid #667085;
  transition: transform 0.14s ease;
}

.material-combobox-toggle:hover,
.material-combobox:focus-within .material-combobox-toggle {
  background: #eef3f6;
}

.material-combobox-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.material-combobox.is-open .material-combobox-toggle::before {
  transform: rotate(180deg);
}

.hpl-apply-all-button {
  display: block;
  width: 100%;
  min-height: 20px;
  margin-top: 4px;
  padding: 2px 5px;
  border: 0;
  border-radius: 4px;
  background: #f4c542;
  color: #4a3510;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.export-table td.export-material-cell--with-hpl-action {
  padding-top: 4px;
  padding-bottom: 4px;
}

.hpl-apply-all-button:hover {
  background: #e7b631;
}

.material-suggestions {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  z-index: 60;
  display: grid;
  gap: 2px;
  max-height: min(260px, 48vh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 4px;
  border: 1px solid #cfd9e8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  scrollbar-color: #aab6c5 #eef2f7;
  scrollbar-width: thin;
}

.material-suggestions::-webkit-scrollbar {
  width: 9px;
}

.material-suggestions::-webkit-scrollbar-track {
  background: #eef2f7;
  border-radius: 999px;
}

.material-suggestions::-webkit-scrollbar-thumb {
  border: 2px solid #eef2f7;
  border-radius: 999px;
  background: #aab6c5;
}

.material-suggestions[hidden] {
  display: none;
}

.material-suggestion,
.material-suggestion-empty {
  min-height: 26px;
  padding: 4px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 12px;
  line-height: 1.25;
}

.material-suggestion {
  cursor: pointer;
  font-weight: 600;
}

.material-suggestion:hover,
.material-suggestion:focus-visible {
  background: #edf5f3;
}

.material-suggestion-empty {
  color: var(--muted);
}

.export-label-cell {
  color: var(--muted);
  font-size: inherit;
  line-height: 1.2;
}

.export-note-split {
  display: inline-grid;
  grid-template-columns: max-content auto max-content;
  column-gap: 28px;
  align-items: baseline;
}

.export-note-split span {
  min-width: 0;
}

.export-note-separator {
  color: var(--ink);
  font-weight: 800;
}

.export-download-button {
  border: 0;
  cursor: pointer;
}

.material-import-download-button {
  bottom: 82px;
  border: 0;
  cursor: pointer;
  background: #334155;
  box-shadow: 0 10px 24px rgba(51, 65, 85, 0.24);
}

.material-import-download-button:hover {
  background: #1f2937;
}

.export-download-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.material-import-download-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

  .export-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .export-layout {
    grid-template-columns: 1fr;
  }

  .kusovnik-workspace {
    padding-left: 12px;
    padding-right: 12px;
  }

  .kusovnik-overview-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .kusovnik-door-chip-list {
    gap: 8px;
  }

  .kusovnik-door-page {
    padding: 16px;
  }

  .saved-orders-table {
    min-width: 1100px;
  }

  .saved-orders-wrap .table-scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .kusovnik-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  body {
    font-size: 15px;
  }

  .topbar,
  .workspace {
    padding-left: 12px;
    padding-right: 12px;
  }

  .entry-panel,
  .order-panel {
    padding: 14px;
  }

  .form-grid,
  .results {
    grid-template-columns: 1fr;
  }

  .door-mode-buttons {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .export-workspace {
    padding-left: 12px;
    padding-right: 12px;
  }

  .export-summary {
    grid-template-columns: 1fr;
  }

  .export-panel {
    padding: 14px;
  }

  .export-panel-head,
  .export-table-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions button {
    width: 100%;
  }

  .next-step-button {
    right: 12px;
    bottom: 12px;
  }

  .export-button-warning {
    right: 12px;
    bottom: 70px;
    max-width: calc(100vw - 24px);
  }

  .material-import-download-button {
    bottom: 68px;
  }

  .back-button {
    left: 12px;
    right: auto;
  }

  .kusovnik-workspace {
    padding-left: 12px;
    padding-right: 12px;
  }

  .kusovnik-overview-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .kusovnik-info-grid {
    grid-template-columns: 1fr;
  }

  .version-history-meta {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  body.kusovnik-page {
    display: block;
    width: auto;
    min-height: 0;
    height: auto;
  }

  .topbar,
  .next-step-button,
  .back-button,
  .app-credit,
  .material-import-download-button,
  .export-download-button {
    display: none !important;
  }

  .kusovnik-workspace {
    display: block;
    width: 190mm;
    max-width: 190mm;
    min-height: 0;
    height: auto;
    flex: none;
    margin: 0;
    padding: 0;
    gap: 0;
  }

  .kusovnik-pages {
    display: block;
    width: 190mm;
    max-width: 190mm;
    margin: 0;
    padding: 0;
    gap: 0;
  }

  .kusovnik-overview {
    display: none !important;
  }

  .kusovnik-door-page {
    display: block;
    position: relative;
    width: 190mm;
    max-width: 190mm;
    height: 270mm;
    min-height: 270mm;
    box-sizing: border-box;
    padding: 0;
    overflow: hidden;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .kusovnik-page-content {
    width: 153.8462%;
    transform: scale(0.65);
    transform-origin: left top;
  }

  .kusovnik-door-page {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
  }

  .kusovnik-door-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .kusovnik-section {
    padding-left: 0;
    padding-right: 0;
    padding-top: 10px;
  }

  .kusovnik-section h3 {
    margin-bottom: 8px;
    font-size: 16px;
  }

  .kusovnik-page-footer {
    display: block;
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    margin: 0;
    padding: 0;
    color: var(--ink);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
  }

  .kusovnik-info-grid {
    grid-template-columns: repeat(4, var(--kusovnik-print-card-width, max-content));
    gap: 6px;
    justify-content: start;
    align-items: start;
  }

  .kusovnik-info-card {
    min-height: 0;
    padding: 7px 8px;
  }

  .kusovnik-info-card-value {
    line-height: 1.15;
  }

  .kusovnik-info-card.kusovnik-note-card {
    grid-column: auto;
    align-self: start;
  }

  .kusovnik-info-card.kusovnik-note-placeholder {
    display: grid;
    visibility: hidden;
    pointer-events: none;
  }

  .kusovnik-info-card.kusovnik-note-card .kusovnik-note-value {
    font-size: 13px;
    line-height: 1.25;
  }

  .kusovnik-cutlist-table .material-subrow-control,
  .kusovnik-cutlist-table .kusovnik-mdf-control {
    height: auto;
    gap: 0;
    color: inherit;
  }

  .kusovnik-cutlist-table .material-subrow-inner {
    min-height: 0;
    gap: 0;
    line-height: inherit;
  }

  .kusovnik-cutlist-table .material-subrow-control::before {
    content: "\00a0";
  }

  .kusovnik-cutlist-table .kusovnik-mdf-pill {
    display: inline;
    height: auto;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    -webkit-text-fill-color: currentColor;
    cursor: default;
  }

  .kusovnik-cutlist-table .kusovnik-mdf-pill:hover,
  .kusovnik-cutlist-table .kusovnik-mdf-pill:focus-visible {
    border: 0;
    box-shadow: none;
    outline: none;
  }

  .kusovnik-cutlist-table .kusovnik-mdf-pill-value {
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
    font-size: 12px !important;
    font-weight: 700 !important;
  }

  .kusovnik-cutlist-table .kusovnik-mdf-menu {
    display: none !important;
  }

  .kusovnik-cutlist-table .kusovnik-mdf-actions {
    display: none !important;
  }

  .cutlist-dimension-actions,
  .cutlist-dimension-edit-button,
  .cutlist-dimension-inline-editor,
  .cutlist-dimension-input {
    display: none !important;
  }

  .cutlist-dimension-control.is-editing .cutlist-dimension-value {
    display: inline;
    visibility: visible;
  }

  .kusovnik-note {
    margin-top: 8px;
    font-size: 12px;
  }

  .kusovnik-cutlist-table th,
  .kusovnik-cutlist-table td {
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .kusovnik-cutlist-table tbody tr.has-cutlist-note {
    height: 44px;
  }

  .kusovnik-cutlist-table .cutlist-note-content {
    display: block;
    overflow: visible;
    max-height: none;
    -webkit-line-clamp: unset;
    font-size: 10px;
    line-height: 1.2;
  }

  .kusovnik-cutlist-table .cutlist-overage-note {
    display: inline-flex;
    min-height: 16px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    padding: 1px 5px;
    border-color: #e9b894;
    background: #fff3e8;
    font-size: 11px;
    line-height: 1.1;
    vertical-align: middle;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .kusovnik-cutlist-table .cutlist-note-detail {
    vertical-align: middle;
  }
}

.dvt-help-button {
  position: fixed;
  top: 50%;
  left: auto;
  right: 0;
  z-index: 60;
  display: inline-flex;
  width: 46px;
  min-width: 46px;
  height: 52px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-right: 0;
  border-radius: 999px 0 0 999px;
  background: #101820;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.26);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  padding: 0;
  transform: translateY(-50%);
}

.dvt-help-button:hover,
.dvt-help-button:focus-visible {
  background: #22313b;
}

.dvt-help-button:focus-visible,
.dvt-help-close:focus-visible,
.dvt-help-tab:focus-visible,
.dvt-help-inspect-toggle:focus-visible {
  outline: 3px solid rgba(245, 181, 44, 0.58);
  outline-offset: 2px;
}

.dvt-help-button-mark {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f5b52c;
  color: #101820;
  font-size: 15px;
  text-align: center;
  line-height: 22px;
}

.dvt-help-question {
  display: inline-block;
  transform: translateX(0.5px);
}

.dvt-help-button-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.dvt-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0);
  opacity: 0;
  transition: opacity 220ms ease, background-color 220ms ease;
  pointer-events: none;
}

.dvt-help-overlay.is-open {
  background: rgba(15, 23, 42, 0.38);
  opacity: 1;
  pointer-events: auto;
}

.dvt-help-panel {
  display: flex;
  width: min(460px, 100%);
  max-width: 100%;
  max-height: 100vh;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: #ffffff;
  box-shadow: -18px 0 48px rgba(15, 23, 42, 0.2);
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.dvt-help-overlay.is-open .dvt-help-panel {
  transform: translateX(0);
}

.dvt-help-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid #eef2f7;
}

.dvt-help-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dvt-help-head h2 {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.18;
}

.dvt-help-close {
  flex: 0 0 36px;
  position: relative;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: #eef2f7;
  color: #17202a;
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

.dvt-help-close:hover {
  background: #dce3ec;
}

.dvt-help-close::before,
.dvt-help-close::after,
.dvt-help-inspect-dock button::before,
.dvt-help-inspect-dock button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
}

.dvt-help-close::before,
.dvt-help-inspect-dock button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.dvt-help-close::after,
.dvt-help-inspect-dock button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.dvt-help-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 12px 14px 8px;
  border-bottom: 1px solid #eef2f7;
  overflow: visible;
}

.dvt-help-tab {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #475467;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  padding: 0 8px;
  white-space: nowrap;
}

.dvt-help-tab:hover {
  background: #f2f4f7;
  color: var(--ink);
}

.dvt-help-tab.is-active {
  border-color: #b9d8d2;
  background: #e6f1ed;
  color: var(--primary-strong);
}

.dvt-help-tools {
  padding: 10px 20px 0;
}

.dvt-help-inspect-toggle {
  min-height: 34px;
  border: 1px solid #cfd6df;
  border-radius: 999px;
  background: #f7f8fa;
  color: #475467;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 0 13px;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.dvt-help-inspect-toggle:hover,
.dvt-help-inspect-toggle:focus-visible,
.dvt-help-inspect-toggle[aria-pressed="true"] {
  border-color: #b9d8d2;
  background: #dff0eb;
  color: var(--primary-strong);
}

.dvt-help-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
  padding: 16px 20px 24px;
}

.dvt-help-section + .dvt-help-section,
.dvt-help-note + .dvt-help-section,
.dvt-help-section + .dvt-help-note {
  margin-top: 18px;
}

.dvt-help-section h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.25;
}

.dvt-help-section p,
.dvt-help-note p {
  margin: 0;
  color: #475467;
  font-size: 14px;
  line-height: 1.55;
}

.dvt-help-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.dvt-help-steps li {
  color: #344054;
  font-size: 14px;
  line-height: 1.5;
}

.dvt-help-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.dvt-help-list > div {
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f7;
}

.dvt-help-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.dvt-help-list dt {
  margin: 0 0 3px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.dvt-help-list dd {
  margin: 0;
  color: #475467;
  font-size: 13px;
  line-height: 1.5;
}

.dvt-help-note {
  border: 1px solid #f4d58f;
  border-radius: 8px;
  background: #fffbeb;
  padding: 12px 14px;
}

.dvt-help-note strong {
  display: block;
  margin-bottom: 4px;
  color: #8a5200;
  font-size: 13px;
}

body.dvt-help-inspect [data-dvt-help-target]:not([hidden]) {
  cursor: help;
}

.dvt-help-hit-layer {
  position: fixed;
  inset: 0;
  z-index: 91;
  background: transparent;
  cursor: help;
}

.dvt-help-target-layer {
  position: fixed;
  inset: 0;
  z-index: 92;
  overflow: hidden;
  pointer-events: none;
}

.dvt-help-target-frame {
  position: absolute;
  box-sizing: border-box;
  border: 3px solid rgba(245, 181, 44, 0.96);
  background: rgba(245, 181, 44, 0.04);
  box-shadow: 0 0 0 5px rgba(245, 181, 44, 0.22);
  pointer-events: none;
}

.dvt-help-popover {
  position: fixed;
  z-index: 95;
  width: min(320px, calc(100vw - 24px));
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 12px 14px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
}

.dvt-help-popover strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  line-height: 1.35;
}

.dvt-help-popover p {
  margin: 0;
  color: #475467;
  font-size: 13px;
  line-height: 1.45;
}

.dvt-help-popover-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.dvt-help-popover-action {
  min-height: 30px;
  border: 1px solid #b9d8d2;
  border-radius: 999px;
  background: #f6fbf9;
  color: var(--primary-strong);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 0 11px;
}

.dvt-help-popover-action:hover,
.dvt-help-popover-action:focus-visible {
  background: #dff0eb;
}

.dvt-help-inspect-dock {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  max-width: calc(100vw - 32px);
  border: 1px solid #b9d8d2;
  border-radius: 999px;
  background: #ffffff;
  color: var(--primary-strong);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.2);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 0 8px 0 14px;
  transform: translateX(-50%);
}

.dvt-help-inspect-dock button {
  flex: 0 0 30px;
  display: inline-grid;
  position: relative;
  box-sizing: border-box;
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  height: 30px;
  min-height: 30px;
  max-height: 30px;
  aspect-ratio: 1 / 1;
  align-self: center;
  place-items: center;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: #e6f1ed;
  color: var(--primary-strong);
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
}

.dvt-help-inspect-dock button:hover,
.dvt-help-inspect-dock button:focus-visible {
  background: #cfe7df;
}

@media (max-width: 899px) {
  .dvt-help-button {
    top: 50%;
    left: auto;
    right: 0;
    bottom: auto;
    width: 48px;
    min-width: 48px;
    height: 52px;
    min-height: 52px;
    border-right: 0;
    border-radius: 999px 0 0 999px;
    padding: 0;
    transform: translateY(-50%);
  }

  .dvt-help-button-mark {
    width: 24px;
    height: 24px;
  }

  .dvt-help-overlay {
    align-items: flex-end;
    justify-content: stretch;
  }

  .dvt-help-panel {
    width: 100%;
    max-height: min(82vh, 720px);
    border-top: 1px solid var(--line);
    border-left: 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.22);
    transform: translateY(100%);
  }

  .dvt-help-overlay.is-open .dvt-help-panel {
    transform: translateY(0);
  }

  .dvt-help-head {
    padding: 16px 16px 12px;
  }

  .dvt-help-head h2 {
    font-size: 19px;
  }

  .dvt-help-tools {
    padding: 10px 16px 0;
  }

  .dvt-help-content {
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  }

  .dvt-help-inspect-dock {
    bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .dvt-help-overlay,
  .dvt-help-panel {
    transition: none;
  }
}

@media print {
  .dvt-help-button,
  .dvt-help-overlay,
  .dvt-help-popover,
  .dvt-help-inspect-dock {
    display: none !important;
  }
}

/* Night mode is intentionally screen-only so printed cut lists stay white. */
@media screen {
  :root[data-theme="dark"] body,
  :root[data-theme="dark"] body.index-page,
  :root[data-theme="dark"] body.kusovnik-page,
  :root[data-theme="dark"] body.export-page {
    background: var(--bg);
    color: var(--ink);
  }

  :root[data-theme="dark"] input,
  :root[data-theme="dark"] select,
  :root[data-theme="dark"] textarea,
  :root[data-theme="dark"] .unit-input,
  :root[data-theme="dark"] .material-dialog-field input,
  :root[data-theme="dark"] .material-dialog-field textarea,
  :root[data-theme="dark"] .material-input,
  :root[data-theme="dark"] .material-dialog-dimension input {
    border-color: #4a5965;
    background: var(--input);
    color: var(--ink);
  }

  :root[data-theme="dark"] input::placeholder,
  :root[data-theme="dark"] textarea::placeholder {
    color: #7f8d99;
    opacity: 1;
  }

  :root[data-theme="dark"] label,
  :root[data-theme="dark"] th,
  :root[data-theme="dark"] .unify-field span,
  :root[data-theme="dark"] .unify-group-title,
  :root[data-theme="dark"] .unify-unchanged-heading,
  :root[data-theme="dark"] .kusovnik-cutlist-table .material-subrow-control,
  :root[data-theme="dark"] .kusovnik-cutlist-table .kusovnik-mdf-control,
  :root[data-theme="dark"] .dvt-help-steps li {
    color: var(--ink);
  }

  :root[data-theme="dark"] .results div,
  :root[data-theme="dark"] .note-popover,
  :root[data-theme="dark"] .delete-popover,
  :root[data-theme="dark"] .export-modal,
  :root[data-theme="dark"] .material-import-box,
  :root[data-theme="dark"] .material-import-visuals figure,
  :root[data-theme="dark"] .material-image-lightbox-image,
  :root[data-theme="dark"] .material-image-lightbox-close,
  :root[data-theme="dark"] .compare-summary-card,
  :root[data-theme="dark"] .compare-diff-box,
  :root[data-theme="dark"] .compare-diff-item,
  :root[data-theme="dark"] .version-history-card,
  :root[data-theme="dark"] .order-picker-item,
  :root[data-theme="dark"] .unify-modal,
  :root[data-theme="dark"] .unify-group,
  :root[data-theme="dark"] .unify-unchanged-list,
  :root[data-theme="dark"] .kusovnik-door-chip,
  :root[data-theme="dark"] .kusovnik-info-card,
  :root[data-theme="dark"] .export-library-path code,
  :root[data-theme="dark"] .export-alert,
  :root[data-theme="dark"] .material-suggestions,
  :root[data-theme="dark"] .dvt-help-panel,
  :root[data-theme="dark"] .dvt-help-popover {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
  }

  :root[data-theme="dark"] th,
  :root[data-theme="dark"] .kusovnik-cutlist-table thead th,
  :root[data-theme="dark"] .export-table th {
    border-color: var(--line);
    background: #222d35;
    color: #bdc8d2;
  }

  :root[data-theme="dark"] tbody tr,
  :root[data-theme="dark"] .kusovnik-cutlist-table th,
  :root[data-theme="dark"] .kusovnik-cutlist-table td,
  :root[data-theme="dark"] .export-table th,
  :root[data-theme="dark"] .export-table td {
    border-color: var(--line);
  }

  :root[data-theme="dark"] .author-button,
  :root[data-theme="dark"] .secondary-button,
  :root[data-theme="dark"] .import-button,
  :root[data-theme="dark"] .table-button,
  :root[data-theme="dark"] .order-picker-item,
  :root[data-theme="dark"] .cutlist-dimension-reset-pill,
  :root[data-theme="dark"] .cutlist-dimension-ok-button,
  :root[data-theme="dark"] .kusovnik-cutlist-table .kusovnik-mdf-pill,
  :root[data-theme="dark"] .export-library-copy-button,
  :root[data-theme="dark"] .dvt-help-close,
  :root[data-theme="dark"] .dvt-help-inspect-toggle {
    border-color: #53616d;
    background: #26313a;
    color: #e1e8ee;
    -webkit-text-fill-color: #e1e8ee;
  }

  :root[data-theme="dark"] .author-button:hover,
  :root[data-theme="dark"] .secondary-button:hover,
  :root[data-theme="dark"] .import-button:hover,
  :root[data-theme="dark"] .table-button:hover,
  :root[data-theme="dark"] .order-picker-item:hover,
  :root[data-theme="dark"] .cutlist-dimension-reset-pill:hover,
  :root[data-theme="dark"] .cutlist-dimension-ok-button:hover,
  :root[data-theme="dark"] .material-image-lightbox-close:hover,
  :root[data-theme="dark"] .dvt-help-close:hover {
    background: #313e48;
    color: #ffffff;
  }

  :root[data-theme="dark"] .quiet-button {
    color: var(--muted);
  }

  :root[data-theme="dark"] .door-mode-button:not([aria-pressed="true"]) {
    border-color: #53616d;
    background: #26313a;
    color: #e1e8ee;
  }

  :root[data-theme="dark"] .door-mode-button:not([aria-pressed="true"]):hover {
    background: #313e48;
  }

  :root[data-theme="dark"] .quiet-button:hover,
  :root[data-theme="dark"] .material-combobox-toggle:hover,
  :root[data-theme="dark"] .material-combobox:focus-within .material-combobox-toggle,
  :root[data-theme="dark"] .kusovnik-cutlist-table .kusovnik-mdf-menu-item:hover,
  :root[data-theme="dark"] .kusovnik-cutlist-table .kusovnik-mdf-menu-item:focus-visible,
  :root[data-theme="dark"] .material-suggestion:hover,
  :root[data-theme="dark"] .material-suggestion:focus-visible,
  :root[data-theme="dark"] .dvt-help-tab:hover {
    background: #26343d;
    color: var(--ink);
  }

  :root[data-theme="dark"] .saved-order-load-button,
  :root[data-theme="dark"] .order-actions .unify-button,
  :root[data-theme="dark"] .saved-orders-footer > .import-button,
  :root[data-theme="dark"] .kusovnik-cutlist-table .kusovnik-mdf-action-button--all,
  :root[data-theme="dark"] .material-import-help-button[aria-expanded="true"],
  :root[data-theme="dark"] .dvt-help-tab.is-active,
  :root[data-theme="dark"] .dvt-help-inspect-toggle[aria-pressed="true"],
  :root[data-theme="dark"] .dvt-help-popover-action,
  :root[data-theme="dark"] .dvt-help-inspect-dock button {
    border-color: #386f66;
    background: #1d3935;
    color: #7bd0c2;
  }

  :root[data-theme="dark"] .saved-order-load-button:hover,
  :root[data-theme="dark"] .order-actions .unify-button:hover,
  :root[data-theme="dark"] .kusovnik-cutlist-table .kusovnik-mdf-action-button--all:hover,
  :root[data-theme="dark"] .material-import-help-button:hover,
  :root[data-theme="dark"] .dvt-help-tab.is-active:hover,
  :root[data-theme="dark"] .dvt-help-popover-action:hover {
    background: #254a44;
  }

  :root[data-theme="dark"] .wall-thickness-display-toggle,
  :root[data-theme="dark"] .wall-thickness-display-toggle.is-active,
  :root[data-theme="dark"] .kusovnik-cutlist-table .kusovnik-mdf-action-button--all-with-protioblozky {
    border-color: #426f92;
    background: #1d3345;
    color: #8fc6ed;
  }

  :root[data-theme="dark"] .note-attention,
  :root[data-theme="dark"] .note-attention:focus,
  :root[data-theme="dark"] .saved-order-active td,
  :root[data-theme="dark"] tbody tr.editing-row td,
  :root[data-theme="dark"] tbody tr.recently-updated-row td,
  :root[data-theme="dark"] .export-summary-card-warn,
  :root[data-theme="dark"] .kusovnik-info-card.kusovnik-note-card,
  :root[data-theme="dark"] .dvt-help-note {
    border-color: #7d6330;
    background: #392f1d;
  }

  :root[data-theme="dark"] .kusovnik-info-card.kusovnik-cladding-card {
    border-color: #386f66;
    background: #1d3935;
  }

  :root[data-theme="dark"] .kusovnik-info-card.kusovnik-cladding-card span {
    color: #7bd0c2;
  }

  :root[data-theme="dark"] .project-manager-button--unknown,
  :root[data-theme="dark"] .kusovnik-page .project-manager-button--unknown:disabled:hover,
  :root[data-theme="dark"] .export-page .project-manager-button--unknown:disabled:hover {
    border-color: #b9822e;
    background: #49361a;
    color: #f1c66f;
    -webkit-text-fill-color: #f1c66f;
  }

  :root[data-theme="dark"] .status-pill.neutral {
    background: #26313a;
    color: #bdc8d2;
  }

  :root[data-theme="dark"] .danger-button {
    background: #432526;
    color: #ff9b92;
  }

  :root[data-theme="dark"] .danger-button:hover {
    background: #543032;
  }

  :root[data-theme="dark"] .message.error,
  :root[data-theme="dark"] .message.danger,
  :root[data-theme="dark"] .export-material-override-warning,
  :root[data-theme="dark"] .export-table .material-input.is-missing {
    border-color: #704043;
    background: var(--danger-bg);
    color: var(--danger);
  }

  :root[data-theme="dark"] .message.warning,
  :root[data-theme="dark"] .export-alert[data-type="warn"] {
    border-color: #735b2d;
  }

  :root[data-theme="dark"] .message.ok,
  :root[data-theme="dark"] .export-alert[data-type="ok"] {
    border-color: #386b49;
  }

  :root[data-theme="dark"] .compare-diff-value-before {
    border-color: #356545;
    background: #173323;
    color: #8ad5a1;
  }

  :root[data-theme="dark"] .compare-diff-value-after {
    border-color: #704043;
    background: #3a2028;
    color: #ff9eb2;
  }

  :root[data-theme="dark"] .kusovnik-cutlist-table .material-row td,
  :root[data-theme="dark"] .kusovnik-cutlist-table .material-subrow td {
    background: #202a32;
    color: #bdc8d2;
  }

  :root[data-theme="dark"] .kusovnik-cutlist-table .kusovnik-mdf-menu {
    background: #202a32;
  }

  :root[data-theme="dark"] .kusovnik-cutlist-table .kusovnik-mdf-menu-item {
    color: #d9e1e8;
  }

  :root[data-theme="dark"] .export-table .material-input:disabled,
  :root[data-theme="dark"] .kusovnik-page .project-manager-button:disabled:hover,
  :root[data-theme="dark"] .export-page .project-manager-button:disabled:hover {
    background: #222d35;
    color: #8997a3;
    -webkit-text-fill-color: #8997a3;
  }

  :root[data-theme="dark"] .material-suggestions {
    scrollbar-color: #657481 #202a32;
  }

  :root[data-theme="dark"] .material-suggestions::-webkit-scrollbar-track {
    background: #202a32;
  }

  :root[data-theme="dark"] .material-suggestions::-webkit-scrollbar-thumb {
    border-color: #202a32;
    background: #657481;
  }

  :root[data-theme="dark"] .material-import-instructions.is-collapsed::after {
    background: linear-gradient(to bottom, rgba(24, 32, 39, 0), var(--surface) 72%);
  }

  :root[data-theme="dark"] .saved-orders-title-name,
  :root[data-theme="dark"] .compare-summary-name,
  :root[data-theme="dark"] .version-history-version,
  :root[data-theme="dark"] .material-import-help-button[aria-expanded="true"],
  :root[data-theme="dark"] .dvt-help-kicker,
  :root[data-theme="dark"] .dvt-help-tab.is-active,
  :root[data-theme="dark"] .dvt-help-inspect-toggle[aria-pressed="true"],
  :root[data-theme="dark"] .dvt-help-popover-action,
  :root[data-theme="dark"] .dvt-help-inspect-dock {
    color: #72cbbd;
  }

  :root[data-theme="dark"] .dvt-help-head,
  :root[data-theme="dark"] .dvt-help-tabs,
  :root[data-theme="dark"] .dvt-help-list > div {
    border-color: var(--line);
  }

  :root[data-theme="dark"] .dvt-help-section p,
  :root[data-theme="dark"] .dvt-help-note p,
  :root[data-theme="dark"] .dvt-help-list dd,
  :root[data-theme="dark"] .dvt-help-popover p {
    color: var(--muted);
  }

  :root[data-theme="dark"] .dvt-help-note strong {
    color: #f0bd62;
  }
}

@media print {
  :root[data-theme="dark"] {
    color-scheme: light !important;
    --bg: #f4f6f8;
    --surface: #ffffff;
    --ink: #17202a;
    --muted: #667085;
    --line: #d9dee7;
    --input: #f9fafb;
    --primary: #18645a;
    --primary-strong: #0d4f47;
    --danger: #b42318;
    --danger-bg: #fff1f0;
    --ok: #237a45;
    --ok-bg: #ecfdf3;
    --warn: #9a5b00;
    --warn-bg: #fff6df;
  }

  .theme-toggle {
    display: none !important;
  }
}
