/* Projekt domu — strona dla rodziny, projektantów i wykonawców.
   Najpierw telefon (ekipy i żona oglądają z komórki): tam zakładki są na dole
   ekranu, pod kciukiem, a pokoje to lista; na komputerze zakładki siedzą
   w nagłówku, a pokoje są kafelkami. Motyw: domyślnie jak w systemie, przycisk
   w nagłówku wymusza jasny albo ciemny (data-theme na <html>, zapamiętany
   w przeglądarce). Bez zewnętrznych czcionek i skryptów. */

:root {
  color-scheme: light;
  --bg: #f5f3ef; --surface: #ffffff; --surface-2: #f0ece5; --surface-3: #e7e1d7;
  --border: #e4ded4; --border-2: #d3cbbe;
  --text: #1f1d1a; --dim: #59534a; --muted: #736c60;
  --accent: #94643a; --accent-2: #7a4f28; --accent-soft: rgba(148, 100, 58, .12); --on-accent: #fff;
  --green: #2b7a47; --green-bg: #2f8a4f; --on-green: #fff;
  --amber: #9a5f0c; --red: #b73a33; --wa: #178a47; --info: #3b6d96; --weekend: rgba(60, 45, 25, .035);
  --shadow: 0 1px 2px rgba(45, 35, 20, .05), 0 4px 14px rgba(45, 35, 20, .06);
  --shadow-lg: 0 10px 30px rgba(45, 35, 20, .14);
  --bar: rgba(245, 243, 239, .86);
  --r: 16px; --head: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
/* ciemny: z systemu (o ile nikt nie wybrał jasnego) albo wybrany przyciskiem */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121110; --surface: #1c1a17; --surface-2: #25221e; --surface-3: #2f2b26;
    --border: #322e29; --border-2: #45403a;
    --text: #eeeae3; --dim: #c3bbaf; --muted: #9a9286;
    --accent: #d4a373; --accent-2: #e4b98b; --accent-soft: rgba(212, 163, 115, .15); --on-accent: #20160c;
    --green: #6cc48c; --green-bg: #5bb67d; --on-green: #0b1f12;
    --amber: #e5aa55; --red: #f07b71; --wa: #1f9d55; --info: #86b1d6; --weekend: rgba(255, 255, 255, .03);
    --shadow: 0 1px 0 rgba(0, 0, 0, .25); --shadow-lg: 0 12px 34px rgba(0, 0, 0, .5);
    --bar: rgba(18, 17, 16, .82);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121110; --surface: #1c1a17; --surface-2: #25221e; --surface-3: #2f2b26;
  --border: #322e29; --border-2: #45403a;
  --text: #eeeae3; --dim: #c3bbaf; --muted: #9a9286;
  --accent: #d4a373; --accent-2: #e4b98b; --accent-soft: rgba(212, 163, 115, .15); --on-accent: #20160c;
  --green: #6cc48c; --green-bg: #5bb67d; --on-green: #0b1f12;
  --amber: #e5aa55; --red: #f07b71; --wa: #1f9d55; --info: #86b1d6; --weekend: rgba(255, 255, 255, .03);
  --shadow: 0 1px 0 rgba(0, 0, 0, .25); --shadow-lg: 0 12px 34px rgba(0, 0, 0, .5);
  --bar: rgba(18, 17, 16, .82);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-2); text-underline-offset: 2px; }
button, input, textarea, select { font: inherit; color: inherit; }
/* iPhone powiększa stronę przy polach mniejszych niż 16 px — tu ich nie ma */
input, textarea, select { font-size: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.ico .f { fill: currentColor; stroke: none; }

/* ── nagłówek ── */
.top { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px); }
/* Rozmycie na pseudoelemencie: filtr na samym nagłówku zrobiłby z niego punkt
   odniesienia dla position:fixed i dolny pasek zakładek przykleiłby się do
   nagłówka zamiast do dołu ekranu. */
.top::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--bar);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }
.top-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 12px; min-height: 58px;
  padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; font-size: 16.5px; letter-spacing: -.01em;
  color: var(--text); text-decoration: none; white-space: nowrap; flex: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: var(--on-accent); }
.brand-mark svg { width: 18px; height: 18px; }
.top-right { display: flex; align-items: center; gap: 8px; min-width: 0; margin-left: auto; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; flex: none;
  padding: 0; border: 1px solid var(--border); background: var(--surface); color: var(--dim); cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--border-2); }
