/*
  Wygląd Q-bajt: tablica dyżurna. Czarna rama trzyma stan firmy: menu z lewej, listwa nad treścią, pasek na dole telefonu.
  Treść leży na jasnym tle. Kolor oznacza tu tylko jedno: pilność albo stan.
*/

@font-face { font-family: "Outfit"; font-weight: 700; font-display: swap; src: url("fonts/outfit-700.woff") format("woff"); }
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-display: swap; src: url("fonts/instrument-400.woff") format("woff"); }
@font-face { font-family: "Instrument Sans"; font-weight: 700; font-display: swap; src: url("fonts/instrument-700.woff") format("woff"); }

:root {
  color-scheme: light dark;
  --frame: #0b0d10;
  --sheet: #e8ebef;
  --surface: #fff;
  --ink: #0b0d10;
  --muted: #535b66;
  --line: #d3d8df;
  --edge: #868c96;
  --chip: #eceef1;
  --solid: #0b0d10;
  --solid-ink: #fff;
  --p1: #c8102e;
  --p1-soft: #fce8eb;
  --p2: #a24f00;
  --p2-soft: #fdf0e0;
  --p3: #1f5fa8;
  --p3-soft: #e6f0fa;
  --p4: #5d6571;
  --p4-soft: #eceef1;
  --good: #1b7a4c;
  --good-soft: #e3f4ea;
  --good-ink: #fff;
  --shadow: 0 1px 2px rgb(11 13 16 / 0.07);
  --display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --text: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --small: 0.9375rem;
  --radius-s: 0.625rem;
  --radius-m: 0.875rem;
  --radius-l: 1.25rem;
  --pill: 999px;
  --side: max(1rem, env(safe-area-inset-left), env(safe-area-inset-right));
}

@media (prefers-color-scheme: dark) {
  :root {
    --frame: #1b1f25;
    --sheet: #0c0e11;
    --surface: #171a1f;
    --ink: #eef1f4;
    --muted: #a3abb6;
    --line: #2a2f36;
    --edge: #7c838d;
    --chip: #262a31;
    --solid: #fff;
    --solid-ink: #0b0d10;
    --p1: #ff7387;
    --p1-soft: #3b1219;
    --p2: #f5a54a;
    --p2-soft: #3a250c;
    --p3: #80b4f3;
    --p3-soft: #13273e;
    --p4: #aeb5bf;
    --p4-soft: #262a31;
    --good: #6fd69b;
    --good-soft: #12301f;
    --good-ink: #0b0d10;
    --shadow: none;
  }
}

/* Na czarnej ramie te same elementy mają jasne kolory, niezależnie od motywu. */
.side, .strip, .nav, .topbar, .plain {
  color-scheme: dark;
  --surface: #23272e;
  --ink: #fff;
  --muted: #b6bdc7;
  --line: #333a44;
  --edge: #6f7782;
  --chip: #2a2f36;
  --solid: #fff;
  --solid-ink: #0b0d10;
  --p1: #ff7387;
  --p1-soft: #3b1219;
  --p2: #f5a54a;
  --p2-soft: #3a250c;
  --p3: #80b4f3;
  --p3-soft: #13273e;
  --p4: #aeb5bf;
  --p4-soft: #2a2f36;
  --good: #6fd69b;
  --good-soft: #12301f;
  --good-ink: #0b0d10;
  --shadow: none;
  color: var(--ink);
}

.p1 { --tone: var(--p1); --tone-soft: var(--p1-soft); }
.p2 { --tone: var(--p2); --tone-soft: var(--p2-soft); }
.p3 { --tone: var(--p3); --tone-soft: var(--p3-soft); }
.p4 { --tone: var(--p4); --tone-soft: var(--p4-soft); }
.good { --tone: var(--good); --tone-soft: var(--good-soft); }

