@font-face { font-family: 'Inter'; src: url('/fonts/Inter.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Cinzel'; src: url('/fonts/Cinzel.ttf') format('truetype'); font-weight: 400 900; font-display: swap; }

:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000; --bg2: #0b0b0c; --card: #111113; --card2: #17171a; --line: rgba(212,175,55,.16); --line2: rgba(255,255,255,.07);
  --gold: #D4AF37; --gold-l: #F3DC8A; --gold-d: #9E7A22; --gold-t: #D4AF37;
  --gold-grad: linear-gradient(135deg, #FFF1B8 0%, #E9C766 30%, #D4AF37 55%, #A8842A 80%, #E7C96A 100%);
  --gold-text-grad: var(--gold-grad);
  --text: #F2EEE3; --muted: #9A958A; --muted2: #858075;
  --green: #22C55E; --green-d: rgba(34,197,94,.14); --red: #EF4444; --red-d: rgba(239,68,68,.14); --orange: #F97316; --yellow: #FACC15;
  --green-t: #22C55E; --red-t: #EF4444; --warn-t: #FACC15;
  --eff0: #22C55E; --eff1: #A3D63B; --eff2: #FACC15; --eff3: #F97316; --eff4: #EF4444;
  --surface: #0d0d0f; --surface2: #141417; --btn-dark: #1b1b1f; --border: #2a2a2e; --border2: #232327; --box-border: #4a4a50;
  --topbar-bg: linear-gradient(to bottom, rgba(0,0,0,.96), rgba(0,0,0,.86)); --nav-bg: rgba(8,8,9,.94); --room-head-bg: rgba(0,0,0,.95);
  --overlay: rgba(0,0,0,.72); --shadow: 0 10px 30px rgba(0,0,0,.6);
  --chip-bg: #17171a; --chip-present-t: #bbf7d0; --chip-leave-t: #bfdbfe;
  --pen-nm: #cfcabd; --pen-am: #c25b5b; --pen-on-nm: #fff; --pen-on-am: #fca5a5; --pres-on-t: #bbf7d0; --ck-bg: #26262a;
  --bubble: #1a1a1d; --bubble-border: #242428; --react-bg: #1d1d20; --react-border: #2c2c31; --composer-bg: #070708;
  --tick: #55555c; --slider-mask: rgba(12,12,14,.72); --effort-bg: #0b0b0d; --kpi-bg: #0c0c0e; --bar-bg: #1d1d20;
  --st-pending-t: #fde68a; --st-ok-t: #86efac; --st-bad-t: #fca5a5; --ann-p: #e9e3d0; --eom-bg: #0d0c09; --auth-bg: #000;
  --pin-bg: #101012; --pin-active: #1c1a12; --dot-off: #3a3a3a; --dot-ring: #111; --hover: #0f0f11; --daysep-bg: #121214;
  --radius: 16px; --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
/* ---------- Styl dzienny ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #faf7f0; --bg2: #f3eee2; --card: #ffffff; --card2: #ffffff; --line: rgba(168,132,31,.30); --line2: rgba(40,32,10,.10);
  --gold: #a8841f; --gold-l: #7d5f12; --gold-d: #a8841f; --gold-t: #7d5f12;
  --gold-grad: linear-gradient(135deg, #F7E3A1 0%, #E6C45E 35%, #D4AF37 60%, #C49A2C 100%);
  --gold-text-grad: linear-gradient(135deg, #8a6a14 0%, #a8841f 50%, #7a5c10 100%);
  --text: #1c1a16; --muted: #625c50; --muted2: #6e685c;
  --green-t: #15803d; --red-t: #c62828; --warn-t: #854d0e;
  --eff0: #15803d; --eff1: #4d7c0f; --eff2: #a16207; --eff3: #c2410c; --eff4: #b91c1c;
  --surface: #f7f3ea; --surface2: #ffffff; --btn-dark: #ffffff; --border: #ddd5c3; --border2: #e4ddcd; --box-border: #a39b8a;
  --topbar-bg: linear-gradient(to bottom, rgba(250,247,240,.97), rgba(250,247,240,.9)); --nav-bg: rgba(255,255,255,.96); --room-head-bg: rgba(255,255,255,.97);
  --overlay: rgba(28,26,22,.45); --shadow: 0 10px 30px rgba(60,45,10,.15);
  --chip-bg: #f3eee2; --chip-present-t: #166534; --chip-leave-t: #1e40af;
  --pen-nm: #3a362e; --pen-am: #b42318; --pen-on-nm: #7f1d1d; --pen-on-am: #b42318; --pres-on-t: #166534; --ck-bg: #e7e1d3;
  --bubble: #ffffff; --bubble-border: #e4ddcd; --react-bg: #ffffff; --react-border: #e4ddcd; --composer-bg: #ffffff;
  --tick: #b3ab99; --slider-mask: rgba(247,243,234,.74); --effort-bg: #fbf9f4; --kpi-bg: #faf7f0; --bar-bg: #ece6d8;
  --st-pending-t: #854d0e; --st-ok-t: #166534; --st-bad-t: #991b1b; --ann-p: #3a362e; --eom-bg: #fffaf0; --auth-bg: #faf7f0;
  --pin-bg: #ffffff; --pin-active: #f6ecd0; --dot-off: #c9c2b2; --dot-ring: #fff; --hover: #f7f3ea; --daysep-bg: #ffffff;
}
:root[data-theme="light"] .card { box-shadow: 0 1px 2px rgba(60,45,10,.06), 0 4px 14px rgba(60,45,10,.05); }
:root[data-theme="light"] .auth { background: radial-gradient(120% 60% at 50% 0%, rgba(212,175,55,.16), transparent 60%), var(--auth-bg); }
:root[data-theme="light"] .pen.on { background: #fdecec; border-color: rgba(220,38,38,.45); }
:root[data-theme="light"] .chip.present { background: #e8f7ee; border-color: rgba(21,128,61,.3); }
:root[data-theme="light"] .pres.on { background: #e8f7ee; border-color: rgba(21,128,61,.35); }
:root[data-theme="light"] .chip.leave { background: #eaf1fe; }
:root[data-theme="light"] .msgs { background: radial-gradient(80% 50% at 50% 0%, rgba(212,175,55,.10), transparent 70%); }
:root[data-theme="light"] .ann-banner { background: linear-gradient(135deg, rgba(212,175,55,.18), rgba(212,175,55,.06)); }
.logo-light { display: none !important; }
:root[data-theme="light"] .logo-light { display: block !important; }
:root[data-theme="light"] .logo-dark { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; transition: background-color .2s; background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, sans-serif; font-size: 15px; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; min-height: 100dvh; }
button, input, textarea, select { font: inherit; color: inherit; }
/* iOS: brak auto-zoomu przy fokusie (min. 16px) */
input, textarea, select, .input { font-size: 16px; }
a { color: var(--gold-l); }
.gold-text { background: var(--gold-text-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cinzel { font-family: 'Cinzel', serif; letter-spacing: .04em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.splash { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.splash img { width: 220px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- layout ---------- */
.shell { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px); padding-left: var(--safe-l); padding-right: var(--safe-r); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) calc(16px + var(--safe-r)) 10px calc(16px + var(--safe-l));
  background: var(--topbar-bg); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar .logo { height: 22px; display: block; }
.topbar .spacer { flex: 1; }
.role-pill { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--gold); color: var(--gold-t); }
.role-pill.worker { border-color: var(--line2); color: var(--muted); }
.content { max-width: 760px; margin: 0 auto; padding: 14px 14px 0; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--nav-bg); backdrop-filter: blur(16px); padding-left: var(--safe-l); padding-right: var(--safe-r); border-top: 1px solid var(--line); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted2); font-size: 10.5px; font-weight: 600; position: relative; }
.bottom-nav a svg { width: 23px; height: 23px; stroke: currentColor; }
.bottom-nav a.active { color: var(--gold-t); }
.bottom-nav a.active::before { content: ''; position: absolute; top: 0; width: 28px; height: 2px; border-radius: 2px; background: var(--gold-grad); }
.nav-badge { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #dc2626; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }

@media (min-width: 900px) {
  .shell { padding-bottom: 20px; padding-left: 230px; }
  .bottom-nav { top: 0; right: auto; width: 230px; height: 100dvh; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 90px 14px 20px; border-top: 0; border-right: 1px solid var(--line); }
  .bottom-nav a { flex: 0; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; font-size: 14px; border-radius: 12px; }
  .bottom-nav a.active { background: rgba(212,175,55,.08); }
  .bottom-nav a.active::before { display: none; }
  .nav-badge { position: static; margin-left: auto; }
  .topbar { padding-left: 24px; }
}

/* ---------- common ---------- */
.card { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card.flat { background: var(--card); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 10px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-t); }
h1.page { font-family: 'Cinzel', serif; font-size: 22px; margin: 6px 2px 12px; font-weight: 700; }
.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; cursor: pointer; transition: transform .08s, filter .2s; }
.btn:active { transform: scale(.97); }
.btn-gold { background: var(--gold-grad); color: #1a1405; box-shadow: 0 6px 24px rgba(212,175,55,.18); }
.btn-dark { background: var(--btn-dark); border: 1px solid var(--line); color: var(--gold-l); }
.btn-green { background: linear-gradient(135deg, #34d57a, #16a34a); color: #03140a; }
.btn-red { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line2); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); display: grid; place-items: center; cursor: pointer; color: var(--gold-l); flex-shrink: 0; }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; letter-spacing: .02em; }
.input { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 13px 14px; outline: none; transition: border-color .2s; }
.input:focus { border-color: var(--gold); }
.input.invalid { border-color: var(--red); }
.err { color: var(--red-t); font-size: 12.5px; margin-top: 6px; font-weight: 600; }
.ok-msg { color: var(--green-t); font-size: 12.5px; margin-top: 6px; font-weight: 600; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13.5px; color: #0b0b0b; flex-shrink: 0; position: relative; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--dot-off); border: 2px solid var(--dot-ring); }
.avatar .dot.on { background: var(--green); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; font-size: 12px; background: var(--chip-bg); border: 1px solid var(--line2); white-space: nowrap; }
.chip.present { background: var(--green-d); border-color: rgba(34,197,94,.35); color: var(--chip-present-t); }
.chip.present::before { content: '✓'; color: var(--green-t); font-weight: 900; }
.chip.leave { background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.35); color: var(--chip-leave-t); }
.badge-gold { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: var(--gold-grad); color: #1a1405; font-size: 11px; font-weight: 800; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }

/* ---------- toasts / modal ---------- */
#toasts { position: fixed; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--card2); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 12px; padding: 11px 14px; box-shadow: var(--shadow); animation: tin .25s ease-out; pointer-events: auto; }
.toast.error { border-left-color: var(--red); }
.toast.penalty { border-left-color: var(--red); }
.toast.effort { border-left-color: var(--green); }
.toast b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.toast span { font-size: 12.5px; color: var(--muted); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }
.modal-back { position: fixed; inset: 0; background: var(--overlay); z-index: 90; display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(4px); }
.modal { width: min(100%, 520px); max-height: 90dvh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); animation: up .22s ease-out; }
@media (min-width: 600px) { .modal-back { align-items: center; } .modal { border-radius: 20px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.modal h3 { margin: 0 0 12px; font-family: 'Cinzel', serif; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.95); z-index: 95; display: grid; place-items: center; }
.lightbox img { max-width: 96vw; max-height: 90dvh; border-radius: 8px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(28px + var(--safe-t)) calc(22px + var(--safe-r)) calc(28px + var(--safe-b)) calc(22px + var(--safe-l));
  background: radial-gradient(120% 60% at 50% 0%, rgba(212,175,55,.13), transparent 60%), var(--auth-bg); }
.auth .logo-big { width: min(78vw, 320px); margin-bottom: 6px; }
.auth .tag { color: var(--muted); font-size: 12.5px; letter-spacing: .28em; text-transform: uppercase; margin-bottom: 28px; }
.auth-box { width: min(100%, 380px); }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 14px 0 18px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--gold-d); }
.pin-dots i.f { background: var(--gold-grad); border-color: var(--gold); box-shadow: 0 0 12px rgba(212,175,55,.5); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.pinpad button { height: 62px; border-radius: 18px; background: var(--pin-bg); border: 1px solid var(--border2); font-size: 24px; font-weight: 600; cursor: pointer; }
.pinpad button:active { background: var(--pin-active); border-color: var(--gold); }
.pinpad button.fn { font-size: 13px; color: var(--muted); }
.bio-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 13px; border-radius: 14px; background: transparent; border: 1px solid var(--gold-d); color: var(--gold-l); font-weight: 700; cursor: pointer; }
.bio-btn svg { width: 24px; height: 24px; stroke: currentColor; }
.auth .switch { margin-top: 18px; text-align: center; color: var(--muted); font-size: 13.5px; }
.auth .switch a { font-weight: 700; cursor: pointer; }
.welcome { text-align: center; margin-bottom: 4px; }
.welcome b { font-size: 18px; }

/* ---------- announcements banner ---------- */
.ann-banner { border: 1px solid var(--gold); background: linear-gradient(135deg, rgba(212,175,55,.16), rgba(212,175,55,.04)); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.ann-banner .t { font-weight: 800; color: var(--gold-l); display: flex; gap: 6px; align-items: center; }
.ann-banner p { margin: 6px 0 10px; font-size: 13.5px; color: var(--ann-p); white-space: pre-wrap; }

/* ---------- calendar ---------- */
.month-nav { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.month-nav h2 { margin: 0; font-family: 'Cinzel', serif; font-size: 20px; text-transform: capitalize; }
.today-card { display: flex; align-items: center; gap: 12px; }
.check-big { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; flex-shrink: 0; border: 2px dashed var(--box-border); background: var(--surface); cursor: pointer; transition: all .2s; }
.check-big svg { width: 32px; height: 32px; stroke: var(--box-border); stroke-width: 3; }
.check-big.on { border: 2px solid var(--green); background: var(--green-d); box-shadow: 0 0 22px rgba(34,197,94,.3); }
.check-big.on svg { stroke: var(--green-t); }
.day-list { display: flex; flex-direction: column; gap: 8px; }
.day-row { display: flex; gap: 12px; padding: 9px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line2); cursor: pointer; text-decoration: none; color: inherit; }
.day-row.today { border-color: var(--gold); box-shadow: inset 0 0 0 1px rgba(212,175,55,.25); }
.day-row.weekend { background: var(--surface); }
.day-row.weekend .d, .day-row.weekend .d span { color: var(--muted); }
.day-row .d { width: 42px; text-align: center; flex-shrink: 0; }
.day-row .d b { display: block; font-size: 19px; font-family: 'Cinzel', serif; }
.day-row .d span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.day-row.today .d b { color: var(--gold-t); }
.day-row .names { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; align-content: center; min-width: 0; }
.day-row .meta { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 4px; font-size: 11.5px; font-weight: 700; }
.mine-check { color: var(--green-t); font-size: 18px; }
.pen-amt { color: var(--red-t); }

/* ---------- day view ---------- */
.day-head { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; }
.day-head h2 { margin: 0; font-size: 18px; font-family: 'Cinzel', serif; text-align: center; flex: 1; line-height: 1.15; }
.day-head h2 small { display: block; font-family: 'Inter'; font-size: 11px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; margin-top: 3px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.stat { background: var(--card); border: 1px solid var(--line2); border-radius: 12px; padding: 8px 10px; }
.stat b { display: block; font-size: 16px; }
.stat span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.present-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.emp { padding: 12px; }
.emp-head { display: flex; align-items: center; gap: 10px; }
.emp-head .n { font-weight: 700; font-size: 15px; }
.emp-head .s { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.pres { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; font-size: 12px; font-weight: 700; border: 1px solid var(--line2); background: var(--surface); color: var(--muted); cursor: default; }
.pres.on { background: var(--green-d); border-color: rgba(34,197,94,.4); color: var(--pres-on-t); }
.pres.on .ck { background: var(--green); color: #03140a; }
.pres .ck { width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; background: var(--ck-bg); font-size: 12px; font-weight: 900; }
.pres.clickable { cursor: pointer; }
.pen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 11px; }
.pen { display: flex; align-items: center; gap: 7px; padding: 7px 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border2); font-size: 11.5px; line-height: 1.2; cursor: default; text-align: left; position: relative; min-height: 40px; }
.pen .box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--box-border); flex-shrink: 0; display: grid; place-items: center; font-size: 12px; font-weight: 900; }
.pen .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pen .nm { color: var(--pen-nm); font-weight: 600; }
.pen .am { color: var(--pen-am); font-weight: 800; white-space: nowrap; font-size: 10.5px; }
.pen.on { background: var(--red-d); border-color: rgba(239,68,68,.55); }
.pen.on .box { background: var(--red); border-color: var(--red); color: #fff; }
.pen.on .nm { color: var(--pen-on-nm); }
.pen.on .am { color: var(--pen-on-am); }
.pen.can { cursor: pointer; }
.pen .ev { position: absolute; top: -6px; right: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface2); border: 1px solid var(--gold-d); display: grid; place-items: center; font-size: 10px; cursor: pointer; }
.pen.wide { grid-column: span 2; }
.effort { margin-top: 12px; padding: 10px 10px 4px; border-radius: 12px; background: var(--effort-bg); border: 1px solid var(--line2); }
.effort-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.effort-top .l { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-t); }
.effort-val { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; color: #0b0b0b; }
.slider-wrap { position: relative; height: 34px; }
.slider-track { position: absolute; left: 12px; right: 12px; top: 12px; height: 10px; border-radius: 6px; background: linear-gradient(90deg, #22C55E 0%, #A3D63B 25%, #FACC15 50%, #F97316 75%, #EF4444 100%); }
.slider-mask { position: absolute; right: 11px; top: 11px; height: 12px; border-radius: 0 6px 6px 0; background: var(--slider-mask); transition: width .15s; }
.slider-ticks { position: absolute; left: 12px; right: 12px; top: 26px; height: 8px; }
.slider-ticks i { position: absolute; width: 2px; height: 7px; background: var(--tick); transform: translateX(-1px); border-radius: 1px; }
.slider-ticks i.hit { background: var(--gold); }
input.range { -webkit-appearance: none; appearance: none; position: absolute; inset: 0; width: 100%; height: 34px; margin: 0; background: transparent; cursor: pointer; }
input.range:disabled { cursor: not-allowed; }
input.range::-webkit-slider-runnable-track { height: 34px; background: transparent; }
input.range::-moz-range-track { height: 34px; background: transparent; }
input.range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: 5px; border-radius: 50%; background: var(--thumb, #22C55E); border: 3px solid #0b0b0b; box-shadow: 0 0 0 2px var(--thumb, #22C55E), 0 0 16px var(--thumb, #22C55E); }
input.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--thumb, #22C55E); border: 3px solid #0b0b0b; box-shadow: 0 0 0 2px var(--thumb, #22C55E); }
.slider-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted2); font-weight: 700; padding: 2px 3px 4px; }
.slider-labels span.hit { color: var(--text); }
.lock { font-size: 10.5px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.emp-foot { display: flex; justify-content: space-between; margin-top: 9px; font-size: 12px; color: var(--muted); }
.emp-foot b.plus { color: var(--green-t); }
.emp-foot b.minus { color: var(--red-t); }

/* ---------- chat ---------- */
.chat-list .item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; text-decoration: none; color: inherit; border: 1px solid transparent; }
.chat-list .item:hover { background: var(--hover); }
.chat-list .item + .item { border-top-color: var(--line2); border-radius: 0; }
.chat-list .t { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.chat-list .t time { font-size: 11px; color: var(--muted); font-weight: 500; }
.chat-list .p { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; justify-content: space-between; gap: 8px; }
.unread { background: var(--gold-grad); color: #111; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; flex-shrink: 0; }
.group-av { background: var(--gold-grad); }
.room { position: fixed; top: var(--vvt, 0px); left: 0; right: 0; height: var(--vvh, 100vh); display: flex; flex-direction: column; background: var(--bg); z-index: 40; padding-left: var(--safe-l); padding-right: var(--safe-r); }
@media (min-width: 900px) { .room { left: 230px; } }
.room-head { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 12px 10px; border-bottom: 1px solid var(--line); background: var(--room-head-bg); }
.room-head .t { font-weight: 700; }
.room-head .s { font-size: 11.5px; color: var(--muted); }
.room-head .s.on { color: var(--green-t); }
.msgs { flex: 1; overflow-y: auto; padding: 14px 12px 6px; display: flex; flex-direction: column; gap: 3px;
  background: radial-gradient(80% 50% at 50% 0%, rgba(212,175,55,.06), transparent 70%); }
.day-sep { align-self: center; font-size: 11px; color: var(--muted); background: var(--daysep-bg); border: 1px solid var(--line2); padding: 3px 10px; border-radius: 999px; margin: 10px 0; }
.msg { display: flex; gap: 8px; max-width: 84%; align-items: flex-end; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar { width: 26px; height: 26px; font-size: 10px; }
.bubble { padding: 8px 11px 6px; border-radius: 16px; background: var(--bubble); border: 1px solid var(--bubble-border); position: relative; word-wrap: break-word; overflow-wrap: anywhere; cursor: pointer; }
.msg.me .bubble { background: linear-gradient(135deg, #F2D985, #D4AF37 60%, #B8922E); color: #17120a; border: 0; border-bottom-right-radius: 5px; }
.msg:not(.me) .bubble { border-bottom-left-radius: 5px; }
.bubble .who { font-size: 11px; font-weight: 800; margin-bottom: 2px; }
.bubble .who { color: var(--uc-d, var(--gold-t)); }
:root[data-theme="light"] .bubble .who { color: var(--uc-l, var(--gold-t)); }
.bubble .txt { white-space: pre-wrap; font-size: 14.5px; line-height: 1.35; }
.bubble .tm { font-size: 10px; opacity: .6; text-align: right; margin-top: 2px; display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.bubble .tm .rd { font-weight: 900; letter-spacing: -2px; }
.msg.me .bubble .tm .rd.seen { color: #065f2a; opacity: 1; }
.bubble img.photo { display: block; max-width: 230px; max-height: 280px; border-radius: 11px; margin: 2px 0 4px; }
.bubble audio { width: 220px; height: 36px; }
.file-chip { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; font-weight: 600; font-size: 13px; }
.reacts { display: flex; gap: 3px; margin-top: -6px; position: relative; z-index: 1; }
.msg.me .reacts { justify-content: flex-end; }
.reacts span { background: var(--react-bg); border: 1px solid var(--react-border); border-radius: 999px; padding: 1px 6px; font-size: 12px; }
.msg-wrap { display: flex; flex-direction: column; }
.msg-wrap.me { align-items: flex-end; }
.seen-by { font-size: 10.5px; color: var(--muted); text-align: right; margin: 2px 4px 4px; }
.typing { font-size: 12px; color: var(--gold-t); padding: 2px 16px 4px; min-height: 20px; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px calc(8px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--composer-bg); }
.composer textarea { flex: 1; resize: none; max-height: 120px; min-height: 42px; background: var(--surface); border: 1px solid var(--border); font-size: 16px; border-radius: 21px; padding: 10px 14px; outline: none; }
.composer textarea:focus { border-color: var(--gold-d); }
.send-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--gold-grad); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.send-btn svg { width: 20px; height: 20px; stroke: #1a1405; }
.send-btn.rec { background: var(--red); animation: pulse 1s infinite; }
.react-bar { position: fixed; z-index: 60; display: flex; gap: 4px; background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px; box-shadow: var(--shadow); }
.react-bar button { background: none; border: 0; font-size: 22px; cursor: pointer; padding: 2px 4px; border-radius: 8px; }
.react-bar button:hover { background: var(--hover); }
.emoji-panel { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px 10px; background: var(--bg2); border-top: 1px solid var(--line2); max-height: 170px; overflow: auto; }
.emoji-panel button { background: none; border: 0; font-size: 22px; padding: 4px; cursor: pointer; }
.rec-bar { display: flex; align-items: center; gap: 10px; flex: 1; color: var(--red); font-weight: 700; padding: 0 8px; }

/* ---------- summary ---------- */
.eom { display: flex; align-items: center; gap: 14px; background: radial-gradient(120% 120% at 0% 0%, rgba(212,175,55,.25), rgba(212,175,55,.04) 60%), var(--eom-bg); border: 1px solid var(--gold); }
.medal { width: 58px; height: 58px; border-radius: 50%; background: var(--gold-grad); display: grid; place-items: center; box-shadow: 0 0 24px rgba(212,175,55,.45); flex-shrink: 0; }
.medal svg { width: 30px; height: 30px; }
.sum-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; }
.sum-row .rank { font-family: 'Cinzel'; font-weight: 800; color: var(--gold-t); text-align: center; }
.sum-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.sum-kpis div { background: var(--kpi-bg); border: 1px solid var(--line2); border-radius: 10px; padding: 7px 6px; text-align: center; }
.sum-kpis b { display: block; font-size: 14px; }
.sum-kpis span { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.net { font-weight: 900; font-size: 16px; }
.net.plus { color: var(--green-t); } .net.minus { color: var(--red-t); }
.bar { height: 6px; border-radius: 4px; background: var(--bar-bg); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #22C55E, #FACC15, #EF4444); background-size: 400px 100%; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- misc lists ---------- */
.list-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line2); }
.list-item:first-child { border-top: 0; }
.status { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; }
.status.pending { background: rgba(250,204,21,.16); color: var(--st-pending-t); }
.status.approved, .status.active { background: var(--green-d); color: var(--st-ok-t); }
.status.rejected, .status.disabled { background: var(--red-d); color: var(--st-bad-t); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.seg { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--gold-grad); color: #1a1405; }
.pesel { font-family: ui-monospace, monospace; letter-spacing: .06em; }

@media print {
  body { background: #fff; color: #000; }
  .topbar, .bottom-nav, .toolbar, .ann-banner, .month-nav button, #toasts { display: none !important; }
  .shell { padding: 0 !important; }
  .card { background: #fff !important; border: 1px solid #bbb; color: #000; break-inside: avoid; }
  .muted, .sum-kpis span { color: #444 !important; }
  .sum-kpis div { background: #fff !important; }
  .eom { background: #fff !important; }
  .gold-text { color: #8a6a14; background: none; }
}

input[type=checkbox] { accent-color: #D4AF37; }

@supports (height: 100dvh) { .room { height: var(--vvh, 100dvh); } }

/* ---------- Wygląd: przełącznik motywu ---------- */
.theme-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--surface2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.theme-seg button { border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 10px 4px; font-size: 13px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; min-height: 44px; }
.theme-seg button .ti { font-size: 18px; line-height: 1; }
.theme-seg button.on { background: var(--card); color: var(--text); border-color: var(--gold-t); box-shadow: var(--shadow); }
.theme-seg button:focus-visible { outline: 2px solid var(--gold-t); outline-offset: 2px; }

/* ---------- Baner instalacji PWA ---------- */
#install-banner { position: fixed; z-index: 35; left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); bottom: calc(12px + var(--safe-b));
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: var(--card); color: var(--text);
  border: 1px solid var(--gold-t); box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: up .25s ease-out; max-width: 560px; margin: 0 auto; }
#install-banner[hidden] { display: none; }
body.has-nav #install-banner { bottom: calc(var(--nav-h) + var(--safe-b) + 10px); }
@media (min-width: 900px) { body.has-nav #install-banner { bottom: calc(16px + var(--safe-b)); left: 250px; } }
#install-banner .ib-icon { width: 42px; height: 42px; border-radius: 10px; flex: none; }
#install-banner .grow { min-width: 0; }
#install-banner b { font-size: 14px; }
#install-banner .small { margin-top: 2px; line-height: 1.35; }
#install-banner .ios-share { vertical-align: -3px; color: #0a84ff; }
:root[data-theme="light"] #install-banner .ios-share { color: #0060df; }
#install-banner .ib-x { flex: none; width: 44px; height: 44px; margin: -8px -6px -8px 0; border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
@media print { #install-banner { display: none !important; } }
:root[data-theme="light"] .theme-seg { background: var(--bg2); }
body.ib-on .auth { padding-bottom: calc(150px + var(--safe-b)); }
body.ib-on .shell { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 140px); }