.icon-btn[hidden] { display: none; }
.icon-btn.on { color: var(--accent-2); border-color: var(--accent); background: var(--accent-soft); }
.who { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--dim); min-width: 0; }
.who-label { display: flex; align-items: baseline; gap: 4px; min-width: 0; overflow: hidden; white-space: nowrap; }
.who-label b { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
/* właściciel ma w nagłówku swoje przyciski (todo, zaplecze) — podpis „właściciel” tylko by je ściskał */
.who-label.owner { display: none; }

/* zakładki: w nagłówku (komputer) albo na dole ekranu (telefon, niżej) */
.nav { display: flex; align-items: center; gap: 2px; min-width: 0; }
.nav[hidden] { display: none; }
.nav-item { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px;
  border-radius: 10px; color: var(--dim); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.on { background: var(--accent-soft); color: var(--accent-2); }
.nav-ico { width: 18px; height: 18px; }
.l-short { display: none; }
.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; line-height: 1; }

.main { max-width: 1100px; margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-right)) calc(48px + var(--safe-b)) max(16px, env(safe-area-inset-left)); }
.pad { padding: 20px 0; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }

/* ── przyciski i drobiazgi ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 15px; min-height: 42px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
  font-weight: 650; font-size: 14px; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s; }
.btn:hover { border-color: var(--border-2); background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.green { background: var(--green-bg); border-color: var(--green-bg); color: var(--on-green); }
.btn.danger { color: var(--red); }
.btn.small { padding: 6px 11px; min-height: 34px; font-size: 13px; border-radius: 10px; }
.btn.ghost { background: none; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn .ico { width: 17px; height: 17px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.notice { padding: 11px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--text);
  font-size: 14px; margin: 0 0 14px; }
.notice.warn { background: color-mix(in srgb, var(--amber) 14%, transparent); }

h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.015em; margin: 4px 0 4px; }
h2 { font-size: 17px; margin: 30px 0 10px; display: flex; align-items: center; gap: 10px; justify-content: space-between; }
h3.grp { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 10px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
  margin: 0 0 18px; }
.page-head h1 { margin: 0; }
.page-head .sub { margin: 3px 0 0; color: var(--muted); font-size: 14px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); white-space: nowrap; }
.badge.ok { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.badge.no { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.badge.soft { background: var(--surface-2); color: var(--dim); }

/* ── „Dla Ciebie” na stronie głównej ── */
.foryou { display: flex; flex-direction: column; gap: 14px; padding: 15px 16px; margin: 0 0 22px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--r); box-shadow: var(--shadow); }
.foryou-title { margin: 0; font-size: 15.5px; font-weight: 750; }
.fy-row { display: flex; flex-direction: column; gap: 7px; }
.fy-label { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fy-links { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.chip:hover { background: var(--surface-3); }
.chip.warn { background: color-mix(in srgb, var(--amber) 15%, transparent); color: var(--amber); }
.fy-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.fy-list a { display: flex; flex-direction: column; gap: 3px; padding: 9px 0; border-top: 1px solid var(--border);
  text-decoration: none; color: var(--text); }
.fy-list li:first-child a { border-top: 0; padding-top: 2px; }
.fy-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fy-body { font-size: 14.5px; overflow-wrap: anywhere; }
.fy-more { font-size: 13px; color: var(--muted); }

/* ── pomieszczenia: na telefonie lista, od 600 px kafelki ── */
.floor { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 26px 0 10px;
  font-size: 16px; font-weight: 750; }
.floor-meta { font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.zones { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.zone { display: flex; align-items: center; gap: 12px; min-height: 70px; padding: 10px 12px 10px 10px;
  text-decoration: none; color: var(--text); border-top: 1px solid var(--border); }
.zone:first-child { border-top: 0; }
.zone:active { background: var(--surface-2); }
.zone-img { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px;
  background: var(--surface-2) center / cover no-repeat; color: var(--accent-2); }
.zone-img.empty { background: var(--surface-2); }
.room-ico { width: 24px; height: 24px; }
.zone-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.zone-name { font-weight: 650; font-size: 15px; line-height: 1.25; }
.zone-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 11px; font-size: 12.5px; color: var(--muted); }
/* co jest w pokoju: ikona + liczba, bez koloru — kolorowe są tylko stany niżej */
.stat { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.stat .ico { width: 14px; height: 14px; stroke-width: 2; }
.new-dot { display: inline-block; width: 8px; height: 8px; margin-left: 7px; border-radius: 50%;
  background: var(--accent); vertical-align: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.zone-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.zone-chev { width: 18px; height: 18px; color: var(--muted); }
.flag { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11.5px;
  font-weight: 700; background: var(--surface-2); color: var(--dim); white-space: nowrap; }
.flag.warn { background: color-mix(in srgb, var(--amber) 15%, transparent); color: var(--amber); }
.flag.ok { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.flag.open { background: var(--accent-soft); color: var(--accent-2); }
.flag.now { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.flag.late { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.outscope { margin-top: 22px; }
.outscope > summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; margin-bottom: 10px; }

@media (min-width: 600px) {
  .zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px;
    background: none; border: 0; border-radius: 0; overflow: visible; box-shadow: none; }
  .zone { flex-direction: column; align-items: stretch; gap: 0; min-height: 0; padding: 0; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow);
    transition: border-color .15s, box-shadow .15s, transform .15s; }
  .zone:first-child { border-top: 1px solid var(--border); }
  .zone:hover { border-color: var(--border-2); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
  .zone .zone-img { width: auto; height: auto; aspect-ratio: 16 / 10; border-radius: 0; }
  .zone .room-ico { width: 34px; height: 34px; stroke-width: 1.5; }
  .zone-body { padding: 10px 12px 12px; }
  .zone-chev { display: none; }
}

/* ── strona pokoju ── */
.crumb { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); text-decoration: none;
  font-weight: 600; }
.crumb:hover { color: var(--text); }
.crumb .ico { width: 16px; height: 16px; }
.zone-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stepper { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted);
  font-variant-numeric: tabular-nums; }
.stepper .icon-btn { width: 34px; height: 34px; border-radius: 10px; }
.stepper .icon-btn .ico { width: 18px; height: 18px; }
.zone-title { display: flex; align-items: center; gap: 12px; margin: 10px 0 0; }
.zone-title h1 { margin: 0; }
.zone-title .zone-img { width: 46px; height: 46px; }
.zone-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; font-size: 13px;
  color: var(--muted); }
.zone-plan { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.zone-plan-l { display: inline-flex; align-items: center; gap: 5px; margin-right: 2px; font-size: 13px; font-weight: 700;
  color: var(--muted); text-decoration: none; }
.zone-plan-l .ico { width: 16px; height: 16px; }
.chip.s-now { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.chip.s-late { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.chip.s-done { color: var(--muted); text-decoration: line-through; }
.jumps { display: flex; gap: 6px; overflow-x: auto; margin: 14px -16px 0; padding: 2px 16px 6px; scrollbar-width: none; }
.jumps::-webkit-scrollbar { display: none; }
.jump { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--dim); font-weight: 600; font-size: 13px;
  cursor: pointer; }
.jump:hover { color: var(--text); border-color: var(--border-2); }
.jump-n { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--text);
  font-size: 12px; text-align: center; }
.jump.hot .jump-n { background: var(--amber); color: var(--bg); }
.sec { scroll-margin-top: calc(var(--head) + 12px); }
.empty-note { margin: 0; padding: 12px 14px; border: 1px dashed var(--border-2); border-radius: 12px;
  color: var(--muted); font-size: 14px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 34px; }
.pager a { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; }
.pager a:hover { border-color: var(--border-2); }
.pager small { color: var(--muted); font-size: 12px; }
.pager b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager .next { grid-column: 2; text-align: right; }

.brief { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px; font-size: 14.5px; overflow-wrap: anywhere; }
.brief.empty { color: var(--muted); font-style: italic; background: none; border-style: dashed; border-color: var(--border-2); }

/* ── karty: propozycje, inspiracje, rzuty, spotkania ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.cards.wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.card.decided-ok { border-color: color-mix(in srgb, var(--green) 55%, var(--border)); }
.card.decided-no { opacity: .88; }
.card-body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 7px; }
.card-title { font-weight: 700; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.card-text { font-size: 14px; color: var(--dim); white-space: pre-wrap; overflow-wrap: anywhere; }
.card-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.card-note { font-size: 12.5px; color: var(--dim); }
.variant { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px;
  border-radius: 8px; background: var(--text); color: var(--bg); font-weight: 800; font-size: 13px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 4px; padding: 4px; }
.gallery.single { grid-template-columns: 1fr; }
.thumb { position: relative; aspect-ratio: 4 / 3; border: 0; padding: 0; cursor: zoom-in; border-radius: 10px;
  background: var(--surface-2) center / cover no-repeat; overflow: hidden; }
.gallery.single .thumb { aspect-ratio: 16 / 10; }
.thumb.pdf { display: grid; place-items: center; cursor: pointer; font-weight: 700; color: var(--dim); font-size: 13px;
  text-decoration: none; padding: 8px; text-align: center; overflow-wrap: anywhere; }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 44px; color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.link-card { display: flex; flex-direction: column; text-decoration: none; color: var(--text); }
.link-img { aspect-ratio: 16 / 10; background: var(--surface-2) center / cover no-repeat; display: grid;
  place-items: center; font-size: 30px; color: var(--muted); position: relative; }
.site { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-2); }
.video-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }

.decision { display: flex; flex-direction: column; gap: 6px; padding-top: 7px; border-top: 1px dashed var(--border-2); }
.decision-note { font-size: 13.5px; white-space: pre-wrap; }

.comments { display: flex; flex-direction: column; gap: 8px; }
.comment { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 9px 12px; }
.comment-head { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.comment-head b { color: var(--text); }
.comment-body { white-space: pre-wrap; font-size: 14.5px; overflow-wrap: anywhere; }

/* ── formularze ── */
.form { display: flex; flex-direction: column; gap: 11px; background: var(--surface); border: 1px solid var(--accent);
  border-radius: var(--r); padding: 15px; box-shadow: var(--shadow); margin: 0 0 14px; }
.form.quiet { border-color: var(--border); }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--dim); }
.inp { width: 100%; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--border-2); background: var(--bg); }
.inp:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
textarea.inp { resize: vertical; min-height: 72px; }
.picked { display: flex; gap: 6px; flex-wrap: wrap; }
.picked span { font-size: 12.5px; background: var(--surface-2); border-radius: 8px; padding: 3px 8px; }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form.edit { margin-top: 4px; }
.form.edit .notice { margin: 0; }

.login { max-width: 400px; margin: 7vh auto 0; border-color: var(--border); box-shadow: var(--shadow-lg); padding: 22px; }
.login-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  background: var(--accent); color: var(--on-accent); }
.login-mark .ico { width: 26px; height: 26px; stroke-width: 2; }
.login h1 { font-size: 23px; margin: 4px 0 0; }