/* Podstawy */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding: 1rem 0 6rem; }
body { margin: 0; background: var(--sheet); color: var(--ink); font: 1rem/1.5 var(--text); overflow-wrap: break-word; -webkit-tap-highlight-color: transparent; }
h1, h2, legend { margin: 0; font-family: var(--display); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; overflow-wrap: anywhere; }
h1 { font-size: 1.875rem; }
h2, legend { font-size: 1.25rem; }
p { margin: 0; overflow-wrap: anywhere; }
pre { margin: 0; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
pre.log { max-height: 24rem; overflow: auto; color: var(--muted); font-size: var(--small); }
code, .code { font-family: var(--mono); font-size: 0.875rem; }
.code { padding: 0.75rem 0.875rem; border-radius: var(--radius-s); background: var(--chip); }
.code + p { margin-top: 0.5rem; }
a { color: inherit; text-underline-offset: 0.2em; }
a, button, summary, label { touch-action: manipulation; }
section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.875rem; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.icon { width: 1.5rem; height: 1.5rem; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; z-index: 40; left: 1rem; top: -6rem; padding: 0.75rem 1.25rem; border-radius: var(--pill); background: #fff; color: #0b0d10; font-weight: 700; }
.skip:focus { top: 1rem; }

/* Rama: znak, dostępność, menu. Wymiary ograniczone przez vw mieszczą menu także przy dużych literach w telefonie. */

.side, .topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding: calc(env(safe-area-inset-top) + 0.75rem) var(--side) 0.75rem; background: var(--frame); }
.brand { display: flex; align-items: center; gap: 0.625rem; min-width: 0; font: 700 1.375rem/1.2 var(--display); letter-spacing: -0.01em; text-decoration: none; }
.brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { flex-shrink: 0; width: fit-content; padding: 2px; border-radius: 50%; background: #fff; }
.badge img { display: block; }

.mode { position: relative; flex-shrink: 0; margin-left: auto; }
.mode summary { display: flex; align-items: center; gap: 0.625rem; min-height: 2.75rem; padding: 0 0.75rem 0 1rem; border-radius: var(--pill); background: var(--chip); font-weight: 700; list-style: none; cursor: pointer; }
.mode summary::-webkit-details-marker { display: none; }
.mode .icon { width: 1.25rem; height: 1.25rem; transition: transform 150ms ease-out; }
.mode[open] .icon { transform: rotate(180deg); }
.dot { width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--good); }
.busy .dot { background: var(--p1); }
.night .dot { background: var(--p4); }
.mode form { position: absolute; z-index: 30; right: 0; top: calc(100% + 0.5rem); display: grid; gap: 0.25rem; width: min(20rem, calc(100vw - 2rem)); padding: 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); box-shadow: 0 16px 40px rgb(0 0 0 / 0.35); }
.mode p { padding: 0.25rem 0.5rem 0.5rem; color: var(--muted); font-size: var(--small); }
.mode button { min-height: 2.75rem; padding: 0 0.75rem; border: 0; border-radius: var(--radius-s); background: var(--chip); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.mode button:hover { background: #fff; color: #0b0d10; }

/* Dolny pasek telefonu: działy. Zakładki działu są u góry. */
.nav { position: fixed; z-index: 20; inset: auto 0 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0.25rem; padding: 0.375rem max(0.25rem, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 0.375rem) max(0.25rem, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: var(--frame); }
.nav a { position: relative; display: grid; place-items: center; align-content: center; gap: 0.125rem; min-width: 0; min-height: 3.25rem; padding: 0 0.125rem; border-radius: 0.75rem; color: var(--muted); font-size: min(0.75rem, 3.6vw); font-weight: 700; line-height: 1.2; text-decoration: none; transition: background-color 150ms ease-out, color 150ms ease-out; }
.nav a:hover { color: #fff; }
.nav a[aria-current] { background: #fff; color: #0b0d10; }
/* Kropka: w tym dziale coś czeka */
.spot { position: absolute; top: 0.375rem; left: calc(50% + 0.625rem); width: 0.625rem; height: 0.625rem; border: 2px solid var(--frame); border-radius: 50%; background: var(--p2); box-sizing: content-box; }
.nav a[aria-current] .spot { border-color: #fff; }

/* Strony panelu. Na telefonie widać zakładki działu: rząd do przesuwania palcem. Na komputerze wszystkie naraz z lewej. */

.tree { flex: none; width: calc(100% + 2 * var(--side)); margin: 0 calc(-1 * var(--side)) -0.375rem; }
.tree .group:not(.on), .tree p, .tree .icon, .tree .full { display: none; }
.tree ul { display: flex; gap: 0.375rem; margin: 0; padding: 0.375rem var(--side); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; list-style: none; }
.tree ul::-webkit-scrollbar { display: none; }
.tree li { flex: none; }
/* position: ukryty tekst przy liczniku zostaje w przewijanym rzędzie i nie poszerza strony na wąskim telefonie */
.tree a { position: relative; display: flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.75rem; padding: 0 1rem; border-radius: 0.75rem; background: var(--chip); color: var(--ink); line-height: 1.2; text-decoration: none; white-space: nowrap; transition: background-color 150ms ease-out, color 150ms ease-out; }
.tree a[aria-current] { background: #fff; color: #0b0d10; font-weight: 700; }
.tree a:focus-visible { outline-offset: -5px; }
.tree a[aria-current]:focus-visible { outline-color: #0b0d10; }
.bubble { display: grid; place-items: center; min-width: 1.375rem; height: 1.375rem; padding: 0 0.375rem; border-radius: var(--pill); background: #a24f00; color: #fff; font-size: 0.8125rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tree a[aria-current] .bubble { background: #0b0d10; color: #fff; }

main { display: flex; flex-direction: column; min-height: calc(100vh - 8rem); min-height: calc(100dvh - env(safe-area-inset-top) - 8rem); }

/* Listwa: ile jest pilnych i po terminie, kto ma dyżur, awaria i trzy rzeczy, które robi się najczęściej */

.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; padding: 0.5rem var(--side) 0.875rem; background: var(--frame); }
.pulse { display: flex; flex-wrap: wrap; align-items: baseline; align-content: center; gap: 0.125rem 1rem; min-height: 2.75rem; color: var(--muted); text-decoration: none; }
.pulse b { color: var(--ink); font: 700 1.375rem/1 var(--display); font-variant-numeric: tabular-nums; }
.pulse .hot, .pulse .hot b { color: var(--p1); }
.pulse:hover { color: var(--ink); }
.duty { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); }
.duty b { color: var(--ink); }
.duty .icon, .alarm .icon { width: 1.25rem; height: 1.25rem; }
.alarm { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.375rem 1rem; border-radius: var(--pill); background: #d0142f; color: #fff; font-weight: 700; text-decoration: none; }
.alarm:hover { background: #b0102a; }
.shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; width: 100%; }
.shortcuts .button { min-height: 2.75rem; padding: 0.25rem 0.375rem; font-size: 0.9375rem; }
.shortcuts .icon { display: none; }

/* Nagłówek strony: tytuł, najwyżej jedno zdanie i czasem przyciski */

.stage { display: grid; gap: 0.5rem; padding: 1.25rem var(--side) 0.5rem; }
.note { max-width: 65ch; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 0.25rem; justify-self: start; max-width: 100%; min-height: 2.75rem; overflow-wrap: anywhere; margin-left: -0.375rem; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }

.focus { grid-template-columns: auto minmax(0, 1fr); gap: 1rem 1.125rem; align-items: center; }
.focus > .back, .focus > .actions, .focus > .note { grid-column: 1 / -1; }
.focus > .ring { width: 6rem; height: 6rem; }
.focus .what { gap: 0.25rem; }
.focus .meta { margin-top: 0.25rem; }
.label { color: var(--muted); }
.title { font-size: 1.625rem; }
.title a { text-decoration: none; }
.title a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.outlined { font: 700 2.75rem/1 var(--display); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
@supports (-webkit-text-stroke: 1px #000) {
  .outlined { color: var(--sheet); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }
}

/* Zgłoszenie: termin w ramce z kolorem pilności, obok opisu */
.focus.ticket { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; align-items: start; }
.focus.ticket > .what { order: 1; }
.focus.ticket > .when { order: 2; padding: 0.875rem 1.125rem; border-left: 6px solid var(--tone, var(--p4)); border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow); }
.focus.ticket.late > .when { background: var(--p1-soft); }
.focus.ticket > .actions { order: 3; }
.focus.ticket > .when p.due { margin-top: 0; }
.focus.ticket > .when p.due b { font-size: 2.5rem; }
.focus.ticket > .when:empty { display: none; }

.actions { display: flex; flex-wrap: wrap; gap: 0.625rem; }
.actions .button { flex: 1 1 auto; }
.stage:not(.focus) > .actions { margin-top: 0.5rem; }

/* Treść */

.sheet { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-content: start; padding: 0.75rem var(--side) calc(env(safe-area-inset-bottom) + 6.5rem); }
.columns, .columns > * { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-content: start; }

.card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.875rem; align-content: start; padding: 1.125rem; border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow); }
.head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: -0.5rem 0; }
.count, .empty, .demo, .hint, .summary { color: var(--muted); }
.demo, .hint { font-size: var(--small); }
.summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 1.5rem; }
.summary > a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--ink); }
.description { max-width: 65ch; white-space: pre-line; }
.prose { max-width: 65ch; }
.bullets { display: grid; gap: 0.5rem; max-width: 65ch; margin: 0; padding-left: 1.25rem; }

/* Lista kontrolna: gotowe, do zrobienia, może poczekać, zepsute */
.checks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.875rem; margin: 0; padding: 0; list-style: none; }
.checks li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.875rem; align-items: start; }
.checks .mark { position: relative; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--chip); color: var(--muted); }
.checks .mark .icon { width: 1.25rem; height: 1.25rem; }
.checks .what { align-self: center; gap: 0.125rem; }
.checks .done .mark { background: var(--good-soft); color: var(--good); }
.checks .todo .mark { background: var(--p2-soft); color: var(--p2); }
.checks .bad .mark { background: var(--p1-soft); color: var(--p1); }
.checks .now .mark { background: var(--solid); color: var(--solid-ink); }
.checks .later strong { color: var(--muted); font-weight: 400; }

