:root {
  color-scheme: light dark;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;  /* co druga karta wydania — delikatnie inny odcień */
  --corner-ok: #40c057;    /* narożnik „przyjęte” — jasna zieleń */
  --text: #1d1f21;
  --muted: #62666b;
  --line: #e2e2de;
  --accent: #1f5f8b;
  --accent-text: #ffffff;
  --ok: #1e7b45;
  --ok-bg: #e3f3e9;
  --info: #1f5f8b;
  --info-bg: #e3eef6;
  --warn: #8a5a00;
  --warn-bg: #fbf0d9;
  --bad: #a1271e;
  --bad-bg: #fbe4e1;
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17191b;
    --surface: #212427;
    --surface-alt: #232a31;
    --corner-ok: #7fd3a0;  /* jak napis „Potwierdzone” */
    --text: #e8e8e6;
    --muted: #a0a4a8;
    --line: #34383c;
    --accent: #6aa9d6;
    --accent-text: #0e1a24;
    --ok: #7fd3a0;
    --ok-bg: #1c3527;
    --info: #8cc0e6;
    --info-bg: #1b2d3b;
    --warn: #f0c46a;
    --warn-bg: #3a2f17;
    --bad: #f19a90;
    --bad-bg: #40211e;
  }
}

/* wybór w „Moje konto”: Ciemny / Jasny niezależnie od urządzenia */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17191b;
  --surface: #212427;
  --surface-alt: #232a31;
  --corner-ok: #7fd3a0;  /* jak napis „Potwierdzone” */
  --text: #e8e8e6;
  --muted: #a0a4a8;
  --line: #34383c;
  --accent: #6aa9d6;
  --accent-text: #0e1a24;
  --ok: #7fd3a0;
  --ok-bg: #1c3527;
  --info: #8cc0e6;
  --info-bg: #1b2d3b;
  --warn: #f0c46a;
  --warn-bg: #3a2f17;
  --bad: #f19a90;
  --bad-bg: #40211e;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }

header.top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

header.top .inner, main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

header.top .inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  flex-wrap: wrap;
}

.brand { font-weight: 700; text-decoration: none; color: var(--text); display: inline-flex; align-items: center; gap: 10px; }
.brand picture { display: inline-flex; }
.brand-logo { height: 28px; width: auto; }
.login-logo { display: block; height: 64px; width: auto; margin: 0 auto 16px; }
.brand span { color: var(--muted); font-weight: 400; }

