/* Nasz Dom — rodzinny organizer. Granatowy atrament, chłodny papier, żółty zakreślacz = "teraz". */
:root {
  --ground: #EEF2F6;
  --surface: #FFFFFF;
  --surface-2: #F4F7FA;
  --ink: #1D2B3A;
  --ink-2: #4A5A6B;
  --ink-3: #7F8D9C;
  --line: #DAE1E8;
  --marker: #FFE066;
  --marker-soft: #FFF1A8;
  --marker-ink: #1D2B3A;
  --danger: #B42318;
  --ok: #0B7F62;
  --on-ink: #FFFFFF;
  --scrim: rgba(17, 26, 36, .42);
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --font-display: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  --tabbar-h: 62px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #121820;
    --surface: #1B232D;
    --surface-2: #232D38;
    --ink: #E8EEF4;
    --ink-2: #B0BCC8;
    --ink-3: #7F8C9A;
    --line: #2E3A47;
    --marker: #E9C93A;
    --marker-soft: #4A4220;
    --danger: #FF8A80;
    --ok: #3CC79E;
    --on-ink: #121820;
    --scrim: rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 17px/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: inherit; text-decoration: none; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid #2A63C9; outline-offset: 2px; border-radius: 10px; }
@media (prefers-color-scheme: dark) { :focus-visible { outline-color: #8DB4FF; } }

#app {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 32px);
}
.boot { color: var(--ink-3); text-align: center; margin-top: 40vh; }

/* ---------- typografia */
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -.005em; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 18px; }
.page-head h1 { font-size: 34px; line-height: 1.1; font-weight: 800; }
.page-head h1 .yr { display: block; color: var(--ink-3); font-weight: 700; font-size: 22px; line-height: 1.2; }
.head-actions { display: flex; gap: 8px; }
.sec { margin-top: 30px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 10px; }
.sec-head h2 { font-size: 21px; line-height: 1.25; font-weight: 750; }
.sec-head .sub { color: var(--ink-2); font-size: 15px; }
a.sec-head:active h2 { opacity: .6; }
.sec-head + .sec-head, .list + .sec-head, .empty + .sec-head { margin-top: 22px; }
.hint, .fine { color: var(--ink-3); font-size: 14px; line-height: 1.4; margin: 6px 2px 0; }
.empty { color: var(--ink-2); background: var(--surface); border-radius: var(--r-md); padding: 16px; margin: 0; }
.muted { color: var(--ink-3); }

mark.hl {
  color: inherit;
  background: linear-gradient(transparent 52%, var(--marker) 52%, var(--marker) 90%, transparent 90%);
  padding: 0 .08em;
  border-radius: 2px;
}
@media (prefers-color-scheme: dark) {
  mark.hl { background: linear-gradient(transparent 60%, rgba(233, 201, 58, .45) 60%, rgba(233, 201, 58, .45) 92%, transparent 92%); }
}

/* ---------- przyciski */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 14px;
  font-weight: 700; font-size: 17px;
}
.btn.primary { background: var(--ink); color: var(--on-ink); }
.btn.ghost { background: var(--surface); border: 1.5px solid var(--line); }
.btn.danger { color: var(--danger); }
.btn.big { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.98); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 13px;
  display: inline-grid; place-items: center;
  background: var(--surface); border: 1.5px solid var(--line); color: var(--ink);
}
.icon-btn.primary { background: var(--ink); color: var(--on-ink); border-color: transparent; }
.icon-btn.sm { width: 36px; height: 36px; border: 0; background: transparent; color: var(--ink-3); }
.icon-btn:active { transform: scale(.95); }
.link-btn {
  font-weight: 700; font-size: 15px; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--marker);
  text-decoration-thickness: 3px; text-underline-offset: 4px;
  padding: 6px 0;
}

/* ---------- awatary */
.av {
  --size: 32px;
  width: var(--size); height: var(--size); border-radius: 50%;
  background: var(--c); color: #fff;
  display: inline-grid; place-items: center; flex: none;
  font: 750 calc(var(--size) * .46)/1 var(--font-display);
}
.av.xs { --size: 22px; }
.av.md { --size: 44px; }
.av.lg { --size: 72px; }
.who { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- pasek zakładek */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs-in { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tabbar-h); }
#tabs a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11.5px; font-weight: 650; color: var(--ink-3);
}
#tabs .ti { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 15px; transition: background .2s; }
#tabs a[aria-current="page"] { color: var(--ink); }
#tabs a[aria-current="page"] .ti { background: var(--marker); color: var(--marker-ink); }
#tabs .badge {
  position: absolute; top: 5px; left: calc(50% + 10px);
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--ink); color: var(--on-ink);
  font: 700 11.5px/19px var(--font-display); text-align: center;
}

