:root {
  --navy: var(--color-bg-footer); --accent: var(--color-primary); --accent-txt: var(--color-primary-text); --red: var(--color-accent-red);
  --bg: var(--color-bg-secondary); --surface: var(--color-bg-primary); --text: var(--color-text-primary); --text2: var(--color-text-secondary); --muted: var(--color-text-tertiary);
  --border: var(--color-border-default); --border-ctl: var(--color-border-strong); --grid: var(--color-bg-tertiary);
  --free: var(--slot-available-bg); --free-fg: var(--slot-available); --hold: var(--color-bg-tertiary); --hold-fg: var(--color-text-secondary);
  --pend: var(--slot-limited-bg); --pend-fg: var(--color-warning-text); --busy: var(--color-primary); --busy-fg: var(--color-text-on-primary);
  --off: var(--slot-unavailable-bg); --off-fg: var(--color-text-secondary); --dzien-wolny: var(--color-bg-secondary); --swieto: var(--color-warning-text);
  --good: var(--color-success); --warn: var(--color-warning-text); --crit: var(--color-danger); --odwr: var(--color-bg-primary);
  --pri-fg: var(--color-text-on-primary); --hm1: var(--color-info-bg); --hm1-fg: var(--color-text-primary); --hm2: var(--color-primary-light); --hm2-fg: var(--color-bg-primary);
  --radius: 6px; --shadow: 0 6px 24px var(--overlay);
  --bar-h: 0px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.up { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.up button, .up input, .up select, .up textarea { font: inherit; color: inherit; }
.up h1, .up h2, .up h3 { margin: 0 0 8px; font-weight: 600; }
.up h1 { font-size: 1.5rem; } .up h2 { font-size: 1.15rem; } .up h3 { font-size: .95rem; }
.up a { color: var(--accent-txt); }
.up :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.up [hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 1100; }
.skip:focus { left: 8px; top: 8px; }
.btn { background: var(--surface); border: 1px solid var(--border-ctl); border-radius: var(--radius); padding: 8px 12px; cursor: pointer; min-height: 40px; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--accent); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--pri-fg); }
.up a.btn { color: var(--text); }
.up a.btn.pri { color: var(--pri-fg); }
.btn.danger { border-color: var(--crit); color: var(--crit); }
.btn.sm { min-height: 34px; padding: 4px 10px; font-size: .88rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn[aria-pressed="true"] { background: var(--accent); color: var(--pri-fg); border-color: var(--accent); }
.app { display: grid; grid-template-columns: 210px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; padding-bottom: var(--bar-h); }
.apphead { grid-column: 1 / 3; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); border-top: 3px solid var(--red); }
.apphead .name { font-weight: 600; }
.apphead .sp { flex: 1; }
.apphead .last, .apphead .kto { font-size: .82rem; color: var(--text2); }
.apphead form { margin: 0; }
.theme-toggle { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; color: var(--text); }
.theme-toggle[hidden] { display: none; }
.theme-toggle .theme-icon { display: none; }
:root:not([data-theme]) .theme-toggle .theme-icon-system, :root[data-theme="light"] .theme-toggle .theme-icon-light, :root[data-theme="dark"] .theme-toggle .theme-icon-dark { display: block; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 12px 8px; display: flex; flex-direction: column; gap: 4px; }
.nav { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: transparent; border: 0; border-radius: var(--radius); padding: 10px 12px; cursor: pointer; min-height: 44px; text-decoration: none; }
.up a.nav { color: var(--text); }
.nav:hover { background: var(--grid); }
.nav[aria-current="page"] { background: var(--grid); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.nav .ico { width: 20px; text-align: center; }
.badge { margin-left: auto; background: var(--crit); color: var(--odwr); border-radius: 999px; font-size: .74rem; font-weight: 700; min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.badge.soft { background: var(--accent); color: var(--pri-fg); }
.up main { padding: 16px; min-width: 0; }
.split > *, .inbox > * { min-width: 0; }
.panel { background: var(--surface); min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.panel + .panel { margin-top: 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.sp { justify-content: space-between; }
.muted { color: var(--text2); font-size: .86rem; }
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.tile { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
.tile .lbl { font-size: .78rem; color: var(--text2); }
.tile .val { font-size: 1.6rem; font-weight: 600; }
.alert { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--warn); background: var(--pend); color: var(--pend-fg); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; }
.up .alert a { color: inherit; font-weight: 600; }
.alert.ok { border-color: var(--good); background: var(--free); color: var(--free-fg); }
.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 9px; font-size: .78rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.st-wolny { background: var(--free); color: var(--free-fg); }
.st-tymczasowy { background: var(--hold); color: var(--hold-fg); border-color: var(--hold-fg); }
.st-oczekuje { background: var(--pend); color: var(--pend-fg); }
.st-zajety { background: var(--busy); color: var(--busy-fg); }
.st-niedostepny { background: var(--off); color: var(--off-fg); text-decoration: line-through; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.up table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.up th, .up td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.up th { font-size: .78rem; color: var(--text2); font-weight: 600; }
.scrollx { overflow-x: auto; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; touch-action: pan-y; }
.cal .dh { background: transparent; border: 0; font-weight: 600; font-size: .8rem; color: var(--text2); padding: 6px 0; cursor: pointer; border-radius: 4px; min-height: 34px; }
.cal .dh:hover { background: var(--grid); }
.day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-height: 76px; padding: 4px 5px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; position: relative; }
.day:hover { border-color: var(--accent); }
.day.past { opacity: .55; cursor: not-allowed; }
.day.empty { visibility: hidden; }
.day.sel { box-shadow: inset 0 0 0 3px var(--accent); background: var(--grid); }
.day.open { border-color: var(--accent); border-width: 2px; }
.day .chg { position: absolute; right: 3px; top: 3px; font-size: .62rem; font-weight: 700; background: var(--warn); color: var(--odwr); border-radius: 3px; padding: 0 4px; }
.day .n { font-weight: 600; font-size: .85rem; }
.day .c { font-size: .68rem; color: var(--text2); line-height: 1.25; }
.day .seg { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--grid); margin-top: auto; }
.seg i { display: block; height: 100%; }
.seg .s1 { background: var(--good); } .seg .s2 { background: var(--warn); } .seg .s3 { background: var(--busy); } .seg .s4 { background: var(--off-fg); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.sel-tb { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; background: var(--grid); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; margin: 10px 0; }
.field { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.field label, .lbl2 { font-size: .82rem; font-weight: 600; }
.field input, .field select, .field textarea, .inp { border: 1px solid var(--border-ctl); background: var(--surface); border-radius: var(--radius); padding: 8px; min-height: 40px; }
.field textarea { min-height: 80px; resize: vertical; }
.field input[disabled], .field select[disabled] { opacity: .6; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.cc { border: 1px solid var(--border-ctl); background: var(--surface); border-radius: 999px; padding: 4px 10px; cursor: pointer; min-height: 34px; }
.cc[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--pri-fg); }
.step { border-left: 3px solid var(--accent); padding-left: 12px; margin: 12px 0; }
.step h3 span { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--pri-fg); align-items: center; justify-content: center; font-size: .78rem; margin-right: 6px; }
.prev { background: var(--grid); border-radius: var(--radius); padding: 10px 12px; font-size: .92rem; }
.prev.bad { border: 1px solid var(--crit); }
.prev ul { margin: 6px 0 0; padding-left: 18px; }
.hm { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.hm h3 { font-size: .85rem; margin: 0 0 4px; text-transform: capitalize; }
.mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini a, .mini span { aspect-ratio: 1; border: 0; border-radius: 3px; font-size: .62rem; display: flex; align-items: center; justify-content: center; padding: 0; background: var(--grid); color: var(--text2); text-decoration: none; }
.mini .pusty { background: transparent; }
.up .mini .l1 { background: var(--hm1); color: var(--hm1-fg); font-weight: 600; }
.up .mini .l2 { background: var(--hm2); color: var(--hm2-fg); font-weight: 600; }
.up .mini .l3 { background: var(--busy); color: var(--busy-fg); font-weight: 700; }
.mini .l0 { background: var(--grid); }
.savebar { position: fixed; right: 24px; bottom: 24px; z-index: 800; display: flex; gap: 8px; align-items: center; background: var(--accent); color: var(--pri-fg); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.savebar .cnt { font-weight: 600; padding: 0 6px; }
.savebar .btn { border-color: var(--footer-rule); background: transparent; color: var(--pri-fg); }
.savebar .btn.pri { background: var(--surface); color: var(--accent-txt); border-color: var(--surface); font-weight: 700; }
.savebar.done { background: var(--good); color: var(--odwr); }
.toasts { position: fixed; left: 226px; bottom: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 242px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); background: var(--surface); color: var(--text); border: 1px solid var(--border-ctl); border-left: 6px solid var(--good); }
.toast.err { background: var(--color-danger-bg); border-left-color: var(--crit); }
.toast.info { border-left-color: var(--color-info); }
.toast .tx { flex: 1; min-width: 0; }
.toast .x { margin-left: auto; background: transparent; border: 0; color: inherit; cursor: pointer; font-size: 1.1rem; min-width: 32px; min-height: 32px; }
.toast .ta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.toast .ta button, .toast .ta a { background: transparent; border: 1px solid var(--border-ctl); color: inherit; border-radius: var(--radius); padding: 2px 8px; cursor: pointer; min-height: 32px; text-decoration: none; display: inline-flex; align-items: center; }
.toast ul { margin: 6px 0 0; padding-left: 18px; font-size: .86rem; }
.modalbg { position: fixed; inset: 0; background: var(--overlay); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 12px; }
.modal { background: var(--surface); border-radius: 10px; padding: 18px; max-width: 520px; width: 100%; max-height: 90%; overflow: auto; box-shadow: var(--shadow); }
.modal ul { padding-left: 18px; }
.hint { font-size: .8rem; color: var(--text2); }
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); padding-bottom: calc(68px + var(--bar-h) + env(safe-area-inset-bottom, 0px)); }
  .apphead { grid-column: 1; }
  .apphead .kto { display: none; }
  .zgl-btn .zgl-nap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 750; flex-direction: row; border-right: 0; border-top: 1px solid var(--border); padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); gap: 2px; justify-content: space-around; }
  .nav { flex-direction: column; gap: 0; font-size: .68rem; padding: 4px 2px; justify-content: center; min-height: 52px; position: relative; text-align: center; }
  .nav .badge { position: absolute; top: 0; right: 4px; margin: 0; }
  .nav[aria-current="page"], .wiecej-btn.akt { box-shadow: inset 0 3px 0 var(--accent); }
  .side .wiecej-btn { display: flex; color: var(--text); font-family: inherit; font-size: .68rem; flex: 1; }
  .side .wiecej { display: none; position: absolute; right: 4px; bottom: 100%; margin-bottom: 6px; flex-direction: column; gap: 2px; min-width: 190px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
  .side .wiecej.otw { display: flex; }
  .wiecej .nav { flex-direction: row; gap: 8px; font-size: .9rem; justify-content: flex-start; min-height: 44px; padding: 10px 12px; text-align: left; }
  .wiecej .nav[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); }
  .side > .nav { flex: 1; }
  .savebar { left: 8px; right: 8px; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); max-width: none; justify-content: space-between; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .toasts { left: 10px; right: 10px; width: auto; bottom: calc(136px + env(safe-area-inset-bottom, 0px)); }
  .day { min-height: 58px; }
  .day .c { display: none; }
  .day .chg { position: static; align-self: flex-start; font-size: .56rem; }
  .up main { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (forced-colors: active) {
  .day.sel { outline: 3px solid Highlight; }
  .chip, .badge, .day .chg { border: 1px solid CanvasText; }
}
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.up a.cc { text-decoration: none; color: var(--text); display: inline-flex; align-items: center; }
.up a.cc[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--pri-fg); }
.sk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 14px; align-items: start; margin-top: 12px; }
.sk .panel + .panel { margin-top: 0; }
.sk-lista ul, .sk-rozmowa, .sk-prop { list-style: none; margin: 0; padding: 0; }
.sk-lista li + li { border-top: 1px solid var(--border); }
.up a.sk-poz { display: grid; gap: 3px; padding: 10px 8px; text-decoration: none; color: var(--text); min-height: 44px; }
.sk-poz:hover, .sk-poz[aria-current="true"] { background: var(--grid); }
.sk-poz[aria-current="true"] { box-shadow: inset 3px 0 0 var(--accent); }
.sk-kto { font-weight: 600; overflow-wrap: anywhere; }
.sk-nowe { color: var(--crit); margin-right: 4px; }
.sk-co { font-size: .9rem; }
.sk-kiedy { font-size: .78rem; margin-left: auto; }
.sk-48 { border-color: var(--warn); background: var(--pend); color: var(--pend-fg); }
.st-w-nowy { background: var(--pend); color: var(--pend-fg); }
.st-w-potwierdzony { background: var(--free); color: var(--free-fg); }
.sk-wroc { display: none; margin: 0 0 8px; }
.sk-kontakt { overflow-wrap: anywhere; }
.sk-rozmowa { display: grid; gap: 8px; margin-bottom: 12px; }
.sk-zd { text-align: center; font-size: .82rem; color: var(--muted); }
.sk-wiad { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; max-width: 92%; overflow-wrap: anywhere; }
.sk-wiad.is-urzad { justify-self: end; background: var(--grid); }
.sk-autor { margin: 0 0 2px; font-size: .82rem; }
.sk-tresc { margin: 0; white-space: pre-wrap; }
.sk-notatka { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
@media (max-width: 900px) {
  .sk { grid-template-columns: minmax(0, 1fr); }
  .sk.sk-otwarty .sk-lista { display: none; }
  .sk:not(.sk-otwarty) .sk-watek { display: none; }
  .sk-wroc { display: block; }
}
.sk-typ { border-top: 1px solid var(--border); padding: 10px 0 0; }
.sk-typ:first-of-type { border-top: 0; }
.dzw { position: relative; }
.dzw-btn { position: relative; min-width: 44px; min-height: 40px; }
.dzw-btn .badge { position: absolute; top: -6px; right: -6px; margin: 0; }
.dzw-lista { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: min(340px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; box-shadow: var(--shadow); }
.dzw-lista ul { list-style: none; margin: 0; padding: 0; }
.dzw-lista li + li { border-top: 1px solid var(--border); }
.up .dzw-lista a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 8px; text-decoration: none; color: var(--text); min-height: 44px; }
.dzw-lista a:hover { background: var(--grid); }
.dzw-lista a strong { grid-column: 1; }
.dzw-lista a span { grid-column: 1; font-size: .85rem; color: var(--text2); overflow-wrap: anywhere; }
.dzw-lista a time { grid-column: 2; grid-row: 1; font-size: .78rem; color: var(--muted); }
.dzw-lista .muted { margin: 8px; }
.sk-radio { border: 0; padding: 0; margin: 0 0 8px; }
.sk-radio label { min-height: 34px; }
.sk-szablony { list-style: none; margin: 0 0 12px; padding: 0; }
.sk-szablony li { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sk-szablony details { min-width: 0; flex: 1; }
.sk-szablony summary { cursor: pointer; font-weight: 600; min-height: 34px; }
.ferr { color: var(--crit); font-size: .84rem; margin: 2px 0 0; }
.field input[aria-invalid="true"], .inp[aria-invalid="true"] { border-color: var(--crit); }
@media (min-width: 821px) and (max-width: 1180px) { .toasts { bottom: 92px; } }
.row > .ferr { flex-basis: 100%; }
@media (max-width: 820px) { body:has(.modalbg) .toasts { bottom: auto; top: 8px; } }
.cal .dh.wk { text-decoration: underline dotted; text-underline-offset: 4px; color: var(--text); }
.day.wk { background: var(--dzien-wolny); }
.day.sw { border-style: dashed; border-color: var(--swieto); border-width: 2px; }
.day.sel.wk { background: var(--grid); }
.day .zn, .swd span, .lg-sw span { color: var(--swieto); }
.day .sn { font-size: .62rem; line-height: 1.15; color: var(--text2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lg-wk { background: var(--dzien-wolny); border-color: var(--border); }
.lg-sw { border-style: dashed; border-color: var(--swieto); }
.swd { margin: 6px 0; font-weight: 600; }
@media (max-width: 820px) { .day .sn { display: none; } }
.up a.tile { text-decoration: none; color: var(--text); display: block; }
a.tile:hover { border-color: var(--accent); }
.reakcje { list-style: none; margin: 0; padding: 0; }
.reakcje li + li { border-top: 1px solid var(--border); }
.up .reakcje a { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 10px 4px; text-decoration: none; color: var(--text); min-height: 44px; }
.reakcje a:hover { background: var(--grid); }
.reakcje a span { color: var(--text2); overflow-wrap: anywhere; }
.pg-znak { background: var(--pend); color: var(--pend-fg); margin-left: 8px; }
.tile { border-left-width: 4px; }
.tile .sub { font-size: .74rem; color: var(--text2); }
.tile .lbl span { margin-right: 2px; }
.tile.t-pend { border-left-color: var(--warn); }
.tile.t-pend .lbl span { color: var(--warn); }
.tile.t-busy { border-left-color: var(--busy); }
.tile.t-free { border-left-color: var(--good); }
.tile.t-free .val, .tile.t-free .lbl span { color: var(--good); }
.tile.t-obl { border-left-color: var(--accent); }
.tile .pasek { height: 8px; border-radius: 4px; background: var(--free); overflow: hidden; margin: 4px 0; }
.tile .pasek i { display: block; height: 100%; background: var(--busy); }
.up .mini a { position: relative; aspect-ratio: 1; border-radius: 3px; font-size: .62rem; display: flex; align-items: center; justify-content: center; text-decoration: none; background: var(--grid); color: var(--text2); border: 1px solid transparent; font-weight: 400; }
.up .mini a:hover, .up .mini a:focus-visible { border-color: var(--accent); z-index: 1; }
.up .mini a.s-wolne { background: var(--free); color: var(--free-fg); }
.up .mini a.s-czesc { background: var(--hm1); color: var(--hm1-fg); font-weight: 600; box-shadow: inset 0 -3px 0 var(--good); }
.up .mini a.s-pelny { background: var(--busy); color: var(--busy-fg); font-weight: 700; }
.up .mini a.wk.s-pusty { background: var(--dzien-wolny); }
.up .mini a.sw { border: 1px dashed var(--swieto); }
.up .mini a.dzis { outline: 2px solid var(--accent); outline-offset: 1px; }
.up .mini a.past { opacity: .55; }
.mini a b { position: absolute; top: 0; right: 2px; font-size: .5rem; font-weight: 700; }
.hm-suma { margin: 4px 0 0; font-size: .74rem; color: var(--text2); }
.hm-suma .w { color: var(--good); }
.chip.hm-wolne { background: var(--free); color: var(--free-fg); }
.chip.hm-czesc { background: var(--hm1); color: var(--hm1-fg); box-shadow: inset 0 -3px 0 var(--good); }
.chip.hm-pelny { background: var(--busy); color: var(--busy-fg); }
.chip.hm-pusty { background: var(--grid); color: var(--text2); }
.chip.hm-dzis { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--surface); color: var(--text); }
section[aria-labelledby="dp-h"] table { display: block; width: 100%; }
section[aria-labelledby="dp-h"] thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
section[aria-labelledby="dp-h"] tbody { display: block; }
section[aria-labelledby="dp-h"] tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
section[aria-labelledby="dp-h"] td { display: block; padding: 0; border: 0; min-width: 0; }
section[aria-labelledby="dp-h"] td:nth-child(1) { font-size: 1.05rem; }
section[aria-labelledby="dp-h"] td:nth-child(3) { grid-column: 1 / -1; font-size: .86rem; color: var(--text2); }
section[aria-labelledby="dp-h"] td:nth-child(3) .hint { display: inline; margin-left: 6px; }
section[aria-labelledby="dp-h"] td:nth-child(4) { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
section[aria-labelledby="dp-h"] td:nth-child(4):empty { display: none; }
.wiecej-btn { display: none; }
.wiecej { display: contents; }
.stat .st { --accent: var(--color-primary); }
.stat .st .panel { margin-bottom: 14px; }
.stat .st .rowbtns { margin: 0 0 12px; }
.stat .st .chip { text-decoration: none; }
.stat .st .tile { border-left-width: 4px; background: var(--surface); }
.stat .st .tile .val { font-size: 1.6rem; }
.stat .st .tile.t-crit { border-left-color: var(--crit); }
.stat .st .tile.t-mut { border-left-color: var(--text2); }
.stat .st .tile.t-obl { border-left-color: var(--accent); }
.stat .st .tile.t-free { border-left-color: var(--good); }
.stat .st .tile.t-busy { border-left-color: var(--busy); }
.stat .st .tile.t-pend { border-left-color: var(--warn); }
.stat .st .tile .val.txt { font-size: 1rem; font-weight: 600; line-height: 1.35; margin-top: 6px; }
.stat .st .legend i { height: 10px; border-radius: 2px; }
.stat .st h2 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.stat .st h3 { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.stat .st .empty { margin-top: 12px; }
.zgl-btn { min-width: 44px; min-height: 40px; gap: 6px; }
.zgl .lead { color: var(--text2); font-size: .88rem; margin: 0 0 12px; }
.zgl .field textarea { min-height: 130px; }
.zgl .licz { font-size: .76rem; color: var(--text2); text-align: right; }
.zgl .hint { font-size: .78rem; color: var(--text2); }
.zgl .err { color: var(--crit); font-size: .82rem; font-weight: 600; min-height: 1.2em; }
.zgl .radia { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.zgl .radia label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 400; font-size: .9rem; }
.zgl fieldset { border: 0; padding: 0; margin: 0 0 10px; min-width: 0; }
.zgl legend { font-size: .82rem; font-weight: 600; padding: 0; }
.zgl .odp { font-size: .84rem; color: var(--text2); overflow-wrap: anywhere; }
.zgl .pulapka { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.zgl-ok { text-align: center; }
.zgl-ok .znak { font-size: 2rem; color: var(--good); }
.zgl-st { border-color: var(--border-ctl); background: var(--surface); color: var(--text); }
.zgl-st.s-w_realizacji { background: var(--pend); color: var(--pend-fg); border-color: transparent; }
.zgl-st.s-zrobione { background: var(--free); color: var(--free-fg); border-color: transparent; }
.zgl-st.s-nie_robimy { background: var(--grid); color: var(--text2); border-color: transparent; }
.zgl-tab td { vertical-align: top; overflow-wrap: anywhere; }
.zgl-tab details summary { cursor: pointer; color: var(--accent-txt); font-size: .82rem; min-height: 32px; }
.zgl-tab .kom { font-size: .82rem; color: var(--text2); margin: 4px 0 0; }

.modal:has(.zgl) #macts { position: sticky; bottom: -18px; background: var(--surface); padding: 10px 0 18px; margin-bottom: -18px; }
.stat .st .sample { background: var(--pend); color: var(--pend-fg); }
.stat .st .chip[aria-current="true"], .stat .st .chip[aria-pressed="true"] { color: var(--accent-txt); }
.sk-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.up .sk-head h2 { margin: 0; overflow-wrap: anywhere; }
.sk-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); gap: 6px 16px; margin: 0 0 12px; font-size: .92rem; }
.sk-kv dt { color: var(--text2); }
.sk-kv dd { margin: 0; overflow-wrap: anywhere; }
.sk-kv .wide { grid-column: 2 / 5; }
.sk-kv .nl { grid-column: 1; }
.sk-rzad { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sk-rzad .btn { min-height: 44px; padding: 8px 16px; font-weight: 600; }
.sk-dec { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; }
.up .sk-dec h3 { margin: 0 0 8px; font-size: .86rem; color: var(--text2); }
.sk-propbox { border: 1px dashed var(--border-ctl); background: var(--grid); border-radius: var(--radius); padding: 12px; margin: 10px 0; }
.sk-propbox ol { margin: 6px 0 0; padding-left: 20px; }
.sk-propbox p { margin: 8px 0 0; }
.sk-odp .field textarea { min-height: 84px; }
.modal.sk-okno { max-width: 940px; max-height: 94vh; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.sk-mh { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 18px 22px 10px; }
.up .sk-mh h2 { margin: 0; font-size: 1.25rem; }
.sk-mh p { margin: 2px 0 0; color: var(--text2); font-size: .92rem; }
.sk-mx { background: transparent; border: 0; color: var(--text2); font-size: 1.5rem; line-height: 1; cursor: pointer; min-width: 44px; min-height: 44px; border-radius: var(--radius); }
.sk-mx:hover { background: var(--grid); }
.sk-mb { padding: 6px 22px 14px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.sk-mf { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 12px 22px; border-top: 1px solid var(--border); background: var(--surface); flex: 0 0 auto; }
.sk-mf .info { color: var(--text2); font-size: .88rem; flex: 1 1 240px; }
.sk-mf .bt { display: flex; gap: 10px; flex-wrap: wrap; }
.sk-mf .btn, .up .sk-nav .btn.sm { min-height: 44px; min-width: 44px; justify-content: center; font-weight: 600; }
.sk-pick { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; }
.sk-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sk-nav strong { font-size: 1rem; text-transform: capitalize; }
.sk-cal .dh { cursor: default; text-align: center; }
.sk-cal .dh:hover { background: transparent; }
.day.skd { min-height: 56px; justify-content: space-between; color: var(--text); font: inherit; }
.day.skd .c { display: block; font-size: .72rem; }
.day.skd[disabled] { opacity: .45; cursor: not-allowed; }
.day.skd[disabled]:hover { border-color: var(--border); }
.day.skd.req { box-shadow: inset 0 0 0 2px var(--warn); }
.day.skd.cur { background: var(--accent); border-color: var(--accent); border-style: solid; color: var(--pri-fg); }
.day.skd.cur .c, .day.skd.cur .zn { color: var(--pri-fg); }
.skd .pk, .lg-pk .pk { background: var(--free); color: var(--free-fg); border: 1px solid var(--free-fg); border-radius: 999px; font-size: .68rem; font-weight: 800; min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.skd .pk { position: absolute; right: 4px; top: 4px; }
.sk-leg .chip { border-color: var(--border); color: var(--text2); font-weight: 400; white-space: normal; }
.sk-leg .lg-req { box-shadow: inset 0 0 0 1px var(--warn); }
.sk-leg .lg-off { opacity: .7; }
.up .sk-bok h3 { margin: 0 0 2px; font-size: 1rem; }
.sk-bok .zn { color: var(--swieto); }
.sk-bok > .muted { margin: 0; }
.sk-sale { margin: 8px 0 0; }
.sk-sale .cc { min-height: 44px; padding: 4px 14px; color: var(--text); }
.sk-sale .cc[aria-pressed="true"] { color: var(--pri-fg); }
.sk-sloty { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.sk-sloty.duzo { max-height: 420px; overflow: auto; padding: 2px; }
.sk-s { min-height: 44px; border: 1px solid var(--border-ctl); background: var(--surface); color: var(--text); border-radius: var(--radius); font-weight: 600; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; padding: 2px 6px; }
.sk-s small { font-weight: 400; color: var(--text2); font-size: .72rem; overflow-wrap: anywhere; text-align: center; }
.sk-s:hover:not([disabled]) { border-color: var(--accent); }
.sk-s[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--pri-fg); }
.sk-s[aria-pressed="true"] small { color: var(--pri-fg); }
.sk-s[disabled] { opacity: .45; cursor: not-allowed; }
.sk-wybrane { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--grid); }
.sk-wybrane h4 { margin: 0 0 6px; font-size: .88rem; }
.sk-wybrane ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.sk-wybrane li { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.sk-wybrane p { margin: 0; }
.sk-rm { min-width: 44px; min-height: 44px; background: var(--surface); border: 1px solid var(--border-ctl); border-radius: var(--radius); color: var(--text2); cursor: pointer; }
.sk-maks { margin: 6px 0 0; }
.sk-msg { margin: 14px 0 0; }
.sk-msg textarea { min-height: 64px; }
.sk-err { color: var(--crit); font-size: .9rem; font-weight: 600; padding: 8px 22px; border-top: 1px solid var(--border); flex: 0 0 auto; }
.sk-err:empty { display: none; }
@media (max-width: 760px) {
  .sk-kv { grid-template-columns: max-content minmax(0, 1fr); }
  .sk-kv .wide { grid-column: 2; }
  .sk-rzad .btn { flex: 1 1 100%; justify-content: center; }
  .modalbg.sk-bg { padding: 0; }
  .modal.sk-okno { max-width: none; height: 100%; max-height: none; border-radius: 0; }
  .sk-pick { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .day.skd { min-height: 50px; }
  .day.skd .c { display: none; }
  .sk-mh, .sk-mb, .sk-mf, .sk-err { padding-left: 14px; padding-right: 14px; }
  .sk-mf .bt { width: 100%; }
  .sk-mf .bt .btn { flex: 1; }
  .sk-sloty.duzo { max-height: none; overflow: visible; }
}
@media (forced-colors: active) {
  .day.skd.cur, .sk-s[aria-pressed="true"] { outline: 3px solid Highlight; }
  .day.skd.req { outline: 2px dashed CanvasText; outline-offset: -4px; }
}
.zgl-ret { font-size: .78rem; margin-top: -4px; }
.sk-rej-wiersz { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.up .sk-rej-wiersz .btn.sm { min-height: 36px; }
.sk-rej-licz { font-size: .78rem; color: var(--text2); text-align: right; }
.sk-rej-jez { margin: 2px 0 0; }
.sk-rej-znak { margin: 4px 0 0; font-size: .88rem; font-weight: 600; color: var(--text); }
.sk-rej-pyt { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--warn); background: var(--pend); color: var(--pend-fg); border-radius: var(--radius); font-size: .9rem; }
.up .sk-rej-pyt .btn.sm { min-height: 36px; color: var(--text); }
.sk-rej-stan { margin: 0; font-size: .88rem; color: var(--text2); min-height: 1.2em; }