nav.main { display: flex; gap: 14px; align-items: center; margin-left: auto; flex-wrap: wrap; }
nav.main form { margin: 0; }
nav.main a.active { color: var(--text); font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Pod-menu działu administratora (portal/navigation.py): drugi rząd pod nagłówkiem */
header.top .subnav { border-top: 1px solid var(--line); background: var(--bg); }
header.top .subnav-inner { max-width: 1100px; margin: 0 auto; padding: 6px 16px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
body.wide header.top .subnav-inner { max-width: 1360px; }
.subnav a { padding: 3px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: .9rem; }
.subnav a:hover, .subnav a:focus-visible { color: var(--text); background: var(--surface); }
.subnav a.active { background: var(--info-bg); color: var(--info); font-weight: 600; }

main { padding-top: 20px; padding-bottom: 48px; }

h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 28px 0 10px; }
h3 { font-size: 1rem; margin: 0 0 6px; }

.sub { color: var(--muted); margin: 0 0 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.card.superseded { opacity: .75; }

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

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.center, th.center { text-align: center; }

.btn, button {
  display: inline-block;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 6px;
  padding: 7px 14px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn.secondary, button.secondary { background: transparent; color: var(--accent); }
.btn.small, button.small { padding: 3px 9px; font-size: .85rem; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 400; text-decoration: underline; }
.btn.whatsapp { background: #1f8f4e; border-color: #1f8f4e; color: #fff; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }

.badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }

.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 8px; background: var(--info-bg); color: var(--info); }
.messages li.success { background: var(--ok-bg); color: var(--ok); }
.messages li.error { background: var(--bad-bg); color: var(--bad); }
.messages li.warning { background: var(--warn-bg); color: var(--warn); }

.note { white-space: pre-wrap; margin: 6px 0; }
.note-lang { font-size: .75rem; font-weight: 700; color: var(--muted); }
.file-note { color: var(--muted); font-style: italic; white-space: normal; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error-text { color: var(--bad); }
.warn-text { color: var(--warn); }

form.stack p { margin: 0 0 12px; }
form.stack label { display: block; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], select, textarea {
  width: 100%;
  max-width: 520px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
input.rev { width: 72px; }
textarea { max-width: 100%; }
.helptext { display: block; color: var(--muted); font-size: .85rem; }
ul.errorlist { color: var(--bad); margin: 4px 0; padding-left: 18px; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }

.login-box { max-width: 420px; margin: 40px auto; }
.lang-switch { display: flex; gap: 10px; justify-content: center; margin-top: 12px; font-size: .9rem; }
.privacy-box { max-width: 720px; margin: 24px auto; }
.privacy-box li { margin-bottom: 10px; }

.comment { border-top: 1px solid var(--line); padding: 10px 0; }
.comment:first-child { border-top: 0; }
.comment .meta { font-size: .85rem; color: var(--muted); }

code.path { background: var(--bg); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line); }

@media (max-width: 640px) {
  header.top .inner { padding-top: 8px; padding-bottom: 8px; }
  nav.main { margin-left: 0; }
  th.hide-sm, td.hide-sm { display: none; }
}

details.folder { border-top: 1px solid var(--line); }
details.folder:first-of-type { border-top: 0; }
details.folder > summary {
  cursor: pointer;
  padding: 9px 4px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  list-style: none;
}
details.folder > summary::-webkit-details-marker { display: none; }
details.folder > summary::before {
  content: "▸";
  color: var(--muted);
  width: 1em;
  transition: transform .15s;
}
details.folder[open] > summary::before { transform: rotate(90deg); }
.folder-name { font-weight: 600; }
details.folder .table-wrap { margin-bottom: 8px; }
/* podfoldery jak w ZIP: wcięcie tylko z lewej, więc kolumny z prawej zostają w jednej linii */
details.folder .subfolders { margin-left: 1.1rem; }

/* panel paczki, karta „Lista części”: filtr niezgodności po meblu, rodzaju i nazwie */
.mismatch-filter { display: grid; gap: 8px; margin: 6px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-alt); }
.mismatch-filter .filter-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mismatch-filter .filter-label { min-width: 70px; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
/* filtr „Malowanie” nad listą elementów lakierni (25.11) — ramka koloru jak w tabeli */
.paint-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.paint-filter .filter-label { min-width: 70px; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.paint-filter button.chip { border-width: 2px; }
table.positions tr[hidden] { display: none; }
.mismatch-filter input[type=search] { flex: 0 1 300px; padding: 4px 8px; }
.mismatch-filter [hidden] { display: none; }  /* „Wyczyść” bez aktywnego filtra (button ma display z reguły ogólnej) */
/* plik bez wiersza: pole z nazwą wiersza (podpowiedzi z arkusza) i „Przypisz do wiersza” w tej samej linii */
form.alias-form { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-left: 4px; vertical-align: middle; }
form.alias-form input[type=text] { width: 20rem; max-width: 100%; padding: 2px 6px; font-size: .85rem; }
button.chip { padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: .85rem; font-weight: 400; white-space: normal; text-align: left; }
button.chip .n { margin-left: 3px; color: var(--muted); font-variant-numeric: tabular-nums; }
button.chip:hover, button.chip:focus-visible { border-color: var(--accent); }
button.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }
button.chip[aria-pressed="true"] .n { color: inherit; }
button.chip.empty:not([aria-pressed="true"]) { opacity: .45; }

.file-search { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0 10px; }
.file-search input { max-width: 420px; }
input[type=search] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.attachments { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.attachment-thumb img {
  display: block;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.attachment-file { font-size: .9rem; }
input[type=file] { max-width: 520px; font: inherit; color: var(--muted); }

/* Lista plików paczki: stałe szerokości kolumn, żeby Ilość / Rewizja / Wydano / Rozmiar
   stały w tych samych miejscach w każdym folderze; nazwa pliku zajmuje resztę i się zawija. */
table.files { table-layout: fixed; }
table.files td:first-child { overflow-wrap: anywhere; }
/* rem, nie em: szerokość bierze się z nagłówka, a ten ma mniejszą czcionkę */
table.files .c-qty { width: 6rem; text-align: center; }  /* Ilość: widoczna też na telefonie */
table.files .c-wt { width: 7rem; text-align: right; white-space: nowrap; }  /* Masa/szt. */
table.files .c-rev { width: 6rem; text-align: center; }
table.files .c-date { width: 7.5rem; text-align: center; white-space: nowrap; }
table.files .c-size { width: 6.5rem; }
table.files .c-dl { width: 9rem; }
table.files .c-col { width: 10rem; }  /* kolor (lakiernia) */
/* Moje paczki: każdy projekt ma własną tabelę, więc szerokości są stałe — kolumny stoją w jednej linii we wszystkich kartach (Adam 24.11) */
table.packages { table-layout: fixed; }
table.packages td:first-child { overflow-wrap: anywhere; }
table.packages .c-release { width: 15rem; }
table.packages .c-state { width: 19rem; }
table.packages td.num { white-space: normal; }
@media (max-width: 640px) {  /* telefon: paczka i wydanie w dwóch równych kolumnach, plakietki pod nimi na całą szerokość */
  table.packages, table.packages thead, table.packages tbody { display: block; }
  table.packages colgroup { display: none; }
  table.packages tr { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
  table.packages th, table.packages td { border-bottom: 0; }
  table.packages th:last-child { display: none; }
  table.packages td.num { grid-column: 1 / -1; text-align: left; padding-top: 0; }
  table.packages td.num:empty { display: none; }
}
@media (max-width: 640px) {
  table.files .c-qty { width: 4rem; }
  table.files .c-col { width: 7rem; }
}

/* Podgląd administratora „jak widzi firma” */
.preview-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: -6px 0 16px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 8px; }
.preview-bar.active { border-style: solid; border-color: var(--warn); background: var(--warn-bg); }
.preview-bar label { font-weight: 600; }
.preview-bar select { width: auto; max-width: 100%; }

/* Kolory u lakierni: owalna ramka bez wypełnienia, każdy kolor (ze strukturą) w innym odcieniu */
.pill { display: inline-block; border: 2px solid var(--muted); border-radius: 999px; padding: 0 8px; font-weight: 600; line-height: 1.5; }
td.c-col .pill { margin: 1px 0; }
.release-colours { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 6px 0 10px; }
.colour-item { white-space: nowrap; }

/* Stopka: prawa i poufność plików */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.site-footer .inner { max-width: 1100px; margin: 0 auto; padding: 14px 16px 24px; text-align: center; line-height: 1.6; }

/* Wydania: zwijane karty, co druga w innym odcieniu, narożnik — czerwony (czeka na „Przyjęte do
   produkcji”) albo zielony (przyjęte) */
.release { position: relative; padding: 0; overflow: hidden; }
.releases .release:nth-child(even) { background: var(--surface-alt); }
.release > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 14px 44px 14px 16px; }
.release > summary::-webkit-details-marker { display: none; }
.release > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.release[open] > summary::before { transform: rotate(90deg); }
.release > summary h3 { margin: 0; }
.release-body { padding: 0 16px 12px; }
/* narożnik w nagłówku karty (widoczny też po zwinięciu), 4 px od ramki */
.corner { position: absolute; top: 4px; right: 4px; line-height: 0; z-index: 1; }
.corner svg { display: block; fill: currentColor; }
.corner.pending { color: #e03131; }
.corner.acked { color: var(--corner-ok); }

/* Zgłoszenia z Trello: czerwony pasek po lewej (otwarte), zielony (rozwiązane, zwinięte) */
.issue { padding: 0; border-left: 4px solid var(--bad); }
.issue.resolved { border-left-color: var(--ok); }
.issue > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 14px 16px; }
.issue > summary::-webkit-details-marker { display: none; }
.issue > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.issue[open] > summary::before { transform: rotate(90deg); }
.issue > summary h3 { margin: 0; }
.issue-body { padding: 0 16px 12px; }
.issue-mark { color: var(--bad); }
.issue-text { margin: 4px 0 8px; overflow-wrap: anywhere; }
.issue-original { margin: 0 0 8px; }
.issue-original > summary { cursor: pointer; }
.issue-files .file-chip { display: inline-block; margin: 2px 6px 2px 0; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-alt); overflow-wrap: anywhere; }
.issue-thread { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 6px; }
.issue-form { margin-top: 8px; }
.issue-form textarea { width: 100%; }
form.stack label.issue-copy { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; margin: 0; }
a.badge { text-decoration: none; }
.trello-line { margin: -4px 0 10px; }
.issue-state { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 8px; }

/* Wiki mebli */
.wiki-item { padding: 8px 0; border-top: 1px solid var(--line); }
.wiki-item:first-child { border-top: 0; padding-top: 0; }
.wiki-title { font-weight: 600; }
.wiki-body h1, .wiki-body h2, .wiki-body h3 { margin: 14px 0 6px; }
.wiki-body > :first-child { margin-top: 0; }
.wiki-body table { margin: 8px 0; }
.wiki-body code { font-size: .9em; }
.wiki-doc-bar { margin: 4px 0 6px; }
.wiki-doc { display: block; width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

/* Przegląd: wyszukiwarka komponentów i zwijane projekty */
.overview-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.overview-search input[type=search] { flex: 1 1 320px; max-width: 560px; }
.overview-search .toggle-projects { margin-left: auto; display: flex; gap: 6px; }
.search-results mark { background: var(--warn-bg); color: var(--warn); padding: 0 1px; border-radius: 2px; }
.search-project { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.search-project:first-of-type { border-top: 0; margin-top: 0; }
.search-project h3 { margin-bottom: 4px; }
.search-package { margin-left: 12px; }
.search-groups { margin: 0 0 8px; padding-left: 18px; overflow-wrap: anywhere; }
.search-groups li { margin: 2px 0 6px; }
.project-card { padding: 0; }
.project-card > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 16px; }
.project-card > summary::-webkit-details-marker { display: none; }
.project-card > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.project-card[open] > summary::before { transform: rotate(90deg); }
.project-card > summary h2 { margin: 0; }
.project-body { padding: 0 16px 12px; }

/* Notatka firmy pod „Przyjęte do produkcji”; nazwa przycisku w owalu w kolorze przycisku */
.ack-note { margin: 6px 0 0; max-width: 70ch; }
.btn-pill { display: inline-block; padding: 0 9px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-weight: 600; line-height: 1.6; white-space: nowrap; }

/* „urgent” z Trello (ciemny pomarańczowy, jak etykieta w Trello): brak części blokuje montaż albo wydanie auta */
.badge.urgent { background: #d9480f; color: #fff; }
.issue.urgent { border-left-color: #d9480f; }

/* Panel paczki: zgłoszenia, zwijane „Nowe wydanie”, wycofanie plików pogrupowane po elemencie */
.workspace-issues ul { margin: 4px 0 0; padding-left: 18px; }
.workspace-issues li { margin: 3px 0; }
.release-form { padding: 0; }
.release-form > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 16px; }
.release-form > summary::-webkit-details-marker { display: none; }
.release-form > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.release-form[open] > summary::before { transform: rotate(90deg); }
.release-form > summary h2 { margin: 0; }
.release-form-body { padding: 0 16px 14px; }
details.withdraw { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 10px; }
details.withdraw > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; }
details.withdraw > summary h3 { margin: 0; display: inline; }
.withdraw-groups { display: flex; flex-direction: column; }
.withdraw-group { border-top: 1px solid var(--line); padding: 4px 0; }
.withdraw-group > summary { cursor: pointer; overflow-wrap: anywhere; }
.withdraw-files { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 6px 28px; font-size: .9rem; }
/* Eksport plików: odbiorcy po firmach, wiersz z linkiem, kolumna zaznaczania na stronie odbiorcy */
.export-company { border-top: 1px solid var(--line); padding: 6px 0 2px; overflow-wrap: anywhere; }
.export-link-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.export-link-row input { flex: 1 1 260px; min-width: 0; }
th.c-sel, td.c-sel { width: 28px; }
table.files .c-got { width: 13rem; text-align: right; white-space: nowrap; }  /* panel eksportu: data pobrania */
@media (max-width: 600px) { table.files .c-got { width: 9.5rem; } }
#export-files button[disabled] { opacity: .45; cursor: default; }  /* „Pobierz zaznaczone” bez zaznaczenia */
/* Eksport: „ALL” przy DXF, podsumowanie wyboru po elementach (DXF, pod nim ↳ pliki elementu), widok elementów */
.export-file { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.export-file .element-all { color: var(--muted); white-space: nowrap; }
.export-picked { margin-top: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.export-picked h3 { margin-top: 0; }
.export-picked-list { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; overflow-wrap: anywhere; }
.picked-child { padding-left: .6em; }
/* plik elementu pod DXF-em: narożnik w dół i w prawo (jak ↳, czytelny w każdej czcionce) */
.child-mark { display: inline-block; width: .8em; height: .65em; margin: 0 .45em .15em .2em; border-left: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); vertical-align: baseline; }
.view-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
table.export-elements tbody.export-element { border-top: 2px solid var(--line); }
table.export-elements tr.element-child td { border-top-color: transparent; }
table.export-elements tr.element-child td > .small { padding-left: 1.45em; }  /* folder pod nazwą, równo z nazwą */

/* Opisy pól: przygaszona ikonka ⓘ, okienko z opisem po najechaniu */
.info { display: inline-flex; vertical-align: middle; margin-left: 4px; color: var(--muted); opacity: .5; cursor: help; line-height: 0; text-transform: none; }
.info:hover, .info:focus { opacity: 1; outline: none; }
.info:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 50%; }
.tip { position: fixed; z-index: 1000; max-width: min(320px, calc(100vw - 16px)); padding: 7px 10px; border-radius: 6px; background: var(--text); color: var(--bg); font-size: .82rem; font-weight: 400; line-height: 1.4; letter-spacing: normal; text-transform: none; text-align: left; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); pointer-events: none; }

/* Przegląd: strzałki kolejności projektów w nagłówku karty */
.move-project { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; flex: none; }
.move-project button { padding: 2px 8px; line-height: 1.2; }
.move-project button[disabled] { opacity: .35; cursor: default; }

/* Wylogowanie: ikonka w nagłówku */
.logout-form, .theme-form { margin: 0; display: inline-flex; }
button.icon-button {
  background: none; border: 0; padding: 5px; margin: 0; color: var(--muted); cursor: pointer;
  border-radius: 6px; display: inline-flex; align-items: center; line-height: 0; font-weight: 400;
}
button.icon-button:hover, button.icon-button:focus-visible { color: var(--accent); background: var(--surface-alt); }

/* Przegląd: nagłówek karty — nazwa i plakietki zawijają się w swojej części, strzałki zawsze z prawej */
.project-card > summary { flex-wrap: nowrap; }
.project-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
/* Przegląd: te same szerokości kolumn we wszystkich projektach, nagłówki z ikonką ⓘ w jednej linii */
table.overview-table { table-layout: fixed; min-width: 720px; }
table.overview-table col.c-pkg { width: 36%; }
table.overview-table col.c-wait { width: 9rem; }
table.overview-table col.c-last { width: 13.5rem; }
table.overview-table th { white-space: nowrap; }
table.overview-table td:first-child { overflow-wrap: anywhere; }
table.overview-table td.c-last { white-space: nowrap; }

/* Strona startowa: kafelki sekcji portalu */
.start-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 16px; }
.tile {
  display: flex; flex-direction: column; gap: 8px; min-height: 150px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none;
}
a.tile:hover, a.tile:focus-visible { border-color: var(--accent); }
.tile-head { display: flex; align-items: center; gap: 10px; }
.tile-head svg { color: var(--accent); flex: none; }
.tile-title { font-weight: 600; font-size: 1.05rem; }
.tile-desc { color: var(--muted); font-size: .9rem; }
.tile-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.tile.soon { background: transparent; border-style: dashed; color: var(--muted); }
.tile.soon .tile-head svg, .tile.soon .tile-title { color: var(--muted); }
.start-note { margin-top: 14px; }

/* Wyceny (/admin/estimates/) */
.est-steps { margin: .4rem 0 .6rem 1.2rem; padding: 0; }
.est-steps li { margin: .3rem 0; }
.est-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.est-card-head h2 { margin: 0; }
.est-table { width: 100%; border-collapse: collapse; margin-top: .6rem; }
.est-table th, .est-table td { text-align: left; padding: .45rem .5rem; border-top: 1px solid var(--line); vertical-align: top; }
.est-table tr:first-child th, .est-table tr:first-child td { border-top: 0; }
.est-table th { font-weight: 600; white-space: nowrap; }
.est-count { font-variant-numeric: tabular-nums; text-align: right; width: 3rem; }
.est-filters { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.est-actions { text-align: right; width: 1%; white-space: nowrap; }
.est-job + .est-job { border-top: 1px solid var(--line); margin-top: .6rem; padding-top: .6rem; }
.est-job h3 { margin: 0 0 .2rem; font-size: 1rem; }
.est-job p { margin: .2rem 0; }

/* Wyceny, etap 2: lista wycen i kreator */
.est-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.est-head h1 { margin: 0 0 .3rem; }
.est-head-num { margin: 0; }
.est-head-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.est-inline { display: inline-flex; gap: .4rem; align-items: center; margin: 0; }
.est-inline select { width: auto; }
.est-versions { margin: .2rem 0 .6rem; }
.est-steps-nav { display: flex; flex-wrap: wrap; gap: .3rem; margin: .8rem 0; }
.est-step { padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; text-decoration: none; color: var(--text); white-space: nowrap; }
.est-step.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.est-step.soon { color: var(--muted); border-style: dashed; }
.est-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin: 0 0 .6rem; }
.est-metric { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; background: var(--surface, transparent); }
.est-metric span { display: block; font-size: .8rem; color: var(--muted); }
.est-metric strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.est-flags { margin: 0 0 .6rem; }
.est-live-note { margin: 0 0 .6rem; }
.est-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1rem; }
.est-grid > label, .est-checks { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; font-size: .9rem; }
.est-grid input, .est-grid select, .est-grid textarea { font-weight: 400; max-width: none; }
.est-wide { grid-column: 1 / -1; }
.est-label { font-weight: 600; }
.est-check { font-weight: 400; display: inline-flex; gap: .4rem; align-items: center; }
.est-checks { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .8rem; }
.est-checklist > div { columns: 2; column-gap: 1.5rem; }
.est-checklist label { display: block; font-weight: 400; margin: .2rem 0; break-inside: avoid; }
.est-buttons { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .9rem; }
.est-lines { width: 100%; border-collapse: collapse; }
.est-lines td { padding: .4rem .35rem; vertical-align: top; }
.est-lines input[type=text] { min-width: 11rem; }
.est-lines td:first-child input + input { margin-top: .25rem; font-size: .8rem; color: var(--muted); }
input.est-num { width: 6.2rem; max-width: 6.2rem; text-align: right; padding: 6px 6px; }
input.est-unit, .est-lines input.est-unit { width: 4rem; min-width: 4rem; max-width: 4rem; padding: 6px 6px; }
.est-pair { white-space: nowrap; }
.est-pair input + input { margin-left: .25rem; }
.est-c { text-align: center; }
.est-r { text-align: right; font-variant-numeric: tabular-nums; }
.est-table th.est-r, .est-table td.est-r { text-align: right; }
.est-nowrap { white-space: nowrap; }
.est-amount { white-space: nowrap; }
.est-strong td { font-weight: 700; }
.est-assumption td:first-child { border-left: 3px solid var(--warn); }
.est-search { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .4rem 0; }
.est-search input[type=search] { max-width: 22rem; }
.est-search input[type=text], .est-search select { width: auto; max-width: 18rem; }
.est-catalog td { padding: .35rem .5rem; }
.est-check-row { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.est-mail { width: 100%; font: .9rem/1.45 ui-monospace, Consolas, monospace; margin-top: .4rem; }
.est-list { margin: .3rem 0 0 1.1rem; padding: 0; }
.est-status-filter { margin: .2rem 0 .5rem; }
@media (max-width: 720px) {
  .est-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .est-grid { grid-template-columns: 1fr; }
  .est-checklist > div { columns: 1; }
}

/* Etapy zleceń (Zlecenia, karta projektu w Przeglądzie, strona etapu) */
.stage-steps { display: flex; gap: 2px; margin: 4px 0 2px; max-width: 12rem; }
.stage-steps span { flex: 1 1 0; height: 5px; border-radius: 2px; background: var(--line); }
.stage-steps span.done { background: var(--info); }
.stage-steps.large { max-width: 28rem; margin: 0 0 6px; }
.stage-steps.large span { height: 8px; }
a.stage-link { text-decoration: none; }
table.orders-table { min-width: 760px; }
table.orders-table td { vertical-align: top; }
tr.current-stage td { background: var(--info-bg); }
.stage-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0 16px; }
/* Moduł „Proces”: edycja typów i etapów */
.proc-row { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.proc-row-4 { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.process-edit input[type=text], .process-edit input[type=number], .process-edit select, .process-edit textarea { max-width: 100%; }
.process-stage.archived summary { opacity: .6; }
.process-stage .project-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.process-stage .actions form { display: inline; }
.project-type-form { margin: 0 0 10px; }
.project-type-form select { width: auto; max-width: 18rem; padding: 3px 8px; }
table.process-types { width: 100%; border-collapse: collapse; }
table.process-types th, table.process-types td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.process-types th.num, table.process-types td.num { text-align: right; width: 6rem; }
.stage-form select, .stage-form input[type="date"] { max-width: 100%; }
.stage-form textarea { width: 100%; }
ol.stage-history { list-style: none; padding: 0; margin: 0; }
ol.stage-history li { padding: 8px 0; border-bottom: 1px solid var(--line); }
ol.stage-history li:last-child { border-bottom: 0; }
.stage-comment { margin: 4px 0 2px; white-space: normal; }
p.untracked-line { margin: 8px 0 0; }
details.client-card table.orders-table { margin-top: 4px; }
/* Zlecenia: te same szerokości kolumn w każdej grupie Klienta */
/* NR w osobnej kolumnie (Adam 23.11): stała szerokość na LD-2026-001, nazwa bierze resztę */
table.orders-table { table-layout: fixed; }
table.orders-table col.c-no { width: 7.6rem; }
table.orders-table col.c-stage { width: 28%; }
table.orders-table col.c-wait { width: 15%; }
table.orders-table col.c-deadline { width: 11%; }
table.orders-table col.c-issues { width: 10%; }
table.orders-table td.c-no { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.orders-table td.c-no + td, table.client-orders td:first-child { overflow-wrap: anywhere; }
/* Zlecenia: filtry (etap, czeka na) i przesuwanie zleceń w Kliencie */
.orders-filters { margin: 0 0 14px; }
.orders-filters p { margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
a.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); text-decoration: none; background: var(--surface); }
a.chip:hover { border-color: var(--accent); }
a.chip.me { border-color: var(--warn); }
a.chip.active { background: var(--info-bg); border-color: var(--info); color: var(--info); font-weight: 600; }
a.chip .chip-count { color: var(--muted); font-size: .85em; }
table.orders-table.with-move col.c-stage { width: 25%; }
table.orders-table.with-move col.c-wait { width: 14%; }
table.orders-table.with-move col.c-deadline { width: 10%; }
table.orders-table.with-move col.c-issues { width: 9%; }
table.orders-table col.c-move { width: 9%; }
td.order-move form { display: flex; gap: 4px; justify-content: flex-end; margin: 0; }
td.order-move button[disabled] { opacity: .35; cursor: default; }
/* Strona etapu: zwijane sekcje */
details.stage-section .project-body { margin-top: 4px; }
/* Termin po czasie: data na czerwono także w polu formularza */
.deadline-overdue input[type="date"] { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }
.deadline-overdue .overdue-note { color: var(--bad); }
/* Przegląd: nagłówek karty projektu w stałych kolumnach (te same szerokości w każdej karcie).
   Nazwa projektu: do 32 znaków (limit w modelu). Na wąskim ekranie kolumny się zawijają. */
.project-head.head-cols { display: grid; align-items: center; gap: 6px 10px;
  /* nazwa | odstęp | Klient | etap | czeka na | termin | zgłoszenia | paczki (przy strzałkach) */
  grid-template-columns: auto minmax(0, 1fr) 10rem 17rem 9.5rem 6rem 4.5rem 5rem; }
.head-cols .col-name { width: 32ch; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-cols .col-client { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.head-cols .col-stage, .head-cols .col-wait { min-width: 0; display: flex; align-items: center; }
.head-cols .col-stage a.stage-link { display: flex; min-width: 0; max-width: 100%; }
.head-cols .col-stage .badge, .head-cols .col-wait .badge { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.head-cols .col-issues { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.head-cols .col-stage a.stage-link { align-items: center; gap: 6px; color: var(--text); }
.head-cols .col-stage .stage-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-cols .col-packages { text-align: right; white-space: nowrap; }
@media (max-width: 1200px) {
  .project-head.head-cols { display: flex; flex-wrap: wrap; }
  .head-cols .col-gap { display: none; }
  .head-cols .col-name { width: auto; max-width: 100%; }
}

/* Szerokie strony (Przegląd, Zlecenia): więcej miejsca na kolumny nagłówków */
body.wide header.top .inner, body.wide main { max-width: 1360px; }

/* Symbole etapów: stopniowane kolory od niebieskiego (początek zlecenia) przez zielony do pomarańczowego (postprodukcja);
   zakończone zlecenie: pełna zieleń */
.badge.stage-code { min-width: 2.4em; text-align: center; letter-spacing: .02em; }
.badge.stage-code.s-A0 { background: hsl(230 70% 91%); color: hsl(230 65% 27%); }
.badge.stage-code.s-A1 { background: hsl(212 70% 91%); color: hsl(212 65% 27%); }
.badge.stage-code.s-FZ { background: hsl(194 70% 91%); color: hsl(194 65% 27%); }
.badge.stage-code.s-A2 { background: hsl(176 70% 91%); color: hsl(176 65% 27%); }
.badge.stage-code.s-ZM { background: hsl(158 70% 91%); color: hsl(158 65% 27%); }
.badge.stage-code.s-B { background: hsl(138 70% 91%); color: hsl(138 65% 27%); }
.badge.stage-code.s-C { background: hsl(118 70% 91%); color: hsl(118 65% 27%); }
.badge.stage-code.s-D { background: hsl(92 70% 91%); color: hsl(92 65% 27%); }
.badge.stage-code.s-E { background: hsl(62 70% 91%); color: hsl(62 65% 27%); }
.badge.stage-code.s-F { background: hsl(38 70% 91%); color: hsl(38 65% 27%); }
.badge.stage-code.s-W { background: hsl(20 70% 91%); color: hsl(20 65% 27%); }
.badge.stage-code.s-AW { background: hsl(335 70% 91%); color: hsl(335 65% 27%); }
.badge.stage-code.s-END { background: hsl(140 55% 36%); color: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge.stage-code.s-END { background: hsl(140 45% 32%); color: #fff; }
  :root:not([data-theme="light"]) .badge.stage-code.s-A0 { background: hsl(230 40% 22%); color: hsl(230 70% 76%); }
  :root:not([data-theme="light"]) .badge.stage-code.s-A1 { background: hsl(212 40% 22%); color: hsl(212 70% 76%); }
  :root:not([data-theme="light"]) .badge.stage-code.s-FZ { background: hsl(194 40% 22%); color: hsl(194 70% 76%); }
  :root:not([data-theme="light"]) .badge.stage-code.s-A2 { background: hsl(176 40% 22%); color: hsl(176 70% 76%); }
  :root:not([data-theme="light"]) .badge.stage-code.s-ZM { background: hsl(158 40% 22%); color: hsl(158 70% 76%); }
  :root:not([data-theme="light"]) .badge.stage-code.s-B { background: hsl(138 40% 22%); color: hsl(138 70% 76%); }
  :root:not([data-theme="light"]) .badge.stage-code.s-C { background: hsl(118 40% 22%); color: hsl(118 70% 76%); }
  :root:not([data-theme="light"]) .badge.stage-code.s-D { background: hsl(92 40% 22%); color: hsl(92 70% 76%); }
  :root:not([data-theme="light"]) .badge.stage-code.s-E { background: hsl(62 40% 22%); color: hsl(62 70% 76%); }
  :root:not([data-theme="light"]) .badge.stage-code.s-F { background: hsl(38 40% 22%); color: hsl(38 70% 76%); }
  :root:not([data-theme="light"]) .badge.stage-code.s-W { background: hsl(20 40% 22%); color: hsl(20 70% 76%); }
  :root:not([data-theme="light"]) .badge.stage-code.s-AW { background: hsl(335 40% 22%); color: hsl(335 70% 76%); }
}
:root[data-theme="dark"] .badge.stage-code.s-A0 { background: hsl(230 40% 22%); color: hsl(230 70% 76%); }
:root[data-theme="dark"] .badge.stage-code.s-A1 { background: hsl(212 40% 22%); color: hsl(212 70% 76%); }
:root[data-theme="dark"] .badge.stage-code.s-FZ { background: hsl(194 40% 22%); color: hsl(194 70% 76%); }
:root[data-theme="dark"] .badge.stage-code.s-A2 { background: hsl(176 40% 22%); color: hsl(176 70% 76%); }
:root[data-theme="dark"] .badge.stage-code.s-ZM { background: hsl(158 40% 22%); color: hsl(158 70% 76%); }
:root[data-theme="dark"] .badge.stage-code.s-B { background: hsl(138 40% 22%); color: hsl(138 70% 76%); }
:root[data-theme="dark"] .badge.stage-code.s-C { background: hsl(118 40% 22%); color: hsl(118 70% 76%); }
:root[data-theme="dark"] .badge.stage-code.s-D { background: hsl(92 40% 22%); color: hsl(92 70% 76%); }
:root[data-theme="dark"] .badge.stage-code.s-E { background: hsl(62 40% 22%); color: hsl(62 70% 76%); }
:root[data-theme="dark"] .badge.stage-code.s-F { background: hsl(38 40% 22%); color: hsl(38 70% 76%); }
:root[data-theme="dark"] .badge.stage-code.s-W { background: hsl(20 40% 22%); color: hsl(20 70% 76%); }
:root[data-theme="dark"] .badge.stage-code.s-AW { background: hsl(335 40% 22%); color: hsl(335 70% 76%); }
:root[data-theme="dark"] .badge.stage-code.s-END { background: hsl(140 45% 32%); color: #fff; }
.stage-label { color: var(--text); }
/* Produkcja (etap D): tory ALU i sklejki, jak etykiety w Trello (ALU czerwone, sklejka niebieska) */
.badge.track-ALU { background: var(--bad-bg); color: var(--bad); }
.badge.track-PLY { background: var(--info-bg); color: var(--info); }
table.production-table td { vertical-align: middle; }
form.prod-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
form.prod-form input[type="text"] { width: 12rem; }
details.production-history { margin-top: 10px; }
details.production-history > summary { cursor: pointer; color: var(--muted); }
form.prod-form select { width: auto; max-width: 13rem; }
table.production-table th:first-child, table.production-table td:first-child { width: 5rem; }
table.production-table td:nth-child(4) { white-space: nowrap; }

/* Słowniczek (DICT) i owale stron procesu (skrót + kolor firmy) */
table.glossary { width: 100%; border-collapse: collapse; }
table.glossary td { padding: 8px 10px 8px 0; border-top: 1px solid var(--line); vertical-align: top; }
table.glossary tr:first-child td { border-top: 0; }
table.glossary td.g-code { width: 6.5rem; white-space: nowrap; }
table.glossary td.g-name { width: 15rem; }
table.glossary td.g-vis { width: 12rem; }
.party { --party: #8a8f98; display: inline-block; min-width: 2.6em; padding: 1px 9px; border: 2px solid var(--party); border-radius: 999px;
  color: var(--text); font-size: .8rem; font-weight: 700; letter-spacing: .03em; text-align: center; white-space: nowrap; }
@media (max-width: 700px) { table.glossary td.g-name, table.glossary td.g-vis { width: auto; } table.glossary td.g-code { width: 4.5rem; } }

/* Nagłówek projektu z zakładkami (portal/admin/_project_header.html): Etap i WO, Pliki PROD, Harmonogram, widok Klienta */
.project-header { margin-bottom: 16px; }
.project-header h1 { margin-bottom: 4px; }
.project-header .sub { margin-bottom: 10px; }
.project-header.compact .project-line { margin: 0 0 8px; }
.project-header.compact .project-line a { text-decoration: none; }
.project-tabs { display: flex; flex-wrap: wrap; gap: 2px 4px; align-items: flex-end; border-bottom: 1px solid var(--line); }
.project-tabs a { padding: 6px 12px; margin-bottom: -1px; border: 1px solid transparent; border-radius: 6px 6px 0 0;
  text-decoration: none; color: var(--muted); white-space: nowrap; }
.project-tabs a:hover, .project-tabs a:focus-visible { color: var(--text); background: var(--surface); }
.project-tabs a.active { color: var(--text); font-weight: 600; background: var(--surface); border-color: var(--line); border-bottom-color: var(--surface); }
.project-tabs .tab-count { color: var(--muted); font-size: .8rem; font-weight: 400; }
.project-tabs .tab-side { margin-left: auto; font-size: .9rem; }
.project-tabs .badge { font-weight: 400; }
@media (max-width: 600px) { .project-tabs .tab-side { margin-left: 0; } .project-tabs a { padding: 5px 9px; } }
/* Okienko 3D modelu Fusion (portal/admin/_fusion_dock.html). fd-side: obok treści po prawej (szerokość liczy skrypt),
   zostaje przy przewijaniu; fd-float: pływające w prawym dolnym rogu na węższym ekranie. */
main:has(> .fusion-rail) { position: relative; }
.fusion-rail[hidden], .fusion-fab[hidden], .fusion-dock [hidden] { display: none !important; }
.fusion-rail.fd-side { position: absolute; top: 0; bottom: 0; left: 100%; }
.fusion-rail.fd-side .fusion-dock { position: sticky; top: 12px; }
.fusion-rail.fd-float { position: fixed; right: 16px; bottom: 16px; width: min(440px, calc(100vw - 32px)); z-index: 60; }
.fusion-rail.fd-float .fusion-dock { box-shadow: 0 8px 28px rgba(0, 0, 0, .35); }
.fusion-dock { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.fd-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; border-bottom: 1px solid var(--line); font-size: .88rem; }
.fd-head { flex-wrap: wrap; row-gap: 4px; }  /* ciasno (kilka przycisków) — przyciski w drugim rzędzie, lista modeli czytelna */
.fd-head .fd-pick { flex: 1 1 auto; min-width: 9rem; width: auto; padding: 2px 4px; font-size: .88rem; }
.fd-head .fd-actions { margin-left: auto; }
.fd-head .fd-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-actions { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.fd-actions a { text-decoration: none; }
.fd-close { background: none; border: 0; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: 0 2px; cursor: pointer; }
.fd-close:hover, .fd-close:focus-visible { color: var(--text); }
.fd-body { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-alt); display: flex; align-items: center; justify-content: center; }
.fd-body .fd-none { margin: 0 16px; text-align: center; }
/* rozmiar i skalę ramki ustawia skrypt (fit): 800 px pomniejszone do okienka, pasek Autodesk poniżej krawędzi */
.fd-frame { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border: 0; transform-origin: 0 0; }
.fd-tools { background: none; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: .8rem; padding: 0 6px; cursor: pointer; }
.fd-tools[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.fusion-fab { position: fixed; right: 16px; bottom: 16px; z-index: 60; border-radius: 999px; padding: 8px 14px; font-weight: 600; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
/* Viewer APS w okienku (25.11): pasek narzędzi Autodesk tylko po „Narzędzia”, karta klikniętej części pod modelem */
.fd-aps { position: absolute; inset: 0; }
.fusion-dock:not(.fd-tools-on) .fd-aps .adsk-toolbar { display: none; }
.fd-msg { position: absolute; left: 12px; right: 12px; top: 50%; transform: translateY(-50%); margin: 0; text-align: center; z-index: 5; pointer-events: none; }
.fd-card { border-top: 1px solid var(--line); padding: 8px 10px; max-height: 40vh; overflow: auto; font-size: .88rem; }
.fd-card p { margin: 2px 0 6px; }
.fd-el + .fd-el { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.fd-el strong { overflow-wrap: anywhere; }
.fd-el-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.fd-el-actions button[disabled] { opacity: .45; cursor: not-allowed; }
/* strona elementu: dane z listy części i podgląd 3D samego elementu obok siebie (25.11) */
.el-top.with-3d { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; align-items: start; }
@media (max-width: 900px) { .el-top.with-3d { grid-template-columns: minmax(0, 1fr); } }
.el-3d-card { padding: 0; overflow: hidden; }
.el-3d-view { position: relative; height: 360px; background: var(--surface-alt); }
.el-3d-view[hidden] { display: none; }
.el-3d-msg { margin: 0; padding: 10px 14px; }
.el-3d-msg[hidden] { display: none; }
/* SpaceMouse (WebHID, próba dla admina, 25.11): przycisk w lewym dolnym rogu, panel nad nim */
.sm-root { position: fixed; left: 16px; bottom: 16px; z-index: 61; }
.sm-root[hidden], .sm-root [hidden] { display: none !important; }
.sm-toggle { box-shadow: 0 4px 14px rgba(0, 0, 0, .25); background: var(--surface); }
.sm-dot { display: inline-block; width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: var(--muted); vertical-align: 1px; }
.sm-root.on .sm-dot { background: #2fa36b; }
.sm-panel { position: absolute; left: 0; bottom: calc(100% + 8px); width: 340px; max-height: 75vh; overflow: auto; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); }
.sm-panel .sm-axes { width: 100%; margin: 8px 0; }
.sm-panel .sm-axes td, .sm-panel .sm-axes th { padding: 2px 4px; }
.sm-speed { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
/* przycisk pod podglądem (okienko 3D, strona elementu, strona próbna); panel jako warstwa przy przycisku */
.sm-root.in-slot { position: static; display: inline-block; }
.sm-root.in-slot .sm-toggle { box-shadow: none; }
.sm-root.in-slot .sm-panel { position: fixed; left: auto; z-index: 70; text-align: left; }
.fd-foot { padding: 6px 10px; border-top: 1px solid var(--line); text-align: right; }
.el-3d-foot, .aps-foot { margin-top: 8px; text-align: right; }
.fd-foot:empty, .el-3d-foot:empty, .aps-foot:empty { display: none; }
.sm-speed input { flex: 1 1 auto; }
button.el-3d { margin-left: 6px; padding: 0 6px; font-size: .72rem; font-weight: 600; line-height: 1.55; border-radius: 4px; vertical-align: 1px; background: transparent; color: var(--accent); }
.fusion-list { list-style: none; padding: 0; margin: 0 0 12px; }
.fusion-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
/* Formularze „Dane projektu” i „Dane paczki” (portal/admin/_data_fields.html) */
.data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; }
.data-field { margin-bottom: 12px; }
.data-field > label { display: block; font-weight: 600; margin-bottom: 4px; }
.data-field.data-check > label { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.data-field input[type=url] { width: 100%; max-width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--text); font: inherit; }
.data-field.has-error input, .data-field.has-error select { border-color: var(--bad); }
.data-field .field-error { color: var(--bad); margin-top: 2px; }
.data-companies > div, .data-companies ul { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; }
.data-companies label { font-weight: 400 !important; display: inline-flex; gap: 6px; align-items: center; }
.data-companies, .data-sheet_url, .data-sheet_categories, .data-furniture_sheet, .data-trello_board { grid-column: 1 / -1; }
.data-facts code { font-size: .85rem; }
@media (max-width: 700px) { .data-grid { grid-template-columns: minmax(0, 1fr); } }
/* Karta klienta detalicznego (portal/customers/form.html): grupy pól, rodzaj osoba / firma */
.cust-form h2.cust-group { font-size: 1rem; margin: 18px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.cust-form h2.cust-group:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.cust-label { display: block; font-weight: 600; margin-bottom: 4px; }
.cust-radios { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.cust-radios label { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; }
.cust-form input.short { max-width: 9rem; }
.cust-form input[type=date] { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.cust-form .data-delivery_address, .cust-form .data-note, .cust-form .data-consent_source { grid-column: 1 / -1; }
.cust-links { margin: .3rem 0 1rem; padding-left: 1.1rem; }
.cust-links li { margin: .2rem 0; }
/* Harmonogram otwarty z zakładki projektu: ten projekt wyróżniony */
.g-block:target { outline: 2px solid var(--accent); outline-offset: -2px; scroll-margin-top: 80px; }

/* Strona zlecenia: zwijany pasek procesu po lewej (Adam, 2026-11-15) */
.order-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 18px; align-items: start; }
.order-layout > aside { position: sticky; top: 12px; }
.order-main > h1:first-child { margin-top: 0; }
.process-bar { padding: 10px 12px; }
.process-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.process-head h2 { font-size: 1rem; margin: 0; }
.process-toggle { font-size: 1.15rem; line-height: 1; padding: 0 4px; text-decoration: none; }
/* zwinięty do lewego boku: same symbole etapów */
.order-layout.process-collapsed { grid-template-columns: 3.6rem minmax(0, 1fr); }
.order-layout.process-collapsed .process-bar { padding: 8px 4px; }
.order-layout.process-collapsed .process-head { justify-content: center; }
.order-layout.process-collapsed .process-head h2, .order-layout.process-collapsed .p-label, .order-layout.process-collapsed .process-help { display: none; }
.order-layout.process-collapsed ol.process li + li::before { padding-left: 0; text-align: center; }
.order-layout.process-collapsed ol.process a { justify-content: center; padding: 2px 0; }
.stage-hint { margin: 0 0 4px; padding: 6px 10px; border-left: 3px solid var(--warn); background: var(--surface); }
ol.process { list-style: none; margin: 8px 0 6px; padding: 0; }
ol.process li + li::before { content: "↓"; display: block; padding-left: 1.05em; color: var(--muted); font-size: .75rem; line-height: 1.05; }
ol.process a { display: flex; align-items: center; gap: 8px; padding: 2px 6px; border-radius: 6px; color: var(--text); text-decoration: none; }
ol.process a:hover { background: var(--info-bg); }
ol.process li.p-done a { opacity: .55; }
ol.process li.p-current a { background: var(--info-bg); box-shadow: inset 0 0 0 2px var(--info); font-weight: 700; }
ol.process li.p-future .p-label { color: var(--muted); }
ol.process .p-label { font-size: .86rem; line-height: 1.25; }
/* Etapy równoległe (np. A0): osobna lista pod paskiem, ze stanem w projekcie. */
ul.process-side { list-style: none; margin: 4px 0 6px; padding: 6px 0 0; border-top: 1px dashed var(--line); }
ul.process-side:empty { display: none; }
ul.process-side::before { content: attr(data-title); display: block; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
ul.process-side li { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; }
ul.process-side a { display: flex; align-items: center; gap: 8px; padding: 2px 6px; border-radius: 6px; color: var(--text); text-decoration: none; }
ul.process-side a:hover { background: var(--info-bg); }
ul.process-side .p-label { font-size: .86rem; line-height: 1.25; }
ul.process-side li.ps-done a, ul.process-side li.ps-na a { opacity: .55; }
ul.process-side .badge { font-size: .72rem; }
.order-layout.process-collapsed ul.process-side::before, .order-layout.process-collapsed ul.process-side .badge { display: none; }
.order-layout.process-collapsed ul.process-side a { justify-content: center; padding: 2px 0; }
.preview-note { padding: 8px 12px; border: 1px dashed var(--info); border-radius: 8px; background: var(--info-bg); }
.track-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 3px 0; }
table.client-orders td { vertical-align: top; }
table.glossary tr.g-collapsed td { padding-top: 3px; padding-bottom: 3px; }
table.glossary tr.g-collapsed strong { font-weight: 500; }
table.glossary tr.g-focus td { background: var(--info-bg); }
/* minmax(0, 1fr), nie 1fr: szeroka tabela WO rozpychała kolumnę i cała strona projektu miała na telefonie ~900 px */
@media (max-width: 860px) { .order-layout, .order-layout.process-collapsed { grid-template-columns: minmax(0, 1fr); } .order-layout > aside { position: static; } }
/* Widok Klienta: więcej miejsca na produkcję (status i data w jednej linii), bez pustego miejsca nad nagłówkiem karty */
table.client-orders th:last-child, table.client-orders td:last-child { width: 36%; }
table.client-orders td:first-child { width: 16%; }
.track-line > .small { white-space: nowrap; }
.order-main .card > h2:first-child { margin-top: 0; }

/* Zlecenia WO na stronie projektu */
.proj-no { font-weight: 500; font-variant-numeric: tabular-nums; }
h1 .proj-no { font-size: .8em; }
table.wo-table td { vertical-align: top; }
.wo-add { margin-top: 10px; }
.wo-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 8px 14px; margin-top: 8px; }
.wo-form-grid .wo-f label { display: block; font-size: .85rem; color: var(--muted); }
.wo-form-grid .wo-f select, .wo-form-grid .wo-f input[type=text], .wo-form-grid .wo-f input[type=date], .wo-form-grid .wo-f textarea { width: 100%; box-sizing: border-box; }
.wo-form-grid .wo-f-note, .wo-form-grid .wo-f-packages { grid-column: 1 / -1; }
.wo-form-grid .wo-f-packages div { display: flex; flex-wrap: wrap; gap: 4px 14px; }
table.wo-table td:first-child a { white-space: nowrap; }

/* Harmonogram (Gantt): fazy projektów i WO na osi czasu */
.g-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 8px; align-items: center; }
.g-key { display: inline-block; width: 22px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: 4px; background: var(--info); }
.g-key-plan { background: transparent; border: 1px dashed var(--info); }
.g-key-active { opacity: .9; }
.g-key-done { opacity: .45; }
.g-key-today { width: 2px; height: 14px; background: var(--bad, #d1495b); border-radius: 0; }
.g-key-bad { height: 0; border-top: 2px solid var(--bad, #d1495b); border-radius: 0; }
.g-card { padding: 8px; }
/* Oś (Adam 23.11): na szerokość okna trzy miesiące (--zoom = dni osi / 91), reszta w bok. Siatka nie jest wyższa
   niż okno, więc pasek przewijania na dole i nagłówek miesięcy są zawsze na ekranie. */
.g-scroll { overflow: auto; max-height: calc(100vh - 4.5rem); container-type: inline-size; overscroll-behavior-x: contain; }
.g-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.g-scroll.g-panning { cursor: grabbing; user-select: none; }
.g-inner { --label: 23rem; --row: 28px; position: relative; min-width: 1150px; width: calc(var(--label) + (100cqw - var(--label)) * var(--zoom, 1)); }
/* każdy wiersz: zamrożona etykieta (sticky, Adam 19.11) i obszar osi z liniami tygodni */
.g-row { display: grid; grid-template-columns: var(--label) minmax(0, 1fr); }
.g-row > .g-label { position: sticky; left: 0; z-index: 3; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.g-area { position: relative; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: var(--week) 100%; }
.g-axis { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.g-months { position: relative; height: 1.6rem; background-image: none; }
.g-months span { position: absolute; top: 0; bottom: 0; padding: 3px 6px; font-size: .78rem; color: var(--muted); border-left: 1px solid var(--line); overflow: hidden; white-space: nowrap; }
.g-scale { background-image: none; }
.g-weeks { position: relative; height: 1.15rem; border-top: 1px solid var(--line); }
.g-weeks span { position: absolute; top: 0; bottom: 0; box-sizing: border-box; padding: 1px 4px; font-size: .7rem; line-height: 1rem; color: var(--muted); border-left: 1px solid var(--line); overflow: hidden; white-space: nowrap; font-variant-numeric: tabular-nums; }
.g-row > .g-axis-label { height: auto; align-self: stretch; }
.g-to-today { padding: 1px 8px; }
.g-pan-hint { cursor: help; }
/* Harmonogram: filtry jak w Przeglądzie i lista projektów do ukrycia */
.g-filters .g-filter-line { margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.g-pick { position: relative; display: inline-block; }
.g-pick > summary { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; list-style: none; }
.g-pick > summary::-webkit-details-marker { display: none; }
.g-pick > summary:hover { border-color: var(--accent); }
.g-pick > summary.active { background: var(--info-bg); border-color: var(--info); color: var(--info); font-weight: 600; }
.g-pick-panel { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; width: max-content; min-width: 20rem; max-width: min(36rem, 90vw); max-height: 60vh; overflow: auto; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / .18); }
.g-pick-actions { padding: 0 6px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.g-pick-row { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.g-pick-row:hover { background: var(--info-bg); }
.g-pick-row .proj-no { min-width: 6.5rem; }
.g-pick-name { overflow: hidden; text-overflow: ellipsis; }
.g-pick-only { margin-left: auto; padding-left: 14px; }
.g-block { position: relative; border-bottom: 1px solid var(--line); }
.g-block.g-selected { box-shadow: inset 3px 0 0 var(--accent); }
.g-block.g-selected > .g-head > .g-label { background: var(--info-bg); }
.g-sub { display: none; }
.g-block.open > .g-sub { display: grid; }
/* lewa kolumna: trzy równe kolumny dla projektu (klient · numer · nazwa) i WO (wykonawca · WO-n · rodzaj i tytuł) */
.g-label { display: grid; grid-template-columns: 4.2rem 5.9rem minmax(0, 1fr); column-gap: .6rem; align-items: center; height: var(--row); padding: 0 8px 0 2px; overflow: hidden; }
.g-label > span, .g-label > a { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.g-c1 { display: flex; align-items: center; gap: 2px; }
.g-c2 { font-variant-numeric: tabular-nums; }
.g-project-label { font-size: .92rem; }
.g-toggle { border: 0; background: none; padding: 0 2px; font-size: .9rem; line-height: 1; color: var(--muted); cursor: pointer; transition: transform .15s; }
.g-block.open .g-toggle { transform: rotate(90deg); }
.g-open { text-decoration: none; }
.g-cell { position: relative; height: var(--row); }
.g-phases { background-color: color-mix(in srgb, var(--line) 35%, transparent); }
.g-stage-row .g-label { padding-left: 1.2rem; }
.g-stage-row .g-area { background-color: color-mix(in srgb, var(--line) 15%, transparent); }
.g-phase, .g-bar { position: absolute; top: 4px; bottom: 4px; border-radius: 4px; overflow: hidden; white-space: nowrap; font-size: .72rem; line-height: 20px; padding: 0 5px; box-sizing: border-box; }
.s-A0 { --h: 230; } .s-A1 { --h: 212; } .s-FZ { --h: 194; } .s-A2 { --h: 176; } .s-ZM { --h: 158; } .s-B { --h: 138; }
.s-C { --h: 118; } .s-D { --h: 92; } .s-E { --h: 62; } .s-F { --h: 38; } .s-W { --h: 20; } .s-AW { --h: 335; }
.g-phase { background: hsl(var(--h, 220) 60% 76%); color: hsl(var(--h, 220) 60% 20%); font-weight: 700; text-align: center; }
.g-phase.s-END { background: hsl(140 55% 36%); color: #fff; }
/* rozwinięcie: plan etapu (obrys), przebieg (pasek w środku), zadania etapu (cienkie linie u dołu) */
.g-plan { position: absolute; top: 3px; bottom: 3px; border: 1.5px dashed hsl(var(--h, 220) 55% 45%); border-radius: 5px; box-sizing: border-box; }
.g-run { position: absolute; top: 8px; height: 9px; border-radius: 3px; background: hsl(var(--h, 220) 60% 70%); }
.g-span { position: absolute; bottom: calc(2px + var(--i, 0) * 3px); height: 2px; background: #0c66e4; border-radius: 1px; opacity: .85; }
.g-span.done { background: var(--muted); opacity: .5; }
.g-span.late { background: var(--warn, #c77700); }
.g-bar { --party: #8a8f98; border: 1px solid var(--party); background: color-mix(in srgb, var(--party) 55%, transparent); color: var(--text); }
.g-bar.active { background: color-mix(in srgb, var(--party) 78%, transparent); }
.g-bar.done { background: color-mix(in srgb, var(--party) 30%, transparent); }
.g-bar.plan, .g-bar.planned { background: transparent; border-style: dashed; }
.g-bar.open-end { border-right-style: dotted; border-right-width: 3px; }
.g-bar.cancelled { opacity: .4; text-decoration: line-through; }
.g-nodate { position: absolute; left: 6px; top: 4px; line-height: 20px; }
/* strzałki WO na obszarze osi; w zwiniętym projekcie (admin) ich nie ma */
.g-deps { position: absolute; top: 0; bottom: 0; left: var(--label); width: calc(100% - var(--label)); height: 100%; pointer-events: none; overflow: visible; z-index: 2; }
.g-block:not(.open) > .g-deps { display: none; }
.g-deps path { fill: none; stroke: var(--muted); stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-dasharray: 3 2; }
.g-deps path.bad { stroke: var(--bad, #d1495b); stroke-dasharray: none; stroke-width: 2; }
.g-today { position: absolute; top: 0; bottom: 0; left: calc(var(--label) + (100% - var(--label)) * var(--today) / 100); width: 2px; background: var(--bad, #d1495b); opacity: .75; pointer-events: none; z-index: 2; }
.g-key-stageplan { background: transparent; border: 1.5px dashed hsl(138 55% 45%); }
.g-key-span { height: 2px; background: #0c66e4; border-radius: 0; }
.g-legend-actions { margin-left: auto; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .g-phase { background: hsl(var(--h, 220) 38% 30%); color: hsl(var(--h, 220) 70% 82%); }
  :root:not([data-theme="light"]) .g-phase.s-END { background: hsl(140 45% 32%); color: #fff; }
  :root:not([data-theme="light"]) .g-run, :root:not([data-theme="light"]) .gd-run { background: hsl(var(--h, 220) 40% 38%); }
  :root:not([data-theme="light"]) .g-plan, :root:not([data-theme="light"]) .gd-plan { border-color: hsl(var(--h, 220) 55% 62%); }
  :root:not([data-theme="light"]) .g-span, :root:not([data-theme="light"]) .gd-taskbar { background: #579dff; }
}
:root[data-theme="dark"] .g-phase { background: hsl(var(--h, 220) 38% 30%); color: hsl(var(--h, 220) 70% 82%); }
:root[data-theme="dark"] .g-phase.s-END { background: hsl(140 45% 32%); color: #fff; }
:root[data-theme="dark"] .g-run, :root[data-theme="dark"] .gd-run { background: hsl(var(--h, 220) 40% 38%); }
:root[data-theme="dark"] .g-plan, :root[data-theme="dark"] .gd-plan { border-color: hsl(var(--h, 220) 55% 62%); }
:root[data-theme="dark"] .g-span, :root[data-theme="dark"] .gd-taskbar { background: #579dff; }
.g-label .party { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }

/* Siatka szczegółowa projektu (Adam 19.11): 9 tygodni, dni i tygodnie, zamrożona kolumna, zadania w wierszach */
#g-detail { margin-top: 16px; scroll-margin-top: 70px; }
.gd-card { padding: 10px; }
.gd-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.gd-head h2 { margin: 0; font-size: 1.1rem; }
.gd-nav { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.gd-help { margin: 6px 0; }
.gd-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px 0 8px; align-items: center; }
.gd-key { display: inline-block; width: 22px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }
.gd-key-plan { border: 1.5px dashed hsl(138 55% 45%); background: hsl(138 60% 76% / .35); }
.gd-key-run { height: 6px; background: hsl(138 60% 70%); }
.gd-key-task { background: #0c66e4; }
.gd-key-card { background: #6cc3e0; }
.gd-key-ghost { border: 1px dashed var(--muted); }
.gd-key-late { background: var(--warn, #c77700); }
.gd-scroll { overflow-x: auto; overflow-y: hidden; }
.gd-inner { --label: 20rem; --day: 26px; --row: 28px; position: relative; width: calc(var(--label) + var(--day) * var(--days)); }
.gd-row { display: grid; grid-template-columns: var(--label) calc(var(--day) * var(--days)); grid-template-rows: var(--row); height: var(--row); }
.gd-label { position: sticky; left: 0; z-index: 4; background: var(--surface); box-shadow: 1px 0 0 var(--line); display: flex; align-items: center; gap: 5px; padding: 0 8px 0 4px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: .88rem; }
.gd-label .gd-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; padding: 0; color: var(--text); min-width: 0; }
.gd-area { position: relative; overflow: hidden; }
.gd-hrow { height: 22px; grid-template-rows: 22px; }
.gd-months .gd-area span, .gd-weeks .gd-area span { position: absolute; top: 0; bottom: 0; left: calc(var(--day) * var(--l)); width: calc(var(--day) * var(--s)); box-sizing: border-box; border-left: 1px solid var(--line); padding: 2px 5px; font-size: .75rem; color: var(--muted); overflow: hidden; white-space: nowrap; }
.gd-weeks .gd-area span { text-align: center; font-variant-numeric: tabular-nums; }
.gd-days { height: 30px; grid-template-rows: 30px; box-shadow: inset 0 -1px 0 var(--line); }
.gd-days .gd-area { display: grid; grid-template-columns: repeat(var(--days), var(--day)); }
.gd-days .gd-area span { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .72rem; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--muted); }
.gd-days .gd-area span small { font-size: .6rem; }
.gd-days .gd-area span.we, .gd-days .gd-area span.hol { color: color-mix(in srgb, var(--muted) 60%, transparent); }
.gd-days .gd-area span.hol { color: var(--bad, #d1495b); }
.gd-days .gd-area span.now { color: var(--bad, #d1495b); font-weight: 700; }
.gd-body { position: relative; }
.gd-cols { position: absolute; top: 0; bottom: 0; left: var(--label); display: grid; grid-template-columns: repeat(var(--days), var(--day)); pointer-events: none; }
.gd-cols i { border-left: 1px solid color-mix(in srgb, var(--line) 45%, transparent); }
.gd-cols i:nth-child(7n+1) { border-left-color: var(--line); }
.gd-cols i.we, .gd-cols i.hol { background: color-mix(in srgb, var(--line) 40%, transparent); }
.gd-body > .gd-row { background-image: linear-gradient(color-mix(in srgb, var(--line) 40%, transparent), color-mix(in srgb, var(--line) 40%, transparent)); background-size: 100% 1px; background-repeat: no-repeat; }
.gd-stage { background: color-mix(in srgb, var(--line) 18%, transparent); }
.gd-stage .gd-label { font-weight: 600; }
.gd-stage.gd-current .gd-label { box-shadow: inset 3px 0 0 var(--info), 1px 0 0 var(--line); }
.gd-group .gd-label { color: var(--muted); }
.gd-item .gd-label, .gd-wo .gd-label { padding-left: 1.4rem; }
.gd-done .gd-label { opacity: .6; }
.gd-area[data-empty] { cursor: cell; }
.gd-bar, .gd-run, .gd-ghost, .gd-wobar { position: absolute; left: calc(var(--day) * var(--l) + 1px); width: calc(var(--day) * var(--s) - 2px); box-sizing: border-box; border-radius: 4px; }
.gd-run { top: 9px; height: 9px; background: hsl(var(--h, 220) 60% 70%); border-radius: 3px; }
.gd-bar { top: 5px; bottom: 5px; z-index: 1; cursor: grab; touch-action: none; font-size: .7rem; line-height: 16px; text-align: center; color: #fff; overflow: hidden; white-space: nowrap; user-select: none; }
.gd-bar.dragging { cursor: grabbing; opacity: .8; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.gd-plan { top: 3px; bottom: 3px; background: hsl(var(--h, 220) 60% 76% / .3); border: 1.5px dashed hsl(var(--h, 220) 55% 45%); color: hsl(var(--h, 220) 60% 25%); font-weight: 700; }
.gd-taskbar { background: #0c66e4; }
.gd-cardbar { background: #6cc3e0; color: #10304a; }
.gd-bar.done { opacity: .45; }
.gd-bar.late { box-shadow: inset 0 -3px 0 var(--warn, #c77700); }
.gd-ghost { top: 4px; bottom: 4px; border: 1px dashed var(--muted); }
.gd-h { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.gd-h-l { left: 0; }
.gd-h-r { right: 0; }
.gd-wobar { --party: #8a8f98; top: 5px; bottom: 5px; border: 1px solid var(--party); background: color-mix(in srgb, var(--party) 55%, transparent); font-size: .7rem; line-height: 16px; padding: 0 4px; overflow: hidden; white-space: nowrap; }
.gd-wobar.plan, .gd-wobar.planned { background: transparent; border-style: dashed; }
.gd-wobar.done { background: color-mix(in srgb, var(--party) 30%, transparent); }
.gd-wobar.open-end { border-right-style: dotted; border-right-width: 3px; }
.gd-deps { position: absolute; top: 0; left: var(--label); pointer-events: none; overflow: visible; z-index: 2; }
.gd-deps path { fill: none; stroke: var(--text); stroke-opacity: .55; stroke-width: 1.3; marker-end: url(#gd-arrow); }
.gd-deps marker path { fill: var(--text); fill-opacity: .55; stroke: none; }
.gd-deps path.bad { stroke: var(--bad, #d1495b); stroke-opacity: 1; marker-end: url(#gd-arrow-bad); }
.gd-deps #gd-arrow-bad path { fill: var(--bad, #d1495b); fill-opacity: 1; }
.gd-today { position: absolute; top: 0; bottom: 0; left: calc(var(--label) + var(--day) * var(--today) + var(--day) / 2); width: 2px; background: var(--bad, #d1495b); opacity: .7; pointer-events: none; z-index: 2; }
.gd-dialog { max-width: 30rem; width: calc(100% - 32px); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.gd-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.gd-dialog h3 { margin: 0; }
/* Okienko zadania jako ruchomy panel (Adam 20.11): nie blokuje siatki, przeciąga się za nagłówek; telefon: zwykłe okno. */
.gd-dialog.gd-float { position: fixed; margin: 0; right: auto; bottom: auto; width: 26rem; max-width: calc(100vw - 8px); max-height: calc(100vh - 8px); overflow-y: auto; z-index: 50; box-shadow: 0 8px 28px rgba(0, 0, 0, .3); }
.gd-d-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gd-dialog.gd-float .gd-d-head { cursor: move; touch-action: none; user-select: none; margin: -4px -4px 0; padding: 4px; }
.gd-d-head h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
.gd-d-x { font-size: 1.4rem; line-height: 1; padding: 0 6px; color: var(--muted); }
.gd-d-more { display: block; margin: 4px 0; padding: 0; text-align: left; }
li.gd-self label { opacity: .5; cursor: default; font-style: italic; }
.gd-grip { position: absolute; left: 3px; top: 50%; transform: translateY(-50%); color: var(--text); opacity: .55; font-size: 1rem; cursor: grab; line-height: 1; letter-spacing: -.2em; user-select: none; }
.gd-grip:hover, .gd-drag:hover .gd-grip { opacity: 1; }
.gd-drag { cursor: grab; }
.gd-drag .gd-name { cursor: pointer; }
.gd-row { position: relative; }
.gd-row.gd-dragging { opacity: .4; }
.gd-row.gd-drop-before::after, .gd-row.gd-drop-after::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); z-index: 6; pointer-events: none; }
.gd-row.gd-drop-before::after { top: 0; }
.gd-row.gd-drop-after::after { bottom: 0; }
.gd-row.gd-drop-stage { outline: 2px solid var(--accent); outline-offset: -2px; }
.gd-d-dates { display: flex; gap: 12px; flex-wrap: wrap; }
.gd-d-buttons { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.deps-pick { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.deps-pick legend { font-size: .9rem; font-weight: 600; padding: 0 4px; }
ul.deps-list { list-style: none; margin: 4px 0 0; padding: 0; max-height: 16rem; overflow-y: auto; }
ul.deps-list li { padding: 2px 0; }
ul.deps-list label { display: flex; gap: 6px; align-items: center; font-size: .9rem; }
.task-edit { max-width: 40rem; }
.task-edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0 14px; }
.plan-fill select { width: auto; }
/* telefon: węższa zamrożona kolumna, żeby oś była widać obok niej */
@media (max-width: 700px) {
  .g-inner { --label: 12rem; }
  .g-label { grid-template-columns: 3.4rem minmax(0, 1fr); column-gap: .3rem; }
  .g-label > .g-c2 { display: none; }
  .g-stage-row .g-label { padding-left: .3rem; }
  .gd-inner { --label: 10rem; }
}
.plan-fill { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 6px 0 10px; }
table.plan-table td { vertical-align: middle; }
table.plan-table tr.plan-current td { background: var(--info-bg); }
table.plan-table input[type=date] { max-width: 11rem; }
/* Harmonogram pierwotny (Adam 19.11): pytanie na bramce przy zmianie etapu, sekcja na stronie projektu */
.baseline-gate { border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px 10px; margin: 6px 0 12px; }
.baseline-gate legend { font-weight: 600; padding: 0 4px; }
.baseline-gate .baseline-choice { display: block; margin: 4px 0; }
.baseline-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin: 8px 0; }
.baseline-form label { display: flex; flex-direction: column; gap: 2px; }
.baseline-form label { flex: 0 1 24rem; }
.baseline-form input[type=text] { width: 100%; box-sizing: border-box; }
.baseline-history ul { margin: 4px 0 0; padding-left: 1.2rem; }
.gd-baseline { margin: 2px 0 6px; }
.gd-d-note[hidden] { display: none; }

/* Zadania na stronie Start (pod kafelkami) */
.tasks { margin-top: 18px; }
.tasks h2 { margin-top: 0; }
ul.task-list { list-style: none; margin: 0; padding: 0; }
li.task { display: grid; grid-template-columns: 1.8rem minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
li.task:first-child { border-top: 0; }
li.task.overdue .task-due { color: var(--bad, #d1495b); font-weight: 700; }
li.task.today .task-due { font-weight: 700; }
li.task.done { opacity: .6; }
li.task.sortable { grid-template-columns: 1rem 1.8rem minmax(0, 1fr) auto; }
li.task.tl-filtered, li.task.tl-folded { display: none; }
li.task.dragging { opacity: .4; }
li.task.drop-before { box-shadow: 0 -2px 0 var(--accent); }
li.task.drop-after { box-shadow: 0 2px 0 var(--accent); }
.task-grip { color: var(--muted); cursor: grab; user-select: none; line-height: 1.5; letter-spacing: -.15em; text-align: center; }
.task-grip:hover { color: var(--text); }
.tasks-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; }
/* Przycisk „Dodaj zadanie” (Adam 20.11): owal na górze sekcji */
.pill-button { display: inline-flex; align-items: center; gap: 4px; padding: 7px 18px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.pill-button:hover { filter: brightness(1.1); }
.pill-button[aria-expanded="true"] { filter: brightness(.9); }
.task-add-form { margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-alt); }
.task-add-form[hidden] { display: none; }
.task-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 0 6px; }
.task-filter input[type=search] { flex: 1 1 14rem; max-width: 22rem; width: auto; padding: 4px 8px; }
.task-filter select { width: auto; max-width: 14rem; padding: 3px 6px; }
.task-fold { margin: 4px 0 0; }
.task-check { background: none; border: 0; color: var(--accent); font-size: 1.15rem; line-height: 1; padding: 0 2px; cursor: pointer; }
.task-meta { white-space: nowrap; text-align: right; }
form.inline-form { display: inline; margin-left: 6px; }
.task-add { margin-top: 10px; }
.task-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 8px 14px; margin-top: 8px; }
.task-form-grid .task-f label { display: block; font-size: .85rem; color: var(--muted); }
.task-form-grid .task-f input, .task-form-grid .task-f select, .task-form-grid .task-f textarea { width: 100%; box-sizing: border-box; }
.task-form-grid .task-f-title, .task-form-grid .task-f-notes { grid-column: 1 / -1; }
@media (max-width: 640px) {
  li.task { grid-template-columns: 1.8rem minmax(0, 1fr); } .task-meta { grid-column: 2; text-align: left; white-space: normal; }
  li.task.sortable { grid-template-columns: 1rem 1.8rem minmax(0, 1fr); } li.task.sortable .task-meta { grid-column: 3; }
}

/* Etapy równoległe na stronie projektu (sekcja Zmiana). */
.parallel-stages { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.parallel-stages h3 { font-size: 1rem; margin: 0 0 4px; }
.parallel-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0; }
.parallel-form input[type=text] { flex: 1 1 12rem; min-width: 0; }
.parallel-form select { width: auto; flex: 0 0 auto; }
.parallel-name { display: inline-flex; align-items: center; gap: 6px; }

/* Tablica zadań projektu wg etapów (strona „Etap i WO”, Adam 19.11): wiersz = etap w kolejności procesu, zadania jako karty. */
.tb-help { margin: 0 0 8px; }
.tb-top { align-items: flex-start; flex-wrap: nowrap; }
.tb-top-help { flex: 1 1 auto; min-width: 0; }
.tb-top .pill-button { flex: none; }
@media (max-width: 640px) { .tb-top { flex-wrap: wrap; } .tb-top .pill-button { order: -1; } }
.task-board { display: grid; gap: 4px; }
.tb-lane { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 4px 10px; align-items: start; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); transition: background .1s, border-color .1s; }
.tb-lane.tb-none { background: var(--surface-alt); }
.tb-lane.tb-current { border-color: var(--info); box-shadow: inset 3px 0 0 var(--info); }
.tb-lane.tb-done .tb-head, .tb-lane.tb-archived .tb-head { opacity: .6; }
.tb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-height: 1.9rem; font-size: .88rem; line-height: 1.25; }
.tb-name { flex: 1 1 6rem; min-width: 0; }
.tb-head .badge.info { order: 9; font-size: .72rem; }
.tb-lane.tb-future .tb-name { color: var(--muted); }
.tb-count { flex: none; min-width: 1.4em; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
ul.tb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; min-height: 1.9rem; border-radius: 6px; }
.task-board.is-dragging ul.tb-list { outline: 1px dashed var(--line); outline-offset: 1px; }
.tb-lane.drop { background: var(--info-bg); border-color: var(--info); }
.tb-lane.drop ul.tb-list { outline: 2px dashed var(--info); }
li.tb-task { flex: 0 1 16rem; min-width: 0; display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: 4px; align-items: start; padding: 5px 8px 5px 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; }
li.tb-task:hover { border-color: var(--accent); }
li.tb-task.dragging { opacity: .4; }
li.tb-task.saving { opacity: .7; }
li.tb-task.done { display: none; opacity: .6; }
.task-board.show-done li.tb-task.done { display: grid; }
li.tb-task.overdue .task-due { color: var(--bad); font-weight: 700; }
li.tb-task.today .task-due { font-weight: 700; }
.tb-title { display: block; font-size: .9rem; line-height: 1.3; overflow-wrap: anywhere; }
/* Nazwa zadania otwiera edycję, ale nie wygląda jak odsyłacz (Adam 20.11). */
a.tb-open, a.tb-open:hover { color: inherit; text-decoration: none; }
.tb-meta { display: flex; flex-wrap: wrap; gap: 0 8px; }
.tb-meta:empty { display: none; }
/* Start → termin: tekst w formacie portalu, a na nim przezroczyste pole daty (klik otwiera kalendarz). */
.tb-dates { display: inline-flex; flex-wrap: wrap; align-items: center; }
.tb-dates.saving { opacity: .6; }
.tb-date { position: relative; display: inline-block; padding: 0 3px; border-radius: 4px; cursor: pointer; }
.tb-date:hover { background: var(--info-bg); }
.tb-date:focus-within { outline: 2px solid var(--accent); }
.tb-date.empty { color: var(--muted); font-style: italic; }
.tb-date input[type=date] { position: absolute; inset: 0; width: 100%; max-width: none; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.tb-arrow { margin: 0 1px; color: var(--muted); }
.tb-flag:not(:empty) { margin-left: 5px; }
/* Karty Trello (lustro): bez przeciągania, nazwa prowadzi do karty, lista i etykiety jak w Trello. */
li.tb-task.tb-trello { cursor: default; border-style: dashed; }
li.tb-task.tb-trello:hover { border-color: var(--line); }
.tb-trello-mark { color: #0c66e4; font-size: .95rem; line-height: 1.3; text-align: center; }
.tb-trello .tb-title { text-decoration: none; color: var(--text); }
.tb-trello .tb-title:hover { text-decoration: underline; }
/* Ikona „3D” na karcie z modelem Fusion: przełącza okienko 3D na ten mebel (portal/admin/_fusion_dock.html) */
.tb-3d { padding: 0 6px; margin-right: 4px; border-radius: 4px; font-size: .72rem; font-weight: 700; line-height: 1.5; background: var(--info-bg); color: var(--info); border: 1px solid transparent; cursor: pointer; }
.tb-3d:hover, .tb-3d:focus-visible { border-color: var(--info); }
.tb-tlist { color: var(--muted); font-style: italic; }
.tl { display: inline-block; min-width: 1.6rem; padding: 0 5px; border-radius: 3px; background: var(--tl); color: #172b4d; font-size: .72rem; line-height: 1.35; font-weight: 600; }
.tb-move { margin: 3px 0 0; }
.tb-move select { max-width: 100%; font-size: .8rem; padding: 1px 2px; }
/* Myszka: lista etapów pod zadaniem dopiero po najechaniu (przeciąganie wystarcza); telefon: zawsze widoczna. */
@media (hover: hover) and (pointer: fine) {
  .tb-move { display: none; }
  li.tb-task:hover .tb-move, li.tb-task:focus-within .tb-move { display: block; }
}
@media (max-width: 640px) {
  .tb-lane { grid-template-columns: minmax(0, 1fr); }
  /* Telefon: bez przeciągania puste miejsce na zadania jest niepotrzebne (zrobione liczą się tylko, gdy są pokazane). */
  .tb-lane.tb-empty ul.tb-list { display: none; }
  .task-board.show-done .tb-lane.tb-empty.tb-has-done ul.tb-list { display: flex; }
  li.tb-task { flex-basis: 100%; }
}

/* Import z WhatsAppa i zapisane rozmowy */
.cmd-table { border-collapse: collapse; margin: 6px 0 10px; }
.cmd-table td { padding: 3px 14px 3px 0; vertical-align: top; }
.cmd-table code { white-space: nowrap; }
.chat-import-form { margin-top: 8px; }
.chat-rec { margin: 6px 0; }
ol.chat-log { margin: 8px 0; padding-left: 1.2rem; }
ol.chat-log li { margin: 2px 0; }

/* Strona „Nowe zadanie” pod telefon */
.quick-task { max-width: 34rem; margin: 0 auto; }
.quick-task textarea, .quick-task select, .quick-task input[type=date] { width: 100%; box-sizing: border-box; font-size: 1rem; }
.quick-task .paste-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 12px; }
.quick-task button.big { font-size: 1.05rem; padding: 12px 18px; width: 100%; }
.quick-task .paste-msg { min-height: 1.2em; }

/* Checklisty zadania (Adam 20.11), jak w Trello: nazwa, pasek postępu, elementy, „ukryj zaznaczone”. */
.cl-badge { display: inline-block; padding: 0 6px; border: 1px solid var(--line); border-radius: 999px; font-size: .75rem; line-height: 1.5; color: var(--muted); text-decoration: none; white-space: nowrap; }
.cl-badge.full { border-color: var(--ok, #3a8f5c); color: var(--ok, #3a8f5c); }
a.cl-badge:hover { border-color: var(--accent); color: var(--text); }
.checklists { margin-top: 14px; }
.cl-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; }
.cl-head h2 { margin: 0; }
.cl-add { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-alt); }
.cl-add[hidden] { display: none; }
.cl-add label { display: flex; flex-direction: column; gap: 2px; font-size: .85rem; color: var(--muted); flex: 1 1 14rem; }
.cl-add input, .cl-add select { width: 100%; box-sizing: border-box; }
.cl-links { margin: 8px 0 0; }
.cl-msg { color: var(--ok, #3a8f5c); }
.checklist { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.cl-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.cl-icon { color: var(--muted); }
.cl-name { margin: 0; font-size: 1.02rem; flex: 1 1 8rem; min-width: 0; cursor: text; overflow-wrap: anywhere; }
.cl-name:hover { background: var(--info-bg); border-radius: 4px; }
.cl-actions { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.cl-progress { display: flex; align-items: center; gap: 10px; margin: 8px 0 6px; }
.cl-pct { min-width: 2.6rem; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.cl-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.cl-bar i { display: block; height: 100%; background: var(--accent); transition: width .15s; }
.cl-bar.full i { background: var(--ok, #3a8f5c); }
ul.cl-items { list-style: none; margin: 0; padding: 0; }
li.cl-item { position: relative; display: grid; grid-template-columns: 1rem 1.6rem minmax(0, 1fr) auto; gap: 4px; align-items: start; padding: 4px 4px 4px 0; border-radius: 6px; }
li.cl-item:hover { background: var(--surface-alt); }
li.cl-item.dragging { opacity: .4; }
li.cl-item.drop-before { box-shadow: 0 -2px 0 var(--accent); }
li.cl-item.drop-after { box-shadow: 0 2px 0 var(--accent); }
.cl-grip { color: var(--muted); cursor: grab; user-select: none; line-height: 1.5; letter-spacing: -.2em; text-align: center; opacity: 0; }
li.cl-item:hover .cl-grip, li.cl-item:focus-within .cl-grip { opacity: 1; }
.cl-check { margin: .35rem 0 0; width: 1rem; height: 1rem; cursor: pointer; }
.cl-text { cursor: text; overflow-wrap: anywhere; line-height: 1.5; border-radius: 4px; }
li.cl-item.checked .cl-text { text-decoration: line-through; color: var(--muted); }
.cl-del { background: none; border: 0; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: 0 6px; cursor: pointer; opacity: 0; }
li.cl-item:hover .cl-del, li.cl-item:focus-within .cl-del { opacity: 1; }
.cl-del:hover { color: var(--bad, #d1495b); }
.cl-edit { width: 100%; box-sizing: border-box; font: inherit; }
.checklist.hide-checked li.cl-item.checked { display: none; }
.cl-done-msg { display: none; margin: 6px 0; }
.checklist.hide-checked.all-done .cl-done-msg { display: block; }
.cl-new { margin-top: 6px; }
.cl-new-box textarea { width: 100%; box-sizing: border-box; margin-bottom: 6px; }
@media (hover: none) { .cl-grip, .cl-del { opacity: 1; } }

/* Godziny z Clockify na stronie projektu (sekcja „Godziny”) */
.hours-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 8px 0; align-items: start; }
.hours-grid caption { text-align: left; font-weight: 600; padding-bottom: 4px; }
.hours-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 10px; }

/* Rozliczenia godzin (Sprzedaż → Rozliczenia) */
.settle-lines select { min-width: 13.5em; }

/* Formularz zamówienia (etap FZ) na stronie etapu projektu */
.order-form .of-new { background: var(--warn-bg, #fff4d6); border-radius: 6px; padding: 8px 12px; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.order-form .of-new p { margin: 0; }
.order-form .of-content { margin: 10px 0 14px; }
.order-form .of-content > summary { cursor: pointer; }
.order-form h3.of-block { font-size: 14px; margin: 14px 0 4px; }
.order-form .of-table, .order-form .of-versions { width: 100%; border-collapse: collapse; font-size: 13px; }
.order-form .of-table th, .order-form .of-table td, .order-form .of-versions th, .order-form .of-versions td { text-align: left; vertical-align: top; padding: 4px 8px; border-bottom: 1px solid var(--line, #e3e5e8); }
.order-form .of-table thead th { font-weight: 600; color: var(--muted); font-size: 12px; }
.order-form .of-table tbody th { font-weight: 600; white-space: nowrap; }
.order-form .of-send fieldset { border: 1px solid var(--line, #e3e5e8); border-radius: 6px; padding: 8px 12px; }
.order-form .of-send label.check { display: block; margin: 2px 0; }
.order-form .of-send input[type=text], .order-form .of-send select { width: auto; display: inline-block; vertical-align: middle; }
.order-form .of-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.order-form .of-admin { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.order-form .of-admin form { margin: 0; }
.order-form .of-imports { background: var(--bad-bg); border-radius: 6px; padding: 8px 12px; margin: 8px 0; }
.order-form .of-imports p { margin: 4px 0; }
.order-form .of-drawings { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0; }
.order-form .of-drawings img { display: block; width: auto; height: auto; max-width: 100%; max-height: 280px; border: 1px solid var(--line, #e3e5e8); border-radius: 6px; background: #fff; }
.order-form .of-files { margin: 10px 0 14px; }
.order-form .of-file-list { margin: 4px 0 8px; padding-left: 18px; }
.order-form .of-file-list li { margin: 2px 0; }
.order-form .of-file-list form { display: inline; margin: 0 0 0 6px; }
.order-form .of-files input[type=file] { width: auto; display: inline-block; vertical-align: middle; }
.order-form .of-lead-files label.check { display: block; margin: 2px 0; }
.dashboard-forms ul { margin: 6px 0 0; padding-left: 18px; }

/* Zapytania (Sprzedaż → Zapytania): oś korespondencji z info@ i odpowiedź z karty */
.lead-due-late { color: var(--bad); font-weight: 600; }
/* Lejek sprzedaży E1: status i historia zapytania, wyceny z wersjami */
.lead-pipeline > p { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.lead-status-change { margin: 8px 0 12px; }
.lead-status-change > summary { cursor: pointer; font-weight: 600; }
.lead-status-change [data-when][hidden] { display: none; }
.lead-history { margin: 8px 0 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 4px; }
.badge.est-closed { opacity: .7; }
.lead-ext-form .data-grid { margin-bottom: 8px; }
.lead-mailbox { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 0 0 12px; }
.lead-mailbox form { margin: 0; }
/* Maile jak w Gmailu (portal/mailview.py, leads/_message.html): zwinięty = nadawca i początek treści. */
.lead-thread { border-top: 1px solid var(--line); }
.lead-mail { border-bottom: 1px solid var(--line); }
.lead-mail > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 2px 12px; align-items: start; padding: 10px 4px; }
.lead-mail > summary::-webkit-details-marker { display: none; }
.lead-mail > summary:hover { background: var(--surface-alt); }
.lead-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 600;
  color: #fff; background: hsl(var(--h, 210) 45% 45%); font-size: 1rem; user-select: none; }
.lead-mail-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lead-mail-line { display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
.lead-mail-name { font-weight: 600; }
.lead-mail-addr, .lead-mail-to, .lead-mail-date { font-size: .85rem; }
.lead-mail-subject { font-size: .9rem; font-weight: 600; }
.lead-mail-snippet { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-mail-date { white-space: nowrap; padding-top: 2px; }
.lead-mail:not([open]) .lead-mail-addr, .lead-mail:not([open]) .lead-mail-to { display: none; }
.lead-mail[open] .lead-mail-snippet { display: none; }
.lead-mail-body { padding: 0 4px 14px 56px; }
.lead-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.lead-quote { margin-top: 8px; }
.lead-quote > summary, .lead-quote-toggle { list-style: none; display: inline-block; cursor: pointer; padding: 0 8px;
  border-radius: 6px; background: var(--surface-alt); border: 1px solid var(--line); color: var(--muted);
  font: inherit; font-size: .8rem; line-height: 1.4; letter-spacing: 1px; }
.lead-quote > summary::-webkit-details-marker { display: none; }
.lead-quote > .lead-text { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--line); color: var(--muted); }
.lead-quote-toggle { margin-top: 4px; }
.lead-quote-toggle:hover, .lead-quote > summary:hover { color: var(--text); }
iframe.lead-html { display: block; width: 100%; height: 120px; border: 0; border-radius: 6px; background: #fff;
  color-scheme: light; }
.lead-images { margin: 0 0 8px; padding: 6px 10px; border-radius: 6px; background: var(--surface-alt); }
.lead-images a { margin-left: 6px; font-weight: 600; }
.lead-atts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.lead-att { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px;
  align-items: center; width: 220px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px;
  text-decoration: none; color: inherit; background: var(--surface); }
.lead-att:hover { border-color: var(--accent); }
.lead-att img, .lead-att-ext { grid-row: 1 / span 2; width: 40px; height: 40px; border-radius: 4px; }
.lead-att img { object-fit: cover; background: var(--surface-alt); }
.lead-att-ext { display: grid; place-items: center; background: #c5221f; color: #fff; font-size: .7rem; font-weight: 700; }
.lead-att-name { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-att-size { font-size: .75rem; }
.lead-mail-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; margin-top: 10px; }
.lead-mail-foot form { margin: 0; }
.lead-mail-foot .lead-delete { margin-left: auto; }
.lead-mail-foot .lead-delete button { color: var(--bad); }
.lead-inbox-item { padding-top: 4px; }
.lead-inbox-item .lead-mail { border-bottom: 0; }
.lead-inbox-item .lead-assign { padding-left: 60px; }
@media (max-width: 640px) {
  .lead-mail > summary { grid-template-columns: 32px minmax(0, 1fr); }
  .lead-avatar { width: 32px; height: 32px; }
  .lead-mail-date { grid-column: 2; padding-top: 0; }
  .lead-mail-body { padding-left: 4px; }
  .lead-inbox-item .lead-assign { padding-left: 0; }
}
.lead-reply .data-field textarea.lead-body { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9rem; }
.lead-reply .data-grid { grid-template-columns: minmax(0, 1fr); }
.lead-inbox .lead-assign { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.lead-inbox .lead-assign form { margin: 0; display: inline-flex; gap: 6px; align-items: center; }
.lead-inbox .lead-assign select { width: auto; max-width: 22rem; }
.token-new { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 12px; }
.token-new code { display: block; margin: 6px 0; padding: 6px 8px; background: var(--bg, #fff); color: var(--text, #111); border-radius: 6px; word-break: break-all; user-select: all; }

/* Zapytania: licznik nieprzypisanych maili w menu i blok na Pulpicie */
.nav-badge { display: inline-block; min-width: 1.4em; padding: 0 .35em; margin-left: .25em; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-size: .75em; font-weight: 600; line-height: 1.55; text-align: center; vertical-align: .1em; }
.dashboard-leads h2 a { color: inherit; text-decoration: none; }
.dashboard-leads h3 { font-size: 14px; margin: 12px 0 2px; }
.dashboard-leads ul { margin: 4px 0 0; padding-left: 18px; }

/* Zapytania: notatka wewnętrzna (mail od nas samych) i załączniki odpowiedzi */
.lead-mail.internal > summary { background: color-mix(in srgb, var(--warn-bg) 45%, transparent); }
.lead-mail .lead-internal { margin-left: 6px; font-size: .72rem; vertical-align: .1em; }
.lead-reply-files { margin: 4px 0 12px; }
.lead-reply-files h3 { font-size: .95rem; margin: 0 0 6px; }
.lead-reply-files ul { list-style: none; padding: 0; margin: 4px 0 8px; }
.lead-reply-files li { margin: 2px 0; }
.lead-reply-files details > summary { cursor: pointer; margin: 6px 0; }
.lead-reply-files input[type=file] { margin: 4px 0; }
/* Strona elementu (portal/element.html, Adam 2026-11-24): dane z listy części, wydania z przyjęciami */
.el-title { overflow-wrap: anywhere; }
.el-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0; }
.el-facts dt { color: var(--muted); }
.el-facts dd { margin: 0; overflow-wrap: anywhere; }
.el-releases { list-style: none; padding: 0; margin: 0; }
.el-releases li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.el-releases li:last-child { border-bottom: 0; }
.el-releases .small { margin-top: 2px; }
a.el-link { color: inherit; text-decoration: underline dotted; text-underline-offset: 2px; }
a.el-link:hover, a.el-link:focus-visible { color: var(--accent); }
/* Próba Viewera APS (portal/admin/aps_view.html, Adam 2026-11-24): model po lewej, karta klikniętej części po prawej */
.aps-layout { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 16px; align-items: start; }
.aps-viewer { position: relative; height: 72vh; min-height: 420px; border-radius: var(--radius); overflow: hidden; background: var(--surface-alt); }
.aps-panel { position: sticky; top: 12px; max-height: 72vh; overflow: auto; }
.aps-element + .aps-element { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.aps-element h3 { margin: 0 0 2px; overflow-wrap: anywhere; }
.aps-element .el-facts { margin: 8px 0 10px; }
.aps-actions button[disabled] { opacity: .45; cursor: not-allowed; }
.aps-path { margin-top: 12px; overflow-wrap: anywhere; }
@media (max-width: 900px) { .aps-layout { grid-template-columns: minmax(0, 1fr); } .aps-panel { position: static; max-height: none; } }

/* Lejek sprzedaży E3: łańcuch numerów i oś sprawy (portal/casefile.py, _case_chain.html, _casefile.html) */
.case-chain { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin: 4px 0 10px; font-size: 13px; }
.case-item { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.case-item a { font-weight: 600; }
.case-ok { border-color: var(--ok); }
.case-ok .case-text { color: var(--ok); }
.case-bad .case-text { color: var(--bad); }
.case-missing { border-style: dashed; color: var(--muted); }
.case-hint { color: var(--muted); font-size: 12px; }
.case-arrow { color: var(--muted); }
.case-axis-wrap { overflow-x: auto; margin: 4px 0 8px; }
.case-axis { display: block; width: 100%; min-width: 720px; height: auto; font-size: 11px; }
.case-axis .cf-grid { stroke: var(--line); stroke-width: 1; }
.case-axis .cf-tick, .case-axis .cf-sub { fill: var(--muted); font-size: 10.5px; }
.case-axis .cf-lane { fill: var(--text); font-weight: 600; font-size: 12px; }
.case-axis .cf-in { fill: var(--text); font-size: 10.5px; font-weight: 600; pointer-events: none; }
.case-axis .cf-label { fill: var(--text); font-size: 11px; }
.case-axis .cf-seg { fill: var(--info-bg); stroke: var(--info); stroke-width: 1; }
.case-axis .cf-new { fill: var(--warn-bg); stroke: var(--warn); }
.case-axis .cf-on_hold { fill: var(--surface); stroke: var(--muted); stroke-dasharray: 3 3; }
.case-axis .cf-draft { fill: var(--surface); stroke: var(--muted); stroke-dasharray: 4 3; }
.case-axis .cf-sent { fill: var(--info-bg); stroke: var(--info); }
.case-axis .cf-ext { stroke-dasharray: 2 2; }
.case-axis .cf-stage { fill: var(--ok-bg); stroke: var(--ok); }
.case-axis .cf-wait { fill: var(--muted); stroke: none; }
.case-axis .cf-today { stroke: var(--bad); stroke-width: 1.5; }
.case-axis .cf-today-t { fill: var(--bad); font-size: 10.5px; }
.case-axis .cf-ok .cf-mark { fill: var(--ok); }
.case-axis .cf-bad .cf-mark { fill: var(--bad); }
.case-axis .cf-warn .cf-mark { fill: var(--warn); }
.case-axis .cf-end .cf-mark { fill: var(--muted); }
.case-axis .cf-deal .cf-mark { fill: var(--warn); }
.case-axis .cf-deposit .cf-mark { fill: var(--accent); }
.case-axis .cf-deposit .cf-ring { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.case-events summary { cursor: pointer; font-weight: 600; }
.case-card > summary { cursor: pointer; }
.case-card > summary h2 { display: inline; }
.case-deposit { margin-top: 8px; flex-wrap: wrap; }
.case-events ol { margin: 6px 0 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
/* Lejek sprzedaży E4: tablica (portal/board.py, pipeline/board.html) */
.funnel-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 14px; }
.funnel-metrics > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.funnel-metrics span { font-size: 12px; color: var(--muted); }
.funnel-metrics strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.funnel-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.funnel-filters select { width: auto; }
.funnel-wrap { overflow-x: auto; }
.funnel-board { display: grid; grid-template-columns: repeat(7, minmax(165px, 1fr)); gap: 8px; min-width: 1150px; align-items: start; }
.funnel-col { background: var(--surface-alt); border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.funnel-col.later { opacity: .6; }
.funnel-col header { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.funnel-col header span { color: var(--muted); font-variant-numeric: tabular-nums; }
.funnel-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.funnel-card.has-issues { border-color: var(--warn); }
.funnel-title { font-weight: 600; }
.funnel-chain { display: flex; flex-wrap: wrap; gap: 3px; }
.funnel-chain .case-item { font-size: 11px; padding: 1px 6px; }
.funnel-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.funnel-issue { color: var(--warn); border-top: 1px dashed var(--line); padding-top: 4px; }
.funnel-issue a { color: var(--warn); }
.funnel-foot { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.funnel-foot summary { cursor: pointer; font-weight: 600; }
.funnel-foot details > .funnel-card { margin-top: 6px; max-width: 420px; }

/* Rozliczenie projektu (lejek E5): pasek zadatek → do rozliczenia → faktura → opłacone. */
.settle-steps { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 12px 0 6px; counter-reset: settle; }
.settle-step { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.settle-step.done { border-color: var(--ok, #2f7d4f); color: var(--ok, #2f7d4f); }
.settle-step.done::before { content: "✓ "; }
.settle-step.current { border-color: var(--accent); color: var(--text); font-weight: 600; }
#amount td.num, #amount th.num { text-align: right; white-space: nowrap; }
.settle-form { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 6px 0; }

/* Kolor czcionki z arkusza formularza zamówienia (sekcja FZ, strona Klienta); w ciemnym motywie rozjaśniony. */
.fc { color: var(--fc); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fc { color: color-mix(in srgb, var(--fc) 55%, #fff); }
}
:root[data-theme="dark"] .fc { color: color-mix(in srgb, var(--fc) 55%, #fff); }
/* Kalendarz Google (portal/gcal.py, calendar.js, calendar/_panel.html): tydzień, wybór terminu, spotkania zapytania */
.cal { --cal-hour: 40px; margin-top: 10px; }
.cal-bar { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 6px; }
.cal-nav { display: flex; gap: 6px; align-items: center; }
.cal-nav strong { margin-left: 6px; white-space: nowrap; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .85rem; }
.cal-chip { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.cal-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.cal-tools { margin-left: auto; white-space: nowrap; }
.cal-status { margin: 0 0 6px; }
.cal-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem); gap: 16px; align-items: start; }
.cal-main.no-side { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1050px) { .cal-main { grid-template-columns: minmax(0, 1fr); } }
.cal-grid { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); min-height: 12rem; }
.cal.is-loading .cal-grid { opacity: .55; }
.cal-row { display: grid; grid-template-columns: 2.6rem repeat(7, minmax(0, 1fr)); }
.cal-head { border-bottom: 1px solid var(--line); }
.cal-dayhead { padding: 4px 4px; font-size: .82rem; font-weight: 600; text-align: center; border-left: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-dayhead.is-today { color: var(--accent); }
.cal-dayhead.is-weekend { color: var(--muted); }
.cal-allday { border-bottom: 1px solid var(--line); min-height: 22px; }
.cal-allday > .cal-gutter { font-size: .66rem; color: var(--muted); padding: 4px 3px 0 0; text-align: right; line-height: 1.1; }
.cal-allday-lane { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-flow: row dense;
  gap: 2px; padding: 2px; align-content: start; }
.cal-scroll { max-height: 27rem; overflow-y: auto; position: relative; }
.cal-body { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.cal-times { position: relative; }
.cal-time { position: absolute; right: 4px; transform: translateY(-50%); font-size: .68rem; color: var(--muted); }
.cal-day { position: relative; border-left: 1px solid var(--line); cursor: crosshair;
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--cal-hour)); }
.cal-day.is-weekend { background-color: var(--surface-alt); }
.cal-day.is-today { background-color: color-mix(in srgb, var(--accent) 6%, transparent); }
.cal-ev { position: absolute; display: flex; flex-direction: column; overflow: hidden; padding: 1px 4px; border-radius: 4px;
  font-size: .74rem; line-height: 1.2; color: var(--text); text-decoration: none; cursor: pointer; z-index: 1;
  background: color-mix(in srgb, var(--c) 24%, var(--surface)); border-left: 3px solid var(--c); }
.cal-ev:hover { background: color-mix(in srgb, var(--c) 38%, var(--surface)); z-index: 2; }
.cal-ev.is-free { background: var(--surface); border: 1px dashed var(--c); border-left: 3px solid var(--c); opacity: .8; }
.cal-ev.is-allday { position: static; flex-direction: row; gap: 4px; white-space: nowrap; }
.cal-ev.is-short { flex-direction: row; gap: 4px; white-space: nowrap; align-items: baseline; }
.cal-ev.is-lead { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-ev-time { font-size: .68rem; color: var(--muted); white-space: nowrap; }
.cal-ev-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.cal-now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--bad); z-index: 3; pointer-events: none; }
.cal-new { position: absolute; left: 2px; right: 2px; z-index: 4; padding: 1px 4px; border-radius: 4px; font-size: .74rem; line-height: 1.2;
  border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 20%, var(--surface)); pointer-events: none;
  display: flex; flex-direction: column; overflow: hidden; }
.cal-form .data-field { margin-bottom: 8px; }
.cal-form input[type=text], .cal-form textarea { max-width: 100%; box-sizing: border-box; }
.cal-form input[type=date], .cal-form input[type=time] { width: 100%; box-sizing: border-box; padding: 7px 6px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.cal-form-times { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 8px; }
.cal-form [data-cal-conflicts] { margin: -2px 0 10px; }
.cal-form .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-conflict { color: var(--warn); font-weight: 600; }
.cal-ok { color: var(--ok); }
.lead-meeting-plan > summary { cursor: pointer; font-weight: 600; }
.meeting-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.meeting-list li { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.meeting-list .m-when { font-weight: 600; }
.meeting-list [hidden] { display: none !important; }
.meeting-list li.is-cancelled .m-when, .meeting-list li.is-cancelled .m-title { text-decoration: line-through; color: var(--muted); }
.meeting-list li.is-past { color: var(--muted); }
.meeting-list .m-cancel > summary { cursor: pointer; color: var(--accent); }
.meeting-list .m-cancel form { margin-top: 4px; }