/* ── co nowego ── */
.feed-day { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
  margin: 20px 0 8px; }
.feed-day:first-of-type { margin-top: 0; }
.feed { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.feed-item { display: flex; gap: 12px; align-items: baseline; padding: 11px 14px; border-top: 1px solid var(--border);
  text-decoration: none; color: var(--text); font-size: 14px; }
.feed-item:first-child { border-top: 0; }
a.feed-item:hover { background: var(--surface-2); }
.feed-item time { flex: none; min-width: 40px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.feed-item span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.feed-item.new { background: var(--accent-soft); }
.feed-item.new time { color: var(--accent-2); font-weight: 700; }

/* ── rzuty w grupach z paczkami ZIP ── */
.plan-group { border-top: 1px solid var(--border); }
.plan-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; padding: 14px 0; cursor: pointer; list-style: none; }
.plan-group-head::-webkit-details-marker { display: none; }
/* w rzutach nazwy grup są długie („Architektura — projekt budowlany 2019”), więc bez wersalików */
.plan-group-head h3.grp { margin: 0; flex: 1; min-width: 12em; padding-left: 20px; text-indent: -20px;
  text-transform: none; letter-spacing: 0; font-size: 15.5px; line-height: 1.35; color: var(--text); }
.plan-group-head h3.grp::before { content: '▸'; display: inline-block; width: 14px; margin-right: 6px; text-indent: 0;
  text-align: center; font-size: 15px; color: var(--muted); transition: transform .15s; }
.plan-group[open] > .plan-group-head h3.grp::before { transform: rotate(90deg); }
.grp-count { font-weight: 500; color: var(--muted); white-space: nowrap; }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; padding-bottom: 18px; }
.plans .thumb { border-radius: 0; }
.plans .thumb.cad { aspect-ratio: 5 / 2; }
.thumb.cad { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px,
  var(--surface) 10px, var(--surface) 20px); color: var(--accent-2); font-size: 15px; }