.search { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; padding: 0.25rem 0.25rem 0.25rem 0.5rem; border: 1.5px solid var(--edge); border-radius: 0.875rem; background: var(--surface); }
.search input { flex: 1 1 10rem; min-width: 0; min-height: 2.75rem; padding: 0 0.625rem; border: 0; background: none; }
.search input:focus-visible { outline: 0; }
.search:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; }
.search .button { border-radius: 0.625rem; }

/* Wiersze: zgłoszenia, klienci, rozmowy */

.list, .lines, .history { margin: 0; padding: 0; list-style: none; }
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.625rem; container-type: inline-size; }
.row { grid-template: "mark what go" auto "mark meta meta" auto / auto minmax(0, 1fr) auto; gap: 0.375rem 0.875rem; align-items: center; padding: 0.875rem 0.75rem 0.875rem 0.875rem; text-decoration: none; transition: transform 150ms ease-out; }
.row:hover { box-shadow: var(--shadow), 0 0 0 1.5px var(--edge); }
.row:active { transform: scale(0.99); }
.row > .ring, .row > .avatar { grid-area: mark; }
.row > .what { grid-area: what; align-self: end; }
.row > .meta { grid-area: meta; align-self: start; }
.row > .icon { grid-area: go; color: var(--muted); }
.row > .what:nth-last-child(2) { grid-row: 1 / -1; align-self: center; }
.row > .what:nth-last-child(2) + .icon { grid-row: 1 / -1; }
/* Zgłoszenie na liście: zamiast znaku brzeg w kolorze pilności */
.row.ticket { grid-template: "what go" auto "meta meta" auto / minmax(0, 1fr) auto; border-left: 6px solid var(--tone, var(--p4)); }
.row.ticket > .icon { grid-row: 1 / -1; }
@container (min-width: 46rem) {
  .row { grid-template: "mark what meta go" auto / auto minmax(0, 1fr) auto auto; gap: 1rem; padding: 0.875rem 1rem; }
  .row.ticket { grid-template: "what meta go" auto / minmax(0, 1fr) auto auto; }
  .row > .what, .row > .meta { align-self: center; }
  .row > .meta { justify-content: flex-end; max-width: 26rem; }
}
.what { display: grid; min-width: 0; overflow-wrap: anywhere; }
.what strong { line-height: 1.3; }
.who { color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.625rem; }
.number { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }

.tag { display: inline-flex; align-items: center; gap: 0.4375rem; max-width: 100%; overflow-wrap: anywhere; padding: 0.1875rem 0.6875rem; border-radius: var(--pill); background: var(--chip); font-size: 0.875rem; font-weight: 700; line-height: 1.35; }
.tag.solid { background: var(--solid); color: var(--solid-ink); }
.tag.tone { background: var(--tone-soft); color: var(--tone); }
.tag.tone::before { content: ""; flex-shrink: 0; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; }
.tag.hot { background: var(--p1-soft); color: var(--p1); }
.tag.warn { background: var(--p2-soft); color: var(--p2); }
.tag.info { background: var(--p3-soft); color: var(--p3); }
.tag.ok { background: var(--good-soft); color: var(--good); }
.due { color: var(--muted); font-size: var(--small); font-variant-numeric: tabular-nums; }
.due.late, .lines .late { color: var(--p1); font-weight: 700; }

.avatar { display: grid; place-items: center; width: 3rem; height: 3rem; border: 2.5px solid var(--ink); border-radius: 50%; font: 700 1rem/1 var(--display); }
.avatar .icon { width: 1.375rem; height: 1.375rem; }
.avatar.toned { border-color: var(--tone); color: var(--tone); }

/* Tablica zgłoszeń: kolumny według tego, kiedy trzeba się sprawą zająć */

.board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.decide { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-content: start; }
.todo, .recent { display: grid; gap: 0.5rem; align-content: start; }
.todo > h2, .recent > h2 { padding: 0 0.25rem 0.5rem; border-bottom: 3px solid var(--ink); font: 700 1rem/1.15 var(--display); letter-spacing: 0.04em; text-transform: uppercase; }
.recent > h2 { border-bottom-width: 1px; border-color: var(--line); color: var(--muted); }
.todo .list { gap: 0.5rem; }
.todo .row { grid-template: "mark what go" auto / auto minmax(0, 1fr) auto; gap: 0.75rem; padding: 0.625rem 0.875rem; }
.todo .avatar { width: 2.5rem; height: 2.5rem; border-width: 2px; }
.todo .avatar .icon { width: 1.25rem; height: 1.25rem; }
.todo .what strong { font-size: var(--small); }
.todo .who { font-size: 0.8125rem; }
.todo > .empty { padding: 0 0.25rem; }
.recent { display: none; }
.feed { display: grid; gap: 0.625rem; margin: 0; padding: 0 0.25rem; list-style: none; }
.feed li { display: grid; grid-template-columns: 4.25rem minmax(0, 1fr); gap: 0.5rem; font-size: 0.875rem; }
.feed time { color: var(--muted); font-family: var(--mono); font-size: 0.8125rem; line-height: 1.6; }
.feed a { display: grid; min-width: 0; text-decoration: none; }
.feed a:hover span { text-decoration: underline; }
.feed span { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.feed small { color: var(--muted); font-size: 0.8125rem; }

/* Na telefonie skróty do kolumn, przyklejone u góry */
.jump { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.25rem; padding: 0.25rem; border-radius: var(--radius-m); background: var(--surface); box-shadow: 0 2px 10px rgb(0 0 0 / 0.1); }
.jump a { display: grid; justify-items: center; align-content: center; min-height: 3.25rem; padding: 0.25rem; border-radius: 0.625rem; color: var(--muted); font-size: 0.8125rem; font-weight: 700; line-height: 1.15; text-align: center; text-decoration: none; }
.jump a:hover { background: var(--chip); }
.jump b { color: var(--ink); font: 700 1.375rem/1.1 var(--display); }

.col { display: grid; gap: 0; align-content: start; scroll-margin-top: 4.75rem; }
.col > h2 { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.75rem; align-items: end; margin-bottom: 0.875rem; padding: 0 0.25rem 0.625rem; border-bottom: 3px solid var(--ink); font: 700 1rem/1.15 var(--display); letter-spacing: 0.04em; text-transform: uppercase; }
.col > h2 .count { grid-row: 1 / span 2; color: inherit; font-size: 2.75rem; line-height: 0.85; letter-spacing: -0.02em; }
.col > h2 small { color: var(--muted); font: 400 0.8125rem/1.25 var(--text); letter-spacing: 0; text-transform: none; }
.col.teraz > h2 { border-color: var(--p1); color: var(--p1); }
.col.pozniej > h2, .col.czeka > h2 { border-color: var(--line); color: var(--muted); }
.col > .empty { padding: 0 0.25rem; }
.cards { display: grid; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }

.tcard { display: grid; overflow: hidden; border-left: 6px solid var(--tone, var(--p4)); border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow); }
.tcard:hover { box-shadow: var(--shadow), 0 0 0 2px var(--tone, var(--edge)); }
.tcard.late { background: var(--p1-soft); }
.tcard > a:not(.button) { display: grid; gap: 0.25rem; padding: 0.875rem 1rem 0.875rem 1.125rem; color: inherit; text-decoration: none; }
.tcard .meta { gap: 0.25rem 0.5rem; color: var(--muted); font-size: 0.875rem; }
.tcard .number { color: var(--ink); font-family: var(--mono); }
.tcard .tag { padding: 0.0625rem 0.5rem; font-size: 0.8125rem; }
.tcard.late .tag.hot { background: var(--p1); color: var(--surface); }
.tcard strong { font-size: 1.0625rem; line-height: 1.3; }
.tcard .who { font-size: var(--small); }
.tcard .call { justify-self: start; min-height: 2.75rem; margin: 0 1rem 0.875rem 1.125rem; white-space: nowrap; }

