/* ============================================================
   JEDNO ŹRÓDŁO STYLU. Te tokeny steruje kartoteka „Styl CSS"
   (ui-style-lab) i nadpisuje je w runtime przez ui-style-apply.js.
   Wartości bazowe = wygląd premium (scalono z theme-premium.css,
   żeby nie było wojny tokenów: theme-premium już ich NIE redefiniuje).
   ============================================================ */
:root {
  --bg: #eef1f7;
  --surface: #ffffff;
  --surface-muted: #f5f7fb;
  --line: #e6e9f1;
  --line-strong: #d6dbe6;
  --text: #19212e;
  --muted: #5d6878;
  --muted-2: #97a0b1;
  --navy: #1b2a4a;
  --navy-2: #25406f;
  --brand: var(--navy);
  --border: var(--line);
  --surface-strong: #eaf0fb;
  --green: #168a4b;
  --green-soft: #e8f7ee;
  --blue-soft: #eaf1ff;
  --yellow-soft: #fff3cf;
  --purple-soft: #f0eaff;
  --danger: #c3352b;
  /* Akcent aplikacji (przyciski, aktywne menu, focus) — sterowany z karty */
  --accent: #3b6ef0;
  --accent-strong: #2f59d6;
  --accent-soft: #eaf0fe;
  --amber: #e0922e;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 12px 30px rgba(16,24,40,.08);
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --shadow-lg: 0 24px 60px rgba(16,24,40,.16);
  --radius: 12px;
  --radius-sm: 9px;
  --input-radius: 9px;
  --button-radius: 9px;
  --sidebar: 238px;
  --font-size-base: 12px;
  --font-family-sans: "DM Sans", "Segoe UI Variable", "Segoe UI", Aptos, "Noto Sans", "Liberation Sans", Arial, sans-serif;
  --label-size: 10px;
  --control-h: 32px;
  --control-h-sm: 27px;
  --icon-button-size: 32px;
  --panel-gap: 10px;
  --panel-pad: 12px;
  --table-cell-y: 9px;
  --table-cell-x: 12px;
  --table-head-size: 9px;
  --presentation-frame-border: 0px;
  --presentation-image-border: 0px;
  --avatar-engineering: #2563eb;
  --select-arrow-space: 32px;
  --select-arrow-space-sm: 26px;
  --select-arrow-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --bom-error-bg: #fff1f0;
  --bom-error-line: #fecdca;
  --bom-error-text: #b42318;
  --bom-ok-bg: #ecfdf3;
  --bom-ok-line: #abefc6;
  --bom-ok-text: #067647;
  --bom-legacy-bg: #eff8ff;
  --bom-legacy-line: #84caff;
  --bom-legacy-text: #175cd3;
  --bom-warning-bg: #fffbeb;
  --bom-warning-line: #fedf89;
  --bom-warning-text: #92400e;
  --tree-project-bg: #ffffff;
  --tree-stage-bg: #f4f7fb;
  --tree-level-2-bg: #eef4fb;
  --tree-level-3-bg: #e7eff8;
  --tree-level-4-bg: #dfe9f5;
  --tree-sold-bg: #e6f6ec;
  --tree-hover-bg: #dbe8f7;
  --tree-project-separator: #b7c7da;
  --tree-project-separator-width: 2px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c111c;
  --surface: #151c2b;
  --surface-muted: #1b2335;
  --surface-strong: #202a40;
  --line: #283044;
  --line-strong: #36415a;
  --text: #e8edf7;
  --muted: #9aa6bd;
  --muted-2: #6c7790;
  --navy: #cdd7ea;
  --navy-2: #eef3fb;
  --accent: #5b86f5;
  --accent-strong: #3b6ef0;
  --accent-soft: #1a2540;
  --green: #56d364;
  --green-soft: #15351f;
  --blue-soft: #1c2430;
  --yellow-soft: #342a11;
  --purple-soft: #241b35;
  --danger: #ff7b72;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 16px 38px rgba(0,0,0,.42);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.32);
  --shadow-lg: 0 28px 64px rgba(0,0,0,.5);
  --bom-error-bg: rgba(127, 29, 29, 0.28);
  --bom-error-line: rgba(248, 113, 113, 0.45);
  --bom-error-text: #fecaca;
  --bom-ok-bg: rgba(20, 83, 45, 0.32);
  --bom-ok-line: rgba(74, 222, 128, 0.42);
  --bom-ok-text: #bbf7d0;
  --bom-legacy-bg: rgba(24, 73, 169, 0.30);
  --bom-legacy-line: rgba(46, 144, 250, 0.58);
  --bom-legacy-text: #b2ddff;
  --bom-warning-bg: rgba(120, 53, 15, 0.30);
  --bom-warning-line: rgba(251, 191, 36, 0.42);
  --bom-warning-text: #fde68a;
  --tree-project-bg: #161b22;
  --tree-stage-bg: #1b222c;
  --tree-level-2-bg: #202936;
  --tree-level-3-bg: #263242;
  --tree-level-4-bg: #2b394b;
  --tree-sold-bg: #183226;
  --tree-hover-bg: #303d50;
  --tree-project-separator: #4b5563;
  --tree-project-separator-width: 2px;
  --select-arrow-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23e6edf3' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  line-height: 1.32;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell.is-login {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.is-login .sidebar,
.app-shell.is-login .topbar {
  display: none;
}

.app-shell.is-login .workspace {
  min-width: 0;
}

.app-shell.is-login .content {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.brand strong {
  display: block;
  color: #10235a;
  font-size: 13px;
  letter-spacing: 0;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  min-width: 42px;
  max-width: 42px;
  object-fit: contain;
  border-radius: var(--radius);
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 9px);
  gap: 5px;
}

.brand-mark span {
  width: 9px;
  height: 9px;
  border: 2px solid var(--navy);
  border-radius: 2px;
}

.nav {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
  align-content: start;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 7px;
  scrollbar-gutter: stable;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #1f2a44;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
}

.nav-catalog-group {
  min-width: 0;
}

.nav-catalog-group > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 9px;
  border-radius: var(--radius);
  color: #1f2a44;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.nav-catalog-group > summary::-webkit-details-marker {
  display: none;
}

/* Chevron grupy „Kartoteki" PO PRAWEJ stronie (ikona+napis wyrównane do lewej, jak inne
   pozycje menu). SVG mask = glif wyśrodkowany w bboxie, obrót wokół własnej osi:
   zwinięte = ⌄ (w dół), otwarte = obrót 180° (w górę) — spójnie z chevronami etapów. */
.nav-catalog-group > summary::before { content: none; }

.nav-catalog-group > summary::after {
  content: "";
  flex: none;
  width: 15px;
  height: 15px;
  margin-left: auto;
  background: currentColor;
  color: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z'/%3E%3C/svg%3E") center / contain no-repeat;
  transform-origin: 50% 50%;
  transition: transform 0.16s ease;
}

.nav-catalog-group[open] > summary::after {
  transform: rotate(180deg);
}

.nav-catalog-group > summary:hover {
  background: #eef3fb;
  color: var(--navy);
}

.nav-catalog-list {
  display: grid;
  gap: 2px;
  margin-top: 2px;
}

.nav-catalog-list .nav-item {
  width: 100%;
}

.mobile-only-nav-action {
  display: none;
}

.nav-item:hover,
.nav-item.active {
  background: #eef3fb;
  color: var(--navy);
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--navy);
}

.nav-group-label {
  padding: 9px 10px 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.collapse-button {
  margin-top: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: #344054;
  font-weight: 600;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.icon-button.mobile-menu-button {
  display: none;
}

h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

h2,
h3,
p {
  margin-top: 0;
}

.top-actions,
.toolbar,
.toolbar-row,
.inline-actions,
.tab-list,
.panel-heading,
.form-grid {
  display: flex;
  align-items: center;
  gap: 7px;
}

.content {
  padding: 11px 12px 16px;
}

.content:has(.project-main-grid) {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  /* Odejmujemy realną wysokość górnego paska (header.topbar = 80px). Wczesniej bylo 48px,
     przez co obszar wystawal ~32px pod ekran i pager + dolne etapy chowaly sie pod krawedzia. */
  height: calc(100dvh - 80px);
  min-height: 0;
  overflow: hidden;
}

.main-grid {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
  overflow: hidden;
}

.content:has(.project-main-grid) .project-main-grid {
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}

/* Środkowy wiersz (karty) przewija się WEWNĄTRZ stałego obszaru — toolbar i pager zostają
   przyklejone, a rozwinięta na całą wysokość karta (np. wiele etapów/ofert) jest w całości
   dostępna. Bez tego .main-grid { overflow:hidden } przycinał dół karty bez możliwości scrolla. */
.content:has(.project-main-grid) .project-cards,
.content:has(.project-main-grid) .project-table {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

/* Etapy renderowane jeszcze przez oryginalną szeroką tabelę (Plany / Produkcja / Gwarancja)
   NIE moga rozbijac waskiej karty — tabela zwija sie do szerokosci karty z poziomym scrollem.
   (Konsultacje i Design maja juz dedykowany kompaktowy render.) */
.project-tile .tile-stage-table {
  display: block;
  width: 100%;
  max-width: 100%;
  /* tree-table ma min-width:1380px (uklad tabeli na pelnej szerokosci) — w karcie musimy
     je wyzerowac, inaczej min-width bije max-width i tabela rozpycha karte. */
  min-width: 0 !important;
  overflow-x: auto;
}
.project-tile .tile-stage-table > tbody {
  display: table;
  width: max-content;
  min-width: 100%;
}

.toolbar {
  flex-wrap: wrap;
  align-items: end;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.toolbar .field {
  min-width: 132px;
}

.toolbar .spacer,
.panel-heading .spacer {
  flex: 1;
}

.search {
  position: relative;
  min-width: min(300px, 100%);
  flex: 0 1 340px;
}

.search-field {
  flex: 0 1 340px;
}

.search-field .search {
  flex: none;
  width: 100%;
}

.search .icon {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  color: var(--muted);
}

.search input {
  width: 100%;
  height: 30px;
  padding: 0 10px 0 32px;
}

input,
select,
textarea {
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: var(--input-radius);
  background: var(--surface);
  color: var(--text);
  padding: 7px 9px;
  outline: none;
}

select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  max-width: 100%;
  background-image: var(--select-arrow-icon);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
  padding-right: var(--select-arrow-space);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

select:not([multiple])::-ms-expand {
  display: none;
}

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

.rich-editor {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  overflow: hidden;
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.rich-toolbar button,
.rich-toolbar select,
.rich-image-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #ffffff;
  color: #1d2939;
  padding: 0 7px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

/* Selecty (Tekst/Skala) muszą wyglądać i mierzyć jak przyciski. Bijemy globalne `.modal select !important` z theme-premium wyższą specyficznością (.modal .rich-toolbar select). */
.rich-toolbar select,
.modal .rich-toolbar select {
  box-sizing: border-box !important;
  width: auto;
  min-height: 26px !important;
  height: 26px !important;
  padding: 0 20px 0 8px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 4px !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23475569' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 7px center !important;
  background-size: 9px 6px !important;
}

.rich-toolbar select[data-rich-font-size] {
  min-width: 64px;
}

.rich-toolbar select[data-rich-image-size] {
  min-width: 72px;
}

/* Rich editor w kompozytorze czatu - kompaktowy */
.chat-rich-editor.rich-editor {
  background: #ffffff;
}

.chat-rich-editor .rich-toolbar {
  gap: 2px;
  padding: 3px 5px;
}

.chat-rich-editor .rich-editable {
  min-height: 92px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.4;
}

.chat-rich-editor .rich-editable:empty::before {
  content: "Napisz wiadomość...";
  color: var(--muted);
  pointer-events: none;
}

.chat-text img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* Emotikony wbudowane w pasek edytora tekstu (richTextEditor) */
.rich-emoji-wrap {
  position: relative;
  display: inline-flex;
}

.rich-emoji-toggle {
  font-size: 15px;
  line-height: 1;
}

.rich-emoji-panel {
  position: fixed;
  z-index: 10000;
  display: grid;
  /* auto-fill: liczba kolumn dopasowuje sie do szerokosci panelu — nigdy nie powstaje
     poziomy przewijak; przewijanie wylacznie gora-dol. */
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 2px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(12, 18, 34, 0.26);
}

.rich-emoji-panel[hidden] {
  display: none;
}

.rich-emoji-panel::-webkit-scrollbar {
  width: 8px;
}

.rich-emoji-panel::-webkit-scrollbar-thumb {
  background: rgba(12, 18, 34, 0.2);
  border-radius: 4px;
}

/* Emotikony w panelu: bez ramek, duze. Panel siedzi w .rich-toolbar, wiec reguly
   ".rich-toolbar button" (i modalne warianty o wyzszej specyficznosci) nadawaly im
   ramke 1px, bialy kafelek i font 11px — bijemy je !important jak w moscie selectow. */
.rich-emoji-panel .rich-emoji {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 44px !important;
  height: 44px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 28px !important;
  line-height: 1;
  cursor: pointer;
}

.rich-emoji-panel .rich-emoji:hover {
  background: #eef4ff !important;
}

:root[data-theme="dark"] .rich-emoji-panel {
  border-color: rgba(148, 163, 184, 0.32);
  background: #1c2436;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}

:root[data-theme="dark"] .rich-emoji-panel .rich-emoji:hover {
  background: rgba(148, 163, 184, 0.18) !important;
}

/* === Duży edytor tekstu (globalny przycisk „powiększ" w pasku) === */
.rich-toolbar .rich-expand-wrap {
  display: inline-flex;
  margin-left: auto;
}

.rich-expand-toggle .icon {
  width: 14px;
  height: 14px;
}

.rich-expand-overlay {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(9, 14, 26, 0.55);
  backdrop-filter: blur(4px);
}

/* === Szkicownik (rysunek + zrzut) === */
.icon-pencil { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z'/%3E%3Cpath d='m15 5 4 4'/%3E%3C/svg%3E"); }

.rich-sketch-overlay {
  position: fixed;
  inset: 0;
  z-index: 11500;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(9, 14, 26, 0.6);
  backdrop-filter: blur(4px);
}

.rich-sketch-panel {
  display: flex;
  flex-direction: column;
  width: min(1160px, 96vw);
  max-height: 92vh;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface, #fff);
  box-shadow: 0 24px 60px rgba(9, 14, 26, 0.4);
}

.rich-sketch-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2, #f6f8fb);
}

.rich-sketch-head strong { font-size: 14px; }
.rich-sketch-hint { color: var(--muted); font-size: 11px; }
.rich-sketch-head-actions { margin-left: auto; display: flex; gap: 8px; }

.rich-sketch-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}

.rich-sketch-tools { display: inline-flex; gap: 3px; }
.rich-sketch-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.rich-sketch-tools button svg { width: 17px; height: 17px; display: block; }
.rich-sketch-tools button:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.rich-sketch-tools button.is-active { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent); }

.rich-sketch-colors { display: inline-flex; gap: 4px; }
.rich-sketch-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--c);
  cursor: pointer;
  padding: 0;
}
.rich-sketch-color.is-active { border-color: var(--accent); transform: scale(1.12); }

.rich-sketch-width { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.rich-sketch-width input { width: 90px; }
.rich-sketch-spacer { flex: 1 1 auto; }
.rich-sketch-load { cursor: pointer; }

.rich-sketch-canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 14px;
  background:
    linear-gradient(45deg, #eef2f7 25%, transparent 25%, transparent 75%, #eef2f7 75%) 0 0/18px 18px,
    linear-gradient(45deg, #eef2f7 25%, #f8fafc 25%, #f8fafc 75%, #eef2f7 75%) 9px 9px/18px 18px;
}

.rich-sketch-canvas-wrap canvas {
  max-width: 100%;
  max-height: 74vh;
  height: auto;
  background-color: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(9, 14, 26, 0.14);
  cursor: crosshair;
  touch-action: none;
}

/* Tło płótna = TYLKO podgląd (subtelne); płótno jest przezroczyste, eksport zawsze biały. */
.rich-sketch-canvas-wrap canvas[data-bg="white"] { background-image: none; }
.rich-sketch-canvas-wrap canvas[data-bg="grid"] {
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}
.rich-sketch-canvas-wrap canvas[data-bg="dots"] {
  background-image: radial-gradient(rgba(15, 23, 42, 0.13) 1.3px, transparent 1.6px);
  background-size: 22px 22px;
}

/* Wybór tła — czytelne przyciski z PODPISEM (Kratka/Kropki/Białe) + mały podgląd wzoru. */
.rich-sketch-bg { display: inline-flex; align-items: center; gap: 4px; }
.rich-sketch-bg-label { font-size: 11px; font-weight: 800; color: var(--muted); }
.rich-sketch-toolbar .rich-sketch-bg .rich-sketch-bg-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line) !important;
  border-radius: 7px;
  background: #fff !important;
  color: var(--text) !important;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.rich-sketch-toolbar .rich-sketch-bg .rich-sketch-bg-opt:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent) !important;
}
.rich-sketch-toolbar .rich-sketch-bg .rich-sketch-bg-opt.is-active {
  border-color: var(--accent) !important;
  background: color-mix(in srgb, var(--accent) 12%, #fff) !important;
  color: var(--accent) !important;
}
/* Podgląd wzoru w osobnym <span> (odporny na reguły dla <button>). */
.rich-sketch-bg-swatch {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  background-color: #fff;
  background-repeat: repeat;
}
.rich-sketch-bg-swatch.is-grid {
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.5) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.5) 1px, transparent 1px);
  background-size: 5px 5px;
}
.rich-sketch-bg-swatch.is-dots {
  background-image: radial-gradient(rgba(15, 23, 42, 0.62) 1px, transparent 1.5px);
  background-size: 5px 5px;
}
.rich-sketch-bg-swatch.is-white { background-image: none; }

/* Przełącznik snap-do-siatki */
/* Przełącznik Siatki: WYŁĄCZONY = biały z ramką (jak Kratka/Kropki/Białe obok), WŁĄCZONY = niebieski. */
.rich-sketch-toolbar .rich-sketch-snap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line) !important;
  border-radius: 7px;
  background: #fff !important;
  color: var(--text) !important;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.rich-sketch-toolbar .rich-sketch-snap:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent) !important;
}
.rich-sketch-toolbar .rich-sketch-snap.is-active {
  border-color: var(--accent) !important;
  background: color-mix(in srgb, var(--accent) 12%, #fff) !important;
  color: var(--accent) !important;
}
.rich-sketch-snap-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background-color: #fff;
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.45) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.45) 1px, transparent 1px);
  background-size: 5px 5px;
}
.rich-sketch-toolbar .rich-sketch-snap.is-active .rich-sketch-snap-dot { border-color: var(--accent); }

/* Przycisk „Edytuj rysunek" pod własną wiadomością z obrazem */
.chat-edit-drawing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.chat-edit-drawing:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.chat-edit-drawing .icon { width: 12px; height: 12px; }

:root[data-theme="dark"] .rich-sketch-canvas-wrap {
  background:
    linear-gradient(45deg, #1b2230 25%, transparent 25%, transparent 75%, #1b2230 75%) 0 0/18px 18px,
    linear-gradient(45deg, #1b2230 25%, #131922 25%, #131922 75%, #1b2230 75%) 9px 9px/18px 18px;
}

/* Wbudowany popup potwierdzenia/prompt (zamiast natywnego window.confirm). Nad wszystkim (też nad rich-expand 11000). */
.app-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(9, 14, 26, 0.5);
  backdrop-filter: blur(3px);
}

.app-confirm {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface, #ffffff);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.app-confirm-body {
  display: grid;
  gap: 8px;
  padding: 18px 20px 6px;
}

.app-confirm-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.app-confirm-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.app-confirm-input {
  width: 100%;
  min-height: 36px;
  margin-top: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface, #ffffff);
  padding: 0 10px;
  color: var(--text);
  font-size: 13px;
}

.app-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px 18px;
}

.app-confirm-actions .button,
.app-confirm-actions .primary-button,
.app-confirm-actions .danger-button {
  min-height: 34px;
  padding: 0 16px;
}

/* Przycisk anulowania ustawiony jako primary = ZAWSZE niebieski (bije auto-ton data-btn-tone). */
.app-confirm-actions .primary-button[data-confirm-cancel] {
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent) !important;
  background: color-mix(in srgb, var(--accent) 14%, transparent) !important;
  color: var(--accent) !important;
}
.app-confirm-actions .primary-button[data-confirm-cancel]:hover {
  border-color: var(--accent) !important;
  background: color-mix(in srgb, var(--accent) 24%, transparent) !important;
}

:root[data-theme="dark"] .app-confirm {
  border-color: rgba(148, 163, 184, 0.32);
  background: #161d2d;
}

.rich-expand-panel {
  display: flex;
  flex-direction: column;
  width: min(980px, 100%);
  height: min(86vh, 900px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface, #ffffff);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.rich-expand-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.rich-expand-head strong {
  font-size: 14px;
  font-weight: 800;
}

.rich-expand-panel .rich-editor.rich-expand-editor {
  flex: 1 1 auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
}

.rich-expand-editor .rich-toolbar {
  gap: 4px;
  padding: 8px 12px;
}

.rich-expand-editor .rich-editable {
  min-height: 0 !important;
  max-height: none !important;
  height: auto;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.55;
}

:root[data-theme="dark"] .rich-expand-panel {
  border-color: rgba(148, 163, 184, 0.32);
  background: #161d2d;
}

.icon-expand { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cpolyline points='9 21 3 21 3 15'/%3E%3Cline x1='21' x2='14' y1='3' y2='10'/%3E%3Cline x1='3' x2='10' y1='21' y2='14'/%3E%3C/svg%3E"); }

.chat-text > :first-child {
  margin-top: 0;
}

.chat-text > :last-child {
  margin-bottom: 0;
}

.rich-toolbar select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.rich-image-button {
  position: relative;
  gap: 5px;
  font-weight: 500;
  cursor: pointer;
}

/* „Obraz" to <label> — ogólne reguły etykiet w modalach (display:block) psuły ikonę (gap 0, baseline zamiast środka). Flex wymuszony globalnie. */
label.rich-image-button,
.rich-toolbar .rich-image-button {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.rich-image-button .icon {
  width: 14px;
  height: 14px;
  min-width: 14px;
  flex: 0 0 14px;
}

.rich-image-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.rich-editable {
  min-height: 112px;
  max-height: 240px;
  padding: 8px 9px;
  outline: none;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  color: var(--text);
  white-space: normal;
}

.rich-editable:focus {
  box-shadow: inset 0 0 0 2px rgba(23, 59, 133, 0.12);
}

.rich-editable img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.rich-editable img.rich-image-selected {
  outline: 2px solid var(--navy-2);
  outline-offset: 2px;
}

.bom-comment-editor .rich-editable {
  min-height: 220px;
  max-height: 42vh;
}

.rich-image-resizer {
  position: absolute;
  z-index: 20;
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-radius: 4px;
  background: var(--navy-2);
  box-shadow: 0 2px 7px rgba(16, 24, 40, 0.24);
  cursor: nwse-resize;
}

.rich-image-resizer[hidden] {
  display: none;
}

.rich-editable ul,
.rich-editable ol {
  margin: 6px 0 6px 20px;
  padding: 0;
}

.rich-preview {
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  white-space: normal;
}

.rich-preview img {
  max-width: 160px;
  max-height: 90px;
  border: 1px solid var(--line);
  border-radius: 5px;
  object-fit: contain;
}

.rich-preview ul,
.rich-preview ol {
  margin: 4px 0 4px 18px;
  padding: 0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--navy-2);
  box-shadow: 0 0 0 3px rgba(23, 59, 133, 0.12);
}

.currency-field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.currency-field.has-currency-select {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.currency-field input {
  width: 100%;
  min-width: 0;
  padding-right: 48px;
  text-align: right;
  font-weight: 800;
}

.currency-field.has-currency-select input {
  padding-right: 9px;
}

.currency-field.has-currency-select select,
select[data-currency-select],
select[data-crew-travel-manual-currency],
select[data-rate-currency],
.price-input-group select,
select[name="currency"],
select[name$="Currency"] {
  width: 86px;
  min-width: 86px;
  max-width: 86px;
  padding-left: 9px;
  padding-right: 30px !important;
  text-align: left;
  font-weight: 850;
  text-overflow: clip;
}

.currency-field span {
  position: absolute;
  right: 10px;
  padding-left: 3px;
  background: var(--surface);
  color: #1d2939;
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.currency-field.is-readonly input,
.currency-field input[readonly] {
  background: var(--surface-muted);
  color: var(--muted);
  cursor: not-allowed;
}

.price-input-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.price-input-group input {
  width: 100%;
  min-width: 0;
  padding-right: 9px;
  text-align: right;
  font-weight: 800;
}

.price-input-group select {
  width: 86px;
  min-width: 86px;
  max-width: 86px;
  padding-left: 7px;
  padding-right: 30px !important;
  font-weight: 800;
  text-overflow: clip;
}

.field {
  display: grid;
  gap: 3px;
}

.field label {
  color: #344054;
  font-size: var(--label-size);
  font-weight: 800;
}

.field small {
  color: var(--muted);
}

.button,
.primary-button,
.ghost-button,
.icon-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: var(--control-h);
  border-radius: var(--button-radius);
  border: 1px solid var(--line-strong);
  padding: 0 9px;
  background: var(--surface);
  color: #1d2939;
  font-weight: 700;
  text-decoration: none;
}

.primary-button {
  border-color: var(--navy);
  background: var(--navy);
  color: white;
}

.ghost-button {
  border-color: transparent;
  background: transparent;
  color: #344054;
}

.theme-toggle {
  min-width: 70px;
  border-color: var(--line);
  background: var(--surface-muted);
}

.theme-toggle.active {
  border-color: var(--line-strong);
  background: #0d1117;
  color: #f0f6fc;
}

.danger-button {
  border-color: #f4b7b2;
  background: #fff5f4;
  color: var(--danger);
}

.button.danger {
  border-color: #f4b7b2;
  background: #fff5f4;
  color: var(--danger);
}

.button:hover,
.ghost-button:hover,
.icon-button:hover {
  background: #f3f6fb;
}

.primary-button:hover {
  background: #0c2254;
}

.sold-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: var(--control-h);
  border: 1px solid #057a36;
  border-radius: var(--button-radius);
  padding: 0 9px;
  background: #059b43;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(5, 122, 54, 0.22);
}

.sold-button:hover {
  background: #047f38;
}

.sold-button.is-sold {
  border-color: #16a34a;
  background: #e8f7ee;
  color: #057a36;
  box-shadow: none;
}

.icon-button {
  width: var(--icon-button-size);
  padding: 0;
}

.square-button {
  width: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
}

.icon-button.danger {
  border-color: #f4b7b2;
  background: #fff5f4;
  color: var(--danger);
}

/* =========================================================================
   LEKKIE, TINTOWANE PRZYCISKI (globalnie): ramka + półprzezroczyste tło + kolorowy tekst.
   Zamiast ciężkich, solidnych wypełnień. !important bije theme-premium (solidne primary, cienie).
   Wariant = znaczenie: primary=niebieski, danger/zamknięcie=czerwony, neutral=subtelny.
   ========================================================================= */
.primary-button,
.button-primary,
button.primary {
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent) !important;
  background: color-mix(in srgb, var(--accent) 14%, transparent) !important;
  color: var(--accent) !important;
  box-shadow: none !important;
}

.primary-button:hover,
.button-primary:hover,
button.primary:hover {
  border-color: var(--accent) !important;
  background: color-mix(in srgb, var(--accent) 24%, transparent) !important;
}

.danger-button,
.button.danger,
.icon-button.danger {
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent) !important;
  background: color-mix(in srgb, var(--danger) 12%, transparent) !important;
  color: var(--danger) !important;
  box-shadow: none !important;
}

.danger-button:hover,
.button.danger:hover,
.icon-button.danger:hover {
  border-color: var(--danger) !important;
  background: color-mix(in srgb, var(--danger) 22%, transparent) !important;
}

/* Przycisk zamknięcia = czerwony tint — TYLKO ikonowy X (nie tekstowy „Anuluj", który też jest close-modal). GLOBALNIE. */
.icon-button[data-action="close-modal"] {
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent) !important;
  background: color-mix(in srgb, var(--danger) 12%, transparent) !important;
  color: var(--danger) !important;
  box-shadow: none !important;
}

.icon-button[data-action="close-modal"]:hover {
  border-color: var(--danger) !important;
  background: color-mix(in srgb, var(--danger) 22%, transparent) !important;
}

/* Neutralne przyciski: ramka + ledwie widoczne tło, bez cienia (lekko, nie topornie).
   Wykluczamy danger i zamknięcie, żeby nie zbić ich czerwonego tintu. */
.button:not(.danger),
.icon-button:not(.danger):not([data-action="close-modal"]) {
  background: color-mix(in srgb, var(--text) 4%, transparent) !important;
  box-shadow: none !important;
}

.button:not(.danger):hover,
.icon-button:not(.danger):not([data-action="close-modal"]):hover {
  background: color-mix(in srgb, var(--text) 9%, transparent) !important;
}

.mini {
  min-height: var(--control-h-sm);
  padding: 0 7px;
  font-size: 9px;
}

.user-chip select {
  min-height: 32px;
  max-width: 190px;
  border-color: transparent;
  background: transparent;
  padding: 4px 2px;
  font-weight: 800;
}

.user-chip,
.avatar,
.status-pill,
.metric,
.badge {
  display: inline-flex;
  align-items: center;
}

.user-chip {
  position: relative;
  gap: 8px;
  min-width: 0;
  max-width: min(260px, 100%);
  overflow: visible;
  color: #1d2939;
  font-weight: 700;
}

/* Ładne menu użytkownika (dropdown spod profilu) */
.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  min-width: 234px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface, #ffffff);
  box-shadow: 0 18px 44px rgba(12, 18, 34, 0.22);
}

.user-menu[hidden] {
  display: none;
}

.user-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 10px;
}

.user-menu-head .user-chip-avatar {
  --avatar-size: 40px;
}

.user-menu-id {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.user-menu-id strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Wyższa specyficzność, by zbić globalne `.user-chip span` (styl awatara 30px) na podtytule. */
.user-chip .user-menu-id span {
  width: auto;
  min-width: 0;
  max-width: 100%;
  height: auto;
  flex: initial;
  aspect-ratio: auto;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-sep {
  height: 1px;
  margin: 2px 6px 4px;
  background: var(--line);
}

.user-menu button[role="menuitem"] {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.user-menu button[role="menuitem"] .icon {
  width: 16px;
  height: 16px;
  min-width: 16px;
  max-width: 16px;
  flex: 0 0 16px;
  aspect-ratio: auto;
  border-radius: 0;
  background-color: currentColor;
  color: var(--muted);
}

.user-menu button[role="menuitem"]:hover {
  background: #eef4ff;
}

.user-menu button.is-danger {
  color: #dc2626;
}

.user-menu button.is-danger .icon {
  color: #dc2626;
}

.user-menu button.is-danger:hover {
  background: #fef2f2;
}

:root[data-theme="dark"] .user-menu {
  border-color: rgba(148, 163, 184, 0.32);
  background: #1c2436;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}

:root[data-theme="dark"] .user-menu button[role="menuitem"]:hover {
  background: rgba(148, 163, 184, 0.18);
}

:root[data-theme="dark"] .user-menu button.is-danger:hover {
  background: rgba(220, 38, 38, 0.2);
}

.user-chip-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0 8px 0 2px;
  font: inherit;
}

.user-chip-trigger strong {
  min-width: 0;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip span,
.avatar {
  --avatar-size: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--avatar-size);
  height: var(--avatar-size);
  min-width: var(--avatar-size);
  max-width: var(--avatar-size);
  flex: 0 0 var(--avatar-size);
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  border-radius: 999px;
  background: #1f2a44;
  color: white;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.user-chip .user-chip-avatar {
  --avatar-size: 44px;
  display: inline-grid;
  place-items: center;
  width: var(--avatar-size);
  height: var(--avatar-size);
  min-width: var(--avatar-size);
  max-width: var(--avatar-size);
  flex: 0 0 var(--avatar-size);
  overflow: hidden;
  border-radius: 999px;
}

.user-chip .user-chip-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
}

.table-wrap {
  overflow: auto;
}

.tree-wrap {
  max-height: calc(100vh - 240px);
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.content:has(.project-main-grid) .tree-wrap {
  height: 100%;
  max-height: none;
  min-height: 0;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: var(--table-cell-y) var(--table-cell-x);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--surface-muted);
  color: #344054;
  font-size: var(--table-head-size);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: #f8fbff;
}

tbody tr.selected {
  background: #f3f7ff;
  box-shadow: inset 3px 0 0 var(--navy-2);
}

.tree-table tbody tr:hover {
  background: var(--tree-hover-bg);
}

.tree-table th,
.tree-table td {
  padding: var(--table-cell-y) var(--table-cell-x);
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

.tree-table {
  table-layout: fixed;
  min-width: 1380px;
}

.tree-table thead th {
  height: 24px;
  padding: var(--table-cell-y) var(--table-cell-x);
  color: #1f2a44;
  font-size: var(--table-head-size);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.tree-table thead th:nth-child(5),
.tree-table thead th:nth-child(6),
.tree-table thead th:nth-child(7),
.tree-table thead th:nth-child(8) {
  text-align: center;
}

.tree-wrap .tree-table {
  width: 100%;
}

.tree-table .inline-actions {
  flex-wrap: wrap;
  gap: 4px;
}

.tree-table .button.mini,
.tree-table .primary-button.mini,
.tree-table .sold-button.mini {
  padding: 3px 6px;
  min-height: 22px;
  font-size: 10px;
  white-space: nowrap;
  overflow-wrap: normal;
}

.tree-table .button.has-unread {
  border-color: #f59e0b;
  background: #fffbeb;
}

.tree-table td:last-child {
  padding-left: 6px;
  padding-right: 8px;
}

.tree-table td:last-child .inline-actions {
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
  margin-left: 0;
}

.tree-table .delete-project-button,
.tree-table .delete-stage-button,
.tree-table .delete-design-button,
.tree-table .delete-offer-button,
.tree-table .delete-construction-button {
  margin-left: 0;
}

.tree-table .row-actions {
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: stretch;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin-left: 0;
}

.tree-table .row-actions .row-action-left {
  display: inline-flex;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.tree-table .row-actions .row-action-right {
  display: inline-flex;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.row-action-spacer {
  flex: 1 1 auto;
}

.row-action-left,
.row-action-right {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.row-action-left {
  justify-content: flex-start;
}

.row-action-right {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tree-table .row-actions .button.mini,
.tree-table .row-actions .primary-button.mini,
.tree-table .row-actions .sold-button.mini {
  flex: 0 0 auto;
}

.stage-summary-grid {
  display: inline-grid;
  grid-template-columns: 10ch minmax(3ch, auto);
  gap: 2px 7px;
  align-items: baseline;
  max-width: 100%;
  color: #344054;
  font-size: 11px;
  line-height: 1.25;
}

.stage-summary-grid span {
  color: #667085;
  text-align: right;
  font-weight: 700;
}

.stage-summary-grid strong {
  min-width: 3ch;
  color: #1d2939;
  font-weight: 700;
}

.tree-table td:nth-child(5),
.tree-table td:nth-child(6),
.tree-table td:nth-child(7),
.tree-table td:nth-child(8) {
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: normal;
  text-align: center;
}

.tree-table .price-cell {
  text-align: center;
  white-space: nowrap;
}

.tree-table .price-cell .money,
.tree-table .price-cell .resource-total {
  display: inline-block;
  min-width: 7ch;
  text-align: right;
}

.tree-table .price-cell .resource-total-stack {
  display: inline-grid;
  justify-items: end;
}

.tree-table .material-price-cell,
.tree-table .transport-price-cell,
.tree-table .assembly-price-cell,
.tree-table .total-price-cell {
  vertical-align: middle;
}

.tree-table .calculation-cost-cell {
  text-align: center;
}

.tree-table .calculation-cost-cell strong {
  display: inline-block;
  min-width: 7ch;
  text-align: right;
}

.tree-table .status-pill {
  max-width: 100%;
  padding: 2px 6px;
  font-size: 10px;
  line-height: 1.1;
  white-space: normal;
}

.tree-table .version-metrics-cell,
.tree-table .plan-status-cell {
  vertical-align: middle;
}

.tree-table .plan-status-cell {
  text-align: left;
}

.plan-status-stack {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 3px;
  min-width: 0;
  line-height: 1.15;
}

.plan-status-date {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-table td:nth-child(5) .money,
.tree-table td:nth-child(8) .money {
  display: inline-block;
  max-width: 100%;
  margin-inline: auto;
  white-space: normal;
}

.tree-table td:nth-child(9) {
  text-align: left;
}

.tree-table td.planning-edit-cell {
  text-align: left;
}

.tree-table td.planning-edit-cell .button {
  margin-left: 0;
}

.tree-table .tree-row > td {
  min-height: 30px;
  font-size: 11px;
  line-height: 1.2;
}

.tree-row.project-row {
  background: var(--tree-project-bg);
}

.tree-row.project-row,
.tree-row.stage-row,
.tree-row.design-version-row,
.tree-row.construction-row:not(.active-version),
.tree-row.consultation-row {
  cursor: pointer;
}

.tree-row.project-row td {
  border-top: var(--tree-project-separator-width) solid var(--tree-project-separator);
  padding-top: 5px;
  padding-bottom: 5px;
}

.tree-row.stage-row {
  background: var(--tree-stage-bg);
}

.tree-row.stage-row td {
  font-weight: 800;
  padding-top: 5px;
  padding-bottom: 5px;
}

.stage-summary-td {
  text-align: center;
}

.tree-row.stage-row .stage-summary-cell {
  display: inline-grid;
  grid-template-columns: 12ch 3ch;
  align-items: center;
  justify-content: center;
  width: 16ch;
  min-width: 16ch;
  gap: 2px 4px;
  color: #1d2939;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.15;
  text-align: left;
}

.tree-row.stage-row .stage-summary-cell span {
  display: block;
  font-weight: 500;
  white-space: nowrap;
}

.tree-row.stage-row .stage-summary-label {
  justify-self: end;
}

.tree-row.stage-row .stage-summary-value {
  justify-self: start;
  min-width: 3ch;
  text-align: left;
}

.project-number-cell .tree-cell-main,
.stage-title-cell .tree-cell-main {
  align-items: center;
}

.tree-row.design-version-row {
  background: var(--tree-level-2-bg);
  box-shadow: inset 3px 0 0 var(--tone-design);
}

.tree-row.design-version-row td {
  border-top: 1px solid #cfe0f5;
}

.tree-row.construction-row {
  background: var(--tree-level-3-bg);
  box-shadow: inset 3px 0 0 #d4e3f5;
}

.tree-row.version-row {
  background: var(--tree-level-4-bg);
  box-shadow: inset 3px 0 0 #e3ebf5;
}

.tree-row.planning-version-row {
  background: var(--tree-level-2-bg);
  box-shadow: inset 3px 0 0 #2563eb;
}

.tree-row.sold-construction-row {
  background: var(--tree-sold-bg);
  box-shadow: inset 3px 0 0 #059b43;
}

.tree-row.planning-tabs-row {
  background: var(--tree-level-4-bg);
}

.planning-tabs-cell {
  align-items: stretch;
}

.planning-context-tabs {
  flex: 1;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  padding: 4px 10px 0;
}

.planning-context-tabs .context-tab {
  flex: 0 0 auto;
  min-height: 28px;
  max-width: 150px;
  padding: 0 8px;
  font-size: 10px;
}

.planning-context-tabs .context-tab:first-child {
  max-width: 210px;
}

.modal.planning-modal {
  width: min(1440px, calc(100vw - 24px));
}

.modal.planning-modal.full-height {
  height: calc(100vh - 24px);
  max-height: calc(100vh - 24px);
}

.modal.planning-modal header,
.modal.planning-modal footer {
  padding: 10px 14px;
}

.modal.planning-modal header {
  min-height: 56px;
}

.modal.planning-modal footer {
  min-height: 52px;
}

.modal.planning-modal .icon-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 7px;
}

.modal.planning-modal .icon {
  width: 16px;
  height: 16px;
}

.planning-form {
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding: 8px 12px 10px;
}

.planning-panel {
  align-content: start;
  gap: 8px;
  padding: 8px;
}

.planning-panel[hidden] {
  display: none;
}

.plan-engineer-picker {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
  min-height: 74px;
  max-height: 96px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
}

.plan-engineer-option {
  grid-template-columns: 14px 20px minmax(82px, 1fr);
  width: min(174px, 100%);
  min-height: 28px;
  border-color: transparent;
  padding: 3px 5px;
}

.compact-planning-head {
  margin-bottom: -2px;
}

.planning-project-grid {
  grid-template-columns: minmax(150px, 0.55fr) minmax(136px, 0.42fr) minmax(136px, 0.42fr) minmax(430px, 1.35fr);
  gap: 6px;
  align-items: end;
}

.planning-engineers-field {
  min-width: 0;
}

.modal.planning-modal .planning-engineers-field label {
  margin-bottom: 1px;
}

.planning-construction-matrix {
  display: grid;
  gap: 2px;
  max-height: 260px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.planning-construction-head,
.planning-construction-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.15fr) minmax(210px, 1fr) minmax(160px, 0.68fr) minmax(118px, 0.42fr) minmax(118px, 0.42fr) minmax(150px, 0.72fr);
  gap: 6px;
  align-items: center;
}

.planning-construction-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 24px;
  background: #ffffff;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.planning-construction-row {
  min-height: 36px;
  padding: 3px 0;
  border-top: 1px solid var(--line);
}

.planning-construction-row select,
.planning-construction-row input {
  min-height: 28px;
  padding: 4px 8px;
}

.planning-construction-name {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.planning-construction-name strong,
.planning-construction-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-construction-name small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.planning-construction-row .planning-construction-meta {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #475467;
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.technical-bom-compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.technical-bom-compact span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-button.mini-upload {
  min-height: 26px;
  padding: 0 8px;
  font-size: 10px;
}

.compact-empty {
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
}

.planning-bom-list {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.planning-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
}

.planning-section-title h3 {
  margin: 0;
  color: #1d2939;
  font-size: 12px;
}

.planning-section-title span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.planning-timeline-preview .timeline-label,
.planning-timeline-preview .timeline-canvas {
  min-height: inherit;
}

.planning-timeline-preview {
  display: grid;
  gap: 5px;
}

.planning-timeline-preview .timeline-preview-meta,
.planning-timeline-preview .timeline-preview-legend {
  margin: 0;
}

.planning-timeline-preview .planning-preview-task.design-preview-selected {
  pointer-events: auto;
  cursor: grab;
}

.planning-construction-panel {
  display: grid;
  grid-template-columns: minmax(150px, 0.34fr) minmax(0, 1.2fr) minmax(250px, 0.44fr);
  gap: 6px;
  align-items: center;
  min-height: 58px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdff;
}

.planning-construction-list {
  display: grid;
  gap: 7px;
}

.plan-item-head {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.plan-item-head strong,
.plan-item-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-item-head strong {
  font-size: 12px;
  font-weight: 900;
}

.plan-item-head span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.planning-construction-title {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
}

.planning-construction-title h3 {
  margin: 0;
  overflow: hidden;
  color: #1d2939;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-construction-title span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-construction-meta {
  display: grid;
  grid-template-columns: 1.1fr 0.7fr 0.55fr 1fr 0.8fr;
  gap: 4px;
  min-width: 0;
}

.planning-meta-chip {
  display: grid;
  align-content: center;
  gap: 1px;
  min-width: 0;
  min-height: 34px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  overflow: hidden;
  color: #1d2939;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-meta-chip b {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.plan-item-assignment {
  margin-top: 10px;
}

.technical-bom-panel {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-content: start;
  gap: 6px;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 6px;
}

.technical-bom-title {
  display: grid;
  align-content: center;
  min-width: 0;
  color: #1d2939;
  line-height: 1.05;
}

.technical-bom-title strong {
  font-size: 11px;
  font-weight: 900;
}

.technical-bom-title span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-construction-panel .technical-bom-panel .upload-strip {
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
}

.planning-construction-panel .technical-bom-panel .upload-button,
.planning-construction-panel .technical-bom-status {
  min-height: 28px;
}

.planning-construction-panel .technical-bom-panel .upload-button {
  padding: 0 9px;
  white-space: nowrap;
}

.planning-notes-details {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.planning-notes-details summary {
  padding: 8px 10px;
  color: #344054;
  font-weight: 900;
  cursor: pointer;
}

.planning-notes-details .field {
  padding: 0 10px 10px;
}

.planning-notes-area {
  min-height: 150px;
}

.technical-bom-status {
  display: flex;
  align-items: center;
  min-height: 28px;
  min-width: 0;
  overflow: hidden;
  color: #475467;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.tree-row.consultation-row,
.tree-row.production-plan-row,
.tree-row.stage-task-row {
  background: var(--tree-level-2-bg);
}

.tree-row.design-plan-row,
.tree-row.design-task-row,
.tree-row.production-plan-segment-row {
  background: var(--tree-level-3-bg);
}

.tree-row.construction-meta-row,
.tree-row.empty-tree-row {
  background: var(--tree-level-4-bg);
}

.tree-row.active-version {
  box-shadow: inset 3px 0 0 var(--green);
}

.empty-tree-row td {
  color: var(--muted);
  font-style: italic;
}

.tree-toggle {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  margin-right: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--navy);
  font-weight: 900;
}

.tree-table .tree-toggle {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  font-size: 12px;
  line-height: 1;
}

.tree-toggle-placeholder {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.tree-indent {
  display: inline-block;
  width: 18px;
  flex: 0 0 18px;
}

.tree-table .tree-indent {
  width: 14px;
  flex: 0 0 14px;
}

.tree-cell-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tree-table .tree-cell-main {
  gap: 5px;
}

.tree-table .tree-cell-main > div,
.tree-table .tree-node-title {
  min-width: 0;
}

.tree-cell-main .stage-dot {
  margin-right: 0;
}

.row-user-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  color: #1d2939;
}

.row-user-inline .small-avatar {
  --avatar-size: 26px;
  font-size: 10px;
}

.row-user-inline strong {
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-user-label,
.row-meta-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.design-meta-cell,
.design-date-cell,
.stage-owner-cell {
  min-width: 0;
}

.tree-table .design-designer-cell {
  min-width: 0;
  vertical-align: middle;
  white-space: nowrap;
}

.tree-table .design-designer-cell .row-user-label {
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
  font-size: 10px;
  text-transform: none;
}

.tree-table .design-designer-cell .row-user-inline {
  vertical-align: middle;
}

.stage-owner-cell .row-user-inline,
.design-designer-cell .row-user-inline {
  max-width: 100%;
}

.stage-owner-cell .row-user-inline strong,
.design-designer-cell .row-user-inline strong {
  max-width: 24ch;
}

.design-date-cell {
  line-height: 1.35;
}

.design-date-cell strong {
  display: block;
  margin-top: 2px;
  color: #1d2939;
}

.attachment-inline-cell {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.attachment-inline-list {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  max-width: 100%;
}

.attachment-inline-list a {
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
}

.attachment-count {
  color: #344054;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.calculation-cost-cell {
  color: #344054;
  line-height: 1.35;
}

.calculation-cost-cell span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.calculation-cost-cell strong {
  color: #1d2939;
}

.resource-cell {
  text-align: right;
}

.tree-table .resource-cell {
  overflow: visible;
  text-align: center;
}

.resource-cell .resource-stack {
  margin-left: auto;
}

.download-cell {
  vertical-align: middle;
  text-align: center;
  overflow: visible;
}

.download-cell .resource-strip {
  justify-content: center;
}

.tree-node-title,
.version-branch {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.tree-table .tree-node-title,
.tree-table .version-branch {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-branch {
  color: #344054;
  font-weight: 650;
}

.version-meta-line {
  margin-bottom: 6px;
  color: #344054;
}

.tree-table .version-meta-line {
  margin-bottom: 0;
  font-size: 11px;
  line-height: 1.2;
}

.construction-name-stack {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.tree-indent-cell,
.construction-name-cell,
.consultation-offer-cell,
.consultation-name-cell {
  vertical-align: middle;
}

.tree-indent-cell {
  color: var(--muted);
  white-space: nowrap;
}

.consultation-offer-cell .tree-cell-main {
  align-items: center;
}

.consultation-offer-cell.continuation {
  color: var(--muted);
}

.construction-dimensions-line {
  display: block;
  color: #344054;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  white-space: normal;
}

.version-metrics {
  display: grid;
  gap: 2px;
  color: #344054;
  font-size: 11px;
  line-height: 1.2;
}

.version-metrics span {
  display: block;
  white-space: normal;
}

.production-row-status {
  margin-top: 4px;
}

.project-person-meta {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.project-person-lines {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.tree-table .project-person-meta {
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 3px;
  min-height: 22px;
  line-height: 1;
  overflow: visible;
}

.project-person-meta > span:first-child {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.tree-table .project-person-meta > span:first-child {
  font-size: 9px;
}

.project-person-meta .inline-actions {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-table .project-person-meta .inline-actions {
  gap: 3px;
}

.production-segments {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 6px;
}

.production-segments span {
  display: grid;
  gap: 2px;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.production-segments strong {
  color: #1d2939;
  font-size: 11px;
  text-transform: uppercase;
}

.premium-tree-row {
  background: var(--tree-level-2-bg);
  box-shadow: inset 3px 0 0 #8aa4c8;
}

.row-detail-title {
  display: block;
  color: #1d2939;
  font-weight: 750;
}

.clipped-line {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pdf-thumb {
  display: inline-grid;
  gap: 6px;
  width: 252px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #344054;
  text-decoration: none;
  vertical-align: top;
}

.pdf-thumb-main {
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 202px;
  padding: 10px 8px 6px;
  color: #344054;
  text-align: center;
  text-decoration: none;
}

.pdf-thumb-main.has-image {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  min-height: 202px;
}

.pdf-thumb-main.has-document {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 202px;
  padding: 0;
  overflow: hidden;
}

.pdf-preview-frame {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.pdf-preview-canvas {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  background: #ffffff;
}

.pdf-preview-canvas:not(.is-rendered) {
  opacity: 0;
}

.pdf-preview-frame.thumb-failed .pdf-preview-canvas {
  display: none;
}

.pdf-thumb-object {
  width: 100%;
  height: 202px;
  border: 0;
  background: #ffffff;
  pointer-events: none;
}

.pdf-thumb-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #ffffff;
}

.pdf-thumb-main.has-image .pdf-thumb-object {
  display: none;
}

.pdf-thumb-main.has-image.thumb-failed .pdf-thumb-object {
  display: block;
}

.pdf-thumb-main.has-image.thumb-failed .pdf-thumb-icon {
  display: none;
}

.pdf-thumb-main.has-image .pdf-thumb-icon {
  display: none;
}

.pdf-thumb-main.has-document .pdf-thumb-icon {
  display: none;
}

.pdf-thumb-main.has-image .pdf-thumb-label {
  width: 100%;
  padding: 0 6px;
}

.pdf-thumb-main.has-document .pdf-thumb-label {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 5px 6px;
  background: rgba(255, 255, 255, 0.92);
}

.pdf-thumb-main.has-image .pdf-thumb-label {
  padding-bottom: 8px;
}

.pdf-thumb-main.thumb-failed .pdf-thumb-image {
  display: none;
}

.pdf-thumb-main.thumb-failed .pdf-thumb-icon {
  display: grid;
}

.pdf-thumb-icon {
  display: grid;
  place-items: center;
  width: 70px;
  height: 84px;
  border: 1px solid #c8d3e2;
  border-radius: 5px;
  background: white;
  color: var(--navy);
}

.pdf-thumb-icon .icon {
  width: 42px;
  height: 42px;
}

.pdf-thumb-label {
  max-width: 100%;
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-thumb-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.pdf-thumb-actions a,
.pdf-thumb-actions button {
  display: grid;
  place-items: center;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--navy-2);
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.pdf-thumb-actions a + a,
.pdf-thumb-actions button {
  border-left: 1px solid var(--line);
}

.pdf-thumb.empty {
  display: inline-grid;
  place-items: center;
  width: 252px;
  min-height: 101px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.resource-stack {
  display: grid;
  gap: 3px;
  min-width: 0;
  width: 164px;
  max-width: 100%;
  justify-items: stretch;
}

.design-resource-cell {
  padding-left: 14px;
  padding-right: 14px;
  text-align: left;
}

.design-resource-cell .resource-stack {
  margin-left: 0;
}

.resource-stack-inline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
}

.resource-stack-inline .resource-line {
  flex: 0 0 auto;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  padding: 2px 5px;
}

.resource-stack-inline .resource-line + .resource-line {
  margin-left: 0;
}

.resource-strip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  white-space: nowrap;
}

.resource-menu {
  position: relative;
  flex: 0 0 auto;
}

.resource-menu[open] {
  z-index: 30;
}

.resource-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 22px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #667085;
  padding: 0 2px;
  font: inherit;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.resource-trigger::-webkit-details-marker {
  display: none;
}

.resource-trigger:hover,
.resource-menu[open] .resource-trigger {
  background: #eef4ff;
  color: var(--navy);
}

.resource-trigger.missing {
  color: var(--muted);
}

.resource-trigger.missing:hover {
  color: var(--danger);
  background: #fff7f6;
}

.resource-menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 35;
  display: grid;
  min-width: 76px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.14);
}

.resource-menu-action {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 26px;
  border: 0;
  background: #ffffff;
  color: var(--navy);
  padding: 0 9px;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.resource-menu-action + .resource-menu-action {
  border-top: 1px solid var(--line);
}

.resource-menu-action:hover {
  background: #eef4ff;
}

.project-stage-menu {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.project-stage-menu[open] {
  z-index: 50;
}

.project-stage-trigger {
  list-style: none;
  cursor: pointer;
}

.project-stage-trigger::-webkit-details-marker {
  display: none;
}

.project-stage-trigger .icon {
  width: 13px;
  height: 13px;
}

/* Wszystkie akcje wiersza identyczny kwadrat 30×30 (base min-height:32 psuł wysokość doc/koszty). */
.prow-actions .icon-button {
  height: 30px;
  min-height: 30px;
}

/* Spójny zestaw akcji w wierszu projektu: „+" (Dodaj etap) jako akcent-outline jak pozostałe ikon-przyciski (nie pełny niebieski przycisk). Bije theme-premium `.primary-button` wyższą specyficznością. */
.prow-actions .project-stage-trigger {
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.prow-actions .project-stage-trigger:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
}

.prow-actions .project-stage-trigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.project-stage-menu-panel {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 55;
  display: grid;
  min-width: 205px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.16);
}

.project-stage-menu[open] .project-stage-menu-panel {
  position: fixed;
  top: var(--project-stage-menu-top, 0px);
  right: auto;
  left: var(--project-stage-menu-left, 0px);
  width: var(--project-stage-menu-width, auto);
  z-index: 1200;
}

.project-stage-menu-action {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 30px;
  border: 0;
  background: #ffffff;
  color: #1d2939;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.project-stage-menu-action + .project-stage-menu-action {
  border-top: 1px solid var(--line);
}

.project-stage-menu-action:hover {
  background: #eef4ff;
  color: var(--navy);
}

.resource-item-row {
  display: grid;
  grid-template-columns: 24px 44px 44px;
  align-items: center;
  gap: 2px;
  min-width: 0;
  white-space: nowrap;
}

.resource-tag {
  flex: 0 0 auto;
  color: #667085;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.resource-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 21px;
  border: 1px solid #d7e0ed;
  border-radius: 4px;
  background: #ffffff;
  color: var(--navy);
  padding: 0 4px;
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  flex: 0 1 auto;
  max-width: 44px;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.resource-missing {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.resource-action:hover {
  background: #eef4ff;
}

.resource-action.is-muted {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.resource-line {
  display: grid;
  grid-template-columns: 26px 54px 54px;
  align-items: center;
  gap: 3px;
  min-width: 0;
  color: #344054;
  font-size: 11px;
  font-weight: 700;
}

.resource-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.resource-line > span:not(.resource-label):not(.resource-muted) {
  grid-column: 2 / -1;
}

.resource-line .resource-muted {
  grid-column: 2 / -1;
}

.resource-line a,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  min-width: 0;
  min-height: 22px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--navy);
  padding: 0 4px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.resource-line a:hover,
.link-button:hover {
  background: #eef4ff;
}

.link-button {
  cursor: pointer;
}

.resource-muted {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.resource-total-stack {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 0;
}

.tree-table .resource-total-stack {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(62px, 1fr) auto minmax(62px, 1fr);
  align-items: center;
  gap: 0;
  min-height: 22px;
}

.tree-table .resource-total-stack .resource-total {
  grid-row: 1;
  grid-column: 2;
  min-width: 7ch;
  text-align: right;
}

.tree-table .resource-total-stack .resource-strip {
  grid-row: 1;
  grid-column: 3;
  width: 100%;
  justify-content: flex-end;
}

.resource-total {
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  text-align: right;
}

.resource-total-note {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.resource-total-note-error {
  color: var(--danger);
}

span.money-bom-neutral {
  color: var(--text);
}

span.money-bom-ok,
.resource-total-stack.resource-total-ok .resource-total {
  color: var(--green);
}

span.money-bom-error,
.resource-total-stack.resource-total-error .resource-total {
  color: var(--danger);
}

.offer-resources {
  display: grid;
  gap: 3px;
  width: 100%;
  justify-items: stretch;
  align-items: start;
}

.offer-resource-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  justify-self: stretch;
  width: 100%;
  max-width: none;
  gap: 0;
  padding: 0 0 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.offer-resource-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.offer-resource-index,
.offer-summary-index {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--navy);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.offer-resource-index {
  margin-top: 2px;
}

.offer-more-hint {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.offer-summary-list {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.offer-summary-item {
  display: grid;
  grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.offer-summary-item strong {
  min-width: 0;
  overflow: hidden;
  color: #1d2939;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offer-construction-name {
  min-width: 0;
  overflow: hidden;
  color: #1d2939;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offer-construction-dimensions {
  min-width: 0;
  color: #344054;
  font-weight: 400;
}

.offer-download-list {
  display: grid;
  gap: 3px;
  justify-items: center;
  min-width: 0;
}

.offer-download-item {
  min-width: 0;
}

.offer-dimension-cell {
  text-align: right;
}

.offer-dimension-list {
  display: grid;
  gap: 3px;
  justify-items: end;
  min-width: 0;
}

.offer-dimension-item {
  display: grid;
  gap: 1px;
  justify-items: end;
  min-width: 0;
  line-height: 1.15;
}

.offer-dimension-metric {
  color: #1d2939;
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}

.offer-dimension-imperial {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.stage-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: middle;
}

.linklike {
  color: var(--navy-2);
  font-weight: 800;
}

.money {
  color: var(--green);
  font-weight: 800;
}

.muted {
  color: var(--muted);
}

.tiny {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.status-pill {
  border: 1px solid #b8e1c2;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.quote {
  border-color: #d6dce7;
  background: #f2f4f7;
  color: #344054;
}

.status-pill.done {
  border-color: #b8e1c2;
  background: #e6f4ea;
  color: #137333;
}

.status-pill.error {
  border-color: #ffd4cf;
  background: #fff1f0;
  color: var(--danger);
}

.status-pill.legacy {
  border-color: #84caff;
  background: #eff8ff;
  color: #175cd3;
}

.status-pill.pending {
  border-color: #fedf89;
  background: #fffbeb;
  color: #b54708;
}

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: #344054;
}

.project-detail {
  display: grid;
  grid-template-columns: 315px minmax(0, 1fr);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.detail-side {
  padding: 18px 16px;
  border-right: 1px solid var(--line);
}

.detail-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.detail-title strong {
  font-size: 18px;
}

.kv {
  display: grid;
  gap: 12px;
}

.kv-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.kv-row dt {
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.kv-row dd {
  margin: 0;
  color: #1d2939;
}

.progress {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: #e4e7ec;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.detail-main {
  min-width: 0;
  padding: 0 14px 18px;
}

.tab-list {
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.tab.active {
  color: var(--navy);
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--navy);
}

.tab-panel {
  padding-top: 14px;
}

.context-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  padding: 8px 16px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.design-tabs-shell {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.design-tabs-shell .context-tabs {
  border-bottom: 0;
}

.context-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  max-width: 220px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: #344054;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-tab.active {
  border-color: var(--line);
  background: #fbfdff;
  color: var(--navy);
  box-shadow: inset 0 3px 0 var(--navy);
}

.context-tab:hover {
  background: #f3f6fb;
}

.design-construction-tab {
  padding: 0 6px 0 10px;
}

.context-tab-inner {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 150px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.context-tab-inner {
  cursor: pointer;
}

.context-tab-remove,
.context-tab-plus {
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 4px;
  background: #eaf2ff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.context-tab-remove:hover,
.context-tab-plus:hover {
  background: #dbeafe;
}

.design-open-picker {
  margin: 6px 8px 6px 2px;
  border: 1px solid var(--line-strong);
}

.design-tabs-hint {
  align-self: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.design-type-popover {
  position: absolute;
  top: calc(100% - 1px);
  left: 16px;
  z-index: 16;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100% - 32px));
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  padding: 10px;
  box-shadow: var(--shadow);
}

/* `hidden` musi ZAWSZE ukrywac popover, takze gdy regula edytora ustawia display:flex
   (wyzsza specyficznosc). Bez tego picker byl widoczny na stale i nie dalo sie go schowac. */
.design-type-popover[hidden] {
  display: none !important;
}

/* Toggle pickera konstrukcji: zielony "+" (pol-przezroczysty jak inne przyciski).
   Po otwarciu pickera staje sie czerwony, a ikona "+" jest obrocona o 45deg -> wyglada jak "x".
   Selektory celowo wysokiej specyficznosci (.icon-button.design-sidebar-plus:not(...)) — bija
   globalna regule tla `.icon-button:not(.danger):not([data-action="close-modal"]) {bg !important}`
   (styles.css ~1279), ktora inaczej nadpisywala zielone/czerwone tlo. */
.icon-button.design-sidebar-plus:not(.danger):not([data-action="close-modal"]) {
  color: #1a7f37 !important;
  border-color: rgba(26, 127, 55, 0.45) !important;
  background: rgba(26, 127, 55, 0.12) !important;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.icon-button.design-sidebar-plus:not(.danger):not([data-action="close-modal"]):hover {
  background: rgba(26, 127, 55, 0.2) !important;
  border-color: rgba(26, 127, 55, 0.62) !important;
}
.design-sidebar-plus .icon {
  transition: transform 0.18s ease;
}
.icon-button.design-sidebar-plus.is-open:not(.danger):not([data-action="close-modal"]) {
  color: #d92d20 !important;
  border-color: rgba(217, 45, 32, 0.5) !important;
  background: rgba(217, 45, 32, 0.14) !important;
}
.icon-button.design-sidebar-plus.is-open:not(.danger):not([data-action="close-modal"]):hover {
  background: rgba(217, 45, 32, 0.22) !important;
  border-color: rgba(217, 45, 32, 0.66) !important;
}
.design-sidebar-plus.is-open .icon {
  transform: rotate(45deg);
}

.design-type-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.design-type-popover-head strong,
.design-type-popover-head span {
  display: block;
}

.design-type-popover-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.design-type-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
}

.design-type-option {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: #1d2939;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
}

.design-type-option > span {
  display: block;
  line-height: 1.2;
}

.design-type-option small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.design-type-option:hover {
  border-color: #9bc2ff;
  background: #eef4ff;
  color: var(--navy);
}

.design-add-tab {
  gap: 6px;
  max-width: 280px;
  padding: 0 8px;
}

.design-add-tab input {
  width: 150px;
  min-height: 24px;
  border: 0;
  background: transparent;
  padding: 0;
  color: #344054;
  font-size: 11px;
  font-weight: 700;
  outline: 0;
}

.design-add-tab input::placeholder {
  color: var(--muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.metric {
  justify-content: space-between;
  min-height: 56px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
}

.metric .icon {
  color: var(--navy);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel-heading {
  min-height: 38px;
  padding: 0 9px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2,
.panel-heading h3 {
  margin: 0;
  font-size: 12px;
}

.panel-body {
  padding: 9px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 9px;
}

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

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

.catalog-switcher {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 6px;
  margin-bottom: 9px;
}

.catalog-tile {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: #1f2a44;
  font-weight: 800;
  text-align: left;
}

.catalog-tile.active {
  border-color: var(--navy);
  background: #eef3fb;
  color: var(--navy);
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.catalog-filter-group {
  --catalog-filter-control-width: 340px;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.catalog-filter-group select,
.catalog-search-field {
  flex: 0 0 var(--catalog-filter-control-width);
  width: var(--catalog-filter-control-width);
  min-width: var(--catalog-filter-control-width);
  max-width: var(--catalog-filter-control-width);
}

.catalog-filter-group select,
.catalog-search-field input {
  height: 40px;
  min-height: 40px;
}

.catalog-search-field {
  position: relative;
  display: block;
  height: 40px;
}

.catalog-search-field .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 1;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.catalog-search-field input {
  width: 100%;
  padding-left: 34px;
}

.catalog-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px 8px;
}

.catalog-page-range {
  min-width: 116px;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.catalog-table th,
.catalog-table td {
  white-space: normal;
}

.users-table .inline-actions {
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.department-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 999px;
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.14);
}

.user-photo-field {
  display: grid;
  grid-template-columns: 56px auto;
  align-items: center;
  gap: 10px;
}

.user-photo-preview {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #f8fafc;
}

.user-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-photo-preview .small-avatar {
  --avatar-size: 48px;
  border: 0;
  font-size: 13px;
}

.phone-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 82px minmax(140px, 1fr);
  gap: 8px;
}

.phone-grid [data-phone-dial] {
  font-weight: 800;
  text-align: center;
}

.component-grid {
  display: grid;
  gap: 8px;
}

.component-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 8px;
}

.settings-form {
  display: grid;
  gap: 10px;
}

.block-editor-form {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  background: #f6f8fb;
}

.block-side-title,
.component-table-title {
  color: #0f172a;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.block-side-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.block-side-title-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.block-editor-side {
  min-width: 0;
  overflow: auto;
  padding: 10px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.block-editor-main {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  overflow: auto;
  padding: 10px;
}

.block-side-section,
.block-editor-panel {
  display: grid;
  gap: 7px;
}

.block-side-section {
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.block-side-section:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

.block-editor-panel {
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #ffffff;
  padding: 9px 10px;
}

.block-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.block-panel-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
}

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

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

.block-rule-row {
  display: grid;
  gap: 6px;
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #f8fafc;
  padding: 7px;
}

.block-hint-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.block-hint-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  border: 1px solid #d8e1ef;
  border-radius: 999px;
  background: #f8fafc;
  padding: 0 7px;
  color: #475467;
  font-size: 9px;
  font-weight: 800;
}

.block-image-preview {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.block-image-preview-large {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.block-image-frame {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.block-image-overlay-action {
  position: absolute;
  z-index: 2;
  width: 26px;
  min-height: 26px;
  height: 26px;
  border-color: rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.92);
  padding: 0;
  color: #0f172a;
}

.block-image-add-action {
  top: 6px;
  left: 6px;
}

.block-image-clear-action {
  top: 6px;
  right: 6px;
}

.block-image-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
}

.block-image-tools .button {
  justify-content: center;
}

.block-image-source {
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #f8fafc;
  color: #475467;
  padding: 6px 7px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
}

.block-image-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.block-transport-card {
  display: grid;
  gap: 5px;
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #f8fafc;
  padding: 7px;
}

.transport-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(70px, 96px) 28px;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #344054;
  font-size: 11px;
  font-weight: 800;
}

.transport-line input {
  min-width: 0;
  text-align: right;
}

.transport-line output {
  min-width: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.transport-line em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.block-transport-divider {
  height: 1px;
  margin: 3px 0;
  background: #d8e1ef;
}

.block-short-help {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}

.block-table-divider {
  height: 1px;
  background: var(--line);
}

.block-notes-field .catalog-rich-notes {
  min-height: 96px;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1d2939;
  font-weight: 900;
}

.checkbox-line input {
  width: 15px;
  min-height: 15px;
}

.checkbox-line.compact {
  min-height: 28px;
  font-size: 11px;
}

.transport-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 6px;
}

.transport-dimensions-group {
  display: grid;
  min-width: 0;
  gap: 4px;
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #f8fafc;
  padding: 6px;
}

.transport-group-label {
  color: #344054;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
}

.transport-dimensions-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 4px;
  min-width: 0;
}

.transport-dimensions-row label {
  display: grid;
  min-width: 0;
  gap: 2px;
  color: #344054;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.1;
}

.transport-dimensions-row input {
  min-width: 0;
}

.transport-dim-separator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.block-component-panel {
  display: grid;
  gap: 5px;
}

.component-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 26px;
}

.component-table th,
.component-table td {
  padding: 5px 6px;
}

.component-table select,
.component-table input {
  width: 100%;
  min-height: 26px;
  padding: 3px 6px;
}

.component-picker {
  display: grid;
  grid-template-columns: minmax(150px, 0.34fr) minmax(220px, 0.66fr);
  gap: 5px;
  align-items: center;
}

.component-picker-with-mode {
  grid-template-columns: 58px minmax(150px, 0.34fr) minmax(220px, 0.66fr);
}

.component-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.component-mode-toggle input {
  width: auto;
  min-height: 0;
  margin: 0;
}

.component-picker input {
  background: #f8fafc;
}

.component-table [data-rate-cost] {
  padding-right: 7px;
  text-align: right;
  font-weight: 800;
}

.component-table th:nth-child(2),
.component-table td:nth-child(2) {
  width: 80px;
  text-align: center;
}

.component-table th:nth-child(3),
.component-table td:nth-child(3),
.component-table th:nth-child(4),
.component-table td:nth-child(4) {
  width: 118px;
}

.component-table th:last-child,
.component-table td:last-child {
  width: 36px;
  text-align: center;
}

.component-table tfoot td {
  background: #f8fafc;
  color: #1d2939;
  font-weight: 900;
}

.block-cost-panel .table-wrap {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow-x: hidden;
  overflow-y: visible;
}

.block-cost-panel .component-table {
  table-layout: fixed;
  min-width: 0;
  width: 100%;
}

.block-cost-panel .component-table th {
  background: #f8fafc;
  color: #334155;
  font-size: 9px;
}

.block-cost-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.block-cost-summary span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  border: 1px solid #d8e1ef;
  border-radius: 999px;
  background: #f8fafc;
  padding: 0 8px;
  color: #475467;
  font-size: 10px;
  font-weight: 800;
}

.block-cost-summary strong {
  color: #0f172a;
}

.block-cost-summary .block-grand-total {
  border-color: #b6c6e2;
  background: #eef3fb;
  color: #102a63;
}

.block-cost-panel .component-table th:first-child,
.block-cost-panel .component-table td:first-child {
  width: auto;
}

.block-cost-panel .component-table th:nth-child(2),
.block-cost-panel .component-table td:nth-child(2) {
  width: 88px;
}

.block-cost-panel .component-table th:nth-child(3),
.block-cost-panel .component-table td:nth-child(3) {
  width: 120px;
}

.block-cost-panel .component-table th:nth-child(4),
.block-cost-panel .component-table td:nth-child(4),
.block-cost-panel .component-table th:nth-child(5),
.block-cost-panel .component-table td:nth-child(5) {
  width: 118px;
}

.block-cost-panel .component-table th:last-child,
.block-cost-panel .component-table td:last-child {
  width: 48px;
}

.crew-rates-panel {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.crew-rates-table th:nth-child(2),
.crew-rates-table td:nth-child(2) {
  width: 136px;
}

.crew-rates-table th:nth-child(3),
.crew-rates-table td:nth-child(3) {
  width: 118px;
}

.crew-rates-table th:nth-child(4),
.crew-rates-table td:nth-child(4) {
  width: 96px;
}

.crew-rates-table th:nth-child(5),
.crew-rates-table td:nth-child(5) {
  width: 88px;
}

.consult-project-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.consult-project-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.consult-project-row small {
  display: block;
  color: var(--muted);
}

.offer-builder {
  display: grid;
  gap: 8px;
}

.compact-offer-builder {
  gap: 8px;
}

.offer-builder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  padding: 0 2px 7px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.offer-title-total {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.offer-title-total strong {
  color: var(--accent);
}

.offer-title-total span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.offer-builder-head > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.offer-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(120px, 1fr));
  gap: 10px;
}

.offer-filters .wide {
  grid-column: span 2;
}

.compact-offer-filters {
  grid-template-columns: minmax(220px, 1.6fr) minmax(150px, 1fr) repeat(4, minmax(96px, 0.75fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.compact-offer-filters .wide {
  grid-column: span 2;
}

.compact-offer-filters .field {
  gap: 4px;
}

.compact-offer-filters label {
  font-size: 11px;
}

.compact-offer-filters input,
.compact-offer-filters select {
  min-height: 32px;
  padding: 5px 8px;
}

.offer-search-layout {
  display: grid;
  grid-template-columns: 300px minmax(330px, 0.92fr) minmax(430px, 1.12fr);
  gap: 12px;
  align-items: start;
  min-height: 0;
}

.offer-filter-panel,
.offer-selected-panel,
.offer-results-panel {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.offer-filter-panel {
  position: sticky;
  top: 0;
  display: grid;
  gap: 8px;
  padding: 0 10px 0 0;
  border-right: 1px solid var(--line);
}

.offer-panel-title {
  display: grid;
  gap: 2px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.offer-panel-title strong {
  font-size: 13px;
}

.offer-panel-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.offer-filter-panel .field {
  gap: 5px;
}

.offer-filter-panel input,
.offer-filter-panel select {
  width: 100%;
}

.offer-filter-group {
  display: grid;
  gap: 6px;
}

.offer-filter-group > strong {
  color: #344054;
  font-size: 12px;
}

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

.offer-selected-panel,
.offer-results-panel {
  display: grid;
  gap: 8px;
  padding: 0;
}

.offer-results-panel {
  min-height: calc(100vh - 250px);
}

.offer-selected-panel .offer-list {
  min-height: calc(100vh - 330px);
  max-height: calc(100vh - 330px);
}

.offer-results-panel .offer-list {
  min-height: calc(100vh - 330px);
  max-height: calc(100vh - 330px);
}

.offer-filter-panel .offer-notes-panel {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.offer-notes-editor .rich-editable {
  height: clamp(220px, 42vh, 360px);
  min-height: 0;
  max-height: none;
}

.offer-section {
  display: grid;
  gap: 8px;
}

.offer-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 31px;
}

.offer-section-title h3 {
  margin: 0;
  font-size: 13px;
}

.offer-section-title span {
  color: var(--muted);
  font-size: 11px;
}

.offer-list {
  display: grid;
  align-content: start;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
  padding: 0 5px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.offer-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  align-self: start;
  min-height: 76px;
  padding: 6px 0;
  border: 1px solid var(--line);
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
}

.offer-selected-panel .offer-row,
.offer-results-panel .offer-row {
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
}

.offer-selected-panel .offer-row-actions,
.offer-results-panel .offer-row-actions {
  grid-column: auto;
}

.offer-selected-panel .offer-row-actions,
.offer-results-panel .offer-row-actions {
  justify-content: flex-end;
  min-width: 116px;
  padding-top: 0;
  border-top: 0;
}

.offer-thumb-cell {
  min-width: 0;
  width: 112px;
}

.offer-thumb-card {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--navy);
  text-decoration: none;
}

.offer-thumb-card.has-document .pdf-thumb-object {
  width: 100%;
  height: 100%;
}

.offer-thumb-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.offer-thumb-fallback {
  display: none;
  place-items: center;
  width: 100%;
  height: 100%;
  background: #edf3fb;
}

.offer-thumb-fallback .icon {
  width: 48px;
  height: 48px;
}

.offer-thumb-card.thumb-failed .offer-thumb-image {
  display: none;
}

.offer-thumb-card.thumb-failed .offer-thumb-fallback {
  display: grid;
}

.offer-thumb-card.placeholder {
  color: var(--navy);
  font-size: 15px;
  font-weight: 900;
}

.construction-thumb {
  display: block;
  width: 96px;
  height: 68px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef2f7;
}

.construction-thumb.placeholder {
  display: grid;
  place-items: center;
  color: var(--navy);
  font-size: 15px;
  font-weight: 900;
}

.offer-row.selected {
  border-color: #b7d7ff;
  background: linear-gradient(90deg, #f6fbff 0, rgba(246, 251, 255, 0) 70%);
}

.offer-row strong,
.offer-row small {
  display: block;
}

.offer-row small {
  margin-top: 3px;
  color: var(--muted);
}

.offer-row-main {
  min-width: 0;
}

.offer-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.offer-row-tags span {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: #344054;
  font-size: 11px;
  font-weight: 800;
}

.offer-row-tags .offer-price-tag {
  border-color: #b6e2c5;
  background: #f0fff4;
  color: var(--green);
  font-weight: 900;
}

.offer-row-actions,
.offer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.offer-pdf-thumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 96px;
}

.offer-links a {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: white;
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.design-planned-list {
  display: grid;
  gap: 8px;
}

.design-planned-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.modal form.design-compact-form {
  padding: 12px;
}

.design-compact-grid {
  gap: 10px;
}

.design-compact-form textarea {
  min-height: 54px;
}

.design-data-panel {
  gap: 10px;
}

.design-data-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(360px, 1.28fr);
  gap: 12px;
  align-items: stretch;
}

.design-summary-fields,
.design-schedule-fields {
  display: grid;
  gap: 8px;
}

.design-summary-fields {
  grid-template-columns: minmax(0, 1fr);
}

.design-schedule-fields {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 9px;
}

.premium-modal-form {
  display: grid;
  gap: 12px;
}

.premium-form-grid {
  gap: 12px;
}

.form-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.form-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-panel-head h3 {
  margin: 0;
  color: #1d2939;
  font-size: 14px;
}

.form-panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.large-textarea {
  min-height: 126px;
  resize: vertical;
}

.type-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.type-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: #344054;
  font-weight: 750;
}

.type-option.selected {
  border-color: #9bc2ff;
  background: #f3f8ff;
  color: var(--navy-2);
}

.design-multiselect {
  display: grid;
  gap: 8px;
}

.design-builder {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1fr);
  gap: 8px;
  align-items: start;
}

.design-selected-list {
  display: grid;
  gap: 4px;
  min-height: 34px;
  max-height: 132px;
  overflow: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.design-selected-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 2px 3px 2px 8px;
  border: 1px solid #d7e0ed;
  border-radius: 5px;
  background: #f8fafc;
}

.design-selected-title {
  overflow: hidden;
  color: #1d2939;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-empty-text {
  align-self: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.design-builder .design-picker-line {
  grid-column: 2;
  grid-row: 1;
}

.design-type-option-list {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 5px;
  max-height: 90px;
  overflow: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.design-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.design-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid #b7d7ff;
  border-radius: 5px;
  background: #f3f8ff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
}

.design-chip button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 4px;
  background: #dbeafe;
  color: var(--navy);
  font-weight: 900;
  cursor: pointer;
}

.design-picker-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

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

.design-timeline-preview {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.timeline-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #344054;
  font-size: 11px;
  font-weight: 600;
}

.timeline-preview-track {
  height: 16px;
  overflow: hidden;
  border-radius: 5px;
  background: #e4e7ec;
}

.timeline-preview-bar {
  height: 100%;
  border-radius: inherit;
  background: #16a34a;
}

.design-preview-timeline {
  max-width: 100%;
  overflow-x: auto;
}

.design-preview-timeline .timeline-head div {
  min-height: 34px;
}

.design-preview-timeline .timeline-label,
.design-preview-timeline .timeline-canvas {
  min-height: 58px;
}

.design-preview-timeline .timeline-head div {
  justify-content: center;
  padding: 0 3px;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.05;
}

.design-preview-timeline.month .timeline-head .timeline-day span {
  font-size: 9px;
  font-weight: 500;
}

.design-preview-timeline .timeline-head div:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
  justify-content: flex-start;
}

.design-preview-timeline .timeline-label {
  position: sticky;
  left: 0;
  z-index: 4;
  padding: 0 7px;
  background: var(--surface);
}

.design-preview-timeline .timeline-label strong {
  font-size: 11px;
  font-weight: 600;
}

.design-preview-timeline .timeline-label small {
  max-width: 118px;
  font-size: 9px;
  font-weight: 500;
}

.design-preview-timeline .timeline-task {
  top: 7px;
  /* Jedna kolumna dnia = 36px (designPreviewGridStyle). min-width musi się jej równać,
     inaczej zadanie 1-dniowe (start==end) rozpycha się na ~2 dni — bug tylko w tym podglądzie. */
  min-width: 36px;
  height: 42px;
  padding: 6px 14px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.15;
  pointer-events: none;
  cursor: default;
}

.design-preview-timeline .timeline-task small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #475467;
  font-size: 9px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.design-preview-timeline .timeline-task .task-title {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-task.design-preview-busy {
  border-color: #f4b7b2;
  background: #fff5f4;
  color: #9f2f28;
}

.timeline-task.design-preview-selected {
  z-index: 4;
  border-color: #87b7ff;
  background: #eaf2ff;
  color: var(--navy);
  box-shadow: inset 4px 0 0 #2f6fed;
  pointer-events: auto;
  cursor: grab;
}

.timeline-task.design-preview-selected.dragging {
  cursor: grabbing;
  opacity: 0.9;
}

.timeline-task.design-preview-selected.resizing {
  cursor: ew-resize;
}

.design-scheduler-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(46px, 1fr));
  gap: 4px;
}

.design-scheduler-day {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: #344054;
  font-size: 10px;
  line-height: 1.1;
}

.design-scheduler-day strong,
.design-scheduler-day small {
  display: block;
}

.design-scheduler-day.is-off {
  background: #f1f3f6;
  color: var(--muted);
}

.design-scheduler-day.is-busy {
  border-color: #f4b7b2;
  background: #fff5f4;
  color: #9f2f28;
}

.design-scheduler-day.is-selected {
  border-color: #87b7ff;
  background: #eaf2ff;
  color: var(--navy);
  box-shadow: inset 0 0 0 2px rgba(23, 59, 133, 0.08);
}

.design-scheduler-day.is-selected.is-busy {
  border-color: #f59e0b;
  background: #fff7ed;
  color: #9a3412;
}

.timeline-preview-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.timeline-preview-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.timeline-preview-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-selected {
  background: #eaf2ff;
  border: 1px solid #87b7ff;
}

.legend-busy {
  background: #fff5f4;
  border: 1px solid #f4b7b2;
}

.legend-off {
  background: #f1f3f6;
  border: 1px solid var(--line);
}

.construction-editor-form .form-panel {
  gap: 10px;
}

.construction-overview-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  gap: 10px;
  align-items: stretch;
}

.construction-context-fields,
.construction-dimensions-card {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.construction-dimensions-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.construction-card-title {
  color: #344054;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.unit-field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.unit-field input {
  width: 100%;
  min-width: 0;
  padding-right: 42px;
  text-align: right;
  font-weight: 800;
}

.unit-field span {
  position: absolute;
  right: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  pointer-events: none;
}

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

.construction-meta-strip div,
.readout-card {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.construction-meta-strip span,
.readout-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.construction-meta-strip strong,
.readout-card strong {
  overflow: hidden;
  color: #1d2939;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.construction-bom-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.42fr) minmax(320px, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.construction-calc-button {
  align-self: center;
  white-space: nowrap;
}

.construction-pdf-grid {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(190px, 230px);
  gap: 12px;
  align-items: stretch;
}

.file-drop-zone {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: #fbfdff;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.file-drop-zone.drag-over {
  border-color: var(--navy-2);
  background: #eef4ff;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.1);
}

.file-drop-zone strong {
  display: block;
  color: #1d2939;
  font-size: 12px;
}

.file-drop-zone small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-progress {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.inline-progress[hidden] {
  display: none;
}

.inline-progress::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
  height: 6px;
  border-radius: 999px;
  background: #e4e7ec;
}

.inline-progress span {
  grid-column: 1;
  grid-row: 1;
  display: block;
  width: 0;
  height: 6px;
  border-radius: 999px;
  background: var(--navy-2);
  transition: width 0.16s ease;
}

.inline-progress small {
  grid-column: 2;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

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

.readout-grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.readout-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.readout-grid strong {
  overflow: hidden;
  color: #1d2939;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bom-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bom-action-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upload-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.design-upload-strip {
  grid-template-columns: auto auto minmax(0, 1fr);
}

.upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: #1d2939;
  font-weight: 800;
  cursor: pointer;
}

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

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

.upload-button.is-disabled input {
  cursor: not-allowed;
}

.attachment-list {
  display: grid;
  gap: 8px;
}

.attachment-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.attachment-main {
  min-width: 0;
}

.attachment-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 32px;
  border-radius: 5px;
  background: #eef4ff;
  color: var(--navy-2);
  font-size: 10px;
  font-weight: 900;
}

.attachment-item a,
.attachment-item strong {
  display: block;
  overflow: hidden;
  color: #1d2939;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-item small,
.attachment-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.attachment-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.attachment-actions a.button {
  display: inline-flex;
  color: #1d2939;
}

.attachment-transfer-list {
  display: grid;
  gap: 6px;
}

.attachment-transfer {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 7px 8px;
}

.attachment-transfer-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #344054;
  font-size: 11px;
  font-weight: 800;
}

.attachment-transfer-meta strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-transfer-meta span {
  flex: 0 0 auto;
  color: var(--muted);
}

.attachment-transfer-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e7ec;
}

.attachment-transfer-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--navy-2);
  transition: width 0.16s ease;
}

.version-editor-grid {
  display: grid;
  gap: 12px;
}

.pdf-upload-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.list-row strong {
  display: block;
}

.roles-panel {
  grid-column: span 2;
}

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

.role-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.role-card strong {
  color: #1d2939;
  font-size: 12px;
}

.role-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.split-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.import-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
}

.calculation-layout {
  display: grid;
  grid-template-columns: 300px minmax(280px, 0.75fr) minmax(0, 1.35fr);
  gap: 14px;
  align-items: start;
}

.calculation-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.calculation-sidebar {
  position: sticky;
  top: 0;
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.calc-context-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.calc-context {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.calc-context span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.calc-context strong {
  color: #1d2939;
}

.calc-context small {
  color: var(--muted);
}

.calc-context-construction {
  justify-items: end;
  text-align: right;
}

.margin-profile-panel {
  display: grid;
  gap: 10px;
}

.margin-profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.calculation-workspace {
  display: grid;
  gap: 12px;
}

.calc-step {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.validation-step {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 420px;
  overflow: hidden;
}

.validation-result-pane {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.validation-result-pane .table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

.validation-result-pane thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.calc-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.calc-step-head > span:first-child {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.calc-step-head h3,
.calc-step-head p {
  margin: 0;
}

.calc-step-head h3 {
  font-size: 14px;
}

.calc-step-head p {
  color: var(--muted);
  font-size: 12px;
}

.premium-drop {
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
}

.calculation-summary {
  display: grid;
  gap: 12px;
}

.calculation-summary strong {
  display: block;
  margin-top: 3px;
}

.calculation-kpis {
  display: grid;
  gap: 8px;
}

.calculation-kpis div {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.calculation-kpis span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.validation-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.validation-head p {
  margin: 0;
}

.validation-stats {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.validation-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.validation-stats .is-error {
  border-color: var(--bom-error-line);
  background: var(--bom-error-bg);
  color: var(--bom-error-text);
}

.validation-stats .is-ok {
  border-color: var(--bom-ok-line);
  background: var(--bom-ok-bg);
  color: var(--bom-ok-text);
}

.validation-stats .is-legacy {
  border-color: var(--bom-legacy-line);
  background: var(--bom-legacy-bg);
  color: var(--bom-legacy-text);
}

.validation-stats .is-warning {
  border-color: var(--bom-warning-line);
  background: var(--bom-warning-bg);
  color: var(--bom-warning-text);
}

.bom-validation-table th,
.bom-validation-table td,
.missing-blocks-table th,
.missing-blocks-table td {
  vertical-align: middle;
}

.bom-validation-table {
  table-layout: fixed;
  min-width: 1160px;
}

.bom-validation-table th,
.bom-validation-table td {
  height: 30px;
  max-height: 30px;
  padding: 3px 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.bom-validation-table th:nth-child(1),
.bom-validation-table td:nth-child(1) {
  width: 62px;
  text-align: center;
}

.bom-validation-table th:nth-child(2),
.bom-validation-table td:nth-child(2) {
  width: 365px;
}

.bom-validation-table th:nth-child(3),
.bom-validation-table td:nth-child(3) {
  width: 270px;
}

.bom-validation-table th:nth-child(4),
.bom-validation-table td:nth-child(4) {
  width: 135px;
}

.bom-validation-table th:nth-child(5),
.bom-validation-table td:nth-child(5) {
  width: 96px;
}

.bom-validation-table th:nth-child(6),
.bom-validation-table td:nth-child(6) {
  width: 300px;
  min-width: 300px;
  overflow: visible;
  text-align: right;
}

.bom-validation-table .bom-row-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 4px;
  min-width: max-content;
}

.bom-validation-table .tiny {
  display: inline;
  margin-left: 5px;
  overflow: hidden;
  color: inherit;
  opacity: 0.72;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bom-validation-table .button.mini {
  min-height: 23px;
  padding: 0 7px;
  font-size: 10px;
}

.bom-validation-table .button.mini.has-comment {
  border-color: #12b76a;
  background: #ecfdf3;
  color: #067647;
}

.bom-validation-table .bom-block-name-button {
  appearance: none;
  display: block;
  max-width: 100%;
  border: 0 !important;
  outline: 0;
  background: transparent !important;
  color: inherit;
  padding: 0 !important;
  box-shadow: none !important;
  font: inherit;
  font-weight: 900;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.bom-validation-table .bom-block-name-button:hover,
.bom-validation-table .bom-block-name-button:focus {
  text-decoration: none;
}

.bom-validation-table tr[data-bom-validation-row] {
  cursor: pointer;
}

.bom-validation-table tr.is-error td {
  border-top: 1px solid var(--bom-error-line);
  border-bottom: 1px solid var(--bom-error-line);
  background: var(--bom-error-bg);
  color: var(--bom-error-text);
}

.bom-validation-table tr.is-ok td {
  border-top: 1px solid var(--bom-ok-line);
  border-bottom: 1px solid var(--bom-ok-line);
  background: var(--bom-ok-bg);
  color: var(--bom-ok-text);
}

.bom-validation-table tr.is-legacy td {
  border-top: 1px solid var(--bom-legacy-line);
  border-bottom: 1px solid var(--bom-legacy-line);
  background: var(--bom-legacy-bg);
  color: var(--bom-legacy-text);
}

.bom-validation-table tr.is-legacy td:nth-child(2) strong {
  text-decoration-line: underline;
  text-decoration-color: #2e90fa;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.bom-validation-table tr.is-warning td {
  border-top: 1px solid var(--bom-warning-line);
  border-bottom: 1px solid var(--bom-warning-line);
  background: var(--bom-warning-bg);
  color: var(--bom-warning-text);
}

.validation-message {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bom-preview-table {
  table-layout: fixed;
  min-width: max(900px, 100%);
}

.bom-preview-table th,
.bom-preview-table td {
  height: 28px;
  max-height: 28px;
  padding: 3px 7px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.bom-param-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.bom-param-strip span {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  max-width: 136px;
  min-height: 20px;
  border: 1px solid #d8e1ef;
  border-radius: 999px;
  background: #f8fafc;
  padding: 0 6px;
  overflow: hidden;
  color: #344054;
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bom-param-strip b {
  color: #667085;
  font-weight: 900;
}

.bom-param-empty {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.bom-column-check {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bom-column-check span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: #344054;
  font-size: 11px;
  font-weight: 800;
}

.bom-column-check strong {
  color: #667085;
  font-size: 10px;
  text-transform: uppercase;
}

.bom-column-check span.ok {
  border-color: #b7e4c7;
  background: #f1fff6;
  color: #067647;
}

.bom-column-check span.missing {
  border-color: #fedf89;
  background: #fffbeb;
  color: #b54708;
}

.missing-blocks-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #ffd4cf;
  border-radius: 8px;
  background: #fff7f6;
}

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

.missing-blocks-head h4,
.missing-blocks-head p {
  margin: 0;
}

.missing-blocks-head h4 {
  color: #b42318;
  font-size: 14px;
}

.missing-blocks-head p {
  color: #667085;
  font-size: 12px;
}

.missing-block-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.missing-block-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #fecdca;
  border-radius: 999px;
  background: #fff1f0;
  color: #7a271a;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 800;
}

.drop-zone {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fbfdff;
}

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

.error-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.error-list li {
  padding: 8px 10px;
  border: 1px solid #ffd4cf;
  border-radius: var(--radius);
  background: #fff7f6;
  color: var(--danger);
}

.timeline {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.timeline-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.timeline-tab {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: #344054;
  padding: 0 12px;
  font-weight: 800;
}

.timeline-tab.active {
  border-color: var(--navy);
  background: var(--navy);
  color: white;
}

.timeline-head,
.timeline-row {
  display: grid;
  grid-template-columns: 120px repeat(7, minmax(118px, 1fr));
  min-width: 950px;
}

.timeline-head div,
.timeline-label,
.timeline-canvas {
  min-height: 52px;
  border-bottom: 1px solid var(--line);
}

.timeline-head div {
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: var(--surface-muted);
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.timeline-head .timeline-day {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
}

.timeline-head .timeline-day small {
  color: inherit;
  font-size: 10px;
  font-weight: 700;
}

.timeline-day.nonwork {
  background: #fff1f0;
  color: #b42318;
}

.timeline-day.sunday,
.timeline-day.holiday {
  background: #ffe4e0;
  color: #b42318;
}

/* === „DZIŚ" — subtelny, delikatny znacznik bieżącego dnia (orientacja „gdzie jesteśmy") === */
/* Nagłówek dnia dzisiejszego: delikatne zielone tło + etykieta DZIŚ (bez toporności). */
.timeline-head .timeline-day.today,
.timeline-head div.today {
  background: color-mix(in srgb, #16a34a 12%, var(--surface-muted)) !important;
  color: #0f7a39 !important;
  font-weight: 800;
  box-shadow: inset 0 -2px 0 color-mix(in srgb, #16a34a 65%, transparent);
  position: relative;
}
.timeline-head div.today::before {
  content: "DZIŚ";
  position: absolute;
  top: 2px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 8px;
  letter-spacing: 0.5px;
  font-weight: 800;
  color: #16a34a;
}
/* Kolumna dnia dzisiejszego: BARDZO delikatny zielony tint na całej wysokości,
   bez linii i strzałek (warstwa dni, pod kafelkami). */
.timeline-day-layer span.today {
  background: color-mix(in srgb, #16a34a 7%, transparent) !important;
}
/* Pionowa linia „teraz" USUNIĘTA (była toporna, ze strzałkami) — zostaje sam tint kolumny. */
.timeline-today-marker {
  display: none !important;
}

/* === Timeline: NOWOCZESNY pasek narzędzi (jedna wysokość 40px, wszystko wycentrowane) === */
.timeline-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; padding: 4px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 12px; width: fit-content; max-width: 100%; }
.timeline-tabs .timeline-tab { min-height: 36px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #475467; padding: 0 16px; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .12s, color .12s, box-shadow .12s; }
.timeline-tabs .timeline-tab:hover { background: var(--surface); color: var(--navy); }
.timeline-tabs .timeline-tab.active { background: var(--navy); color: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .2); }

.timeline-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.timeline-search { display: flex; align-items: center; gap: 9px; flex: 1 1 260px; min-width: 220px; max-width: 460px; height: 40px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.timeline-search:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 14%, transparent); }
.timeline-search .icon { width: 16px; height: 16px; opacity: .5; flex: 0 0 auto; }
.timeline-search input { flex: 1; min-width: 0; height: 100%; border: none; background: transparent; outline: none; font: inherit; color: var(--text); }
.timeline-search input::-webkit-search-cancel-button { display: none; }
.timeline-search-clear { flex: 0 0 auto; border: none; background: transparent; cursor: pointer; font-size: 16px; line-height: 1; color: var(--muted); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.timeline-search-clear:hover { background: var(--surface-muted); color: var(--text); }
.timeline-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }

/* Segmentowe grupy (nawigacja dat + zakres) — jedna wysokość, treść WYCENTROWANA */
.timeline-toolbar .segmented { height: 40px; display: inline-flex; align-items: stretch; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.timeline-toolbar .segmented button { min-height: 0; height: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-right: 1px solid var(--line); background: transparent; color: #344054; padding: 0 16px; font-weight: 700; font-size: 13px; cursor: pointer; transition: background .12s, color .12s; }
.timeline-toolbar .segmented button:last-child { border-right: 0; }
.timeline-toolbar .segmented button:hover { background: var(--surface-muted); }
.timeline-toolbar .segmented button.active { background: var(--navy); color: #fff; }
.timeline-toolbar .timeline-nav button { min-width: 44px; padding: 0 12px; }
.timeline-toolbar .timeline-nav .icon { width: 16px; height: 16px; }

/* Chip „Dziś" — wyrównany do reszty, z zielonym pulsem */
.timeline-today-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; background: color-mix(in srgb, #16a34a 8%, var(--surface-muted)); border: 1px solid color-mix(in srgb, #16a34a 24%, transparent); color: #0f7a39; font-size: 13px; font-weight: 700; white-space: nowrap; }
.timeline-today-pip { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; display: inline-block; box-shadow: 0 0 0 3px color-mix(in srgb, #16a34a 20%, transparent); }

/* Gantt: etykieta wiersza — czytelny układ (numer/nazwa + kompaktowa meta %/status) */
.timeline.timeline-gantt .timeline-label { flex-direction: column; align-items: stretch; justify-content: center; gap: 6px; padding: 10px 12px; }
.timeline.timeline-gantt .timeline-label-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.timeline.timeline-gantt .timeline-label-text { min-width: 0; }
.timeline.timeline-gantt .timeline-label-text strong { display: block; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline.timeline-gantt .tree-toggle { width: 22px; height: 22px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); display: inline-grid; place-items: center; font-weight: 800; line-height: 1; cursor: pointer; flex: 0 0 auto; color: #475467; }
.timeline.timeline-gantt .tree-toggle:hover { background: var(--surface-muted); }
.timeline-row-meta { display: flex; align-items: center; gap: 8px; }
.timeline-progress-track { flex: 1 1 auto; min-width: 36px; height: 6px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.timeline-progress-track > span { display: block; height: 100%; background: var(--navy); border-radius: 999px; }
.timeline-row-meta em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--muted); }
.timeline-status { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; color: #475467; white-space: nowrap; }
.timeline-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.timeline-status.active { color: #0284c7; }
.timeline-status.late { color: #dc2626; }
.timeline-status.planned { color: #d97706; }
.timeline-status.done { color: #16a34a; }
.timeline-row-dots { display: none; }

/* === Panel ogólny (checklisty / konsultacje) === */
.timeline-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px; }
.timeline-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.timeline-panel-head h3 { margin: 0; font-size: 16px; }
.timeline-panel-head p { margin: 2px 0 0; }

/* === Checklista (Moje zadania / Gwarancja) === */
.checklist { max-width: 760px; }
.checklist-add { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-muted); margin-bottom: 12px; }
.checklist-add .icon { width: 16px; height: 16px; opacity: .55; }
.checklist-add input { flex: 1; min-width: 0; border: none; background: transparent; outline: none; font: inherit; }
.checklist-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: background .15s; }
.checklist-item:hover { background: var(--surface-muted); }
.checklist-check { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: transparent; }
.checklist-check .icon { width: 14px; height: 14px; }
.checklist-item.is-done .checklist-check { background: #16a34a; border-color: #16a34a; color: #fff; }
.checklist-body { flex: 1; min-width: 0; }
.checklist-text { margin: 0; font-weight: 600; color: var(--text); word-break: break-word; cursor: text; }
.checklist-item.is-done .checklist-text { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.checklist-item.is-task .checklist-text { cursor: pointer; }
.checklist-meta { color: var(--muted); font-size: 11px; }
.checklist-edit-input { width: 100%; border: 1px solid var(--navy); border-radius: 6px; padding: 2px 6px; font: inherit; font-weight: 600; }
.checklist-row-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; opacity: 0; transition: opacity .15s; }
.checklist-item:hover .checklist-row-actions, .checklist-item.is-task .checklist-row-actions { opacity: 1; }
.checklist-task-badge { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--tone-design); border: 1px solid color-mix(in srgb, var(--tone-design) 45%, transparent); border-radius: 999px; padding: 2px 7px; }
.checklist-empty { color: var(--muted); padding: 14px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.checklist-empty.small { padding: 8px; font-size: 12px; }
.checklist-done-group { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.checklist-done-head { display: flex; align-items: center; gap: 8px; border: none; background: transparent; cursor: pointer; font-weight: 800; color: var(--muted); padding: 4px 0; }
.checklist-done-head .icon { width: 14px; height: 14px; color: #16a34a; }
.checklist-done-head .chevron { font-size: 11px; }
.checklist-done-count { background: var(--surface-muted); border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.checklist-list-done { margin-top: 8px; opacity: .85; }

/* === Konsultacje === */
.consult-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.consult-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.consult-card.has-overdue { border-color: #f4b7b2; box-shadow: inset 3px 0 0 #dc2626; }
.consult-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.consult-card-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.consult-card-title strong { color: var(--navy); }
.consult-card-name { font-weight: 700; }
.consult-card-client { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.consult-card-client .icon { width: 13px; height: 13px; }
.consult-card-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.consult-badge.overdue { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.consult-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.chip-button:hover { background: var(--surface-muted); }
.consult-weekly { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; margin-left: auto; }
.consult-weekly.on { color: #0f7a39; font-weight: 700; }
.reminder-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.reminder-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.reminder-item.is-overdue { border-color: #fecdca; background: #fffafa; }
.reminder-item .checklist-check { width: 20px; height: 20px; }
.reminder-item.is-done .checklist-text { text-decoration: line-through; color: var(--muted); }
.reminder-due { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.reminder-due .icon { width: 12px; height: 12px; }
.reminder-due.overdue { color: #b42318; font-weight: 700; }
.reminder-due.soon { color: #b54708; font-weight: 700; }
.reminder-add { display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.reminder-add input { height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; font: inherit; background: var(--surface); }
.reminder-add input[type=text] { flex: 1; min-width: 0; }

/* === DOPIESZCZENIE: miękkie cienie, hovery, odstępy (ten sam charakter) === */
/* „Nowe zadanie" w pasku — ta sama wysokość 40px co reszta kontrolek. */
.timeline-controls .primary-button.timeline-add { height: 40px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; font-weight: 700; }
.timeline-controls .primary-button.timeline-add .icon { width: 16px; height: 16px; }

/* Gantt: kontener z delikatnym cieniem + hover wiersza dla orientacji. */
.timeline.timeline-gantt { box-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04); }
.timeline.timeline-gantt > .timeline-row:hover > .timeline-label { background: var(--surface-muted); }
.timeline.timeline-gantt > .timeline-row { transition: background .12s; }

/* Panele i karty — miękki cień + spójne odstępy. */
.timeline-panel { box-shadow: 0 1px 3px rgba(16, 24, 40, .05); }
.timeline-panel-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); }

/* Checklista — lekki „lift" przy hoverze, delikatniejsze ramki. */
.checklist-list { gap: 8px; }
.checklist-item { border-color: color-mix(in srgb, var(--line) 80%, transparent); transition: background .14s, box-shadow .14s, border-color .14s, transform .06s; }
.checklist-item:hover { background: var(--surface); border-color: var(--line-strong); box-shadow: 0 2px 8px rgba(16, 24, 40, .06); }
.checklist-check { transition: background .14s, border-color .14s, transform .08s; }
.checklist-check:hover { border-color: #16a34a; }
.checklist-check:active { transform: scale(.92); }
.checklist-add { transition: border-color .14s, background .14s; }
.checklist-add:focus-within { border-color: var(--navy); background: var(--surface); }

/* Konsultacje — karty z miękkim cieniem i hoverem; przyciski‑chipy dopieszczone. */
.consult-card { box-shadow: 0 1px 3px rgba(16, 24, 40, .05); transition: box-shadow .15s, transform .06s, border-color .15s; }
.consult-card:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, .08); border-color: var(--line-strong); }
.chip-button { transition: background .12s, border-color .12s, color .12s; }
.chip-button:hover { border-color: var(--navy); color: var(--navy); }
.consult-weekly input { accent-color: #16a34a; }
.reminder-item { transition: border-color .12s, background .12s; }
.reminder-add input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 12%, transparent); }

.timeline-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  color: #1d2939;
  font-weight: 800;
}

.timeline-label small {
  max-width: 100px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-canvas {
  position: relative;
  grid-column: span 7;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: calc(100% / 7) 100%;
}

/* Profesjonalny gantt: pierwsza kolumna (etykiety projektów/osób) PRZYKLEJONA w poziomie,
   żeby przy przewijaniu dni zostawała widoczna, a „dziś" startowało zaraz za nią.
   Scope tylko do głównego timeline — podglądy Design/Plany (.design-preview-timeline,
   .planning-timeline-preview) celowo nietknięte. */
.timeline.timeline-gantt > .timeline-head > div:first-child,
.timeline.timeline-gantt > .timeline-row > .timeline-label {
  position: sticky;
  left: 0;
  z-index: 6;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--line);
}
.timeline.timeline-gantt > .timeline-head > div:first-child {
  z-index: 8;
  background: var(--surface-muted);
}

.timeline-day-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.timeline-day-layer span {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(185, 28, 28, 0.12);
}

.timeline-day-layer .nonwork {
  background: rgba(255, 76, 76, 0.13);
}

.timeline-day-layer .sunday,
.timeline-day-layer .holiday {
  background: rgba(255, 76, 76, 0.22);
}

.timeline-task {
  position: absolute;
  top: 9px;
  min-width: 92px;
  height: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(16, 24, 40, 0.10);
  border-radius: 8px;
  padding: 4px 11px;
  color: #1d2939;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
  z-index: 2;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  transition: left 0.08s ease, width 0.08s ease, box-shadow 0.14s ease, transform 0.1s ease;
}

.timeline-task:hover {
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.16);
  transform: translateY(-1px);
  z-index: 5;
}

.timeline-task .task-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-task small {
  display: block;
  color: #475467;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-task.projects {
  background: #e3f1fc;
}

.timeline-task.design {
  background: #e9f4fd;
  border-color: #b6dcf6;
}

/* Design „Gotowy" zostaje ZIELONY — zielony = praca skończona (świadomy wyjątek). */
.timeline-task.design-ready {
  background: #bbf7d0;
  border-color: #16a34a;
  box-shadow: inset 4px 0 0 #16a34a;
}

.timeline-task.design-ready small {
  color: #14532d;
}

.timeline-task.consulting {
  background: #eef2f7;
}

.timeline-task.plans {
  background: #dbe8ff;
}

.timeline-task.production {
  background: #e8ebef;
}

.timeline-task.transport {
  background: #ffedbd;
}

.timeline-task.assembly {
  background: #e8dcff;
}

.timeline-task.certification {
  background: #ccfbf1;
}

.timeline-section-header {
  margin-bottom: 10px;
}

.timeline-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.timeline-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.timeline-controls > strong {
  color: #344054;
  font-size: 12px;
}

.segmented {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.segmented button {
  min-height: 32px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: #344054;
  padding: 0 10px;
  font-weight: 800;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active {
  background: var(--navy);
  color: white;
}

.timeline-row.child .timeline-label {
  background: #fbfdff;
  color: #344054;
  padding-left: 28px;
}

.timeline-label {
  flex-direction: row;
}

.timeline-label.child strong {
  font-size: 12px;
}

.timeline-task {
  min-width: 34px;
  height: 40px;
  padding: 5px 12px;
  user-select: none;
}

.timeline-task .task-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-task.dragging {
  opacity: 0.8;
  z-index: 5;
  cursor: grabbing;
  outline: 2px solid rgba(15, 42, 99, 0.24);
}

.timeline-task.drag-ready {
  z-index: 5;
}

.timeline-task.resizing {
  outline: 2px solid rgba(23, 59, 133, 0.32);
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.16);
}

.timeline-task:has(.resize-handle:hover) {
  z-index: 5;
  outline: 2px solid rgba(23, 59, 133, 0.24);
}

.timeline-task:has(.resize-handle.left:hover) {
  box-shadow: inset 4px 0 0 var(--navy-2), 0 6px 16px rgba(16, 24, 40, 0.16);
}

.timeline-task:has(.resize-handle.right:hover) {
  box-shadow: inset -4px 0 0 var(--navy-2), 0 6px 16px rgba(16, 24, 40, 0.16);
}

.timeline-task.resize-left {
  box-shadow: inset 4px 0 0 var(--navy-2), 0 6px 16px rgba(16, 24, 40, 0.16);
}

.timeline-task.resize-right {
  box-shadow: inset -4px 0 0 var(--navy-2), 0 6px 16px rgba(16, 24, 40, 0.16);
}

.resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 6;
  width: 12px;
  background: rgba(255, 255, 255, 0.28);
  cursor: ew-resize;
}

.resize-handle:hover {
  background: rgba(23, 59, 133, 0.42);
}

.timeline-task.resize-left .resize-handle.left,
.timeline-task.resize-right .resize-handle.right {
  width: 14px;
  background: var(--navy-2);
}

.resize-handle.left {
  left: 0;
}

.resize-handle.right {
  right: 0;
}

.timeline-row.drop-target .timeline-label {
  background: #eef4ff;
  box-shadow: inset 3px 0 0 var(--navy-2);
}

.timeline-row.drop-target .timeline-canvas {
  outline: 2px solid rgba(23, 59, 133, 0.18);
  outline-offset: -2px;
}

.timeline.month .timeline-head .timeline-day span {
  font-size: 11px;
}

.timeline-empty {
  padding: 18px;
  color: var(--muted);
  font-style: italic;
  border-top: 1px solid var(--line);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.section-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: var(--muted);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 24, 40, 0.36);
}

.modal-backdrop.is-suspended {
  display: none;
}

.modal-backdrop.presentation-options-backdrop {
  place-items: stretch;
  padding: 0;
}

.modal-back-button {
  align-self: center;
  min-height: 34px;
  margin-right: 8px;
}

.modal-backdrop.calculation-backdrop {
  place-items: center;
  padding: 4px;
}

.modal-backdrop.project-backdrop {
  place-items: center;
  padding: 4px;
}

.modal-backdrop.block-backdrop {
  place-items: center;
  padding: 12px;
}

.modal-backdrop.project-costs-backdrop {
  place-items: center;
  padding: 12px;
}

.modal-backdrop.planning-backdrop {
  place-items: center;
  padding: 4px;
}

.modal {
  width: min(1120px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 12px;
  box-shadow: var(--shadow);
}

.modal.full-height {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 40px);
  max-height: calc(100vh - 40px);
  overflow: hidden;
}

.modal.full-height > form,
.modal.full-height > .modal-form {
  flex: 1 1 auto;
  overflow: auto;
}

.modal.project-modal,
.modal.construction-modal {
  width: min(1600px, calc(100vw - 8px));
}

.modal.project-modal.full-height,
.modal.construction-modal.full-height {
  height: calc(100vh - 8px);
  max-height: calc(100vh - 8px);
}

.modal.project-modal.full-height {
  width: min(1440px, calc(100vw - 16px));
  height: calc(100dvh - 8px);
  max-height: calc(100dvh - 8px);
  border-radius: var(--radius);
}

.modal.project-modal header,
.modal.project-modal footer {
  padding: 7px 10px;
}

.modal.project-modal header h2 {
  font-size: 14px;
}

.modal.block-modal.full-height {
  width: min(1500px, 100%);
  max-width: 100%;
  height: min(920px, 100%);
  max-height: 100%;
}

.modal.block-modal.full-height > form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.modal.calculation-modal.full-height {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(80vw, calc(100vw - 16px));
  min-width: min(1320px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
  height: calc(100dvh - 8px);
  min-height: calc(100dvh - 8px);
  max-height: calc(100dvh - 8px);
  border-radius: 8px;
  overflow: hidden;
}

.modal.calculation-modal.full-height > .calculation-shell {
  grid-template-columns: 420px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  height: auto;
  max-height: none;
  min-height: 0;
  overflow: hidden;
  padding: 10px;
}

.modal.calculation-modal .calculation-sidebar,
.modal.calculation-modal .calculation-workspace {
  min-height: 0;
}

.modal.calculation-modal .calculation-sidebar {
  align-content: start;
  overflow: auto;
}

.modal.calculation-modal .calculation-workspace {
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
  align-self: stretch;
  height: 100%;
  overflow: hidden;
  padding-right: 0;
}

.modal.calculation-modal .validation-step {
  min-height: 0;
  height: 100%;
}

.modal.calculation-modal .validation-result-pane {
  height: 100%;
  min-height: 260px;
  max-height: none;
  overflow: auto;
}

.modal.calculation-modal .validation-result-pane .table-wrap,
.modal.calculation-modal .validation-result-pane .validation-scroll {
  height: auto;
  max-height: none;
  min-height: 0;
  overflow-x: auto;
  overflow-y: visible;
}

.modal.calculation-modal .mapping-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.modal.project-costs-modal.full-height {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1920px, 100%);
  max-width: 100%;
  height: min(980px, 100%);
  max-height: 100%;
  overflow: hidden;
}

.modal.project-costs-modal .project-cost-calculator-head,
.modal.project-costs-modal .project-cost-footer {
  min-height: 44px;
  padding: 7px 10px;
  background: var(--surface);
}

.modal.project-costs-modal .project-cost-footer {
  justify-content: space-between;
}

.modal.project-costs-modal .project-cost-footer > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.modal.project-costs-modal .project-cost-footer > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.modal.project-costs-modal .project-cost-presentation-button {
  border-color: #057a36;
  background: #059b43;
}

.modal.project-costs-modal .project-cost-presentation-button:hover {
  background: #047f38;
}

.modal.design-modal .design-footer-presentation-button {
  border-color: #057a36;
  background: #059b43;
}

.modal.design-modal .design-footer-presentation-button:hover {
  background: #047f38;
}

.modal.presentation-options-modal {
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 0;
  overflow: hidden;
}

.modal.presentation-options-modal > .presentation-options-form {
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.presentation-options-form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--surface-muted);
}

.presentation-options-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.presentation-options-summary strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.presentation-options-summary span,
.presentation-configurator-controls h3,
.presentation-preview-head span,
.presentation-control-row span,
.presentation-option-row small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.presentation-configurator-grid {
  display: grid;
  grid-template-columns: clamp(380px, 28vw, 520px) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.presentation-configurator-controls {
  min-height: 0;
  overflow: auto;
  padding: 10px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.presentation-configurator-controls h3 {
  margin: 4px 0 8px;
  text-transform: uppercase;
}

.presentation-option-list,
.presentation-module-list,
.presentation-control-list {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.presentation-control-group {
  display: grid;
  gap: 6px;
  padding: 8px 0 10px;
  border-top: 1px solid var(--line);
}

.presentation-control-group:first-of-type {
  border-top: 0;
}

.presentation-control-group h3,
.presentation-control-group p {
  margin: 0;
}

.presentation-control-group p {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.presentation-module-row {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.presentation-module-row strong,
.presentation-module-row small {
  display: block;
}

.presentation-module-row strong {
  color: var(--text);
  font-weight: 900;
}

.presentation-module-row small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.presentation-option-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.presentation-option-row input {
  align-self: center;
}

.presentation-option-row strong,
.presentation-option-row small {
  display: block;
}

.presentation-option-row strong {
  color: var(--text);
  font-weight: 900;
}

.presentation-save-layout-row {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
}

.presentation-control-row {
  display: grid;
  grid-template-columns: minmax(122px, 1fr) minmax(128px, 168px) 78px;
  gap: 8px;
  align-items: center;
  min-height: 36px;
}

.presentation-control-row input,
.presentation-control-row select {
  width: 100%;
  min-width: 0;
}

.presentation-control-row input[type="color"] {
  padding: 2px;
}

.presentation-control-row output {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.presentation-page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.presentation-page-tab {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.presentation-page-tab.active,
.presentation-page-tab:hover {
  border-color: var(--navy);
  background: var(--blue-soft);
  color: var(--navy);
}

.presentation-options-form[data-active-presentation-page] .presentation-control-group {
  display: none;
}

.presentation-options-form[data-active-presentation-page="global"] .presentation-control-group[data-presentation-page-panel="global"],
.presentation-options-form[data-active-presentation-page="title"] .presentation-control-group[data-presentation-page-panel="title"],
.presentation-options-form[data-active-presentation-page="construction"] .presentation-control-group[data-presentation-page-panel="construction"],
.presentation-options-form[data-active-presentation-page="finance"] .presentation-control-group[data-presentation-page-panel="finance"],
.presentation-options-form[data-active-presentation-page="roi"] .presentation-control-group[data-presentation-page-panel="roi"] {
  display: grid;
}

.presentation-configurator-preview {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
}

.presentation-preview-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 2px 8px;
}

.presentation-preview-head strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.presentation-preview-head .presentation-page-tabs {
  justify-content: flex-end;
  margin: 0;
}

.presentation-preview-canvas {
  position: relative;
  display: block;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(16, 42, 99, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(16, 42, 99, 0.06) 1px, transparent 1px),
    var(--presentation-preview-bg, #ffffff);
  background-size: 34px 34px;
  padding: 14px;
}

.presentation-live-preview-frame {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
}

.presentation-live-preview-status {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 18px;
  z-index: 2;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.presentation-live-preview-status[data-tone="error"] {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
  color: var(--danger);
}

.presentation-preview-document {
  width: min(100%, 980px);
  min-height: 590px;
  margin: 0 auto;
  border: 1px solid color-mix(in srgb, var(--presentation-preview-accent, #A10707) 24%, var(--line));
  border-radius: var(--presentation-preview-radius, 6px);
  background: var(--presentation-preview-paper, #ffffff);
  padding: var(--presentation-preview-pad, 24px);
  color: var(--text);
  box-shadow: 0 14px 38px rgba(16, 24, 40, 0.12);
}

.presentation-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--presentation-preview-gap, 18px);
  margin-bottom: var(--presentation-preview-gap, 18px);
}

.presentation-preview-title {
  display: grid;
  gap: 2px;
}

.presentation-preview-title small,
.presentation-preview-title span,
.presentation-preview-summary span,
.presentation-preview-card small,
.presentation-preview-price span,
.presentation-preview-finance span {
  color: var(--muted);
  font-size: var(--presentation-preview-meta, 10px);
  font-weight: 800;
}

.presentation-preview-title strong {
  color: var(--presentation-preview-accent, #A10707);
  font-size: var(--presentation-preview-title, 18px);
  line-height: 1.05;
}

.presentation-preview-logo {
  display: grid;
  place-items: center;
  width: 68px;
  height: 42px;
  border-radius: var(--presentation-preview-card-radius, 4px);
  background: var(--presentation-preview-accent, #A10707);
  color: #ffffff;
  font-weight: 950;
}

.presentation-preview-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--presentation-preview-gap, 18px);
  align-items: end;
  margin-bottom: var(--presentation-preview-gap, 18px);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--presentation-preview-card-radius, 4px);
  background: var(--surface-muted);
}

.presentation-preview-summary strong {
  display: block;
  color: var(--text);
  font-size: calc(var(--presentation-preview-title, 18px) * 0.58);
}

.presentation-preview-summary b {
  color: var(--presentation-preview-accent, #A10707);
  font-size: var(--presentation-preview-title-price, 24px);
  line-height: 1;
}

.presentation-preview-construction {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, var(--presentation-preview-info, 500px));
  grid-template-rows: auto auto;
  gap: var(--presentation-preview-gap, 18px);
  align-items: stretch;
}

.presentation-preview-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 240px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--presentation-preview-card-radius, 4px);
  background: linear-gradient(135deg, #f8fafc, #dbe3ee);
}

.presentation-preview-visual > span {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 76%;
  height: 62%;
  border: 1px dashed color-mix(in srgb, var(--presentation-preview-accent, #A10707) 42%, var(--line));
  border-radius: var(--presentation-preview-card-radius, 4px);
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-weight: 900;
}

.presentation-preview-watermark {
  position: absolute;
  inset: auto 24px 10px auto;
  color: var(--presentation-preview-accent, #A10707);
  font-size: 42px;
  font-weight: 950;
  opacity: var(--presentation-preview-watermark, 0.18);
}

.presentation-preview-info {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.presentation-preview-price,
.presentation-preview-card,
.presentation-preview-metrics span,
.presentation-preview-finance > div {
  border: 1px solid var(--line);
  border-radius: var(--presentation-preview-card-radius, 4px);
  background: var(--surface);
}

.presentation-preview-price,
.presentation-preview-card,
.presentation-preview-finance > div {
  padding: 10px;
}

.presentation-preview-price strong {
  display: block;
  color: var(--presentation-preview-accent, #A10707);
  font-size: var(--presentation-preview-construction-price, 22px);
}

.presentation-preview-card strong,
.presentation-preview-finance strong {
  display: block;
  color: var(--text);
  font-size: var(--presentation-preview-construction-title, 13px);
}

.presentation-preview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.presentation-preview-metrics span {
  display: grid;
  place-items: center;
  min-height: 44px;
  color: var(--text);
  font-size: var(--presentation-preview-construction-metric, 13px);
  font-weight: 900;
}

.presentation-preview-gallery {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  overflow: hidden;
}

.presentation-preview-gallery span {
  width: var(--presentation-preview-thumb, 112px);
  height: calc(var(--presentation-preview-thumb, 112px) * 0.62);
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--presentation-preview-card-radius, 4px);
  background: linear-gradient(135deg, #ffffff, #e4eaf2);
}

.presentation-preview-finance {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--presentation-preview-gap, 18px);
  margin-top: var(--presentation-preview-gap, 18px);
}

.presentation-preview-finance > div:first-child {
  background: var(--presentation-preview-dark, #090f1f);
  color: #ffffff;
}

.presentation-preview-finance > div:first-child span,
.presentation-preview-finance > div:first-child strong {
  color: #ffffff;
}

.presentation-preview-finance b {
  display: block;
  margin-top: 5px;
  color: var(--presentation-preview-accent, #A10707);
  font-size: var(--presentation-preview-finance-total, 22px);
  line-height: 1;
}

.presentation-preview-finance > div:first-child b {
  color: #ffffff;
}

.presentation-preview-finance span {
  font-size: var(--presentation-preview-finance-text, 10px);
}

.presentation-preview-finance strong {
  font-size: var(--presentation-preview-finance-title, 18px);
}

.presentation-preview-canvas[data-info-position="left"] .presentation-preview-visual {
  order: 2;
}

.presentation-preview-canvas[data-info-position="left"] .presentation-preview-info {
  order: 1;
}

.presentation-preview-canvas[data-info-position="bottom"] .presentation-preview-construction {
  grid-template-columns: 1fr;
}

.presentation-preview-canvas[data-info-position="bottom"] .presentation-preview-info {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.presentation-preview-canvas[data-info-position="bottom"] .presentation-preview-metrics {
  grid-column: 1 / -1;
}

.presentation-preview-canvas[data-construction-metrics="bottom"] .presentation-preview-metrics {
  order: 10;
}

.presentation-preview-canvas[data-construction-metrics="hidden"] .presentation-preview-metrics {
  display: none;
}

.presentation-preview-canvas[data-logo-position="left"] .presentation-preview-logo {
  order: -1;
}

.presentation-preview-canvas[data-title-layout="stack"] .presentation-preview-header {
  align-items: flex-start;
  flex-direction: column;
}

.presentation-preview-canvas[data-title-layout="center"] .presentation-preview-header,
.presentation-preview-canvas[data-title-layout="center"] .presentation-preview-summary {
  align-items: center;
  grid-template-columns: 1fr;
  text-align: center;
}

.presentation-preview-canvas[data-title-layout="center"] .presentation-preview-header {
  flex-direction: column;
}

.presentation-preview-canvas[data-title-navigation="hidden"] .presentation-preview-summary {
  display: none;
}

.presentation-preview-canvas[data-summary-align="center"] .presentation-preview-summary {
  grid-template-columns: 1fr;
  text-align: center;
}

.presentation-preview-canvas[data-summary-align="left"] .presentation-preview-summary {
  grid-template-columns: 1fr;
}

.presentation-preview-canvas[data-gallery-mode="side"] .presentation-preview-construction {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.34fr) minmax(230px, var(--presentation-preview-info, 500px));
}

.presentation-preview-canvas[data-gallery-mode="side"] .presentation-preview-gallery {
  grid-column: auto;
  flex-direction: column;
  min-width: 0;
}

.presentation-preview-canvas[data-gallery-mode="hidden"] .presentation-preview-gallery {
  display: none;
}

.presentation-preview-canvas[data-finance-layout="stack"] .presentation-preview-finance {
  grid-template-columns: 1fr;
}

.presentation-preview-canvas[data-roi-layout="stack"] .presentation-preview-finance {
  grid-template-columns: 1fr;
}

.presentation-preview-canvas[data-roi-map="left"] .presentation-preview-finance > div:last-child {
  order: -1;
}

.presentation-preview-canvas[data-roi-map="top"] .presentation-preview-finance {
  grid-template-columns: 1fr;
}

.presentation-preview-canvas[data-roi-map="top"] .presentation-preview-finance > div:last-child {
  order: -1;
}

.presentation-preview-canvas[data-price-info="summary"] .presentation-preview-finance > div:first-child {
  display: none;
}

.presentation-preview-canvas[data-price-info="finance"] .presentation-preview-summary b {
  display: none;
}

.presentation-preview-canvas[data-image-ratio="4-3"] .presentation-preview-visual {
  aspect-ratio: 4 / 3;
}

.presentation-preview-canvas[data-image-ratio="1-1"] .presentation-preview-visual {
  aspect-ratio: 1 / 1;
}

.presentation-preview-canvas[data-image-ratio="21-9"] .presentation-preview-visual {
  aspect-ratio: 21 / 9;
}

.presentation-preview-canvas[data-image-fit="cover"] .presentation-preview-visual > span {
  width: 100%;
  height: 100%;
  border-style: solid;
}

.presentation-preview-pages {
  position: absolute;
  left: 14px;
  top: 14px;
  width: var(--presentation-preview-page-width, 1840px);
  max-width: none;
  margin: 0;
  transform: translate(var(--presentation-preview-offset-x, 0px), var(--presentation-preview-offset-y, 0px)) scale(var(--presentation-preview-scale, 1));
  transform-origin: top left;
}

.presentation-preview-page {
  display: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--presentation-preview-accent, #A10707) 24%, var(--line));
  border-radius: var(--presentation-preview-radius, 6px);
  background: var(--presentation-preview-paper, #ffffff);
  padding: var(--presentation-preview-pad, 24px);
  color: var(--text);
  box-shadow: 0 14px 38px rgba(16, 24, 40, 0.12);
}

.presentation-preview-canvas[data-active-page="title"] .presentation-preview-page[data-presentation-preview-page="title"],
.presentation-preview-canvas[data-active-page="construction"] .presentation-preview-page[data-presentation-preview-page="construction"],
.presentation-preview-canvas[data-active-page="finance"] .presentation-preview-page[data-presentation-preview-page="finance"],
.presentation-preview-canvas[data-active-page="roi"] .presentation-preview-page[data-presentation-preview-page="roi"] {
  display: grid;
}

.presentation-preview-page img {
  display: block;
  max-width: 100%;
}

.presentation-preview-template-page {
  padding: 0;
  place-items: stretch;
  background: #ffffff;
}

.presentation-preview-template-page .presentation-preview-template-image {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.presentation-preview-final-header,
.presentation-preview-page-head,
.presentation-preview-title-kpis,
.presentation-preview-finance-layout,
.presentation-preview-roi-layout {
  display: grid;
  gap: var(--presentation-preview-gap, 18px);
}

.presentation-preview-final-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  margin-bottom: var(--presentation-preview-gap, 18px);
}

.presentation-preview-title-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.presentation-preview-title-copy small,
.presentation-preview-title-copy span,
.presentation-preview-title-copy p,
.presentation-preview-page-head span,
.presentation-preview-page-head small,
.presentation-preview-title-kpis span,
.presentation-preview-card span,
.presentation-preview-card small,
.presentation-preview-finance-table span,
.presentation-preview-finance-summary span,
.presentation-preview-finance-summary p,
.presentation-preview-finance-kpis span,
.presentation-preview-pop-kpis span,
.presentation-preview-pop-kpis small,
.presentation-preview-rings span,
.presentation-preview-roi-panel span,
.presentation-preview-roi-panel p,
.presentation-preview-roi-grid span {
  color: var(--muted);
  font-size: var(--presentation-preview-meta, 12px);
  font-weight: 850;
}

.presentation-preview-title-copy strong {
  color: var(--presentation-preview-accent, #A10707);
  font-size: var(--presentation-preview-title, 38px);
  line-height: 1;
}

.presentation-preview-title-copy p {
  max-width: 740px;
  margin: 0;
  font-size: var(--presentation-preview-subtitle, 14px);
  line-height: 1.4;
}

.presentation-preview-final-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.presentation-preview-final-nav a {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--presentation-preview-card-radius, 4px);
  background: var(--surface-muted);
  color: var(--text);
  font-size: var(--presentation-preview-meta, 12px);
  font-weight: 900;
}

.presentation-preview-logo {
  display: grid;
  place-items: center;
  width: 82px;
  height: 54px;
  border-radius: var(--presentation-preview-card-radius, 4px);
  background: var(--presentation-preview-accent, #A10707);
  color: #ffffff;
  font-size: 18px;
  font-weight: 950;
}

.presentation-preview-title-hero {
  position: relative;
  height: clamp(280px, 40dvh, 540px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--presentation-preview-card-radius, 4px);
  background: color-mix(in srgb, var(--surface-muted) 72%, #ffffff);
}

.presentation-preview-title-hero img {
  width: 100%;
  height: 100%;
  max-height: min(58dvh, 620px);
  object-fit: var(--presentation-preview-image-fit, contain);
  object-position: center;
}

.presentation-preview-title-price {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 3px;
  min-width: 260px;
  padding: 16px;
  border-radius: var(--presentation-preview-card-radius, 4px);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.16);
}

.presentation-preview-title-price span,
.presentation-preview-title-price small {
  color: var(--muted);
  font-size: var(--presentation-preview-meta, 12px);
  font-weight: 900;
}

.presentation-preview-title-price strong {
  color: var(--presentation-preview-accent, #A10707);
  font-size: var(--presentation-preview-title-price, 24px);
  line-height: 1;
}

.presentation-preview-title-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: var(--presentation-preview-gap, 18px);
}

.presentation-preview-title-kpis > div,
.presentation-preview-card,
.presentation-preview-finance-table,
.presentation-preview-finance-summary,
.presentation-preview-population-panel,
.presentation-preview-roi-panel {
  border: 1px solid var(--line);
  border-radius: var(--presentation-preview-card-radius, 4px);
  background: var(--surface);
}

.presentation-preview-title-kpis > div {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.presentation-preview-title-kpis strong {
  color: var(--text);
  font-size: 17px;
  line-height: 1.15;
}

.presentation-preview-page-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.presentation-preview-page-head strong {
  display: block;
  color: var(--text);
  font-size: var(--presentation-preview-construction-title, 24px);
  line-height: 1.05;
}

.presentation-preview-page-head b {
  color: var(--presentation-preview-accent, #A10707);
  font-size: var(--presentation-preview-construction-price, 24px);
  line-height: 1;
}

.presentation-preview-page-head.is-dark {
  padding: 18px;
  border: 0;
  border-radius: var(--presentation-preview-card-radius, 4px);
  background: var(--presentation-preview-dark, #090f1f);
}

.presentation-preview-page-head.is-dark strong,
.presentation-preview-page-head.is-dark b {
  color: #ffffff;
}

.presentation-preview-page-head.is-dark span,
.presentation-preview-page-head.is-dark small {
  color: rgba(255, 255, 255, 0.72);
}

.presentation-preview-construction-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, var(--presentation-preview-info, 500px));
  gap: var(--presentation-preview-gap, 18px);
  align-items: start;
  margin-top: var(--presentation-preview-gap, 18px);
}

.presentation-preview-render-panel {
  position: relative;
  display: grid;
  min-height: 0;
  height: min(52dvh, 620px);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--presentation-preview-card-radius, 4px);
  background: color-mix(in srgb, var(--surface-muted) 72%, #ffffff);
}

.presentation-preview-render-panel img {
  width: 100%;
  height: 100%;
  object-fit: var(--presentation-preview-image-fit, contain);
  object-position: center;
}

.presentation-preview-watermark {
  position: absolute;
  right: 18px;
  bottom: 12px;
  color: var(--presentation-preview-accent, #A10707);
  font-size: clamp(28px, 5vw, 72px);
  font-weight: 950;
  letter-spacing: 0;
  opacity: var(--presentation-preview-watermark, 0.18);
  pointer-events: none;
}

.presentation-preview-construction-info {
  display: grid;
  gap: var(--presentation-preview-gap, 18px);
  min-width: 0;
}

.presentation-preview-card {
  display: grid;
  gap: 6px;
  padding: 13px;
}

.presentation-preview-card strong {
  color: var(--text);
  font-size: var(--presentation-preview-construction-title, 24px);
  line-height: 1.05;
}

.presentation-preview-card small {
  font-size: var(--presentation-preview-construction-text, 12px);
  line-height: 1.35;
}

.presentation-preview-price-card strong {
  color: var(--presentation-preview-accent, #A10707);
  font-size: var(--presentation-preview-construction-price, 24px);
}

.presentation-preview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.presentation-preview-metrics span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--presentation-preview-card-radius, 4px);
  background: var(--surface-muted);
}

.presentation-preview-metrics small {
  color: var(--muted);
  font-size: var(--presentation-preview-meta, 12px);
  font-weight: 900;
}

.presentation-preview-metrics strong {
  color: var(--text);
  font-size: var(--presentation-preview-construction-metric, 13px);
}

.presentation-preview-attractions ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0 0 0 18px;
  color: var(--text);
  font-size: var(--presentation-preview-attractions, 9px);
  font-weight: 780;
  line-height: 1.35;
}

.presentation-preview-gallery {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, var(--presentation-preview-thumb, 112px)));
  gap: 10px;
}

.presentation-preview-gallery span {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--presentation-preview-card-radius, 4px);
  background: var(--surface-muted);
}

.presentation-preview-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.presentation-preview-finance-layout,
.presentation-preview-roi-layout {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: stretch;
  margin-top: var(--presentation-preview-gap, 18px);
}

.presentation-preview-finance-table,
.presentation-preview-finance-summary,
.presentation-preview-population-panel,
.presentation-preview-roi-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.presentation-preview-finance-table > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.presentation-preview-finance-table > div:last-child {
  border-bottom: 0;
}

.presentation-preview-finance-table strong {
  color: var(--text);
  font-size: var(--presentation-preview-finance-value, 18px);
  text-align: right;
}

.presentation-preview-finance-table .is-total strong {
  color: var(--presentation-preview-accent, #A10707);
  font-size: var(--presentation-preview-finance-total, 42px);
  line-height: 1;
}

.presentation-preview-finance-summary strong,
.presentation-preview-roi-panel strong {
  color: var(--text);
  font-size: var(--presentation-preview-finance-title, 46px);
  line-height: 1.02;
}

.presentation-preview-finance-summary p,
.presentation-preview-roi-panel p {
  margin: 0;
  font-size: var(--presentation-preview-finance-text, 12px);
  line-height: 1.45;
}

.presentation-preview-finance-kpis,
.presentation-preview-pop-kpis,
.presentation-preview-roi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.presentation-preview-finance-kpis > div,
.presentation-preview-pop-kpis > div,
.presentation-preview-roi-grid > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--presentation-preview-card-radius, 4px);
  background: var(--surface-muted);
}

.presentation-preview-finance-kpis strong,
.presentation-preview-pop-kpis strong,
.presentation-preview-roi-grid strong {
  color: var(--text);
  font-size: var(--presentation-preview-roi-value, 16px);
}

.presentation-preview-map {
  overflow: hidden;
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: var(--presentation-preview-card-radius, 4px);
  background:
    linear-gradient(90deg, rgba(16, 42, 99, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(16, 42, 99, 0.05) 1px, transparent 1px),
    #f8fafc;
  background-size: 28px 28px;
}

.presentation-preview-map svg {
  width: 100%;
  height: 100%;
  min-height: 250px;
}

.presentation-preview-map path,
.presentation-preview-map circle {
  fill: none;
  stroke: var(--presentation-preview-accent, #A10707);
  stroke-width: 2;
  opacity: 0.54;
}

.presentation-preview-map circle {
  stroke: var(--navy);
  opacity: 0.45;
}

.presentation-preview-map .pin {
  fill: var(--presentation-preview-accent, #A10707);
  stroke: #ffffff;
  opacity: 1;
}

.presentation-preview-map text {
  fill: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.presentation-preview-rings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.presentation-preview-rings span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
}

.presentation-preview-roi-panel b {
  color: var(--presentation-preview-accent, #A10707);
  font-size: var(--presentation-preview-roi-title, 38px);
  line-height: 1;
}

.presentation-preview-canvas[data-logo-position="left"] .presentation-preview-logo {
  order: -1;
}

.presentation-preview-canvas[data-title-layout="stack"] .presentation-preview-final-header {
  grid-template-columns: 1fr;
}

.presentation-preview-canvas[data-title-layout="center"] .presentation-preview-final-header,
.presentation-preview-canvas[data-title-layout="center"] .presentation-preview-title-copy,
.presentation-preview-canvas[data-title-layout="center"] .presentation-preview-title-price {
  justify-items: center;
  text-align: center;
}

.presentation-preview-canvas[data-title-layout="center"] .presentation-preview-final-header {
  grid-template-columns: 1fr;
}

.presentation-preview-canvas[data-title-navigation="hidden"] .presentation-preview-final-nav,
.presentation-preview-canvas[data-gallery-mode="hidden"] .presentation-preview-gallery,
.presentation-preview-canvas[data-construction-metrics="hidden"] .presentation-preview-metrics,
.presentation-preview-canvas[data-construction-attractions="hidden"] .presentation-preview-attractions,
.presentation-preview-canvas[data-title-price="hidden"] .presentation-preview-title-price,
.presentation-preview-canvas[data-price-info="finance"] .presentation-preview-title-price,
.presentation-preview-canvas[data-price-info="summary"] .presentation-preview-finance-summary {
  display: none;
}

.presentation-preview-canvas[data-summary-align="center"] .presentation-preview-title-kpis {
  text-align: center;
}

.presentation-preview-canvas[data-summary-align="left"] .presentation-preview-title-kpis {
  grid-template-columns: 1fr;
}

.presentation-preview-canvas[data-title-price="below"] .presentation-preview-title-price {
  position: static;
  min-width: 0;
  margin: var(--presentation-preview-gap, 18px) 0 0;
  box-shadow: none;
}

.presentation-preview-canvas[data-info-position="left"] .presentation-preview-render-panel {
  order: 2;
}

.presentation-preview-canvas[data-info-position="left"] .presentation-preview-construction-info {
  order: 1;
}

.presentation-preview-canvas[data-info-position="bottom"] .presentation-preview-construction-layout {
  grid-template-columns: 1fr;
}

.presentation-preview-canvas[data-info-position="bottom"] .presentation-preview-construction-info {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.presentation-preview-canvas[data-info-position="bottom"] .presentation-preview-attractions,
.presentation-preview-canvas[data-info-position="bottom"] .presentation-preview-metrics {
  grid-column: 1 / -1;
}

.presentation-preview-canvas[data-construction-metrics="bottom"] .presentation-preview-metrics {
  order: 10;
}

.presentation-preview-canvas[data-construction-attractions="bottom"] .presentation-preview-attractions {
  grid-column: 1 / -1;
  order: 12;
}

.presentation-preview-canvas[data-gallery-mode="side"] .presentation-preview-construction-layout {
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.18fr) minmax(320px, var(--presentation-preview-info, 500px));
}

.presentation-preview-canvas[data-gallery-mode="side"] .presentation-preview-gallery {
  grid-column: auto;
  grid-template-columns: 1fr;
  order: 2;
}

.presentation-preview-canvas[data-gallery-mode="side"] .presentation-preview-construction-info {
  order: 3;
}

.presentation-preview-canvas[data-image-ratio="4-3"] .presentation-preview-render-panel,
.presentation-preview-canvas[data-image-ratio="4-3"] .presentation-preview-title-hero {
  aspect-ratio: 4 / 3;
}

.presentation-preview-canvas[data-image-ratio="1-1"] .presentation-preview-render-panel,
.presentation-preview-canvas[data-image-ratio="1-1"] .presentation-preview-title-hero {
  aspect-ratio: 1 / 1;
}

.presentation-preview-canvas[data-image-ratio="21-9"] .presentation-preview-render-panel,
.presentation-preview-canvas[data-image-ratio="21-9"] .presentation-preview-title-hero {
  aspect-ratio: 21 / 9;
}

.presentation-preview-canvas[data-finance-layout="stack"] .presentation-preview-finance-layout,
.presentation-preview-canvas[data-finance-breakdown="top"] .presentation-preview-finance-layout,
.presentation-preview-canvas[data-roi-layout="stack"] .presentation-preview-roi-layout,
.presentation-preview-canvas[data-roi-map="top"] .presentation-preview-roi-layout {
  grid-template-columns: 1fr;
}

.presentation-preview-canvas[data-finance-breakdown="right"] .presentation-preview-finance-table {
  order: 2;
}

.presentation-preview-canvas[data-roi-map="left"] .presentation-preview-population-panel {
  order: -1;
}

.presentation-preview-canvas[data-roi-population="right"] .presentation-preview-population-panel {
  order: 2;
}

.presentation-preview-page {
  border-width: var(--presentation-preview-frame-border, 1px);
  border-color: var(--presentation-preview-frame, var(--line));
  box-shadow: 0 14px 38px rgba(16, 24, 40, 0.12);
}

.presentation-preview-final-header {
  gap: var(--presentation-preview-title-header-gap, var(--presentation-preview-gap, 18px));
  margin-bottom: var(--presentation-preview-title-header-gap, var(--presentation-preview-gap, 18px));
  padding: var(--presentation-preview-title-header-y, 0) var(--presentation-preview-title-header-x, 0);
  border-bottom: var(--presentation-preview-header-border, 0) solid var(--presentation-preview-line, var(--line));
}

.presentation-preview-page-head {
  border-bottom-width: var(--presentation-preview-header-border, 1px);
  border-bottom-color: var(--presentation-preview-line, var(--line));
}

.presentation-preview-logo {
  width: var(--presentation-preview-logo-width, 82px);
  height: var(--presentation-preview-logo-height, 54px);
}

.presentation-preview-title-hero {
  height: var(--presentation-preview-title-hero-height, 540px);
  border-width: var(--presentation-preview-image-border, 1px);
  border-color: var(--presentation-preview-frame, var(--line));
  transform: translate(var(--presentation-preview-title-hero-x, 0), var(--presentation-preview-title-hero-y, 0));
}

.presentation-preview-title-hero img {
  object-position: var(--presentation-preview-image-x, 50%) var(--presentation-preview-image-y, 50%);
  transform: scale(var(--presentation-preview-title-hero-scale, 1));
}

.presentation-preview-title-price {
  width: var(--presentation-preview-title-price-width, 260px);
  min-width: 0;
  transform: translate(var(--presentation-preview-title-price-x, 0), var(--presentation-preview-title-price-y, 0));
}

.presentation-preview-title-kpis {
  gap: var(--presentation-preview-title-kpi-gap, var(--presentation-preview-gap, 18px));
}

.presentation-preview-title-kpis > div {
  padding: var(--presentation-preview-title-kpi-pad, 12px);
}

.presentation-preview-title-kpis > div,
.presentation-preview-card,
.presentation-preview-finance-table,
.presentation-preview-finance-summary,
.presentation-preview-population-panel,
.presentation-preview-roi-panel,
.presentation-preview-finance-kpis > div,
.presentation-preview-pop-kpis > div,
.presentation-preview-roi-grid > div {
  border-width: var(--presentation-preview-card-border, 1px);
  border-color: var(--presentation-preview-frame, var(--line));
}

.presentation-preview-card,
.presentation-preview-finance-table,
.presentation-preview-finance-summary,
.presentation-preview-population-panel,
.presentation-preview-roi-panel {
  padding: var(--presentation-preview-card-pad, 13px);
}

.presentation-preview-construction-layout {
  padding: var(--presentation-preview-construction-pad-y, 0) var(--presentation-preview-construction-pad-x, 0);
}

.presentation-preview-render-panel {
  width: var(--presentation-preview-render-width, 100%);
  height: var(--presentation-preview-render-height, 100%);
  border-width: var(--presentation-preview-image-border, 1px);
  border-color: var(--presentation-preview-frame, var(--line));
  transform: translate(var(--presentation-preview-render-x, 0), var(--presentation-preview-render-y, 0));
}

.presentation-preview-render-panel img {
  object-position: var(--presentation-preview-image-x, 50%) var(--presentation-preview-image-y, 50%);
  transform: scale(var(--presentation-preview-image-zoom, 1));
}

.presentation-preview-construction-info {
  transform: translate(var(--presentation-preview-info-x, 0), var(--presentation-preview-info-y, 0));
}

.presentation-preview-construction-info .presentation-preview-card {
  padding: var(--presentation-preview-info-pad, var(--presentation-preview-card-pad, 13px));
}

.presentation-preview-metrics {
  grid-template-columns: repeat(var(--presentation-preview-metrics-columns, 4), minmax(0, 1fr));
}

.presentation-preview-attractions ul {
  columns: var(--presentation-preview-attraction-columns, 1);
}

.presentation-preview-gallery {
  gap: var(--presentation-preview-thumb-gap, 10px);
  transform: translate(var(--presentation-preview-thumb-x, 0), var(--presentation-preview-thumb-y, 0));
  justify-content: flex-start;
}

.presentation-preview-canvas[data-gallery-justify="center"] .presentation-preview-gallery {
  justify-content: center;
}

.presentation-preview-canvas[data-gallery-justify="right"] .presentation-preview-gallery {
  justify-content: end;
}

.presentation-preview-canvas[data-gallery-justify="stretch"] .presentation-preview-gallery {
  grid-template-columns: repeat(4, minmax(var(--presentation-preview-thumb, 112px), 1fr));
}

.presentation-preview-gallery span {
  border-width: var(--presentation-preview-thumb-border, 1px);
  border-color: var(--presentation-preview-frame, var(--line));
  aspect-ratio: var(--presentation-preview-thumb-aspect, 16/9);
}

.presentation-preview-gallery img {
  object-fit: var(--presentation-preview-thumb-fit, cover);
}

.presentation-preview-canvas[data-thumbnail-aspect="4-3"] .presentation-preview-gallery span {
  aspect-ratio: 4 / 3;
}

.presentation-preview-canvas[data-thumbnail-aspect="1-1"] .presentation-preview-gallery span {
  aspect-ratio: 1 / 1;
}

.presentation-preview-canvas[data-thumbnail-aspect="21-9"] .presentation-preview-gallery span {
  aspect-ratio: 21 / 9;
}

.presentation-preview-canvas[data-thumbnail-fit="contain"] .presentation-preview-gallery img {
  object-fit: contain;
}

.presentation-preview-finance-page,
.presentation-preview-roi-page {
  padding: var(--presentation-preview-finance-pad-y, var(--presentation-preview-pad, 24px)) var(--presentation-preview-finance-pad-x, var(--presentation-preview-pad, 24px));
}

.presentation-preview-finance-layout {
  gap: var(--presentation-preview-finance-gap, var(--presentation-preview-gap, 18px));
}

.presentation-preview-finance-table {
  padding: var(--presentation-preview-finance-panel-pad, var(--presentation-preview-card-pad, 13px));
  transform: translate(var(--presentation-preview-finance-table-x, 0), var(--presentation-preview-finance-table-y, 0));
}

.presentation-preview-finance-summary {
  padding: var(--presentation-preview-finance-panel-pad, var(--presentation-preview-card-pad, 13px));
  transform: translate(var(--presentation-preview-finance-summary-x, 0), var(--presentation-preview-finance-summary-y, 0));
}

.presentation-preview-roi-layout {
  gap: var(--presentation-preview-roi-gap, var(--presentation-preview-gap, 18px));
}

.presentation-preview-population-panel {
  padding: var(--presentation-preview-roi-pad, var(--presentation-preview-card-pad, 13px));
  transform: translate(var(--presentation-preview-roi-map-x, 0), var(--presentation-preview-roi-map-y, 0));
}

.presentation-preview-roi-panel {
  padding: var(--presentation-preview-roi-pad, var(--presentation-preview-card-pad, 13px));
  transform: translate(var(--presentation-preview-roi-panel-x, 0), var(--presentation-preview-roi-panel-y, 0));
}

.presentation-preview-map,
.presentation-preview-map svg {
  min-height: var(--presentation-preview-roi-map-height, 250px);
}

.modal.project-costs-modal .project-costs-form,
.project-costs-form {
  width: 100%;
  max-width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(320px, 21vw, 410px) minmax(0, 1fr) clamp(310px, 18vw, 360px);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  overflow: hidden;
  background: var(--surface-muted);
}

.project-costs-form > * {
  min-width: 0;
  min-height: 0;
}

.modal.project-costs-modal .project-cost-top-kpis {
  grid-column: 1 / -1;
}

.modal.project-costs-modal .project-cost-scope-panel,
.modal.project-costs-modal .project-cost-center-panel,
.modal.project-costs-modal .project-costs-results {
  min-width: 0;
  min-height: 0;
}

.modal.project-costs-modal .project-cost-scope-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.modal.project-costs-modal .project-cost-scope-body {
  min-height: 0;
  overflow: auto;
}

.modal.project-costs-modal .project-cost-center-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.modal.project-costs-modal .project-costs-results {
  overflow: auto;
}

.project-costs-side,
.project-costs-main {
  min-height: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}

.project-costs-side {
  overflow: auto;
}

.project-costs-main {
  overflow: auto;
}

.project-cost-top-kpis {
  display: grid;
  grid-template-columns: minmax(280px, 1.25fr) repeat(5, minmax(140px, 1fr));
  gap: 8px;
  align-items: stretch;
}

.project-cost-profile-tools,
.project-cost-kpi {
  min-width: 0;
  min-height: 62px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.project-cost-profile-tools {
  display: grid;
  gap: 5px;
  align-content: center;
}

.project-cost-profile-tools > span,
.project-cost-kpi > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.project-cost-profile-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}

.project-cost-profile-controls select {
  min-width: 0;
}

.project-cost-kpi {
  display: grid;
  align-content: center;
}

.project-cost-kpi strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-kpi small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-kpi.positive strong,
.project-cost-kpi.positive small {
  color: var(--green);
}

.project-cost-construction-list {
  display: grid;
  gap: 7px;
}

.project-cost-section-label {
  margin: 5px 2px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.project-cost-design-tree {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  overflow: hidden;
}

.project-cost-design-tree > summary {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  padding: 6px 8px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.project-cost-design-tree > summary::-webkit-details-marker {
  display: none;
}

.project-cost-design-tree > summary strong {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-design-tree > summary span:last-child {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.project-cost-tree-chevron::before {
  content: ">";
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
  transition: transform 0.15s ease;
}

.project-cost-design-tree[open] .project-cost-tree-chevron::before {
  transform: rotate(90deg);
}

.project-cost-design-children {
  display: grid;
  gap: 4px;
  padding: 6px;
  border-top: 1px solid var(--border);
}

.project-cost-construction-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.project-cost-construction-card:has([data-cost-construction]:checked) {
  border-color: var(--navy);
  background: #eef3fb;
  box-shadow: inset 3px 0 0 var(--navy);
}

.project-cost-construction {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 8px;
  align-items: center;
  min-height: 72px;
  padding: 8px 9px;
  border-bottom: 0;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.project-cost-construction:last-child {
  border-bottom: 0;
}

.project-cost-pdf-thumb {
  position: relative;
  width: 68px;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
  overflow: hidden;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.project-cost-pdf-object,
.project-cost-pdf-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  background: #fff;
  pointer-events: none;
}

.project-cost-pdf-thumb.has-image .project-cost-pdf-object,
.project-cost-pdf-thumb.has-image .project-cost-pdf-fallback {
  display: none;
}

.project-cost-pdf-thumb.has-document .project-cost-pdf-fallback {
  display: none;
}

.project-cost-pdf-thumb.thumb-failed .project-cost-pdf-image {
  display: none;
}

.project-cost-pdf-thumb.has-image.thumb-failed .project-cost-pdf-object {
  display: block;
}

.project-cost-pdf-thumb.has-image.thumb-failed .project-cost-pdf-fallback {
  display: block;
}

.project-cost-pdf-fallback {
  position: relative;
  z-index: 1;
}

.project-cost-pdf-thumb.is-empty {
  color: var(--muted);
  font-weight: 700;
}

.project-cost-construction-info {
  min-width: 0;
}

.project-cost-construction input[data-cost-construction] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.project-cost-construction-title {
  display: flex;
  gap: 6px;
  align-items: baseline;
  min-width: 0;
}

.project-cost-construction-title strong,
.project-cost-construction-name {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-construction-name {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.project-cost-construction-name:hover {
  color: var(--brand);
  text-decoration: underline;
}

.project-cost-construction-title em,
.project-cost-construction small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-construction-title em {
  flex: 0 1 auto;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.project-cost-construction small {
  color: var(--muted);
  font-size: 11px;
}

.project-cost-construction-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 8px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.project-cost-construction-profile {
  display: block;
  margin-top: 7px;
}

.project-cost-construction-profile select {
  width: 100%;
}

.project-cost-construction-toggle {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--button-radius);
  background: var(--surface);
  color: var(--navy);
  font-weight: 900;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.project-cost-construction-toggle:hover {
  background: #f3f6fb;
}

.project-cost-construction-toggle-icon::before {
  content: ">";
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  transform-origin: center;
  transition: transform 0.16s ease;
}

.project-cost-construction-toggle[aria-expanded="true"] .project-cost-construction-toggle-icon::before {
  transform: rotate(90deg);
}

.project-cost-construction-mini {
  padding: 8px 9px 9px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

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

.project-cost-summary-grid div {
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.project-cost-summary-grid span,
.project-cost-summary-grid strong {
  display: block;
}

.project-cost-summary-grid span {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
}

.project-cost-summary-grid strong {
  font-size: 12px;
}

[data-route-rows],
.project-cost-route-grid {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.project-cost-route-head,
.project-cost-route-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 130px minmax(190px, 1.2fr) 90px 34px;
  gap: 6px;
  align-items: center;
}

.project-cost-route-head {
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.project-cost-route-row input,
.project-cost-route-row select {
  min-width: 0;
}

.project-cost-compact-grid {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.project-cost-grid-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.project-cost-extra-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 10px;
}

.project-cost-subpanel {
  min-width: 0;
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  padding: 8px;
}

.project-cost-subpanel.full {
  grid-column: 1 / -1;
}

.project-cost-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.project-cost-subhead span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: right;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.project-cost-line-head,
.project-cost-line-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 80px 100px 34px;
  gap: 6px;
  align-items: center;
}

.project-cost-line-head {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0 4px 4px;
}

.project-cost-line-row + .project-cost-line-row {
  margin-top: 5px;
}

.project-cost-line-row input,
.project-cost-line-row select {
  min-width: 0;
}

.project-cost-manual {
  margin-top: 8px;
}

.project-cost-scope-panel {
  min-height: 0;
  overflow: hidden;
}

.project-cost-scope-panel .project-cost-construction-list {
  min-height: 0;
  max-height: calc(100dvh - 330px);
  overflow: auto;
  padding-right: 2px;
}

.project-cost-summary-panel {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--surface);
}

.modal.project-costs-modal .project-cost-summary-panel {
  position: static;
  display: grid;
  align-content: start;
  gap: 0;
  padding: 10px;
}

.project-cost-category-panel {
  min-width: 0;
}

.project-cost-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
  gap: 8px;
  align-items: start;
}

.project-cost-category-slot {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.project-cost-category-card {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--button-radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.project-cost-category-card:hover {
  background: #f3f6fb;
}

.project-cost-category-card.is-active {
  border-color: var(--navy);
  background: #eef3fb;
  color: var(--navy);
  box-shadow: inset 0 -3px 0 var(--navy);
}

.project-cost-category-card .icon {
  color: var(--navy);
}

.project-cost-category-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.project-cost-category-copy strong,
.project-cost-category-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-category-copy strong {
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}

.project-cost-category-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
}

.project-cost-category-margin {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-height: 36px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.project-cost-category-margin.is-placeholder {
  visibility: hidden;
}

.project-cost-category-margin-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 34px;
  justify-items: center;
  gap: 2px;
  margin: 0;
  color: var(--navy);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.project-cost-category-margin-switch input[type="hidden"],
.project-cost-category-margin-switch input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.project-cost-category-margin-switch > span {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.15s ease;
}

.project-cost-category-margin-switch > span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.22);
  transition: transform 0.15s ease;
}

.project-cost-category-margin-switch input[type="checkbox"]:checked + span {
  background: #2563eb;
}

.project-cost-category-margin-switch input[type="checkbox"]:checked + span::after {
  transform: translateX(16px);
}

.project-cost-category-margin-switch em {
  font-style: normal;
}

.project-cost-category-margin-input {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(58px, auto) minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  margin: 0;
}

.project-cost-category-margin-input span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.project-cost-category-margin-input input {
  width: 100%;
  min-width: 0;
  height: 26px;
  min-height: 26px;
  padding: 3px 6px;
}

.project-cost-editor-stack {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.project-cost-editor-stack.is-tabbed [data-project-cost-editor-panel] {
  display: none;
}

.project-cost-editor-stack.is-tabbed [data-project-cost-editor-panel].is-active-tab {
  display: grid;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: auto;
}

.project-cost-editor-section {
  min-width: 0;
  min-height: 0;
  align-content: start;
}

.project-cost-editor-section > summary.project-cost-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 9px 10px;
  margin: -10px -10px 10px;
  border-bottom: 1px solid var(--line);
  cursor: default;
  list-style: none;
  background: var(--surface-strong);
}

.project-cost-editor-section > summary.project-cost-editor-head::-webkit-details-marker {
  display: none;
}

.project-cost-editor-head span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.project-cost-editor-head strong,
.project-cost-editor-head small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-editor-head strong {
  font-size: 13px;
  font-weight: 900;
}

.project-cost-editor-head small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.project-cost-editor-head b {
  white-space: nowrap;
}

.project-cost-step-body {
  min-width: 0;
}

.project-cost-tab-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.project-cost-tab-workbench:has(.project-cost-tab-side),
.project-cost-tab-workbench:has(.project-cost-transport-advice-panel) {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
}

.project-cost-tab-main,
.project-cost-tab-side {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

.project-cost-summary-vat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(94px, auto);
  gap: 8px;
  align-items: end;
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--line);
}

.project-cost-vat-switch {
  position: relative;
  display: grid;
  grid-template-columns: 34px auto auto;
  gap: 7px;
  align-items: center;
  min-width: 0;
  margin: 0;
  font-weight: 900;
}

.project-cost-vat-switch input[type="hidden"],
.project-cost-vat-switch input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.project-cost-vat-slider {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #cbd5e1;
}

.project-cost-vat-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.22);
  transition: transform 0.15s ease;
}

.project-cost-vat-switch input[type="checkbox"]:checked + .project-cost-vat-slider {
  background: #2563eb;
}

.project-cost-vat-switch input[type="checkbox"]:checked + .project-cost-vat-slider::after {
  transform: translateX(16px);
}

.project-cost-vat-switch em {
  color: var(--navy);
  font-style: normal;
}

.project-cost-vat-rate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  gap: 5px;
  align-items: center;
  margin: 0;
}

.project-cost-vat-rate span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-cost-vat-rate input {
  width: 78px;
  text-align: center;
}

.project-cost-vat-rate small {
  font-size: 11px;
  font-weight: 900;
}

.project-cost-results-compact {
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.project-cost-total-result {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 78px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #2f6da6;
  color: #ffffff;
}

.project-cost-total-result span,
.project-cost-total-result small {
  font-weight: 900;
}

.project-cost-total-result strong {
  min-width: 0;
  overflow: hidden;
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-result-section-title {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-cost-project-line,
.project-cost-result-empty {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 36px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.project-cost-project-line span,
.project-cost-project-line strong,
.project-cost-project-line small,
.project-cost-result-empty {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-project-line span {
  font-weight: 900;
}

.project-cost-project-line strong {
  text-align: right;
}

.project-cost-project-line small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.project-cost-project-line.is-hidden {
  display: none;
}

.project-cost-result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  overflow: hidden;
}

.project-cost-result-card > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 36px;
  padding: 7px 8px;
  cursor: pointer;
  list-style: none;
}

.project-cost-result-card > summary::-webkit-details-marker {
  display: none;
}

.project-cost-result-card > summary span,
.project-cost-result-card > summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-result-card > summary span {
  font-weight: 900;
}

.project-cost-result-detail {
  display: grid;
  gap: 5px;
  padding: 0 8px 8px;
}

.project-cost-result-detail div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.project-cost-result-detail span,
.project-cost-result-detail strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-result-detail strong {
  color: var(--text);
}

.project-cost-flowbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 0 2px;
  background: var(--surface-muted);
}

.project-cost-flowbar a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.project-cost-flowbar a:hover {
  border-color: var(--brand);
  background: #f8fbff;
}

.project-cost-flowbar span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eaf2fb;
  color: var(--brand);
  font-size: 10px;
  font-weight: 900;
}

.project-cost-flowbar strong,
.project-cost-flowbar em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-flowbar strong {
  font-size: 12px;
}

.project-cost-flowbar em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.project-cost-kpi-strip {
  display: grid;
  grid-template-columns: 1fr 1.35fr repeat(3, 1fr);
  gap: 8px;
}

.project-cost-kpi-strip div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.project-cost-kpi-strip span,
.project-cost-kpi-strip strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-kpi-strip span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-cost-kpi-strip strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.project-cost-workflow-panel {
  display: grid;
  gap: 10px;
}

.project-cost-mode-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 300px);
  gap: 10px;
  align-items: stretch;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #f8fafc;
}

.project-cost-mode-row .project-cost-subhead {
  grid-column: 1 / -1;
  margin: 0;
}

.project-cost-mode-check {
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.project-cost-mode-check strong {
  color: var(--text);
  font-size: 12px;
}

.project-cost-manual-inline {
  margin: 0;
}

.project-cost-manual-inline .currency-field {
  margin-top: 3px;
}

.project-cost-address-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}

.project-cost-address-panel .project-cost-address-grid {
  margin: 0;
}

.project-cost-route-options-panel {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  overflow: hidden;
}

.project-cost-route-options-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.project-cost-route-options-panel summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-cost-route-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 8px;
  padding: 8px;
  border-top: 1px solid var(--border);
}

.project-cost-route-hgv {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
  padding-top: 2px;
}

.project-cost-route-grid {
  margin-top: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.project-cost-route-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.project-cost-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.project-cost-route-toolbar strong {
  font-size: 12px;
  font-weight: 850;
}

.project-cost-route-head,
.project-cost-route-row {
  grid-template-columns: minmax(190px, 1.15fr) minmax(230px, 1.1fr) minmax(150px, 0.75fr) 34px;
  grid-template-rows: auto;
}

.project-cost-route-head {
  grid-template-columns: minmax(190px, 1.15fr) minmax(230px, 1.1fr) minmax(150px, 0.75fr) 34px;
}

.project-cost-route-head span:nth-child(2) {
  display: block;
}

.project-cost-route-head span:nth-child(3) {
  grid-column: 3 / 4;
}

.project-cost-route-head span:nth-child(4) {
  grid-column: 4 / 5;
}

.project-cost-route-row {
  min-height: 42px;
  align-items: center;
}

.project-cost-route-row,
.project-cost-crew-travel-row {
  --project-cost-route-control-height: 34px;
}

.project-cost-route-row input,
.project-cost-route-row select,
.project-cost-crew-travel-row input,
.project-cost-crew-travel-row select {
  height: var(--project-cost-route-control-height);
  line-height: 1.2;
  box-sizing: border-box;
}

.project-cost-route-row [data-route-name] {
  grid-column: 1 / 2;
  grid-row: 1;
}

.project-cost-route-row [data-route-transport] {
  grid-column: 2 / 3;
  grid-row: 1;
  min-width: 0;
}

.project-cost-route-row [data-action="remove-project-route"] {
  grid-column: 4 / 5;
  grid-row: 1;
  align-self: center;
}

.project-cost-route-row [data-route-mode] {
  display: none;
}

.project-cost-route-numbers {
  display: grid;
  grid-column: 3 / 4;
  grid-row: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto;
  gap: 6px;
  min-width: 0;
}

.project-cost-route-numbers label {
  display: block;
  min-width: 0;
  margin: 0;
}

.project-cost-route-numbers label span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.project-cost-route-numbers input {
  width: 100%;
  min-width: 0;
  padding-inline: 6px;
}

.project-cost-route-scroll {
  display: grid;
  gap: 6px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.project-cost-collapsible {
  display: block;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  overflow: hidden;
}

.project-cost-collapsible > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 8px;
  cursor: pointer;
  list-style: none;
  background: var(--surface-strong);
}

.project-cost-collapsible > summary::-webkit-details-marker {
  display: none;
}

.project-cost-collapsible > summary strong {
  font-size: 12px;
}

.project-cost-collapsible > summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.project-cost-collapsible-body {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.project-cost-mini-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.project-cost-mini-result-grid div {
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
}

.project-cost-mini-result-grid span,
.project-cost-mini-result-grid strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-mini-result-grid span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.project-cost-mini-result-grid strong {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 900;
}

.project-cost-hotel-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, auto);
  gap: 7px;
  align-items: end;
  margin-top: 7px;
}

.project-cost-extra-night {
  min-height: 34px;
  margin: 0;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.project-cost-limit-card {
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
}

.project-cost-limit-card span,
.project-cost-limit-card strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-limit-card span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.project-cost-limit-card strong {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 900;
}

.project-cost-crew-address-grid {
  grid-template-columns: minmax(0, 1fr);
}

.project-cost-crew-travel-scroll {
  display: grid;
  gap: 6px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.project-cost-crew-travel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 124px) 32px;
  gap: 6px;
  padding: 0 5px 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.project-cost-crew-travel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 124px) 32px;
  grid-template-rows: auto auto auto;
  gap: 6px;
  align-items: center;
  min-height: 104px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
  overflow: visible;
}

.project-cost-crew-travel-row input,
.project-cost-crew-travel-row select {
  min-width: 0;
}

.project-cost-crew-travel-row [data-crew-travel-mode] {
  display: none;
}

.project-cost-crew-travel-row [data-crew-travel-name] {
  grid-column: 1 / 2;
  grid-row: 1;
}

.project-cost-crew-travel-row [data-crew-travel-item] {
  grid-column: 1 / 2;
  grid-row: 2;
}

.project-cost-crew-travel-row > [data-crew-travel-manual] {
  grid-column: 1 / 3;
  grid-row: 3;
}

.project-cost-crew-travel-manual-block {
  grid-column: 1 / 3;
  grid-row: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.project-cost-crew-travel-manual-block > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.project-cost-crew-travel-manual {
  min-width: 0;
}

.project-cost-crew-travel-row [data-action="remove-crew-travel-route"] {
  grid-column: 3 / 4;
  grid-row: 1 / 4;
  align-self: center;
}

.project-cost-crew-travel-numbers {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
}

.project-cost-crew-travel-numbers label {
  display: block;
  min-width: 0;
  margin: 0;
}

.project-cost-crew-travel-numbers label span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.project-cost-crew-travel-numbers input {
  width: 100%;
  min-width: 0;
  padding-inline: 6px;
}

.project-cost-transport-load-panel {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid #86efac;
  border-radius: 7px;
  background: #ecfdf3;
}

.project-cost-transport-load-panel > summary {
  cursor: pointer;
  list-style: none;
}

.project-cost-transport-load-panel > summary::-webkit-details-marker {
  display: none;
}

.project-cost-load-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-cost-load-head::before {
  content: ">";
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1px solid #86efac;
  border-radius: 999px;
  color: #047857;
  font-size: 10px;
  font-weight: 900;
  transition: transform 0.15s ease;
}

.project-cost-transport-load-panel[open] > .project-cost-load-head::before {
  transform: rotate(90deg);
}

.project-cost-load-head > strong {
  flex: 1 1 auto;
  min-width: 0;
  color: #064e3b;
  font-size: 12px;
  font-weight: 850;
}

.project-cost-load-head > span {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.project-cost-load-metric,
.project-cost-load-inline {
  color: #047857;
  font-variant-numeric: tabular-nums;
}

.project-cost-load-metric.danger,
.project-cost-load-inline.danger {
  color: #b42318;
}

.project-cost-load-table-wrap {
  overflow: auto;
}

.project-cost-load-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.project-cost-load-table th,
.project-cost-load-table td {
  padding: 5px 6px;
  border-top: 1px solid #bbf7d0;
  text-align: right;
  white-space: nowrap;
}

.project-cost-load-table th:first-child,
.project-cost-load-table td:first-child {
  text-align: left;
}

.project-cost-load-table th {
  color: #065f46;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.project-cost-load-compact-list {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-cost-load-compact-row,
.project-cost-load-compact-empty {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  align-items: center;
  min-width: 0;
  border-top: 1px solid #bbf7d0;
  padding: 5px 0 0;
  color: #064e3b;
  font-size: 10px;
}

.project-cost-load-compact-row strong {
  min-width: 0;
  overflow: hidden;
  color: #064e3b;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-load-compact-row span {
  color: #047857;
  white-space: nowrap;
}

.project-cost-load-compact-row span:first-of-type {
  grid-column: 1 / -1;
  white-space: normal;
}

.project-cost-load-compact-row b {
  color: #047857;
  font-weight: 900;
  white-space: nowrap;
}

.project-cost-transport-advice-panel {
  min-width: 0;
  max-height: min(520px, calc(100dvh - 270px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding: 9px;
  border: 1px solid #86efac;
  border-radius: 7px;
  background: #ecfdf3;
  overflow: hidden;
  align-self: start;
}

.project-cost-transport-advice-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
  padding-bottom: 7px;
  border-bottom: 1px solid #bbf7d0;
}

.project-cost-transport-advice-head span,
.project-cost-transport-advice-head b {
  min-width: 0;
}

.project-cost-transport-advice-head strong,
.project-cost-transport-advice-head small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-cost-transport-advice-head strong {
  color: #064e3b;
  font-size: 12px;
  font-weight: 900;
}

.project-cost-transport-advice-head small {
  color: #047857;
  font-size: 10px;
  font-weight: 800;
}

.project-cost-transport-advice-head b {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-weight: 900;
}

.project-cost-transport-advice-panel .project-cost-load-compact-list {
  overflow: auto;
  padding-right: 2px;
}

.project-cost-bom-detail-list {
  display: grid;
  gap: 10px;
}

.project-cost-bom-construction-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.project-cost-bom-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  background: #eef3fb;
  border-bottom: 1px solid var(--line);
}

.project-cost-bom-detail-row span,
.project-cost-bom-detail-row small,
.project-cost-bom-detail-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-cost-bom-detail-row span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.project-cost-bom-detail-row small {
  grid-column: 1 / 2;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.project-cost-bom-detail-row strong {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.project-cost-bom-steel-summary {
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
}

.project-cost-bom-steel-rule {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.project-cost-bom-steel-rule-head {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.project-cost-bom-steel-rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 7px;
}

.project-cost-bom-steel-rule-tile {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
}

.project-cost-bom-steel-rule-tile span,
.project-cost-bom-steel-rule-tile strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-bom-steel-rule-tile span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-cost-bom-steel-rule-tile strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.project-cost-version-mini-panel {
  min-width: 0;
}

.project-cost-version-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.project-cost-version-table-row {
  display: grid;
  gap: 3px;
  min-width: 0;
  margin: 0;
}

.project-cost-version-table-label {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-cost-version-table-value,
.project-cost-version-table-value input {
  width: 100%;
  min-width: 0;
}

.project-cost-bottom-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(520px, 1.08fr);
  gap: 10px;
  align-items: start;
}

.project-cost-fieldsets {
  display: grid;
  gap: 10px;
}

.project-cost-fieldset {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.project-cost-fieldset > strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.project-cost-two-field-grid {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 8px;
}

.project-cost-extra-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.project-cost-subpanel {
  display: grid;
  gap: 7px;
  padding: 8px;
}

.project-cost-subpanel.full {
  grid-column: auto;
}

.project-cost-line-head,
.project-cost-line-row {
  grid-template-columns: minmax(160px, 1fr) 72px 80px 32px;
}

@media (max-width: 1280px) {
  .modal.project-costs-modal .project-costs-form,
  .project-costs-form {
    grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
  }

  .modal.project-costs-modal .project-cost-top-kpis,
  .project-cost-top-kpis,
  .modal.project-costs-modal .project-costs-results,
  .project-costs-results {
    grid-column: 1 / -1;
  }

  .project-cost-top-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .project-cost-profile-tools {
    grid-column: 1 / -1;
  }

  .project-cost-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .project-cost-bottom-grid,
  .project-cost-tab-workbench:has(.project-cost-tab-side),
  .project-cost-tab-workbench:has(.project-cost-transport-advice-panel),
  .project-cost-address-grid,
  .project-cost-route-options-grid,
  .project-cost-route-hgv,
  .project-cost-mode-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-cost-transport-advice-panel {
    max-height: none;
  }

  .project-cost-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .modal.presentation-options-modal {
    width: calc(100vw - 8px);
    height: calc(100dvh - 8px);
    max-width: calc(100vw - 8px);
    max-height: calc(100dvh - 8px);
  }

  .presentation-configurator-grid {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .presentation-configurator-controls {
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .presentation-configurator-preview {
    min-height: 540px;
    overflow: visible;
  }

  .presentation-preview-canvas {
    min-height: 520px;
  }

  .presentation-preview-head {
    grid-template-columns: 1fr;
  }

  .presentation-preview-head .presentation-page-tabs {
    justify-content: flex-start;
  }

  .presentation-preview-final-header,
  .presentation-preview-page-head,
  .presentation-preview-construction-layout,
  .presentation-preview-canvas[data-gallery-mode="side"] .presentation-preview-construction-layout,
  .presentation-preview-finance-layout,
  .presentation-preview-roi-layout {
    grid-template-columns: 1fr;
  }

  .presentation-preview-title-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .presentation-preview-title-hero,
  .presentation-preview-render-panel {
    height: auto;
    min-height: 280px;
  }

  .presentation-preview-metrics,
  .presentation-preview-finance-kpis,
  .presentation-preview-pop-kpis,
  .presentation-preview-roi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .presentation-preview-construction,
  .presentation-preview-canvas[data-gallery-mode="side"] .presentation-preview-construction {
    grid-template-columns: 1fr;
  }

  .presentation-preview-canvas[data-gallery-mode="side"] .presentation-preview-gallery {
    flex-direction: row;
  }

  .modal.project-costs-modal .project-costs-form,
  .project-costs-form {
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
  }

  .modal.project-costs-modal .project-cost-scope-panel,
  .modal.project-costs-modal .project-cost-center-panel,
  .modal.project-costs-modal .project-costs-results {
    overflow: visible;
  }

  .project-cost-top-kpis,
  .project-cost-category-grid,
  .project-cost-tab-workbench:has(.project-cost-tab-side),
  .project-cost-tab-workbench:has(.project-cost-transport-advice-panel) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-cost-profile-tools,
  .project-costs-results,
  .project-cost-editor-stack,
  .project-cost-tab-main,
  .project-cost-tab-side,
  .project-cost-transport-advice-panel {
    grid-column: 1 / -1;
  }

  .project-cost-flowbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: static;
  }

  .project-cost-scope-panel .project-cost-construction-list {
    max-height: none;
  }
}

@media (max-width: 780px) {
  .presentation-options-summary,
  .presentation-preview-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .presentation-control-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
  }

  .presentation-control-row output {
    text-align: left;
  }

  .presentation-preview-document {
    min-height: auto;
    padding: 12px;
  }

  .presentation-preview-header,
  .presentation-preview-summary {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .presentation-preview-canvas[data-info-position="bottom"] .presentation-preview-info,
  .presentation-preview-info,
  .presentation-preview-finance {
    grid-template-columns: 1fr;
  }

  .modal-backdrop.project-costs-backdrop {
    padding: 4px;
  }

  .modal.project-costs-modal.full-height {
    width: calc(100vw - 8px);
    height: calc(100dvh - 8px);
    max-height: calc(100dvh - 8px);
    border-radius: var(--radius);
  }

  .modal.project-costs-modal .project-cost-calculator-head {
    min-height: 44px;
  }

  .modal.project-costs-modal .project-cost-calculator-head h2 {
    max-width: calc(100vw - 82px);
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .modal.project-costs-modal .project-costs-form,
  .project-costs-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
    overflow: auto;
  }

  .project-cost-top-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .project-cost-profile-tools {
    grid-column: 1 / -1;
  }

  .project-cost-profile-controls {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .project-cost-kpi {
    min-height: 58px;
    padding: 7px 8px;
  }

  .project-cost-kpi strong {
    font-size: 15px;
  }

  .project-cost-design-children {
    padding: 5px;
  }

  .project-cost-construction {
    min-height: 64px;
    padding: 7px 8px;
  }

  .project-cost-construction-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-cost-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .project-cost-category-slot {
    gap: 5px;
  }

  .project-cost-category-card {
    min-height: 56px;
  }

  .project-cost-category-margin {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .project-cost-mobile-panel-slot {
    display: none;
  }

  .project-cost-mobile-panel-slot.has-active-panel {
    display: block;
    grid-column: 1 / -1;
  }

  .project-cost-mobile-panel-slot.has-active-panel .project-cost-editor-section {
    margin-top: 2px;
  }

  .project-cost-editor-stack {
    display: none;
  }

  .project-cost-tab-workbench,
  .project-cost-tab-workbench:has(.project-cost-tab-side),
  .project-cost-tab-workbench:has(.project-cost-transport-advice-panel),
  .project-cost-mode-row,
  .project-cost-address-grid,
  .project-cost-bottom-grid,
  .project-cost-two-field-grid,
  .project-cost-summary-vat,
  .project-cost-route-options-grid,
  .project-cost-route-hgv {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-cost-route-head,
  .project-cost-line-head {
    display: none;
  }

  .project-cost-line-row {
    grid-template-columns: minmax(0, 1fr) 70px 76px 32px;
  }

  .project-cost-version-table,
  .project-cost-route-row,
  .project-cost-crew-travel-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-cost-route-row [data-route-name],
  .project-cost-route-row [data-route-transport],
  .project-cost-route-row .project-cost-route-numbers,
  .project-cost-route-row [data-action="remove-project-route"],
  .project-cost-crew-travel-row [data-crew-travel-name],
  .project-cost-crew-travel-row [data-crew-travel-item],
  .project-cost-crew-travel-row .project-cost-crew-travel-numbers,
  .project-cost-crew-travel-manual-block,
  .project-cost-crew-travel-row [data-action="remove-crew-travel-route"] {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .project-cost-route-numbers,
  .project-cost-crew-travel-numbers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
  }

  .project-cost-crew-travel-manual-block {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-cost-route-row [data-action="remove-project-route"],
  .project-cost-crew-travel-row [data-action="remove-crew-travel-route"] {
    justify-self: end;
  }

  .project-cost-total-result strong {
    font-size: 20px;
  }

  .modal.project-costs-modal .project-cost-footer {
    align-items: stretch;
    gap: 7px;
  }

  .modal.project-costs-modal .project-cost-footer > div {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .modal.project-costs-modal .project-cost-footer .button,
  .modal.project-costs-modal .project-cost-footer .primary-button {
    width: 100%;
    min-width: 0;
    padding: 0 6px;
    font-size: 10px;
    line-height: 1.1;
    text-align: center;
  }
}

.modal.compact-cost-catalog-modal.full-height {
  width: min(960px, calc(100vw - 24px));
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 24px);
}

.compact-catalog-form {
  padding: 12px;
}

.compact-catalog-form .supplier-editor-panel {
  margin: 0;
}

.compact-rich-notes {
  min-height: 150px;
}

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

.calculation-margin-grid .full {
  grid-column: 1 / -1;
}

.project-editor-shell {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(460px, 620px) minmax(360px, 1fr);
  min-height: 0;
  overflow: hidden;
  background: var(--surface-muted);
}

.project-editor-shell-no-chat {
  display: grid;
  grid-template-columns: 1fr;
  overflow: auto;
}

.project-card-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: auto;
  align-content: start;
  padding: 8px 10px;
  background: #f8fafc;
}

.project-create-modal {
  width: min(720px, calc(100vw - 18px));
}

.project-create-modal .project-card-form {
  height: auto;
  max-height: calc(100vh - 128px);
  overflow: auto;
}

.project-card-stack,
.project-status-card {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 6px;
  overflow: visible;
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #ffffff;
  padding: 8px 10px;
}

.project-card-stack {
  grid-template-columns: minmax(0, 1fr);
}

.project-status-card {
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: auto auto;
}

.project-span-2 {
  grid-column: 1 / -1;
}

.project-panel-head {
  display: flex;
  align-items: center;
  grid-column: 1 / -1;
  min-height: 24px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.project-panel-head strong {
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-field-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid #c9d5e8;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  padding: 5px 7px;
}

.project-description-card {
  grid-template-rows: auto auto;
  align-content: start;
  min-height: 0;
}

.project-field-card > span,
.project-card-title-row > span {
  color: #344054;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.project-field-card input,
.project-field-card select,
.project-field-card textarea {
  min-height: 24px;
  border-color: transparent;
  background: transparent;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
}

.project-client-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.project-client-row .button {
  min-height: 24px;
  white-space: nowrap;
}

.project-address-field {
  gap: 7px;
}

.project-address-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.project-address-row input[name="address"] {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 0 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.04);
}

.project-address-row input[name="address"]::placeholder {
  color: #667085;
  font-weight: 700;
}

.project-address-row .button {
  justify-self: end;
  min-height: 40px;
  padding: 0 16px;
  white-space: nowrap;
}

.project-address-status {
  min-height: 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.project-population-panel {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
}

.project-population-panel > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #f1f5f9;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  list-style: none;
}

.project-population-panel > summary::-webkit-details-marker {
  display: none;
}

.project-population-panel > summary::before {
  content: "▸";
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.project-population-panel[open] > summary::before {
  content: "▾";
}

.project-population-panel > summary > span {
  min-width: 0;
}

.project-population-panel > summary > small {
  justify-self: end;
  color: var(--danger);
  font-size: 10px;
  font-weight: 900;
}

.project-population-panel.is-empty > summary {
  border-bottom: 0;
}

.project-population-panel[open].is-empty > summary {
  border-bottom: 1px solid var(--line);
}

.project-population-body {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.modal.project-modal.project-form-only .project-population-body {
  max-height: none;
  overflow: visible;
  padding-bottom: 12px;
  scroll-padding-bottom: 12px;
}

.project-population-meta,
.project-population-empty {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 8px 10px;
}

.project-population-meta span,
.project-population-empty strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.project-population-meta small,
.project-population-empty span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.project-population-empty {
  color: #9a3412;
  background: #fff7ed;
  border-color: #fed7aa;
  font-size: 12px;
  font-weight: 800;
}

.project-population-map-card {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
}

.project-population-map-card > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: #eef7f0;
}

.project-population-map-card > header strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.project-population-map-card > header span {
  justify-self: end;
  max-width: 420px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-align: right;
}

.project-population-map-card.is-empty > header {
  border-bottom: 0;
  background: #fff7ed;
}

.project-population-map {
  position: relative;
  height: clamp(300px, 48vw, 410px);
  min-height: 300px;
  overflow: hidden;
  background: #dbe8d4;
  isolation: isolate;
}

.project-population-map-tiles,
.project-population-map-overlay {
  position: absolute;
  inset: 0;
}

.project-population-map-tiles {
  z-index: 1;
}

.project-population-map-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  max-width: none;
  user-select: none;
}

.project-population-map-overlay {
  z-index: 2;
  pointer-events: none;
}

.project-population-map-boundary-fill {
  fill: rgba(255, 106, 0, 0.14);
  stroke: none;
}

.project-population-map-boundary-halo {
  fill: none;
  stroke: rgba(255, 255, 255, 0.86);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 11;
}

.project-population-map-boundary {
  fill: none;
  stroke: #ff5a00;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5.5;
  filter: drop-shadow(0 1px 0 #ffffff) drop-shadow(0 0 5px rgba(255, 90, 0, 0.78));
}

.project-population-map-ring {
  fill: rgba(0, 91, 187, 0.035);
  stroke: #005fd1;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.project-population-map-label {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(0, 95, 209, 0.35);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16);
  color: #0048a3;
  min-width: 48px;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}

.project-population-map-center {
  position: absolute;
  z-index: 4;
  width: 15px;
  height: 15px;
  transform: translate(-50%, -50%);
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #f97316;
  box-shadow: 0 0 0 2px rgba(154, 52, 18, 0.55), 0 8px 18px rgba(15, 23, 42, 0.24);
  pointer-events: none;
}

.project-population-map-attribution {
  position: absolute;
  right: 6px;
  bottom: 5px;
  z-index: 5;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.88);
  color: #344054;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
}

.project-population-map-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.project-population-city,
.project-population-radius {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
}

.project-population-city.is-empty {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.project-population-city > header,
.project-population-radius > header,
.project-population-section-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: #edf4fc;
}

.project-population-city > header span,
.project-population-section-title span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.project-population-city > header strong,
.project-population-radius > header strong,
.project-population-section-title strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.project-population-city > header b,
.project-population-radius > header span {
  justify-self: end;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.project-population-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.project-population-kpis > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  background: #fbfdff;
}

.project-population-kpis > div:last-child {
  border-right: 0;
}

.project-population-kpis span,
.project-population-age-row span,
.project-population-radius-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.project-population-kpis strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.project-population-kpis small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-population-age-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.project-population-age-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) 90px minmax(118px, auto);
  gap: 10px;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.project-population-age-row:last-child {
  border-bottom: 0;
}

.project-population-age-row.is-child,
.project-population-age-row.is-kid {
  background: #f8fbff;
}

.project-population-age-row.is-teen {
  background: #f9fafb;
}

.project-population-age-row.is-adult {
  background: #f3f4f6;
}

.project-population-age-row b {
  justify-self: end;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.project-population-age-row small {
  justify-self: end;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: right;
}

.project-population-age-divider {
  display: block;
  padding: 7px 10px;
  border-bottom: 1px solid #fed7aa;
  background: #fff7ed;
}

.project-population-age-divider span {
  color: #9a3412;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-population-section-title {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.project-population-section-title span {
  justify-self: end;
  max-width: 420px;
  text-align: right;
  text-transform: none;
}

.project-population-radius-list {
  display: grid;
  gap: 10px;
}

.project-population-radius-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.project-population-radius-summary span {
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.project-population-radius-summary span:last-child {
  border-right: 0;
}

.project-quick-client {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.project-quick-client[hidden] {
  display: none !important;
}

.project-quick-client .primary-button {
  justify-content: center;
}

.project-description-card .rich-editor {
  border-color: transparent;
  background: transparent;
  grid-template-rows: auto auto;
  height: auto;
  min-height: 0;
  /* Wrapper ma przezroczystą ramkę, a clip radius 12px ścinał 1px ramki toolbara/pola na rogach (5px) — bez clipa linie są pełne. */
  border-radius: 0;
  overflow: visible;
}

.project-description-card .rich-toolbar {
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 5px 5px 0 0;
  flex-wrap: wrap;
  overflow: hidden;
}

.project-description-card .rich-toolbar button,
.project-description-card .rich-toolbar select,
.project-description-card .rich-image-button {
  min-height: 24px;
  min-width: 26px;
  padding: 0 6px;
  font-size: 10px;
}

.project-description-card .rich-editable {
  min-height: 112px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 5px 5px;
  background: #ffffff;
  font-size: 12px;
  font-weight: 500;
}

.project-field-card select[multiple] {
  min-height: 108px;
  padding: 4px 0;
}

.project-participants-card {
  position: relative;
  min-height: 0;
  align-content: start;
  grid-template-rows: auto auto;
  padding: 6px 7px;
}

.project-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-card-title-row small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.project-people-picker {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  gap: 5px;
  min-height: 0;
}

.project-people-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 106px;
  gap: 5px;
}

.project-people-tools select,
.project-people-tools input {
  min-width: 0;
  min-height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #ffffff;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
}

.project-user-search {
  position: relative;
  display: grid;
  align-items: center;
  min-width: 0;
}

.project-user-search .icon {
  position: absolute;
  left: 7px;
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
}

.project-user-search input {
  width: 100%;
  padding-left: 8px;
}

.project-participant-selected {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  max-height: 30px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
}

.project-selected-empty {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 5px;
}

.project-participant-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  max-width: 178px;
  min-height: 22px;
  border: 1px solid #c9d5e8;
  border-radius: 999px;
  background: #f8fafc;
  padding: 1px 4px 1px 2px;
  color: #1d2939;
  font-size: 10px;
  font-weight: 850;
}

.project-participant-chip .small-avatar {
  --avatar-size: 18px;
  color: #ffffff;
  font-size: 8px;
}

.project-participant-chip > span {
  min-width: 0;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-participant-chip button {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: var(--danger);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.project-people-grid {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 45;
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-content: start;
  gap: 4px;
  max-height: 148px;
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  padding: 5px;
  border: 1px solid #c9d5e8;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(16, 24, 40, 0.12);
}

.project-people-picker.is-open .project-people-grid,
.project-people-picker:focus-within .project-people-grid {
  display: grid;
}

.project-participant-card {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 28px;
  border: 1px solid #d7e0ed;
  border-radius: 6px;
  background: #ffffff;
  padding: 3px 6px;
  color: #1d2939;
  cursor: pointer;
}

.project-participant-card[hidden] {
  display: none !important;
}

.project-participant-card:hover {
  border-color: #b8c7dc;
  background: #f8fafc;
}

.project-participant-card.is-selected {
  border-color: #9bb8e6;
  background: #f3f7ff;
  box-shadow: inset 3px 0 0 var(--navy);
}

.project-participant-checkbox {
  position: absolute;
  pointer-events: none;
  opacity: 0;
}

.project-participant-card .small-avatar {
  --avatar-size: 22px;
  border-color: #d7e0ed;
  color: #ffffff;
  font-size: 9px;
}

.plan-assignee-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 5px;
  max-height: 118px;
  overflow: auto;
  padding-right: 2px;
}

.user-select-option {
  display: grid;
  grid-template-columns: 16px 24px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 30px;
  border: 1px solid #d7e0ed;
  border-radius: 6px;
  background: #ffffff;
  padding: 3px 6px;
  color: #1d2939;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.user-select-option:hover {
  background: #f8fafc;
  border-color: #b8c7dc;
}

.user-select-option input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.user-select-option .small-avatar {
  --avatar-size: 22px;
  color: #ffffff;
  font-size: 9px;
}

.user-option-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  line-height: 1.05;
}

.user-option-copy strong,
.user-option-copy span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-option-copy strong {
  font-size: 11px;
  font-weight: 900;
}

.user-option-copy span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.project-people-empty {
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  min-height: 44px;
  border: 1px dashed #c9d5e8;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.project-people-empty[hidden] {
  display: none !important;
}

.project-description-card {
  grid-column: auto;
  align-self: start;
  min-height: 0;
  grid-template-rows: auto auto;
}

.project-description-card textarea {
  width: 100%;
  min-height: 104px;
  height: auto;
  font-size: 12px;
  font-weight: 600;
}

.project-chat-panel {
  display: grid;
  grid-template-rows: 38px auto minmax(0, 1fr) auto;
  min-height: 0;
  border-left: 1px solid var(--line-strong);
  background: #f6f8fb;
  color: var(--text);
}

/* === Wątki dyskusyjne: belka w oknie projektu === */
.project-chat-panel.has-thread-rail {
  display: flex;
  grid-template-rows: none;
  min-width: 0;
}

.project-chat-panel.has-thread-rail .project-chat-main {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-rows: 38px auto minmax(0, 1fr) auto;
}

.chat-thread-rail {
  flex: 0 0 172px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line-strong);
  background: #eef3f8;
}

.chat-thread-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 6px 0 10px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
}

.chat-thread-rail-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-thread-item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.chat-thread-item:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.chat-thread-item.is-active { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.chat-thread-item.has-unread { font-weight: 900; }

.chat-thread-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dot, #94a3b8);
}

.chat-thread-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-thread-badge,
.message-hub-thread-child .message-hub-badge {
  flex: 0 0 auto;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger, #c3352b);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-thread-manage {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.chat-thread-manage .icon { width: 12px; height: 12px; }

/* Usuń wątek — tylko własne (custom) */
.chat-thread-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--danger, #c3352b) 40%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--danger, #c3352b) 8%, transparent);
  color: var(--danger, #c3352b);
  cursor: pointer;
}
.chat-thread-delete:hover { background: color-mix(in srgb, var(--danger, #c3352b) 18%, transparent); }
.chat-thread-delete .icon { width: 13px; height: 13px; }

/* === Drzewo wątków w hubie wiadomości === */
.message-hub-tree-row {
  display: flex;
  align-items: stretch;
  gap: 2px;
}

.message-hub-twisty {
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
}

.message-hub-twisty.is-empty { cursor: default; }
.message-hub-twisty .icon { width: 14px; height: 14px; transition: transform 0.12s ease; }
.message-hub-twisty.is-open .icon { transform: rotate(90deg); }
.message-hub-twisty:not(.is-empty):hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }

.message-hub-tree-row .message-hub-conversation { flex: 1 1 auto; min-width: 0; }

.message-hub-thread-children {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 1px 0 5px 24px;
  padding-left: 6px;
  border-left: 1px dashed var(--line-strong);
}

.message-hub-thread-child {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.message-hub-thread-child:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.message-hub-thread-child.is-active { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.message-hub-thread-child.has-unread { font-weight: 800; }

.message-hub-thread-child-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.message-hub-thread-child-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.message-hub-thread-child-prev { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: var(--muted); }

.message-hub-add-thread {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 2px;
  padding: 6px 8px;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 7px;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.message-hub-add-thread:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.message-hub-add-thread .icon { width: 13px; height: 13px; }

/* === Modal wątku (zakładanie / osoby) === */
.thread-people-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.thread-people-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.thread-people-option:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.thread-people-option.is-selected { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.thread-people-option input { width: 16px; height: 16px; cursor: pointer; }
.thread-people-name { display: flex; flex-direction: column; line-height: 1.2; }
.thread-people-name small { color: var(--muted); font-size: 10px; }
.thread-people-hint { margin: 0 0 8px; font-size: 11px; }

:root[data-theme="dark"] .chat-thread-rail { background: #161b22; }
:root[data-theme="dark"] .project-chat-panel.has-thread-rail .chat-thread-rail { border-right-color: var(--line); }

.project-chat-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line-strong);
  background: #eef3f8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.project-chat-title span:last-child {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.project-chat-people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px 4px;
}

.small-avatar {
  --avatar-size: 28px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: #1f2937;
  color: #ffffff;
}

.project-people-summary {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.project-people-summary.compact {
  grid-template-columns: auto;
  gap: 0;
  width: max-content;
  overflow: visible;
}

.project-people-summary > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-stack {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  overflow: visible;
}

.avatar-stack .small-avatar {
  --avatar-size: 26px;
  margin-left: 0;
  border: 2px solid #ffffff;
  font-size: 10px;
}

.avatar-stack .small-avatar:first-child {
  margin-left: 0;
}

.tree-table .small-avatar {
  --avatar-size: 20px;
  font-size: 8px;
}

.tree-table .avatar-stack .small-avatar {
  --avatar-size: 18px;
  margin-left: 0;
  border-width: 1px;
  font-size: 8px;
}

.tree-table .project-people-summary {
  gap: 4px;
  min-height: 20px;
  line-height: 1;
  overflow: visible;
}

.avatar-more {
  display: inline-grid;
  place-items: center;
  background: #eef2f7;
  color: #344054;
}

.project-chat-history {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 8px 10px 10px;
}

.project-chat-empty {
  align-self: center;
  justify-self: center;
  max-width: 260px;
  color: var(--muted);
  text-align: center;
}

.chat-message {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
}

.chat-message .small-avatar {
  --avatar-size: 24px;
  font-size: 9px;
}

.chat-message.own {
  grid-template-columns: minmax(0, 1fr) 24px;
}

.chat-message.own .small-avatar {
  grid-column: 2;
}

.chat-message.own .chat-bubble {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  background: #dcfce7;
  color: #123524;
}

.chat-message.is-highlighted .chat-bubble {
  outline: 2px solid rgba(23, 59, 133, 0.3);
  box-shadow: 0 0 0 4px rgba(23, 59, 133, 0.08);
}

.chat-bubble {
  max-width: min(420px, 100%);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #1d2939;
  padding: 7px 8px;
  font-size: 11px;
}

.chat-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
}

.chat-text {
  margin-top: 5px;
  white-space: pre-wrap;
}

/* === Dymki w stylu WhatsApp === */
.project-chat-history {
  gap: 4px;
  padding: 12px 14px 14px;
  background:
    radial-gradient(rgba(12, 18, 34, 0.02) 1px, transparent 1px) 0 0 / 20px 20px,
    #eef1f5;
}

.chat-message {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  max-width: 100%;
}

.chat-message.own {
  flex-direction: row-reverse;
}

.chat-message .small-avatar {
  --avatar-size: 26px;
  align-self: flex-end;
  font-size: 9px;
}

.chat-bubble {
  position: relative;
  max-width: 76%;
  min-width: 56px;
  padding: 6px 9px 4px;
  border: 0;
  border-radius: 12px;
  background: #ffffff;
  color: #1d2939;
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.12);
  font-size: 13px;
}

.chat-message.incoming .chat-bubble {
  border-top-left-radius: 4px;
}

.chat-message.own .chat-bubble {
  background: #d9fdd3;
  color: #0c1f12;
  border-top-right-radius: 4px;
}

.chat-sender {
  margin-bottom: 1px;
  color: #1f6feb;
  font-size: 11px;
  font-weight: 800;
}

.chat-bubble .chat-text {
  margin: 0;
  line-height: 1.35;
  word-break: break-word;
}

.chat-stamp {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin-top: 2px;
  color: rgba(0, 0, 0, 0.42);
  font-size: 10px;
  font-weight: 600;
}

.chat-message.own .chat-stamp {
  color: rgba(7, 94, 33, 0.55);
}

.chat-tick {
  margin-left: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -1.5px;
}

/* Potwierdzenia odczytu: wysłane = szare ✓✓, odczytane = niebieskie ✓✓ */
.chat-tick.is-pending,
.chat-tick.is-sent {
  color: rgba(0, 0, 0, 0.38);
}

.chat-tick.is-read {
  color: #2f9bf6;
}

.small-avatar.has-photo {
  padding: 0;
  overflow: hidden;
}

.small-avatar.has-photo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Toolbar kompozytora */
.chat-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
}

.chat-tool {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.chat-tool:hover {
  background: #eef2f7;
}

.chat-tool b,
.chat-tool i,
.chat-tool s {
  font-size: 13px;
}

.chat-tool-sep {
  width: 1px;
  height: 18px;
  margin: 0 3px;
  background: var(--line-strong);
}

.chat-text blockquote {
  margin: 3px 0;
  padding: 2px 8px;
  border-left: 3px solid rgba(31, 111, 235, 0.5);
  color: rgba(0, 0, 0, 0.66);
}

.chat-text ul.chat-list {
  margin: 3px 0;
  padding-left: 18px;
}

.chat-text ul.chat-list li {
  margin: 1px 0;
}

.chat-text pre.chat-code {
  margin: 3px 0;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(12, 18, 34, 0.08);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.88em;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Dropdown adresatow (czat projektowy) */
.chat-recipient-field {
  position: relative;
  z-index: 40;
  display: grid;
  gap: 6px;
}

.chat-recipient-picker {
  position: relative;
}

.chat-recipient-picker input {
  width: 100%;
}

.chat-recipient-picker .chat-recipient-list {
  position: fixed;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 300px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(12, 18, 34, 0.22);
}

.chat-recipient-picker .chat-recipient-list::-webkit-scrollbar {
  width: 8px;
}

.chat-recipient-picker .chat-recipient-list::-webkit-scrollbar-thumb {
  background: rgba(12, 18, 34, 0.2);
  border-radius: 4px;
}

.chat-recipient-picker .chat-recipient-list.is-collapsed {
  display: none;
}

.chat-recipient-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.chat-recipient-option:hover {
  background: #eef4ff;
}

.chat-recipient-option.is-selected {
  background: #e3edff;
}

.chat-recipient-copy {
  display: grid;
  min-width: 0;
}

.chat-recipient-copy strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-recipient-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-recipient-check {
  color: #2563eb;
  font-size: 13px;
  font-weight: 900;
}

.chat-recipient-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
}

.chat-selected-recipients {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.chat-recipient-empty-chip {
  padding: 4px 2px;
  color: var(--muted);
  font-size: 12px;
}

.chat-recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 6px 2px 2px;
  border-radius: 999px;
  background: #e3edff;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 700;
}

.chat-recipient-chip .small-avatar {
  --avatar-size: 20px;
  font-size: 8px;
}

.chat-recipient-chip-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-recipient-chip button {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0 !important;
  border: 1px solid color-mix(in srgb, var(--danger, #c3352b) 45%, transparent) !important;
  border-radius: 50% !important;
  background: color-mix(in srgb, var(--danger, #c3352b) 12%, transparent) !important;
  color: var(--danger, #c3352b) !important;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.chat-recipient-chip button:hover {
  border-color: color-mix(in srgb, var(--danger, #c3352b) 70%, transparent) !important;
  background: color-mix(in srgb, var(--danger, #c3352b) 22%, transparent) !important;
  color: var(--danger, #c3352b) !important;
}

.chat-attachments {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.chat-attachment-menu {
  position: relative;
  min-width: 0;
}

.chat-attachment-menu[open] {
  z-index: 80;
}

.chat-attachment {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  border: 1px solid #d7e0ed;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  padding: 4px 6px;
  font: inherit;
  text-align: left;
  text-decoration: none;
  list-style: none;
  cursor: pointer;
}

.chat-attachment::-webkit-details-marker {
  display: none;
}

.chat-attachment:hover,
.chat-attachment-menu[open] .chat-attachment {
  border-color: #b7c7dd;
  background: rgba(255, 255, 255, 0.48);
}

.chat-attachment.missing {
  color: var(--muted);
}

.chat-attachment.missing:hover {
  color: var(--danger);
  background: #fff7f6;
}

.chat-attachment img {
  width: 34px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
}

.chat-attachment-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 90;
  display: grid;
  min-width: 94px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.16);
}

.chat-attachment-action {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 28px;
  border: 0;
  background: #ffffff;
  color: var(--navy);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.chat-attachment-action + .chat-attachment-action {
  border-top: 1px solid var(--line);
}

.chat-attachment-action:hover {
  background: #eef4ff;
}

.project-chat-compose {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--line-strong);
  background: #eef3f8;
  overflow: visible;
}

.project-chat-compose textarea {
  width: 100%;
  min-height: 44px;
  border-color: var(--line-strong);
  background: #ffffff;
  font-size: 11px;
  resize: vertical;
}

/* Stary blok pickera adresatow usuniety - zastapiony nowymi regulami wyzej (.chat-recipient-* + fixed dropdown). */

.chat-recipient-option .small-avatar {
  --avatar-size: 26px;
  font-size: 9px;
}

.chat-recipient-line {
  margin-top: 3px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
}

.user-list-empty {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px dashed #c9d5e8;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.chat-pending-files:empty {
  display: none;
}

.chat-pending-files {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #f8fafc;
  padding: 7px;
}

.chat-pending-head,
.chat-pending-file {
  display: grid;
  align-items: center;
  gap: 6px;
}

.chat-pending-head {
  grid-template-columns: minmax(0, 1fr) auto;
  color: #475467;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-pending-head .ghost-button {
  min-height: 22px;
  color: #344054;
}

.chat-pending-list {
  display: grid;
  gap: 5px;
}

.chat-pending-file {
  grid-template-columns: 18px minmax(0, 1fr) auto 24px;
  min-height: 30px;
  border-radius: 5px;
  background: #ffffff;
  color: #1d2939;
  padding: 4px 5px;
}

.chat-pending-name {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-pending-size {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.chat-pending-file .square-button {
  width: 22px;
  min-width: 22px;
  min-height: 22px;
}

.project-chat-compose-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.chat-file-button {
  background: #ffffff;
}

.notification-button {
  position: relative;
}

.notification-button.has-unread {
  border-color: #ef4444;
  background: #fef2f2;
}

.notification-count,
.chat-row-count {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  background: #f59e0b;
  color: #111827;
  font-size: 10px;
  font-weight: 700;
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(239, 68, 68, 0.25);
  animation: notif-pulse 1.8s ease-in-out infinite;
}

@keyframes notif-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}

.chat-notification-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 36px));
}

.chat-notification {
  display: grid;
  gap: 10px;
  border: 1px solid #c9d5e8;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  box-shadow: var(--shadow);
}

.chat-notification-head {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 28px;
  gap: 9px;
  align-items: center;
}

.chat-notification-head strong,
.chat-notification-head span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-notification-head span {
  color: var(--muted);
  font-size: 11px;
}

.chat-notification p {
  margin: 0;
  color: #344054;
}

.chat-notification-reply {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
}

.modal.messages-modal {
  width: min(780px, 100%);
}

.modal.message-hub-modal {
  width: min(1120px, 100%);
  height: calc(100vh - 14px);
  max-height: calc(100vh - 14px);
  display: flex;
  flex-direction: column;
}

.message-hub-modal > header {
  flex: 0 0 auto;
}

.message-hub {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.message-hub-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line-strong);
  background: #f6f8fb;
}

.message-hub-tools {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line-strong);
}

.message-hub-scope {
  display: inline-flex;
  gap: 4px;
}

.message-hub-scope button {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.message-hub-scope button.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.message-hub-search {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

.message-hub-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 10px 0;
  border-bottom: 1px solid var(--line-strong);
}

.message-hub-tabs button {
  flex: 1;
  padding: 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.message-hub-tabs button.is-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.message-hub-new {
  width: 100%;
  justify-content: center;
}

.message-hub-subhead {
  padding: 8px 12px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.message-hub-person {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.message-hub-person:hover {
  background: #eef4ff;
}

.message-hub-person-copy {
  display: grid;
  min-width: 0;
}

.message-hub-person-copy strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-hub-person-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-hub-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 12px 4px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #f1f5fb;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.message-hub-section-head.is-static {
  cursor: default;
}

.message-hub-section-unread {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-style: normal;
}

.message-hub-chevron {
  color: var(--muted);
  font-size: 11px;
}

.message-hub-conv-list {
  max-height: 42vh;
  overflow-y: auto;
}

.message-hub-empty.small {
  padding: 12px;
  font-size: 12px;
}

.message-hub-contact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.message-hub-contact:hover {
  background: #eef4ff;
}

.message-hub-contact.is-active {
  background: #e3edff;
}

.message-hub-contact-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.message-hub-contact-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.message-hub-contact-top strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-hub-contact.has-unread .message-hub-contact-top strong {
  font-weight: 900;
}

.message-hub-contact-top time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.message-hub-contact-prev {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-hub-contact.has-unread .message-hub-contact-prev {
  color: #344054;
  font-weight: 700;
}

.chat-recipient-fixed {
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  font-size: 11px;
}

.chat-recipient-to strong {
  font-weight: 800;
}

.chat-emoji-popover {
  position: absolute;
  left: 8px;
  bottom: 52px;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  width: min(300px, calc(100% - 16px));
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(12, 18, 34, 0.22);
}

.chat-emoji-popover[hidden] {
  display: none;
}

.chat-emoji {
  padding: 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.chat-emoji:hover {
  background: #eef4ff;
}

.chat-emoji-btn {
  font-size: 16px;
}

.chat-text code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(12, 18, 34, 0.08);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9em;
}

.chat-text a {
  color: #2563eb;
  text-decoration: underline;
  word-break: break-word;
}

.chat-message.is-pending {
  opacity: 0.6;
}

.chat-message.is-failed .chat-bubble {
  outline: 1px solid #ef4444;
}

.chat-failed-note {
  margin-top: 4px;
  color: #ef4444;
  font-size: 10px;
  font-weight: 800;
}

.message-hub-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.message-hub-tree-node { min-width: 0; max-width: 100%; }
.message-hub-tree-row { min-width: 0; max-width: 100%; }
.message-hub-conv-meta time { flex: 0 0 auto; white-space: nowrap; }

.message-hub-conversation {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.message-hub-conversation:hover {
  background: #eef4ff;
}

.message-hub-conversation.is-active {
  background: #e3edff;
}

.message-hub-conversation.has-unread strong {
  font-weight: 900;
}

.message-hub-conv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.message-hub-conv-prev,
.message-hub-conv-meta { min-width: 0; }

.message-hub-conv-top strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-hub-badge {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.message-hub-conv-prev {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-hub-conv-prev em {
  color: #344054;
  font-style: normal;
  font-weight: 700;
}

.message-hub-conv-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.message-hub-conv-meta time {
  color: var(--muted);
  font-size: 11px;
}

.message-hub-thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.message-hub-thread .project-chat-panel {
  height: 100%;
  min-height: 0;
  border-left: 0;
}

.message-hub-placeholder,
.message-hub-empty {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .modal.message-hub-modal {
    height: min(90vh, 780px);
  }

  .message-hub {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(120px, 38%) minmax(0, 1fr);
  }

  .message-hub-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }
}

.message-center {
  display: grid;
  gap: 12px;
  max-height: min(70vh, 720px);
  overflow: auto;
  padding: 14px;
  background: var(--surface-muted);
}

.message-project-group {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.message-project-group h3 {
  margin: 0;
  color: #102a63;
  font-size: 14px;
}

.message-sender-group {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.message-sender-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  font-weight: 900;
}

.message-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 7px 8px;
}

.message-row.unread {
  border-color: #b9cdf3;
  background: #eef4ff;
  font-weight: 900;
}

.message-row.read {
  background: #f8fafc;
  color: #344054;
  font-weight: 500;
}

.message-unread-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: transparent;
}

.message-row.unread .message-unread-dot {
  background: #2563eb;
}

.message-row-copy {
  display: grid;
  min-width: 0;
}

.message-row-copy strong,
.message-row-copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-row.read .message-row-copy strong {
  font-weight: 500;
}

.message-row.unread .message-row-copy strong {
  font-weight: 900;
}

.message-row-copy span {
  color: var(--muted);
  font-size: 11px;
}

.message-center-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  font-weight: 800;
}

.modal.design-modal {
  width: min(1280px, calc(100vw - 24px));
}

.modal.design-modal.full-height {
  height: calc(100vh - 24px);
  max-height: calc(100vh - 24px);
}

.modal.offer-modal {
  width: min(1280px, 100%);
}

.modal header,
.modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.modal footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.modal header h2 {
  margin: 0;
  font-size: 15px;
}

.modal form {
  padding: 10px;
}

.modal-form {
  padding: 10px;
}

.modal input,
.modal select,
.modal textarea {
  min-height: 28px;
  padding: 4px 7px;
}

.modal textarea {
  min-height: 72px;
}

.modal .currency-field input {
  padding-right: 48px;
}

.modal .currency-field.has-currency-select input {
  padding-right: 9px;
}

.modal .button,
.modal .primary-button,
.modal .ghost-button,
.modal .danger-button,
.modal .upload-button {
  min-height: 32px;
  padding: 0 10px;
}

.modal .icon-button {
  width: 32px;
  min-height: 32px;
}

.modal .form-panel {
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
}

.modal .premium-modal-form {
  gap: 10px;
}

.modal .form-grid {
  gap: 8px;
}

.modal .form-panel-head h3 {
  font-size: 12px;
}

.modal .form-panel-head span,
.modal .field label,
.modal .tiny,
.modal .muted {
  font-size: 10px;
}

.modal .large-textarea {
  min-height: 96px;
}

.modal .design-notes-area {
  min-height: 180px;
}

.modal .offer-rich-notes,
.modal .task-rich-notes,
.modal .production-rich-notes,
.modal .catalog-rich-notes {
  min-height: 120px;
}

.modal .context-tabs {
  padding: 6px 14px 0;
}

.modal .context-tab {
  min-height: 32px;
  padding: 0 10px;
  font-size: 10px;
}

.modal.planning-modal .planning-form {
  align-content: start;
  gap: 8px;
  padding: 8px 12px 10px;
}

.modal.planning-modal .planning-panel {
  align-self: start;
  align-content: start;
  gap: 8px;
  padding: 8px;
}

.modal.planning-modal .planning-construction-panel {
  gap: 6px;
  padding: 6px;
}

.modal.planning-modal .planning-context-tabs {
  gap: 2px;
  padding: 4px 10px 0;
}

.modal.planning-modal .planning-context-tabs .context-tab {
  min-height: 28px;
  max-width: 150px;
  padding: 0 8px;
  font-size: 10px;
}

.modal.planning-modal .planning-context-tabs .context-tab:first-child {
  max-width: 210px;
}

.modal .form-grid.planning-project-grid {
  grid-template-columns: minmax(150px, 0.55fr) minmax(136px, 0.42fr) minmax(136px, 0.42fr) minmax(430px, 1.35fr);
  gap: 6px;
}

.modal.planning-modal .technical-bom-panel {
  gap: 6px;
  margin-top: 0;
  padding: 6px;
}

.form-grid {
  align-items: stretch;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full {
  grid-column: 1 / -1;
}

.modal.material-modal {
  display: flex;
  flex-direction: column;
  width: min(1080px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 32px));
  overflow: hidden;
}

.modal.material-modal header,
.modal.material-modal footer {
  flex: 0 0 auto;
  padding: 10px 14px;
}

.modal.material-modal form {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px 14px;
}

.material-card-form {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr) 326px;
  gap: 14px;
  align-items: start;
}

.material-main-card,
.material-side-card,
.material-metric-card,
.material-photo-card {
  min-width: 0;
}

.material-main-card {
  display: grid;
  gap: 9px;
}

.material-photo-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px;
  border: 1px solid #d6e0ee;
  border-radius: var(--radius);
  background: #f8fafc;
}

.material-photo-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid #cad6e6;
  border-radius: var(--radius);
  background: #ffffff;
}

.material-photo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.material-photo-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 1px dashed #b8c7dc;
  border-radius: 5px;
  background: #f1f5f9;
  color: #667085;
  text-align: center;
}

.material-photo-placeholder strong {
  font-size: 11px;
  font-weight: 900;
}

.material-title-grid,
.material-meta-grid,
.material-price-grid,
.material-weight-grid {
  display: grid;
  gap: 8px;
  align-items: end;
}

.material-title-grid {
  grid-template-columns: minmax(0, 1fr) 150px;
}

.material-meta-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.86fr);
}

.material-meta-grid .field:last-child {
  grid-column: 1 / -1;
}

.material-side-card {
  display: grid;
  gap: 10px;
}

.material-metric-card {
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid #d6e0ee;
  border-radius: var(--radius);
  background: #f8fafc;
}

.material-metric-card.primary {
  border-color: #b9c8de;
  background: #f3f7fc;
}

.material-metric-head {
  display: grid;
  gap: 2px;
}

.material-metric-head span {
  color: #344054;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.material-metric-head strong {
  color: #102a63;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
}

.material-price-grid {
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
}

.material-price-grid .full {
  grid-column: 1 / -1;
}

.material-weight-grid {
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 0.72fr);
}

.material-weight-grid .full {
  grid-column: 1 / -1;
}

.material-card-form .field {
  gap: 4px;
}

.material-card-form .field label {
  font-size: 10px;
}

.modal.material-modal input,
.modal.material-modal select {
  min-height: 30px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.modal.block-modal input,
.modal.block-modal select {
  min-height: 30px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.modal.block-modal .catalog-rich-notes {
  min-height: 92px;
}

.modal.block-modal .rich-toolbar {
  padding: 4px;
}

.modal.block-modal .rich-toolbar button,
.modal.block-modal .rich-toolbar select,
.modal.block-modal .rich-image-button {
  min-height: 28px;
}

.modal.material-modal .price-input-group {
  grid-template-columns: minmax(0, 1fr) 74px;
}

.modal.material-modal .rich-toolbar {
  padding: 4px;
}

.modal.material-modal .rich-toolbar button,
.modal.material-modal .rich-toolbar select,
.modal.material-modal .rich-image-button {
  min-height: 24px;
}

.modal.material-modal .material-rich-notes {
  min-height: 154px;
}

.modal.catalog-modal,
.modal.catalog-modal.full-height,
.modal.catalog-modal.material-modal,
.modal.catalog-modal.planning-modal,
.modal.catalog-modal.block-modal.full-height {
  display: flex;
  flex-direction: column;
  width: min(1180px, calc(100vw - 32px));
  height: min(760px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border-radius: 8px;
}

.modal.catalog-modal header,
.modal.catalog-modal footer,
.modal.catalog-modal.material-modal header,
.modal.catalog-modal.material-modal footer {
  flex: 0 0 auto;
  padding: 9px 12px;
}

.modal.catalog-modal > form#catalog-form,
.modal.catalog-modal.material-modal > form#catalog-form,
.modal.catalog-modal.planning-modal > form#catalog-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.modal.catalog-modal.block-modal > form#catalog-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.modal.catalog-modal .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
  align-items: start;
}

.modal.catalog-modal .form-grid .full {
  grid-column: 1 / -1;
}

.modal.catalog-modal.crew-modal,
.modal.catalog-modal.crew-modal.full-height {
  width: min(1440px, calc(100vw - 16px));
  height: calc(100dvh - 8px);
  max-height: calc(100dvh - 8px);
}

.modal.catalog-modal.crew-modal > form#catalog-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.installation-crew-editor-form {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  background: #f8fafc;
}

.crew-editor-side {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.crew-editor-main {
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 8px 10px;
}

.crew-side-card,
.crew-editor-panel {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.crew-editor-panel {
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #ffffff;
  padding: 8px 10px;
}

.crew-side-card.crew-notes-panel {
  align-content: start;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #ffffff;
  padding: 8px;
}

.crew-logo-preview {
  aspect-ratio: 16 / 8;
}

.crew-card-preview {
  min-height: 54px;
}

.modal.catalog-modal.crew-modal .crew-data-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.modal.catalog-modal.crew-modal label {
  font-size: 10px;
}

.modal.catalog-modal.crew-modal input,
.modal.catalog-modal.crew-modal select,
.modal.catalog-modal.crew-modal textarea {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 4px 7px;
  font-size: 11px;
}

.modal.catalog-modal.crew-modal .button,
.modal.catalog-modal.crew-modal .primary-button,
.modal.catalog-modal.crew-modal .upload-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.modal.catalog-modal.crew-modal .crew-rates-panel {
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
}

.modal.catalog-modal.crew-modal .crew-rates-panel .table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.modal.catalog-modal.crew-modal .crew-rates-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}

.modal.catalog-modal.crew-modal .crew-rates-table th,
.modal.catalog-modal.crew-modal .crew-rates-table td {
  padding: 4px 5px;
}

.modal.catalog-modal.crew-modal .crew-rates-table th {
  background: #f8fafc;
  color: #334155;
  font-size: 9px;
}

.modal.catalog-modal.crew-modal .crew-rates-table th:nth-child(2),
.modal.catalog-modal.crew-modal .crew-rates-table td:nth-child(2) {
  width: 132px;
}

.modal.catalog-modal.crew-modal .crew-rates-table th:nth-child(3),
.modal.catalog-modal.crew-modal .crew-rates-table td:nth-child(3) {
  width: 118px;
}

.modal.catalog-modal.crew-modal .crew-rates-table th:nth-child(4),
.modal.catalog-modal.crew-modal .crew-rates-table td:nth-child(4) {
  width: 96px;
}

.modal.catalog-modal.crew-modal .crew-rates-table th:nth-child(5),
.modal.catalog-modal.crew-modal .crew-rates-table td:nth-child(5) {
  width: 82px;
}

.modal.catalog-modal.crew-modal .crew-rates-table th:last-child,
.modal.catalog-modal.crew-modal .crew-rates-table td:last-child {
  width: 38px;
  text-align: center;
}

.modal.catalog-modal.crew-modal .crew-rates-table input,
.modal.catalog-modal.crew-modal .crew-rates-table select {
  min-height: 26px;
  padding: 3px 6px;
}

.modal.catalog-modal.crew-modal .crew-rates-table .icon-button {
  width: 24px;
  min-width: 24px;
  min-height: 24px;
}

.modal.catalog-modal.crew-modal .crew-rich-notes .rich-editable {
  height: clamp(150px, 28dvh, 260px);
  min-height: 150px;
  max-height: 260px;
  font-size: 11px;
}

.modal.catalog-modal.crew-modal .rich-toolbar {
  gap: 4px;
  min-height: 34px;
  max-height: 66px;
  overflow: hidden;
  padding: 4px;
}

.modal.catalog-modal.crew-modal .rich-toolbar button,
.modal.catalog-modal.crew-modal .rich-toolbar select,
.modal.catalog-modal.crew-modal .rich-image-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 28px;
  min-height: 26px;
  max-width: none;
  padding: 0 7px;
  font-size: 11px;
}

.modal.catalog-modal.crew-modal .rich-toolbar select[data-rich-font-size] {
  width: 74px;
}

.modal.catalog-modal.crew-modal .rich-toolbar select[data-rich-image-size] {
  width: 82px;
}

.modal.catalog-modal .field {
  gap: 4px;
}

.modal.catalog-modal .field label,
.modal.catalog-modal .block-side-title,
.modal.catalog-modal .component-table-title,
.modal.catalog-modal .material-metric-head span {
  color: #344054;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.modal.catalog-modal input,
.modal.catalog-modal select,
.modal.catalog-modal textarea,
.modal.catalog-modal.material-modal input,
.modal.catalog-modal.material-modal select,
.modal.catalog-modal.block-modal input,
.modal.catalog-modal.block-modal select {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 500;
}

.modal.catalog-modal .button,
.modal.catalog-modal .primary-button,
.modal.catalog-modal .ghost-button,
.modal.catalog-modal .danger-button,
.modal.catalog-modal .upload-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.modal.catalog-modal .icon-button {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
}

.modal.catalog-modal input:focus,
.modal.catalog-modal select:focus,
.modal.catalog-modal textarea:focus {
  border-color: #98a2b3;
  box-shadow: 0 0 0 2px rgba(16, 24, 40, 0.08);
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  border-color: #98a2b3;
  box-shadow: 0 0 0 2px rgba(16, 24, 40, 0.08);
}

.modal.catalog-modal .rich-editor {
  border-radius: 6px;
}

.modal.catalog-modal .rich-toolbar {
  gap: 4px;
  padding: 4px;
}

.modal.catalog-modal .rich-toolbar button,
.modal.catalog-modal .rich-toolbar select,
.modal.catalog-modal .rich-image-button,
.modal.catalog-modal.material-modal .rich-toolbar button,
.modal.catalog-modal.material-modal .rich-toolbar select,
.modal.catalog-modal.material-modal .rich-image-button,
.modal.catalog-modal.block-modal .rich-toolbar button,
.modal.catalog-modal.block-modal .rich-toolbar select,
.modal.catalog-modal.block-modal .rich-image-button {
  min-width: 28px;
  min-height: 26px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 700;
}

.modal.catalog-modal .rich-editable {
  min-height: 96px;
  font-size: 12px;
  font-weight: 500;
}

.modal.catalog-modal .rich-editable:focus {
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.12);
}

.modal .rich-editable:focus {
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.12);
}

.modal.catalog-modal .catalog-rich-notes,
.modal.catalog-modal .material-rich-notes {
  min-height: 104px;
}

.modal.catalog-modal .user-form-grid {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.modal.catalog-modal .user-photo-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.modal.catalog-modal .user-photo-preview {
  width: 78px;
  height: 78px;
}

.modal.catalog-modal .user-photo-preview .small-avatar {
  --avatar-size: 78px;
  font-size: 18px;
}

.modal.catalog-modal .material-card-form {
  grid-template-columns: 190px minmax(0, 1fr) 280px;
  gap: 12px;
}

.modal.catalog-modal .material-photo-card,
.modal.catalog-modal .material-metric-card,
.modal.catalog-modal .block-editor-panel,
.modal.catalog-modal .block-rule-row {
  border-radius: 6px;
}

.modal.catalog-modal .material-photo-card,
.modal.catalog-modal .material-metric-card {
  padding: 9px;
}

.modal.catalog-modal.material-modal.full-height {
  width: min(1320px, calc(100vw - 16px));
  height: calc(100dvh - 8px);
  max-height: calc(100dvh - 8px);
}

.modal.catalog-modal.material-modal header,
.modal.catalog-modal.material-modal footer {
  padding: 7px 10px;
}

.modal.catalog-modal.material-modal header h2 {
  font-size: 14px;
}

.modal.catalog-modal.material-modal > form#catalog-form {
  overflow: hidden;
  padding: 0;
}

.material-editor-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 318px;
  min-height: 0;
  height: 100%;
  background: #f8fafc;
}

.material-editor-side {
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.material-editor-main {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  overflow: auto;
  padding: 8px 10px;
}

.material-side-section,
.material-editor-panel {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.material-side-section {
  margin-bottom: 9px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.material-side-section:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

.material-editor-panel {
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #ffffff;
  padding: 8px 10px;
}

.material-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.material-panel-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
}

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

.material-summary-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.material-summary-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid #d8e1ef;
  border-radius: 999px;
  background: #f8fafc;
  padding: 0 7px;
  color: #475467;
  font-size: 10px;
  font-weight: 800;
}

.material-summary-strip strong {
  margin-left: 4px;
  color: #102a63;
  font-weight: 900;
}

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

.material-side-two {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr);
  gap: 6px;
}

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

.material-image-tools > * {
  min-width: 0;
  overflow: hidden;
}

.modal.catalog-modal.material-modal .material-photo-preview {
  aspect-ratio: 16 / 8;
}

.modal.catalog-modal.material-modal .field {
  min-width: 0;
  gap: 3px;
}

.modal.catalog-modal.material-modal .field label,
.modal.catalog-modal.material-modal .block-side-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #344054;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.catalog-modal.material-modal input,
.modal.catalog-modal.material-modal select {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 4px 7px;
  font-size: 11px;
}

.modal.catalog-modal.material-modal .button,
.modal.catalog-modal.material-modal .primary-button,
.modal.catalog-modal.material-modal .upload-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.modal.catalog-modal.material-modal .material-metric-card {
  gap: 7px;
  padding: 8px 9px;
}

.modal.catalog-modal.material-modal .material-metric-head {
  gap: 2px;
}

.modal.catalog-modal.material-modal .material-metric-head span {
  font-size: 10px;
  font-weight: 800;
  text-transform: none;
}

.modal.catalog-modal.material-modal .material-metric-head strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.modal.catalog-modal.material-modal .price-line-grid {
  gap: 6px;
}

.modal.catalog-modal.material-modal .material-rich-notes {
  min-height: 136px;
}

.modal.catalog-modal.supplier-modal.full-height {
  width: min(1260px, calc(100vw - 24px));
  height: min(720px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
}

.modal.catalog-modal.supplier-modal header,
.modal.catalog-modal.supplier-modal footer {
  padding: 7px 10px;
}

.modal.catalog-modal.supplier-modal header h2 {
  font-size: 14px;
}

.modal.catalog-modal.supplier-modal > form#catalog-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.supplier-editor-form {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  background: #f8fafc;
}

.supplier-editor-side {
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.supplier-editor-main {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  overflow: auto;
  padding: 8px 10px;
}

.supplier-side-section,
.supplier-editor-panel {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.supplier-side-section {
  margin-bottom: 9px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.supplier-side-section:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

.supplier-editor-panel {
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #ffffff;
  padding: 8px 10px;
}

.supplier-logo-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  border: 1px solid #cad6e6;
  border-radius: 6px;
  background: #ffffff;
}

.logo-preview-click {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
}

.logo-preview-click img,
.supplier-logo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 10px;
}

.logo-preview-click.is-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  border: 1px dashed #b8c7dc;
  border-radius: 5px;
  background: #f1f5f9;
  color: #667085;
  text-align: center;
}

.logo-preview-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #0f2f6b;
  color: #ffffff;
}

.logo-preview-plus .icon {
  width: 18px;
  height: 18px;
  background: #ffffff;
}

.logo-preview-empty-text {
  color: #344054;
  font-size: 10px;
  font-weight: 900;
}

.logo-preview-initials {
  color: #667085;
  font-size: 10px;
  font-weight: 800;
}

.logo-preview-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 22px;
  min-width: 22px;
  min-height: 22px;
  border: 1px solid #fecaca;
  border-radius: 5px;
  background: #fff5f5;
  color: var(--danger);
  padding: 0;
  cursor: pointer;
}

.logo-preview-remove .icon {
  width: 13px;
  height: 13px;
}

.supplier-logo-placeholder {
  display: grid;
  place-items: center;
  gap: 5px;
  width: 100%;
  height: 100%;
  border: 1px dashed #b8c7dc;
  border-radius: 5px;
  background: #f1f5f9;
  color: #667085;
  text-align: center;
}

.supplier-logo-placeholder span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: #0f2f6b;
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
}

.supplier-logo-placeholder strong {
  font-size: 10px;
  font-weight: 900;
}

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

.supplier-logo-tools > * {
  min-width: 0;
  overflow: hidden;
}

.supplier-attachment-tools {
  grid-template-columns: minmax(0, 1fr);
}

.supplier-card-preview {
  display: grid;
  gap: 6px;
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 9px;
}

.supplier-card-preview strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
}

.supplier-card-lines {
  display: grid;
  gap: 3px;
}

.supplier-card-lines span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-owner-card,
.client-contact-stat {
  display: grid;
  gap: 3px;
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #f8fafc;
  padding: 7px;
}

.client-owner-card span,
.client-contact-stat span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
}

.client-owner-card strong,
.client-contact-stat strong {
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-data-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 6px;
  align-items: end;
}

.supplier-data-grid .full {
  grid-column: 1 / -1;
}

.supplier-phone-grid {
  grid-template-columns: minmax(150px, 0.75fr) minmax(0, 1fr);
  gap: 6px;
}

.supplier-contact-list {
  display: grid;
  gap: 6px;
}

.supplier-contact-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(120px, 0.85fr) minmax(160px, 1fr) minmax(130px, 0.85fr) 28px;
  align-items: end;
  gap: 6px;
  min-width: 0;
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #f8fafc;
  padding: 6px;
}

.supplier-contact-row .field {
  min-width: 0;
}

.supplier-contact-remove {
  width: 28px;
  height: 28px;
  align-self: end;
}

.supplier-attachment-list {
  display: grid;
  gap: 5px;
}

.supplier-attachment-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 7px 8px;
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #ffffff;
  padding: 7px 28px 7px 7px;
}

.supplier-attachment-item small {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-attachment-menu {
  position: relative;
  min-width: 0;
}

.supplier-attachment-menu summary {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}

.supplier-attachment-menu summary::-webkit-details-marker {
  display: none;
}

.supplier-attachment-menu summary span {
  border-bottom: 1px dotted #9aa8bd;
}

.supplier-attachment-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 40;
  display: grid;
  min-width: 128px;
  overflow: hidden;
  border: 1px solid #c8d6ea;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.supplier-attachment-dropdown a,
.supplier-attachment-dropdown span {
  padding: 7px 9px;
  color: #0f172a;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.supplier-attachment-dropdown a:hover {
  background: #eef4ff;
}

.supplier-attachment-remove {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 20px;
  min-width: 20px;
  min-height: 20px;
  border: 1px solid #fecaca;
  border-radius: 5px;
  background: #fff5f5;
  color: var(--danger);
  opacity: 0;
  padding: 0;
  transform: translateY(-50%);
  transition: opacity 0.12s ease;
  cursor: pointer;
}

.supplier-attachment-item:hover .supplier-attachment-remove,
.supplier-attachment-remove:focus-visible {
  opacity: 1;
}

.supplier-attachment-remove .icon {
  width: 12px;
  height: 12px;
}

.supplier-price-empty {
  border: 1px dashed #b8c7dc;
  border-radius: 6px;
  background: #f8fafc;
  padding: 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.modal.catalog-modal.supplier-modal .field {
  min-width: 0;
  gap: 3px;
}

.modal.catalog-modal.supplier-modal .field label,
.modal.catalog-modal.supplier-modal .block-side-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #344054;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.catalog-modal.supplier-modal input,
.modal.catalog-modal.supplier-modal select {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 4px 7px;
  font-size: 11px;
}

.modal.catalog-modal.supplier-modal .button,
.modal.catalog-modal.supplier-modal .primary-button,
.modal.catalog-modal.supplier-modal .upload-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.modal.catalog-modal.supplier-modal .supplier-rich-notes {
  min-height: 124px;
}

.modal.catalog-modal.supplier-modal .rich-toolbar {
  flex-wrap: nowrap;
  align-content: center;
  height: 36px;
  overflow: hidden;
}

.modal.catalog-modal.transport-modal.full-height {
  width: min(1540px, calc(100vw - 20px));
  height: calc(100dvh - 20px);
  max-height: calc(100dvh - 20px);
}

.modal.catalog-modal.transport-modal header,
.modal.catalog-modal.transport-modal footer {
  padding: 7px 10px;
}

.modal.catalog-modal.transport-modal header h2 {
  font-size: 14px;
}

.modal.catalog-modal.transport-modal > form#catalog-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.transport-editor-form {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  background: #f8fafc;
}

.transport-editor-side {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #ffffff;
  padding: 8px 10px;
}

.transport-editor-main {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  overflow: auto;
  padding: 8px 10px;
}

.transport-side-card,
.transport-editor-panel {
  display: grid;
  min-width: 0;
  gap: 7px;
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #ffffff;
  padding: 8px 10px;
}

.transport-side-card {
  background: #f8fafc;
}

.transport-mode-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  border: 1px solid #bcd0ee;
  border-radius: 999px;
  background: #eef4ff;
  color: #0f2f6b;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 900;
}

.transport-side-card > strong {
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transport-side-card > span,
.transport-summary-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

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

.transport-summary-grid strong {
  color: #0f172a;
  font-size: 11px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.transport-dimension-preview {
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  padding: 8px;
  font-size: 11px;
  font-weight: 900;
}

.transport-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
}

.transport-form-grid .full,
.transport-dimension-fields {
  grid-column: 1 / -1;
}

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

.billing-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
}

.billing-toggle label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.billing-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.billing-toggle label.active {
  background: var(--navy);
  color: #ffffff;
}

.transport-dimension-fields {
  display: grid;
  gap: 4px;
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #f8fafc;
  padding: 7px;
}

.modal.catalog-modal.transport-modal .transport-dimensions-row {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px;
}

.modal.catalog-modal.transport-modal .field {
  min-width: 0;
  gap: 3px;
}

.modal.catalog-modal.transport-modal .field label,
.modal.catalog-modal.transport-modal .block-side-title,
.modal.catalog-modal.transport-modal .transport-group-label,
.modal.catalog-modal.transport-modal .transport-dimensions-row label span {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #344054;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.catalog-modal.transport-modal input,
.modal.catalog-modal.transport-modal select {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 4px 7px;
  font-size: 11px;
}

.modal.catalog-modal.transport-modal .button,
.modal.catalog-modal.transport-modal .primary-button,
.modal.catalog-modal.transport-modal .upload-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.modal.catalog-modal.transport-modal .transport-rich-notes {
  min-height: 132px;
}

.modal.catalog-modal.transport-modal .rich-toolbar {
  flex-wrap: nowrap;
  align-content: center;
  height: 36px;
  overflow: hidden;
}

.modal.catalog-modal.work-service-modal.full-height {
  width: min(1120px, calc(100vw - 24px));
  height: min(680px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
}

.modal.catalog-modal.work-service-modal header,
.modal.catalog-modal.work-service-modal footer {
  padding: 7px 10px;
}

.modal.catalog-modal.work-service-modal header h2 {
  font-size: 14px;
}

.modal.catalog-modal.work-service-modal > form#catalog-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.work-service-editor-form {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  background: #f8fafc;
}

.work-service-editor-side {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #ffffff;
  padding: 8px 10px;
}

.work-service-editor-main {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  overflow: auto;
  padding: 8px 10px;
}

.work-service-side-card,
.work-service-editor-panel {
  display: grid;
  min-width: 0;
  gap: 7px;
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #ffffff;
  padding: 8px 10px;
}

.work-service-side-card {
  background: #f8fafc;
}

.work-service-side-card > strong {
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-service-side-card > span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-service-supplier-preview {
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  padding: 8px;
  font-size: 11px;
  font-weight: 900;
}

.work-service-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
}

.work-service-form-grid .full {
  grid-column: 1 / -1;
}

.modal.catalog-modal.work-service-modal .field {
  min-width: 0;
  gap: 3px;
}

.modal.catalog-modal.work-service-modal .field label,
.modal.catalog-modal.work-service-modal .block-side-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #344054;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.catalog-modal.work-service-modal input,
.modal.catalog-modal.work-service-modal select {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 4px 7px;
  font-size: 11px;
}

.modal.catalog-modal.work-service-modal .button,
.modal.catalog-modal.work-service-modal .primary-button,
.modal.catalog-modal.work-service-modal .upload-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.modal.catalog-modal.work-service-modal .work-service-rich-notes {
  min-height: 140px;
}

.modal.catalog-modal.work-service-modal .rich-toolbar {
  flex-wrap: nowrap;
  align-content: center;
  height: 36px;
  overflow: hidden;
}

.modal .rich-image-button input,
.modal.catalog-modal .rich-image-button input {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  padding: 0;
}

.modal.catalog-modal .block-editor-form {
  grid-template-columns: 300px minmax(0, 1fr);
  background: #f8fafc;
}

.modal.catalog-modal .block-editor-side,
.modal.catalog-modal .block-editor-main {
  padding: 10px;
}

.modal.catalog-modal.block-modal.full-height {
  width: min(1500px, 100%);
  max-width: 100%;
  height: min(920px, 100%);
  max-height: 100%;
}

.modal.catalog-modal.block-modal header,
.modal.catalog-modal.block-modal footer {
  padding: 7px 10px;
}

.modal.catalog-modal.block-modal header h2 {
  font-size: 14px;
}

.modal.catalog-modal.block-modal .block-editor-form {
  grid-template-columns: clamp(360px, 25vw, 440px) minmax(0, 1fr);
  min-height: 0;
  height: 100%;
}

.modal.catalog-modal.block-modal .block-editor-side {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 10px;
}

.modal.catalog-modal.block-modal .block-editor-main {
  align-content: start;
  gap: 8px;
  padding: 8px 10px;
}

.modal.catalog-modal.block-modal .block-editor-panel {
  gap: 7px;
  padding: 8px 10px;
}

.modal.catalog-modal.block-modal .block-side-section {
  gap: 7px;
  margin-bottom: 9px;
  padding-bottom: 9px;
}

.modal.catalog-modal.block-modal .block-panel-head {
  align-items: center;
  min-height: 28px;
  padding-bottom: 6px;
}

.modal.catalog-modal.block-modal .block-panel-head h3 {
  font-size: 12px;
}

.modal.catalog-modal.block-modal .field {
  min-width: 0;
  gap: 3px;
}

.modal.catalog-modal.block-modal .field label {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #344054;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.catalog-modal.block-modal .block-two-field-grid,
.modal.catalog-modal.block-modal .transport-metrics-grid,
.modal.catalog-modal.block-modal .price-line-grid {
  gap: 6px;
}

.modal.catalog-modal.block-modal .block-editor-side .block-two-field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal.catalog-modal.block-modal .block-editor-side .transport-metrics-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal.catalog-modal.block-modal .block-editor-side .transport-dimensions-group,
.modal.catalog-modal.block-modal .block-editor-side .transport-stackable {
  grid-column: 1 / -1;
}

.modal.catalog-modal.block-modal .block-editor-side .transport-dimensions-group {
  padding: 5px;
}

.modal.catalog-modal.block-modal .block-editor-side .transport-dimensions-row input {
  min-height: 25px;
  padding: 3px 5px;
  font-size: 10px;
}

.modal.catalog-modal.block-modal .block-editor-side *,
.modal.catalog-modal.block-modal .block-editor-side *::before,
.modal.catalog-modal.block-modal .block-editor-side *::after {
  max-width: 100%;
}

.modal.catalog-modal.block-modal .block-two-field-grid > *,
.modal.catalog-modal.block-modal .transport-metrics-grid > * {
  min-width: 0;
}

.modal.catalog-modal.block-modal .component-picker {
  grid-template-columns: minmax(0, 0.34fr) minmax(0, 0.66fr);
  gap: 5px;
}

.modal.catalog-modal.block-modal .component-picker-with-mode {
  grid-template-columns: 50px minmax(0, 0.34fr) minmax(0, 0.66fr);
}

.modal.catalog-modal.block-modal .component-table th,
.modal.catalog-modal.block-modal .component-table td {
  height: 26px;
  padding: 2px 5px;
  font-size: 10px;
  line-height: 1.15;
}

.modal.catalog-modal.block-modal .component-table select,
.modal.catalog-modal.block-modal .component-table input {
  min-height: 24px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.15;
}

.modal.catalog-modal.block-modal .component-mode-toggle input {
  width: auto;
  min-height: 0;
  padding: 0;
}

.modal.catalog-modal.block-modal input,
.modal.catalog-modal.block-modal select {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 4px 7px;
  font-size: 11px;
}

.rich-toolbar button,
.rich-toolbar select,
.rich-image-button,
.modal .rich-toolbar button,
.modal .rich-toolbar select,
.modal .rich-image-button,
.modal .project-description-card .rich-toolbar button,
.modal .project-description-card .rich-toolbar select,
.modal .project-description-card .rich-image-button,
.modal.catalog-modal .rich-toolbar button,
.modal.catalog-modal .rich-toolbar select,
.modal.catalog-modal .rich-image-button,
.modal.catalog-modal.supplier-modal .rich-toolbar button,
.modal.catalog-modal.supplier-modal .rich-toolbar select,
.modal.catalog-modal.supplier-modal .rich-image-button,
.modal.catalog-modal.transport-modal .rich-toolbar button,
.modal.catalog-modal.transport-modal .rich-toolbar select,
.modal.catalog-modal.transport-modal .rich-image-button,
.modal.catalog-modal.work-service-modal .rich-toolbar button,
.modal.catalog-modal.work-service-modal .rich-toolbar select,
.modal.catalog-modal.work-service-modal .rich-image-button,
.modal.catalog-modal.block-modal .rich-toolbar button,
.modal.catalog-modal.block-modal .rich-toolbar select,
.modal.catalog-modal.block-modal .rich-image-button {
  flex: 0 0 auto;
  width: auto;
  height: 26px;
  min-width: 28px;
  min-height: 26px;
  max-width: none;
}

.rich-toolbar select,
.modal .rich-toolbar select,
.modal .project-description-card .rich-toolbar select,
.modal.catalog-modal .rich-toolbar select,
.modal.catalog-modal.supplier-modal .rich-toolbar select,
.modal.catalog-modal.transport-modal .rich-toolbar select,
.modal.catalog-modal.work-service-modal .rich-toolbar select,
.modal.catalog-modal.block-modal .rich-toolbar select {
  width: auto;
  min-width: 0;
  padding-right: 22px;
}

.rich-toolbar select[data-rich-font-size],
.modal .rich-toolbar select[data-rich-font-size],
.modal .project-description-card .rich-toolbar select[data-rich-font-size],
.modal.catalog-modal .rich-toolbar select[data-rich-font-size],
.modal.catalog-modal.supplier-modal .rich-toolbar select[data-rich-font-size],
.modal.catalog-modal.transport-modal .rich-toolbar select[data-rich-font-size],
.modal.catalog-modal.work-service-modal .rich-toolbar select[data-rich-font-size],
.modal.catalog-modal.block-modal .rich-toolbar select[data-rich-font-size] {
  width: 74px;
}

.rich-toolbar select[data-rich-image-size],
.modal .rich-toolbar select[data-rich-image-size],
.modal .project-description-card .rich-toolbar select[data-rich-image-size],
.modal.catalog-modal .rich-toolbar select[data-rich-image-size],
.modal.catalog-modal.supplier-modal .rich-toolbar select[data-rich-image-size],
.modal.catalog-modal.transport-modal .rich-toolbar select[data-rich-image-size],
.modal.catalog-modal.work-service-modal .rich-toolbar select[data-rich-image-size],
.modal.catalog-modal.block-modal .rich-toolbar select[data-rich-image-size] {
  width: 82px;
}

.modal.catalog-modal.block-modal .button,
.modal.catalog-modal.block-modal .primary-button,
.modal.catalog-modal.block-modal .upload-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.modal.catalog-modal.block-modal .block-image-preview-large {
  min-height: 260px;
  aspect-ratio: 4 / 3;
}

.modal.catalog-modal.block-modal .block-image-tools {
  gap: 5px;
}

.modal.catalog-modal.block-modal .block-image-tools > * {
  min-width: 0;
  overflow: hidden;
}

.modal.catalog-modal.block-modal .block-image-source {
  padding: 5px 7px;
  font-size: 9px;
}

.modal.catalog-modal.block-modal .block-rule-row {
  gap: 5px;
  padding: 6px;
}

.modal.catalog-modal.block-modal .block-hint-strip {
  gap: 4px;
}

.modal.catalog-modal.block-modal .block-hint-strip span {
  min-height: 17px;
  padding: 0 6px;
  font-size: 8px;
}

.modal.catalog-modal.block-modal .checkbox-line.compact {
  min-height: 24px;
  font-size: 10px;
}

.modal.catalog-modal.block-modal .checkbox-line input {
  width: 14px;
  min-height: 14px;
}

.modal.catalog-modal.block-modal .block-cost-summary span {
  min-height: 22px;
  padding: 0 7px;
  font-size: 10px;
}

.modal.catalog-modal.block-modal .component-table-toolbar {
  min-height: 22px;
}

.modal.catalog-modal.block-modal .component-table .icon-button {
  width: 24px;
  min-width: 24px;
  min-height: 24px;
}

.modal-backdrop.offer-backdrop {
  place-items: stretch;
  padding: 0;
}

.modal.offer-modal.full-height {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  /* !important bije theme-premium .modal { border-radius:18px !important } — okno jest
     pelnoekranowe (rogi przy krawedziach ekranu), wiec zaokraglenie musi byc zerowe. */
  border-radius: 0 !important;
}

.modal.offer-modal header,
.modal.offer-modal footer {
  flex: 0 0 auto;
  padding: 7px 10px;
}

.modal.offer-modal header h2 {
  font-size: 14px;
}

.modal.offer-modal.full-height > .modal-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.modal.offer-modal .offer-builder {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
  background: #f8fafc;
}

.modal.offer-modal .offer-builder-head {
  min-height: 38px;
  padding: 7px 20px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.modal.offer-modal.full-height .offer-builder-head {
  padding-left: 20px;
  padding-right: 20px;
}

.modal.offer-modal .offer-title-total {
  gap: 8px;
  margin-left: 4px;
}

.modal.offer-modal .offer-title-total strong {
  color: #0f172a;
  font-size: 13px;
}

.modal.offer-modal .offer-title-total span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid #b6e2c5;
  border-radius: 999px;
  background: #f0fff4;
  padding: 0 8px;
  color: var(--green);
  font-size: 11px;
}

.modal.offer-modal .offer-builder-head > span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-right: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  padding: 0 8px;
  color: #475467;
  font-size: 10px;
}

.modal.offer-modal .offer-search-layout {
  display: grid;
  grid-template-columns: minmax(220px, 250px) minmax(520px, 0.98fr) minmax(620px, 1.12fr);
  align-items: stretch;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

.modal.offer-modal .offer-filter-panel {
  position: static;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.modal.offer-modal .offer-panel-title {
  gap: 2px;
  padding-bottom: 7px;
}

.modal.offer-modal .offer-panel-title strong {
  color: #0f172a;
  font-size: 12px;
}

.modal.offer-modal .offer-panel-title span {
  font-size: 10px;
}

.modal.offer-modal .offer-filter-card,
.modal.offer-modal .offer-filter-group,
.modal.offer-modal .offer-notes-panel {
  display: grid;
  gap: 6px;
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #f8fafc;
  padding: 8px;
}

.modal.offer-modal .offer-filter-group > strong {
  color: #344054;
  font-size: 10px;
  font-weight: 900;
}

.modal.offer-modal .offer-filter-panel .field {
  min-width: 0;
  gap: 3px;
}

.modal.offer-modal .offer-filter-panel label,
.modal.offer-modal .offer-range-row > span {
  color: #344054;
  font-size: 9px;
  font-weight: 800;
}

.modal.offer-modal input,
.modal.offer-modal select {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 500;
}

.modal.offer-modal .offer-range-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.9fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 5px;
}

.modal.offer-modal .offer-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 8px 10px;
  border-left: 1px solid var(--line);
  background: #f8fafc;
}

.modal.offer-modal .offer-selected-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

.modal.offer-modal .offer-section-title {
  align-items: center;
  min-height: 28px;
}

.modal.offer-modal .offer-section-title h3 {
  color: #0f172a;
  font-size: 12px;
}

.modal.offer-modal .offer-section-title span {
  font-size: 10px;
}

.modal.offer-modal .offer-list,
.modal.offer-modal .offer-selected-panel .offer-list,
.modal.offer-modal .offer-results-panel .offer-list {
  display: grid;
  grid-auto-rows: 158px;
  align-content: start;
  gap: 10px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 0 6px 0 0;
}

.modal.offer-modal .offer-results-panel {
  min-height: 0;
}

.modal.offer-modal .offer-row,
.modal.offer-modal .offer-selected-panel .offer-row,
.modal.offer-modal .offer-results-panel .offer-row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) 34px;
  align-items: stretch;
  gap: 9px;
  height: 158px;
  min-height: 158px;
  max-height: 158px;
  padding: 8px;
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
  position: relative;
}

.modal.offer-modal .offer-row.selected {
  border-color: #b7c7dd;
  background: #ffffff;
  box-shadow: inset 3px 0 0 var(--navy);
}

.modal.offer-modal .offer-thumb-cell {
  display: flex;
  width: 148px;
  min-width: 0;
  height: 140px;
  min-height: 140px;
}

.modal.offer-modal .offer-thumb-card {
  width: 148px;
  height: 140px;
  min-height: 140px;
  max-height: 140px;
  aspect-ratio: auto;
  border-radius: 6px;
  background: #ffffff;
}

.modal.offer-modal .offer-thumb-card.placeholder {
  min-height: 140px;
  border-style: dashed;
  background: #ffffff;
  font-size: 24px;
}

.modal.offer-modal .offer-thumb-card.has-document {
  border-color: #cfd9e8;
  background: transparent;
}

.modal.offer-modal .offer-thumb-card.has-document .pdf-thumb-object {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
  pointer-events: none;
}

.modal.offer-modal .offer-thumb-image,
.modal.offer-modal .offer-thumb-pdf-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: transparent;
}

.modal.offer-modal .offer-thumb-fallback {
  gap: 4px;
  background: #f8fafc;
  color: var(--navy);
}

.modal.offer-modal .offer-thumb-fallback small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.modal.offer-modal .offer-row-main {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  align-content: start;
  gap: 3px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.modal.offer-modal .offer-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding-right: 112px;
}

.modal.offer-modal .offer-card-title {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.modal.offer-modal .offer-card-title strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.offer-modal .offer-card-title span,
.modal.offer-modal .offer-row small {
  overflow: hidden;
  color: #667085;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.offer-modal .offer-row small {
  margin: 0;
  padding-right: 112px;
}

.modal.offer-modal .offer-card-client {
  display: -webkit-box;
  max-height: 24px;
  overflow: hidden;
  color: #475467;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: normal;
  padding-right: 112px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.modal.offer-modal .offer-card-metrics {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) minmax(64px, 0.85fr) minmax(64px, 0.85fr) minmax(74px, 0.9fr);
  gap: 4px;
  margin-top: 2px;
}

.modal.offer-modal .offer-card-metrics > span {
  display: grid;
  gap: 1px;
  min-width: 0;
  min-height: 34px;
  border: 1px solid #d8e1ef;
  border-radius: 5px;
  background: #f8fafc;
  padding: 4px 6px;
  color: #0f172a;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: normal;
}

.modal.offer-modal .offer-card-metrics .offer-metric-capacity,
.modal.offer-modal .offer-card-metrics .offer-metric-count {
  align-content: center;
}

.modal.offer-modal .offer-card-metrics .offer-metric-dimensions {
  grid-column: span 2;
}

.modal.offer-modal .offer-card-metrics .offer-metric-attractions {
  grid-column: span 3;
}

.modal.offer-modal .offer-card-metrics b {
  color: #667085;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.modal.offer-modal .offer-attractions-preview-button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 23px;
  border: 1px solid #c7d7ea;
  border-radius: 4px;
  background: #ffffff;
  color: #1f5f99;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.modal.offer-modal .offer-attractions-inline {
  display: grid;
  grid-template-columns: auto minmax(78px, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.modal.offer-modal .offer-attractions-inline strong {
  display: block;
  min-width: 18px;
  color: #0f172a;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.modal.offer-modal .offer-attractions-preview-button:hover:not(:disabled) {
  border-color: #2b6cb0;
  background: #eff6ff;
}

.modal.offer-modal .offer-attractions-preview-button:disabled {
  color: #98a2b3;
  cursor: default;
  opacity: 0.75;
}

.offer-attractions-popover {
  position: fixed;
  z-index: 5000;
  max-height: min(360px, calc(100vh - 24px));
  border: 1px solid #c7d7ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  color: #0f172a;
  overflow: hidden;
}

.offer-attractions-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #e4eaf3;
  background: #f8fafc;
  padding: 10px 10px 8px;
}

.offer-attractions-popover-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.offer-attractions-popover-head strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offer-attractions-popover-head span {
  color: #667085;
  font-size: 10px;
  font-weight: 800;
}

.offer-attractions-popover-list {
  display: grid;
  gap: 4px;
  max-height: 288px;
  padding: 8px;
  overflow: auto;
}

.offer-attractions-popover-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #e4eaf3;
  border-radius: 6px;
  background: #ffffff;
  padding: 7px 8px;
}

.offer-attractions-popover-row span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offer-attractions-popover-row strong {
  min-width: 24px;
  border-radius: 999px;
  background: #eff6ff;
  padding: 3px 7px;
  color: #1f5f99;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.offer-attractions-popover-list p {
  margin: 0;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.modal.offer-modal .offer-price-tag {
  box-sizing: border-box;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 106px;
  max-width: 100%;
  min-width: 0;
  min-height: 22px;
  border: 1px solid #b6e2c5;
  border-radius: 999px;
  background: #f0fff4;
  padding: 0 6px;
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.offer-modal .offer-row-tags {
  display: none;
}

.modal.offer-modal .offer-row-actions {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 30px minmax(0, 1fr);
  align-content: stretch;
  align-self: stretch;
  justify-items: stretch;
  gap: 5px;
  height: 100%;
  min-width: 0;
  width: 34px;
  padding: 0;
  border: 0;
}

.modal.offer-modal .offer-links {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  width: 100%;
}

.modal.offer-modal .button,
.modal.offer-modal .primary-button {
  min-height: 28px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 700;
}

.modal.offer-modal .offer-links a,
.modal.offer-modal .offer-row-actions .button,
.modal.offer-modal .offer-row-actions .primary-button {
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal.offer-modal .offer-row-actions .offer-action-symbol {
  grid-row: 2;
  align-self: stretch;
  min-height: 0;
  height: 100%;
  border-radius: 6px;
  padding: 0;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.modal.offer-modal .offer-file-empty {
  align-self: start;
  justify-self: stretch;
  display: grid;
  place-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f8fafc;
  font-size: 10px;
  white-space: nowrap;
}

.modal.offer-modal .offer-create-row {
  display: none;
  padding: 6px 6px 0 0;
}

.modal.offer-modal .offer-create-row .primary-button {
  justify-content: center;
  width: 100%;
}

.modal.offer-modal .offer-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.modal.offer-modal .offer-footer-presentation-button {
  border-color: #057a36;
  background: #059b43;
}

.modal.offer-modal .offer-footer-presentation-button:hover:not(:disabled) {
  background: #047f38;
}

.modal.offer-modal .offer-notes-panel {
  margin-top: 0;
  padding-top: 8px;
  border-top: 1px solid #d8e1ef;
}

.modal.offer-modal .offer-notes-editor {
  min-height: 138px;
}

.modal.offer-modal .offer-notes-editor .rich-editable {
  height: 104px;
  min-height: 104px;
  max-height: 104px;
  font-size: 11px;
}

.modal.offer-modal .rich-toolbar {
  flex-wrap: wrap;
  align-content: center;
  gap: 4px;
  min-height: 34px;
  max-height: 66px;
  overflow: hidden;
  padding: 4px;
}

.modal.offer-modal .rich-toolbar button,
.modal.offer-modal .rich-toolbar select,
.modal.offer-modal .rich-image-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 28px;
  min-height: 26px;
  max-width: none;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 600;
}

.modal.offer-modal .rich-toolbar select {
  width: auto;
  min-width: 0;
  padding-right: 22px;
}

.modal.offer-modal .rich-toolbar select[data-rich-font-size] {
  width: 74px;
}

.modal.offer-modal .rich-toolbar select[data-rich-image-size] {
  width: 82px;
}

.modal.design-modal.full-height,
.modal.construction-modal.full-height {
  width: min(1440px, calc(100vw - 16px));
  height: calc(100dvh - 8px);
  max-height: calc(100dvh - 8px);
  border-radius: 8px;
}

.modal.design-modal header,
.modal.design-modal footer,
.modal.construction-modal header,
.modal.construction-modal footer {
  flex: 0 0 auto;
  padding: 7px 10px;
}

.modal.design-modal header h2,
.modal.construction-modal header h2 {
  font-size: 14px;
}

.modal.design-modal.full-height > form,
.modal.construction-modal.full-height > form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.modal.design-modal .context-tabs,
.modal.construction-modal .context-tabs {
  gap: 4px;
  min-height: 39px;
  padding: 5px 12px 0;
  background: #ffffff;
}

.modal.design-modal .context-tab,
.modal.construction-modal .context-tab {
  min-height: 30px;
  max-width: 180px;
  padding: 0 9px;
  font-size: 10px;
}

.modal.design-modal .context-tab-plus,
.modal.construction-modal .context-tab-plus {
  width: 22px;
  height: 22px;
  margin: 4px 6px 4px 0;
}

.modal.design-modal .design-editor-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  background: #f8fafc;
}

.modal.design-modal .design-editor-body {
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 8px 10px;
}

.modal.design-modal .form-panel,
.modal.construction-modal .form-panel {
  gap: 8px;
  padding: 9px;
  border-radius: 6px;
  background: #ffffff;
}

.modal.design-modal .form-panel-head h3,
.modal.construction-modal .form-panel-head h3 {
  font-size: 12px;
}

.modal.design-modal .form-panel-head span,
.modal.construction-modal .form-panel-head span {
  font-size: 10px;
}

.modal.design-modal .design-data-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  min-height: 0;
}

.modal.design-modal .design-fields-card {
  display: grid;
  align-content: start;
  min-width: 0;
}

.modal.design-modal .design-compact-grid,
.modal.construction-modal .design-compact-grid {
  gap: 7px;
}

.modal.design-modal .date-pair {
  gap: 7px;
}

.modal.design-modal input,
.modal.design-modal select,
.modal.construction-modal input,
.modal.construction-modal select {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 500;
}

.modal.design-modal label,
.modal.construction-modal label {
  font-size: 10px;
}

.modal.design-modal .design-calendar-card {
  min-width: 0;
}

.modal.design-modal .design-calendar-card .design-timeline-preview {
  height: 100%;
  min-height: 150px;
  padding: 8px;
}

.modal.design-modal .design-preview-timeline .timeline-label,
.modal.design-modal .design-preview-timeline .timeline-canvas {
  min-height: 48px;
}

.modal.design-modal .design-preview-timeline .timeline-task {
  top: 6px;
  height: 34px;
  padding: 5px 10px;
}

.modal.design-modal .design-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 8px;
  min-height: 0;
}

.modal.design-modal .design-description-panel,
.modal.design-modal .design-attachment-panel {
  align-content: start;
  min-width: 0;
}

.modal.design-modal .design-rich-notes .rich-editable {
  min-height: 126px;
  height: 154px;
  max-height: 154px;
  font-size: 11px;
}

.modal.design-modal .design-attachment-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
}

.modal.design-modal .design-attachment-actions .upload-button,
.modal.design-modal .design-attachment-actions .button,
.modal.construction-modal .upload-button {
  justify-content: center;
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.modal.design-modal .design-attachment-panel .attachment-list {
  max-height: 166px;
  overflow: auto;
}

.modal.design-modal .rich-toolbar,
.modal.construction-modal .rich-toolbar {
  gap: 4px;
  min-height: 34px;
  max-height: 66px;
  overflow: hidden;
  padding: 4px;
}

.modal.design-modal .rich-toolbar button,
.modal.design-modal .rich-toolbar select,
.modal.design-modal .rich-image-button,
.modal.construction-modal .rich-toolbar button,
.modal.construction-modal .rich-toolbar select,
.modal.construction-modal .rich-image-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 28px;
  min-height: 26px;
  max-width: none;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 600;
}

.modal.design-modal .rich-toolbar select,
.modal.construction-modal .rich-toolbar select {
  width: auto;
  min-width: 0;
  padding-right: 22px;
}

.modal.design-modal .rich-toolbar select[data-rich-font-size],
.modal.construction-modal .rich-toolbar select[data-rich-font-size] {
  width: 74px;
}

.modal.design-modal .rich-toolbar select[data-rich-image-size],
.modal.construction-modal .rich-toolbar select[data-rich-image-size] {
  width: 82px;
}

.modal.construction-modal .construction-editor-form {
  display: block;
  background: #f8fafc;
}

.modal.construction-modal .construction-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 8px 10px;
}

.modal.construction-modal .construction-version-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(280px, 0.8fr) 320px;
  align-content: start;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 8px 10px;
}

.modal.construction-modal .construction-main-stack,
.modal.construction-modal .construction-side-stack {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.modal.construction-modal .construction-context-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal.construction-modal .construction-description-panel textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.35;
}

.modal.construction-modal [data-construction-description-counter] {
  color: #0f172a;
  font-weight: 900;
}

.modal.construction-modal [data-construction-description-counter].is-limit {
  color: var(--red);
}

.modal.construction-modal .construction-dimensions-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.modal.construction-modal .readout-grid {
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 0.55fr) minmax(0, 1.7fr);
  gap: 7px;
}

.modal.construction-modal .readout-grid div {
  gap: 2px;
  padding: 7px 8px;
}

.modal.construction-modal .readout-grid span {
  font-size: 9px;
}

.modal.construction-modal .readout-grid strong {
  font-size: 11px;
}

.modal.construction-modal .bom-action-row {
  gap: 6px;
}

.modal.construction-modal .construction-bom-actions {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
}

.modal.construction-modal .bom-action-row span {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.construction-modal .construction-bom-quick-check {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  min-height: 260px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.modal.construction-modal .construction-bom-quick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.modal.construction-modal .construction-bom-quick-head strong {
  color: #344054;
  font-size: 10px;
  white-space: nowrap;
}

.modal.construction-modal .construction-bom-quick-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  max-height: min(360px, 42vh);
  overflow: auto;
}

.modal.construction-modal .construction-bom-quick-row,
.modal.construction-modal .construction-bom-quick-more,
.modal.construction-modal .construction-bom-quick-empty {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
}

.modal.construction-modal .construction-bom-quick-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 6px;
}

.modal.construction-modal .construction-bom-quick-header {
  position: sticky;
  top: 0;
  z-index: 1;
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.modal.construction-modal .construction-bom-quick-header span {
  text-align: center;
}

.modal.construction-modal .construction-bom-quick-row span,
.modal.construction-modal .construction-bom-quick-name-button {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.construction-modal .construction-bom-quick-name-button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.modal.construction-modal .construction-bom-quick-name-button:hover {
  text-decoration-line: underline;
}

.modal.construction-modal .construction-bom-quick-row .construction-bom-quick-qty {
  text-align: center;
}

.modal.construction-modal .construction-bom-quick-row.construction-bom-quick-header span {
  text-align: center;
}

.modal.construction-modal .construction-bom-quick-row.construction-bom-quick-header .construction-bom-quick-name {
  text-align: left;
}

.modal.construction-modal .construction-bom-quick-action {
  display: flex;
  justify-content: flex-end;
  overflow: visible;
}

.modal.construction-modal .bom-comment-button {
  width: 28px;
  min-width: 28px;
  min-height: 24px;
  padding: 0;
  background: #ffffff;
  font-size: 10px;
}

.modal.construction-modal .bom-comment-button.has-comment {
  border-color: #12b76a;
  background: #ecfdf3;
  color: #067647;
}

.modal.construction-modal .construction-bom-quick-row.is-ok {
  border-color: var(--bom-ok-line);
  background: var(--bom-ok-bg);
  color: var(--bom-ok-text);
}

.modal.construction-modal .construction-bom-quick-row.is-legacy {
  border-color: var(--bom-legacy-line);
  background: var(--bom-legacy-bg);
  color: var(--bom-legacy-text);
}

.modal.construction-modal .construction-bom-quick-row.is-legacy .construction-bom-quick-name {
  text-decoration-line: underline;
  text-decoration-color: #2e90fa;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.modal.construction-modal .construction-bom-quick-row.is-warning {
  border-color: var(--bom-warning-line);
  background: var(--bom-warning-bg);
  color: var(--bom-warning-text);
}

.modal.construction-modal .construction-bom-quick-row.is-error {
  border-color: var(--bom-error-line);
  background: var(--bom-error-bg);
  color: var(--bom-error-text);
}

.modal.construction-modal .construction-bom-quick-more,
.modal.construction-modal .construction-bom-quick-empty {
  color: var(--muted);
  background: var(--surface);
}

.modal.construction-modal .construction-pdf-panel {
  align-content: start;
}

.modal.construction-modal .construction-presentation-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
  min-height: 0;
  transition: box-shadow 0.16s ease, outline-color 0.16s ease;
}

.modal.construction-modal .construction-presentation-panel.is-dragover,
.modal.construction-modal .construction-presentation-panel.is-uploading {
  outline: 2px solid #2b6cb0;
  outline-offset: -2px;
  box-shadow: inset 0 0 0 999px rgba(43, 108, 176, 0.08), 0 0 0 3px rgba(43, 108, 176, 0.14);
}

.modal.construction-modal .construction-presentation-panel.is-dragover::after {
  content: "Upusc pliki tutaj";
  position: absolute;
  inset: 44px 10px 10px;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 2px dashed #2b6cb0;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.88);
  color: #1f5f99;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  pointer-events: none;
}

.modal.construction-modal .construction-presentation-upload {
  display: grid;
  gap: 8px;
}

.modal.construction-modal .construction-presentation-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 3px;
  scrollbar-gutter: stable;
}

.modal.construction-modal .construction-presentation-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
  min-height: 74px;
  padding: 6px;
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #ffffff;
}

.modal.construction-modal .construction-presentation-preview {
  display: block;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.modal.construction-modal .construction-presentation-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 62px;
  border: 1px solid #d8e1ef;
  border-radius: 5px;
  background-color: transparent;
  background-image:
    linear-gradient(45deg, rgba(148, 163, 184, 0.22) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.22) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.22) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.22) 75%);
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-size: 12px 12px;
  color: var(--muted);
  object-fit: contain;
  overflow: hidden;
}

.modal.construction-modal .construction-presentation-thumb.is-file {
  background: #f8fafc;
}

.modal.construction-modal .construction-presentation-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.modal.construction-modal .construction-presentation-file-label {
  position: absolute;
  right: 4px;
  bottom: 3px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.82);
  padding: 1px 4px;
  color: #344054;
  font-size: 8px;
  font-weight: 900;
}

.modal.construction-modal .construction-presentation-meta {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.modal.construction-modal .construction-presentation-meta strong,
.modal.construction-modal .construction-presentation-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.construction-modal .construction-presentation-meta strong {
  color: #0f172a;
  font-size: 11px;
}

.modal.construction-modal .construction-presentation-meta small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.modal.construction-modal .construction-presentation-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed #b9c7d8;
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.modal.construction-modal .pdf-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.modal.construction-modal .pdf-thumb {
  width: 100%;
  max-width: 252px;
  justify-self: center;
}

.modal.construction-modal .pdf-thumb-main {
  height: 202px;
}

.modal.construction-modal .pdf-thumb-image {
  height: 168px;
}

.modal-backdrop.editor-backdrop {
  place-items: center;
  padding: 12px;
}

.modal.design-modal.full-height,
.modal.construction-modal.full-height {
  width: min(1600px, calc(100vw - 24px));
  height: calc(100dvh - 24px);
  max-height: calc(100dvh - 24px);
  border-radius: 8px;
}

.modal.design-modal .design-editor-shell,
.modal.construction-modal .construction-editor-form {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  background: #f6f8fb;
}

.modal.design-modal .design-workspace,
.modal.construction-modal .design-workspace {
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #f6f8fb;
}

.modal.construction-modal .design-workspace.no-sidebar {
  grid-template-columns: minmax(0, 1fr);
}

.modal.design-modal .design-construction-sidebar,
.modal.construction-modal .design-construction-sidebar {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 8px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.modal.design-modal .design-sidebar-head,
.modal.construction-modal .design-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  color: #344054;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.modal.design-modal .design-sidebar-head .design-open-picker,
.modal.construction-modal .design-sidebar-head .design-open-picker {
  margin: 0;
}

.modal.design-modal .design-summary-card,
.modal.construction-modal .design-summary-card,
.modal.design-modal .design-construction-card,
.modal.construction-modal .design-construction-card {
  position: relative;
  display: grid;
  min-width: 0;
  border: 1px solid #d8e1ef;
  border-radius: 6px;
  background: #f8fafc;
  color: #0f172a;
}

.modal.design-modal .design-summary-card,
.modal.construction-modal .design-summary-card {
  gap: 2px;
  min-height: 56px;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.modal.design-modal .design-summary-card:disabled,
.modal.construction-modal .design-summary-card:disabled {
  cursor: default;
}

.modal.design-modal .design-summary-card span,
.modal.construction-modal .design-summary-card span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.design-modal .design-summary-card small,
.modal.construction-modal .design-summary-card small {
  overflow: hidden;
  color: #667085;
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.design-modal .design-summary-card.active,
.modal.construction-modal .design-summary-card.active,
.modal.design-modal .design-construction-card.active,
.modal.construction-modal .design-construction-card.active {
  border-color: #9bb7dc;
  background: #ffffff;
  box-shadow: inset 3px 0 0 var(--navy);
}

.modal.design-modal .design-construction-card-list,
.modal.construction-modal .design-construction-card-list {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.modal.design-modal .design-construction-card-main,
.modal.construction-modal .design-construction-card-main {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.modal.design-modal .design-construction-card-main:disabled,
.modal.construction-modal .design-construction-card-main:disabled {
  cursor: default;
}

.modal.design-modal .design-construction-card-title,
.modal.construction-modal .design-construction-card-title {
  overflow: hidden;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.design-modal .design-construction-card-meta,
.modal.construction-modal .design-construction-card-meta {
  overflow: hidden;
  color: #667085;
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.design-modal .design-construction-card-stats,
.modal.construction-modal .design-construction-card-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(54px, 0.44fr);
  gap: 4px;
}

.modal.design-modal .design-construction-card-stats span,
.modal.construction-modal .design-construction-card-stats span {
  display: grid;
  gap: 1px;
  min-width: 0;
  min-height: 30px;
  border: 1px solid #e1e8f2;
  border-radius: 5px;
  background: #ffffff;
  padding: 4px 5px;
  overflow: hidden;
  color: #0f172a;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.modal.design-modal .design-construction-card-stats span:first-child,
.modal.design-modal .design-construction-card-stats span:last-child,
.modal.construction-modal .design-construction-card-stats span:first-child,
.modal.construction-modal .design-construction-card-stats span:last-child {
  grid-column: 1 / -1;
}

.modal.design-modal .design-construction-card-stats b,
.modal.construction-modal .design-construction-card-stats b {
  color: #667085;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.modal.design-modal .design-construction-card-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(217, 45, 32, 0.45);
  border-radius: 5px;
  background: rgba(217, 45, 32, 0.12);
  color: #d92d20;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.modal.design-modal .design-type-popover,
.modal.construction-modal .design-type-popover {
  position: static;
  z-index: 1;
  width: auto;
  min-width: 0;
  gap: 7px;
  padding: 8px;
  border-color: #d8e1ef;
  box-shadow: none;
}

.modal.design-modal .design-picker-line,
.modal.construction-modal .design-picker-line {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.modal.design-modal .design-type-options,
.modal.construction-modal .design-type-options {
  grid-template-columns: 1fr;
  max-height: 170px;
  overflow: auto;
}

.modal.design-modal .design-editor-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  padding: 8px 10px;
}

.modal.design-modal .design-main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.modal.design-modal .design-main-stack {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.modal.design-modal .design-core-panel,
.modal.design-modal .design-timeline-panel {
  align-content: start;
}

.modal.design-modal .design-core-panel .design-compact-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.modal.design-modal .design-core-panel .date-pair {
  grid-column: span 2;
}

.modal.design-modal .design-calendar-card {
  min-width: 0;
}

.modal.design-modal .design-calendar-card .design-timeline-preview {
  min-height: 176px;
}

.modal.design-modal .design-preview-timeline .timeline-head div:first-child {
  z-index: 9;
}

.modal.design-modal .design-preview-timeline .timeline-label {
  z-index: 8;
}

.modal.design-modal .design-preview-timeline .timeline-task {
  z-index: 3;
}

.modal.design-modal .design-preview-timeline .timeline-task.design-preview-selected {
  z-index: 5;
}

.modal.design-modal .design-description-panel,
.modal.design-modal .design-attachment-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.modal.design-modal .design-description-panel .field {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}

.modal.design-modal .design-rich-notes {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.modal.design-modal .design-rich-notes .rich-editable {
  height: auto;
  min-height: 0;
  max-height: none;
}

.modal.design-modal .design-attachment-panel {
  position: relative;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  align-self: stretch;
}

.modal.design-modal .design-attachment-drop-hint {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 122px;
  border: 1px dashed #b8c7dc;
  border-radius: 6px;
  background: #f8fbff;
  color: #475467;
  text-align: center;
}

.modal.design-modal .design-attachment-drop-hint strong {
  color: #1d2939;
  font-size: 12px;
  font-weight: 900;
}

.modal.design-modal .design-attachment-drop-hint small {
  color: #667085;
  font-size: 10px;
  font-weight: 800;
}

.modal.design-modal .design-attachment-panel.is-dragover,
.modal.design-modal .design-attachment-panel.is-uploading {
  outline: 2px solid #2b6cb0;
  outline-offset: -2px;
  box-shadow: inset 0 0 0 999px rgba(43, 108, 176, 0.08), 0 0 0 3px rgba(43, 108, 176, 0.14);
}

.modal.design-modal .design-attachment-panel.is-dragover::after {
  content: "Upuść pliki tutaj";
  position: absolute;
  inset: 82px 9px 9px;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 2px dashed #2b6cb0;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.88);
  color: #1f5f99;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  pointer-events: none;
}

.modal.design-modal .design-attachment-panel .attachment-list {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 3px;
  scrollbar-gutter: stable;
}

.modal.construction-modal .construction-editor-grid {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 440px);
  height: 100%;
  min-height: 0;
  padding: 8px 10px;
}

.modal.construction-modal .construction-main-stack,
.modal.construction-modal .construction-side-stack {
  overflow: auto;
}

.modal.construction-modal .construction-side-stack {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.modal.construction-modal .construction-pdf-panel {
  display: grid;
  grid-template-rows: auto minmax(0, auto);
  min-height: 0;
  align-content: start;
}

.modal.construction-modal .pdf-upload-row {
  display: grid;
  grid-template-rows: auto minmax(0, auto);
  align-content: start;
  min-height: 0;
  gap: 8px;
}

.modal.construction-modal .pdf-thumb {
  width: 100%;
  max-width: none;
  min-height: 0;
  overflow: hidden;
}

.modal.construction-modal .pdf-thumb-main,
.modal.construction-modal .pdf-thumb-main.has-image,
.modal.construction-modal .pdf-thumb-main.has-document {
  display: block;
  width: 100%;
  min-height: 250px;
  height: min(34dvh, 330px);
  aspect-ratio: auto;
  padding: 0;
  overflow: hidden;
}

.modal.construction-modal .pdf-thumb-object,
.modal.construction-modal .pdf-thumb-image {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  background: #ffffff;
}

.modal.construction-modal .pdf-thumb-label {
  display: none;
}

.modal.planning-modal.full-height {
  /* PRAWDZIWY full-screen, wycentrowany (koniec marginesu z jednej i ucięcia z drugiej strony). */
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  border-radius: 0;
}
.modal-backdrop.planning-backdrop {
  padding: 0;
}

.modal.planning-modal header,
.modal.planning-modal footer {
  flex: 0 0 auto;
  min-height: 0;
  padding: 7px 10px;
}

.modal.planning-modal header h2 {
  font-size: 14px;
}

.modal.planning-modal .icon-button {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 6px;
}

.modal.planning-modal .icon {
  width: 14px;
  height: 14px;
}

.modal.planning-modal.full-height > form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.modal.planning-modal .planning-editor-shell {
  display: block;
  background: #f8fafc;
}

.modal.planning-modal .planning-editor-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

/* Body modala planowania = SHELL flex: [form: Zakres+Uwagi | Harmonogram+Konstrukcje] + [Czat etapu]. */
.modal.planning-modal.full-height > .planning-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  gap: 8px;
  padding: 8px 10px;
}
.modal.planning-modal .planning-shell > form {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}
.modal.planning-modal .planning-side-column {
  grid-template-rows: auto auto;
  align-content: start;
  overflow-y: auto;
}
.modal.planning-modal .planning-chat-column {
  flex: 0 0 clamp(360px, 26vw, 460px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}
.modal.planning-modal .planning-chat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex: 0 0 auto;
}
.modal.planning-modal .planning-chat-head h3 { margin: 0; font-size: 12px; }
.modal.planning-modal .planning-chat-head span { font-size: 10px; color: var(--muted); }
.modal.planning-modal .planning-chat-column .project-chat-panel {
  flex: 1 1 auto;
  min-height: 0;
}

.modal.planning-modal .planning-side-column,
.modal.planning-modal .planning-main-column {
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

.modal.planning-modal .planning-side-column {
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.modal.planning-modal .planning-main-column {
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.modal.planning-modal .planning-panel {
  gap: 8px;
  padding: 9px;
  border-radius: 6px;
  background: #ffffff;
}

.modal.planning-modal .form-panel-head h3 {
  font-size: 12px;
}

.modal.planning-modal .form-panel-head span {
  font-size: 10px;
}

.modal.planning-modal .planning-side-grid,
.modal .form-grid.planning-side-grid {
  grid-template-columns: 1fr;
  gap: 7px;
}

.modal.planning-modal label {
  font-size: 10px;
}

.modal.planning-modal input,
.modal.planning-modal select,
.modal.planning-modal textarea {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 500;
}

.modal.planning-modal .plan-assignee-list {
  grid-template-columns: 1fr;
  gap: 5px;
  max-height: 178px;
  overflow: auto;
  padding-right: 2px;
}

.modal.planning-modal .user-select-option {
  grid-template-columns: 14px 24px minmax(0, 1fr);
  min-height: 30px;
  padding: 3px 6px;
}

.modal.planning-modal .user-select-option input {
  width: 14px;
  height: 14px;
}

.modal.planning-modal .planning-notes-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  align-content: start;
  min-height: 0;
  overflow: hidden;
}

.modal.planning-modal .planning-notes-panel .field.full {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.modal.planning-modal .planning-notes-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.modal.planning-modal .planning-notes-area .rich-editable {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  font-size: 11px;
}

.modal.planning-modal .planning-attachment-strip {
  grid-template-columns: 1fr;
  gap: 6px;
}

.modal.planning-modal .upload-button,
.modal.planning-modal .button,
.modal.planning-modal .primary-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.modal.planning-modal .planning-notes-panel .attachment-list {
  max-height: 132px;
  overflow: auto;
}

.modal.planning-modal .planning-main-column .planning-panel {
  min-width: 0;
}

.modal.planning-modal .planning-timeline-panel {
  align-self: start;
  min-height: 0;
  overflow: hidden;
}

.modal.planning-modal .planning-timeline-panel > [data-planning-timeline-preview] {
  min-height: 0;
  overflow: hidden;
}

.modal.planning-modal .planning-timeline-preview {
  height: auto;
  min-height: 0;
}

.modal.planning-modal .planning-timeline-preview .design-preview-timeline {
  min-height: 0;
  max-height: 100%;
  overflow: auto;
}

.modal.planning-modal .planning-timeline-preview .timeline-preview-meta {
  font-size: 10px;
}

.modal.planning-modal .planning-timeline-preview .timeline-preview-legend {
  gap: 8px;
  font-size: 9px;
}

.modal.planning-modal .planning-timeline-preview .timeline-head div {
  min-height: 28px;
  font-size: 9px;
}

.modal.planning-modal .planning-timeline-preview .timeline-label {
  padding: 0 6px;
}

.modal.planning-modal .planning-timeline-preview .timeline-label strong {
  font-size: 10px;
}

.modal.planning-modal .planning-timeline-preview .timeline-label small {
  font-size: 9px;
}

.modal.planning-modal .planning-preview-task {
  height: 38px;
  padding: 5px 10px;
  font-size: 10px;
}

.modal.planning-modal .planning-preview-task small {
  margin-top: 1px;
  font-size: 9px;
}

.modal.planning-modal .planning-construction-list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: stretch;
  min-height: 0;
  overflow: hidden;
}

.modal.planning-modal .planning-construction-matrix {
  height: 100%;
  max-height: none;
  min-height: 0;
  padding: 3px;
  /* KLUCZOWE: wiersze u góry o naturalnej wysokości (bez rozciągania na całą wysokość). */
  align-content: start;
  grid-auto-rows: max-content;
  overflow: auto;
}

.modal.planning-modal .planning-construction-head,
.modal.planning-modal .planning-construction-row {
  grid-template-columns: minmax(160px, 1.05fr) minmax(180px, 1fr) minmax(150px, 0.72fr) minmax(112px, 0.5fr) minmax(112px, 0.5fr) minmax(130px, 0.62fr);
  gap: 5px;
}

/* Tabela SLIM (Nazwa | Inzynier-inicjaly | BOM) — Start/Koniec/Dane usunięte (są na harmonogramie). */
.modal.planning-modal .planning-construction-matrix-slim .planning-construction-head,
.modal.planning-modal .planning-construction-matrix-slim .planning-construction-row {
  grid-template-columns: minmax(160px, 1fr) 56px minmax(120px, auto);
  gap: 10px;
  align-items: center;
}
/* Inzynier = avatar inicjałów z przezroczystym selectem na wierzchu (klik = zmiana). */
.plan-assignee {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.plan-assignee-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  letter-spacing: .3px;
}
.plan-assignee .plan-assignee-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  opacity: 0;
  cursor: pointer;
  padding: 0 !important;
}

/* Środek-dół: Konstrukcje | Uwagi 50/50 szerokości, oba na PEŁNĄ wysokość. */
.modal.planning-modal .planning-bottom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr); /* wiersz wypełnia wysokość -> panele stretch */
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}
.modal.planning-modal .planning-bottom-row > .planning-panel {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  /* KLUCZOWE: oba panele na PEŁNĄ wysokość wiersza (notes panel łapał align-self:start). */
  align-self: stretch;
  height: 100%;
}
.modal.planning-modal .planning-bottom-row .planning-notes-panel .field {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.modal.planning-modal .planning-bottom-row .planning-notes-area {
  min-height: 0;
  height: 100%;
}

.modal.planning-modal .planning-construction-head {
  min-height: 24px;
  font-size: 9px;
}

.modal.planning-modal .planning-construction-row {
  min-height: 34px;
  padding: 2px 0;
}

.modal.planning-modal .planning-construction-name strong {
  font-size: 11px;
}

.modal.planning-modal .planning-construction-name small,
.modal.planning-modal .planning-construction-row .planning-construction-meta,
.modal.planning-modal .technical-bom-compact span {
  font-size: 9px;
}

.modal.planning-modal .planning-construction-row select,
.modal.planning-modal .planning-construction-row input {
  min-height: 26px;
  padding: 3px 7px;
  font-size: 11px;
}

.modal.planning-modal .upload-button.mini-upload {
  min-height: 24px;
  padding: 0 8px;
  font-size: 10px;
}

.modal.planning-modal .rich-toolbar {
  gap: 4px;
  min-height: 34px;
  max-height: 66px;
  overflow: hidden;
  padding: 4px;
}

.modal.planning-modal .rich-toolbar button,
.modal.planning-modal .rich-toolbar select,
.modal.planning-modal .rich-image-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 28px;
  min-height: 26px;
  max-width: none;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 600;
}

.modal.planning-modal .rich-toolbar select {
  width: auto;
  min-width: 0;
  padding-right: 22px;
}

.modal.planning-modal .rich-toolbar select[data-rich-font-size] {
  width: 74px;
}

.modal.planning-modal .rich-toolbar select[data-rich-image-size] {
  width: 82px;
}

.modal .project-editor-shell {
  padding: 0;
}

.modal .project-card-form {
  padding: 0;
}

.modal .project-chat-compose {
  padding: 10px;
}

.modal .project-field-card input,
.modal .project-field-card select,
.modal .project-field-card textarea {
  min-height: 26px;
  border-color: transparent;
  background: transparent;
  padding: 0;
}

.modal .project-people-tools select,
.modal .project-people-tools input,
.modal .chat-recipient-toolbar select,
.modal .chat-recipient-toolbar input {
  min-height: 28px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  padding: 0 7px;
}

.modal .chat-recipient-toolbar .button {
  min-height: 28px;
  padding: 0 8px;
}

.modal .user-select-option input {
  width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
}

.modal .project-chat-compose textarea {
  padding: 8px 9px;
  background: #ffffff;
}

.toast-root {
  position: fixed;
  left: 50%;
  right: auto;
  top: 18px;
  bottom: auto;
  transform: translateX(-50%);
  z-index: 2147483000;
  display: grid;
  gap: 8px;
  width: min(420px, calc(100vw - 36px));
  pointer-events: none;
}

.app-busy {
  position: fixed;
  inset: 0;
  z-index: 2147482999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(246, 248, 251, 0.34);
  backdrop-filter: blur(2px);
  opacity: 0;
  transform: scale(0.985);
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.app-busy.is-visible {
  opacity: 1;
  transform: scale(1);
}

.app-busy-panel {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-width: min(360px, calc(100vw - 48px));
  padding: 28px 32px 24px;
  border: 1px solid rgba(47, 99, 150, 0.20);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: #102033;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.20);
}

.app-busy-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
}

.app-busy-ring {
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 5px solid rgba(47, 99, 150, 0.14);
  border-top-color: var(--brand);
  border-right-color: var(--danger);
  border-radius: 50%;
  animation: app-busy-spin 0.82s linear infinite;
}

.app-busy-mark img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 86px;
  height: 70px;
  max-height: none;
  object-fit: contain;
  object-position: center;
  transform: translate(-50%, -50%);
  z-index: 1;
  filter: drop-shadow(0 6px 16px rgba(15, 23, 42, 0.12));
}

.app-busy-fallback {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 6px;
  background: var(--brand);
  color: #ffffff;
  font-size: 34px;
  font-weight: 950;
  line-height: 1;
}

.app-busy-panel strong {
  font-size: 18px;
  line-height: 1.15;
  text-align: center;
}

.app-busy-panel small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

body.is-app-busy button,
body.is-app-busy input,
body.is-app-busy select {
  cursor: progress;
}

@keyframes app-busy-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 700px) {
  .app-busy {
    padding: 18px;
  }

  .app-busy-panel {
    min-width: min(300px, calc(100vw - 36px));
    padding: 24px 20px 22px;
  }

  .app-busy-mark {
    width: 102px;
    height: 102px;
  }

  .app-busy-mark img {
    width: 76px;
    height: 62px;
  }
}

.toast {
  min-width: 260px;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: #1d2939;
  font-weight: 700;
  pointer-events: auto;
}

.toast.error {
  border-color: #ffd4cf;
  background: #fff7f6;
  color: var(--danger);
}

.client-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.login-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(360px, 100%);
  display: grid;
  gap: 18px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.login-brand-only {
  display: grid;
  place-items: center;
  min-height: 96px;
}

.login-logo-image {
  max-width: 240px;
  max-height: 96px;
  object-fit: contain;
}

.login-logo-fallback {
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.login-fields {
  display: grid;
  gap: 10px;
}

.login-panel .field {
  gap: 5px;
}

.login-panel input {
  min-height: 38px;
  background: var(--surface);
}

.login-panel .primary-button {
  min-height: 38px;
}

.login-message {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.login-recovery-button {
  justify-self: center;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--navy);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.login-recovery-button:hover {
  color: var(--navy-2);
  text-decoration: underline;
}

.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.contact-list span {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-muted);
  padding: 3px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  color: currentColor;
  vertical-align: middle;
  background: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.icon-folder { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z'/%3E%3C/svg%3E"); }
.icon-calc { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='16' height='20' x='4' y='2' rx='2'/%3E%3Cpath d='M8 6h8'/%3E%3Cpath d='M16 14v4'/%3E%3Cpath d='M16 10h.01'/%3E%3Cpath d='M12 10h.01'/%3E%3Cpath d='M8 10h.01'/%3E%3Cpath d='M12 14h.01'/%3E%3Cpath d='M8 14h.01'/%3E%3Cpath d='M12 18h.01'/%3E%3Cpath d='M8 18h.01'/%3E%3C/svg%3E"); }
.icon-cart { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='21' r='1'/%3E%3Ccircle cx='19' cy='21' r='1'/%3E%3Cpath d='M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12'/%3E%3C/svg%3E"); }
.icon-timeline { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6h10'/%3E%3Cpath d='M6 12h9'/%3E%3Cpath d='M11 18h7'/%3E%3C/svg%3E"); }
.icon-doc { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z'/%3E%3Cpath d='M14 2v4a2 2 0 0 0 2 2h4'/%3E%3Cpath d='M16 13H8'/%3E%3Cpath d='M16 17H8'/%3E%3Cpath d='M10 9H8'/%3E%3C/svg%3E"); }
.icon-image { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='3' rx='2' ry='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21'/%3E%3C/svg%3E"); }
.icon-comment { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); }
.icon-eye { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.icon-user { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E"); }
.icon-logout { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' x2='9' y1='12' y2='12'/%3E%3C/svg%3E"); }
.icon-truck { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2'/%3E%3Cpath d='M15 18H9'/%3E%3Cpath d='M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14'/%3E%3Ccircle cx='17' cy='18' r='2'/%3E%3Ccircle cx='7' cy='18' r='2'/%3E%3C/svg%3E"); }
.icon-small-truck { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2'/%3E%3Cpath d='M15 18H9'/%3E%3Cpath d='M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14'/%3E%3Ccircle cx='17' cy='18' r='2'/%3E%3Ccircle cx='7' cy='18' r='2'/%3E%3C/svg%3E"); }
.icon-car { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.5 2.8C1.4 11.3 2 12 2 12v4c0 .6.4 1 1 1h2'/%3E%3Ccircle cx='7' cy='17' r='2'/%3E%3Cpath d='M9 17h6'/%3E%3Ccircle cx='17' cy='17' r='2'/%3E%3C/svg%3E"); }
.icon-shipping-box { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z'/%3E%3Cpath d='M12 22V12'/%3E%3Cpolyline points='3.29 7 12 12 20.71 7'/%3E%3Cpath d='m7.5 4.27 9 5.15'/%3E%3C/svg%3E"); }
.icon-menu { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' x2='20' y1='6' y2='6'/%3E%3Cline x1='4' x2='20' y1='12' y2='12'/%3E%3Cline x1='4' x2='20' y1='18' y2='18'/%3E%3C/svg%3E"); }
.icon-box { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/%3E%3Cpath d='m3.3 7 8.7 5 8.7-5'/%3E%3Cpath d='M12 22V12'/%3E%3C/svg%3E"); }
.icon-blocks { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='7' height='7' x='3' y='3' rx='1'/%3E%3Crect width='7' height='7' x='14' y='3' rx='1'/%3E%3Crect width='7' height='7' x='14' y='14' rx='1'/%3E%3Crect width='7' height='7' x='3' y='14' rx='1'/%3E%3C/svg%3E"); }
.icon-tag { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z'/%3E%3Ccircle cx='7.5' cy='7.5' r='1.2' fill='black'/%3E%3C/svg%3E"); }
.icon-wrench { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/svg%3E"); }
.icon-star { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z'/%3E%3C/svg%3E"); }
.icon-settings { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.icon-help { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); }
.icon-bell { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.268 21a2 2 0 0 0 3.464 0'/%3E%3Cpath d='M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326'/%3E%3C/svg%3E"); }
.icon-envelope { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='16' x='2' y='4' rx='2'/%3E%3Cpath d='m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7'/%3E%3C/svg%3E"); }
.icon-moon { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E"); }
.icon-sun { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2'/%3E%3Cpath d='M12 20v2'/%3E%3Cpath d='m4.93 4.93 1.41 1.41'/%3E%3Cpath d='m17.66 17.66 1.41 1.41'/%3E%3Cpath d='M2 12h2'/%3E%3Cpath d='M20 12h2'/%3E%3Cpath d='m6.34 17.66-1.41 1.41'/%3E%3Cpath d='m19.07 4.93-1.41 1.41'/%3E%3C/svg%3E"); }
.icon-chevron-left { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E"); }
.icon-chevron-right { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E"); }
.icon-search { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E"); }
.icon-plus { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M12 5v14'/%3E%3C/svg%3E"); }
.icon-download { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' x2='12' y1='15' y2='3'/%3E%3C/svg%3E"); }
.icon-upload { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' x2='12' y1='3' y2='15'/%3E%3C/svg%3E"); }
.icon-filter { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3'/%3E%3C/svg%3E"); }
.icon-close { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E"); }
/* Cała rodzina ikon = Lucide (kontur, stroke 2px, round). */
.icon-trash { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6'/%3E%3Cpath d='M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cline x1='10' x2='10' y1='11' y2='17'/%3E%3Cline x1='14' x2='14' y1='11' y2='17'/%3E%3C/svg%3E"); }

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .brand div:last-child,
  .nav-item,
  .nav-catalog-group > summary span {
    font-size: 0;
  }

  .nav-item,
  .nav-catalog-group > summary {
    justify-content: center;
  }

  /* sidebar tylko-ikony: chevron grupy zbędny (margin-left:auto psułby centrowanie) */
  .nav-catalog-group > summary::after {
    display: none;
  }

  .collapse-button {
    justify-content: center;
    font-size: 0;
  }

  .project-detail,
  .two-col,
  .import-layout,
  .calculation-layout,
  .calculation-shell {
    grid-template-columns: 1fr;
  }

  .offer-row,
  .offer-selected-panel .offer-row,
  .offer-results-panel .offer-row,
  .upload-strip,
  .premium-drop,
  .construction-dimensions-grid,
  .construction-overview-grid,
  .construction-bom-grid,
  .construction-pdf-grid,
  .construction-meta-strip,
  .readout-grid {
    grid-template-columns: 1fr;
  }

  .offer-thumb-cell,
  .offer-thumb-card {
    width: min(100%, 308px);
  }

  .catalog-switcher {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .offer-search-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .offer-results-panel {
    grid-column: 1 / -1;
    min-height: 360px;
  }

  .project-editor-shell,
  .project-card-form {
    grid-template-columns: 1fr;
  }

  .project-card-stack,
  .project-people-grid {
    grid-template-columns: 1fr;
  }

  .project-card-stack {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .design-data-grid,
  .design-upload-strip,
  .modal.design-modal .design-data-layout,
  .modal.design-modal .design-bottom-grid,
  .modal.construction-modal .construction-editor-grid,
  .modal.construction-modal .construction-version-grid,
  .modal.planning-modal .planning-editor-layout,
  .installation-crew-editor-form,
  .modal.catalog-modal.crew-modal .crew-data-grid,
  .modal.construction-modal .construction-context-grid,
  .modal.construction-modal .construction-dimensions-grid,
  .modal.construction-modal .readout-grid {
    grid-template-columns: 1fr;
  }

  .modal.design-modal.full-height > form,
  .modal.construction-modal.full-height > form,
  .modal.construction-modal .construction-editor-grid,
  .modal.planning-modal.full-height > form,
  .modal.planning-modal .planning-editor-layout,
  .modal.planning-modal .planning-main-column {
    overflow: auto;
  }

  .project-editor-shell {
    overflow: auto;
  }

  .modal.calculation-modal.full-height > .calculation-shell {
    grid-template-columns: 1fr;
  }

  .modal.calculation-modal .mapping-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card-form {
    overflow: visible;
  }

  .project-status-card {
    grid-template-rows: auto auto auto;
  }

  .project-participants-card {
    min-height: 0;
  }

  .project-chat-panel {
    min-height: 420px;
    border-left: 0;
    border-top: 1px solid var(--line-strong);
  }
}

@media (max-width: 1400px) {
  .import-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 780px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(3, 1fr);
    padding: 10px;
  }

  .nav-catalog-group {
    grid-column: 1 / -1;
  }

  .nav-catalog-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-item {
    font-size: 12px;
    gap: 8px;
  }

  .collapse-button {
    display: none;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    flex-direction: column;
  }

  .topbar-title {
    width: 100%;
  }

  .icon-button.mobile-menu-button {
    display: inline-grid;
  }

  .content {
    padding: 14px;
  }

  .summary-grid,
  .cards-grid,
  .catalog-grid,
  .catalog-switcher,
  .form-grid,
  .mapping-grid,
  .block-editor-form,
  .block-two-field-grid,
  .phone-grid,
  .component-row,
  .offer-filters,
  .offer-row,
  .offer-selected-panel .offer-row,
  .offer-results-panel .offer-row,
  .design-planned-row,
  .material-card-form,
  .material-title-grid,
  .material-meta-grid,
  .material-price-grid,
  .material-weight-grid {
    grid-template-columns: 1fr;
  }

  .modal.material-modal {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
  }

  .modal.block-modal.full-height {
    width: min(100%, calc(100vw - 20px));
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
  }

  .modal.block-modal.full-height > form {
    overflow: auto;
  }

  .modal.block-modal .block-editor-form {
    height: auto;
  }

  .block-image-preview {
    width: 100%;
    max-width: 180px;
  }

  .block-editor-side,
  .block-editor-main {
    overflow: visible;
  }

  .modal.calculation-modal.full-height {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
  }

  .modal.calculation-modal .mapping-grid {
    grid-template-columns: 1fr;
  }

  .offer-section-title,
  .offer-row-actions {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .offer-filters .wide {
    grid-column: auto;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar > *,
  .toolbar select,
  .toolbar button {
    width: 100%;
  }

  .catalog-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-filter-group {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-filter-group select,
  .catalog-search-field {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .catalog-pager {
    flex-wrap: wrap;
  }

  .project-main-grid {
    gap: 8px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .project-main-grid .toolbar {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .project-main-grid .toolbar .search-field,
  .project-main-grid .toolbar .search {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  .project-main-grid .tree-wrap {
    max-height: none;
    overflow: visible;
    scrollbar-gutter: auto;
  }

  .project-main-grid .tree-table,
  .project-main-grid .tree-table tbody,
  .project-main-grid .tree-table tr,
  .project-main-grid .tree-table td {
    display: block;
    width: 100%;
  }

  .project-main-grid .tree-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
  }

  .project-main-grid .tree-table colgroup,
  .project-main-grid .tree-table thead {
    display: none;
  }

  .project-main-grid .tree-table tbody {
    display: grid;
    gap: 8px;
  }

  .project-main-grid .tree-table tr.tree-row {
    display: grid;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .project-main-grid .tree-table tr.project-row {
    border-left: 3px solid var(--navy);
  }

  .project-main-grid .tree-table tr.stage-row {
    background: var(--surface-muted);
  }

  .project-main-grid .tree-table tr.construction-row {
    background: #f4fbf7;
  }

  .project-main-grid .tree-table tr.tree-row:not(.project-row) {
    width: calc(100% - 14px);
    margin-left: 14px;
    border-left: 4px solid rgba(16, 42, 99, 0.22);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }

  .project-main-grid .tree-table tr.design-version-row,
  .project-main-grid .tree-table tr.planning-version-row,
  .project-main-grid .tree-table tr.production-plan-row,
  .project-main-grid .tree-table tr.stage-task-row,
  .project-main-grid .tree-table tr.warranty-task-row,
  .project-main-grid .tree-table tr.construction-row {
    width: calc(100% - 24px);
    margin-left: 24px;
  }

  .project-main-grid .tree-table tr.construction-row {
    border-left-color: rgba(18, 183, 106, 0.42);
  }

  .project-main-grid .tree-table tr.tree-row > td {
    display: grid;
    grid-template-columns: minmax(78px, 30%) minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    min-height: 0;
    padding: 7px 9px;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.25;
    text-align: left;
    white-space: normal;
  }

  .project-main-grid .tree-table tr.tree-row > td:last-child {
    border-bottom: 0;
  }

  .project-main-grid .tree-table tr.tree-row > td::before {
    display: block;
    min-width: 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: normal;
  }

  .project-main-grid .tree-table tr.tree-row > td:nth-child(1)::before { content: "Drzewo"; }
  .project-main-grid .tree-table tr.tree-row > td:nth-child(2)::before { content: "Nazwa"; }
  .project-main-grid .tree-table tr.tree-row > td:nth-child(3)::before { content: "Szczegóły"; }
  .project-main-grid .tree-table tr.tree-row > td:nth-child(4)::before { content: "Plan / status"; }
  .project-main-grid .tree-table tr.tree-row > td:nth-child(5)::before { content: "Materiał"; }
  .project-main-grid .tree-table tr.tree-row > td:nth-child(6)::before { content: "Transport"; }
  .project-main-grid .tree-table tr.tree-row > td:nth-child(7)::before { content: "Montaż"; }
  .project-main-grid .tree-table tr.tree-row > td:nth-child(8)::before { content: "Razem"; }
  .project-main-grid .tree-table tr.tree-row > td:nth-child(9)::before { content: "Akcje"; }

  .project-main-grid .tree-table .tree-toggle {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    flex-basis: 34px;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1;
  }

  .project-main-grid .tree-table .price-cell,
  .project-main-grid .tree-table .price-cell .money,
  .project-main-grid .tree-table .price-cell .resource-total,
  .project-main-grid .tree-table .calculation-cost-cell {
    justify-self: start;
    text-align: left;
  }

  .project-main-grid .tree-table tr.tree-row > td.price-cell {
    justify-items: start;
  }

  .project-main-grid .tree-table .price-cell .money,
  .project-main-grid .tree-table .price-cell .resource-total,
  .project-main-grid .tree-table .price-cell .resource-total-stack {
    min-width: 0;
    justify-items: start;
    justify-self: start;
    margin-left: 0;
    text-align: left;
  }

  .project-main-grid .tree-table tr.tree-row > td:has(.row-actions) {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .project-main-grid .tree-table tr.tree-row > td:has(.row-actions)::before {
    content: "Akcje";
  }

  .project-main-grid .tree-table .row-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    gap: 8px;
  }

  .project-main-grid .tree-table .row-action-left {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(98px, 1fr));
    gap: 7px;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }

  .project-main-grid .tree-table .row-action-right {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    min-width: 0;
  }

  .project-main-grid .tree-table .inline-actions:not(.row-actions) {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .project-main-grid .tree-table .button.mini,
  .project-main-grid .tree-table .primary-button.mini,
  .project-main-grid .tree-table .sold-button.mini {
    width: 100%;
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .project-main-grid .tree-table .project-stage-menu {
    display: grid;
    width: 100%;
    grid-column: 1 / -1;
  }

  .project-main-grid .tree-table .project-stage-trigger {
    width: 100%;
  }

  .project-main-grid .tree-table .row-action-right .square-button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
  }

  .project-main-grid .tree-table .project-stage-menu-panel {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 6px;
    box-shadow: none;
  }

  .project-main-grid .pager {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .compact-offer-filters {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  }

  .compact-offer-filters .wide {
    grid-column: span 2;
  }

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

  .offer-filter-panel {
    position: static;
  }

  .component-table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .price-input-group {
    grid-template-columns: minmax(0, 1fr) 76px;
  }

  .offer-results-panel {
    grid-column: auto;
  }

  .offer-selected-panel .offer-list,
  .offer-results-panel .offer-list {
    min-height: 180px;
    max-height: none;
  }

  .project-editor-shell,
  .project-card-form,
  .project-card-stack,
  .project-people-grid,
  .planning-construction-panel,
  .chat-notification-reply {
    grid-template-columns: 1fr;
  }

  .modal .form-grid.planning-project-grid,
  .planning-construction-head,
  .planning-construction-row {
    grid-template-columns: 1fr;
  }

  .roles-panel {
    grid-column: auto;
  }

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

  .modal .project-card-form {
    padding: 12px;
  }
}

/* Compact GUI refresh */
.compact-main,
.compact-workspace {
  min-height: calc(100vh - 78px);
}

.compact-table-wrap {
  max-height: calc(100vh - 142px);
  overflow: auto;
}

.compact-data-table {
  table-layout: fixed;
  min-width: 980px;
}

.compact-data-table th,
.compact-data-table td {
  height: 30px;
  padding: 4px 7px;
  font-size: 10px;
  line-height: 1.25;
  vertical-align: middle;
}

.compact-data-table td strong,
.compact-data-table td small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-data-table td small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.empty-cell {
  height: 80px;
  color: var(--muted);
  text-align: center;
}

.compact-catalog-switcher {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.compact-catalog-toolbar {
  min-height: 42px;
}

.compact-filter-select {
  max-width: 220px;
}

.calculation-page,
.compact-calculation-page {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 8px;
  min-height: calc(100vh - 78px);
}

.calculation-controls,
.metric-list {
  display: grid;
  gap: 7px;
}

.metric-list span,
.dense-kpis > div {
  display: grid;
  gap: 2px;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.metric-list span {
  min-height: 34px;
}

.metric-list strong,
.dense-kpis strong {
  color: #102a63;
  font-size: 12px;
}

.dense-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 7px;
  margin-bottom: 8px;
}

.dense-kpis span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.section-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  margin-top: 8px;
  border-bottom: 1px solid var(--line);
}

.section-line span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.import-shell {
  display: grid;
  gap: 10px;
}

.import-source textarea {
  min-height: 260px;
  resize: vertical;
}

.compact-help {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.compact-recognized {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px 0;
}

.compact-recognized span {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: #475467;
  font-size: 9px;
  font-weight: 900;
}

.compact-recognized .ok {
  border-color: #bfe5cf;
  background: #ecfdf3;
  color: #067647;
}

.validation-summary-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 30px;
  padding: 0 2px;
}

.ok-text {
  color: #067647;
  font-weight: 900;
}

.error-text {
  color: var(--danger);
  font-weight: 900;
}

.validation-result-pane .table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

.validation-scroll {
  max-height: calc(100vh - 210px);
  overflow: auto;
}

.validation-row-ok {
  background: #f0fff6;
  box-shadow: inset 3px 0 0 #16a34a;
}

.validation-row-warning {
  background: #fff9e8;
  box-shadow: inset 3px 0 0 #f59e0b;
}

.validation-row-error {
  background: #fff1f1;
  box-shadow: inset 3px 0 0 #dc2626;
}

.price-line-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 7px;
  align-items: end;
}

.professional-material-form {
  width: 100%;
}

.compact-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 8px;
}

.compact-form-grid .full {
  grid-column: 1 / -1;
}

.project-detail-shell {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.tiny-avatar {
  --avatar-size: 22px;
  margin-right: 5px;
  font-size: 9px;
}

:root[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
}

:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .main-grid,
:root[data-theme="dark"] .toolbar,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .modal,
:root[data-theme="dark"] .modal header,
:root[data-theme="dark"] .modal footer,
:root[data-theme="dark"] .project-detail,
:root[data-theme="dark"] .tab-panel,
:root[data-theme="dark"] .project-chat-panel,
:root[data-theme="dark"] .project-chat-compose,
:root[data-theme="dark"] .offer-filter-panel,
:root[data-theme="dark"] .offer-selected-panel,
:root[data-theme="dark"] .offer-results-panel,
:root[data-theme="dark"] .form-panel,
:root[data-theme="dark"] .project-card-form,
:root[data-theme="dark"] .project-card-stack,
:root[data-theme="dark"] .project-status-card,
:root[data-theme="dark"] .project-field-card,
:root[data-theme="dark"] .material-photo-card,
:root[data-theme="dark"] .material-metric-card,
:root[data-theme="dark"] .block-editor-side,
:root[data-theme="dark"] .block-editor-panel,
:root[data-theme="dark"] .construction-dimensions-card,
:root[data-theme="dark"] .readout-card,
:root[data-theme="dark"] .readout-grid div,
:root[data-theme="dark"] .planning-panel,
:root[data-theme="dark"] .planning-construction-panel,
:root[data-theme="dark"] .technical-bom-panel,
:root[data-theme="dark"] .validation-result-pane,
:root[data-theme="dark"] .component-table,
:root[data-theme="dark"] .crew-rates-panel,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .settings-form,
:root[data-theme="dark"] .empty {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

:root[data-theme="dark"] .bom-validation-table tr.is-error td,
:root[data-theme="dark"] .validation-stats .is-error {
  border-color: var(--bom-error-line);
  background: var(--bom-error-bg);
  color: var(--bom-error-text);
}

:root[data-theme="dark"] .bom-validation-table tr.is-ok td,
:root[data-theme="dark"] .validation-stats .is-ok {
  border-color: var(--bom-ok-line);
  background: var(--bom-ok-bg);
  color: var(--bom-ok-text);
}

:root[data-theme="dark"] .bom-validation-table tr.is-legacy td,
:root[data-theme="dark"] .validation-stats .is-legacy {
  border-color: var(--bom-legacy-line);
  background: var(--bom-legacy-bg);
  color: var(--bom-legacy-text);
}

:root[data-theme="dark"] .bom-validation-table tr.is-warning td,
:root[data-theme="dark"] .validation-stats .is-warning {
  border-color: var(--bom-warning-line);
  background: var(--bom-warning-bg);
  color: var(--bom-warning-text);
}

:root[data-theme="dark"] .bom-param-strip span {
  border-color: #30363d;
  background: #0d1117;
  color: #c9d1d9;
}

:root[data-theme="dark"] .bom-param-strip b {
  color: #8b949e;
}

:root[data-theme="dark"] .bom-validation-table .button.mini.has-comment,
:root[data-theme="dark"] .modal.construction-modal .bom-comment-button.has-comment {
  border-color: rgba(74, 222, 128, 0.5);
  background: rgba(20, 83, 45, 0.35);
  color: #bbf7d0;
}

:root[data-theme="dark"] .modal.construction-modal .construction-bom-quick-check,
:root[data-theme="dark"] .modal.construction-modal .construction-bom-quick-more,
:root[data-theme="dark"] .modal.construction-modal .construction-bom-quick-empty {
  border-color: var(--line);
  background: var(--surface);
}

:root[data-theme="dark"] .modal.construction-modal .construction-bom-quick-head strong {
  color: var(--text);
}

:root[data-theme="dark"] .modal.construction-modal .construction-bom-quick-header {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

:root[data-theme="dark"] .modal.construction-modal .construction-bom-quick-row.is-ok {
  border-color: var(--bom-ok-line);
  background: var(--bom-ok-bg);
  color: var(--bom-ok-text);
}

:root[data-theme="dark"] .modal.construction-modal .construction-bom-quick-row.is-legacy {
  border-color: var(--bom-legacy-line);
  background: var(--bom-legacy-bg);
  color: var(--bom-legacy-text);
}

:root[data-theme="dark"] .modal.construction-modal .construction-bom-quick-row.is-warning {
  border-color: var(--bom-warning-line);
  background: var(--bom-warning-bg);
  color: var(--bom-warning-text);
}

:root[data-theme="dark"] .modal.construction-modal .construction-bom-quick-row.is-error {
  border-color: var(--bom-error-line);
  background: var(--bom-error-bg);
  color: var(--bom-error-text);
}

:root[data-theme="dark"] .modal.construction-modal .construction-presentation-panel.is-dragover,
:root[data-theme="dark"] .modal.construction-modal .construction-presentation-panel.is-uploading {
  outline-color: #58a6ff;
  box-shadow: inset 0 0 0 999px rgba(88, 166, 255, 0.08), 0 0 0 3px rgba(88, 166, 255, 0.16);
}

:root[data-theme="dark"] .modal.construction-modal .construction-presentation-panel.is-dragover::after {
  border-color: #58a6ff;
  background: rgba(13, 17, 23, 0.88);
  color: #79c0ff;
}

:root[data-theme="dark"] .topbar {
  background: rgba(13, 17, 23, 0.92);
}

:root[data-theme="dark"] .brand strong,
:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3,
:root[data-theme="dark"] strong,
:root[data-theme="dark"] .tree-node-title,
:root[data-theme="dark"] .block-panel-head h3,
:root[data-theme="dark"] .form-panel-head h3,
:root[data-theme="dark"] .offer-panel-title strong,
:root[data-theme="dark"] .offer-row strong,
:root[data-theme="dark"] .user-chip,
:root[data-theme="dark"] .linklike,
:root[data-theme="dark"] .tree-table thead th {
  color: var(--text);
}

:root[data-theme="dark"] .brand small,
:root[data-theme="dark"] .muted,
:root[data-theme="dark"] .tiny,
:root[data-theme="dark"] .field label,
:root[data-theme="dark"] .project-field-card > span,
:root[data-theme="dark"] .project-card-title-row > span,
:root[data-theme="dark"] .form-panel-head span,
:root[data-theme="dark"] .block-panel-head span,
:root[data-theme="dark"] .offer-panel-title span,
:root[data-theme="dark"] .offer-row small,
:root[data-theme="dark"] .pager,
:root[data-theme="dark"] .plan-status-date {
  color: var(--muted);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .rich-editor,
:root[data-theme="dark"] .rich-editable,
:root[data-theme="dark"] .rich-toolbar,
:root[data-theme="dark"] .project-description-card .rich-editable,
:root[data-theme="dark"] .project-people-tools input,
:root[data-theme="dark"] .project-people-tools select,
:root[data-theme="dark"] .project-participant-selected,
:root[data-theme="dark"] .project-people-grid,
:root[data-theme="dark"] .chat-recipient-toolbar input,
:root[data-theme="dark"] .chat-recipient-toolbar select,
:root[data-theme="dark"] .component-picker input,
:root[data-theme="dark"] .component-picker select {
  border-color: var(--line-strong);
  background: #0d1117;
  color: var(--text);
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: #6e7681;
}

:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] textarea:focus {
  border-color: #6e7681;
  box-shadow: 0 0 0 2px rgba(139, 148, 158, 0.18);
}

:root[data-theme="dark"] .button,
:root[data-theme="dark"] .ghost-button,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .upload-button,
:root[data-theme="dark"] .danger-button {
  border-color: var(--line-strong);
  background: #21262d;
  color: var(--text);
}

:root[data-theme="dark"] .button:hover,
:root[data-theme="dark"] .ghost-button:hover,
:root[data-theme="dark"] .icon-button:hover,
:root[data-theme="dark"] .upload-button:hover {
  background: #30363d;
}

:root[data-theme="dark"] .primary-button {
  border-color: #f0f6fc;
  background: #f0f6fc;
  color: #0d1117;
}

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

:root[data-theme="dark"] .theme-toggle {
  border-color: #30363d;
  background: #21262d;
  color: #c9d1d9;
}

:root[data-theme="dark"] .theme-toggle.active {
  border-color: #8b949e;
  background: #0d1117;
  color: #f0f6fc;
}

:root[data-theme="dark"] .icon-button.danger,
:root[data-theme="dark"] .button.danger,
:root[data-theme="dark"] .danger-button {
  border-color: #8e2f2a;
  background: #2d1517;
  color: var(--danger);
}

:root[data-theme="dark"] .nav-item,
:root[data-theme="dark"] .collapse-button {
  color: #c9d1d9;
}

:root[data-theme="dark"] .nav-item:hover,
:root[data-theme="dark"] .nav-item.active {
  background: #21262d;
  color: #f0f6fc;
}

:root[data-theme="dark"] .catalog-switcher {
  background: transparent;
}

:root[data-theme="dark"] .catalog-tile {
  border-color: #30363d;
  background: #161b22;
  color: #c9d1d9;
}

:root[data-theme="dark"] .catalog-tile:hover {
  border-color: #6e7681;
  background: #21262d;
  color: #f0f6fc;
}

:root[data-theme="dark"] .catalog-tile.active {
  border-color: #8b949e;
  background: #2d333b;
  color: #f0f6fc;
  box-shadow: inset 3px 0 0 #f0f6fc;
}

:root[data-theme="dark"] .catalog-tile .icon {
  background: currentColor;
  opacity: 1;
}

:root[data-theme="dark"] .catalog-toolbar {
  border-color: var(--line);
  background: #161b22;
}

:root[data-theme="dark"] .catalog-table {
  background: #0d1117;
  color: var(--text);
}

:root[data-theme="dark"] .catalog-table tbody tr {
  background: #161b22;
}

:root[data-theme="dark"] .catalog-table tbody tr:hover {
  background: #1f242c;
}

:root[data-theme="dark"] .catalog-table td {
  border-color: var(--line);
  color: var(--text);
}

:root[data-theme="dark"] .catalog-table small,
:root[data-theme="dark"] .catalog-table .tiny {
  color: var(--muted);
}

:root[data-theme="dark"] th,
:root[data-theme="dark"] .tree-table thead th,
:root[data-theme="dark"] .catalog-table th,
:root[data-theme="dark"] .component-table th {
  border-color: var(--line);
  background: #161b22;
  color: #c9d1d9;
}

:root[data-theme="dark"] td,
:root[data-theme="dark"] th,
:root[data-theme="dark"] .brand,
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .collapse-button,
:root[data-theme="dark"] .modal header,
:root[data-theme="dark"] .modal footer,
:root[data-theme="dark"] .panel-heading,
:root[data-theme="dark"] .project-panel-head,
:root[data-theme="dark"] .project-chat-title,
:root[data-theme="dark"] .project-chat-compose,
:root[data-theme="dark"] .block-panel-head {
  border-color: var(--line);
}

:root[data-theme="dark"] tbody tr:hover,
:root[data-theme="dark"] .tree-row.project-row,
:root[data-theme="dark"] .tree-row.stage-row,
:root[data-theme="dark"] .tree-row.design-version-row,
:root[data-theme="dark"] .tree-row.planning-version-row,
:root[data-theme="dark"] .tree-row.construction-row,
:root[data-theme="dark"] .tree-row.version-row,
:root[data-theme="dark"] .tree-row.sold-construction-row,
:root[data-theme="dark"] .offer-row,
:root[data-theme="dark"] .design-selected-row,
:root[data-theme="dark"] .project-person-row,
:root[data-theme="dark"] .project-participant-card,
:root[data-theme="dark"] .project-participant-chip,
:root[data-theme="dark"] .user-select-option,
:root[data-theme="dark"] .chat-recipient-option,
:root[data-theme="dark"] .chat-recipient-chip,
:root[data-theme="dark"] .material-photo-placeholder,
:root[data-theme="dark"] .block-rule-row,
:root[data-theme="dark"] .block-hint-strip span,
:root[data-theme="dark"] .compact-help,
:root[data-theme="dark"] .metric-list span,
:root[data-theme="dark"] .dense-kpis > div {
  border-color: var(--line);
  background: #161b22;
  color: var(--text);
}

:root[data-theme="dark"] tbody tr:hover,
:root[data-theme="dark"] .offer-row:hover,
:root[data-theme="dark"] .project-participant-card:hover,
:root[data-theme="dark"] .chat-recipient-option:hover {
  background: #1f242c;
}

:root[data-theme="dark"] tbody tr.selected,
:root[data-theme="dark"] .offer-row.selected,
:root[data-theme="dark"] .project-participant-card.is-selected,
:root[data-theme="dark"] .chat-recipient-option.is-selected {
  background: #21262d;
  box-shadow: inset 3px 0 0 #8b949e;
}

:root[data-theme="dark"] .tree-table tbody tr:hover {
  background: var(--tree-hover-bg);
}

:root[data-theme="dark"] .tree-row.project-row {
  background: var(--tree-project-bg);
}

:root[data-theme="dark"] .tree-row.project-row td {
  border-top-color: var(--tree-project-separator);
}

:root[data-theme="dark"] .tree-row.stage-row {
  background: var(--tree-stage-bg);
}

:root[data-theme="dark"] .tree-row.consultation-row,
:root[data-theme="dark"] .tree-row.production-plan-row,
:root[data-theme="dark"] .tree-row.stage-task-row,
:root[data-theme="dark"] .tree-row.design-version-row,
:root[data-theme="dark"] .tree-row.planning-version-row,
:root[data-theme="dark"] .premium-tree-row {
  background: var(--tree-level-2-bg);
}

:root[data-theme="dark"] .tree-row.design-plan-row,
:root[data-theme="dark"] .tree-row.design-task-row,
:root[data-theme="dark"] .tree-row.production-plan-segment-row,
:root[data-theme="dark"] .tree-row.construction-row {
  background: var(--tree-level-3-bg);
}

:root[data-theme="dark"] .tree-row.version-row,
:root[data-theme="dark"] .tree-row.construction-meta-row,
:root[data-theme="dark"] .tree-row.empty-tree-row,
:root[data-theme="dark"] .tree-row.planning-tabs-row {
  background: var(--tree-level-4-bg);
}

:root[data-theme="dark"] .tree-row.sold-construction-row {
  background: var(--tree-sold-bg);
}

:root[data-theme="dark"] .project-participant-check,
:root[data-theme="dark"] .project-participant-chip button {
  border-color: var(--line-strong);
  background: #0d1117;
  color: var(--danger);
}

:root[data-theme="dark"] .project-participant-checkbox:checked + .project-participant-check {
  border-color: #f0f6fc;
  background: #f0f6fc;
}

:root[data-theme="dark"] .project-participant-checkbox:checked + .project-participant-check::after {
  border-color: #0d1117;
}

:root[data-theme="dark"] .project-stage-menu-panel,
:root[data-theme="dark"] .project-stage-menu-action {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

:root[data-theme="dark"] .project-stage-menu-action:hover {
  background: var(--surface-strong);
  color: #f0f6fc;
}

:root[data-theme="dark"] .money {
  color: var(--green);
}

:root[data-theme="dark"] .status-pill {
  border-color: #2f6f43;
  background: #16351f;
  color: #56d364;
}

:root[data-theme="dark"] .status-pill.quote {
  border-color: #3d444d;
  background: #21262d;
  color: #c9d1d9;
}

:root[data-theme="dark"] .status-pill.done {
  border-color: #2f6f43;
  background: #15351f;
  color: #56d364;
}

:root[data-theme="dark"] .status-pill.error {
  border-color: #8e2f2a;
  background: #2d1517;
  color: var(--danger);
}

:root[data-theme="dark"] .status-pill.legacy {
  border-color: rgba(46, 144, 250, 0.58);
  background: rgba(24, 73, 169, 0.30);
  color: #b2ddff;
}

:root[data-theme="dark"] .status-pill.pending {
  border-color: #6f4f1f;
  background: #2f260d;
  color: #e3b341;
}

:root[data-theme="dark"] .modal-backdrop {
  background: rgba(1, 4, 9, 0.72);
}

:root[data-theme="dark"] .chat-bubble {
  border-color: #2f6f43;
  background: #143a24;
  color: var(--text);
}

:root[data-theme="dark"] .chat-message.own .chat-bubble {
  border-color: #30363d;
  background: #21262d;
}

:root[data-theme="dark"] .chat-attachment,
:root[data-theme="dark"] .chat-attachment-panel,
:root[data-theme="dark"] .resource-menu-panel {
  border-color: var(--line);
  background: #161b22;
  color: var(--text);
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .file-drop-zone,
:root[data-theme="dark"] .offer-thumb-card,
:root[data-theme="dark"] .offer-thumb-card.placeholder,
:root[data-theme="dark"] .offer-thumb-fallback,
:root[data-theme="dark"] .pdf-thumb-card,
:root[data-theme="dark"] .pdf-thumb,
:root[data-theme="dark"] .pdf-thumb-main,
:root[data-theme="dark"] .block-image-preview,
:root[data-theme="dark"] .material-photo-preview {
  border-color: var(--line);
  background: #0d1117;
  color: var(--muted);
}

:root[data-theme="dark"] .pdf-thumb-actions,
:root[data-theme="dark"] .pdf-thumb-actions a,
:root[data-theme="dark"] .pdf-thumb-actions button {
  border-color: var(--line);
  color: #f0f6fc;
}

:root[data-theme="dark"] .currency-field span {
  background: #0d1117;
  color: var(--text);
}

:root[data-theme="dark"] .toast {
  border-color: var(--line);
  background: #161b22;
  color: var(--text);
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .modal.catalog-modal.material-modal .material-editor-form,
:root[data-theme="dark"] .modal.catalog-modal.material-modal .material-editor-main {
  background: #0d1117;
}

:root[data-theme="dark"] .modal.catalog-modal.material-modal .material-editor-side,
:root[data-theme="dark"] .modal.catalog-modal.material-modal .material-editor-panel,
:root[data-theme="dark"] .modal.catalog-modal.material-modal .material-metric-card {
  border-color: #30363d;
  background: #161b22;
  color: var(--text);
}

:root[data-theme="dark"] .modal.catalog-modal.material-modal .material-side-section,
:root[data-theme="dark"] .modal.catalog-modal.material-modal .material-panel-head {
  border-color: #30363d;
}

:root[data-theme="dark"] .modal.catalog-modal.material-modal .block-side-title,
:root[data-theme="dark"] .modal.catalog-modal.material-modal .material-panel-head h3,
:root[data-theme="dark"] .modal.catalog-modal.material-modal .material-metric-head span {
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.material-modal .material-panel-head > span,
:root[data-theme="dark"] .modal.catalog-modal.material-modal .material-metric-head strong,
:root[data-theme="dark"] .modal.catalog-modal.material-modal .block-image-source,
:root[data-theme="dark"] .modal.catalog-modal.material-modal .material-summary-strip span {
  color: #c9d1d9;
}

:root[data-theme="dark"] .modal.catalog-modal.material-modal .block-image-source,
:root[data-theme="dark"] .modal.catalog-modal.material-modal .material-summary-strip span {
  border-color: #30363d;
  background: #21262d;
}

:root[data-theme="dark"] .modal.catalog-modal.material-modal .material-summary-strip strong {
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.material-modal input,
:root[data-theme="dark"] .modal.catalog-modal.material-modal select {
  border-color: #3d444d;
  background: #0d1117;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.material-modal .rich-toolbar button,
:root[data-theme="dark"] .modal.catalog-modal.material-modal .rich-toolbar select,
:root[data-theme="dark"] .modal.catalog-modal.material-modal .rich-image-button {
  border-color: #3d444d;
  background: #0d1117;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-editor-form,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-editor-main {
  background: #0d1117;
}

:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-editor-side,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-editor-panel,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-card-preview,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .client-owner-card,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .client-contact-stat,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-contact-row,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-attachment-item,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-attachment-dropdown {
  border-color: #30363d;
  background: #161b22;
  color: var(--text);
}

:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-side-section,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .material-panel-head {
  border-color: #30363d;
}

:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .block-side-title,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .material-panel-head h3,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-card-preview strong,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .client-owner-card strong,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .client-contact-stat strong,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-attachment-menu summary,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-attachment-dropdown a,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-attachment-dropdown span {
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .material-panel-head > span,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-card-preview span,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-card-preview small,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .client-owner-card span,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .client-contact-stat span,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-attachment-item small {
  color: #c9d1d9;
}

:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-logo-preview,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-logo-placeholder,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .logo-preview-click.is-empty,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-price-empty {
  border-color: #30363d;
  background: #0d1117;
  color: #c9d1d9;
}

:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .logo-preview-empty-text,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .logo-preview-initials {
  color: #c9d1d9;
}

:root[data-theme="dark"] .modal.catalog-modal.supplier-modal input,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal select {
  border-color: #3d444d;
  background: #0d1117;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .rich-toolbar button,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .rich-toolbar select,
:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .rich-image-button {
  border-color: #3d444d;
  background: #0d1117;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.supplier-modal .supplier-attachment-dropdown a:hover {
  background: #21262d;
}

:root[data-theme="dark"] .modal.catalog-modal.crew-modal .installation-crew-editor-form,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal .crew-editor-main {
  background: #0d1117;
}

:root[data-theme="dark"] .modal.catalog-modal.crew-modal .crew-editor-side,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal .crew-editor-panel,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal .crew-side-card.crew-notes-panel,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal .supplier-card-preview,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal .crew-rates-panel .table-wrap {
  border-color: #30363d;
  background: #161b22;
  color: var(--text);
}

:root[data-theme="dark"] .modal.catalog-modal.crew-modal .supplier-logo-preview,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal .supplier-logo-placeholder,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal .logo-preview-click.is-empty {
  border-color: #30363d;
  background: #0d1117;
  color: #c9d1d9;
}

:root[data-theme="dark"] .modal.catalog-modal.crew-modal .logo-preview-empty-text,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal .logo-preview-initials {
  color: #c9d1d9;
}

:root[data-theme="dark"] .modal.catalog-modal.crew-modal .material-panel-head,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal .block-side-title,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal .material-panel-head h3,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal .supplier-card-preview strong {
  border-color: #30363d;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.crew-modal .material-panel-head > span,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal .supplier-card-preview span,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal .supplier-card-preview small {
  color: #c9d1d9;
}

:root[data-theme="dark"] .modal.catalog-modal.crew-modal .crew-rates-table th,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal .crew-rates-table td {
  border-color: #30363d;
}

:root[data-theme="dark"] .modal.catalog-modal.crew-modal .crew-rates-table th {
  background: #161b22;
  color: #c9d1d9;
}

:root[data-theme="dark"] .modal.catalog-modal.crew-modal input,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal select,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal textarea,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal .rich-toolbar button,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal .rich-toolbar select,
:root[data-theme="dark"] .modal.catalog-modal.crew-modal .rich-image-button {
  border-color: #3d444d;
  background: #0d1117;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.transport-modal .transport-editor-form,
:root[data-theme="dark"] .modal.catalog-modal.transport-modal .transport-editor-main {
  background: #0d1117;
}

:root[data-theme="dark"] .modal.catalog-modal.transport-modal .transport-editor-side,
:root[data-theme="dark"] .modal.catalog-modal.transport-modal .transport-side-card,
:root[data-theme="dark"] .modal.catalog-modal.transport-modal .transport-editor-panel,
:root[data-theme="dark"] .modal.catalog-modal.transport-modal .transport-dimension-preview,
:root[data-theme="dark"] .modal.catalog-modal.transport-modal .transport-dimension-fields {
  border-color: #30363d;
  background: #161b22;
  color: var(--text);
}

:root[data-theme="dark"] .modal.catalog-modal.transport-modal .block-side-title,
:root[data-theme="dark"] .modal.catalog-modal.transport-modal .transport-group-label,
:root[data-theme="dark"] .modal.catalog-modal.transport-modal .transport-dimensions-row label span,
:root[data-theme="dark"] .modal.catalog-modal.transport-modal .material-panel-head h3,
:root[data-theme="dark"] .modal.catalog-modal.transport-modal .transport-side-card > strong,
:root[data-theme="dark"] .modal.catalog-modal.transport-modal .transport-summary-grid strong,
:root[data-theme="dark"] .modal.catalog-modal.transport-modal .transport-dimension-preview {
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.transport-modal .material-panel-head > span,
:root[data-theme="dark"] .modal.catalog-modal.transport-modal .transport-side-card > span,
:root[data-theme="dark"] .modal.catalog-modal.transport-modal .transport-summary-grid span {
  color: #c9d1d9;
}

:root[data-theme="dark"] .modal.catalog-modal.transport-modal .transport-mode-badge {
  border-color: #3d444d;
  background: #21262d;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.transport-modal input,
:root[data-theme="dark"] .modal.catalog-modal.transport-modal select,
:root[data-theme="dark"] .modal.catalog-modal.transport-modal .rich-toolbar button,
:root[data-theme="dark"] .modal.catalog-modal.transport-modal .rich-toolbar select,
:root[data-theme="dark"] .modal.catalog-modal.transport-modal .rich-image-button {
  border-color: #3d444d;
  background: #0d1117;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .work-service-editor-form,
:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .work-service-editor-main {
  background: #0d1117;
}

:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .work-service-editor-side,
:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .work-service-side-card,
:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .work-service-editor-panel,
:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .work-service-supplier-preview {
  border-color: #30363d;
  background: #161b22;
  color: var(--text);
}

:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .block-side-title,
:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .material-panel-head h3,
:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .work-service-side-card > strong,
:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .transport-summary-grid strong,
:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .work-service-supplier-preview {
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .material-panel-head > span,
:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .work-service-side-card > span,
:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .transport-summary-grid span {
  color: #c9d1d9;
}

:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .transport-mode-badge {
  border-color: #3d444d;
  background: #21262d;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.work-service-modal input,
:root[data-theme="dark"] .modal.catalog-modal.work-service-modal select,
:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .rich-toolbar button,
:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .rich-toolbar select,
:root[data-theme="dark"] .modal.catalog-modal.work-service-modal .rich-image-button {
  border-color: #3d444d;
  background: #0d1117;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-editor-form,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-editor-main {
  background: #0d1117;
}

:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-editor-side,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-editor-panel,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-rule-row,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-cost-panel .table-wrap {
  border-color: #30363d;
  background: #161b22;
  color: var(--text);
}

:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-side-section,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-panel-head {
  border-color: #30363d;
}

:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-side-title,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .component-table-title,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-panel-head h3,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .checkbox-line,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .component-table tfoot td {
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-panel-head span,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-image-source,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-hint-strip span,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-cost-summary span {
  color: #c9d1d9;
}

:root[data-theme="dark"] .modal.catalog-modal.block-modal .component-table th,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .component-table td {
  border-color: #30363d;
  background: #0d1117;
  color: #e6edf3;
}

:root[data-theme="dark"] .modal.catalog-modal.block-modal .component-table th,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-cost-panel .component-table th {
  background: #161b22;
  color: #c9d1d9;
}

:root[data-theme="dark"] .modal.catalog-modal.block-modal .component-table tfoot td {
  background: #21262d;
}

:root[data-theme="dark"] .modal.catalog-modal.block-modal .component-picker input,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .component-picker select,
:root[data-theme="dark"] .modal.catalog-modal.block-modal input,
:root[data-theme="dark"] .modal.catalog-modal.block-modal select {
  border-color: #3d444d;
  background: #0d1117;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-image-source,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-hint-strip span,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-cost-summary span {
  border-color: #30363d;
  background: #21262d;
}

:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-cost-summary strong {
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-cost-summary .block-grand-total {
  border-color: #8b949e;
  background: #2d333b;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.catalog-modal.block-modal .block-image-preview,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .material-photo-placeholder {
  border-color: #30363d;
  background: #0d1117;
  color: #c9d1d9;
}

:root[data-theme="dark"] .modal.catalog-modal.block-modal .rich-toolbar button,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .rich-toolbar select,
:root[data-theme="dark"] .modal.catalog-modal.block-modal .rich-image-button {
  border-color: #3d444d;
  background: #0d1117;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.offer-modal .offer-builder,
:root[data-theme="dark"] .modal.offer-modal .offer-section {
  background: #0d1117;
}

:root[data-theme="dark"] .modal.offer-modal .offer-builder-head,
:root[data-theme="dark"] .modal.offer-modal .offer-filter-panel,
:root[data-theme="dark"] .modal.offer-modal .offer-row,
:root[data-theme="dark"] .modal.offer-modal .offer-filter-card,
:root[data-theme="dark"] .modal.offer-modal .offer-filter-group,
:root[data-theme="dark"] .modal.offer-modal .offer-notes-panel,
:root[data-theme="dark"] .modal.offer-modal .offer-card-metrics > span {
  border-color: #30363d;
  background: #161b22;
  color: var(--text);
}

:root[data-theme="dark"] .modal.offer-modal .offer-row.selected {
  border-color: #6e7681;
  background: #161b22;
  box-shadow: inset 3px 0 0 #8b949e;
}

:root[data-theme="dark"] .modal.offer-modal .offer-title-total strong,
:root[data-theme="dark"] .modal.offer-modal .offer-panel-title strong,
:root[data-theme="dark"] .modal.offer-modal .offer-section-title h3,
:root[data-theme="dark"] .modal.offer-modal .offer-card-title strong,
:root[data-theme="dark"] .modal.offer-modal .offer-card-metrics > span {
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.offer-modal .offer-builder-head > span,
:root[data-theme="dark"] .modal.offer-modal .offer-card-title span,
:root[data-theme="dark"] .modal.offer-modal .offer-card-client,
:root[data-theme="dark"] .modal.offer-modal .offer-row small,
:root[data-theme="dark"] .modal.offer-modal .offer-card-metrics b,
:root[data-theme="dark"] .modal.offer-modal .offer-panel-title span,
:root[data-theme="dark"] .modal.offer-modal .offer-section-title span {
  color: #8b949e;
}

:root[data-theme="dark"] .modal.offer-modal .offer-title-total span,
:root[data-theme="dark"] .modal.offer-modal .offer-price-tag {
  border-color: #2f6f43;
  background: #15351f;
  color: #56d364;
}

:root[data-theme="dark"] .modal.offer-modal .offer-builder-head > span {
  border-color: #30363d;
  background: #21262d;
}

:root[data-theme="dark"] .modal.offer-modal .offer-attractions-preview-button {
  border-color: #3d444d;
  background: #0d1117;
  color: #79c0ff;
}

:root[data-theme="dark"] .modal.offer-modal .offer-attractions-preview-button:hover:not(:disabled) {
  border-color: #58a6ff;
  background: #161b22;
}

:root[data-theme="dark"] .modal.offer-modal .offer-attractions-preview-button:disabled {
  color: #8b949e;
}

:root[data-theme="dark"] .offer-attractions-popover {
  border-color: #30363d;
  background: #0d1117;
  color: #f0f6fc;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] .offer-attractions-popover-head {
  border-color: #30363d;
  background: #161b22;
}

:root[data-theme="dark"] .offer-attractions-popover-head span,
:root[data-theme="dark"] .offer-attractions-popover-list p {
  color: #8b949e;
}

:root[data-theme="dark"] .offer-attractions-popover-row {
  border-color: #30363d;
  background: #161b22;
}

:root[data-theme="dark"] .offer-attractions-popover-row strong {
  background: #1f2d3d;
  color: #79c0ff;
}

:root[data-theme="dark"] .modal.offer-modal input,
:root[data-theme="dark"] .modal.offer-modal select,
:root[data-theme="dark"] .modal.offer-modal .rich-toolbar button,
:root[data-theme="dark"] .modal.offer-modal .rich-toolbar select,
:root[data-theme="dark"] .modal.offer-modal .rich-image-button {
  border-color: #3d444d;
  background: #0d1117;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.offer-modal .offer-links a {
  border-color: #3d444d;
  background: #21262d;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.offer-modal .offer-file-empty {
  border-color: #30363d;
  background: #0d1117;
  color: #8b949e;
}

:root[data-theme="dark"] .modal.design-modal .design-editor-shell,
:root[data-theme="dark"] .modal.construction-modal .construction-editor-form {
  background: #0d1117;
}

:root[data-theme="dark"] .modal.design-modal .context-tabs,
:root[data-theme="dark"] .modal.construction-modal .context-tabs,
:root[data-theme="dark"] .modal.design-modal .form-panel,
:root[data-theme="dark"] .modal.construction-modal .form-panel,
:root[data-theme="dark"] .modal.design-modal .design-construction-sidebar,
:root[data-theme="dark"] .modal.construction-modal .design-construction-sidebar,
:root[data-theme="dark"] .modal.design-modal .design-summary-card,
:root[data-theme="dark"] .modal.construction-modal .design-summary-card,
:root[data-theme="dark"] .modal.design-modal .design-construction-card,
:root[data-theme="dark"] .modal.construction-modal .design-construction-card,
:root[data-theme="dark"] .modal.design-modal .design-construction-card-stats span,
:root[data-theme="dark"] .modal.construction-modal .design-construction-card-stats span,
:root[data-theme="dark"] .modal.design-modal .design-type-popover,
:root[data-theme="dark"] .modal.design-modal .design-calendar-card .design-timeline-preview,
:root[data-theme="dark"] .modal.construction-modal .readout-grid div {
  border-color: #30363d;
  background: #161b22;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.design-modal .context-tab.active,
:root[data-theme="dark"] .modal.construction-modal .context-tab.active,
:root[data-theme="dark"] .modal.design-modal .design-summary-card.active,
:root[data-theme="dark"] .modal.construction-modal .design-summary-card.active,
:root[data-theme="dark"] .modal.design-modal .design-construction-card.active,
:root[data-theme="dark"] .modal.construction-modal .design-construction-card.active {
  border-color: #30363d;
  background: #161b22;
  color: #f0f6fc;
  box-shadow: inset 3px 0 0 #8b949e;
}

:root[data-theme="dark"] .modal.design-modal .form-panel-head h3,
:root[data-theme="dark"] .modal.construction-modal .form-panel-head h3,
:root[data-theme="dark"] .modal.design-modal .readout-grid strong,
:root[data-theme="dark"] .modal.construction-modal .readout-grid strong,
:root[data-theme="dark"] .modal.design-modal .design-summary-card span,
:root[data-theme="dark"] .modal.construction-modal .design-summary-card span,
:root[data-theme="dark"] .modal.design-modal .design-construction-card-title,
:root[data-theme="dark"] .modal.construction-modal .design-construction-card-title,
:root[data-theme="dark"] .modal.design-modal .design-construction-card-stats span,
:root[data-theme="dark"] .modal.construction-modal .design-construction-card-stats span {
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.design-modal .form-panel-head span,
:root[data-theme="dark"] .modal.construction-modal .form-panel-head span,
:root[data-theme="dark"] .modal.design-modal .readout-grid span,
:root[data-theme="dark"] .modal.construction-modal .readout-grid span,
:root[data-theme="dark"] .modal.construction-modal .bom-action-row span,
:root[data-theme="dark"] .modal.design-modal .design-summary-card small,
:root[data-theme="dark"] .modal.construction-modal .design-summary-card small,
:root[data-theme="dark"] .modal.design-modal .design-construction-card-meta,
:root[data-theme="dark"] .modal.construction-modal .design-construction-card-meta,
:root[data-theme="dark"] .modal.design-modal .design-construction-card-stats b,
:root[data-theme="dark"] .modal.construction-modal .design-construction-card-stats b {
  color: #8b949e;
}

:root[data-theme="dark"] .modal.design-modal input,
:root[data-theme="dark"] .modal.design-modal select,
:root[data-theme="dark"] .modal.construction-modal input,
:root[data-theme="dark"] .modal.construction-modal select,
:root[data-theme="dark"] .modal.design-modal .rich-toolbar button,
:root[data-theme="dark"] .modal.design-modal .rich-toolbar select,
:root[data-theme="dark"] .modal.design-modal .rich-image-button,
:root[data-theme="dark"] .modal.construction-modal .rich-toolbar button,
:root[data-theme="dark"] .modal.construction-modal .rich-toolbar select,
:root[data-theme="dark"] .modal.construction-modal .rich-image-button {
  border-color: #3d444d;
  background: #0d1117;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.planning-modal .planning-editor-shell {
  background: #0d1117;
}

:root[data-theme="dark"] .modal.planning-modal .planning-panel,
:root[data-theme="dark"] .modal.planning-modal .planning-construction-matrix,
:root[data-theme="dark"] .modal.planning-modal .planning-construction-head,
:root[data-theme="dark"] .modal.planning-modal .user-select-option {
  border-color: #30363d;
  background: #161b22;
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.planning-modal .form-panel-head h3,
:root[data-theme="dark"] .modal.planning-modal .planning-construction-name strong {
  color: #f0f6fc;
}

:root[data-theme="dark"] .modal.planning-modal .form-panel-head span,
:root[data-theme="dark"] .modal.planning-modal .planning-construction-head,
:root[data-theme="dark"] .modal.planning-modal .planning-construction-name small,
:root[data-theme="dark"] .modal.planning-modal .planning-construction-row .planning-construction-meta,
:root[data-theme="dark"] .modal.planning-modal .technical-bom-compact span {
  color: #8b949e;
}

:root[data-theme="dark"] .modal.planning-modal input,
:root[data-theme="dark"] .modal.planning-modal select,
:root[data-theme="dark"] .modal.planning-modal textarea,
:root[data-theme="dark"] .modal.planning-modal .rich-toolbar button,
:root[data-theme="dark"] .modal.planning-modal .rich-toolbar select,
:root[data-theme="dark"] .modal.planning-modal .rich-image-button {
  border-color: #3d444d;
  background: #0d1117;
  color: #f0f6fc;
}

@media (max-width: 980px) {
  .calculation-page,
  .compact-calculation-page,
  .block-editor-form,
  .material-editor-form,
  .material-card-form {
    grid-template-columns: 1fr;
  }

  .modal.catalog-modal.material-modal > form#catalog-form {
    overflow: auto;
  }

  .material-editor-form {
    height: auto;
  }

  .material-editor-side,
  .material-editor-main {
    overflow: visible;
  }

  .dense-kpis,
  .compact-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .modal.design-modal .design-workspace,
  .modal.construction-modal .design-workspace {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .modal.design-modal .design-construction-sidebar,
  .modal.construction-modal .design-construction-sidebar {
    max-height: 300px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .modal.design-modal .design-editor-body,
  .modal.construction-modal .construction-editor-grid {
    overflow: visible;
  }
}

@media (max-width: 1180px) {
  .modal.catalog-modal.block-modal > form#catalog-form {
    overflow: auto;
  }

  .modal.catalog-modal.block-modal .block-editor-form {
    grid-template-columns: 1fr;
    height: auto;
  }

  .modal.catalog-modal.block-modal .block-editor-side,
  .modal.catalog-modal.block-modal .block-editor-main {
    overflow: visible;
  }

  .modal.catalog-modal.block-modal .block-image-preview-large {
    min-height: 240px;
    max-height: 360px;
  }
}

/* Wspolny uklad okien, formularzy i ustawien.
   UWAGA: offer-backdrop NIE moze tu byc — okno ofert jest pelnoekranowe
   (.modal.offer-modal.full-height: width:100vw/height:100dvh), wiec kazdy
   padding tla spycha je poza ekran i przycina stopke z przyciskami.
   Jego padding:0 ustawia .modal-backdrop.offer-backdrop wyzej. */
.modal-backdrop.calculation-backdrop,
.modal-backdrop.project-backdrop,
.modal-backdrop.planning-backdrop,
.modal-backdrop.editor-backdrop {
  padding: 12px;
}

.modal.project-modal.full-height {
  width: min(1240px, 100%);
  height: min(900px, 100%);
  max-height: 100%;
  border-radius: var(--radius);
}

.modal.project-modal.project-form-only {
  width: min(740px, calc(100vw - 24px));
  height: auto;
  max-height: min(900px, 100%);
  /* Flex: formularz zawsze mieści się MIĘDZY nagłówkiem a stopką (stary calc(100dvh-104px) liczył od viewportu,
     więc form wystawał pod stopkę i shellowy overflow:hidden ucinał dolny padding/ramkę edytora). */
  display: flex;
  flex-direction: column;
}

.modal.project-modal.project-form-only > header,
.modal.project-modal.project-form-only > footer {
  flex: 0 0 auto;
}

.modal.project-modal.project-form-only .project-editor-shell-no-chat {
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.modal.project-modal.project-form-only .project-card-form {
  height: auto;
  max-height: none;
  min-height: 0;
  overflow: auto;
  scroll-padding-bottom: 20px;
  /* Stack ma rosnąć z treścią (scroll w formie), a nie być rozciągany do okna formy — inaczej treść wystaje i zakrywa dolny padding. */
  grid-template-rows: max-content;
  align-content: start;
}

.modal.project-modal.project-form-only .project-card-stack {
  grid-auto-rows: max-content;
  align-content: start;
}

/* Bez wewnętrznej „białej karty w ramce": jedna biała powierzchnia formularza — mniejsze marginesy, szersze pola.
   Bije !important z theme-premium (.project-editor-shell/.project-card-form/.project-card-stack) wyższą specyficznością. */
.modal.project-modal.project-form-only .project-editor-shell,
.modal.project-modal.project-form-only .project-card-form {
  background: var(--surface) !important;
}

.modal.project-modal.project-form-only .project-card-form {
  padding: 12px 20px 20px !important;
}

.modal.project-modal.project-form-only .project-card-stack,
.modal.project-modal.project-form-only .project-status-card {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.modal.project-modal.project-form-only .project-address-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

/* Spójny standard pól jak w całej aplikacji (theme-premium): 32px / 12.5px — adres NIE odstaje. */
.modal.project-modal.project-form-only .project-address-row input[name="address"] {
  min-height: 32px;
  height: 32px;
  font-size: 12.5px;
  font-weight: 500;
}

.modal.project-modal.project-form-only .project-address-row .button {
  justify-self: end;
  min-height: 32px;
  height: 32px;
  padding: 0 12px;
  white-space: nowrap;
}

/* Przyciski w formularzu czytelne i spójne z polami (mini=9px było nieczytelnym miszmaszem). */
.modal.project-modal.project-form-only .project-card-stack .button {
  min-height: 32px;
  font-size: 11px;
  font-weight: 700;
}

/* „Edytuj projekt" (z czatem) — TA SAMA płaska prawa strona (formularz) co „Nowy projekt":
   bez wewnętrznej białej karty w ramce, biała powierzchnia formularza, czytelne przyciski.
   Scoped do selektorów formularza + :not(.project-form-only) — czat (.project-chat-panel) NIETKNIĘTY. */
.modal.project-modal:not(.project-form-only) .project-card-form {
  background: var(--surface) !important;
}

.modal.project-modal:not(.project-form-only) .project-card-stack,
.modal.project-modal:not(.project-form-only) .project-status-card {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.modal.project-modal:not(.project-form-only) .project-card-stack .button {
  min-height: 32px;
  font-size: 11px;
  font-weight: 700;
}

.modal.project-modal.project-form-only .project-field-card,
.modal.project-modal.project-form-only .project-description-card,
.modal.project-modal.project-form-only .project-participants-card {
  align-content: start;
  min-height: auto;
}

.modal.project-modal.project-form-only .project-participants-card {
  min-height: 66px;
}

.modal.project-modal.project-form-only .project-description-card .rich-editable {
  min-height: 118px;
}

.modal.calculation-modal.full-height {
  width: min(1720px, 100%);
  min-width: 0;
  max-width: 100%;
  height: min(940px, 100%);
  min-height: 0;
  max-height: 100%;
  border-radius: var(--radius);
}

.modal.calculation-modal header,
.modal.construction-modal header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 10px;
}

.modal.calculation-modal header h2,
.modal.construction-modal header h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
}

.modal.construction-modal header > div {
  display: grid;
  justify-items: center;
  align-content: center;
  min-width: 0;
  text-align: center;
}

.modal.construction-modal header p {
  margin: 2px 0 0;
  text-align: center;
}

.modal.construction-modal header {
  display: flex;
  justify-content: center;
  padding-right: 58px;
  padding-left: 58px;
}

.modal.construction-modal header > div {
  width: 100%;
}

.modal.construction-modal header > .icon-button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.modal.design-modal header {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 56px;
  padding-right: 58px;
  padding-left: 58px;
}

.modal.design-modal header > div {
  display: grid;
  width: 100%;
  min-width: 0;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.modal.design-modal header p {
  margin: 2px 0 0;
  text-align: center;
}

.modal.design-modal header > .icon-button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.modal.calculation-modal.full-height > .calculation-shell {
  grid-template-columns: clamp(320px, 24vw, 420px) minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.modal.calculation-modal .calculation-command-panel {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.modal.calculation-modal .calculation-command-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(260px, 0.9fr) minmax(340px, 1fr);
  align-items: start;
  gap: 12px;
}

.modal.calculation-modal .calculation-command-section {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.modal.calculation-modal .calc-command-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.modal.calculation-modal .compact-import-drop {
  min-width: 0;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.modal.calculation-modal .compact-import-drop .upload-button {
  min-height: 34px;
}

.modal.calculation-modal .bom-library-switch.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  overflow: visible;
  border: 0;
  background: transparent;
}

.modal.calculation-modal .bom-library-switch.segmented button {
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: var(--button-radius);
  padding: 0 11px;
  background: var(--surface);
  font-size: 11px;
}

.modal.calculation-modal .bom-library-switch.segmented button.active {
  border-color: var(--navy);
  background: var(--navy);
  color: #ffffff;
}

.modal.calculation-modal .calculation-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.modal.calculation-modal .calculation-action-bar .button,
.modal.calculation-modal .calculation-action-bar .primary-button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.modal.calculation-modal .validation-title-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.modal.calculation-modal .validation-head {
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.modal.calculation-modal .validation-head .validation-stats {
  justify-self: center;
}

.modal.calculation-modal .validation-head > p:last-child {
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}

.modal.calculation-modal .validation-result-pane {
  overflow: hidden;
}

.modal.calculation-modal .validation-result-pane .table-wrap,
.modal.calculation-modal .validation-result-pane .validation-scroll {
  max-height: 100%;
  overflow: auto;
  padding-bottom: 28px;
  scroll-padding-bottom: 28px;
  scrollbar-gutter: stable;
}

.modal.calculation-modal .bom-validation-table {
  width: 100%;
  min-width: 1580px;
  margin-bottom: 20px;
}

.modal.calculation-modal .bom-validation-table th:nth-child(6),
.modal.calculation-modal .bom-validation-table td:nth-child(6) {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 460px;
  min-width: 460px;
  overflow: visible;
  text-align: right;
}

.modal.calculation-modal .bom-validation-table th:nth-child(6) {
  z-index: 3;
  background: var(--surface-muted);
}

.modal.calculation-modal .bom-validation-table tr.is-error td:nth-child(6) {
  background: var(--bom-error-bg);
}

.modal.calculation-modal .bom-validation-table tr.is-legacy td:nth-child(6) {
  background: var(--bom-legacy-bg);
}

.modal.calculation-modal .bom-validation-table tr.is-warning td:nth-child(6) {
  background: var(--bom-warning-bg);
}

.modal.calculation-modal .bom-validation-table tr.is-ok td:nth-child(6) {
  background: var(--bom-ok-bg);
}

.modal.calculation-modal .bom-validation-table .bom-row-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
  width: 100%;
  min-width: max-content;
  max-width: none;
}

.modal.calculation-modal .bom-validation-table .button.mini {
  min-height: 26px;
  min-width: 0;
  padding: 0 8px;
  font-size: 10px;
  white-space: nowrap;
}

.modal.construction-modal.full-height {
  width: min(1600px, 100%);
  max-width: 100%;
  height: min(940px, 100%);
  max-height: 100%;
  border-radius: var(--radius);
}

.modal.construction-modal .construction-editor-grid {
  grid-template-columns: minmax(0, 1fr) minmax(430px, 470px);
  gap: 10px;
  padding: 10px 12px;
}

.modal.construction-modal .construction-main-stack {
  overflow: hidden;
}

.modal.construction-modal .construction-side-stack {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.modal.construction-modal .construction-presentation-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.modal.construction-modal .construction-presentation-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.modal.construction-modal .construction-presentation-upload .upload-button,
.modal.construction-modal .construction-presentation-upload .button {
  width: 100%;
}

.modal.construction-modal .construction-presentation-list {
  width: 100%;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 0;
  scrollbar-gutter: auto;
}

.modal.construction-modal .construction-presentation-empty {
  display: grid;
  place-items: center;
  width: 100%;
  justify-self: stretch;
  box-sizing: border-box;
  min-height: 180px;
  height: min(26dvh, 240px);
  max-height: 240px;
}

.modal.construction-modal .construction-bom-quick-check {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  height: clamp(250px, 30dvh, 330px);
  max-height: clamp(250px, 30dvh, 330px);
}

.modal.construction-modal .construction-bom-quick-list {
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-bottom: 18px;
  scroll-padding-bottom: 18px;
  scrollbar-gutter: stable;
}

.modal.construction-modal .construction-bom-quick-row,
.modal.construction-modal .construction-bom-quick-more,
.modal.construction-modal .construction-bom-quick-empty {
  padding-top: 5px;
  padding-bottom: 5px;
}

.settings-header {
  margin-bottom: 8px;
}

.settings-page {
  width: 100%;
  max-width: 720px;
  margin: 0;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px);
  gap: 12px;
  align-items: start;
  justify-content: start;
}

.settings-column {
  display: contents;
}

.settings-panel {
  overflow: hidden;
}

.settings-panel.settings-collapsible.is-collapsed > :not(.panel-heading) {
  display: none;
}

.settings-panel .panel-heading {
  min-height: 44px;
  padding: 8px 10px;
  align-items: center;
}

.settings-panel .settings-accordion-heading {
  cursor: pointer;
  gap: 10px;
  user-select: none;
}

.settings-panel .settings-accordion-heading:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.settings-panel .settings-accordion-heading > div {
  min-width: 0;
}

.settings-accordion-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--primary);
  background: var(--surface);
}

.settings-accordion-icon::before {
  content: ">";
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.16s ease;
}

.settings-panel:not(.is-collapsed) .settings-accordion-icon::before {
  transform: rotate(90deg);
}

.settings-panel .panel-heading h2 {
  font-size: 13px;
}

.settings-panel .panel-heading p {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.25;
}

.settings-form-body {
  display: grid;
  gap: 9px;
  padding: 10px;
}

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

.settings-image-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.settings-image-preview {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 104px;
  height: 76px;
  padding: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: transparent;
  background-image:
    linear-gradient(45deg, rgba(148, 163, 184, 0.2) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.2) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.2) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.2) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-align: center;
}

.settings-image-preview img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.settings-image-preview.user-photo-preview-small {
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: 50%;
}

.settings-image-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.settings-image-actions strong,
.settings-image-actions span {
  flex: 0 0 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-image-actions strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.settings-image-actions span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 3px;
}

.settings-actions .button,
.settings-actions .primary-button,
.settings-image-actions .button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 800;
}

.settings-panel .list-row,
.settings-note {
  min-height: 34px;
  padding: 7px 8px;
}

.settings-panel .list-row span,
.settings-note span {
  min-width: 0;
}

.settings-panel .list-row strong,
.settings-note strong {
  overflow-wrap: anywhere;
  text-align: right;
}

.settings-switch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.settings-switch-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.settings-switch-row strong {
  font-size: 12px;
}

.settings-switch-row small,
.settings-help {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}

.settings-switch-row input[type="checkbox"] {
  width: 38px;
  min-width: 38px;
  min-height: 22px;
}

.settings-control-group {
  display: grid;
  gap: 8px;
}

.settings-control-group.is-disabled {
  opacity: 0.62;
}

.app-busy-fallback:empty,
.app-busy-fallback[hidden] {
  display: none;
}

.app-busy-mark img:not([hidden]) {
  display: block;
  z-index: 3;
}

:root[data-theme="dark"] .settings-panel,
:root[data-theme="dark"] .settings-switch-row {
  border-color: #30363d;
  background: #161b22;
}

:root[data-theme="dark"] .settings-image-preview,
:root[data-theme="dark"] .settings-control-group.is-disabled {
  color: #8b949e;
}

@media (max-width: 1180px) {
  .modal.calculation-modal.full-height > .calculation-shell {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .modal.calculation-modal .calculation-workspace,
  .modal.calculation-modal .calculation-sidebar {
    overflow: visible;
  }

  .modal.calculation-modal .calculation-command-grid,
  .modal.construction-modal .construction-editor-grid {
    grid-template-columns: 1fr;
  }

  .settings-layout {
    grid-template-columns: minmax(0, 640px);
    max-width: 640px;
  }

  .modal.construction-modal .construction-side-stack {
    overflow: visible;
  }
}

@media (max-width: 780px) {
  .modal-backdrop.calculation-backdrop,
  .modal-backdrop.project-backdrop,
  .modal-backdrop.planning-backdrop,
  .modal-backdrop.editor-backdrop {
    padding: 8px;
  }

  .modal.project-modal.full-height,
  .modal.construction-modal.full-height,
  .modal.calculation-modal.full-height {
    width: 100%;
    height: min(100%, 920px);
  }

  .project-address-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-address-row .button {
    justify-self: stretch;
    width: 100%;
  }

  .project-population-panel > summary,
  .project-population-city > header,
  .project-population-radius > header,
  .project-population-section-title {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .project-population-panel > summary > small,
  .project-population-city > header b,
  .project-population-radius > header span,
  .project-population-section-title span {
    grid-column: 1 / -1;
    justify-self: start;
    max-width: none;
    text-align: left;
  }

  .project-population-kpis,
  .project-population-radius-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-population-kpis > div:nth-child(2n) {
    border-right: 0;
  }

  .project-population-age-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .project-population-age-row small {
    grid-column: 1 / -1;
    justify-self: start;
    text-align: left;
  }

  .modal.calculation-modal .validation-head {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .modal.calculation-modal .validation-head .validation-stats,
  .modal.calculation-modal .validation-head > p:last-child {
    justify-self: start;
    text-align: left;
    white-space: normal;
  }

  .settings-page {
    max-width: 100%;
  }

  .settings-form-grid,
  .settings-image-row {
    grid-template-columns: 1fr;
  }

  .settings-image-row {
    grid-template-columns: 74px minmax(0, 1fr);
    align-items: center;
  }

  .settings-image-preview {
    width: 74px;
    height: 58px;
  }

  .settings-image-preview.user-photo-preview-small {
    width: 72px;
    height: 72px;
  }

  .settings-image-actions strong,
  .settings-image-actions span {
    white-space: normal;
  }
}

select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: var(--select-arrow-icon);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
  padding-right: var(--select-arrow-space) !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rich-toolbar select:not([multiple]) {
  padding-right: var(--select-arrow-space-sm) !important;
}

.currency-field.has-currency-select {
  grid-template-columns: minmax(0, 1fr) 86px;
}

.currency-field.has-currency-select select,
select[data-currency-select],
select[data-crew-travel-manual-currency],
select[data-rate-currency],
.price-input-group select,
select[name="currency"],
select[name$="Currency"] {
  width: 86px;
  min-width: 86px;
  max-width: 86px;
  padding-right: 30px !important;
  text-overflow: clip;
}

.searchable-select-popover {
  position: fixed;
  z-index: 220;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 4px;
  min-width: 0;
  max-width: min(560px, calc(100vw - 16px));
  max-height: min(360px, calc(100dvh - 24px));
  background: transparent;
}

.searchable-select-filter {
  width: 100%;
  height: var(--searchable-select-control-height, 32px);
  min-height: var(--searchable-select-control-height, 32px);
  border: 1px solid var(--line-strong);
  border-radius: var(--input-radius);
  background: var(--surface);
  padding: 0 30px 0 9px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 0 0 3px rgba(23, 59, 133, 0.12);
}

.searchable-select-popover::after {
  content: "⌄";
  position: absolute;
  top: 0;
  right: 10px;
  display: grid;
  place-items: center;
  height: var(--searchable-select-control-height, 32px);
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.searchable-select-list {
  display: grid;
  gap: 3px;
  min-height: 0;
  max-height: 292px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 6px;
  box-shadow: 0 16px 38px rgba(16, 24, 40, 0.18);
}

.searchable-select-option,
.searchable-select-empty {
  min-width: 0;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  padding: 5px 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
}

.searchable-select-option {
  cursor: pointer;
}

.searchable-select-option:hover,
.searchable-select-option.is-active {
  border-color: #b6c6e2;
  background: #eef3fb;
  color: var(--navy);
}

.searchable-select-option.is-selected {
  border-color: var(--navy);
  background: #eaf1ff;
  color: var(--navy);
  font-weight: 900;
}

.searchable-select-empty {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

@media (max-width: 780px) {
  body.mobile-menu-open {
    overflow: hidden;
  }

  body.mobile-menu-open::before {
    content: "";
    position: fixed;
    inset: 52px 0 0;
    z-index: 110;
    background: rgba(15, 23, 42, 0.34);
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 130;
    min-height: 52px;
    padding: 8px 10px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }

  .topbar-title {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }

  .topbar-title h1 {
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-actions {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
  }

  .top-actions [data-action="help"],
  .top-actions [data-action="toggle-theme"],
  .top-actions .user-chip span {
    display: none;
  }

  .icon-button.mobile-menu-button {
    display: inline-grid;
    flex: 0 0 auto;
  }

  .sidebar {
    position: fixed;
    top: 52px;
    right: 0;
    left: 0;
    z-index: 120;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: calc(100dvh - 52px);
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
    background: var(--surface);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.22);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-105%);
    transition: transform 0.18s ease, opacity 0.18s ease;
  }

  body.mobile-menu-open .sidebar,
  #app.mobile-menu-open .sidebar {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .brand {
    min-height: 42px;
    padding: 5px 8px;
    gap: 8px;
  }

  .brand div:last-child {
    min-width: 0;
    font-size: inherit;
  }

  .brand strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand small {
    display: none;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
    min-width: 34px;
    max-width: 34px;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    max-height: calc(100dvh - 94px);
    padding: 6px;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  .sidebar .nav-item {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    place-items: center;
    align-content: center;
    justify-content: center;
    min-width: 0;
    height: 48px;
    padding: 5px 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-muted);
    color: #1f2a44;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1.08;
    text-align: center;
  }

  .sidebar .mobile-only-nav-action {
    display: grid;
  }

  .sidebar .nav-item > span:not(.icon) {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-overflow: ellipsis;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .sidebar .nav-item .icon {
    width: 17px;
    height: 17px;
  }

  .sidebar .nav-item:hover,
  .sidebar .nav-item.active {
    border-color: #bdd4f3;
    background: #eaf2ff;
    color: var(--navy);
  }

  .sidebar .nav-item.active {
    box-shadow: inset 0 -3px 0 var(--navy);
  }

  .nav-catalog-group {
    grid-column: 1 / -1;
  }

  .nav-catalog-group > summary {
    justify-content: flex-start;
    min-height: 34px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f8fafc;
    color: #1f2a44;
    font-size: 12px;
    font-weight: 900;
  }

  .nav-catalog-group > summary span {
    font-size: 12px;
  }

  .nav-catalog-group > summary .icon {
    width: 16px;
    height: 16px;
  }

  .nav-catalog-group > summary::after {
    display: block;
    width: 13px;
    height: 13px;
  }

  .nav-catalog-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin-top: 5px;
  }

  .nav-catalog-list .nav-item {
    height: 45px;
    padding: 4px 3px;
    font-size: 9.5px;
  }

  .collapse-button {
    display: none;
  }
}

/* ============================================================
   OKNA EDYTORA DESIGN / KONSTRUKCJI (przywrócone z oryginału PostgreSQL/ —
   zgubione przy kopiowaniu). Pełnoekranowy layout, sidebar, popover typów,
   stopka z „Generuj prezentację", panel BOM.
   ============================================================ */
.modal-backdrop.design-editor-backdrop,
.modal-backdrop.construction-editor-backdrop {
  place-items: center;
  padding: 0;
  overflow: hidden;
}
.modal.design-modal.design-editor-modal.full-height,
.modal.construction-modal.construction-editor-modal.full-height {
  width: min(1600px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  height: 100%;
  max-height: 100%;
  min-height: 0;
  border-radius: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.modal.construction-modal.construction-editor-modal header {
  position: relative;
}
.modal.construction-modal.construction-editor-modal header > .icon-button[data-action="close-modal"] {
  display: inline-grid;
  place-items: center;
  z-index: 2;
}
.modal.design-modal.design-editor-modal .design-construction-sidebar,
.modal.construction-modal.construction-editor-modal .design-construction-sidebar {
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}
.modal.design-modal.design-editor-modal .design-type-popover,
.modal.construction-modal.construction-editor-modal .design-type-popover {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 42px;
  z-index: 30;
  width: auto;
  /* Rosnie WRAZ z lista: pokazuje cala liste, az dojdzie do dolu sidebaru (= dolu okna).
     Dopiero gdy lista jest dluzsza niz dostepna wysokosc — wewnetrzny scroll pionowy. */
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: calc(100% - 50px);
  overflow: hidden;
  border-color: var(--line-strong);
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}
.modal.design-modal.design-editor-modal .design-type-options,
.modal.construction-modal.construction-editor-modal .design-type-options {
  flex: 0 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
}
.modal.design-modal.design-editor-modal .design-type-popover-head,
.modal.design-modal.design-editor-modal .design-picker-line,
.modal.construction-modal.construction-editor-modal .design-type-popover-head,
.modal.construction-modal.construction-editor-modal .design-picker-line {
  flex: 0 0 auto;
}
.modal.design-modal.design-editor-modal .design-sidebar-plus,
.modal.construction-modal.construction-editor-modal .design-sidebar-plus {
  display: inline-grid;
  place-items: center;
}
.modal.design-modal.design-editor-modal .design-construction-card-remove,
.modal.construction-modal.construction-editor-modal .design-construction-card-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(217, 45, 32, 0.45);
  border-radius: 5px;
  background: rgba(217, 45, 32, 0.12);
  color: #d92d20;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.modal.design-modal.design-editor-modal .design-construction-card-remove:hover,
.modal.construction-modal.construction-editor-modal .design-construction-card-remove:hover {
  border-color: rgba(217, 45, 32, 0.66);
  background: rgba(217, 45, 32, 0.22);
  color: #b42318;
}
.modal.construction-modal.construction-editor-modal .construction-modal-footer {
  justify-content: flex-end;
}
.construction-footer-presentation-button,
.design-footer-presentation-button {
  border-color: #057a36;
  background: #059b43;
}
.construction-footer-presentation-button:hover:not(:disabled),
.design-footer-presentation-button:hover:not(:disabled) {
  background: #047f38;
}
.modal.construction-modal.construction-editor-modal .construction-main-stack {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  align-content: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.modal.construction-modal.construction-editor-modal .construction-bom-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  align-content: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.modal.construction-modal.construction-editor-modal .construction-bom-panel .construction-bom-quick-check {
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}
.modal.construction-modal.construction-editor-modal .construction-bom-panel .construction-bom-quick-list {
  min-height: 0;
  max-height: none;
  overflow: auto;
}

/* Klik w wiersz kartoteki = edycja -> wskaźnik klikalności na wierszach z akcją Edytuj */
[data-catalog-table-wrap] tbody tr:hover { background: var(--surface-muted); }
[data-catalog-table-wrap] tbody tr { cursor: pointer; }

/* Okno kategorii blokow: tabela trybow liczenia transportu (aktywny tryb podswietlony) */
.block-category-form .transport-mode-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.35;
}
.block-category-form .transport-mode-table th,
.block-category-form .transport-mode-table td {
  padding: 7px 9px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line, #e5e7eb);
}
.block-category-form .transport-mode-table thead th {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #667085);
}
.block-category-form .transport-mode-table td:first-child {
  white-space: nowrap;
  font-weight: 800;
}
.block-category-form .transport-mode-table tr.is-active td {
  background: var(--surface-muted, #eef4ff);
  box-shadow: inset 3px 0 0 var(--accent, #2563eb);
}

/* Atrybut hidden przegrywa z .field { display:grid } - wymuszenie dla pol trybu kategorii */
.block-category-form [data-category-param][hidden] {
  display: none !important;
}

/* Okno kategorii blokow: wysokosc dopasowana do tresci (bez scrolla i bez pustej przestrzeni) */
.modal.catalog-modal.block-category-modal {
  height: auto;
  max-height: calc(100dvh - 32px);
}

/* =============================================================================
   TON PRZYCISKÓW = ZNACZENIE (globalnie, w każdym oknie). Sterowane atrybutem
   [data-btn-tone] ustawianym przez js/zz-button-tones.js po etykiecie/akcji.
   ZIELONY = Zapisz/Dodaj, CZERWONY = Anuluj/Usuń/Zamknij. Lekki, półprzezroczysty
   tint (color-mix), spójny z resztą przycisków. Na końcu pliku + wysoka
   specyficzność (m.in. :not(.danger) = 0,3,0) + !important, by bić globalne
   reguły neutralne/primary z góry pliku (linie ~1231-1287). */
button[data-btn-tone="green"],
a[data-btn-tone="green"],
.button[data-btn-tone="green"]:not(.danger),
.primary-button[data-btn-tone="green"],
.ghost-button[data-btn-tone="green"],
.icon-button[data-btn-tone="green"]:not(.danger) {
  border: 1px solid color-mix(in srgb, var(--green) 55%, transparent) !important;
  background: color-mix(in srgb, var(--green) 16%, transparent) !important;
  color: var(--green) !important;
  box-shadow: none !important;
}
button[data-btn-tone="green"]:hover,
a[data-btn-tone="green"]:hover,
.button[data-btn-tone="green"]:not(.danger):hover,
.primary-button[data-btn-tone="green"]:hover,
.ghost-button[data-btn-tone="green"]:hover,
.icon-button[data-btn-tone="green"]:not(.danger):hover {
  border-color: var(--green) !important;
  background: color-mix(in srgb, var(--green) 26%, transparent) !important;
  color: var(--green) !important;
}

button[data-btn-tone="red"],
a[data-btn-tone="red"],
.button[data-btn-tone="red"]:not(.danger),
.primary-button[data-btn-tone="red"],
.ghost-button[data-btn-tone="red"],
.icon-button[data-btn-tone="red"]:not(.danger) {
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent) !important;
  background: color-mix(in srgb, var(--danger) 12%, transparent) !important;
  color: var(--danger) !important;
  box-shadow: none !important;
}
button[data-btn-tone="red"]:hover,
a[data-btn-tone="red"]:hover,
.button[data-btn-tone="red"]:not(.danger):hover,
.primary-button[data-btn-tone="red"]:hover,
.ghost-button[data-btn-tone="red"]:hover,
.icon-button[data-btn-tone="red"]:not(.danger):hover {
  border-color: var(--danger) !important;
  background: color-mix(in srgb, var(--danger) 22%, transparent) !important;
  color: var(--danger) !important;
}

/* =============================================================================
   KOLORY ETAPÓW I STATUSÓW — JEDEN spójny system (synchronizacja, 2026-06-10).
   Każdy Etap (Konsultacje/Projektowanie/Plany/Produkcja/Montaż/Gwarancja/
   Certyfikacja) ma własny kolor; każdy stan pracy (W toku/Oczekuje/Gotowy) swój.
   Faza projektu o tej samej nazwie co Etap dostaje TEN SAM kolor — sterowane z
   JS (statusPill + stageToneKey/statusToneKey, plik 00-state.js). Tinty liczone
   color-mix, więc adaptują się do motywu z tych samych zmiennych bazowych.
   UWAGA: klucze tonów MUSZĄ pokrywać się z STAGE_TONE_BY_ID/statusToneKey w JS. */
:root {
  /* Kolory etapów. Produkcja = pomarańcz. Design = BABY BLUE (jasny niebieski) —
     zielony zarezerwowany WYŁĄCZNIE dla pracy skończonej (--tone-done / design-ready).
     Plany = mocny niebieski (NIE zamieniać z Designem!). */
  --tone-consulting: #64748b;   /* Konsultacje — szary (oryginał) */
  --tone-design: #7ec2f0;       /* Projektowanie/Design — baby blue (było zielone) */
  --tone-plans: #2563eb;        /* Plany — niebieski (oryginał) */
  --tone-production: #ea580c;   /* Produkcja — pomarańcz (było szare) */
  --tone-montaz: #9333ea;       /* Montaż — fiolet (brak oryginału, rzadko) */
  --tone-warranty: #dc2626;     /* Gwarancja — czerwony (oryginał) */
  --tone-certification: #0891b2;/* Certyfikacja — cyjan (brak oryginału, rzadko) */
  --tone-inprogress: #0284c7;   /* W toku — błękit */
  --tone-pending: #d97706;      /* Oczekuje — bursztyn */
  --tone-done: #16a34a;         /* Gotowy — zielony */
}
:root[data-theme="dark"] {
  --tone-consulting: #94a3b8;
  --tone-design: #8fcaf6;       /* Design — baby blue (było zielone #4ade80) */
  --tone-plans: #60a5fa;
  --tone-production: #fb923c;
  --tone-montaz: #c084fc;
  --tone-warranty: #f87171;
  --tone-certification: #22d3ee;
  --tone-inprogress: #38bdf8;
  --tone-pending: #fbbf24;
  --tone-done: #4ade80;
}
/* Most: klasa tonu -> zmienna --pill (czytana przez pille i kropki Etapów). */
.tone-consulting { --pill: var(--tone-consulting); }
.tone-design { --pill: var(--tone-design); }
.tone-plans { --pill: var(--tone-plans); }
.tone-production { --pill: var(--tone-production); }
.tone-montaz { --pill: var(--tone-montaz); }
.tone-warranty { --pill: var(--tone-warranty); }
.tone-certification { --pill: var(--tone-certification); }
.tone-inprogress { --pill: var(--tone-inprogress); }
.tone-pending { --pill: var(--tone-pending); }
.tone-done { --pill: var(--tone-done); }

.status-pill[class*="tone-"] {
  border: 1px solid color-mix(in srgb, var(--pill) 42%, transparent) !important;
  background: color-mix(in srgb, var(--pill) 14%, var(--surface)) !important;
  color: color-mix(in srgb, var(--pill) 74%, var(--text)) !important;
}
.stage-dot[class*="tone-"] {
  background: var(--pill) !important;
}

/* Timeline: bloki zadań w kolorze Etapu (te same tony). Tło mieszane z bielą,
   by pozostało czytelne w obu motywach. */
.timeline-task.consulting {
  background: color-mix(in srgb, var(--tone-consulting) 18%, #ffffff) !important;
  border-color: color-mix(in srgb, var(--tone-consulting) 45%, #ffffff) !important;
}
.timeline-task.projects,
.timeline-task.design {
  background: color-mix(in srgb, var(--tone-design) 18%, #ffffff) !important;
  border-color: color-mix(in srgb, var(--tone-design) 45%, #ffffff) !important;
}
.timeline-task.plans {
  background: color-mix(in srgb, var(--tone-plans) 18%, #ffffff) !important;
  border-color: color-mix(in srgb, var(--tone-plans) 45%, #ffffff) !important;
}
.timeline-task.production {
  background: color-mix(in srgb, var(--tone-production) 18%, #ffffff) !important;
  border-color: color-mix(in srgb, var(--tone-production) 45%, #ffffff) !important;
}
.timeline-task.assembly {
  background: color-mix(in srgb, var(--tone-montaz) 18%, #ffffff) !important;
  border-color: color-mix(in srgb, var(--tone-montaz) 45%, #ffffff) !important;
}
.timeline-task.certification {
  background: color-mix(in srgb, var(--tone-certification) 18%, #ffffff) !important;
  border-color: color-mix(in srgb, var(--tone-certification) 45%, #ffffff) !important;
}

/* Nagłówek projektu: para znaczników FAZA / STAN (np. „Projektowanie / W toku").
   Drugi znacznik (stan) pojawia się tylko gdy etap nie jest jeszcze Gotowy. */
.status-badge-pair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.status-badge-sep {
  color: var(--muted);
  font-weight: 800;
  opacity: 0.55;
  font-size: 12px;
}

/* Tabela Bloki: lampki zdrowia, plakietki cech, menu wiersza, panel-rzad formularza */
.block-health-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 50%;
  vertical-align: middle;
  flex: none;
}
.block-health-dot.is-red { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .16); }
.block-health-dot.is-orange { background: #fb923c; box-shadow: 0 0 0 3px rgba(251, 146, 60, .18); }
.block-health-dot.is-green { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .16); }
.block-code-cell { white-space: nowrap; }

.block-flags { display: flex; flex-direction: column; gap: 4px; }
.block-flag {
  display: inline-block;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.block-flag.is-dynamic {
  color: #1d4ed8;
  background: color-mix(in srgb, #2563eb 12%, transparent);
  border: 1px solid color-mix(in srgb, #2563eb 30%, transparent);
}
.block-flag.is-install {
  color: #7e22ce;
  background: color-mix(in srgb, #9333ea 12%, transparent);
  border: 1px solid color-mix(in srgb, #9333ea 30%, transparent);
}

.row-menu { position: relative; display: inline-block; }
.row-menu > summary {
  list-style: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 900;
  color: var(--muted, #667085);
  background: var(--surface, #fff);
}
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu[open] > summary { background: var(--surface-muted, #eef2f7); }
.row-menu-panel {
  position: absolute;
  right: 0;
  top: 34px;
  z-index: 60;
  padding: 6px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .14);
}
.row-menu-panel .inline-actions { display: flex; flex-direction: column; gap: 4px; }
.row-menu-panel .inline-actions .button { width: 100%; justify-content: center; }

.block-editor-panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 900px) {
  .block-editor-panel-row { grid-template-columns: 1fr; }
}

/* Kompaktowe panele Dynamika/Instalacja: checkbox w naglowku, pola w linii, opis pod polami */
.block-rule-panel .block-panel-head { display: flex; align-items: center; gap: 10px; }
.block-rule-panel .panel-head-toggle { margin-left: auto; white-space: nowrap; font-weight: 800; }
.block-rule-panel .block-short-help { margin: 6px 0 0; }
.block-installation-grid { align-items: start; }
[data-block-installation-hours-field][hidden] { display: none !important; }

/* =============================================================================
   DASHBOARD — widok wyników (karty KPI + otwarte wg etapu + Top 10 designów).
   Kolory kart przez tony --tone-* (spójne ze statusami/etapami).
   ============================================================================= */
.icon-gauge { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 14 4-4'/%3E%3Cpath d='M3.34 19a10 10 0 1 1 17.32 0'/%3E%3C/svg%3E"); }

.dash-grid { gap: 14px; }

.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.dash-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  border-left: 4px solid var(--line-strong);
}
.dash-card-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.dash-card-value {
  font-size: 22px;
  line-height: 1.15;
  color: var(--text);
}
.dash-card-sub { font-size: 11px; color: var(--muted); }
.dash-tone-inprogress { border-left-color: var(--tone-inprogress); }
.dash-tone-pending { border-left-color: var(--tone-pending); }
.dash-tone-done { border-left-color: var(--tone-done); }
.dash-tone-plans { border-left-color: var(--tone-plans); }

.dash-panels {
  display: grid;
  grid-template-columns: minmax(230px, 320px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
@media (max-width: 1023px) {
  .dash-panels { grid-template-columns: 1fr; }
}
.dash-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px 16px;
}
.dash-panel h3 { margin: 0 0 10px; font-size: 14px; }
.dash-hint { font-size: 11px; font-weight: 600; color: var(--muted); }

.dash-phase-list { display: grid; gap: 6px; }
.dash-phase-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.dash-phase-row:hover { background: var(--surface-muted); border-color: var(--line); }
.dash-phase-row b { font-size: 14px; }

.dash-table-wrap { border: none; }
.dash-table { width: 100%; border-collapse: collapse; }
.dash-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.dash-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.dash-table tbody tr:hover { background: var(--surface-muted); }
.dash-rank { width: 28px; color: var(--muted); font-weight: 800; }
.dash-num, .dash-money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dash-table th:nth-child(n+3) { text-align: right; }
.dash-project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.dash-project-link:hover .dash-project-name { text-decoration: underline; }
.dash-project-name { color: var(--text); font-weight: 700; }
.dash-empty { padding: 14px 4px; }


/* ===== Popup-instrukcja Dynamika/Instalacja + czerwone ramki "tu dostosuj" (block-attention) ===== */
.block-attention {
  box-shadow: 0 0 0 2px #d92d20, 0 0 16px rgba(217, 45, 32, 0.3) !important;
  animation: block-attention-pulse 1.6s ease-in-out infinite;
}
@keyframes block-attention-pulse {
  0%, 100% { box-shadow: 0 0 0 2px #d92d20, 0 0 16px rgba(217, 45, 32, 0.3); }
  50% { box-shadow: 0 0 0 2px rgba(217, 45, 32, 0.55), 0 0 6px rgba(217, 45, 32, 0.12); }
}
.app-confirm.app-info { width: min(620px, 100%); }
.app-confirm.app-info .app-info-content { text-align: left; font-size: 13px; line-height: 1.55; color: var(--muted); }
.app-confirm.app-info .app-info-content p { margin: 6px 0; }
.app-confirm.app-info .app-info-content strong { color: var(--text); }
.app-confirm.app-info .app-info-content ol { margin: 8px 0; padding-left: 20px; display: grid; gap: 6px; }


/* Podpowiedzi "= 0,095 m" przy polach miar (ludzkie jednostki): trzecia kolumna .transport-line
   miala sztywne 28px pod statyczne "m"/"m3" - dynamiczna tresc dostaje auto i jedna linie. */
.transport-line:has(em[data-measure-hint]) { grid-template-columns: minmax(0, 1fr) minmax(70px, 96px) auto; }
em[data-measure-hint] { white-space: nowrap; }

/* =============================================================================
   DASHBOARD — rozbudowa (lejek, trend, terminy, alerty wycen, zespół, klienci).
   Nadpisuje wcześniejszy .dash-panels (2 kolumny -> responsywna siatka paneli).
   ============================================================================= */
.dash-panels {
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
}
.dash-panel-top { grid-column: 1 / -1; }
.dash-subhead { margin-top: 14px; }

/* Lejek konwersji */
.dash-funnel { display: grid; gap: 6px; }
.dash-funnel-row {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr) 26px;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.dash-funnel-row:hover { background: var(--surface-muted); border-color: var(--line); }
.dash-funnel-bar {
  height: 12px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--text) 5%, transparent);
  overflow: hidden;
}
.dash-funnel-bar i {
  display: block;
  height: 100%;
  border-radius: 6px;
  min-width: 4px;
}
.dash-funnel-row b { text-align: right; }

/* Trend miesięczny (mini-słupki CSS) */
.dash-chart {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  align-items: end;
  height: 130px;
  padding-top: 6px;
}
.dash-chart-col { display: grid; grid-template-rows: 1fr auto; gap: 4px; height: 100%; }
.dash-chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 100%;
}
.dash-bar { width: 9px; border-radius: 3px 3px 0 0; }
.dash-bar-offers { background: var(--tone-inprogress); }
.dash-bar-sold { background: var(--tone-done); }
.dash-chart-label { text-align: center; font-size: 9px; color: var(--muted); }
.dash-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 0 3px 0 8px;
  vertical-align: middle;
}
.dash-dot-offers { background: var(--tone-inprogress); }
.dash-dot-sold { background: var(--tone-done); }

/* Listy alertów (terminy + jakość wycen) */
.dash-alert-list { display: grid; gap: 5px; }
.dash-alert-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 6px;
  border-radius: 8px;
}
.dash-alert-row:hover { background: var(--surface-muted); }
.dash-chip {
  flex: none;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid;
}
.dash-chip-late {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}
.dash-chip-soon,
.dash-chip-warn {
  color: var(--tone-pending);
  border-color: color-mix(in srgb, var(--tone-pending) 45%, transparent);
  background: color-mix(in srgb, var(--tone-pending) 10%, transparent);
}
.dash-date { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.dash-late { color: var(--danger); font-weight: 800; }
.dash-flags { margin-left: auto; display: inline-flex; gap: 4px; flex-wrap: wrap; }
.dash-more { font-size: 11px; color: var(--muted); padding: 2px 6px; }

/* Zespół */
.dash-team-list { display: grid; gap: 6px; }
.dash-team-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 5px 6px;
  border-radius: 8px;
}
.dash-team-row:hover { background: var(--surface-muted); }
.dash-team-name { display: grid; line-height: 1.2; }
.dash-team-name small { color: var(--muted); font-size: 10px; }
.dash-team-stat { font-size: 11.5px; color: var(--text); white-space: nowrap; }
.dash-team-stat:last-child { text-align: right; color: var(--green); font-weight: 700; }


/* Sekcja Logistyka w karcie bloku: pola rowno pod soba w STALEJ kolumnie po prawej,
   przeliczenie (= 0,095 m) PO LEWEJ stronie pola, justowane do prawej (rosnie w lewo).
   Kolejnosc w DOM: etykieta | (AUTO) | podpowiedz | pole. Scope na .block-transport-card,
   zeby nie ruszac linii transport-line w innych formularzach (pojazdy itd.). */
.block-transport-card .transport-line,
.block-transport-card .transport-line:has(em[data-measure-hint]) { grid-template-columns: auto minmax(0, 1fr) 96px; }
.block-transport-card .transport-line-auto,
.block-transport-card .transport-line-auto:has(em[data-measure-hint]) { grid-template-columns: auto auto minmax(0, 1fr) 96px; }
.block-transport-card .transport-line em { justify-self: end; text-align: right; white-space: nowrap; width: auto; }
.block-transport-card .transport-line input { width: 100%; }
/* Checkbox AUTO bez ramki-jajka: zwykly checkbox + napis, bez tla i poswiaty po kliknieciu. */
.measure-auto {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  color: #475467;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.measure-auto input { margin: 0; width: 12px; height: 12px; }
.measure-auto input:focus:not(:focus-visible) { outline: none; box-shadow: none; }
:root[data-theme="dark"] .measure-auto { color: #cbd5e1; }


/* ============================================================
   ZAMÓWIENIA: drzewo projekt -> konstrukcja -> dostawca.
   Węzły to <details>/<summary>: natywny marker ukryty, własna
   karetka, poziomy tonowane tłami --tree-* jak drzewo projektów.
   ============================================================ */
.orders-tree-panel {
  padding: var(--panel-pad);
  display: grid;
  gap: 12px;
}

.orders-project-node,
.orders-construction-node,
.orders-supplier-node {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.orders-construction-node,
.orders-supplier-node { border-radius: var(--radius-sm); }

.orders-project-node > summary,
.orders-construction-node > summary,
.orders-supplier-node > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.orders-project-node > summary::-webkit-details-marker,
.orders-construction-node > summary::-webkit-details-marker,
.orders-supplier-node > summary::-webkit-details-marker { display: none; }

.orders-project-node > summary { background: var(--tree-stage-bg); }
.orders-construction-node > summary { background: var(--tree-level-2-bg); }
.orders-supplier-node > summary { background: var(--tree-level-3-bg); }
.orders-project-node > summary:hover,
.orders-construction-node > summary:hover,
.orders-supplier-node > summary:hover { background: var(--tree-hover-bg); }
.orders-project-node > summary:focus-visible,
.orders-construction-node > summary:focus-visible,
.orders-supplier-node > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.orders-project-node[open] > summary,
.orders-construction-node[open] > summary,
.orders-supplier-node[open] > summary { border-bottom: 1px solid var(--line); }

/* Karetka: chevron obraca się w dół po rozwinięciu */
.orders-tree-caret {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  background: currentColor;
  color: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
  transition: transform 0.15s ease;
}
details[open] > summary > .orders-tree-caret { transform: rotate(90deg); }

.orders-node-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
/* Projekt: numer i nazwa w jednej linii */
.orders-project-node > summary > .orders-node-title {
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
}
.orders-node-title strong {
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}
.orders-node-title > span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-node-metrics {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.orders-node-metrics strong {
  color: var(--text);
  font-size: 12px;
  min-width: 84px;
  text-align: right;
}
.orders-supplier-total {
  margin-left: auto;
  font-size: 12px;
  white-space: nowrap;
}

.orders-project-children,
.orders-construction-children {
  padding: 10px 12px 12px;
  display: grid;
  gap: 10px;
}

/* Puste stany w drzewie: kompaktowe, bez 160px wysokości globalnego .empty */
.orders-project-children .empty,
.orders-construction-children .empty {
  min-height: 0;
  padding: 14px 12px;
  font-size: 11px;
}

/* Tabela materiałów dostawcy: nagłówek nie-sticky, liczby do prawej */
.orders-material-table-wrap { padding: 10px 12px 6px; overflow-x: auto; }
.orders-material-table th { position: static; }
.orders-material-table th:nth-child(n+3):nth-child(-n+5),
.orders-material-table td:nth-child(n+3):nth-child(-n+5),
.orders-material-table th:nth-child(n+7),
.orders-material-table td:nth-child(n+7) { text-align: right; }
.orders-material-table td:first-child { white-space: normal; }
.orders-material-table tbody tr:last-child td { border-bottom: 0; }

/* Pasek PDF per dostawca (caly projekt) + stopka legendy stanu magazynowego */
.orders-supplier-pdf-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px dashed var(--line-strong, #d0d5dd);
  border-radius: 10px;
  background: var(--surface-muted);
}
.orders-supplier-pdf-label { font-size: 11px; font-weight: 800; color: var(--muted, #5a6376); }
.orders-stock-footnote { padding: 6px 2px 8px; color: var(--muted, #5a6376); }
.orders-supplier-node summary .button.mini { margin-left: 8px; }

/* Magazyn w kartotece Materiały: zwarta tabela 9 kolumn — nagłówki i liczby bez zawijania,
   kolumny liczbowe do prawej (tabular-nums), edycja inline Na stanie / Wymagany stan.
   Nadpisuje .catalog-table { white-space: normal } (ta sama specyficzność, dalej w pliku). */
.materials-stock-table th,
.materials-stock-table td { white-space: nowrap; }
.materials-stock-table td.material-cell {
  white-space: normal;
  min-width: 220px;
  max-width: 360px;
  overflow-wrap: anywhere;
}
.materials-stock-table th:nth-child(n+3):nth-child(-n+8),
.materials-stock-table td:nth-child(n+3):nth-child(-n+8) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.materials-stock-table td:last-child { text-align: right; }
.materials-stock-table .inline-actions { flex-wrap: nowrap; justify-content: flex-end; }
.stock-edit { display: inline-flex; align-items: center; gap: 5px; }
.stock-unit { font-size: 11px; color: var(--muted, #5a6376); min-width: 24px; text-align: left; }
.stock-inline-input {
  width: 74px;
  padding: 3px 6px;
  text-align: right;
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}
.stock-inline-input::-webkit-outer-spin-button,
.stock-inline-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stock-zero { color: var(--muted, #5a6376); }
.materials-stock-table td.stock-negative strong { color: var(--danger, #c3352b); }
.materials-stock-table td.stock-below-min strong { color: var(--warning, #b54708); }
.stock-to-order { color: var(--danger, #c3352b); }

/* Zamówienia: wydanie na produkcję + uzupełnienie magazynu (stan minimalny) */
.orders-issued-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong, #d0d5dd);
  background: var(--surface-muted);
  color: var(--muted, #5a6376);
  white-space: nowrap;
}
.orders-restock-panel { margin-bottom: 14px; }
.orders-restock-panel .orders-material-table-wrap { padding: 4px 0 0; }

/* Źródło potrzeb konstrukcji: BOM techniczny (korekta) vs szacunek z kalkulacji vs brak */
.orders-bom-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong, #d0d5dd);
  background: var(--surface-muted);
  color: var(--muted, #5a6376);
  white-space: nowrap;
}
.orders-bom-badge.bom-technical {
  border-color: color-mix(in srgb, var(--navy-2, #2458e6) 45%, transparent);
  background: color-mix(in srgb, var(--navy-2, #2458e6) 10%, transparent);
  color: var(--navy-2, #2458e6);
}
.orders-bom-badge.bom-estimate {
  border-color: color-mix(in srgb, #b54708 45%, transparent);
  background: color-mix(in srgb, #f59e0b 14%, transparent);
  color: var(--warning, #b54708);
}
.orders-loading-note { color: var(--muted, #5a6376); margin-top: 4px; }

/* Kropka statusu zamówienia (wygląd jak kropki etapów przy projektach):
   żółta = zamówione częściowo (zostało domówienie), zielona = zamówione w całości */
.order-status-dot { margin-right: 6px; flex: none; }

/* Grupa dostawcy w pasku projektu: kropka + PDF + Oznacz zamówione trzymają się razem */
.orders-supplier-pdf-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border: 1px solid var(--line, #e4e7ec);
  border-radius: 8px;
}
/* PROSTA TABELA zamówień: chipy konstrukcji + płaska tabela z wierszami grupującymi firm */
.orders-constructions-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 2px 8px;
}
.orders-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 3px 10px;
  border: 1px solid var(--line, #e4e7ec);
  border-radius: 999px;
  font-size: 11px;
}
.orders-chip-name { font-weight: 800; white-space: nowrap; }
.orders-chip.is-issued { opacity: 0.75; }
/* Status BOM-u na chipie: skąd pochodzą ilości tej konstrukcji */
.orders-chip-status { font-size: 10px; font-weight: 800; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.02em; }
.orders-chip-status.is-technical { color: var(--navy-2, #2458e6); }
.orders-chip-status.is-estimate { color: var(--warning, #b54708); }
.orders-chip-status.is-none { color: var(--danger, #c3352b); }
.orders-flat-table th { white-space: nowrap; }
/* 9 kolumn: liczby (3-6) i ceny (8-9) do prawej */
.orders-flat-table th:nth-child(n+3):nth-child(-n+6),
.orders-flat-table td:nth-child(n+3):nth-child(-n+6),
.orders-flat-table th:nth-child(n+8),
.orders-flat-table td:nth-child(n+8) { text-align: right; }
.orders-flat-table th:nth-child(7),
.orders-flat-table td:nth-child(7) { text-align: left; }
.orders-supplier-row td {
  background: var(--surface-muted);
  border-top: 2px solid var(--line-strong, #d0d5dd);
  text-align: left !important;
  vertical-align: middle;
  cursor: pointer;
}
/* Równe wiersze firm: zawartość komórek w flexach (kropka/nazwa/status z lewej,
   suma+przyciski z prawej, wszystko wyśrodkowane w pionie) */
.orders-supplier-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
}
.orders-supplier-cell .order-status-dot,
.orders-supplier-cell .orders-group-caret { margin-right: 0; }
.orders-supplier-cell .tiny { color: var(--muted, #5a6376); white-space: nowrap; }
.orders-supplier-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.orders-group-caret {
  display: inline-block;
  flex: none;
  width: 0;
  height: 0;
  border-left: 5px solid var(--muted, #5a6376);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.15s ease;
}
.orders-group-caret.open { transform: rotate(90deg); }

/* Modal przyjęcia dostawy (PZ): tabela „Przyjmuję teraz" + historia przyjęć */
.receipt-table th:nth-child(n+2):nth-child(-n+5),
.receipt-table td:nth-child(n+2):nth-child(-n+5) { text-align: right; }
.receipt-history-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }

/* Pasek postępu zamówień projektu (% wartości materiałów pokrytej wpisami „zamówione") */
.orders-progress-wrap { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.orders-progress {
  width: 110px;
  height: 8px;
  border-radius: 999px;
  background: var(--line, #e4e7ec);
  overflow: hidden;
}
.orders-progress-fill { height: 100%; border-radius: 999px; background: #f59e0b; }
.orders-progress-fill.done { background: #16a34a; }
.orders-progress-label { font-size: 11px; font-weight: 800; color: var(--muted, #5a6376); }

/* GŁÓWNY PANEL projektu: segmentowy pasek alokacji + legenda kwot + chip produkcji/ryzyka */
.odash-summary-pct {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #15803d;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #22c55e 14%, transparent);
}
.odash-summary-pct.risk { color: var(--danger, #c3352b); background: color-mix(in srgb, #dc2626 12%, transparent); }
.orders-dashboard { padding: 4px 2px 12px; }
.odash-bar {
  display: flex;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line, #e4e7ec);
}
.odash-seg { display: block; height: 100%; }
.odash-seg.secured { background: #16a34a; }
.odash-seg.transit { background: #f59e0b; }
.odash-seg.toorder { background: #dc2626; }
.odash-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-top: 8px;
  font-size: 12px;
}
.odash-pct { font-weight: 800; }
.odash-stat { display: inline-flex; align-items: center; gap: 6px; color: var(--muted, #5a6376); }
.odash-stat strong { color: var(--text, #1a1f2b); font-variant-numeric: tabular-nums; }
.odash-stat .odot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.odot.secured { background: #16a34a; }
.odot.transit { background: #f59e0b; }
.odot.toorder { background: #dc2626; }
.odash-chips { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.odash-chip {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.odash-chip.prod { color: var(--navy-2, #2458e6); background: color-mix(in srgb, var(--navy-2, #2458e6) 10%, transparent); }
.odash-chip.eta { color: var(--muted, #5a6376); background: var(--surface-muted); border: 1px solid var(--line, #e4e7ec); }
.odash-chip.risk { color: #fff; background: var(--danger, #c3352b); }

/* Pasek filtrów okna Zamówień: szukajka projektów + filtr zdarzeń + licznik */
.orders-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 2px 2px 10px;
}
.orders-search-field { min-width: 260px; flex: 0 1 320px; }
.orders-toolbar select { max-width: 240px; }
.orders-toolbar [data-orders-count] { margin-left: auto; white-space: nowrap; }
