/* =====================================================================
   Wygląd w stylu iOS (v7). Ładowany po style.css: nadpisuje kolory,
   typografię i komponenty; kolory oznaczeń kalendarza (--k-*) zostają
   konfigurowalne w Ustawieniach → Wygląd kalendarza.
   ===================================================================== */
:root {
  --ios-bg: #f2f2f7; --ios-card: #ffffff; --ios-card-2: #f2f2f7; --ios-label: #000000;
  --ios-sec: #6c6c70; --ios-ter: #8e8e93; --ios-sep: rgba(60, 60, 67, .22); --ios-fill: #e5e5ea;
  --tint: #007aff; --tint-press: #0062cc; --tint-soft: rgba(0, 122, 255, .12);
  --green: #34c759; --green-ink: #248a3d; --green-soft: rgba(52, 199, 89, .16);
  --red: #ff3b30; --red-ink: #d70015; --red-soft: rgba(255, 59, 48, .13);
  --orange: #ff9500; --orange-ink: #c93400; --orange-soft: rgba(255, 149, 0, .16);
  --blue-soft: rgba(0, 122, 255, .12); --gray-soft: rgba(120, 120, 128, .14);
  --bar-glass: rgba(249, 249, 249, .86);
  --side-w: 256px;
  /* stare zmienne aplikacji → paleta iOS (wszystkie ekrany przejmują wygląd) */
  --bg: var(--ios-bg); --paper: var(--ios-card); --ink: var(--ios-label); --muted: var(--ios-sec); --line: var(--ios-sep);
  --accent: var(--tint); --accent-ink: #fff; --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ios-bg: #000000; --ios-card: #1c1c1e; --ios-card-2: #2c2c2e; --ios-label: #ffffff;
    --ios-sec: #98989f; --ios-ter: #7c7c82; --ios-sep: rgba(84, 84, 88, .55); --ios-fill: #2c2c2e;
    --tint: #0a84ff; --tint-press: #409cff; --tint-soft: rgba(10, 132, 255, .2);
    --green: #30d158; --green-ink: #30d158; --green-soft: rgba(48, 209, 88, .18);
    --red: #ff453a; --red-ink: #ff6961; --red-soft: rgba(255, 69, 58, .2);
    --orange: #ff9f0a; --orange-ink: #ffb340; --orange-soft: rgba(255, 159, 10, .2);
    --blue-soft: rgba(10, 132, 255, .2); --gray-soft: rgba(120, 120, 128, .28);
    --bar-glass: rgba(22, 22, 24, .82);
  }
}

/* ---------- podstawy ---------- */
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.01em; background: var(--ios-bg); color: var(--ios-label);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
a { color: var(--tint); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--tint); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--ios-sec); }

/* ---------- nawigacja: telefon ---------- */
.navbar {
  position: sticky; top: 0; z-index: 30; height: calc(44px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; justify-content: center;
  background: var(--bar-glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--ios-sep);
}
.navbar-title { font-size: 17px; font-weight: 600; }
body:has(.large-title) .navbar-title { opacity: 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: var(--bar-glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--ios-sep);
}
.tabbar > a, .tab-more > summary {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 48px; color: var(--ios-ter); font-size: 10.5px; font-weight: 500; text-decoration: none; cursor: pointer; list-style: none;
}
.tab-more > summary::-webkit-details-marker { display: none; }
.tabbar .ico { width: 27px; height: 27px; }
.tabbar > a[aria-current], .tab-more > summary[aria-current] { color: var(--tint); }
.tabbar > a:hover { text-decoration: none; }
.badge {
  position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}
.tab-more { position: relative; }
.more-sheet {
  position: absolute; right: 6px; bottom: calc(100% + 10px); width: min(280px, calc(100vw - 24px));
  background: var(--ios-card); border-radius: 14px; padding: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .22);
  display: grid; gap: 2px;
}
.more-who { margin: 6px 10px 6px; font-size: 13px; color: var(--ios-sec); }
.more-sheet a { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: 10px; color: var(--ios-label); font-size: 16px; }
.more-sheet a:hover, .more-sheet a[aria-current] { background: var(--ios-fill); text-decoration: none; }
.more-sheet .ico { width: 22px; height: 22px; color: var(--tint); }
.more-sheet a.is-danger, .more-sheet a.is-danger .ico { color: var(--red); }