/* Termin: duża godzina, a obok, ile zostało. Pasek pokazuje, jak blisko terminu. */
p.due { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.125rem 0.625rem; margin-top: 0.375rem; font-size: 0.875rem; }
p.due b { color: var(--ink); font: 700 1.625rem/1 var(--display); font-variant-numeric: tabular-nums; }
p.due span { color: var(--muted); }
p.due.late b, p.due.late span { color: var(--p1); font-weight: 700; }
.bar { display: block; width: 100%; height: 5px; margin-top: 0.375rem; border-radius: 3px; overflow: hidden; }
.bar .track { fill: var(--line); }
.bar .fill { fill: var(--tone, var(--ink)); }
.late .bar .fill { fill: var(--p1); }

/* Sprawy z awarii w jednej ramce */
.outage-box { overflow: hidden; border: 2px solid var(--p1); border-radius: var(--radius-m); background: var(--surface); }
.outage-box .head { display: grid; gap: 0.125rem; margin: 0; padding: 0.75rem 1rem; background: var(--p1-soft); color: var(--p1); text-decoration: none; }
.outage-box .head strong { display: flex; align-items: center; gap: 0.5rem; }
.outage-box .head .icon { width: 1.25rem; height: 1.25rem; }
.outage-box .head > span { font-size: 0.875rem; }
.outage-box ul { margin: 0; padding: 0; list-style: none; }
.outage-box li a { display: grid; gap: 0.125rem; padding: 0.75rem 1rem; border-top: 1px solid var(--line); text-decoration: none; }
.outage-box li a:hover { background: var(--chip); }
.outage-box li span { color: var(--muted); font-size: 0.875rem; }

.boardhead { grid-template-columns: minmax(0, 1fr); }
.boardhead .tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.25rem; }
.boardhead .search { flex: 1 1 16rem; }
.boardhead .segments { flex: 1 1 14rem; }

/* Od tabletu: decyzje i ostatnie zdarzenia w jednym niskim pasie nad kolumnami, żeby kolumny zaczynały się wysoko */
@media (min-width: 37.5rem) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decide { grid-column: 1 / -1; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .todo { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 0.5rem; }
  .todo > h2, .todo > .empty { grid-column: 1 / -1; }
  .todo .list { align-self: stretch; }
  .todo .row { height: 100%; }
  .recent { display: grid; }
  .feed li:nth-child(n + 4) { display: none; }
  .jump { display: none; }
}

/* Kto ma jaką wersję */

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(21rem, 100%), 1fr)); gap: 0.75rem; align-items: start; }
.owner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.owner a { display: flex; align-items: center; gap: 0.875rem; min-width: 0; text-decoration: none; overflow-wrap: anywhere; }
.owner a:hover strong { text-decoration: underline; text-underline-offset: 0.2em; }
.versions { display: grid; margin: 0; padding: 0; list-style: none; }
.versions li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 0.75rem; padding: 0.5rem 0; border-top: 1px solid var(--line); }
.versions a { display: grid; flex: 1 1 11rem; min-width: 0; min-height: 2.75rem; align-content: center; text-decoration: none; overflow-wrap: anywhere; }
.versions a:hover strong { text-decoration: underline; text-underline-offset: 0.2em; }

/* Czas pracy: przejście między dniami i miesiącami */

.pager { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem; gap: 0.75rem; align-items: center; text-align: center; }
.pager a { display: grid; place-items: center; height: 2.75rem; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); }
.pager a:hover { box-shadow: var(--shadow), 0 0 0 1.5px var(--edge); }

/* Głosówki */

.recorder { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 1rem; }
.recorder p { flex: 1 1 10rem; font-variant-numeric: tabular-nums; }

/* Raport dla klienta */

.report { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; }
.report li { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: 0.25rem 0.75rem; padding: 0.75rem 0; border-top: 1px solid var(--line); }
.report li:last-child { padding-bottom: 0; }
.report li > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.25rem; overflow-wrap: anywhere; }
.report label { margin-top: 0.5rem; }
.beside { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 0.75rem; }
.beside p { flex: 1 1 12rem; }
.day { color: var(--muted); font-variant-numeric: tabular-nums; }
.lead { max-width: 60ch; font-size: 1.125rem; }
.totals dd { font: 700 2rem/1.1 var(--display); font-variant-numeric: tabular-nums; }

/* Rozliczenia: pozycje na fakturę */

.positions { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; counter-reset: position; }
.positions > li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.25rem 0.875rem; padding: 0.875rem 0; border-top: 1px solid var(--line); counter-increment: position; }
.positions > li:last-child { padding-bottom: 0; }
.positions > li > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.375rem; min-width: 0; overflow-wrap: anywhere; }
.positions > li > input[type="checkbox"] { width: 1.625rem; height: 1.625rem; min-height: 0; margin: 0.625rem 0 0; padding: 0; accent-color: var(--solid); cursor: pointer; }
.positions > li > .mark { width: 1.625rem; padding-top: 0.5rem; color: var(--muted); text-align: center; }
.positions > li > .mark:empty { padding-top: 0; }
.positions > li > .mark:empty::before { content: counter(position) "."; }
.positions textarea { min-height: 0; field-sizing: content; }
.positions .link { justify-self: start; }
.positions > li:has(input[type="checkbox"]:not(:checked)) textarea, .positions > li:has(input[type="checkbox"]:not(:checked)) .number { color: var(--muted); }
.sum { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; }
.parts { display: grid; gap: 0.25rem; margin: 0; padding: 0; color: var(--muted); font-size: var(--small); list-style: none; }
.parts a { display: inline-block; padding: 0.375rem 0; }
.fees { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); gap: 0.875rem 1rem; margin: 0; padding: 0; list-style: none; }
.sums { padding-top: 0.875rem; border-top: 2px solid var(--ink); }
.sums dd { font-family: var(--display); font-size: 1.25rem; font-variant-numeric: tabular-nums; }

/* Porady dla AI */

.tip ul, .tip ol, .steps { display: grid; gap: 0.25rem; margin: 0; padding-left: 1.375rem; }
.tip li::marker, .steps li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.steps { margin-top: 0.375rem; }
.steps a { display: inline-block; padding: 0.625rem 0; }
/* Pola zależne od tego, dla kogo jest porada. Starsza przeglądarka pokaże po prostu wszystkie. */
.tipform:not(:has([name="dla"][value="programs"]:checked)) .for-programs, .tipform:not(:has([name="dla"][value="clients"]:checked)) .for-clients { display: none; }