/* ---------- start */
.hero { margin: 2px 0 6px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.hello { font-weight: 650; color: var(--ink-2); }
.hero h1 { display: grid; gap: 2px; }
.hero-dow { font-size: 22px; line-height: 1.2; font-weight: 700; color: var(--ink-2); }
.hero-day { font-size: 46px; line-height: 1.05; font-weight: 800; letter-spacing: -.015em; }

.duty-row { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 10px; }
.duty {
  background: var(--surface); border-radius: var(--r-md);
  padding: 12px 12px 13px; display: grid; gap: 4px; align-content: start;
  box-shadow: inset 0 4px 0 var(--c, var(--line));
}
.duty.free { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.duty .d-emoji { font-size: 24px; line-height: 1.2; }
.duty .d-task { font: 750 16px/1.2 var(--font-display); }
.duty .d-who { display: flex; align-items: center; gap: 6px; font-size: 14.5px; color: var(--ink-2); min-width: 0; }
.duty .d-who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duty .d-done { font-size: 13px; font-weight: 700; color: var(--ok); display: flex; align-items: center; gap: 3px; }
.duty .d-done svg { width: 15px; height: 15px; stroke-width: 2.6; }
.duty.mine { box-shadow: inset 0 4px 0 var(--c), 0 0 0 2px var(--c); }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--surface); border-radius: var(--r-md); padding: 14px; display: grid; gap: 6px; align-content: start; min-height: 98px; }
.tile-label { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; font-weight: 650; }
.tile-label svg { width: 17px; height: 17px; }
.tile-value { font: 700 17px/1.3 var(--font-display); overflow-wrap: anywhere; }

.banner { background: var(--surface); border-radius: var(--r-lg); padding: 16px 16px 14px; margin-top: 20px; box-shadow: inset 0 0 0 2px var(--marker); }
.banner h3 { font-size: 18px; font-weight: 750; margin-bottom: 4px; }
.banner p { margin: 0; color: var(--ink-2); font-size: 15.5px; }
.banner ol { margin: 10px 0 0; padding-left: 22px; font-size: 15.5px; }
.banner ol li { margin: 4px 0; }
.banner ol svg { width: 18px; height: 18px; vertical-align: -3px; }
.banner .row { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }

/* ---------- lista wydarzeń */
.list { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.ev {
  display: grid; grid-template-columns: 62px 4px minmax(0, 1fr); gap: 12px;
  width: 100%; padding: 13px 16px 13px 14px; text-align: left; align-items: stretch;
}
.ev + .ev { border-top: 1px solid var(--line); }
.ev:active { background: var(--surface-2); }
.ev-time { font: 700 17px/1.3 var(--font-display); font-variant-numeric: tabular-nums; }
.ev-time .allday { display: block; font-size: 13px; line-height: 1.25; font-weight: 650; color: var(--ink-2); padding-top: 2px; }
.ev-strip { border-radius: 2px; min-height: 22px; }
.ev-title { display: block; font-weight: 650; overflow-wrap: anywhere; }
.ev-meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; color: var(--ink-3); font-size: 14px; }
.ev-meta svg { width: 15px; height: 15px; }
.ev-meta .whole { font-size: 13.5px; }
.day-group + .day-group { margin-top: 18px; }
.day-group h3 { font-size: 15.5px; font-weight: 700; color: var(--ink-2); margin: 0 2px 8px; }