.side { display: none; }
body.has-nav { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.wrap { padding: 12px 16px 32px; }

/* ---------- nawigacja: komputer / tablet (panel boczny jak w aplikacjach Apple) ---------- */
@media (min-width: 900px) {
  .navbar, .tabbar { display: none; }
  body.has-nav { padding-bottom: 0; padding-left: var(--side-w); }
  .side {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 30;
    padding: 22px 14px 18px; background: var(--ios-card); border-right: .5px solid var(--ios-sep); overflow-y: auto;
  }
  .side .brand { display: flex; align-items: center; gap: 10px; color: var(--ios-label); font-size: 19px; font-weight: 700; padding: 4px 10px 18px; text-decoration: none; }
  .side .brand-mark { width: 26px; height: 26px; border: 0; border-radius: 7px; background: var(--tint); box-shadow: inset 0 0 0 7px var(--tint), inset 0 0 0 11px #fff; }
  .side-nav { display: grid; gap: 2px; }
  .side-nav a, .side-foot a {
    display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--ios-label); font-size: 15px; font-weight: 500; text-decoration: none;
  }
  .side-nav .ico, .side-foot .ico { width: 21px; height: 21px; color: var(--tint); flex: none; }
  .side-nav a:hover, .side-foot a:hover { background: var(--ios-fill); }
  .side-nav a[aria-current] { background: var(--tint); color: #fff; }
  .side-nav a[aria-current] .ico { color: #fff; }
  .side-foot { margin-top: auto; padding-top: 14px; border-top: .5px solid var(--ios-sep); display: grid; gap: 4px; }
  .side-user { font-size: 13px; color: var(--ios-sec); padding: 0 12px 4px; }
  .wrap { padding: 28px 32px 48px; max-width: 1120px; }
}

/* ---------- komponenty ogólne ---------- */
.note { border: 0; border-radius: 12px; background: var(--ios-card); padding: 12px 14px 12px 3.3rem; }
.note-ok { background: var(--green-soft); } .note-err { background: var(--red-soft); } .note-warn { background: var(--orange-soft); }
.block, .req, .norm, .auth, .alert-box, .abs-item, .events-banner, .duty, .tl-wrap, .matrix-wrap, .late-day, .ovl-list li {
  border-radius: 14px; border: 0; box-shadow: none;
}
.block { background: var(--ios-card); }
input, select, textarea {
  border: 0; background: var(--ios-card); box-shadow: inset 0 0 0 .5px var(--ios-sep); border-radius: 10px; color: var(--ios-label); font-size: 16px;
}
.block input, .block select, .block textarea, .req input { background: var(--ios-bg); box-shadow: none; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--tint); }
label { color: var(--ios-sec); font-size: 13px; }
.btn { background: var(--tint); color: #fff; border-radius: 12px; font-weight: 600; padding: .65rem 1.2rem; }
.btn:hover { background: var(--tint-press); text-decoration: none; }
.btn-ghost { background: var(--tint-soft); color: var(--tint); border: 0; }
.btn-ghost:hover { background: var(--tint-soft); filter: brightness(.95); }
.btn-danger { background: var(--red); }
.linkish { color: var(--tint); text-decoration: none; }
.pill, .pill-approved, .pill-pending, .pill-rejected { border-radius: 99px; }
.chips a { text-decoration: none; }
.chips span { background: var(--ios-card); border-radius: 99px; color: var(--ios-label); }
.alert-box { background: var(--ios-card); }

/* przypomnienia o wydarzeniach: karta iOS */
.events-banner { background: var(--ios-card); border-left: 0; padding: 12px 14px; }
.events-banner h2 { color: var(--ios-sec); font-size: 13px; letter-spacing: .02em; font-weight: 600; }
.ev-when { background: var(--orange-soft); color: var(--orange-ink); }
.ev-when.is-today { background: var(--red); color: #fff; }

/* kafel dyżuru i sekcje pod kalendarzem */
.duty { background: var(--ios-card); border-left: 0; }
.sec { font-size: 1.25rem; margin: 30px 4px 8px; }
section.days article.day { border-left: 0; border-radius: 14px; }
section.days .punch { background: var(--ios-bg); border-radius: 12px; }

/* ---------- nagłówek miesiąca ---------- */
.mhead { margin: 4px 0 14px; }
.mhead-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.large-title { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -0.025em; }
.large-title .yr { font-weight: 400; color: var(--ios-ter); }
.mhead-nav { display: flex; align-items: center; gap: 8px; padding-bottom: 2px; }
.mhead-nav .round { width: 36px; height: 36px; border-radius: 50%; background: var(--ios-fill); color: var(--tint); display: grid; place-items: center; }
.mhead-nav .round .ico { width: 18px; height: 18px; stroke-width: 2.4; }
.mhead-nav .round:hover { text-decoration: none; filter: brightness(.96); }
.mhead-nav .pill { padding: 7px 13px; border-radius: 99px; background: var(--tint-soft); color: var(--tint); font-size: 15px; font-weight: 600; }
.mhead-sum { margin: 6px 0 8px; font-size: 15px; color: var(--ios-sec); }
.mhead-sum b { color: var(--ios-label); font-weight: 600; }
.mhead-sum .sep { margin: 0 6px; color: var(--ios-ter); }
.mhead-sum .is-over { color: var(--orange-ink); }
.ibar-progress { height: 6px; border-radius: 3px; background: var(--ios-fill); overflow: hidden; }
.ibar-progress span { display: block; height: 100%; border-radius: 3px; background: var(--tint); }

/* ---------- kalendarz ---------- */
.ical { background: var(--ios-card); border-radius: 18px; padding: 10px 6px 8px; }
.ical-dow, .ical-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ical-dow span { text-align: center; font-size: 12px; font-weight: 600; color: var(--ios-ter); text-transform: uppercase; padding-bottom: 4px; }
.ical-grid { row-gap: 2px; }
.iday {
  position: relative; min-width: 0; height: 64px; padding: 4px 0 0; margin: 0; border: 0 !important; box-shadow: none !important;
  background: transparent !important; color: var(--ios-label) !important; font: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 12px;
}
.iday:hover { background: var(--ios-card-2) !important; }
.inum {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-size: 18px; font-weight: 400; font-variant-numeric: tabular-nums; transition: background .15s;
}
.iday.is-off .inum { color: var(--ios-ter); }
.iday.is-today .inum { background: var(--tint); color: #fff; font-weight: 600; }
.iday.is-selected .inum { background: var(--ios-label); color: var(--ios-card); font-weight: 600; }
.iday.is-today.is-selected .inum { background: var(--tint); box-shadow: 0 0 0 3px var(--tint-soft); }
.iday.hl-on { outline: 0 !important; transform: none !important; box-shadow: none !important; }
.iday.hl-on .inum { background: var(--tint-soft); color: var(--tint); font-weight: 600; }
.iday.hl-on.is-today .inum { background: var(--tint); color: #fff; }
.ibar { width: 20px; height: 4px; border-radius: 2px; background: transparent; }
.iday.st-work .ibar { background: var(--k-work); }
.iday.st-leave .ibar { background: var(--k-leave); }
.iday.st-occasional .ibar { background: var(--k-occasional); }
.iday.st-sick .ibar { background: var(--k-sick); }
.iday.st-lieu .ibar { background: var(--k-lieu); }
.iday.st-unpaid .ibar { background: var(--k-unpaid); }
.iday.st-offwork .ibar { background: var(--k-offwork-line); }
.iday.st-flag .ibar, .iday.st-missing .ibar { background: var(--k-missing); }
.iday.has-ot .ibar { box-shadow: 6px 0 0 -0px var(--k-overtime); width: 14px; margin-right: 6px; }
.iday.has-pending .ibar { background: repeating-linear-gradient(90deg, var(--k-pending-line) 0 4px, transparent 4px 7px); }
.isub {
  max-width: 100%; padding: 0 2px; font-size: 10.5px; line-height: 1.1; font-weight: 500; color: var(--ios-sec);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums;
}
.iday.st-missing .isub, .iday.st-flag .isub { color: var(--red-ink); }
.iday.has-ot .isub { color: var(--orange-ink); }
.idots { position: absolute; top: 4px; right: calc(50% - 22px); display: flex; flex-direction: column; gap: 2px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.dot-ev { background: var(--red); }
.dot-duty { background: var(--k-duty); }
.ilegend { list-style: none; margin: 10px 4px 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ios-sec); }
.ilegend li { display: flex; align-items: center; gap: 6px; }
.ilegend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; background: none; border: 0 !important; box-shadow: none; }
.ilegend i.st-work { background: var(--k-work); } .ilegend i.st-leave { background: var(--k-leave); }
.ilegend i.st-offwork { background: var(--k-offwork-line); } .ilegend i.st-sick { background: var(--k-sick); }
.ilegend i.st-missing { background: var(--k-missing); }
.ilegend i.is-pend { background: repeating-linear-gradient(90deg, var(--k-pending-line) 0 4px, transparent 4px 7px); }
.ilegend i.dot { width: 6px; height: 6px; border-radius: 50%; }
@media (min-width: 700px) {
  .ical { padding: 16px 12px 12px; }
  .iday { height: 84px; padding-top: 8px; gap: 5px; }
  .inum { width: 40px; height: 40px; font-size: 20px; }
  .ibar { width: 28px; }
  .isub { font-size: 12px; }
  .idots { right: calc(50% - 27px); top: 8px; }
}

/* ---------- karta „Dziś” ---------- */
.today { background: var(--ios-card); border-radius: 18px; padding: 16px 16px 14px; margin: 0 0 14px; display: grid; gap: 8px; }
.today-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.today-date { font-size: 15px; font-weight: 600; }
.today-main { display: flex; align-items: baseline; gap: 10px; }
.today-time { font-size: 46px; font-weight: 300; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.today-of { font-size: 16px; color: var(--ios-sec); }
.today .ibar-progress span { background: var(--green); }
.today-hint { margin: 2px 0 0; font-size: 13px; color: var(--ios-sec); }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px;
  background: var(--gray-soft); color: var(--ios-sec); font-size: 13px; font-weight: 600; box-shadow: none !important; border: 0 !important;
}
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill.is-in { background: var(--green-soft); color: var(--green-ink); }

/* ---------- listy w grupach (jak Ustawienia iOS) ---------- */
.group-title { margin: 24px 16px 6px; font-size: 13px; font-weight: 400; color: var(--ios-sec); text-transform: uppercase; letter-spacing: .02em; }
.group { list-style: none; margin: 0; padding: 0; background: var(--ios-card); border-radius: 12px; overflow: hidden; }
.group li { position: relative; }
.group li + li::before { content: ""; position: absolute; top: 0; left: 58px; right: 0; border-top: .5px solid var(--ios-sep); }
.cell { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 52px; color: var(--ios-label); text-decoration: none; }
a.cell:hover { background: var(--ios-card-2); text-decoration: none; }
.cell-ic { flex: none; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 17px; line-height: 1; }
.cell-ic .ico { width: 19px; height: 19px; stroke-width: 2.1; }
.tone-red { background: var(--red-soft); color: var(--red); } .tone-blue { background: var(--blue-soft); color: var(--tint); }
.tone-green { background: var(--green-soft); color: var(--green-ink); } .tone-orange { background: var(--orange-soft); color: var(--orange-ink); }
.tone-gray { background: var(--gray-soft); color: var(--ios-sec); }
.cell-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cell-title { font-size: 16px; }
.cell-sub { font-size: 13px; color: var(--ios-sec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-val { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cell-val.is-muted { color: var(--ios-ter); font-weight: 500; font-size: 17px; }
.cell-chev { width: 14px; height: 14px; color: var(--ios-ter); stroke-width: 2.6; flex: none; }

/* ---------- arkusz dnia ---------- */
.sheet {
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: min(100%, 560px); max-width: 100%; max-height: 88vh; max-height: 88dvh;
  padding: 0; border: 0; border-radius: 16px 16px 0 0; background: var(--ios-bg); color: var(--ios-label);
  display: none; flex-direction: column; overflow: hidden; transition: transform .25s cubic-bezier(.2, .8, .2, 1);
  animation: sheet-up .32s cubic-bezier(.2, .8, .2, 1);
}
.sheet[open] { display: flex; }
.sheet::backdrop { background: rgba(0, 0, 0, .38); animation: fade-in .25s ease; }
.sheet.is-closing { transform: translateY(105%); }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 900px) {
  .sheet { inset: auto 0 32px 0; border-radius: 16px; }
  .sheet .sheet-grab { display: none; }
}
@media (prefers-reduced-motion: reduce) { .sheet, .sheet::backdrop { animation: none; transition: none; } }
.sheet-grab { flex: none; width: 36px; height: 5px; border-radius: 3px; background: var(--ios-ter); opacity: .5; margin: 7px auto 0; }
.sheet-head { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 2px 8px 4px; }
.sheet-title { margin: 0; font-size: 17px; font-weight: 600; text-align: center; }
.link-btn { justify-self: start; border: 0; background: none; color: var(--tint); font: inherit; font-size: 17px; min-height: 44px; padding: 0 8px; cursor: pointer; }
.sheet-body { overflow-y: auto; padding: 6px 16px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.sheet-card { background: var(--ios-card); border-radius: 16px; padding: 18px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.sheet-big { font-size: 52px; font-weight: 300; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.sheet-emoji { font-size: 40px; line-height: 1.2; }
.sheet-sub { font-size: 15px; color: var(--ios-sec); }
.sheet-note { margin: 10px 4px 0; font-size: 14px; color: var(--ios-sec); }
.sheet-actions { display: grid; gap: 10px; margin-top: 22px; }
.btn-ios {
  display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 16px; border-radius: 14px;
  background: var(--tint); color: #fff; font-size: 17px; font-weight: 600; text-decoration: none;
}
.btn-ios:hover { text-decoration: none; filter: brightness(1.05); }
.btn-ios.is-plain { background: var(--ios-card); color: var(--tint); }

/* ---------- widoki admina ---------- */
.matrix td.m { border-radius: 8px; }
.matrix th.who a { color: var(--ios-label); }
.matrix-wrap { background: var(--ios-card); padding: 8px; }
.tl-wrap { background: var(--ios-card); }
.tl-name { background: var(--ios-card); }
.month-nav a { background: var(--ios-fill); color: var(--tint); }
.month-nav h2 { font-size: 1.4rem; }
table.list { background: var(--ios-card); border-radius: 12px; overflow: hidden; }
.nw { white-space: nowrap; }
.ilegend i.dot-ev { background: var(--red); } .ilegend i.dot-duty { background: var(--k-duty); }

/* ---------- v7.2: oś czasu — tabela z kratką (klasy tg-*, bez kolizji ze starymi stylami) ---------- */
.tg-ctl { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 6px 0 12px; }
.tg-seg { display: inline-flex; background: var(--ios-fill); border-radius: 10px; padding: 2px; }
.tg-seg a { padding: 6px 12px; border-radius: 8px; color: var(--ios-label); background: transparent; font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none; }
.tg-seg a[aria-current] { background: var(--ios-card); color: var(--ios-label); box-shadow: 0 1px 3px rgba(0,0,0,.14); font-weight: 600; }
.tg-move { display: flex; align-items: center; gap: 8px; }
.tg-move strong { font-size: 17px; text-align: center; }
.tg-round { width: 36px; height: 36px; border-radius: 50%; background: var(--ios-fill); color: var(--tint); display: grid; place-items: center; text-decoration: none; }
.tg-round .ico { width: 18px; height: 18px; stroke-width: 2.4; }
.tg-pill { padding: 7px 13px; border-radius: 99px; background: var(--tint-soft); color: var(--tint); font-size: 15px; font-weight: 600; text-decoration: none; }
.tg-move a:hover { text-decoration: none; filter: brightness(.96); }
.tg-box { background: var(--ios-card); border-radius: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tg { --nw: 160px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12px; margin: 0; width: calc(var(--nw) + var(--n) * var(--cw)); max-width: none; }
table.tg col { width: var(--cw); }
table.tg col.tg-namecol { width: var(--nw); }
@media (max-width: 600px) { table.tg { --nw: 116px; } }
table.tg th, table.tg td {
  display: table-cell; position: static; padding: 0; height: 40px; min-width: 0; text-align: center; vertical-align: middle;
  border: 0; border-right: 1px solid var(--ios-sep); border-bottom: 1px solid var(--ios-sep); background: transparent; box-shadow: none; border-radius: 0;
}
table.tg .tg-name {
  position: sticky; left: 0; z-index: 3; background: var(--ios-card); text-align: left; padding: 0 10px;
  font-size: 14px; font-weight: 500; color: var(--ios-label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
table.tg .tg-name small { color: var(--ios-sec); font-weight: 400; }
table.tg thead th { background: var(--ios-card); font-weight: 600; color: var(--ios-sec); }
table.tg .tg-months th { height: 30px; text-align: left; padding-left: 8px; color: var(--ios-label); font-size: 13px; border-left: 2px solid var(--ios-sep); overflow: hidden; white-space: nowrap; }
table.tg .tg-months th.tg-name { border-left: 0; }
table.tg .tg-days th { height: 42px; line-height: 1.15; overflow: hidden; }
.tg-dn { display: block; font-size: 12px; color: var(--ios-label); font-variant-numeric: tabular-nums; }
.tg-dw { display: block; font-size: 10px; font-weight: 500; color: var(--ios-ter); text-transform: uppercase; }
table.tg .tg-off { background: var(--ios-card-2); }
table.tg thead .tg-off .tg-dn { color: var(--ios-ter); }
table.tg .tg-wk { border-left: 2px solid var(--ios-sep); }
table.tg thead th.tg-now { background: var(--tint); }
table.tg thead th.tg-now .tg-dn, table.tg thead th.tg-now .tg-dw { color: #fff; }
table.tg td.tg-now { background: var(--tint-soft); }
table.tg td.tg-ovl:not(.tg-has) { background: var(--red-soft); }
table.tg tr.tg-me > th { background: color-mix(in srgb, var(--tint) 9%, var(--ios-card)); }
table.tg td.tg-has { padding: 6px 2px; }
table.tg td.tg-has a { display: block; text-decoration: none; }
.tg-bar {
  display: flex; align-items: center; gap: 4px; height: 26px; padding: 0 6px; border-radius: 7px; overflow: hidden; white-space: nowrap;
  font-size: 12px; font-weight: 600; text-align: left;
}
.tg-bt { overflow: hidden; text-overflow: ellipsis; }
.tgk-leave { background: var(--k-leave-bg); color: var(--k-leave); }
.tgk-occasional { background: var(--k-occasional-bg); color: var(--k-occasional); }
.tgk-sick { background: var(--k-sick-bg); color: var(--k-sick); }
.tgk-lieu { background: var(--k-lieu-bg); color: var(--k-lieu); }
.tgk-unpaid { background: var(--k-unpaid-bg); color: var(--k-unpaid); }
.tgk-other { background: var(--gray-soft); color: var(--ios-sec); }
.tg-bar.tg-pend { background: var(--k-pending-bg); color: var(--k-pending-line); outline: 2px dashed var(--k-pending-line); outline-offset: -2px; }
table.tg tfoot th, table.tg tfoot td { height: 32px; font-weight: 700; font-size: 12px; background: var(--ios-card); border-bottom: 0; }
table.tg tfoot td.tg-off { background: var(--ios-card-2); }
table.tg tfoot td.tg-mid { background: var(--orange-soft); color: var(--orange-ink); }
table.tg tfoot td.tg-hi { background: var(--red-soft); color: var(--red-ink); }
table.tg .hl-on { outline: 2px solid var(--tint) !important; outline-offset: -2px !important; transform: none !important; box-shadow: none !important; }
.tg-leg { display: inline-block; width: 18px !important; height: 10px !important; border-radius: 3px !important; }
.tg-leg.tg-pend { background: var(--k-pending-bg); outline: 2px dashed var(--k-pending-line); outline-offset: -2px; }
.tg-leg.tg-ovl { background: var(--red-soft); }
.group .cell[data-hl-from] { cursor: pointer; }

/* ---------- pole emoji ---------- */
.emoji-field { display: flex; align-items: center; gap: 8px; position: relative; }
.emoji-field input { width: 4.6rem; min-width: 4.6rem; text-align: center; font-size: 1.4rem; padding: .3rem; }
.emoji-pop > summary { list-style: none; min-height: 40px; padding: .4rem .9rem; font-size: 14px; }
.emoji-pop > summary::-webkit-details-marker { display: none; }
.emoji-grid {
  position: absolute; z-index: 50; left: 0; top: calc(100% + 6px); width: min(340px, calc(100vw - 32px)); max-height: 320px; overflow-y: auto;
  background: var(--ios-card); border-radius: 14px; padding: 6px 10px 10px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.emoji-group { margin: 8px 2px 4px; font-size: 12px; font-weight: 600; color: var(--ios-sec); text-transform: uppercase; }
.emoji-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; }
.emoji-row button { height: 38px; border: 0; background: transparent; border-radius: 8px; font-size: 22px; cursor: pointer; padding: 0; }
.emoji-row button:hover, .emoji-row button:focus-visible { background: var(--ios-fill); }
.emoji-clear { margin-top: 8px; width: 100%; min-height: 36px; border: 0; border-radius: 10px; background: var(--ios-fill); color: var(--ios-label); font: inherit; font-size: 14px; cursor: pointer; }

/* ---------- dyżur jako osobna grupa ---------- */
.group.is-mine { box-shadow: inset 0 0 0 2px var(--orange); }
.tg-mlab { position: sticky; left: calc(var(--nw) + 8px); }

/* ---------- Faza 3: konto czasu ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 6px; }
@media (max-width: 520px) { .kpis { gap: 6px; } .kpi { padding: 10px; } .kpi-v { font-size: 21px; } .kpi-k { font-size: 12px; } .kpi-s { font-size: 11px; } }
.kpi { background: var(--ios-card); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; }
.kpi.is-warn { background: var(--orange-soft); }
.kpi-k { font-size: 13px; color: var(--ios-sec); }
.kpi-v { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-s { font-size: 12px; color: var(--ios-sec); }
.cell-wrap { flex-wrap: wrap; }
.choice { display: flex; gap: 8px; margin-left: auto; }
.choice .btn { min-height: 38px; padding: .35rem .9rem; font-size: 14px; }
.ot-person { padding: 14px 16px; margin-bottom: 10px; }
.ot-person h3 { margin: 0 0 6px; font-size: 17px; }
.ot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 0; border-top: .5px solid var(--ios-sep); }
.ot-row:first-of-type { border-top: 0; }
.ot-what { flex: 1 1 280px; font-size: 15px; }
.ot-amt { display: inline-block; margin-left: 6px; font-weight: 700; color: var(--orange-ink); font-variant-numeric: tabular-nums; }
.ot-amt.is-neg { color: var(--red-ink); }
.ot-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ot-act input { width: auto; min-height: 38px; }
.ot-act input[name=hours] { width: 4.5rem; text-align: center; }
.ot-act input[name=comment] { flex: 1 1 180px; }
.ot-act .btn { min-height: 38px; padding: .35rem .9rem; font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.check { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; color: var(--ios-label); font-size: 15px; }
.check input { width: auto; min-height: 0; }
.check .muted { flex-basis: 100%; }
.punch-btn-sm { min-height: 64px !important; font-size: 1.1rem; margin-top: 8px; }
.punch-btn.is-break { background: var(--orange-soft); color: var(--orange-ink); }
.punch-offer { background: var(--ios-card); border-radius: 14px; padding: 14px; display: grid; gap: 8px; text-align: center; }
.punch-offer p { margin: 0 0 4px; font-size: 16px; }
.ot-h { display: inline-flex; align-items: center; gap: 4px; color: var(--ios-sec); font-size: 14px; }
.note::before { color: #fff; }

/* ---------- skaner QR w aplikacji ---------- */
.scan-btn { gap: 10px; margin-top: 6px; }
.scan-btn .ico { width: 22px; height: 22px; }
.scanner { max-width: 520px; margin: 0 auto; }
.scan-view { position: relative; margin-top: 14px; aspect-ratio: 3 / 4; max-height: 62vh; width: 100%; border-radius: 22px; overflow: hidden; background: #000; display: grid; place-items: center; }
.scan-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; }
.scan-view.is-live video { opacity: 1; }
.scan-frame { position: absolute; width: 62%; aspect-ratio: 1; border-radius: 22px; box-shadow: 0 0 0 9999px rgba(0,0,0,.35); outline: 3px solid rgba(255,255,255,.9); outline-offset: -3px; pointer-events: none; }
.scan-start { position: relative; z-index: 2; gap: 10px; }
.scan-start .ico { width: 22px; height: 22px; }
.scan-msg { text-align: center; margin: 12px 0 0; font-size: 15px; color: var(--ios-sec); min-height: 1.4em; }
.scan-msg.is-bad { color: var(--red-ink); }

/* ---------- uzupełnienie z puli nadgodzin: osobny kolor ---------- */
:root { --credit: #30b0c7; --credit-soft: rgba(48, 176, 199, .16); --credit-ink: #0e7c8f; }
@media (prefers-color-scheme: dark) { :root { --credit: #40c8e0; --credit-soft: rgba(64, 200, 224, .2); --credit-ink: #64d2ff; } }
.iday.has-credit .ibar { background: linear-gradient(90deg, var(--k-work) 0 calc(100% - var(--cr, 0%)), var(--credit) calc(100% - var(--cr, 0%)) 100%); }
.iday.has-credit .isub { color: var(--credit-ink); }
.ilegend i.is-credit { background: var(--credit); }
.ibar-progress { display: flex; }
.ibar-progress span.is-credit { background: var(--credit) !important; border-radius: 0 3px 3px 0; }
.ibar-progress span + span.is-credit { margin-left: 0; }
.credit-txt { color: var(--credit-ink); }
.credit-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--credit); margin-right: 6px; vertical-align: 1px; }
.credit-dot.is-work { background: var(--k-work); }
.sheet-split { display: flex; gap: 14px; font-size: 14px; color: var(--ios-sec); }
.chip-credit { background: var(--credit-soft); color: var(--credit-ink); }
.matrix td.m.has-credit { box-shadow: inset 0 -4px 0 var(--credit); }
.mhead-sum a.is-over { color: var(--orange-ink); }
.mhead-sum .ot-wait { color: var(--ios-sec); text-decoration: underline dotted; }

/* --- Wyciąg nadgodzin */
.statement { background: var(--ios-card); border-radius: 14px; padding: 12px 16px 6px; margin: 14px 0 6px; }
.statement h2 { margin: 0 0 4px; font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ios-sec); }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: .5px solid var(--ios-sep); }
.statement h2 + .st-row { border-top: 0; }
.st-k { font-size: 16px; display: flex; flex-direction: column; min-width: 0; }
.st-k small { font-size: 12.5px; color: var(--ios-sec); }
.st-v { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-row.is-plus .st-v { color: var(--green-ink, #248a3d); }
.st-row.is-minus .st-v { color: var(--credit-ink); }
.st-row.is-zero .st-v, .st-row.is-wait .st-v { color: var(--ios-sec); font-weight: 500; }
.st-row.is-total { border-top: 1.5px solid var(--ios-label); }
.st-row.is-total .st-k { font-weight: 700; }
.st-row.is-total .st-v { font-size: 22px; font-weight: 700; }
.st-row.is-wait .st-k { color: var(--ios-sec); }
.st-more { display: block; padding: 9px 0 6px; border-top: .5px solid var(--ios-sep); font-size: 15px; }
.st-deficit { margin: 8px 16px 0; font-size: 15px; color: var(--orange-ink, #b25000); }

/* --- Powiadomienia push */
.push-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; background: var(--ios-card); border-radius: 14px; padding: 12px 14px; margin: 0 0 12px; }
.push-card[hidden] { display: none; }
.push-ic { font-size: 22px; }
.push-body { flex: 1 1 220px; display: flex; flex-direction: column; font-size: 15px; }
.push-txt { color: var(--ios-sec); font-size: 13.5px; }
.push-act { display: flex; align-items: center; gap: 12px; }
.push-act .btn { min-height: 38px; padding: .35rem 1rem; }

/* --- Zgłoszenie godziny wyjścia */
.claim-form { margin: 0; }
.claim-fields { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 4px 0 2px 44px; }
.claim-fields label { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0; }
.claim-fields input { width: auto; min-height: 38px; }
.claim-fields input[name=reason] { flex: 1 1 160px; }
.claim-fields .btn { min-height: 38px; padding: .35rem 1rem; }
@media (max-width: 520px) { .claim-fields { padding-left: 0; } }

/* --- Ogłoszenia z potwierdzeniem */
.events-banner .ev { grid-template-columns: auto auto 1fr auto; }
.events-banner .ev.needs-ack { background: var(--tint-soft); margin: 0 -8px; padding: 6px 8px; border-radius: 10px; }
.ev-ack { margin: 0; }
.ev-ack .btn { min-height: 34px; padding: .25rem .8rem; font-size: 14px; white-space: nowrap; }
.ev-acked { font-size: 13px; color: var(--green-ink, #248a3d); white-space: nowrap; }
@media (max-width: 520px) { .events-banner .ev { grid-template-columns: auto auto 1fr; } .ev-ack, .ev-acked { grid-column: 1 / -1; justify-self: end; } }
.check-row { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 10px; }
.check-row input { width: auto; min-height: 0; margin-top: 4px; flex: none; }
.adj-form { align-items: center; }
.adj-form select { width: auto; min-height: 38px; flex: 1 1 200px; }
.adj-form .adj-exp { display: flex; align-items: center; gap: 6px; font-size: 14px; margin: 0; white-space: nowrap; }
.adj-form input[name=note] { flex: 1 1 200px; }

/* --- Zamiast linków w tekście: przyciski i kafle jak w aplikacji */
.head-row { align-items: center; }
.head-row > a:not(.btn), .filters a, .form-actions > a:not(.btn), .show-cal {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 99px;
  background: var(--tint-soft); color: var(--tint); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.filters { flex-wrap: wrap; }
.filters a[aria-current] { background: var(--tint); color: #fff; }
.head-row > a:not(.btn):hover, .filters a:hover, .form-actions > a:not(.btn):hover { text-decoration: none; filter: brightness(.97); }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 14px 0; }
.quick a { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px; border-radius: 14px; background: var(--ios-card); color: var(--ios-label); font-size: 15px; font-weight: 600; text-decoration: none; }
.quick a:hover { text-decoration: none; background: var(--tint-soft); }
.quick .ico { width: 24px; height: 24px; color: var(--tint); flex: none; }
.team-info { margin-bottom: 12px; }
.hint-more { margin: 8px 0 0; font-size: 14px; }
.hint-more > summary { cursor: pointer; color: var(--tint); font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.punches .arrow { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.punches .arrow small { font-size: 12px; font-weight: 600; color: var(--ios-sec); font-variant-numeric: tabular-nums; }

/* --- Kalendarz: poziome linie między tygodniami */
.ical-grid { row-gap: 0; }
.ical-grid > * { position: relative; }
.ical-grid > :nth-child(n+8)::before { content: ""; position: absolute; left: 0; right: 0; top: 0; border-top: .5px solid var(--ios-sep); pointer-events: none; }
.ical-grid > .iday { border-radius: 0; padding-top: 6px; }
.aud-pick { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 6px; }
.ev-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; }
.ev-tags span { font-size: 12.5px; padding: 2px 9px; border-radius: 99px; background: var(--ios-fill); color: var(--ios-sec); }
.aud-pick .wd span, .wd input[type=radio] + span { font-size: 15px; font-weight: 600; }

/* --- Odświeżanie w aplikacji z ekranu głównego: przycisk w pasku i pociągnięcie w dół */
.nav-refresh { position: absolute; right: 8px; bottom: 0; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: var(--tint); cursor: pointer; padding: 0; }
.nav-refresh .ico { width: 22px; height: 22px; }
.nav-refresh.is-busy .ico, .ptr.is-busy span { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ptr { position: fixed; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 50px); z-index: 60; display: flex; justify-content: center; pointer-events: none; opacity: 0; transform: translateY(-30px); }
.ptr span { width: 30px; height: 30px; border-radius: 50%; background: var(--ios-card); box-shadow: 0 2px 10px rgba(0,0,0,.18); border: 3px solid var(--ios-fill); border-top-color: var(--tint); box-sizing: border-box; }
.ptr.is-ready span { border-color: var(--tint); }
@media (min-width: 900px) { .ptr { display: none; } }

/* --- Formularze w siatce: pola w jednym wierszu mają równą wysokość (dłuższy opis obok nie rozciąga sąsiada) */
.form-grid { align-items: start; }
.form-grid > label { align-content: start; }
.form-grid > label > input, .form-grid > label > select { flex: 0 0 auto; align-self: stretch; height: auto; }

/* --- Płynne przejścia między zakładkami (menu stoi w miejscu, zmienia się treść) */
@view-transition { navigation: auto; }
.tabbar { view-transition-name: tabbar; }
.side { view-transition-name: side; }
.navbar { view-transition-name: navbar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }

/* --- Stan „Zapisuję…” i własne okno potwierdzenia */
.btn.is-busy, .btn-ios.is-busy { opacity: .65; cursor: progress; }
button:disabled { cursor: default; }
dialog.confirm { border: 0; border-radius: 16px; padding: 20px 20px 14px; width: min(340px, calc(100vw - 48px)); background: var(--ios-card); color: var(--ios-label); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog.confirm::backdrop { background: rgba(0, 0, 0, .38); }
.confirm-msg { margin: 0 0 16px; font-size: 17px; font-weight: 600; text-align: center; line-height: 1.3; }
.confirm-act { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-act .btn { min-height: 44px; justify-content: center; }

/* --- Arkusze z formularzami, przyciski na górze strony, puste stany */
.top-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0 6px; }
.top-actions .btn-ios { margin: 0; width: 100%; border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 17px; }
.form-sheet .sheet-body { padding-top: 10px; }
.form-sheet .form, .form-sheet .form-grid { max-width: none; }
.form-sheet .late-form { display: grid; gap: .9rem; }
.form-sheet .btn-ios { width: 100%; border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 17px; margin: 4px 0 0; }
.form-sheet .form-actions { display: block; }
@media (min-width: 700px) { .form-sheet.sheet { max-width: 560px; margin-inline: auto; } }
.empty { background: var(--ios-card); border-radius: 14px; padding: 18px 16px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.empty p { margin: 0; color: var(--ios-sec); font-size: 15px; }
.empty .btn-ios { margin: 0; padding-inline: 22px; width: auto; border: 0; cursor: pointer; font: inherit; font-weight: 600; }

/* --- Kalendarz zespołu: przełącznik tydzień / miesiąc */
.mx-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 10px; }
.seg { display: inline-flex; background: var(--ios-fill); border-radius: 10px; padding: 2px; }
.seg button { border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 600; color: var(--ios-label); padding: 6px 16px; border-radius: 8px; cursor: pointer; min-height: 34px; }
.seg button[aria-pressed=true] { background: var(--ios-card); box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.mx-week { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mx-week[hidden] { display: none; }
.mx-week .round { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--tint-soft); color: var(--tint); display: grid; place-items: center; cursor: pointer; padding: 0; }
.mx-week .round:disabled { opacity: .35; }
.mx-week .round .ico { width: 18px; height: 18px; }
.matrix .wk-off { display: none; }
.matrix.is-week { width: 100% !important; table-layout: fixed; }
.matrix.is-week .c-sum { display: none; }
.matrix.is-week col.c-who { width: 34% !important; }
.matrix.is-week col.c-day { width: auto !important; }
.matrix.is-week td.m a { min-height: 40px; display: grid; place-items: center; font-size: 14px; }
.matrix td.m a[data-sheet] { cursor: pointer; }

/* --- Jeden styl nagłówków i bloków na wszystkich ekranach (jak w Kalendarzu) */
.wrap > h1, .head-row > h1 { font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -0.025em; margin: 6px 0 8px; }
@media (max-width: 520px) { .wrap > h1, .head-row > h1 { font-size: 30px; } }
.wrap > h2, .sec, section.reqs + h2 { margin: 26px 16px 8px; font-size: 13px; font-weight: 400; color: var(--ios-sec); text-transform: uppercase; letter-spacing: .02em; }
.block > h2, .block > header > h3, .req > header > h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.block > h2 { margin: 0 0 8px; }
.block, .req, .norm { border-radius: 14px; border: 0; box-shadow: none; }
.wrap > p.muted { font-size: 15px; margin: 0 4px 12px; }
.reqs { display: grid; gap: 10px; }
.norm .norm-figures .k { font-size: 13px; color: var(--ios-sec); }
.norm .norm-figures .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.table-wrap { border-radius: 14px; }
table.list th { font-size: 12.5px; font-weight: 600; color: var(--ios-sec); text-transform: none; }
.matrix.is-week th.who { white-space: normal; overflow-wrap: anywhere; line-height: 1.2; font-size: 13px; }

/* --- Pola daty i godziny na iPhonie: nie szersze niż pozostałe pola */
input[type=date], input[type=time], input[type=datetime-local] { -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; display: block; text-align: left; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value, input[type=datetime-local]::-webkit-date-and-time-value { text-align: left; }
.form-grid > label, .form-sheet label { min-width: 0; }
.form-inline input[type=date], .form-inline input[type=time], .ot-act input[type=date], .ot-act input[type=time], .claim-fields input[type=time], .adj-exp input[type=date] { width: auto; display: inline-block; }

/* --- Szerokie widoki na komputerze: oś czasu i kalendarz zespołu wykorzystują całą szerokość */
@media (min-width: 900px) { body:has(.tg-box) .wrap, body:has(.matrix-wrap) .wrap { max-width: none; } }
.who-line { margin: 0 4px 6px; font-size: 14px; color: var(--ios-sec); }
.bal-hint { margin: 6px 0 0; }
.etat-none[hidden], .etat[hidden] { display: none !important; }

/* ==========================================================================
   Ruch: wejście treści, reakcja na dotyk, płynne paski i okna
   (wszystko wyłącza się przy „ogranicz ruch” w systemie)
   ========================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes slide-l { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes slide-r { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes note-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  /* treść strony wjeżdża kolejno, kafel po kaflu */
  .wrap > * { animation: rise .38s cubic-bezier(.2, .8, .2, 1) both; }
  .wrap > :nth-child(2) { animation-delay: .03s; } .wrap > :nth-child(3) { animation-delay: .06s; }
  .wrap > :nth-child(4) { animation-delay: .09s; } .wrap > :nth-child(5) { animation-delay: .12s; }
  .wrap > :nth-child(6) { animation-delay: .15s; } .wrap > :nth-child(7) { animation-delay: .18s; }
  .wrap > :nth-child(n+8) { animation-delay: .2s; }
  .wrap > dialog, .wrap > template, .wrap > script { animation: none; }
  .note, .notices .note { animation: note-in .35s cubic-bezier(.2, .8, .2, 1) both; }
  /* paski postępu rosną od lewej */
  .ibar-progress span, .bar span { transform-origin: left center; animation: grow-x .7s cubic-bezier(.2, .8, .2, 1) .15s both; }
  /* zmiana miesiąca: kalendarz przesuwa się w stronę strzałki */
  .ical.go-next { animation: slide-l .32s cubic-bezier(.2, .8, .2, 1) both; }
  .ical.go-prev { animation: slide-r .32s cubic-bezier(.2, .8, .2, 1) both; }
  /* okna */
  dialog.confirm[open] { animation: pop .2s cubic-bezier(.2, .9, .3, 1.2) both; }
  .more-sheet { animation: pop .18s ease-out both; transform-origin: bottom right; }
  .emoji-grid { animation: pop .16s ease-out both; }
  details[open] > :not(summary) { animation: rise .25s ease-out both; }
  /* reakcja na dotyk i najechanie */
  .btn, .btn-ios, .pill, .round, .seg button, .quick a, .cell, .iday, .tabbar a, .tab-more summary, .head-row > a, .filters a, .linkish, .nav-refresh, .matrix td.m a {
    transition: transform .14s ease, background-color .2s ease, box-shadow .2s ease, opacity .2s ease, filter .2s ease;
  }
  .btn:active, .btn-ios:active, .pill:active, .round:active, .seg button:active, .quick a:active, .head-row > a:active, .filters a:active, .nav-refresh:active { transform: scale(.96); }
  a.cell:active, .iday:active, .matrix td.m a:active { transform: scale(.98); }
  .tabbar a:active .ico, .tab-more summary:active .ico { transform: scale(.85); }
  .tabbar a .ico { transition: transform .2s cubic-bezier(.2, .9, .3, 1.4); }
  .tabbar a[aria-current] .ico { transform: translateY(-1px) scale(1.06); }
  @media (hover: hover) {
    .quick a:hover, .block:hover .btn, a.cell:hover { filter: none; }
    .quick a:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, .07); }
    .btn:hover, .btn-ios:hover { filter: brightness(1.06); }
    .matrix td.m a[data-sheet]:hover { transform: scale(1.06); }
  }
  .side-nav a { transition: background-color .2s ease, color .2s ease, transform .14s ease; }
  .side-nav a:active { transform: scale(.98); }
  .status-pill.is-in i { animation: pulse 2s ease-in-out infinite; }
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, .5); } 50% { box-shadow: 0 0 0 5px rgba(52, 199, 89, 0); } }
.cell-btn { width: 100%; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.cell-btn:hover { background: var(--ios-card-2); }
.cell-edit { margin-left: 8px; font-size: 14px; font-weight: 600; color: var(--tint); }
.sheet-actions button.btn-ios { width: 100%; border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 17px; }
.matrix td.m a { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ==========================================================================
   Warstwa „Apple”: sprężyste arkusze, przełączniki iOS, unoszenie kart, rozmycie tła
   ========================================================================== */
:root { --spring: cubic-bezier(.32, .72, 0, 1); --spring-pop: cubic-bezier(.34, 1.4, .64, 1); }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* arkusze i okna: krzywa jak w iOS, rozmyte tło */
@keyframes sheet-spring { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-blur { from { opacity: 0; backdrop-filter: blur(0); } to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: sheet-spring .5s var(--spring) both; }
  @media (min-width: 700px) { .sheet[open] { animation: pop .32s var(--spring-pop) both; } }
  .sheet.is-closing { transition: transform .26s cubic-bezier(.4, 0, 1, 1); }
  dialog.dlg[open] { animation: pop .3s var(--spring-pop) both; }
}
.sheet::backdrop, dialog.confirm::backdrop, dialog.dlg::backdrop { background: rgba(0, 0, 0, .32); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade-blur .3s ease both; }

/* przełączniki zamiast kwadratowych pól wyboru */
.check-row input[type=checkbox], label.check > input[type=checkbox], .switch {
  -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 51px !important; height: 31px; min-height: 0; margin: 0 2px 0 0;
  border-radius: 99px; background: var(--ios-fill); border: 0; cursor: pointer; transition: background-color .25s ease; padding: 0;
}
.check-row input[type=checkbox]::after, label.check > input[type=checkbox]::after, .switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .3s var(--spring);
}
.check-row input[type=checkbox]:checked, label.check > input[type=checkbox]:checked, .switch:checked { background: var(--green); }
.check-row input[type=checkbox]:checked::after, label.check > input[type=checkbox]:checked::after, .switch:checked::after { transform: translateX(20px); }
.check-row input[type=checkbox]:active::after, label.check > input[type=checkbox]:active::after { width: 33px; }
.check-row input[type=checkbox]:checked:active::after, label.check > input[type=checkbox]:checked:active::after { transform: translateX(14px); }
label.check { display: flex !important; flex-wrap: wrap; align-items: center; gap: 10px; }
label.check > .muted { flex-basis: 100%; }

/* karty i listy: delikatne uniesienie i podświetlenie wiersza */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .block, .req, .abs-item, .alert-box, .statement, .today, .push-card, .empty, .kpi {
    transition: transform .35s var(--spring), box-shadow .35s var(--spring);
  }
  .req:hover, .abs-item:hover, a.alert-box:hover, .alert-box:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, .07); }
  .group > li > .cell, .group > li > a.cell, .group > li > form.cell { transition: background-color .18s ease; }
  .group > li > a.cell:hover, .group > li > .cell-btn:hover { background: var(--ios-card-2); }
  .iday:hover .inum { transform: scale(1.08); }
  .iday .inum { transition: transform .25s var(--spring-pop), background-color .2s ease; }
  .side-nav a:hover:not([aria-current]) { background: var(--ios-card-2); }
  .abs-item, .ev { transition: background-color .18s ease; }
}

/* przyciski: miękka sprężyna przy wciśnięciu */
@media (prefers-reduced-motion: no-preference) {
  .btn, .btn-ios, .quick a, .seg button, .pill, .round { transition: transform .3s var(--spring-pop), filter .2s ease, background-color .2s ease, box-shadow .3s var(--spring); }
  .btn:active, .btn-ios:active { transform: scale(.95); transition-duration: .08s; }
  /* dni kalendarza wjeżdżają wiersz po wierszu */
  .ical-grid > * { animation: rise .45s var(--spring) both; }
  .ical-grid > :nth-child(n+8) { animation-delay: .04s; } .ical-grid > :nth-child(n+15) { animation-delay: .08s; }
  .ical-grid > :nth-child(n+22) { animation-delay: .12s; } .ical-grid > :nth-child(n+29) { animation-delay: .16s; } .ical-grid > :nth-child(n+36) { animation-delay: .2s; }
  .ical.go-next .ical-grid > *, .ical.go-prev .ical-grid > * { animation: none; }
  /* pasek zakładek i aktywna pozycja menu */
  .side-nav a[aria-current] { animation: pop .35s var(--spring-pop) both; }
  .tabbar a[aria-current] .ico { animation: tab-bounce .45s var(--spring-pop); }
  .status-pill, .badge { transition: transform .3s var(--spring-pop); }
  .badge { animation: pop .4s var(--spring-pop) .3s both; }
  /* wyróżnienie fokusa */
  :focus-visible { transition: outline-offset .2s var(--spring); }
}
@keyframes tab-bounce { 0% { transform: scale(.85); } 60% { transform: translateY(-2px) scale(1.12); } 100% { transform: translateY(-1px) scale(1.06); } }
.navbar, .tabbar { transition: box-shadow .3s ease, background-color .3s ease; }
body.is-scrolled .navbar { box-shadow: 0 1px 0 var(--ios-sep), 0 8px 20px rgba(0, 0, 0, .04); }
.count-up { font-variant-numeric: tabular-nums; }

/* --- Nadgodziny w szczegółach dnia: osobna kolorowa pastylka */
.ot-pill { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 14px; border-radius: 99px; background: var(--orange-soft); color: var(--orange-ink); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ot-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }

/* --- Dziś nieobecni */
.absent-today { background: var(--ios-card); border-radius: 14px; padding: 10px 14px 12px; margin: 0 0 12px; }
.at-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.at-head h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ios-sec); display: flex; align-items: center; gap: 8px; }
.at-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--ios-fill); color: var(--ios-label); font-size: 12px; }
.absent-today.is-collapsed { padding-bottom: 10px; }
.at-toggle { font-size: 15px; }
.at-chips { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.at-chip { display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; font: inherit; font-size: 15px; font-weight: 600; color: var(--ios-label);
  background: var(--ios-card-2); border-radius: 99px; padding: 7px 12px 7px 9px; }
.at-chip small { font-weight: 400; color: var(--ios-sec); font-size: 13px; }
.at-chip:hover { background: var(--tint-soft); }
.abs-sheet .sheet-card { gap: 6px; }
.at-kind { font-size: 30px !important; font-weight: 600; }
.at-back { background: var(--green-soft); color: var(--green-ink); }
.at-back::before { background: var(--green); }
.today-link { display: block; margin-top: 10px; font-size: 15px; font-weight: 600; text-align: center; }
.plan-form { display: grid; gap: 0; }
.plan-form .group-title { margin: 16px 4px 6px; }
.plan-row { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; background: var(--ios-card); padding: 8px 14px; margin: 0; border-bottom: .5px solid var(--ios-sep); font-size: 16px; color: var(--ios-label); }
.plan-row .plan-day b { font-weight: 600; }
.plan-row input[type=time] { width: 120px !important; display: inline-block; flex: none; }
.plan-row.is-off { color: var(--ios-ter); }
.plan-form .btn-ios { margin-top: 16px; }
.plan-form .group-title + .plan-row { border-radius: 12px 12px 0 0; }

/* --- Komunikaty: zamykane dotknięciem; wyjście ze strony: lekkie wygaszenie */
.note.is-closable { cursor: pointer; }
.ev-acked.is-new { animation: pop .35s var(--spring-pop) both; }
.events-banner .ev { transition: background-color .4s ease, margin .3s ease, padding .3s ease; }
body.is-leaving main.wrap { opacity: .55; transform: translateY(4px); transition: opacity .16s ease, transform .16s ease; }
.sheet-head .link-btn:focus:not(:focus-visible) { outline: none; }

/* --- Pola godziny na iPhonie: pełna szerokość i wysokość także gdy są puste */
input[type=time], input[type=date], input[type=datetime-local] { min-height: 44px; }
.claim-fields input[type=time], .plan-row input[type=time], .ot-act input[type=time], .form-inline input[type=time] { min-width: 112px; }
.claim-fields input[type=time] { font-size: 17px; font-weight: 600; }

/* --- Oś czasu urlopów: ikonka równo na środku paska */
.tg-ic { flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; font-size: 13px; line-height: 1; }
.tg-bar.tg-short { justify-content: center; padding: 0 2px; }
.tg-bar.tg-short .tg-bt { display: none; }
/* --- Godziny startu: wypełnianie tygodnia */
.plan-fill { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; background: var(--ios-card); border-radius: 12px; padding: 10px 14px; margin: 6px 0 4px; }
.plan-fill label { display: grid; gap: 4px; margin: 0; }
.plan-fill input { width: 120px !important; }
.plan-fill .btn { min-height: 44px; }
.plan-wk { display: flex; align-items: center; justify-content: space-between; }
.plan-wk .link-btn { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; }
@keyframes flash-fill { 0% { background: var(--tint-soft); } 100% { background: var(--ios-card-2, #f2f2f7); } }
.plan-row input.flash { animation: flash-fill .8s ease; }
.print-act { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.print-act form { margin: 0; }
.print-act .btn { min-height: 36px; padding: .3rem .9rem; font-size: 14px; }
.print-link { white-space: nowrap; font-weight: 600; }
.head-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.head-acts > a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 99px; background: var(--tint-soft); color: var(--tint); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.chk-del { margin: 0 0 0 8px; }
.chk-add { margin-top: 10px; }
.chk-add > summary { cursor: pointer; font-weight: 600; color: var(--tint); }
.chk-add[open] > summary { margin-bottom: 10px; }

/* --- Otwarte okno/arkusz: tło się nie przewija */
html:has(dialog[open]), html:has(dialog[open]) body { overflow: hidden; }
dialog, .sheet-body { overscroll-behavior: contain; }
.close-tbl td, .close-tbl th { white-space: nowrap; font-variant-numeric: tabular-nums; }
.top-actions a.btn-ios { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.od-line { margin-top: 4px; }

/* ==========================================================================
   Feedback: toast, animacja sukcesu, pasek ładowania, zakładki, potrząśnięcie
   ========================================================================== */
:root { --tint-btn: #0064d2; }
@media (prefers-color-scheme: dark) { :root { --tint-btn: #0a72e8; } }
/* przyciski: odrobinę ciemniejszy niebieski — kontrast z białym tekstem ≥ 4,5:1 (WCAG AA) */
.btn:not(.btn-ghost):not(.btn-danger), .btn-ios:not(.is-plain), .top-actions .btn-ios:not(.is-plain), .scan-btn { background: var(--tint-btn) !important; }

.toasts { position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 78px); z-index: 90; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
@media (min-width: 900px) { .toasts { bottom: 28px; left: 240px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 520px; width: max-content; padding: 11px 16px 11px 12px; border-radius: 16px;
  background: rgba(30, 30, 32, .92); color: #fff; font-size: 15px; line-height: 1.35; box-shadow: 0 12px 34px rgba(0, 0, 0, .25);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  transform: translateY(24px) scale(.96); opacity: 0; transition: transform .45s var(--spring-pop, ease), opacity .25s ease; cursor: pointer; }
.toast.is-in { transform: none; opacity: 1; }
.toast.is-out { transform: translateY(16px) scale(.97); opacity: 0; transition-duration: .3s; }
.toast b { color: #fff; }
.toast a { color: #8ec5ff; }
.toast-ic { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--green); color: #fff; }
.toast-warn .toast-ic { background: var(--orange); }
.toast-err .toast-ic { background: var(--red); }

.celebrate { position: fixed; inset: 0; z-index: 95; display: grid; place-content: center; justify-items: center; gap: 14px; background: rgba(0, 0, 0, .28);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s ease; }
.celebrate.is-in { opacity: 1; }
.cel-circle { width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; background: var(--green); box-shadow: 0 18px 50px rgba(52, 199, 89, .45);
  transform: scale(.4); transition: transform .55s cubic-bezier(.34, 1.56, .64, 1); }
.celebrate.is-err .cel-circle { background: var(--red); box-shadow: 0 18px 50px rgba(255, 59, 48, .4); }
.celebrate.is-in .cel-circle { transform: scale(1); }
.celebrate.is-err.is-in .cel-circle { animation: shake .5s .25s; }
.cel-circle svg { width: 70px; height: 70px; fill: none; stroke: #fff; stroke-width: 5.5; stroke-linecap: round; stroke-linejoin: round; }
.cel-path { stroke-dasharray: 60; stroke-dashoffset: 60; }
.celebrate.is-in .cel-path { transition: stroke-dashoffset .45s .2s ease-out; stroke-dashoffset: 0; }
.cel-text { margin: 0; color: #fff; font-size: 22px; font-weight: 700; text-shadow: 0 2px 10px rgba(0, 0, 0, .3); }

.nav-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 99; background: var(--tint); border-radius: 0 3px 3px 0; box-shadow: 0 0 8px var(--tint); opacity: 0; pointer-events: none; }
.nav-progress.is-on { opacity: 1; animation: nav-prog 8s cubic-bezier(.1, .7, .2, 1) forwards; }
.nav-progress.is-done { width: 100%; opacity: 0; transition: opacity .3s .1s; }
@keyframes nav-prog { 0% { width: 0; } 10% { width: 35%; } 40% { width: 70%; } 100% { width: 92%; } }

@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.shake { animation: shake .45s ease; }
.swipe-away { transform: translateX(110%); opacity: 0; transition: transform .35s cubic-bezier(.4, 0, .6, 1), opacity .3s ease; }

.tabs-seg { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; background: var(--ios-fill); border-radius: 12px; padding: 3px; margin: 10px 0 14px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 46px); z-index: 20; }
@media (min-width: 900px) { .tabs-seg { top: 8px; width: max-content; max-width: 100%; } }
.tabs-seg::-webkit-scrollbar { display: none; }
.tabs-seg button { flex: 1 0 auto; border: 0; background: transparent; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--ios-label); padding: 8px 14px; border-radius: 9px; min-height: 38px; cursor: pointer; white-space: nowrap; transition: background-color .2s ease, box-shadow .2s ease; }
.tabs-seg button[aria-selected=true] { background: var(--ios-card); box-shadow: 0 1px 4px rgba(0, 0, 0, .14); }
.tab-in { animation: rise .35s cubic-bezier(.2, .8, .2, 1) both; }

/* --- większe pola dotyku (min. 44 px na telefonie) */
@media (pointer: coarse) {
  .linkish, .link-btn, .actions a, .actions .linkish, td.actions form button, [data-add].linkish, .push-act .linkish, .tg-seg button, .tg-seg a, .print-act .linkish, .chk-del .linkish, .filters a {
    min-height: 44px; display: inline-flex; align-items: center; padding-inline: 10px;
  }
  td.actions { white-space: nowrap; }
  .at-chip { min-height: 40px; }
}

/* --- licznik w menu: delikatny puls, gdy czeka coś do zrobienia */
@media (prefers-reduced-motion: no-preference) {
  .badge { animation: pop .4s var(--spring-pop) .3s both, badge-pulse 2.6s ease-in-out 1.2s 3; }
}
@keyframes badge-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, .45); } 50% { box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); } }
@media (prefers-color-scheme: dark) { .toast { border: 1px solid rgba(255,255,255,.14); box-shadow: 0 10px 30px rgba(0,0,0,.6); } }

/* ---------- płynne zamykanie arkuszy i okien ---------- */
@keyframes sheet-out { from { transform: translateY(var(--drag-y, 0px)); } to { transform: translateY(105%); } }
@keyframes pop-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(.94); } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
dialog.is-shown { animation: none !important; }
.sheet.is-dragging { animation: none !important; transition: none !important; will-change: transform; }
.sheet.is-settling { animation: none !important; transition: transform .42s cubic-bezier(.2, 1.15, .4, 1) !important; }
.sheet.is-closing { animation: sheet-out .3s cubic-bezier(.32, 0, .67, 0) both !important; transition: none !important; }
@media (min-width: 700px) { .sheet.is-closing { animation-name: pop-out !important; animation-duration: .2s !important; } }
dialog.confirm.is-closing, dialog.dlg.is-closing { animation: pop-out .18s ease-in both !important; }
dialog.is-closing::backdrop { animation: fade-out .3s ease both !important; }
@media (prefers-reduced-motion: reduce) { dialog.is-closing, dialog.is-closing::backdrop { animation: none !important; } }

/* ---------- ikony SVG (Lucide) zamiast emoji ---------- */
.i { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex: none; display: inline-block; }
.i-txt { line-height: 1; }
.cell-ic .i { width: 19px; height: 19px; vertical-align: 0; }
.sheet-emoji { color: var(--ios-sec); }
.sheet-emoji .i { width: 40px; height: 40px; stroke-width: 1.6; vertical-align: 0; }
.isub .i { width: 15px; height: 15px; vertical-align: -2px; stroke-width: 2.2; }
.tg-ic .i { width: 13px; height: 13px; vertical-align: 0; stroke-width: 2.4; }
.abs-ic .i, .ev-ic .i { width: 20px; height: 20px; vertical-align: 0; }
.at-chip .i { width: 16px; height: 16px; vertical-align: 0; color: var(--tint); }
.push-ic .i { width: 24px; height: 24px; color: var(--tint); }
.chip .i, .flag-reason .i, .sheet-note .i { width: 15px; height: 15px; vertical-align: -2px; }
.flag-reason .i, .sheet-note .i-triangle-alert { color: var(--orange-ink, #b25f00); }
.matrix td .i, .m .i, .evt .i { width: 14px; height: 14px; vertical-align: -2px; stroke-width: 2.2; }
.ilegend .i, .legend .i { width: 14px; height: 14px; vertical-align: -2px; }
.ap-pv .mid .i { width: 16px; height: 16px; vertical-align: 0; }
.btn-ios .i, .btn .i { width: 17px; height: 17px; vertical-align: -3px; }
/* wybór ikony */
.icon-field { gap: 10px; }
.icon-cur { width: 44px; height: 44px; border-radius: 12px; background: var(--ios-fill); display: grid; place-items: center; color: var(--ios-label); flex: none; }
.icon-cur .i { width: 22px; height: 22px; vertical-align: 0; }
.icon-none { color: var(--ios-ter); }
.icon-field .emoji-row { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 4px; }
.icon-field .emoji-row button { height: 42px; color: var(--ios-label); display: grid; place-items: center; }
.icon-field .emoji-row button .i { width: 21px; height: 21px; vertical-align: 0; }
.icon-field .emoji-row button.is-on { background: var(--tint); color: #fff; }

/* etykieta stanu dnia w arkuszu: kolor oznaczenia z kalendarza + ikona */
.status-pill .i { width: 15px; height: 15px; vertical-align: 0; stroke-width: 2.3; }
.status-pill.sp-work { background: var(--k-work-bg); color: var(--k-work); }
.status-pill.sp-leave { background: var(--k-leave-bg); color: var(--k-leave); }
.status-pill.sp-occasional { background: var(--k-occasional-bg); color: var(--k-occasional); }
.status-pill.sp-sick { background: var(--k-sick-bg); color: var(--k-sick); }
.status-pill.sp-lieu { background: var(--k-lieu-bg); color: var(--k-lieu); }
.status-pill.sp-unpaid { background: var(--k-unpaid-bg); color: var(--k-unpaid); }
.status-pill.sp-offwork { background: var(--k-offwork-bg); color: var(--k-offwork); }
.status-pill.sp-flag { background: var(--k-flag-bg); color: var(--k-flag); }
.status-pill.sp-missing { background: var(--red-soft); color: var(--red-ink); }
.status-pill.sp-workday { background: var(--tint-soft); color: var(--tint-press); }
.status-pill.sp-off { background: var(--k-off-bg); color: var(--ios-label); }
.status-pill.sp-holiday { background: var(--red-soft); color: var(--red-ink); }
@media (prefers-color-scheme: dark) { .status-pill.sp-workday { color: #8cc4ff; } }

/* zmiana miesiąca w miejscu: stary kalendarz odjeżdża, nowy wjeżdża */
@keyframes out-l { to { opacity: 0; transform: translateX(-24px); } }
@keyframes out-r { to { opacity: 0; transform: translateX(24px); } }
@media (prefers-reduced-motion: no-preference) {
  .ical.go-out-next { animation: out-l .14s ease-in both; }
  .ical.go-out-prev { animation: out-r .14s ease-in both; }
}

/* przyciski tekstowe → małe przyciski w kształcie pastylki (czytelne, łatwe do trafienia) */
button.linkish, a.linkish {
  display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 5px 13px; border: 0; border-radius: 99px;
  background: var(--tint-soft); color: var(--tint-press); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .15s var(--spring-pop, ease);
}
button.linkish:hover, a.linkish:hover { background: color-mix(in srgb, var(--tint) 20%, transparent); }
button.linkish:active, a.linkish:active { transform: scale(.96); }
button.linkish .i { width: 15px; height: 15px; vertical-align: 0; }
button.linkish:is([value=cancel], [value=late_cancel], [value=delete], [value=remove], [value=deactivate], [value=del_holiday]) { background: var(--red-soft); color: var(--red-ink); }
button.linkish:is([value=cancel], [value=late_cancel], [value=delete], [value=remove], [value=deactivate], [value=del_holiday]):hover { background: color-mix(in srgb, var(--red) 22%, transparent); }
@media (prefers-color-scheme: dark) { button.linkish, a.linkish { color: #8cc4ff; } }
.req form:has(> .linkish) { margin-top: 10px; }
.day .linkish { justify-self: start; font-size: 13px; }
.miss-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.miss-act .btn-ios { display: inline-flex; align-items: center; gap: 6px; width: auto; padding: 9px 14px; font-size: 15px; border-radius: 12px; }
.sheet-actions .btn-ios { display: flex; align-items: center; justify-content: center; gap: 8px; }
.sheet-lead { margin: 4px 2px 14px; line-height: 1.45; }
#sheet-dzien .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.miss-act .btn-ios { width: auto; flex: 0 1 auto; }

/* oznaczenie wpisów wprowadzonych ręcznie / zgłoszonych / zamkniętych automatycznie */
.src-badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px 1px 6px; border-radius: 99px; font-size: 11.5px; font-weight: 600; line-height: 1.5; vertical-align: 1px; white-space: nowrap; }
.src-badge .i { width: 11px; height: 11px; vertical-align: 0; }
.src-manual { background: var(--orange-soft); color: var(--orange-ink); }
.src-claim { background: var(--blue-soft); color: var(--tint-press); }
.src-auto { background: var(--gray-soft); color: var(--ios-sec); }
@media (prefers-color-scheme: dark) { .src-claim { color: #8cc4ff; } }
.cell-sub-wrap { white-space: normal; }
.src-part { white-space: nowrap; }
.btn.btn-danger { background: var(--red); color: #fff; border: 0; }

/* wydarzenia: własny kolor (indygo) — czerwony zostaje tylko dla błędów i braków */
:root { --ev: #5856d6; --ev-ink: #4b49c4; --ev-soft: rgba(88, 86, 214, .14); }
@media (prefers-color-scheme: dark) { :root { --ev: #7d7aff; --ev-ink: #a9a7ff; --ev-soft: rgba(125, 122, 255, .22); } }
.tone-event { background: var(--ev-soft); color: var(--ev-ink); }
.dot-ev, .ilegend i.dot-ev { background: var(--ev); }
.ev-when.is-today { background: var(--ev); color: #fff; }
.ev-ic, .ev-ic-tile, .abs-ic.ev-ic-tile { color: var(--ev-ink); }
.abs-ic.ev-ic-tile, .ev-ic-tile { background: var(--ev-soft); }
.matrix tfoot td.evt { color: var(--ev-ink); }

/* tabele: kolumna akcji zostaje komórką tabeli (flex rozbijał wiersz), przyciski obok siebie */
.list td.actions { display: table-cell; vertical-align: middle; text-align: right; white-space: normal; }
.list td.actions > a, .list td.actions > form { display: inline-flex; align-items: center; vertical-align: middle; margin: 2px 0 2px 10px; }
.list td.actions > details { display: block; margin-top: 6px; text-align: left; white-space: normal; }
.list td.actions form { margin-block: 0; }
.list td.actions a, .list td.actions button { white-space: nowrap; }
.list td.actions > form { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.print-link { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 5px 13px; border-radius: 99px; background: var(--tint-soft); color: var(--tint-press); font-size: 14px; font-weight: 600; text-decoration: none; }
.print-link .i { width: 15px; height: 15px; vertical-align: 0; }
@media (prefers-color-scheme: dark) { .print-link { color: #8cc4ff; } }
/* ostatnie decyzje na telefonie: akcje pod wnioskiem */
@media (max-width: 640px) {
  .list-recent, .list-recent tbody { display: block; }
  .list-recent tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; }
  .list-recent td { display: block; padding: 0 12px; border: 0; }
  .list-recent td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .list-recent td.actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; text-align: left; padding-top: 6px; }
  .list-recent td.actions:empty { display: none; }
  .list-recent td.actions > a, .list-recent td.actions > form { margin: 0; }
  .list-recent tr + tr { border-top: .5px solid var(--ios-sep); }
}

.ev-tags .i { width: 14px; height: 14px; vertical-align: -2px; }

.cell-wrap:has(.settle-act) { flex-wrap: wrap; }
.settle-act { flex: 1 0 100%; margin: 10px 0 0; }
.settle-act .btn { width: 100%; min-height: 40px; font-size: 15px; }