/* Pierścień: udział, czas pracy, kroki naprawy na stronie klienta */

.ring { display: block; width: 4rem; height: 4rem; flex-shrink: 0; }
.ring circle, .ring path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.track { stroke: var(--line); stroke-width: 3; }
.value { stroke: var(--tone, var(--ink)); stroke-width: 5; }
.ring.late .value { stroke: var(--p1); }
.ring.done .value, .ring.done .sign { stroke: var(--good); }
.ring.waiting .value { stroke: var(--muted); stroke-width: 3.5; stroke-dasharray: 0.9 10.096; }
.ring.waiting .track { stroke: none; }
.sign { stroke: var(--muted); stroke-width: 5; }
.ring.share .value { stroke: var(--p2); }
.ring text { text-anchor: middle; }
.big { font: 700 21px/1 var(--display); fill: var(--ink); }
.big.long { font-size: 17px; }
.small { font: 400 12px/1 var(--text); fill: var(--muted); }
.focus .small { font-size: 10px; }

/* Szczegóły */

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 0.875rem 1.25rem; margin: 0; }
.facts dt { color: var(--muted); font-size: var(--small); }
.facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
/* Pole dotyku większe niż sam napis. */
.facts dd > a { display: inline-flex; align-items: center; min-height: 2.75rem; margin-block: -0.625rem; }
.facts .wide { grid-column: 1 / -1; }
.facts .wide dd { font-weight: 400; }
/* Grafik dyżurów: siedem dni obok siebie, na telefonie po dwa. */
.week { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.75rem; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem; }
/* Inne sprawy klienta jedna pod drugą, choć odnośnik w opisie zwykle stoi w wierszu. */
.other, .facts dd > .other { display: flex; align-items: center; width: fit-content; min-height: 2.75rem; margin-block: 0; }

.fold { gap: 0; padding: 0 1.125rem; }
.fold[open] { padding-bottom: 1.125rem; }
.card > .fold { padding: 0; }
.fold summary { display: flex; align-items: center; gap: 0.75rem; min-height: 3.5rem; font-weight: 700; list-style: none; cursor: pointer; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary span { flex: 1; }
.fold summary .icon:last-child { transition: transform 150ms ease-out; }
.fold[open] summary .icon:last-child { transform: rotate(180deg); }
.fold p { margin-bottom: 0.75rem; }
.fold .field p { margin-bottom: 0; }

.history li { position: relative; padding: 0 0 1rem 1.75rem; }
.history li:last-child { padding-bottom: 0; }
.history li::before { content: ""; position: absolute; left: 0; top: 0.375rem; width: 0.75rem; height: 0.75rem; border: 2px solid var(--muted); border-radius: 50%; }
.history li:not(:last-child)::after { content: ""; position: absolute; left: calc(0.375rem - 1px); top: 1.375rem; bottom: -0.125rem; width: 2px; background: var(--line); }
.history .technician::before { border-color: var(--ink); background: var(--ink); }
.history span { color: var(--muted); font-size: var(--small); }

.lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 1rem; padding: 0.375rem 0; border-top: 1px solid var(--line); }
.lines strong { align-self: center; min-width: 0; overflow-wrap: anywhere; }
.lines a { display: inline-flex; align-items: center; min-width: 2.75rem; min-height: 2.75rem; justify-self: start; font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
.lines span { grid-row: 2; grid-column: 1; color: var(--muted); overflow-wrap: anywhere; }
.lines span:empty { display: none; }
.lines form, .lines a.link { grid-row: 1 / span 2; grid-column: 2; }
.lines a.link { justify-self: end; justify-content: flex-end; min-width: 2.75rem; font: inherit; }

.chat { display: grid; gap: 0.75rem; }
.chat .bubble, .sms { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.25rem; place-items: initial; min-width: 0; height: auto; max-width: min(34rem, 92%); padding: 0; border-radius: 0; background: none; color: inherit; font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.chat .bubble span, .sms span { color: var(--muted); font-size: var(--small); }
.chat .bubble p, .sms pre { width: fit-content; padding: 0.75rem 1.125rem; border-radius: 1.25rem 1.25rem 1.25rem 0.375rem; background: var(--surface); box-shadow: var(--shadow); }
.preview { display: inline-flex; align-items: center; justify-self: start; min-height: 2.75rem; }
.chat .bubble.caller { justify-self: end; justify-items: end; }
.chat .bubble.caller p { border-radius: 1.25rem 1.25rem 0.375rem 1.25rem; background: var(--solid); color: var(--solid-ink); }

/* Formularze */

.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.sheet > .solo, .fold .stack { max-width: 40rem; }
fieldset { min-width: 0; margin: 0; border: 0; }
legend { float: left; padding: 0; }
label { display: grid; gap: 0.375rem; font-size: var(--small); overflow-wrap: anywhere; }
input, select, textarea { width: 100%; min-height: 3rem; padding: 0.625rem 0.875rem; border: 1.5px solid var(--edge); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); font: 400 1rem/1.4 var(--text); }
select { padding-left: 0.625rem; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: vertical; }

.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.375rem; }
.error { color: var(--p1); font-size: var(--small); font-weight: 700; }
[aria-invalid="true"] { border-color: var(--p1); }
.choice { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.375rem; padding: 0; }
.choice legend { font: 400 var(--small)/1.5 var(--text); letter-spacing: 0; }

/* Jeden formularz na sprawę do zrobienia i na wykonaną pracę. Starsza przeglądarka pokaże po prostu wszystkie pola. */
.entry:has([value="zrobione"]:checked) .only-open, .entry:not(:has([value="zrobione"]:checked)) .only-done { display: none; }

.trip { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.625rem; }
.trip:not(:has([name="wyjazd"]:checked)) .trip-km { display: none; }

.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(2.75rem, 1fr)); gap: 0.25rem; }
.quick button { min-height: 2.75rem; padding: 0; border: 1.5px solid var(--edge); border-radius: 0.625rem; background: none; color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; transition: background-color 150ms ease-out; }
.quick button:hover { background: var(--chip); }
.quick button[aria-pressed="true"] { border-color: var(--solid); background: var(--solid); color: var(--solid-ink); font-weight: 700; }

.combo { position: relative; }
.combo ul { position: absolute; z-index: 15; inset: calc(100% + 0.25rem) 0 auto; display: grid; max-height: min(18.5rem, 45vh); margin: 0; padding: 0.25rem; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); box-shadow: 0 16px 40px rgb(0 0 0 / 0.25); list-style: none; }
.combo li { display: grid; align-content: center; min-height: 2.75rem; padding: 0.375rem 0.75rem; border-radius: 0.5rem; overflow-wrap: anywhere; cursor: pointer; }
.combo li:hover, .combo li[aria-selected="true"] { background: var(--chip); }
.combo li span { color: var(--muted); font-size: var(--small); }