/* ---------- kalendarz */
.month { background: var(--surface); border-radius: var(--r-lg); padding: 10px 6px 10px; }
.dow-row, .days { display: grid; grid-template-columns: repeat(7, 1fr); }
.dow-row span { text-align: center; font-size: 12.5px; color: var(--ink-3); font-weight: 650; padding: 2px 0 6px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px 0 5px; border-radius: 12px; min-height: 50px; }
.day .num {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font: 650 17px/1 var(--font-display); font-variant-numeric: tabular-nums;
}
.day.out .num { color: var(--ink-3); opacity: .5; }
.day.today .num { background: var(--marker); color: var(--marker-ink); font-weight: 800; }
.day.sel .num { box-shadow: inset 0 0 0 2px var(--ink); }
.day.today.sel .num { box-shadow: inset 0 0 0 2px var(--marker-ink); }
.dots { display: flex; gap: 3px; height: 6px; align-items: center; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.dot.more { background: none; width: auto; height: auto; font-size: 10px; line-height: 6px; color: var(--ink-3); font-weight: 800; }
.back-today { display: flex; justify-content: center; margin-top: 6px; }

/* ---------- koło sprzątania */
.wheel-wrap { display: grid; place-items: center; margin: 0 0 4px; }
.wheel { width: min(84vw, 330px); height: auto; overflow: visible; }
.wheel text { font-family: var(--font-display); }
.wheel .ring { fill: var(--surface); stroke: var(--ground); stroke-width: 5; }
.wheel .ring.free { fill: var(--surface-2); }
.wheel .ring-label { fill: var(--ink); font-size: 15px; font-weight: 750; text-anchor: middle; }
.wheel .ring-emoji { font-size: 22px; text-anchor: middle; }
.wheel .wedge { stroke: var(--surface); stroke-width: 3; transition: fill .3s; }
.wheel .wedge-label { fill: #fff; font-size: 17px; font-weight: 800; text-anchor: middle; dominant-baseline: central; }
.wheel .hub { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.wheel .hub-dot { fill: var(--ink); }
.wheel-disc, .wheel .wl { transform-box: view-box; transition: transform .7s cubic-bezier(.34, 1.25, .5, 1); }
@media (prefers-reduced-motion: reduce) { .wheel-disc, .wheel .wl { transition: none; } }

.wk-nav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; margin: 8px 0 4px; }
.wk-label { text-align: center; display: grid; }
.wk-label strong { font: 800 21px/1.2 var(--font-display); }
.wk-label span { color: var(--ink-2); font-size: 14.5px; }
.wk-label .now { justify-self: center; background: var(--marker); color: var(--marker-ink); font-weight: 700; font-size: 13px; padding: 1px 10px; border-radius: 10px; margin-top: 3px; }

.duty-card { background: var(--surface); border-radius: var(--r-lg); padding: 16px; margin-top: 12px; box-shadow: inset 5px 0 0 var(--c); }
.dc-head { display: flex; align-items: center; gap: 12px; }
.dc-emoji { font-size: 30px; line-height: 1; }
.dc-title { flex: 1; min-width: 0; }
.dc-title h3 { font-size: 20px; font-weight: 800; }
.dc-title p { margin: 3px 0 0; display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 15px; }
.done-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border-radius: 20px;
  border: 2px solid var(--c); color: var(--ink); font-weight: 750; font-size: 15px; white-space: nowrap;
}
.done-btn svg { width: 17px; height: 17px; stroke-width: 2.6; }
.done-btn.on { background: var(--c); color: #fff; }
.dc-done { margin: 10px 0 0; color: var(--ink-2); font-size: 14.5px; }
details.dc-check { margin-top: 12px; border-top: 1px solid var(--line); }
details.dc-check summary {
  list-style: none; cursor: pointer; padding: 12px 0 2px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-weight: 650; font-size: 15.5px;
}
details.dc-check summary::-webkit-details-marker { display: none; }
details.dc-check summary svg { width: 18px; height: 18px; transition: transform .2s; color: var(--ink-3); }
details.dc-check[open] summary svg { transform: rotate(90deg); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: var(--c); border-radius: 3px; transition: width .3s; }
.checks { list-style: none; margin: 6px 0 0; padding: 0; }
.checks button { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 9px 0; text-align: left; font-size: 16px; }
.box {
  width: 24px; height: 24px; border-radius: 8px; flex: none; margin-top: 1px;
  border: 2px solid var(--line); display: grid; place-items: center; color: #fff;
  transition: background .15s, border-color .15s;
}
.box svg { width: 16px; height: 16px; stroke-width: 3; opacity: 0; }
.is-checked .box { background: var(--c, var(--ink)); border-color: var(--c, var(--ink)); }
.is-checked .box svg { opacity: 1; }
.is-checked .ctext { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }

.free-line { display: flex; align-items: center; gap: 10px; margin: 14px 4px 0; color: var(--ink-2); }
.free-line .fe { font-size: 22px; }
.swap-box { margin-top: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.swap-note { flex: 1; min-width: 200px; background: var(--marker-soft); border-radius: var(--r-sm); padding: 10px 12px; font-size: 15px; }

.legend-grid { display: grid; gap: 12px; }
@media (min-width: 560px) { .legend-grid { grid-template-columns: 1fr 1fr; } }
.legend { background: var(--surface); border-radius: var(--r-md); padding: 14px 16px 10px; }
.legend h3 { font-size: 17px; font-weight: 750; display: flex; gap: 8px; align-items: center; }
.legend ul { margin: 8px 0 0; padding: 0; list-style: none; }
.legend li { position: relative; padding: 5px 0 5px 18px; font-size: 15.5px; line-height: 1.35; }
.legend li::before { content: ""; position: absolute; left: 2px; top: 12px; width: 7px; height: 7px; border-radius: 2px; background: var(--ink-3); }
.legend li + li { border-top: 1px dashed var(--line); }

/* ---------- zakupy */
.add-row { display: flex; gap: 8px; margin-bottom: 18px; }
.add-row input { flex: 1; min-width: 0; }
.add-row .btn { width: 52px; padding: 0; }
.shop { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.shop li { display: flex; align-items: center; padding-right: 6px; }
.shop li + li { border-top: 1px solid var(--line); }
.shop .chk { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 14px 8px 14px 16px; text-align: left; min-height: 56px; }
.shop .ctext { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.shop.done { opacity: .85; }

/* ---------- jadłospis */
.meals { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.meals li + li { border-top: 1px solid var(--line); }
.meals button { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 12px 16px 12px 10px; text-align: left; min-height: 64px; }
.m-day { display: grid; justify-items: center; gap: 1px; }
.m-dow { font-size: 12.5px; color: var(--ink-3); font-weight: 700; }
.m-num { font: 800 21px/1 var(--font-display); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; }
.is-today .m-num { background: var(--marker); color: var(--marker-ink); }
.m-dinner { font-weight: 650; overflow-wrap: anywhere; }
.m-sub { display: block; font-size: 13.5px; color: var(--ink-3); margin-top: 2px; }

/* ---------- tablica */
.composer { background: var(--surface); border-radius: var(--r-lg); padding: 12px; }
.composer textarea { border: 0; background: transparent; padding: 6px; min-height: 76px; }
.composer textarea:focus { outline: none; }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.notes { display: grid; gap: 10px; margin-top: 18px; }
.note { background: var(--surface); border-radius: var(--r-md); padding: 13px 14px 8px 16px; box-shadow: inset 4px 0 0 var(--c); }
.note.pinned { background: color-mix(in srgb, var(--marker) 24%, var(--surface)); }
.note-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.note-head time { color: var(--ink-3); font-size: 14px; }
.note-head .pin { color: var(--ink-2); display: inline-flex; }
.note-head .pin svg { width: 16px; height: 16px; }
.note p { white-space: pre-wrap; margin: 8px 0 4px; overflow-wrap: anywhere; }
.note-actions { display: flex; justify-content: flex-end; gap: 2px; }

/* ---------- ważne info */
.info-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.info-list li { display: flex; align-items: center; gap: 8px; padding: 12px 10px 12px 16px; }
.info-list li + li { border-top: 1px solid var(--line); }
.info-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.info-label { font-size: 14px; color: var(--ink-2); font-weight: 650; }
.info-value { font-weight: 650; font-size: 17px; overflow-wrap: anywhere; }
.info-value a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.info-note { font-size: 14px; color: var(--ink-3); }
.info-actions { display: flex; gap: 2px; }

/* ---------- więcej / ustawienia */
.nav-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.nav-list li + li { border-top: 1px solid var(--line); }
.nav-list a, .nav-list button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 14px 14px 16px; text-align: left; min-height: 60px; }
.nav-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); flex: none; }
.nav-txt { flex: 1; min-width: 0; display: grid; }
.nav-txt strong { font-weight: 650; }
.nav-txt span { font-size: 14px; color: var(--ink-3); }
.nav-list .chev { color: var(--ink-3); width: 18px; height: 18px; }

.set-block { background: var(--surface); border-radius: var(--r-lg); padding: 6px 16px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; min-height: 56px; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row .lbl { display: grid; min-width: 0; }
.set-row .lbl span { font-size: 14px; color: var(--ink-3); }
.set-row select { width: auto; min-height: 40px; padding: 6px 32px 6px 12px; background-position: calc(100% - 17px) 50%, calc(100% - 11px) 50%; flex: none; }
.status-pill { font-size: 14px; font-weight: 700; padding: 3px 10px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.status-pill.on { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); color: var(--ok); }
.member-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; width: 100%; text-align: left; }
.member-row + .member-row { border-top: 1px solid var(--line); }
.member-row .nm { flex: 1; font-weight: 650; }
.member-row .tag { font-size: 13px; color: var(--ink-3); }

/* ---------- formularze */
.form { display: grid; gap: 0; }
.field { display: grid; gap: 6px; margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.field .lab, fieldset.field legend { font-size: 15px; font-weight: 700; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type="text"], input[type="password"], input[type="date"], input[type="time"], input[type="tel"], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border-radius: 13px; border: 1.5px solid var(--line);
  background: var(--surface-2); font-size: 17px; color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
input[type="date"], input[type="time"] { display: block; text-align: left; }
input::-webkit-date-and-time-value { text-align: left; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
textarea { min-height: 96px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: transparent; }
::placeholder { color: var(--ink-3); opacity: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip > span {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 15px; border-radius: 21px;
  border: 1.5px solid var(--line); background: var(--surface);
  font-weight: 650; font-size: 15.5px; white-space: nowrap;
}
.chip > span svg { width: 16px; height: 16px; }
.chip input:checked + span { background: var(--c, var(--ink)); border-color: var(--c, var(--ink)); color: var(--chip-on, var(--on-ink)); }
.chip input:focus-visible + span { outline: 3px solid #2A63C9; outline-offset: 2px; }
.chip input:disabled + span { opacity: .35; }
.chip.person > span { padding-left: 6px; }
.chip.person .av { --size: 28px; }
.chip.person input:checked + span .av { box-shadow: 0 0 0 2px #fff; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; }
.swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatch span { display: block; width: 40px; height: 40px; border-radius: 50%; background: var(--c); }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c); }
.swatch input:focus-visible + span { outline: 3px solid #2A63C9; outline-offset: 4px; }

.switch { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-weight: 600; cursor: pointer; }
.switch.inline { margin: 0; }
input.tgl {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 51px; height: 31px; border-radius: 16px; margin: 0;
  background: var(--line); position: relative; cursor: pointer; transition: background .2s;
}
input.tgl::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s;
}
input.tgl:checked { background: var(--ok); }
input.tgl:checked::after { transform: translateX(20px); }

/* ---------- arkusz (okno od dołu) */
body.sheet-open { overflow: hidden; }
.sheet-backdrop { position: fixed; inset: 0; background: var(--scrim); z-index: 40; animation: fade .2s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 640px; margin: 0 auto;
  max-height: calc(100dvh - env(safe-area-inset-top) - 20px);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 26px 26px 0 0;
  padding: 6px 18px calc(env(safe-area-inset-bottom) + 20px);
  animation: sheet-up .3s cubic-bezier(.2, .9, .3, 1);
}
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 6px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: -6px; background: var(--surface); padding: 6px 0 12px; z-index: 2; }
.sheet-head h2 { font-size: 23px; font-weight: 800; }
.sheet .icon-btn.sm { color: var(--ink-2); background: var(--surface-2); border-radius: 50%; }
.sheet input[type="text"], .sheet input[type="password"], .sheet input[type="date"], .sheet input[type="time"], .sheet select, .sheet textarea { background: var(--surface-2); }
.sheet-actions { display: grid; gap: 6px; margin-top: 6px; }
.sheet p.lead { margin: 0 0 16px; color: var(--ink-2); }
@keyframes sheet-up { from { transform: translateY(48px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-backdrop { animation: none; } }

/* ---------- logowanie */
.auth { min-height: calc(100dvh - 120px); display: grid; align-content: center; justify-items: center; gap: 14px; text-align: center; }
.auth .logo { width: 96px; height: 96px; border-radius: 24px; }
.auth h1 { font-size: 34px; font-weight: 800; }
.auth p { margin: 0; color: var(--ink-2); max-width: 340px; }
.auth form { width: 100%; max-width: 360px; display: grid; gap: 12px; margin-top: 8px; text-align: left; }
.auth .err { color: var(--danger); font-weight: 600; min-height: 1.4em; }
.pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 12px; width: 100%; max-width: 440px; margin-top: 10px; }
.pick button { display: grid; justify-items: center; gap: 10px; padding: 18px 8px 16px; border-radius: 20px; background: var(--surface); font: 750 18px/1.2 var(--font-display); }
.pick button:active { transform: scale(.97); }

/* ---------- komunikat */
#toast {
  position: fixed; left: 50%; z-index: 60;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); width: max-content;
  background: var(--ink); color: var(--on-ink);
  padding: 12px 18px; border-radius: 14px; font-weight: 650; font-size: 15.5px;
  transition: opacity .25s, transform .25s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--danger); color: var(--on-ink); }
body.sheet-open #toast { bottom: calc(env(safe-area-inset-bottom) + 18px); }

@media (min-width: 700px) {
  #app { padding-top: 28px; }
}