.dl { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; text-decoration: none; }
.dl .ico { width: 16px; height: 16px; }
/* białe arkusze rysunków świecą w ciemnym motywie — lekko przygaszone */
:root[data-theme="dark"] .plans .thumb:not(.cad) { filter: brightness(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .plans .thumb:not(.cad) { filter: brightness(.9); } }

/* ── spotkania i ustalenia ── */
.meeting-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.meeting-card { flex-direction: row; text-decoration: none; color: var(--text); }
.meeting-card:hover { border-color: var(--border-2); }
.meeting-card .card-body { flex: 1; min-width: 0; }
.date-tile { flex: none; width: 66px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; background: var(--accent-soft); color: var(--accent-2); }
.date-tile b { font-size: 23px; line-height: 1; font-variant-numeric: tabular-nums; }
.date-tile span { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.meeting-actions { margin-top: 12px; }
.agreements { display: flex; flex-direction: column; gap: 8px; }
.agreements h3.grp { margin: 16px 0 2px; }
.agreements h3.grp a { color: inherit; text-decoration: none; }
.agreement { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px; }
.agreement.st-do_ustalenia { border-left: 3px solid var(--amber); }
.agreement.st-ustalone { border-left: 3px solid var(--green); }
.agreement.st-zrobione { opacity: .75; }
.agreement.st-zrobione .agreement-body { text-decoration: line-through; text-decoration-color: var(--muted); }
.agreement-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.agreement-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.assignee { font-size: 12.5px; font-weight: 700; color: var(--accent-2); }
.status-select { font-size: 16px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); min-height: 30px; }
.status-select.st-ustalone { color: var(--green); }
.status-select.st-do_ustalenia { color: var(--amber); }
.status-select.st-zrobione { color: var(--dim); }

/* WhatsApp */
a.btn.wa { text-decoration: none; }
.btn.wa:not(.ghost) { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.ghost.wa { color: var(--wa); }

/* ── instrukcja ── */
.help { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow); margin: 0 0 12px; }
.help > summary { cursor: pointer; padding: 14px 16px; font-weight: 700; font-size: 16px; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.help > summary::-webkit-details-marker { display: none; }
.help > summary::after { content: '▾'; color: var(--muted); transition: transform .15s; }
.help:not([open]) > summary::after { transform: rotate(-90deg); }
.help-lead { margin: -4px 16px 12px; color: var(--dim); font-size: 14.5px; }
.help-steps { margin: 0; padding: 0 16px 16px; list-style: none; counter-reset: step;
  display: flex; flex-direction: column; gap: 12px; }
.help-steps > li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; gap: 8px;
  font-size: 14.5px; line-height: 1.45; }
.help-steps > li::before { content: counter(step); display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent-2); font-weight: 800; font-size: 12.5px; }
.help-steps > li b { display: block; margin-bottom: 1px; }
.help-steps > li span { color: var(--dim); }
.help-steps ul { margin: 6px 0 0; padding-left: 18px; color: var(--dim); display: flex; flex-direction: column; gap: 3px; }
.help-tip { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.help-tip a { text-decoration: none; font-weight: 600; }

/* ── podgląd zdjęć (zawsze ciemny) ──
   Zdjęcie w elastycznym pudełku, nie w siatce: w siatce max-height: 100% liczy się od wysokości
   samego zdjęcia, więc pionowe wychodziło poza ekran (czarny pas nad nim i ucięty dół).
   margin: auto środkuje, a po powiększeniu nie ucina góry, jak robi to align-items: center. */
.viewer { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column;
  background: #0b0b0b; overscroll-behavior: contain; }
html.viewer-open, html.viewer-open body { overflow: hidden; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex: none;
  padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); color: #eee; font-size: 14px; }
.viewer-count { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-bar .row { flex: none; flex-wrap: nowrap; }
.viewer-bar a, .viewer-bar button { color: #fff; background: rgba(255, 255, 255, .12); border: 0; border-radius: 10px;
  padding: 8px 12px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.viewer-bar a:hover, .viewer-bar button:hover { background: rgba(255, 255, 255, .2); }
.viewer-img { flex: 1; min-height: 0; display: flex; overflow: auto; padding: 0 12px calc(12px + var(--safe-b));
  touch-action: pan-x pan-y pinch-zoom; }
.viewer-img img { margin: auto; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.viewer-cap { flex: none; margin: 0; padding: 8px 16px 4px; color: #ddd; font-size: 13.5px; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.viewer-cap:empty { display: none; }
/* strzałki ustawia JS tuż przy bokach zdjęcia; na zdjęciu (gdy obok brak miejsca) są półprzezroczyste */
.viewer-nav { position: absolute; top: 50%; left: 8px; z-index: 2; transform: translateY(-50%); width: 46px; height: 64px;
  border: 0; border-radius: 12px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 28px; line-height: 1;
  cursor: pointer; transition: background-color .15s; }
.viewer-nav.next { left: auto; right: 8px; }
.viewer-nav[style*="left"] { right: auto; }
.viewer-nav:hover { background: rgba(255, 255, 255, .26); }
.viewer.nav-in .viewer-nav { background: rgba(0, 0, 0, .38); }
.viewer.nav-in .viewer-nav:hover { background: rgba(0, 0, 0, .55); }
/* pasek miniatur: wyśrodkowany, gdy się mieści; przewijany, gdy nie (margin: auto zamiast justify-content) */
.viewer-strip { flex: none; overflow-x: auto; padding: 4px 12px calc(12px + var(--safe-b)); scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.viewer-strip-in { display: flex; gap: 8px; width: max-content; margin: 0 auto; }
.vthumb { flex: none; width: 76px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 9px; overflow: hidden;
  background: rgba(255, 255, 255, .08); opacity: .55; cursor: pointer; transition: opacity .15s, border-color .15s; }
.vthumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.vthumb:hover { opacity: .85; }
.vthumb.on { opacity: 1; border-color: #fff; }
@media (max-width: 559px) {
  .viewer-bar { padding-left: 10px; padding-right: 10px; gap: 8px; font-size: 13px; }
  .viewer-bar a, .viewer-bar button { padding: 7px 9px; font-size: 13px; }
  .viewer-img { padding: 0 0 var(--safe-b); }
  .viewer-img img { border-radius: 0; }
  .viewer-nav { width: 38px; height: 54px; font-size: 24px; }
  .viewer-strip { padding: 4px 8px calc(8px + var(--safe-b)); }
  .vthumb { width: 58px; height: 44px; border-radius: 7px; }
}

.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + var(--safe-b)); z-index: 200;
  display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 11px 14px; border-radius: 12px; font-size: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25); pointer-events: auto; }
.toast.err { background: var(--red); color: #fff; }
.toast { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.toast-act { flex: none; border: 0; background: none; color: inherit; font-weight: 800; text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer; padding: 4px 2px; }

/* ── średni ekran: zakładki w drugim wierszu nagłówka ── */
@media (min-width: 760px) and (max-width: 1139px) {
  :root { --head: 110px; }
  .top-inner { flex-wrap: wrap; row-gap: 4px; padding-bottom: 6px; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -8px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
}
@media (min-width: 1140px) {
  .nav { margin-left: 18px; }
}

/* ── telefon: zakładki na dole ekranu ── */
@media (max-width: 759px) {
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; gap: 0; justify-content: space-around;
    padding: 5px max(4px, env(safe-area-inset-left)) calc(5px + var(--safe-b)) max(4px, env(safe-area-inset-right));
    background: var(--bar); border-top: 1px solid var(--border);
    -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }
  .nav-item { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; padding: 6px 2px 4px; border-radius: 12px;
    font-size: 11px; font-weight: 650; color: var(--muted); }
  .nav-item:hover { background: none; }
  .nav-item.on { background: none; color: var(--accent-2); }
  .nav-ico { width: 24px; height: 24px; }
  .nav-item.on .nav-ico { stroke-width: 2.2; }
  .l-long { display: none; }
  .l-short { display: inline; }
  .nav-badge { position: absolute; top: 2px; left: calc(50% + 5px); }
  body.has-nav .main { padding-bottom: calc(92px + var(--safe-b)); }
  body.has-nav .toasts { bottom: calc(80px + var(--safe-b)); }
  /* klawiatura na iPhonie podnosi przyklejone do dołu elementy — pasek chowamy na czas pisania */
  body.typing .nav { display: none; }
  .who-role { display: none; }
}
@media (max-width: 560px) {
  .cards, .cards.wide { grid-template-columns: 1fr; }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .plans .card-body { padding: 8px 10px 10px; gap: 4px; }
  .plans .card-title { font-size: 13.5px; }
  .plans .card-note { font-size: 12px; }
  .meeting-list { grid-template-columns: 1fr; }
  h1 { font-size: 23px; }
  .hide-xs { display: none; }
}
/* na telefonie nagłówek ma do czterech przycisków — zostaje sam znak domu */
@media (max-width: 439px) {
  .brand-text { display: none; }
}
@media (min-width: 1140px) and (max-width: 1239px) {
  .who-role { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ── harmonogram ── */
.k-projekt { --k: var(--accent); }
.k-zakupy { --k: var(--info); }
.k-prace { --k: var(--green-bg); }
.k-termin { --k: var(--amber); }
.sch-now { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin: 0 0 16px; }
.sch-col { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--border); border-left: 4px solid var(--border-2); border-radius: var(--r); box-shadow: var(--shadow); }
.sch-col.s-late { border-left-color: var(--red); }
.sch-col.s-now { border-left-color: var(--info); }
.sch-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.sch-item { display: grid; grid-template-columns: 10px 1fr; column-gap: 9px; width: 100%; padding: 6px 6px 6px 2px;
  border: 0; border-radius: 9px; background: none; text-align: left; cursor: pointer; color: var(--text); }
.sch-item:hover { background: var(--surface-2); }
.sch-item i { grid-row: span 2; width: 10px; height: 10px; margin-top: 5px; border-radius: 3px; background: var(--k); }
.sch-what { font-weight: 650; font-size: 14px; }
.sch-when { font-size: 12.5px; color: var(--muted); }

.g-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 10px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-2); }
.seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 0; border-radius: 8px;
  background: none; color: var(--dim); font-weight: 650; font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.check-inline { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--dim); cursor: pointer; }
.g-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-left: auto; font-size: 12.5px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 5px; }
.lg i, .seg button i { width: 10px; height: 10px; border-radius: 3px; background: var(--k); }
.lg.k-termin i, .seg button.k-termin i { transform: rotate(45deg) scale(.85); border-radius: 2px; }
.g-empty { margin: 0 0 10px; }

.g-scroll { position: relative; overflow: auto; max-height: max(380px, calc(100vh - 250px));
  max-height: max(380px, calc(100dvh - 250px)); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow); overscroll-behavior-x: contain; }
.g-inner { --label: 200px; --lane: 30px; position: relative; width: calc(var(--label) + var(--days) * var(--dw)); }
.g-head { position: sticky; top: 0; z-index: 6; display: flex; background: var(--surface); border-bottom: 1px solid var(--border); }
.g-label { position: sticky; left: 0; z-index: 4; flex: none; width: var(--label); min-width: 0; display: flex;
  align-items: center; gap: 8px; padding: 0 10px 0 12px; background: var(--surface); border-right: 1px solid var(--border);
  color: var(--text); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.g-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-label .ico { width: 16px; height: 16px; color: var(--accent-2); }
a.g-label:hover span { text-decoration: underline; }
.g-corner { z-index: 7; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.g-scale { position: relative; flex: none; width: calc(var(--days) * var(--dw)); height: 50px; }
/* nazwa miesiąca trzyma się lewej krawędzi, dopóki jego kawałek osi jest widoczny (clip, nie hidden — hidden psuje sticky) */
.g-month { position: absolute; top: 0; left: calc(var(--s) * var(--dw)); width: calc(var(--n) * var(--dw)); height: 25px;
  padding-top: 5px; border-left: 1px solid var(--border-2); font-size: 12.5px; font-weight: 700; white-space: nowrap;
  overflow: clip; }
.g-month span { position: sticky; left: calc(var(--label) + 8px); display: inline-block; padding: 0 8px; }
.g-day, .g-week { position: absolute; top: 26px; left: calc(var(--s) * var(--dw)); width: var(--dw); height: 22px;
  color: var(--dim); font-size: 11.5px; line-height: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.g-week { width: calc(7 * var(--dw)); padding-left: 4px; border-left: 1px solid var(--border); text-align: left; }
.g-day.we { color: var(--muted); opacity: .75; }
.g-day.today, .g-week.today { color: var(--accent-2); font-weight: 800; }
.g-day.today { background: var(--accent-soft); border-radius: 6px; opacity: 1; }
.g-row { display: flex; min-height: calc(var(--lanes, 1) * var(--lane) + 10px); border-bottom: 1px solid var(--border); }
.g-row:last-child { border-bottom: 0; }
.g-group { min-height: 30px; background: var(--surface-2); }
.g-group .g-label { background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 750;
  text-transform: uppercase; letter-spacing: .05em; }
/* siatka: linia co poniedziałek i cień weekendu (oś zawsze zaczyna się w poniedziałek) */
.g-track { position: relative; flex: none; width: calc(var(--days) * var(--dw));
  background-image: linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to right, transparent calc(var(--dw) * 5), var(--weekend) calc(var(--dw) * 5));
  background-size: calc(var(--dw) * 7) 100%, calc(var(--dw) * 7) 100%; }
.g-group .g-track { background-image: none; }
.g-track.editable { cursor: copy; }
.g-track.g-armed { background-color: var(--accent-soft); }
.g-mline { position: absolute; top: 0; bottom: 0; left: calc(var(--label) + var(--s) * var(--dw)); z-index: 1;
  border-left: 1px solid var(--border-2); pointer-events: none; }
.g-now { position: absolute; top: 0; bottom: 0; left: calc(var(--label) + (var(--s) + .5) * var(--dw)); z-index: 1;
  width: 2px; margin-left: -1px; background: var(--red); opacity: .65; pointer-events: none; }
.g-bar { position: absolute; z-index: 2; top: calc(5px + var(--l, 0) * var(--lane)); left: calc(var(--s) * var(--dw) + 1px);
  width: calc(var(--n) * var(--dw) - 2px); height: calc(var(--lane) - 6px); display: flex; align-items: center; gap: 6px;
  padding: 0 8px 0 9px; overflow: clip; border-radius: 7px; border: 1px solid color-mix(in srgb, var(--k) 45%, transparent);
  border-left: 4px solid var(--k); background: color-mix(in srgb, var(--k) 20%, var(--surface)); color: var(--text);
  font-size: 12.5px; line-height: 1.1; white-space: nowrap; cursor: grab; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; touch-action: pan-x pan-y; }
/* podpis paska trzyma się lewej krawędzi osi, gdy początek paska jest już przewinięty (clip, nie hidden — hidden psuje sticky) */
.g-bar-in { position: sticky; left: calc(var(--label) + 8px); display: flex; gap: 6px; min-width: 0; max-width: 100%;
  overflow: hidden; }
.g-bar-t { flex: 0 1 auto; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.g-bar-w { flex: 0 100 auto; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }   /* „kto” ustępuje pierwszy */
/* na krótkim pasku zostaje sam tytuł — kto robi, widać w szczegółach */
.g-bar { container-type: inline-size; }
@container (max-width: 120px) { .g-bar-w { display: none; } }
.g-bar.s-now { background: color-mix(in srgb, var(--k) 34%, var(--surface)); }
.g-bar.s-done { opacity: .55; }
.g-bar.s-done .g-bar-t::before { content: '✓ '; }
.g-bar.s-late { box-shadow: inset 0 -3px 0 var(--red); }
.g-h { position: absolute; top: 0; bottom: 0; z-index: 1; width: 10px; cursor: ew-resize; }
.g-h.l { left: 0; }
.g-h.r { right: 0; }
.g-mile { position: absolute; z-index: 2; top: calc(5px + var(--l, 0) * var(--lane));
  left: calc((var(--s) + .5) * var(--dw) - 8px); height: calc(var(--lane) - 6px); display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 650; white-space: nowrap; cursor: grab; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; touch-action: pan-x pan-y; }
.g-mile i { width: 14px; height: 14px; margin: 0 1px; border-radius: 3px; background: var(--k); transform: rotate(45deg);
  box-shadow: 0 0 0 2px var(--surface); }
.g-mile.s-done { opacity: .55; }
.g-mile.s-late span { color: var(--red); }
.g-bar:focus-visible, .g-mile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.g-bar.g-armed, .g-mile.g-armed { transform: scale(1.04); }
.g-drag { z-index: 8; box-shadow: var(--shadow-lg); cursor: grabbing; }
.g-ghost { border-style: dashed; opacity: .9; }
.g-flash { animation: g-flash 1.8s ease-out; }
@keyframes g-flash {
  0%, 45% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 50%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
body.g-dragging, body.g-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.g-tip { position: fixed; z-index: 150; transform: translate(-50%, calc(-100% - 16px)); padding: 5px 9px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 650; white-space: nowrap; pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }

/* okno etapu: na komputerze na środku, na telefonie arkusz od dołu */
dialog.sheet { width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
  padding: 0; overflow: auto; border: 1px solid var(--border); border-radius: 18px; background: var(--surface);
  color: var(--text); box-shadow: var(--shadow-lg); }
dialog.sheet::backdrop { background: rgba(10, 8, 5, .45); }
.sheet-body { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 18px; }
.sheet-body > label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--dim); }
.sheet-body > label.check-inline { flex-direction: row; font-size: 14px; }
.sheet-body p { margin: 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 17px; }
.sheet-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: var(--dim); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.chips .chip { border: 0; font: inherit; font-size: 13px; font-weight: 600; padding: 5px 10px; cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-l { font-size: 13px; font-weight: 600; color: var(--dim); }
.row.dates > label { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 5px; font-size: 13px;
  font-weight: 600; color: var(--dim); }
.row.dates > label[hidden] { display: none; }

@media (max-width: 759px) {
  .g-inner { --label: 108px; --lane: 28px; }
  .g-label { gap: 6px; padding: 0 6px 0 9px; font-size: 12.5px; }
  .g-label .ico { display: none; }
  .sch-now { gap: 10px; }
  .sch-col { padding: 10px 12px; }
  .g-legend { width: 100%; margin-left: 0; }
  .g-scroll { max-height: max(340px, calc(100vh - 240px)); max-height: max(340px, calc(100dvh - 240px)); }
}
@media (max-width: 559px) {
  dialog.sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0;
    padding-bottom: var(--safe-b); }
}
@media (prefers-reduced-motion: reduce) {
  .g-flash { animation: none; outline: 3px solid var(--accent); }
}