.options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.375rem; }
.options label { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.875rem; min-height: 3.25rem; padding: 0.5rem 0.875rem; border: 1.5px solid var(--edge); border-radius: var(--radius-s); font-size: 1rem; cursor: pointer; }
.options label:hover { background: var(--chip); }
.options input { width: 1.375rem; height: 1.375rem; min-height: 0; margin: 0; padding: 0; accent-color: var(--solid); cursor: pointer; }
.options label > span { display: grid; min-width: 0; }
.options label:has(:checked) { border-color: var(--ink); }

/* Wybór wielu klientów: długa lista przewija się w środku, a wyszukiwanie zostaje nad nią. */
.picker .tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.75rem; }
.picker .tools input { flex: 1 1 12rem; min-width: 0; }
.picker .options { max-height: min(28rem, 60vh); margin: -0.25rem; padding: 0.25rem; overflow-y: auto; overscroll-behavior: contain; }

.check { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.875rem; min-height: 2.75rem; font-size: 1rem; cursor: pointer; }
.check input { appearance: none; position: relative; width: 3rem; height: 1.75rem; min-height: 0; margin: 0; padding: 0; border-radius: var(--pill); background: var(--chip); cursor: pointer; transition: background-color 150ms ease-out, border-color 150ms ease-out; }
.check input::before { content: ""; position: absolute; left: 0.1875rem; top: calc(50% - 0.5625rem); width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--muted); transition: transform 150ms ease-out, background-color 150ms ease-out; }
.check input:checked { border-color: var(--solid); background: var(--solid); }
.check input:checked::before { background: var(--solid-ink); transform: translateX(1.3125rem); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; justify-self: start; max-width: 100%; min-height: 2.875rem; overflow-wrap: anywhere; padding: 0.375rem 1.125rem; border: 1.5px solid transparent; border-radius: 0.75rem; background: var(--solid); color: var(--solid-ink); font: 700 1rem/1.25 var(--text); text-align: center; text-decoration: none; cursor: pointer; transition: transform 150ms ease-out, opacity 150ms ease-out; }
.button .icon { width: 1.25rem; height: 1.25rem; stroke-width: 2.25; }
.button:hover { opacity: 0.86; }
.button:active { transform: scale(0.98); }
.button.quiet { border-color: var(--edge); background: transparent; color: var(--ink); }
.button.danger { border-color: var(--p1); background: transparent; color: var(--p1); }
.button:disabled { opacity: 0.45; cursor: default; }
.button.small { min-height: 2.75rem; padding-inline: 1.25rem; }
.link { min-height: 2.75rem; padding: 0 0.25rem; border: 0; background: none; color: var(--muted); font: inherit; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
a.link { display: inline-flex; align-items: center; }
.link:hover { color: var(--p1); }
a.link:hover { color: var(--ink); }

.segments { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.25rem; border: 1.5px solid var(--edge); border-radius: 0.875rem; background: var(--surface); }
.segments a, .segments button { flex: 1 1 auto; min-height: 2.75rem; padding: 0 0.75rem; border: 0; border-radius: 0.625rem; background: none; color: var(--ink); font: inherit; white-space: nowrap; cursor: pointer; transition: background-color 150ms ease-out; }
.segments a { display: grid; place-items: center; text-decoration: none; }
.segments a:hover, .segments button:hover { background: var(--chip); }
.segments a[aria-current], .segments button:disabled { background: var(--solid); color: var(--solid-ink); font-weight: 700; cursor: default; }

.segments label { position: relative; display: block; flex: 1 1 auto; }
.segments input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.segments label span { display: grid; place-items: center; min-height: 2.75rem; padding: 0 0.75rem; border-radius: 0.625rem; font-size: 1rem; white-space: nowrap; transition: background-color 150ms ease-out; }
.segments label:hover span { background: var(--chip); }
.segments input:checked + span { background: var(--solid); color: var(--solid-ink); font-weight: 700; }
.segments input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }

/* Zdjęcia od klienta */

input[type="file"] { padding: 0.375rem; border-style: dashed; cursor: pointer; }
input[type="file"]::file-selector-button { min-height: 2.25rem; margin-right: 0.75rem; padding: 0 1rem; border: 0; border-radius: var(--pill); background: var(--chip); color: var(--ink); font: 700 0.9375rem/1.25 var(--text); cursor: pointer; }
.shots { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: start; }
.shots canvas, .shots img { display: block; width: auto; min-width: 3rem; max-width: 100%; height: 6.5rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--chip); object-fit: cover; }
.shots img { max-width: min(12rem, 100%); }
.shots figure { margin: 0; min-width: 0; max-width: 100%; }
.shots .name { display: grid; place-items: center; width: 8rem; max-width: 100%; min-height: 6.5rem; padding: 0.5rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--chip); font-size: var(--small); overflow-wrap: anywhere; }
/* Wklejanie ma sens przy klawiaturze i myszy, a bez skryptów nie działa. */
.paste { display: none; }
@media (hover: hover) and (pointer: fine) and (scripting: enabled) {
  .paste { display: inline; }
}
.posts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.posts li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.625rem; }
.posts li + li { padding-top: 1rem; border-top: 1px solid var(--line); }

/* Komunikaty */

.notice { padding: 0.75rem 1rem; border-radius: var(--radius-s); background: var(--chip); font-weight: 700; }
.notice.bad { background: var(--p1-soft); color: var(--p1); }
.notice.good { background: var(--good-soft); color: var(--good); }
.notice.warn { background: var(--p2-soft); color: var(--p2); }
.toast { position: fixed; z-index: 25; inset: auto var(--side) calc(env(safe-area-inset-bottom) + 5.25rem); display: flex; align-items: center; gap: 0.625rem; width: fit-content; max-width: 34rem; margin-inline: auto; padding: 0.75rem 1.25rem; border-radius: var(--radius-m); background: var(--good); color: var(--good-ink); font-weight: 700; box-shadow: 0 12px 32px rgb(0 0 0 / 0.25); }
.toast.bad { background: var(--p1); color: var(--surface); }
.toast.fading { animation: fade 300ms ease-in 5s forwards; }
@keyframes fade { to { opacity: 0; visibility: hidden; } }

/* Logowanie i błędy: na czarnym tle, jak rama */

.plain { background: var(--frame); }
.plain main { display: grid; gap: 1.5rem; justify-items: center; align-content: center; min-height: 100vh; min-height: 100dvh; padding: 2rem var(--side); }
.plain h1 { font-size: 1.75rem; text-align: center; }
.plain .card { width: min(24rem, 100%); padding: 1.5rem; border-radius: var(--radius-l); }
.plain .card .button { justify-self: stretch; }
.plain .spare { display: grid; gap: 0.75rem; }
.plain .spare summary { display: flex; align-items: center; min-height: 2.75rem; color: var(--muted); font-size: var(--small); text-decoration: underline; text-underline-offset: 0.2em; list-style: none; cursor: pointer; }
.plain .spare summary::-webkit-details-marker { display: none; }
.plain .spare[open] summary { color: var(--ink); text-decoration: none; font-weight: 700; }

/* Konto: klucz do aplikacji i kody zapasowe */

