/* Praxis-App Sobejko – wygląd aplikacji (kolory i kroje jak na stronie) */
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF; }
@font-face { font-family: "Jakarta"; src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Jakarta"; src: url("../fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-02BA, U+1E00-1EFF; }

:root {
  --bg: #f3f6f5; --card: #ffffff; --ink: #142629; --ink-2: #3d5155; --muted: #5d6f72; --line: #e3ebe8;
  --brand: #145c55; --brand-deep: #0b2e30; --brand-soft: #e3f0ec; --accent: #10845a; --accent-soft: #d6f1e3;
  --warn: #7a4a00; --warn-soft: #fff4dc; --red: #c62828; --red-soft: #fde6e6;
  --display: "Jakarta", "Inter", system-ui, sans-serif; --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tabs: 68px; color-scheme: light;
}
* { box-sizing: border-box; }
/* Bez przybliżania (aplikacja ma własny tryb „Duża czcionka”): pan-x pan-y = tylko przewijanie, bez zoomu palcami i podwójnym stuknięciem */
html { -webkit-text-size-adjust: 100%; font-size: 16px; touch-action: pan-x pan-y; }
html.big { font-size: 19px; }
/* Bez pojedynczego słowa w ostatniej linii (np. „…całą / dobę”) – przeglądarka rozkłada tekst równo między linie */
#app :is(h1, h2, h3, b, strong, small, .kick) { text-wrap: balance; }
#app :is(p, li, span) { text-wrap: pretty; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 400 1rem/1.5 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
@media (min-width: 640px) { body { background: radial-gradient(900px 600px at 80% -10%, rgba(16, 132, 90, .18), transparent), #e9efed; } }
a { color: inherit; }
button { font: inherit; color: inherit; }
.i { width: 1.25rem; height: 1.25rem; flex: none; }
.i.sm { width: 1rem; height: 1rem; opacity: .6; }
.i.big { width: 3rem; height: 3rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }
@media (min-width: 640px) { .app { box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(11, 46, 48, .15); } }
.screen { display: grid; gap: .8rem; padding: calc(env(safe-area-inset-top, 0px) + .75rem) max(1rem, env(safe-area-inset-right, 0px)) calc(var(--tabs) + env(safe-area-inset-bottom, 0px) + 1.2rem) max(1rem, env(safe-area-inset-left, 0px)); }

/* nagłówek */
.ah { display: flex; align-items: center; gap: .75rem; padding: .25rem 0 .2rem; }
.ah img { width: 2.6rem; height: 2.6rem; border-radius: .75rem; }
.ah h1 { margin: 0; font: 800 1.15rem/1.2 var(--display); }
.ah p { margin: 0; font-size: .8rem; color: var(--muted); }
.lng { margin-left: auto; border: 0; border-radius: .7rem; padding: .45rem .7rem; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: .78rem; cursor: pointer; }

/* karty */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 1.2rem; padding: 1rem 1.1rem; display: grid; gap: .55rem; margin: 0; }
.card h2, .h3 { margin: 0; font: 800 1.05rem/1.25 var(--display); }
.card p { margin: 0; }
.card.warn { background: var(--warn-soft); border-color: #f3dfae; color: var(--warn); }
.mut { color: var(--muted); font-size: .85rem; }
.c { text-align: center; }
.kick { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.kick.red { color: var(--red); }
.line { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.row2 { display: flex; flex-wrap: wrap; gap: .5rem; }
.offline { display: flex; gap: .5rem; align-items: center; margin: 0; padding: .6rem .8rem; border-radius: .9rem; background: #eceff1; color: var(--ink-2); font-size: .82rem; }

/* przyciski */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.9rem; padding: .65rem 1rem; border: 0; border-radius: .9rem; font-weight: 700; font-size: .92rem; text-decoration: none; cursor: pointer; }
.btn.p { background: var(--brand); color: #fff; }
.btn.s { background: var(--brand-soft); color: var(--brand); }
.btn.r { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.btn.danger { color: var(--red); }
.btn.sm { min-height: 2.4rem; padding: .45rem .8rem; font-size: .85rem; }
.btn.full { width: 100%; }
.row2 .btn { flex: 1 1 auto; }

/* Start */
.hero { display: grid; gap: .3rem; padding: 1.1rem 1.15rem; border-radius: 1.3rem; color: #fff; background: linear-gradient(140deg, #145c55, #0b2e30); box-shadow: 0 14px 30px rgba(11, 46, 48, .22); }
.hero strong { font: 800 1.55rem/1.15 var(--display); }
.hero small { color: #c3e2da; font-size: .85rem; }
.hero .addr { opacity: .8; font-size: .78rem; }
.pill { display: inline-flex; align-items: center; gap: .4rem; width: max-content; max-width: 100%; padding: .2rem .7rem; border-radius: 99px; background: rgba(255, 255, 255, .15); font-size: .78rem; font-weight: 700; }
.pill .dot { width: .5rem; height: .5rem; border-radius: 50%; background: #ffb4a8; }
.hero.is-open .pill .dot { background: #8fd6b5; box-shadow: 0 0 0 4px rgba(143, 214, 181, .25); }
.status { border-left: 0; background: var(--warn-soft); border-color: #f3dfae; }
.status--closed, .status--urgent { background: var(--red-soft); border-color: #f5c2c2; }
.status--open { background: var(--accent-soft); border-color: #b9e6cf; }
.status .dates { font: 800 1.1rem var(--display); color: var(--warn); }
.subs { display: grid; gap: .5rem; padding-top: .3rem; }
.sub { display: grid; gap: .15rem; padding: .7rem .8rem; border-radius: .9rem; background: rgba(255, 255, 255, .8); }
.sub small { color: var(--muted); font-size: .8rem; }
.sub .row2 { margin-top: .35rem; }
.qa { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.q { display: grid; gap: .3rem; align-content: start; min-height: 5.6rem; padding: .85rem; border-radius: 1.1rem; background: var(--card); border: 1px solid var(--line); color: var(--brand); text-decoration: none; }
.q span { font-weight: 800; font-size: .95rem; line-height: 1.2; }
.q small { color: var(--muted); font-size: .76rem; }
.q .i { width: 1.5rem; height: 1.5rem; }
.q.main { background: linear-gradient(140deg, #13a06d, #0d704d); border-color: transparent; color: #fff; box-shadow: 0 10px 22px rgba(16, 132, 90, .3); }
.q.main small { color: #d6f1e3; }
.q.wide { grid-column: 1 / -1; min-height: 0; grid-auto-flow: column; justify-content: start; align-items: center; gap: .6rem; }
.week { list-style: none; margin: 0; padding: 0; }
.week li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid #edf2f0; font-size: .92rem; }
.week li:last-child { border-bottom: 0; }
.week li.today { color: var(--accent); font-weight: 700; }
.week li.off b { color: var(--muted); font-weight: 500; }
.week b { font-variant-numeric: tabular-nums; text-align: right; }
.link { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; border-radius: 1rem; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-weight: 600; }
.link .i:last-child { margin-left: auto; width: 1rem; opacity: .5; }

/* Notdienst */
.sos { display: grid; justify-items: center; gap: .1rem; padding: 1.1rem; border-radius: 1.4rem; background: linear-gradient(150deg, #e53935, #b71c1c); color: #fff; text-decoration: none; box-shadow: 0 16px 34px rgba(198, 40, 40, .35); text-align: center; }
.sos span { display: inline-flex; gap: .45rem; align-items: center; font-weight: 700; }
.sos b { font: 800 3.2rem/1 var(--display); letter-spacing: .02em; }
.sos small { opacity: .9; font-size: .82rem; }
.list { padding: .3rem .4rem; gap: 0; }
.list a, .list button { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .8rem .7rem; border: 0; border-bottom: 1px solid #edf2f0; background: none; text-align: left; text-decoration: none; color: var(--ink); cursor: pointer; }
.list > :last-child { border-bottom: 0; }
.list > a > .i:first-child, .list > button > .i:first-child { width: 2.3rem; height: 2.3rem; padding: .5rem; border-radius: .75rem; background: var(--brand-soft); color: var(--brand); }
.list span { flex: 1; display: grid; }
.list small { color: var(--muted); font-size: .8rem; }

/* Notfallpass */
.empty { display: grid; justify-items: center; gap: .6rem; padding: 2rem 1.2rem; text-align: center; background: var(--card); border: 1px dashed #c7d6d2; border-radius: 1.3rem; color: var(--ink-2); }
.empty .i { color: var(--red); }
.empty h2 { margin: 0; font: 800 1.15rem var(--display); color: var(--ink); }
.empty p { margin: 0 0 .4rem; }
.pass { border: 2px solid var(--red); gap: 0; padding: 0; overflow: hidden; }
.pass__name { display: grid; padding: .9rem 1.1rem; background: var(--red); color: #fff; }
.pass__name b { font: 800 1.3rem/1.2 var(--display); }
.pass__name small { opacity: .9; }
.pr { display: grid; gap: .1rem; padding: .65rem 1.1rem; border-bottom: 1px solid #f2e3e3; }
.pr:last-child { border-bottom: 0; }
.pr span { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pr b { font-weight: 600; white-space: pre-line; }
.pr.alert b { color: var(--red); font-weight: 800; }
.pr.ice a { display: inline-flex; gap: .4rem; align-items: center; margin-top: .3rem; color: var(--brand); font-weight: 700; text-decoration: none; }
.tip { margin: 0; padding: .8rem 1rem; border-radius: 1rem; background: var(--brand-soft); color: var(--ink-2); font-size: .88rem; }
.lock { display: flex; gap: .45rem; align-items: center; margin: 0; color: #0b5c40; font-size: .8rem; font-weight: 600; }
.lock .i { width: 1rem; height: 1rem; }
.form { gap: .35rem; }
.form label { margin-top: .45rem; font-size: .82rem; font-weight: 700; color: var(--ink-2); }
.form input, .form select, .form textarea { width: 100%; min-height: 2.9rem; padding: .65rem .8rem; border: 1px solid #cfdcd8; border-radius: .8rem; background: #fafcfb; font: 400 1rem var(--sans); color: var(--ink); }
.form textarea { resize: vertical; min-height: 3.6rem; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16, 132, 90, .18); }
.form .row2 { margin-top: .8rem; }

/* Więcej */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: .25rem; padding: .25rem; border-radius: .9rem; background: #eef2f1; }
.seg button { border: 0; border-radius: .7rem; padding: .6rem .3rem; background: none; font-weight: 700; font-size: .88rem; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--brand); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.sw { position: relative; width: 3.2rem; height: 1.9rem; flex: none; border: 0; border-radius: 1rem; background: #cfd8d6; cursor: pointer; transition: background .2s; }
.sw::after { content: ""; position: absolute; top: .2rem; left: .2rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: left .2s; }
.sw.on { background: var(--accent); }
.sw.on::after { left: 1.5rem; }
.soon ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.soon li { display: flex; gap: .55rem; align-items: center; color: var(--ink-2); font-size: .9rem; }
.soon .i { color: #d4a017; width: 1rem; height: 1rem; }
.ver { margin: .3rem 0 0; text-align: center; color: var(--muted); font-size: .78rem; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs) + 1rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); margin: 0; padding: .6rem 1rem; border-radius: 99px; background: var(--ink); color: #fff; font-size: .85rem; }

/* dolne menu */
.tabs { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; display: flex; justify-content: space-around; padding: .4rem .4rem calc(.45rem + env(safe-area-inset-bottom, 0px)); background: #fff; /* bez rozmycia tła – blur na stałym pasku zacinał przewijanie na słabszych telefonach */ border-top: 1px solid var(--line); }
.tabs a { flex: 1; display: grid; justify-items: center; gap: .1rem; padding: .35rem .2rem; border-radius: .8rem; color: #5f7370; font-size: .7rem; font-weight: 700; text-decoration: none; }
.tabs a .i { width: 1.45rem; height: 1.45rem; }
.tabs a.on { color: var(--brand); background: var(--brand-soft); }
.tabs a[href="#notdienst"].on { color: var(--red); background: var(--red-soft); }

/* prolog */
.ob { min-height: 100vh; display: flex; flex-direction: column; gap: .9rem; padding: calc(env(safe-area-inset-top, 0px) + 1rem) 1.3rem calc(env(safe-area-inset-bottom, 0px) + 1.4rem); background: linear-gradient(180deg, #dff2ea 0%, var(--bg) 45%); }
.ob h1 { margin: 0; text-align: center; font: 800 1.55rem/1.15 var(--display); color: var(--brand-deep); }
.ob h1.mt { margin-top: 2.2rem; }
.ob .obsub { margin: 0; text-align: center; color: var(--muted); }
.skip { align-self: flex-end; border: 0; background: none; padding: .4rem .2rem; color: var(--muted); font-weight: 700; cursor: pointer; }
.ob__icon { align-self: center; width: 7.5rem; height: 7.5rem; margin-top: .5rem; filter: drop-shadow(0 16px 30px rgba(11, 46, 48, .3)); }
.ob__shield { align-self: center; display: grid; place-items: center; width: 5.5rem; height: 5.5rem; margin-top: 2.5rem; border-radius: 50%; background: var(--accent-soft); color: #0b5c40; }
.ob__shield .i { width: 2.6rem; height: 2.6rem; }
.feat { display: grid; gap: .6rem; margin-top: .3rem; }
.feat > div { display: grid; grid-template-columns: 2.7rem 1fr; gap: .8rem; align-items: center; padding: .75rem .85rem; border-radius: 1.1rem; background: #fff; border: 1px solid var(--line); }
.feat span { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; border-radius: .8rem; background: var(--brand-soft); color: var(--brand); }
.feat p { margin: 0; display: grid; }
.feat small { color: var(--muted); font-size: .82rem; }
.dots { display: flex; justify-content: center; gap: .4rem; margin-top: auto; padding-top: 1rem; }
.dots i { width: .5rem; height: .5rem; border-radius: .3rem; background: #c7d6d2; }
.dots i.on { width: 1.5rem; background: var(--brand); }
.aa { font: 800 2rem var(--display); color: var(--brand); }
.noscript { padding: 2rem; text-align: center; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Funkcje zdrowotne ---------- */
button.q { font: inherit; text-align: left; cursor: pointer; }
.backbtn { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .8rem; background: var(--card); border: 1px solid var(--line); color: var(--brand); }
.flip { transform: rotate(180deg); }
.medcard { grid-template-columns: 2.6rem 1fr auto; align-items: center; text-decoration: none; color: var(--ink); }
.medcard__i { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .8rem; background: var(--accent-soft); color: #0b5c40; }
.medcard span:nth-child(2) { display: grid; }
.medcard small { color: var(--muted); font-size: .82rem; }
.hg { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.hg a { display: flex; align-items: center; gap: .55rem; padding: .75rem; border-radius: .9rem; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .88rem; text-decoration: none; line-height: 1.2; }
.err { display: flex; gap: .5rem; align-items: center; margin: 0; padding: .7rem .9rem; border-radius: .9rem; background: var(--red-soft); color: var(--red); font-weight: 700; font-size: .9rem; }
.card.okc { background: var(--accent-soft); border-color: #b9e6cf; color: #0b5c40; display: block; }
.card.danger { background: var(--red-soft); border-color: #f5c2c2; color: var(--red); display: flex; gap: .5rem; align-items: center; }
.card.warn { display: block; }
.doses { list-style: none; margin: 0; padding: 0; }
.doses li { display: grid; grid-template-columns: 3.2rem 1fr auto; gap: .7rem; align-items: center; padding: .6rem .2rem; border-bottom: 1px solid #edf2f0; }
.doses li:last-child { border-bottom: 0; }
.doses .tm { font: 800 1rem var(--display); color: var(--brand); font-variant-numeric: tabular-nums; }
.doses span { display: grid; }
.doses small { color: var(--muted); font-size: .8rem; }
.doses li.is-next { margin: 0 -.6rem; padding-left: .8rem; padding-right: .6rem; border-radius: .9rem; background: var(--warn-soft); }
.doses li.is-done strong { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .25); }
.chk { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: 50%; border: 2px solid #b9cdc8; background: #fff; color: transparent; cursor: pointer; }
.chk.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.two, .three { display: grid; gap: .6rem; }
.two { grid-template-columns: 1fr 1fr; }
.three { grid-template-columns: 1fr 1fr 1fr; }
.two > div, .three > div { display: grid; gap: .35rem; align-content: start; }
.times { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.form .times input { width: auto; min-width: 7.2rem; flex: 0 0 auto; }
.daysel { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; }
.form .day { position: relative; margin: 0; }
.day input { position: absolute; opacity: 0; pointer-events: none; }
.day span { display: grid; place-items: center; height: 2.6rem; border-radius: .7rem; background: #eef2f1; color: var(--muted); font-weight: 800; font-size: .8rem; cursor: pointer; }
.day input:checked + span { background: var(--brand); color: #fff; }
.day input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.form .cb { display: grid; grid-template-columns: 1.4rem 1fr; gap: .6rem; align-items: start; margin-top: .8rem; padding: .8rem; border-radius: .9rem; background: var(--brand-soft); font-weight: 400; }
.form .cb input { width: 1.3rem; height: 1.3rem; min-height: 0; margin: .1rem 0 0; padding: 0; accent-color: var(--accent); }
.cb span { display: grid; gap: .15rem; }
.cb small { color: var(--muted); font-size: .8rem; }
.seg4 { grid-template-columns: repeat(4, 1fr); }
.seg3 { grid-template-columns: repeat(3, 1fr); }
.seg.small button { padding: .45rem .2rem; font-size: .78rem; }
.kpis { align-items: flex-start; }
.kpis .r { text-align: right; }
.kpi { margin: .1rem 0 0; }
.kpi b { font: 800 2rem/1 var(--display); color: var(--brand); }
.kpi small { color: var(--muted); }
.kpi2 { margin: .2rem 0 0; font: 800 1.15rem var(--display); }
.chart { display: block; margin-top: .3rem; }
.leg { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: 0; color: var(--muted); font-size: .8rem; align-items: center; }
.leg i { display: inline-block; width: .9rem; height: .25rem; border-radius: 2px; margin-right: .3rem; vertical-align: middle; }
.entries { list-style: none; margin: 0; padding: 0; }
.entries li { display: grid; grid-template-columns: 1fr auto auto; gap: .6rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid #edf2f0; font-size: .92rem; }
.entries li:last-child { border-bottom: 0; }
.entries span { display: grid; color: var(--ink-2); }
.entries small { color: var(--muted); font-size: .78rem; }
.entries b { font-variant-numeric: tabular-nums; }
.mini { width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border: 0; border-radius: .6rem; background: #eef2f1; color: var(--muted); cursor: pointer; }
.mini.r { width: auto; padding: 0 .7rem; background: var(--red); color: #fff; font-weight: 700; font-size: .8rem; }
.mini .i { width: 1rem; height: 1rem; }
.vac { display: grid; gap: .2rem; padding: .6rem 0; border-top: 1px solid #edf2f0; }
.vac p { margin: 0; white-space: pre-line; color: var(--ink-2); font-size: .92rem; line-height: 1.5; }
.card .src { margin-top: .3rem; color: var(--muted); font-size: .76rem; }
.pack { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.pack label { display: grid; grid-template-columns: 1.4rem 1fr; gap: .6rem; align-items: center; padding: .45rem 0; font-size: .95rem; cursor: pointer; }
.pack input { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); }
.pack input:checked + span { color: var(--muted); text-decoration: line-through; }
.ck { list-style: none; margin: 0; padding: 0; }
.ck li { display: grid; gap: .4rem; padding: .7rem 0; border-bottom: 1px solid #edf2f0; }
.ck li:last-child { border-bottom: 0; }
.ck__top { display: flex; justify-content: space-between; gap: .7rem; align-items: flex-start; }
.ck__top span { display: grid; }
.ck__top small { color: var(--muted); font-size: .8rem; }
.ck__top em { flex: none; font-style: normal; font-size: .76rem; font-weight: 800; padding: .2rem .6rem; border-radius: 99px; background: #eef2f1; color: var(--muted); white-space: nowrap; }
.st-due .ck__top em { background: var(--warn-soft); color: var(--warn); }
.st-ok .ck__top em, .st-done .ck__top em { background: var(--accent-soft); color: #0b5c40; }
.st-later { opacity: .6; }
.ck__last { display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-size: .82rem; color: var(--muted); }
.ck__last input { width: auto; min-height: 2.3rem; padding: .3rem .5rem; border: 1px solid #cfdcd8; border-radius: .6rem; background: #fafcfb; font: inherit; color: var(--ink); }
.toast { z-index: 30; }
.toast[hidden] { display: none; }

/* ---------- Wydruk / PDF ---------- */
#print { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  html.printing body { background: #fff; }
  html.printing #app, html.printing .toast { display: none !important; }
  html.printing #print { display: block; color: #142629; font: 10.5pt/1.45 "Inter", sans-serif; }
  #print .ph { display: flex; gap: 12px; align-items: center; padding-bottom: 10px; border-bottom: 2px solid #145c55; }
  #print .ph img { width: 40px; height: 40px; border-radius: 10px; }
  #print .ph h1 { margin: 0; font: 800 17pt "Jakarta", sans-serif; }
  #print .ph p { margin: 0; color: #5d6f72; font-size: 9pt; }
  #print .ph__r { margin-left: auto; text-align: right; font-size: 9pt; color: #5d6f72; }
  #print h2 { margin: 16px 0 6px; font: 800 12pt "Jakarta", sans-serif; color: #0b2e30; border-bottom: 1px solid #c9d8d4; padding-bottom: 3px; }
  #print h2 small { font: 400 9pt "Inter", sans-serif; color: #5d6f72; margin-left: 6px; }
  #print .pmeta { margin: 8px 0 0; }
  #print .pgrid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items: start; break-inside: avoid; }
  #print .pstat { margin: 0; display: grid; grid-template-columns: auto auto; gap: 4px 10px; font-size: 9.5pt; }
  #print .pstat dt { color: #5d6f72; }
  #print .pstat dd { margin: 0; font-weight: 700; text-align: right; }
  #print .leg { display: flex; gap: 10px; font-size: 8.5pt; color: #5d6f72; }
  #print .leg i { display: inline-block; width: 12px; height: 3px; margin-right: 4px; vertical-align: middle; }
  #print .pt { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 9pt; }
  #print .pt th { text-align: left; background: #eef4f2; padding: 4px 6px; font-size: 8pt; text-transform: uppercase; letter-spacing: .04em; color: #5d6f72; }
  #print .pt td { padding: 3px 6px; border-bottom: 1px solid #e6ecea; }
  #print .pt tr { break-inside: avoid; }
  #print .pf { margin-top: 18px; padding-top: 6px; border-top: 1px solid #c9d8d4; font-size: 8pt; color: #7b8b8a; }
}

/* ---------- Recepcja online: czerwona jak na stronie ---------- */
.q.rez { position: relative; grid-column: 1 / -1; min-height: 0; grid-template-columns: auto 1fr auto; grid-auto-flow: column; align-items: center; gap: .8rem; padding: 1rem; border-color: transparent; color: #fff; background: linear-gradient(135deg, #e53935, #c62828); box-shadow: 0 12px 26px rgba(198, 40, 40, .35); }
.q.rez span { display: grid; gap: .1rem; }
.q.rez b { font-size: 1.05rem; }
.q.rez small { color: #ffe1de; font-weight: 500; }
.q.rez .i { width: 1.7rem; height: 1.7rem; }
.q.rez .badge { font-style: normal; padding: .2rem .6rem; border-radius: 99px; background: rgba(255, 255, 255, .22); font-weight: 800; font-size: .76rem; }
.q.rez::before { content: ""; position: absolute; inset: 0; border-radius: inherit; animation: rezPulse 2.6s ease-out infinite; pointer-events: none; }
@keyframes rezPulse { 0% { box-shadow: 0 0 0 0 rgba(229, 57, 53, .5); } 70% { box-shadow: 0 0 0 12px rgba(229, 57, 53, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); } }
.btn[data-rez] { background: linear-gradient(135deg, #e53935, #c62828); color: #fff; border: 0; box-shadow: 0 8px 18px rgba(198, 40, 40, .25); }
@media (prefers-reduced-motion: reduce) { .q.rez::before { animation: none; } }

/* ---------- Pola zaznaczenia (jak na stronie) ---------- */
.app input[type="checkbox"] { -webkit-appearance: none; appearance: none; width: 1.4rem; height: 1.4rem; margin: 0; flex: none; display: inline-grid; place-items: center; border: 2px solid #b9cdc8; border-radius: .45rem; background: #fff; cursor: pointer; transition: background .15s, border-color .15s; }
.app input[type="checkbox"]::after { content: ""; width: .36rem; height: .7rem; border-right: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(45deg) translate(-1px, -1px); opacity: 0; transition: opacity .15s; }
.app input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.app input[type="checkbox"]:checked::after { opacity: 1; }
.app input[type="checkbox"]:focus-visible { outline: 3px solid rgba(16, 132, 90, .35); outline-offset: 2px; }
.form .cb input[type="checkbox"] { width: 1.4rem; height: 1.4rem; margin-top: .05rem; }
.form input[type="time"] { font-variant-numeric: tabular-nums; }

/* ---------- Przycisk wyboru (lista / data) ---------- */
.pickwrap { display: block; }
.pick { width: 100%; min-height: 2.9rem; display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border: 1px solid #cfdcd8; border-radius: .8rem; background: #fafcfb; color: var(--ink); font: 400 1rem var(--sans); text-align: left; cursor: pointer; }
.pick .pv { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick.is-empty .pv { color: #8a9a98; }
.pick > .i:first-child { color: var(--brand); }
.pick .i.down { width: 1rem; height: 1rem; opacity: .55; transform: rotate(90deg); transition: transform .2s; }
.pick[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16, 132, 90, .18); }
.pick[aria-expanded="true"] .i.down { transform: rotate(-90deg); }
.pick--sm { width: auto; min-height: 2.4rem; padding: .35rem .6rem; gap: .45rem; font-size: .9rem; }
.pick--sm .i { width: 1rem; height: 1rem; }

/* ---------- Okienko wyboru ---------- */
.pop { position: fixed; z-index: 60; padding: .6rem; background: #fff; border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 18px 50px rgba(11, 46, 48, .25); color: var(--ink); animation: popIn .16s ease; }
.pop[hidden] { display: none; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pop--sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto !important; max-height: 78vh; display: flex; flex-direction: column; padding: .8rem .8rem calc(.8rem + env(safe-area-inset-bottom, 0px)); border-radius: 1.4rem 1.4rem 0 0; box-shadow: 0 0 0 100vmax rgba(11, 46, 48, .45); animation: sheetUp .22s ease; }
@keyframes sheetUp { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.pop__head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .1rem .3rem .5rem; }
.pop__head b { font: 800 1rem var(--display); }
.pop__x { width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border: 0; border-radius: 50%; background: #eef2f1; color: var(--ink); cursor: pointer; }
.pop__search { width: 100%; min-height: 2.8rem; margin-bottom: .4rem; padding: .6rem .8rem; border: 1px solid #cfdcd8; border-radius: .8rem; background: #fafcfb; font: 400 1rem var(--sans); color: var(--ink); }
.pop__search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16, 132, 90, .18); }
.pop__list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; overscroll-behavior: contain; }
.pop--sheet .pop__list { max-height: none; flex: 1; min-height: 0; }
.pop__list button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem .85rem; border: 0; border-radius: .7rem; background: none; color: var(--ink); font: 400 .97rem var(--sans); text-align: left; cursor: pointer; }
.pop__list button:hover, .pop__list button:focus-visible { background: var(--brand-soft); outline: none; }
.pop__list button[aria-selected="true"] { font-weight: 700; color: var(--brand); }
.pop__list button[aria-selected="true"]::after { content: ""; flex: none; width: 6px; height: 11px; border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(45deg) translateY(-2px); }
.pop__none { padding: .8rem; color: var(--muted); }

/* kalendarz */
.pop--date { width: 300px; }
.cal__head { display: flex; align-items: center; justify-content: space-between; gap: .3rem; margin-bottom: .3rem; }
.cal__head button { border: 0; background: none; color: inherit; cursor: pointer; }
.cal__nav { width: 2.3rem; height: 2.3rem; display: grid; place-items: center; border-radius: .6rem; color: var(--brand) !important; }
.cal__nav:hover { background: var(--brand-soft); }
.cal__title { display: inline-flex; align-items: center; gap: .3rem; padding: .4rem .6rem; border-radius: .6rem; font: 800 1rem var(--display); text-transform: capitalize; }
button.cal__title:hover { background: var(--brand-soft); }
.cal__title .i { width: .95rem; height: .95rem; opacity: .55; transform: rotate(90deg); }
.cal__wd, .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal__wd span { padding: .3rem 0; text-align: center; color: var(--muted); font-size: .72rem; font-weight: 800; }
.cal__grid button { aspect-ratio: 1; border: 0; border-radius: .6rem; background: none; color: var(--ink); font: 600 .92rem var(--sans); font-variant-numeric: tabular-nums; cursor: pointer; }
.cal__grid button:hover:not(:disabled) { background: var(--brand-soft); }
.cal__grid button.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
.cal__grid button.is-sel { background: var(--brand); color: #fff; box-shadow: none; }
.cal__grid button.is-out { visibility: hidden; }
.cal__grid button:disabled { color: #c7d2cf; cursor: default; }
.cal__grid--3 { grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.cal__grid--3 button { aspect-ratio: auto; padding: .8rem 0; text-transform: capitalize; }
.cal__foot { display: flex; justify-content: space-between; margin-top: .4rem; padding-top: .4rem; border-top: 1px solid #edf2f0; }
.cal__foot button { padding: .45rem .6rem; border: 0; border-radius: .5rem; background: none; color: var(--brand); font-weight: 700; cursor: pointer; }
.cal__foot button:hover { background: var(--brand-soft); }

/* ---------- Podpowiedź o języku w recepcji online (jak na stronie) ---------- */
.hint { position: fixed; z-index: 2147483647; left: 12px; right: 12px; bottom: calc(var(--tabs) + 12px); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 12px 12px 14px; background: var(--brand-soft); border: 1px solid #cfe3dd; border-radius: 14px; box-shadow: 0 12px 30px rgba(15, 61, 62, .18); color: var(--ink); font-family: var(--sans); animation: popIn .3s ease; }
.hint[hidden] { display: none; }
.hint::after { content: "🌐"; grid-row: 1 / 3; grid-column: 1; align-self: center; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #fff; font-size: 1.15rem; }
.hint strong { grid-column: 2; color: var(--brand); font-size: .95rem; }
.hint span { grid-column: 2; color: var(--ink-2); font-size: .86rem; line-height: 1.45; }
.hint button { grid-column: 3; grid-row: 1 / 3; align-self: center; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer; }
.hint button .i { width: 1rem; height: 1rem; }
.hint.dock { right: auto; bottom: auto; }
.hint.dock::before { content: ""; position: absolute; top: -9px; left: var(--caret, 50%); width: 16px; height: 16px; background: var(--brand-soft); border-left: 1px solid #cfe3dd; border-top: 1px solid #cfe3dd; transform: rotate(45deg); border-radius: 3px 0 0 0; }

/* ---------- Płeć: dwa równe przyciski ---------- */
.seg2 { grid-template-columns: repeat(2, 1fr); }
.theme { display: grid; gap: .4rem; padding-top: .6rem; border-top: 1px solid #edf2f0; }
.mut.sm { font-size: .78rem; }

/* ---------- Przewodnik po aplikacji ---------- */
.tour { gap: 1rem; }
.tour__top { display: flex; justify-content: space-between; align-items: center; }
.tour__count { font-weight: 800; color: var(--muted); font-size: .9rem; }
.tour__bar { height: 6px; border-radius: 3px; background: #dbe6e2; overflow: hidden; }
.tour__bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #13a06d, #145c55); transition: width .3s ease; }
.tour__icon { align-self: center; display: grid; place-items: center; width: 5.5rem; height: 5.5rem; margin-top: 1rem; border-radius: 1.6rem; background: linear-gradient(140deg, #13a06d, #0d704d); color: #fff; box-shadow: 0 16px 34px rgba(16, 132, 90, .3); }
.tour__icon.is-red { background: linear-gradient(140deg, #e53935, #c62828); box-shadow: 0 16px 34px rgba(198, 40, 40, .3); }
.tour__icon .i { width: 2.6rem; height: 2.6rem; }
.tour h1 { margin-top: .4rem; }
.tour__text { margin: 0; text-align: center; color: var(--ink-2); font-size: 1.02rem; line-height: 1.6; }
.tour__where { display: grid; gap: .4rem; margin-top: .4rem; padding: .8rem; border-radius: 1.1rem; background: var(--card); border: 1px solid var(--line); }
.tour__where .mut { text-align: center; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.tour__tabs { display: flex; justify-content: space-around; }
.tour__tabs span { flex: 1; display: grid; justify-items: center; gap: .1rem; padding: .45rem .2rem; border-radius: .8rem; color: #8a9a98; font-weight: 700; }
.tour__tabs small { font-size: .7rem; }
.tour__tabs span.on { color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px var(--accent); }
.tour__nav { margin-top: auto; }
.tour__nav .btn { flex: 1; }

/* ---------- Tryb ciemny ---------- */
html.dark {
  --bg: #0e1819; --card: #172a2c; --ink: #e8f0ee; --ink-2: #c2d2cf; --muted: #94a9a6; --line: #264043;
  --brand: #8fd3c6; --brand-deep: #e8f0ee; --brand-soft: #173b38; --accent: #34b37f; --accent-soft: #16392c;
  --warn: #f3c46b; --warn-soft: #3a2e15; --red: #ef5350; --red-soft: #3c1d1d; color-scheme: dark;
}
html.dark body { background: var(--bg); }
@media (min-width: 640px) { html.dark body { background: radial-gradient(900px 600px at 80% -10%, rgba(16, 132, 90, .2), transparent), #0a1213; } }
html.dark .app { box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, .4); }
html.dark .btn.p, html.dark .day input:checked + span, html.dark .cal__grid button.is-sel, html.dark .tour__bar i { background: #1a6e66; color: #fff; }
html.dark .btn.s, html.dark .hg a, html.dark .lng { background: var(--brand-soft); color: var(--brand); }
html.dark .btn.ghost { color: var(--ink-2); border-color: var(--line); }
html.dark .tabs { background: #132224; border-top-color: var(--line); }
html.dark .tabs a { color: #7f9794; }
html.dark .tabs a.on { color: var(--brand); background: var(--brand-soft); }
html.dark .seg, html.dark .day span, html.dark .mini, html.dark .pop__x, html.dark .ck__top em, html.dark .tour__bar { background: #10201f; }
html.dark .seg button { color: var(--muted); }
html.dark .seg button.on { background: #24403f; color: var(--brand); box-shadow: none; }
html.dark .form input, html.dark .form select, html.dark .form textarea, html.dark .pick, html.dark .pop__search, html.dark .ck__last input { background: #10201f; border-color: #2e4b4c; color: var(--ink); }
html.dark .pick.is-empty .pv { color: #7f9794; }
html.dark .sw { background: #355150; }
html.dark .sw.on { background: var(--accent); }
html.dark .app input[type="checkbox"] { background: #10201f; border-color: #4a6a68; }
html.dark .app input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
html.dark .chk { background: #10201f; border-color: #4a6a68; }
html.dark .chk.on { background: var(--accent); border-color: var(--accent); }
html.dark .pop { background: #172a2c; border-color: var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, .5); }
html.dark .pop__list button { color: var(--ink); }
html.dark .cal__grid button { color: var(--ink); }
html.dark .cal__grid button:disabled { color: #3f5a59; }
html.dark .cal__foot, html.dark .vac, html.dark .theme { border-color: var(--line); }
html.dark .week li, html.dark .doses li, html.dark .entries li, html.dark .ck li, html.dark .list a, html.dark .list button { border-bottom-color: #213a3b; }
html.dark .doses li.is-next { background: var(--warn-soft); }
html.dark .feat > div, html.dark .sub { background: var(--card); border-color: var(--line); }
html.dark .feat span { background: var(--brand-soft); color: var(--brand); }
html.dark .offline { background: #1f3436; color: var(--ink-2); }
html.dark .empty { background: var(--card); border-color: #355150; color: var(--ink-2); }
html.dark .pr { border-bottom-color: #3a2a2a; }
html.dark .lock, html.dark .medcard__i, html.dark .card.okc { color: #6fd3a5; }
html.dark .card.okc { background: var(--accent-soft); border-color: #24503f; }
html.dark .card.warn, html.dark .status { background: var(--warn-soft); border-color: #5a4720; color: var(--ink); }
html.dark .status--closed, html.dark .status--urgent, html.dark .card.danger { background: var(--red-soft); border-color: #5a2a2a; }
html.dark .status .dates { color: var(--warn); }
html.dark .q { background: var(--card); border-color: var(--line); color: var(--brand); }
html.dark .q.main { background: linear-gradient(140deg, #13a06d, #0d704d); color: #fff; }
html.dark .q.rez { background: linear-gradient(135deg, #e53935, #c62828); color: #fff; }
html.dark .hero { background: linear-gradient(140deg, #1a524c, #0b2423); box-shadow: 0 14px 30px rgba(0, 0, 0, .35); }
html.dark .ob { background: linear-gradient(180deg, #12302b 0%, var(--bg) 45%); }
html.dark .ob__shield { background: var(--accent-soft); color: #6fd3a5; }
html.dark .chart line { stroke: #264043; }
html.dark .chart text { fill: #8ea5a2; }
html.dark .hint { background: #173b38; border-color: #2e5b55; color: var(--ink); }
html.dark .hint::before { background: #173b38; border-color: #2e5b55; }
html.dark .hint button, html.dark .hint::after { background: #10201f; color: var(--ink); }
html.dark .toast { background: #e8f0ee; color: #142629; }
html.dark .backbtn { background: var(--card); border-color: var(--line); }
html.dark .tour__tabs span { color: #7f9794; }
html.dark .tour__tabs span.on { color: var(--brand); }
html.dark .link { background: var(--card); border-color: var(--line); color: var(--ink-2); }

/* ---------- Animacje (krótkie; wyłączone przy „Ogranicz ruch”) ---------- */
/* 1. Przejścia między ekranami */
.screen.anim-fwd { animation: scrFwd .32s cubic-bezier(.2, .8, .2, 1) both; }
.screen.anim-back { animation: scrBack .32s cubic-bezier(.2, .8, .2, 1) both; }
.screen.anim-fade { animation: scrFade .28s ease both; }
@keyframes scrFwd { from { opacity: 0; transform: translateX(34px); } to { opacity: 1; transform: none; } }
@keyframes scrBack { from { opacity: 0; transform: translateX(-34px); } to { opacity: 1; transform: none; } }
@keyframes scrFade { from { opacity: 0; } to { opacity: 1; } }

/* 5. Karty pojawiają się kolejno */
.screen[class*="anim-"] > * { animation: cardIn .38s cubic-bezier(.2, .8, .2, 1) both; }
.screen[class*="anim-"] > *:nth-child(2) { animation-delay: .03s; }
.screen[class*="anim-"] > *:nth-child(3) { animation-delay: .06s; }
.screen[class*="anim-"] > *:nth-child(4) { animation-delay: .09s; }
.screen[class*="anim-"] > *:nth-child(5) { animation-delay: .12s; }
.screen[class*="anim-"] > *:nth-child(6) { animation-delay: .15s; }
.screen[class*="anim-"] > *:nth-child(n+7) { animation-delay: .18s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 2. Odhaczenie leku */
.doses li.just .chk { animation: chkPop .42s cubic-bezier(.3, 1.6, .5, 1) both; }
.doses li.just .chk path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: chkDraw .32s .12s ease forwards; }
.doses li.just strong { animation: doneFade .5s ease both; }
@keyframes chkPop { 0% { transform: scale(.7); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes chkDraw { to { stroke-dashoffset: 0; } }
@keyframes doneFade { from { color: var(--ink); } to { color: var(--muted); } }

/* 3. Wykresy się rysują */
.chart .ln { stroke-dasharray: 1; stroke-dashoffset: 1; animation: lineDraw .9s .1s cubic-bezier(.4, 0, .2, 1) forwards; }
.chart .pt { opacity: 0; animation: ptIn .3s .75s ease forwards; }
@keyframes lineDraw { to { stroke-dashoffset: 0; } }
@keyframes ptIn { to { opacity: 1; } }
#print .chart .ln { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
#print .chart .pt { opacity: 1; animation: none; }

/* 4. Zielona kropka „Teraz otwarte” */
.hero.is-open .pill .dot { animation: dotPulse 2.2s ease-out infinite; }
@keyframes dotPulse { 0% { box-shadow: 0 0 0 0 rgba(143, 214, 181, .7); } 70% { box-shadow: 0 0 0 8px rgba(143, 214, 181, 0); } 100% { box-shadow: 0 0 0 0 rgba(143, 214, 181, 0); } }

/* 6. Wprowadzenie i przewodnik przesuwają się w bok */
.ob.ob-fwd > * { animation: obFwd .34s cubic-bezier(.2, .8, .2, 1) both; }
.ob.ob-back > * { animation: obBack .34s cubic-bezier(.2, .8, .2, 1) both; }
.ob.ob-fwd .tour__nav, .ob.ob-back .tour__nav, .ob.ob-fwd .tour__top, .ob.ob-back .tour__top, .ob.ob-fwd .tour__bar, .ob.ob-back .tour__bar { animation: none; }
@keyframes obFwd { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes obBack { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }

/* 7. Przyciski i kafelki lekko się wciskają */
.q, .btn, .hg a, .list a, .list button, .tabs a, .chk, .seg button, .pick, .lng, .backbtn, .medcard, .link { transition: transform .12s ease, background-color .2s, box-shadow .2s; }
.q:active, .btn:active, .hg a:active, .list a:active, .list button:active, .seg button:active, .pick:active, .lng:active, .backbtn:active, .medcard:active, .link:active { transform: scale(.97); }
.tabs a:active, .chk:active { transform: scale(.92); }

/* 8. „Zapisano ✓” */
.toast { animation: toastIn .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (prefers-reduced-motion: reduce) {
  .screen, .screen > *, .ob > *, .chart .ln, .chart .pt, .doses li.just .chk, .doses li.just .chk path, .doses li.just strong, .hero .pill .dot, .toast, .pop, .q.rez::before { animation: none !important; }
  .chart .ln { stroke-dashoffset: 0; }
  .chart .pt { opacity: 1; }
  .doses li.just .chk path { stroke-dashoffset: 0; }
  .q:active, .btn:active, .tabs a:active, .chk:active { transform: none; }
}

/* ---------- Dolny pasek: przesuwane zaznaczenie ---------- */
.tabs__ind { position: absolute; z-index: 0; top: .4rem; bottom: calc(.45rem + env(safe-area-inset-bottom, 0px)); left: .4rem; width: calc((100% - .8rem) / 4); border-radius: .9rem; background: var(--brand-soft); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .55s cubic-bezier(.22, .9, .3, 1), background-color .45s ease; }
.tabs[data-on="2"] .tabs__ind { background: var(--red-soft); }
.tabs[data-on="-1"] .tabs__ind { opacity: 0; }
.tabs a, html.dark .tabs a { position: relative; z-index: 1; background: transparent !important; transition: color .45s ease, transform .18s ease; }
.tabs a .i { transition: transform .45s cubic-bezier(.22, .9, .3, 1); }
.tabs a.on .i { transform: translateY(-2px) scale(1.08); }

/* ---------- Spokojniejsze tempo animacji ---------- */
.screen.anim-fwd { animation: scrFwd .55s cubic-bezier(.22, .9, .3, 1) both; }
.screen.anim-back { animation: scrBack .55s cubic-bezier(.22, .9, .3, 1) both; }
.screen.anim-fade { animation: scrFade .5s ease both; }
@keyframes scrFwd { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes scrBack { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.screen[class*="anim-"] > * { animation: cardIn .6s cubic-bezier(.22, .9, .3, 1) both; }
.screen[class*="anim-"] > *:nth-child(2) { animation-delay: .06s; }
.screen[class*="anim-"] > *:nth-child(3) { animation-delay: .12s; }
.screen[class*="anim-"] > *:nth-child(4) { animation-delay: .18s; }
.screen[class*="anim-"] > *:nth-child(5) { animation-delay: .24s; }
.screen[class*="anim-"] > *:nth-child(6) { animation-delay: .3s; }
.screen[class*="anim-"] > *:nth-child(n+7) { animation-delay: .34s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ob.ob-fwd > * { animation: obFwd .55s cubic-bezier(.22, .9, .3, 1) both; }
.ob.ob-back > * { animation: obBack .55s cubic-bezier(.22, .9, .3, 1) both; }
@keyframes obFwd { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes obBack { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.tour__bar i { transition: width .6s cubic-bezier(.22, .9, .3, 1); }
.chart .ln { animation: lineDraw 1.3s .15s cubic-bezier(.4, 0, .2, 1) forwards; }
.chart .pt { animation: ptIn .45s 1.1s ease forwards; }
.doses li.just .chk { animation: chkPop .55s cubic-bezier(.3, 1.4, .5, 1) both; }
.doses li.just .chk path { animation: chkDraw .45s .15s ease forwards; }
.doses li.just strong { animation: doneFade .7s ease both; }
.toast { animation: toastIn .45s cubic-bezier(.22, .9, .3, 1); }
.pop { animation: popIn .25s ease; }
.pop--sheet { animation: sheetUp .38s cubic-bezier(.22, .9, .3, 1); }
.q, .btn, .hg a, .list a, .list button, .chk, .seg button, .pick, .lng, .backbtn, .medcard, .link { transition: transform .2s ease, background-color .3s, box-shadow .3s; }
.sw::after { transition: left .3s cubic-bezier(.22, .9, .3, 1); }
.sw { transition: background .3s ease; }
@media (prefers-reduced-motion: reduce) {
  .tabs__ind, .tabs a .i, .tour__bar i { transition: none !important; }
  .tabs a.on .i { transform: none; }
  .screen, .screen > *, .ob > *, .chart .ln, .chart .pt, .doses li.just .chk, .doses li.just .chk path, .doses li.just strong, .toast, .pop, .pop--sheet { animation: none !important; }
}

/* Nagłówek w kartach-listach („Moje zdrowie”, „Wszystkie leki”) – odstęp jak w innych kartach */
.card.list > .kick { margin: 0; padding: .75rem .7rem .35rem; border-bottom: 1px solid #edf2f0; }
html.dark .card.list > .kick { border-bottom-color: #213a3b; }

/* ---------- Płynne przenikanie ekranów (View Transitions) ---------- */
.screen { view-transition-name: screen; }
.tabs { view-transition-name: tabs; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-old(tabs) { display: none; }
::view-transition-new(tabs) { animation: none; }
::view-transition-group(screen) { animation-duration: .7s; animation-timing-function: cubic-bezier(.25, .8, .25, 1); }
::view-transition-old(screen), ::view-transition-new(screen) { animation-duration: .7s; animation-timing-function: cubic-bezier(.25, .8, .25, 1); animation-fill-mode: both; }
html[data-dir="fade"]::view-transition-old(screen) { animation-name: vtFadeOut; }
html[data-dir="fade"]::view-transition-new(screen) { animation-name: vtFadeIn; }
html[data-dir="fwd"]::view-transition-old(screen) { animation-name: vtOutLeft; }
html[data-dir="fwd"]::view-transition-new(screen) { animation-name: vtInRight; }
html[data-dir="back"]::view-transition-old(screen) { animation-name: vtOutRight; }
html[data-dir="back"]::view-transition-new(screen) { animation-name: vtInLeft; }
@keyframes vtFadeOut { to { opacity: 0; } }
@keyframes vtFadeIn { from { opacity: 0; } }
@keyframes vtOutLeft { to { opacity: 0; transform: translateX(-28px); } }
@keyframes vtInRight { from { opacity: 0; transform: translateX(28px); } }
@keyframes vtOutRight { to { opacity: 0; transform: translateX(28px); } }
@keyframes vtInLeft { from { opacity: 0; transform: translateX(-28px); } }

/* ---------- Jeszcze spokojniej: starsze przeglądarki, pasek, przewodnik ---------- */
.screen.anim-fwd { animation: scrFwd .7s cubic-bezier(.25, .8, .25, 1) both; }
.screen.anim-back { animation: scrBack .7s cubic-bezier(.25, .8, .25, 1) both; }
.screen.anim-fade { animation: scrFade .6s ease both; }
.tabs__ind { transition: transform .65s cubic-bezier(.25, .8, .25, 1), background-color .5s ease; }
.tabs a .i { transition: transform .55s cubic-bezier(.25, .8, .25, 1); }
.ob.ob-fwd > * { animation: obFwd .65s cubic-bezier(.25, .8, .25, 1) both; }
.ob.ob-back > * { animation: obBack .65s cubic-bezier(.25, .8, .25, 1) both; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .tabs__ind { transition: none !important; }
}

/* Bez wjeżdżania kart z dołu – cały ekran przesuwa się tylko w poziomie (lewo / prawo) */
.screen[class*="anim-"] > * { animation: none; }

/* Dawka, której godzina minęła, a nie jest odhaczona */
.doses li.is-late .tm { color: var(--warn); }
.doses li.is-late .chk { border-color: #e2b45c; }

/* ---------- Wiadomości z praktyki ---------- */
.news { border-left: 0; background: linear-gradient(135deg, #eaf6f1, #ffffff 70%); border-color: #cfe7dd; }
.news .kick { display: flex; align-items: center; gap: .4rem; }
.news .kick .i { width: 1rem; height: 1rem; }
.news__new { margin-left: auto; font-style: normal; padding: .15rem .55rem; border-radius: 99px; background: var(--accent); color: #fff; font-size: .68rem; letter-spacing: .04em; animation: newPulse 2.4s ease-in-out infinite; }
@keyframes newPulse { 50% { box-shadow: 0 0 0 5px rgba(16, 132, 90, .15); } }
.news__msg { white-space: pre-line; color: var(--ink-2); }
.news--important { background: linear-gradient(135deg, var(--warn-soft), #fff 70%); border-color: #f3dfae; }
.news--urgent { background: linear-gradient(135deg, var(--red-soft), #fff 70%); border-color: #f5c2c2; }
.news .btn { justify-self: start; }
html.dark .news { background: linear-gradient(135deg, #173b38, var(--card) 70%); border-color: #2e5b55; }
html.dark .news--important { background: linear-gradient(135deg, var(--warn-soft), var(--card) 70%); border-color: #5a4720; }
html.dark .news--urgent { background: linear-gradient(135deg, var(--red-soft), var(--card) 70%); border-color: #5a2a2a; }

/* ---------- Zapas leków ---------- */
.low { background: var(--warn-soft); border-color: #f3dfae; }
.low__head { display: grid; grid-template-columns: 2.4rem 1fr; gap: .7rem; align-items: center; }
.low__head > div { display: grid; }
.low__head small { color: var(--ink-2); font-size: .84rem; }
.low__i { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: .7rem; background: #fff; color: var(--warn); }
.low .row2 .btn { flex: 1 1 auto; }
html.dark .low { border-color: #5a4720; }
html.dark .low__i { background: #10201f; }
.list small.stock { color: #0b5c40; font-weight: 600; }
.list small.stock.is-low { color: var(--warn); }
html.dark .list small.stock { color: #6fd3a5; }
.stockset { margin: .8rem 0 0; padding: .8rem; border: 1px dashed #c7d6d2; border-radius: .9rem; display: grid; gap: .35rem; }
.stockset legend { padding: 0 .3rem; font-weight: 800; font-size: .85rem; color: var(--ink-2); }
.stockset .mut { margin: 0; font-size: .8rem; }
html.dark .stockset { border-color: #355150; }

/* ---------- Przypomnienie o pomiarze ---------- */
.measrem .line { align-items: center; }
.measrem input[type="time"] { flex: none; width: 7.2rem; min-height: 2.6rem; padding: .4rem .6rem; border: 1px solid #cfdcd8; border-radius: .7rem; background: #fafcfb; font: 600 1rem var(--sans); color: var(--ink); }
html.dark .measrem input[type="time"] { background: #10201f; border-color: #2e4b4c; }

/* Pomysły i uwagi */
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#fb-form .seg { margin-bottom: .3rem; }
#fb-form .tip { margin-top: .6rem; font-size: .82rem; }
#fb-form .btn[disabled] { opacity: .7; }

/* Najwęższe telefony (320 px): kolumny mogą się zwęzić, długie słowa („Wideokonsultacja”) dzielą się zamiast rozpychać ekran */
.qa, .seg, .seg3 { grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
.seg, .seg3 { --cols: 3; }
.q, .seg button { min-width: 0; }
.q span, .q small, .seg button { overflow-wrap: anywhere; hyphens: auto; }
/* Podpisy w dolnym pasku zakładek min. 12 px */
.tabs a span, .tabs button span, .tabs__lbl { font-size: max(.75rem, 12px); }
/* Ekran i kafelki „Moje zdrowie” też mogą się zwęzić na 320 px */
.screen { grid-template-columns: minmax(0, 1fr); }
.hg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hg a, .hg a span { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }

/* Tryb pokazowy w ramce telefonu na podstronie: bez paska przewijania (jak w prawdziwym telefonie) */
html.is-demo, html.is-demo * { scrollbar-width: none; }
html.is-demo ::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* Tryb pokazowy: pulsujące podświetlenie elementu, który podstrona proponuje kliknąć */
@keyframes demoSpot { 0% { box-shadow: 0 0 0 0 rgba(31, 157, 138, .6); } 70% { box-shadow: 0 0 0 16px rgba(31, 157, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 157, 138, 0); } }
html.is-demo .demo-spot { position: relative; z-index: 2; outline: 3px solid #1f9d8a; outline-offset: 3px; animation: demoSpot 1.5s ease-out infinite; }
html.is-demo .demo-spot--r { border-radius: 14px; }
/* „dotknięcie palcem” tuż przed kliknięciem */
@keyframes demoTap { 0% { transform: scale(1); } 45% { transform: scale(.94); } 100% { transform: scale(1); } }
html.is-demo .demo-tap { animation: demoTap .32s ease; }
/* pod dolnym paskiem iPhone'a jest pasek „home” – miejsce jak w prawdziwym telefonie */
html.is-demo .tabs { padding-bottom: 26px; }
/* na liście wyboru (okienko z przewijaniem) ramka do środka, żeby nie była ucięta */
@keyframes demoSpotIn { 0% { box-shadow: inset 0 0 0 0 rgba(31, 157, 138, .35); } 50% { box-shadow: inset 0 0 0 6px rgba(31, 157, 138, .18); } 100% { box-shadow: inset 0 0 0 0 rgba(31, 157, 138, 0); } }
html.is-demo .pop .demo-spot { outline-offset: -3px; border-radius: 12px; background: rgba(31, 157, 138, .08); animation: demoSpotIn 1.5s ease-out infinite; }

/* Karta ratunkowa widoczna bez odblokowania: tapeta + instrukcja z kopiowaniem */
.lockcard { display: grid; gap: .6rem; }
.lockcard .kick { display: flex; align-items: center; gap: .4rem; margin: 0; }
.lockcard .kick .i { width: 1rem; height: 1rem; }
.lockcard .mut { margin: 0; }
.idhow { padding: 0; }
.idhow summary { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .95rem 1.1rem; font-weight: 700; cursor: pointer; list-style: none; }
.idhow summary::-webkit-details-marker { display: none; }
.idhow summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--accent); }
.idhow[open] summary::after { content: "−"; }
.howto { margin: 0; padding: 0 1.1rem .4rem 2.4rem; display: grid; gap: .45rem; font-size: .92rem; }
.copyrows { display: grid; border-top: 1px solid var(--line); }
.copyrow { display: flex; align-items: center; gap: .7rem; padding: .65rem 1.1rem; border-bottom: 1px solid var(--line); }
.copyrow:last-child { border-bottom: 0; }
.copyrow > span { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.copyrow small { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.copyrow b { font-weight: 600; overflow-wrap: anywhere; }
.copyrow .btn { flex: none; }

/* Reise-Check: leki w podróży + zaświadczenie */
.trmeds { display: grid; gap: .7rem; }
.trmeds .kick { display: flex; align-items: center; gap: .4rem; margin: 0; }
.trmeds .kick .i { width: 1rem; height: 1rem; }
.trmeds h2 { margin: 0; }
.trmeds .mut { margin: 0; }
.trmeds .howto { padding: 0 0 0 1.3rem; }
.tmbtm { display: grid; gap: .45rem; padding: .85rem 1rem; border-radius: 1rem; background: #fff6e0; color: #5a4300; }
.tmbtm b { display: flex; align-items: center; gap: .4rem; font-size: .92rem; }
.tmbtm b .i { width: 1.05rem; height: 1.05rem; flex: none; }
.tmbtm p { margin: 0; font-size: .86rem; line-height: 1.45; }
.tmbtm .btn { justify-self: start; }
.tmtips { margin: 0; padding: 0; list-style: none; display: grid; gap: .4rem; font-size: .88rem; color: var(--ink-2); }
.tmtips li { display: flex; gap: .5rem; align-items: flex-start; }
.tmtips .i { width: 1rem; height: 1rem; flex: none; margin-top: .15rem; color: var(--accent); }
@media print {
  #print .pcert { margin: 10px 0; font-size: 10pt; }
  #print .pcert i { color: #5d6f72; }
  #print .pline { display: inline-block; height: 1em; border-bottom: 1px solid #142629; vertical-align: bottom; }
  #print .pt td small { color: #5d6f72; font-size: 8pt; }
  #print .psign { display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px; margin-top: 22px; break-inside: avoid; }
  #print .psign span { display: block; font-size: 8.5pt; color: #5d6f72; margin-bottom: 26px; }
  #print .psign .pline { display: block; width: 100%; }
  #print .pstamp { height: 80px; border: 1px dashed #9fb3ae; border-radius: 6px; }
}
/* pokaz w telefonie na podstronie: bez rozmycia pod dolnym paskiem (telefon jest przeskalowany – rozmycie bardzo spowalnia) */
html.is-demo .tabs { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }

/* Drukuj / Zapisz PDF */
.docbtn { display: grid; gap: .45rem; }
.docbtn > p { margin: 0; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.docbtn .row2 { margin: 0; }

/* ===== Tablet i iPad (od 768 px): boczny pasek nawigacji zamiast dolnego, szersza treść ===== */
@media (min-width: 768px) {
  :root { --rail: 108px; }
  body, html.dark body { background: var(--bg); }
  .app { max-width: none; margin: 0 0 0 calc(var(--rail) + env(safe-area-inset-left, 0px)); box-shadow: none; }
  .screen { max-width: 780px; margin: 0 auto; gap: 1rem; padding: calc(env(safe-area-inset-top, 0px) + 1.6rem) max(2rem, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 2.5rem) 2rem; }
  .ah img { width: 3rem; height: 3rem; }
  .ah h1 { font-size: 1.45rem; }
  .ah p { font-size: .9rem; }
  .card { padding: 1.2rem 1.35rem; border-radius: 1.35rem; }
  /* pasek nawigacji po lewej, jak w aplikacjach na iPada */
  .tabs { top: 0; bottom: 0; left: 0; right: auto; width: calc(var(--rail) + env(safe-area-inset-left, 0px)); max-width: none; margin: 0; flex-direction: column; justify-content: center; gap: 8px; padding: calc(env(safe-area-inset-top, 0px) + 1rem) .6rem calc(env(safe-area-inset-bottom, 0px) + 1rem) calc(env(safe-area-inset-left, 0px) + .6rem); border-top: 0; border-right: 1px solid var(--line); }
  .tabs a { flex: none; height: 76px; align-content: center; padding: 0 .2rem; font-size: .76rem; }
  .tabs a .i { width: 1.75rem; height: 1.75rem; }
  .tabs__ind { top: calc(50% - 164px); bottom: auto; left: calc(env(safe-area-inset-left, 0px) + .6rem); width: calc(100% - 1.2rem - env(safe-area-inset-left, 0px)); height: 76px; transform: translateY(calc(var(--i, 0) * 84px)); }
  .tabs a.on .i { transform: scale(1.1); }
  /* szybkie akcje i kafelki: więcej kolumn */
  .qa { grid-template-columns: repeat(4, 1fr); gap: .75rem; }
  .q { min-height: 6.6rem; padding: 1rem; }
  .hg { grid-template-columns: repeat(4, 1fr); }
  .toast { left: calc(50% + var(--rail) / 2); bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); }
}
/* iPad poziomo / duży tablet: jeszcze szerzej */
@media (min-width: 1100px) {
  .screen { max-width: 900px; }

}
@media (min-width: 768px) { html.is-demo .tabs { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem); } }