.key { font-size: 1.125rem; letter-spacing: 0.06em; word-spacing: 0.25em; overflow-wrap: anywhere; user-select: all; }
.spares { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.spares li { padding: 0.625rem 0.75rem; border-radius: var(--radius-s); background: var(--chip); text-align: center; }
.spares code { font-size: 1rem; letter-spacing: 0.02em; }
.card > .lines:first-child li:first-child { border-top: 0; }

/* Strona statusu dla klienta */

.public main { max-width: 46rem; margin: 0 auto; }
.public .sheet { padding-bottom: calc(env(safe-area-inset-bottom) + 2rem); }
.public .topbar { max-width: none; }
.public .focus > .note { grid-column: 1 / -1; }
.ring.step .sign { stroke: var(--ink); }
.history .ahead { color: var(--muted); }

/* Formularz zgłoszeń dla klienta. Reszta pytań pojawia się po wyborze rodzaju sprawy, a starsza przeglądarka pokaże wszystkie pola. */
.report:not(:has([name="rodzaj"]:checked)) .po-wyborze,
.report:not(:has([name="rodzaj"][value="problem"]:checked)) .tylko-problem,
.report:not(:has([name="rodzaj"][value="zamowienie"]:checked)) .tylko-zamowienie,
.report:not(:has([name="rodzaj"][value="awaria"]:checked)) .tylko-awaria,
.report:has([name="rodzaj"][value="zamowienie"]:checked) .bez-zamowienia { display: none; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.tiles { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 0.625rem; clear: both; }
.tile { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.875rem; min-height: 4.75rem; padding: 0.875rem 3rem 0.875rem 1rem; border: 1.5px solid var(--edge); border-radius: var(--radius-m); font-size: 1rem; cursor: pointer; transition: background-color 150ms ease-out, border-color 150ms ease-out; }
.tile input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.tile > .icon { width: 2rem; height: 2rem; }
.tile strong { display: block; font: 700 1.125rem/1.2 var(--display); letter-spacing: -0.01em; }
.tile small { display: block; margin-top: 0.25rem; color: var(--muted); font-size: var(--small); line-height: 1.35; }
.tile::after { content: ""; position: absolute; top: calc(50% - 0.6875rem); right: 1rem; width: 1.375rem; height: 1.375rem; border: 1.5px solid var(--edge); border-radius: 50%; }
.tile:hover { background: var(--chip); }
.tile:has(:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.tile:has(:checked)::after { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 4px var(--surface); }
.tile:has(:focus-visible) { outline: 3px solid var(--ink); outline-offset: 3px; }
.tile.p1 > .icon { color: var(--p1); }
.tile.p1:has(:checked) { border-color: var(--p1); background: var(--p1-soft); box-shadow: inset 0 0 0 1.5px var(--p1); }
.tile.p1:has(:checked)::after { border-color: var(--p1); background: var(--p1); box-shadow: inset 0 0 0 4px var(--p1-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 0.375rem; clear: both; }
.chips label { position: relative; display: block; }
.chips input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.chips span { display: grid; place-items: center; min-height: 2.75rem; padding: 0 1rem; border: 1.5px solid var(--edge); border-radius: var(--pill); font-size: 1rem; transition: background-color 150ms ease-out; }
.chips label:hover span { background: var(--chip); }
.chips input:checked + span { border-color: var(--solid); background: var(--solid); color: var(--solid-ink); font-weight: 700; }
.chips input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }
.chips .p1 input:checked + span { border-color: var(--p1); background: var(--p1); color: #fff; }
.choice .segments { clear: both; }
[aria-invalid="true"] > .segments, [aria-invalid="true"] .chips span, fieldset[aria-invalid="true"] .tile { border-color: var(--p1); }
.pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.osoba { display: grid; gap: 1rem; }
.osoba summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; min-height: 3rem; padding: 0.5rem 1rem; border-radius: var(--radius-s); background: var(--chip); list-style: none; cursor: pointer; overflow-wrap: anywhere; }
.osoba summary::-webkit-details-marker { display: none; }
.osoba .zmien { font-weight: 700; text-decoration: underline; text-underline-offset: 0.2em; }
.osoba[open] summary { display: none; }
.send { display: grid; gap: 0.75rem; }
.send .button { justify-self: stretch; min-height: 3.25rem; font-size: 1.0625rem; }
kbd { padding: 0 0.3em; border: 1px solid var(--line); border-radius: 0.3em; background: var(--chip); font: 700 0.875em/1.4 var(--text); white-space: nowrap; }
.link-firmy { overflow-wrap: anywhere; user-select: all; }
@media (min-width: 40rem) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile { grid-template-columns: minmax(0, 1fr); align-content: start; align-items: start; gap: 0.75rem; min-height: 10rem; padding: 1.125rem 1rem 1rem; }
  .tile::after { top: 1rem; }
  .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .send .button { justify-self: start; padding-inline: 1.75rem; }
}

/* Komputer: rama z lewej i u góry, treść obok */

@media (min-width: 64rem) {
  html { scroll-padding: 1.5rem 0; }
  .shell { display: grid; grid-template-columns: 17rem minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 10; flex-flow: column; align-items: stretch; justify-content: flex-start; gap: clamp(0.5rem, 1.8vh, 1.25rem); height: 100vh; height: 100dvh; padding: clamp(0.75rem, 2.2vh, 1.5rem) 1rem clamp(0.5rem, 1.5vh, 1.5rem) max(1rem, env(safe-area-inset-left)); }
  .brand { padding-left: 0.25rem; font-size: 1.5rem; }
  .mode { margin-left: 0; }
  .mode summary { min-height: 3rem; }
  .mode summary span:nth-child(2) { flex: 1; }
  .mode form { right: auto; left: 0; }
  .nav { display: none; }
  /* Wysokość wiersza zależy od okna, żeby na zwykłym monitorze wszystko mieściło się bez przewijania. */
  .tree { flex: 1 1 auto; width: auto; min-height: 0; margin: 0 -0.5rem; padding: 0 0.5rem; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  .tree .group, .tree .group:not(.on), .tree p { display: block; }
  .tree .group + .group { margin-top: clamp(0.25rem, 1.1vh, 1.25rem); }
  .tree p { padding: 0 0.875rem clamp(0rem, 4vh - 1.9375rem, 0.25rem); color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; line-height: 1.35; text-transform: uppercase; }
  .tree ul { display: grid; gap: 0.125rem; padding: 0; overflow: visible; }
  .tree a { justify-content: flex-start; gap: 0.75rem; min-height: clamp(1.5rem, 3.15vh, 2.75rem); padding: 0 0.875rem; background: none; color: var(--muted); font-size: 0.9375rem; }
  .tree a:hover { background: var(--chip); color: #fff; }
  .tree a[aria-current], .tree a[aria-current]:hover { background: #fff; color: #0b0d10; }
  .tree .icon { display: block; width: 1.25rem; height: 1.25rem; }
  .tree .short { display: none; }
  .tree .full { display: inline; }
  .tree .bubble { margin-left: auto; }
  main { min-height: 100vh; min-height: 100dvh; }
  .strip { padding: 0.75rem 1.75rem; border-left: 1px solid var(--line); }
  .shortcuts { display: flex; width: auto; margin-left: auto; }
  .shortcuts .button { padding-inline: 1rem; }
  .shortcuts .icon { display: block; }
  .stage { padding: 1.75rem 1.75rem 0.5rem; }
  h1 { font-size: 2.25rem; }
  .focus { grid-template-columns: auto minmax(0, 1fr); gap: 1.25rem 2rem; }
  .focus > .ring { grid-row: span 2; width: 8.5rem; height: 8.5rem; }
  .focus > .actions { grid-column: 2; align-self: start; }
  .focus .what { align-self: end; }
  .focus.ticket { grid-template-columns: minmax(0, 1fr) minmax(16rem, auto); gap: 1rem 2rem; align-items: end; }
  .focus.ticket > .back, .focus.ticket > .actions { grid-column: 1 / -1; }
  .focus.ticket > .what { grid-column: 1; grid-row: 2; }
  .focus.ticket > .when { grid-column: 2; grid-row: 2; }
  .focus.ticket > .actions { grid-row: 3; align-self: start; }
  .title { font-size: 2rem; }
  .outlined { font-size: 3.5rem; }
  .actions .button { flex: none; }
  .sheet { gap: 1.5rem; padding: 1rem 1.75rem 2.5rem; }
  .sheet > * { width: 100%; max-width: 72rem; }
  .sheet > .board { max-width: none; }
  .boardhead { grid-template-columns: minmax(0, 1fr) auto; column-gap: 2rem; align-items: end; }
  .boardhead > h1, .boardhead > .note { grid-column: 1; }
  .boardhead > .tools { grid-column: 2; grid-row: 1 / span 2; align-self: end; flex-wrap: nowrap; margin: 0; }
  .boardhead .search { flex: 0 1 22rem; }
  .boardhead .segments { flex: none; }
  .columns { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
  .columns > * { gap: 1.25rem; }
  .columns.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .columns.split { grid-template-rows: auto 1fr; }
  .columns.split > :nth-child(2) { grid-row: span 2; }
  .settings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
  .settings > .button { grid-column: 1 / -1; align-self: start; }
  nav.segments, .pager { max-width: 32rem; }
  .public .topbar { padding-inline: 2rem; }
  .toast { inset: auto 2rem 2rem auto; }
}

/* Szeroki ekran: cztery kolumny tablicy, a od bardzo szerokiego także panel decyzji z prawej */

@media (min-width: 75rem) {
  .board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 105rem) {
  .board { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(17rem, 20rem); }
  .decide { position: sticky; top: 1rem; grid-column: 5; grid-row: 1; grid-template-columns: minmax(0, 1fr); }
  .todo { grid-template-columns: minmax(0, 1fr); }
  .feed li:nth-child(n + 4) { display: grid; }
  .board > .col { grid-row: 1; }
}

/* Bardzo wąskie telefony */

@media (max-width: 22.5rem) {
  .focus { column-gap: 0.875rem; }
  .focus > .ring { width: 5rem; height: 5rem; }
  .search .button { padding: 0 0.75rem; }
  .search .button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .jump a { font-size: 0.75rem; }
}
@media (max-width: 319px) {
  .brand { font-size: 1.125rem; }
  .mode summary { gap: 0.5rem; padding: 0 0.75rem; font-size: 0.875rem; }
  .mode summary .icon { display: none; }
  .nav { padding-inline: 2px; }
  .nav a { padding: 0; font-size: 12px; }
  .shortcuts .button { font-size: 0.8125rem; }
}

/* Niskie okno na komputerze: menu przewija się razem ze stroną, więc żadna pozycja nie ginie */

@media (min-width: 64rem) and (max-height: 30rem) {
  .side { position: static; height: auto; }
  .tree { overflow: visible; }
}

/* Laptop: znak i dostępność w jednym rzędzie, żeby całe menu mieściło się na ekranie */

@media (min-width: 64rem) and (min-height: 30.01rem) and (max-height: 47rem) {
  .side { flex-flow: row wrap; align-content: flex-start; }
  .brand span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .mode { flex: 1 1 0; }
  .tree { flex: 0 0 calc(100% + 1rem); max-height: calc(100vh - 5rem); max-height: calc(100dvh - 5rem); }
  .tree p { padding-bottom: clamp(0rem, 3vh - 1.25rem, 0.1875rem); font-size: 0.6875rem; }
  .tree a { min-height: clamp(1.5rem, 3.55vh, 2.75rem); }
}

/* Najniższe laptopy: zamiast nazw grup zostają odstępy */

@media (min-width: 64rem) and (min-height: 30.01rem) and (max-height: 41.99rem) {
  .tree p { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tree .group + .group { margin-top: 0.3125rem; padding-top: 0.3125rem; border-top: 1px solid var(--line); }
}

/* Duży ekran dotykowy: wiersze menu na palec, menu najwyżej się przewija */

@media (min-width: 64rem) and (pointer: coarse) {
  .tree a { min-height: 2.75rem; }
}

/* Duże monitory: wszystko rośnie, żeby napisy nie były drobne */

@media (min-width: 120rem) {
  html { font-size: 112.5%; }
  .sheet > * { max-width: 96rem; }
}
@media (min-width: 150rem) { html { font-size: 125%; } }
@media (min-width: 220rem) { html { font-size: 162.5%; } }

/* Telefon trzymany poziomo: menu nie może zabrać połowy ekranu */

@media (min-width: 37rem) and (max-width: 63.99rem) {
  .tree .icon { display: block; width: 1.25rem; height: 1.25rem; }
  .tree .short { display: none; }
  .tree .full { display: inline; }
  .shortcuts { display: flex; width: auto; margin-left: auto; }
  .shortcuts .icon { display: block; }
}
@media (max-height: 30rem) and (max-width: 63.99rem) {
  .nav a { min-height: 2.75rem; }
  .spot { top: 0.25rem; }
  .sheet { padding-bottom: calc(env(safe-area-inset-bottom) + 5.5rem); }
}
@media (max-height: 30rem) and (min-width: 37rem) and (max-width: 63.99rem) {
  .nav a { grid-auto-flow: column; justify-content: center; gap: 0.5rem; padding: 0 0.625rem; }
}

/* Wydruk: czarne na białym, bez menu i przycisków, sprawy niedzielone między kartki */

@media print {
  @page { margin: 16mm 14mm; }
  :root, .topbar, .strip { color-scheme: light; --frame: #fff; --sheet: #fff; --surface: #fff; --ink: #000; --muted: #444; --line: #ccc; --shadow: none; }
  html { font-size: 11pt; }
  body { background: #fff; }
  .side, .strip, .nav, .skip, .toast, .paper, .demo, form button { display: none !important; }
  .public main { max-width: none; }
  .topbar, .stage, .sheet { padding: 0; }
  .stage { margin: 4mm 0 6mm; }
  .sheet { gap: 5mm; }
  .card { padding: 0; border-radius: 0; box-shadow: none; }
  .badge { border: 1px solid #000; }
  .report li { break-inside: avoid; }
  h2 { break-after: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .toast.fading { animation-duration: 1ms; }
}
