/* ==========================================================================
   EmbrioLife — prototyp (wersja poglądowa)
   PALETA: wszystkie kolory marki są w zmiennych poniżej. Po otrzymaniu logo
   wystarczy podmienić --brand*, --accent*, --info* (jasny i ciemny motyw).
   ========================================================================== */
:root {
  /* kolory marki — róż z logo EmbrioLife (#E4599A) */
  --brand-logo: #e4599a;     /* dokładny róż z logo: tylko dekoracja (paski, podkreślenia) */
  --brand: #b42f6c;          /* róż pogłębiony: przyciski, linki, tekst — biały tekst spełnia WCAG AA */
  --brand-strong: #962458;
  --brand-soft: #fbeaf2;
  --on-brand: #ffffff;
  --accent: #8a570c;         /* uzupełniający ciepły: wpisy hodowcy */
  --accent-soft: #f6ecdc;
  --info: #2a6b68;           /* uzupełniający chłodny: lekarz, wykres, statusy */
  --info-soft: #e3f0ef;
  --hero: #26262b;           /* grafit */
  --hero-text: #ffffff;

  /* baza neutralna: ciepła biel / grafit */
  --bg: #f7f5f3;
  --surface: #ffffff;
  --surface-2: #f0edea;
  --border: #e3dfdb;
  --border-strong: #c2bcb6;
  --text: #26262b;
  --muted: #63605f;

  /* stany */
  --ok: #24744a;
  --ok-soft: #e1f2e8;
  --danger: #b0352d;
  --danger-soft: #fbe9e7;
  --demo: #26262b;
  --demo-text: #f3f1ee;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(38, 38, 43, .05), 0 6px 20px rgba(38, 38, 43, .06);
  --shadow-lg: 0 20px 60px rgba(20, 20, 24, .28);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --bar-h: 0px;
  --side-w: 248px;
  color-scheme: light;
}
[data-theme="dark"] {
  --brand: #f088b6;
  --brand-strong: #f7a8cb;
  --brand-soft: #3a1c2b;
  --on-brand: #2a0817;
  --accent: #e2a868;
  --accent-soft: #33271a;
  --info: #72c4be;
  --info-soft: #17302f;
  --hero: #2c2c33;
  --hero-text: #ffffff;

  --bg: #151517;
  --surface: #1d1d21;
  --surface-2: #26262b;
  --border: #34343a;
  --border-strong: #505058;
  --text: #efedea;
  --muted: #a8a4a2;

  --ok: #6cc795;
  --ok-soft: #163324;
  --danger: #f08a80;
  --danger-soft: #3a1c19;
  --demo: #0b0b0d;
  --demo-text: #e6e3df;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  overflow-x: hidden; min-height: 100vh;
  transition: background-color .25s ease, color .25s ease;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 12px 16px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- pasek „brak połączenia” (kolejka zmian czeka na sieć) ---------- */
.netbar {
  position: fixed; left: 50%; top: 10px; transform: translateX(-50%); z-index: 90; max-width: calc(100vw - 24px);
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px;
  background: var(--demo, #3b2f2a); color: var(--demo-text, #fff); font-size: 14px; line-height: 1.35; box-shadow: 0 8px 26px rgba(0,0,0,.22);
}
.netbar[hidden] { display: none; }
.netbar svg { width: 18px; height: 18px; flex: none; }
@media (max-width: 860px) { .netbar { top: auto; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); border-radius: 14px; width: calc(100vw - 24px); } }
/* ---------- ekran startu ---------- */
.boot { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px 16px; text-align: center; }
.boot__t { max-width: 360px; }
.empty--start { padding: 34px 18px; color: var(--text); }
.empty--start .btn { margin-top: 4px; }

/* ---------- logo (pliki od grafika: logo-roz.png jasny motyw, logo-bialy.png ciemny) ---------- */
.logo { display: inline-flex; align-items: center; text-decoration: none; line-height: 0; }
.logo img { height: 46px; width: auto; display: block; }
.logo .logo__d { display: none; }
[data-theme="dark"] .logo .logo__l, .logo--white .logo__l { display: none; }
[data-theme="dark"] .logo .logo__d, .logo--white .logo__d { display: block; }
.logo--lg img { height: 76px; }
.side .logo img { height: 56px; }

/* ---------- przyciski ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:hover { border-color: var(--brand); }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn--primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--on-brand); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn--ghost:hover { background: var(--brand-soft); border-color: transparent; }
.btn--danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn--block { width: 100%; }
.btn--sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
.iconbtn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text);
  transition: background-color .15s ease, border-color .15s ease;
}
.iconbtn:hover { border-color: var(--brand); }
.iconbtn svg { width: 20px; height: 20px; }

/* ---------- formularze ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field > label, .fs > legend, .lbl { font-size: 14px; font-weight: 700; }
.opt { font-weight: 500; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.hint { font-size: 13px; color: var(--muted); }
.err { font-size: 13px; color: var(--danger); font-weight: 600; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; }
.unit { position: relative; }
.unit .input { padding-right: 58px; }
.unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.fs { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.fs > legend { padding: 0; margin-bottom: 8px; }
.fs--box { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 16px 2px; margin-bottom: 16px; }
.fs--box > legend { padding: 0 8px; margin-left: -8px; margin-bottom: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; flex: 1 1 auto; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  font-size: 15px; font-weight: 600; text-align: center; transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.seg input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }
.seg input:focus-visible + span { outline: 3px solid var(--info); outline-offset: 2px; }
.switch { position: relative; display: inline-flex; align-items: center; min-height: 44px; min-width: 56px; cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { width: 52px; height: 30px; border-radius: 30px; background: var(--border-strong); position: relative; transition: background-color .2s ease; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s ease; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(22px); }
.switch input:focus-visible + i { outline: 3px solid var(--info); outline-offset: 2px; }

/* ---------- logowanie ---------- */
.login { min-height: calc(100vh - var(--bar-h)); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login__aside {
  background: #26262b; border-right: 4px solid var(--brand-logo);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
[data-theme="dark"] .login__aside { background: #0f0f11; }
.login__aside h1 { font-family: var(--font-head); font-size: clamp(34px, 3.8vw, 52px); font-weight: 600; max-width: 15ch; line-height: 1.08; }
.login__aside ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; max-width: 46ch; }
.login__aside li { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; opacity: .95; }
.login__aside li svg { width: 20px; height: 20px; flex: none; margin-top: 3px; color: var(--brand-logo); }
.login__aside small { opacity: .8; font-size: 13px; }
.login__main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px 24px; gap: 20px; }
.login__card { width: 100%; max-width: 430px; animation: rise .45s ease both; }
.login__card h2 { font-family: var(--font-head); font-size: 36px; font-weight: 700; margin-bottom: 6px; }
.login__card > p { color: var(--muted); margin-bottom: 22px; }
.login__top { width: 100%; max-width: 430px; display: flex; justify-content: space-between; align-items: center; }
.login__top .logo { display: none; }
.login__links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -4px 0 14px; }
.linkbtn { background: none; border: 0; padding: 0; min-height: 44px; color: var(--brand); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 14.5px; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--text); font-size: 14px; align-items: flex-start; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--info); }
.notice--warn { background: var(--accent-soft); }
.notice--warn svg { color: var(--accent); }
.login__demo { margin-top: 22px; padding: 18px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.login__demo h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.login__demo .btn { margin-bottom: 10px; }
.login__demo .btn:last-of-type { margin-bottom: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- układ aplikacji ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - var(--bar-h)); }
.side {
  position: sticky; top: var(--bar-h); height: calc(100vh - var(--bar-h)); align-self: start;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 22px;
}
.side__who { font-size: 13px; color: var(--muted); padding: 0 10px; }
.side__who strong { display: block; color: var(--text); font-size: 14.5px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav__item {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 12px;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px;
  transition: background-color .15s ease, color .15s ease;
}
.nav__item svg { width: 20px; height: 20px; flex: none; color: var(--muted); transition: color .15s ease; }
.nav__item:hover { background: var(--surface-2); }
.nav__item[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }
.nav__item[aria-current="page"] svg { color: var(--brand); }
.nav__badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--brand); color: var(--on-brand); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.side__foot { margin-top: auto; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.topbar { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.page { width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 32px 24px; flex: 1; animation: fade .25s ease both; }
.page--narrow { max-width: 760px; }
.page__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page__title { font-family: var(--font-head); font-size: 38px; font-weight: 700; line-height: 1.05; }
.page__sub { color: var(--muted); margin-top: 4px; font-size: 15px; }
.footer { padding: 20px 32px 28px; color: var(--muted); font-size: 13px; text-align: center; }
.bottomnav { display: none; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; text-decoration: none; font-size: 14.5px; margin-bottom: 4px; }
.back svg { width: 18px; height: 18px; }

/* ---------- karty, kafle ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 16px; }
.card__title { font-size: 17px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card__title .btn { margin-left: auto; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cols > .card { margin-top: 0; }
.stack > * + * { margin-top: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-width: 0; box-shadow: var(--shadow); }
.stat__label { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat__value { font-size: 30px; font-weight: 800; line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat__value small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.stat__note { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stat--hero { background: var(--hero); border-color: var(--hero); color: var(--hero-text); }
.stat--hero .stat__label, .stat--hero .stat__note, .stat--hero .stat__value small { color: inherit; opacity: .85; }
.progress { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.stat--hero .progress { background: rgba(255, 255, 255, .18); }
.progress__bar { height: 100%; border-radius: 8px; background: var(--brand-logo); transition: width .6s ease; }
.kv { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 15px; }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: break-word; }
.pre { white-space: pre-line; overflow-wrap: break-word; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }

/* ---------- znaczniki ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge--brand { background: var(--brand-soft); color: var(--brand-strong); }
.badge--accent { background: var(--accent-soft); color: var(--accent); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--new { background: var(--accent); color: var(--on-brand); }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sample { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 6px; padding: 1px 7px; letter-spacing: .01em; white-space: normal; }

/* ---------- lista pacjentek ---------- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 260px; min-width: 0; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 42px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 700; font-size: 14px; cursor: pointer; color: var(--text); transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip .num { opacity: .7; margin-left: 4px; }
.plist { display: grid; gap: 10px; }
.avatar { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }

/* ---------- nagłówek karty i zakładki ---------- */
.chead { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.chead__id { display: flex; gap: 14px; align-items: center; min-width: 0; }
.chead__id .avatar { width: 56px; height: 56px; font-size: 20px; border-radius: 16px; }
.chead h1 { font-family: var(--font-head); font-size: 36px; font-weight: 700; line-height: 1.05; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; font-weight: 700; font-size: 15px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .15s ease, border-color .15s ease; }
.tab:hover { color: var(--text); }
.tab[aria-current="page"] { color: var(--text); border-bottom-color: var(--brand-logo); }

/* ---------- działania ---------- */
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.todo li { display: flex; gap: 12px; align-items: center; min-height: 46px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.todo li:last-child { border-bottom: 0; }
.todo__date { margin-left: auto; font-size: 13.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.todo__txt { min-width: 0; overflow-wrap: break-word; font-weight: 600; }
.todo .done .todo__txt { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.tick { width: 44px; height: 44px; margin: 0 -8px 0 -10px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; color: var(--brand); }
.tick i { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; transition: background-color .15s ease, border-color .15s ease; }
.tick[aria-pressed="true"] i { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.tick svg { width: 14px; height: 14px; opacity: 0; }
.tick[aria-pressed="true"] svg { opacity: 1; }
.tick--ro { cursor: default; }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) 170px auto; gap: 8px; margin-top: 12px; align-items: end; }
.inline-form .field { margin: 0; }

/* ---------- chronologia ---------- */
.tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tl__item { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.tl__item--lekarz { border-left-color: var(--info); }
.tl__item--hodowca { border-left-color: var(--accent); }
.tl__item--fresh { animation: flash 1.6s ease 1; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); } 100% { box-shadow: var(--shadow); } }
.tl__head { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.tl__date { margin-left: auto; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl__who { font-size: 13.5px; color: var(--muted); }
.tl__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 16px; }
.tl__grid div { min-width: 0; }
.tl__k { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.tl__v { font-weight: 700; overflow-wrap: break-word; }
.tl__block { margin-top: 10px; }
.tl__block p { overflow-wrap: break-word; white-space: pre-line; }
.daysep { font-size: 12.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 8px 0 -2px; }

/* ---------- wykres ---------- */
.chart-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; }
.chart-head .chips .chip { min-height: 44px; padding: 0 14px; font-size: 13.5px; }
.chart { position: relative; width: 100%; min-height: 220px; touch-action: pan-y; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { stroke: var(--border-strong); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--info); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--info); stroke: var(--surface); stroke-width: 2; transition: r .12s ease; }
.chart .dot.on { r: 7; }
.chart .cross { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.chart .cross.on { opacity: 1; }
.chart .lastlbl { fill: var(--text); font-weight: 800; font-size: 13px; }
.chart__tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 13px; line-height: 1.3; white-space: nowrap; opacity: 0; transform: translate(-50%, -100%); transition: opacity .12s ease; z-index: 2; }
.chart__tip.on { opacity: 1; }
.chart__tip b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.chart-desc { font-size: 14px; color: var(--muted); margin-top: 10px; }
details.tblwrap { margin-top: 10px; }
details.tblwrap summary { min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--brand); font-size: 14.5px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* ---------- hodowcy / przypomnienia ---------- */
.rowcard { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 12px 16px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.rowcard + .rowcard { margin-top: 10px; }
.rowcard__name { font-weight: 800; font-size: 16.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rowcard__meta { color: var(--muted); font-size: 14px; overflow-wrap: break-word; }
.rowcard__act { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.rem { grid-template-columns: auto minmax(0, 1fr) auto; }
.email { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.email__head { background: var(--surface-2); padding: 12px 16px; font-size: 13.5px; display: grid; gap: 2px; overflow-wrap: break-word; }
.email__head b { font-weight: 700; }
.email__body { padding: 16px; font-size: 15px; white-space: pre-line; overflow-wrap: break-word; }
.email__subj { font-weight: 800; font-size: 16px; padding: 14px 16px 0; }

/* ---------- okna ---------- */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(8, 16, 14, .55); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .18s ease both; }
.modal { width: 100%; max-width: 620px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: rise .22s ease both; border: 1px solid var(--border); }
.modal--sm { max-width: 460px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 22px; border-bottom: 1px solid var(--border); }
.modal__head h2 { font-size: 19px; font-weight: 800; }
.modal__body { padding: 20px 22px; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.modal__foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-lg); animation: rise .25s ease both; text-align: center; }

/* ---------- powiadomienia ---------- */
.notif { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.notif + .notif { margin-top: 10px; }
.notif__ico { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.notif__ico svg { width: 20px; height: 20px; }
.notif--lekarz .notif__ico { background: var(--info-soft); color: var(--info); }
.notif__t { font-weight: 800; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.notif__d { font-size: 13px; color: var(--muted); margin-top: 2px; }
.notif > div { min-width: 0; }
.notif p { overflow-wrap: break-word; }

/* ---------- telefon / tablet ---------- */
@media (max-width: 1020px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .login { grid-template-columns: minmax(0, 1fr); }
  .login__aside { display: none; }
  .login__top .logo { display: inline-flex; }
  .login__main { justify-content: flex-start; padding-top: 20px; }
  .shell { display: block; }
  .side { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .topbar__act { display: flex; gap: 8px; }
  .page { padding: 18px 16px 16px; }
  .page__title { font-size: 31px; }
  .footer { padding: 16px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .bottomnav a { flex: 1 1 0; min-width: 0; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-decoration: none; border-radius: 12px; position: relative; transition: color .15s ease, background-color .15s ease; }
  .bottomnav a svg { width: 22px; height: 22px; }
  .bottomnav a[aria-current="page"] { color: var(--brand-strong); background: var(--brand-soft); }
  .bottomnav .nav__badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .rowcard { grid-template-columns: minmax(0, 1fr); }
  .rowcard__act { justify-content: flex-start; }
  .rem { grid-template-columns: auto minmax(0, 1fr); }
  .rem .rowcard__act { grid-column: 1 / -1; }
  .chead h1 { font-size: 30px; }
  .chead .btn { flex: 1 1 auto; }
  .tabs { margin-left: -16px; margin-right: -16px; padding: 0 12px; }
  .tab { padding: 0 12px; font-size: 14.5px; }
  .modal-back { padding: 0; align-items: flex-end; }
  .modal, .modal--sm { max-width: none; border-radius: 20px 20px 0 0; max-height: calc(100vh - var(--bar-h)); max-height: calc(100dvh - 24px); animation-name: sheet; border-bottom: 0; }
  .modal__foot .btn { flex: 1 1 auto; }
  .modal__body { padding: 18px 16px; }
  .modal__head { padding-left: 16px; }
  .modal__foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .inline-form { grid-template-columns: minmax(0, 1fr); }
  .toasts { bottom: 84px; }
  .stat__value { font-size: 26px; }
  .card { padding: 16px; }
}
@media (max-width: 420px) {
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .row2--keep { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dd { margin-bottom: 8px; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media print { .netbar, .side, .bottomnav, .topbar { display: none; } }

/* poprawki po przeglądzie zrzutów */
#main:focus, #main:focus-visible { outline: none; }
.badge, .sample { font-family: var(--font); letter-spacing: 0; line-height: 1.3; }

/* ---------- intro (wejście w motywie logo; tylko transform i opacity; łącznie 1,15 s) ---------- */
.intro { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; cursor: pointer; animation: intro-out .3s ease .85s both; will-change: opacity, transform; }
.intro__box { position: relative; overflow: hidden; padding: 4px 6px; }
.intro .logo img { height: auto; width: min(66vw, 440px); }
.intro__ecg { width: min(66vw, 440px); height: auto; display: block; }
.intro__ecg path { fill: none; stroke: var(--brand-logo); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.intro__cover { position: absolute; inset: 0; background: var(--bg); animation: intro-wipe .55s cubic-bezier(.6, 0, .2, 1) .05s both; will-change: transform; }
.intro__box--line .intro__cover { animation-duration: .5s; animation-delay: .28s; }
.intro__skip { position: absolute; left: 0; right: 0; bottom: 34px; text-align: center; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); animation: fade .3s ease .1s both; }
@keyframes intro-wipe { to { transform: translateX(101%); } }
@keyframes intro-out { to { opacity: 0; transform: scale(1.03); } }
/* przełącznik „Wyłącz animacje” */
[data-noanim] *, [data-noanim] *::before, [data-noanim] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
.optrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 2px 4px 2px 2px; font-weight: 700; font-size: 15px; }

/* ---------- odporność na bardzo długie imiona i teksty ---------- */
#app, #modal-root, .toasts { overflow-wrap: break-word; }
.chead__id > div, .rowcard > div, .modal__head h2, .prow__breeder, .prow__id > div, .card__title, .stat__value { min-width: 0; }
.btn { max-width: 100%; }
.modal__head h2 { overflow: hidden; }

/* ==========================================================================
   Uzupełnienia po audycie (hodowca + lekarz)
   ========================================================================== */
.input::placeholder { color: var(--muted); opacity: 1; }
.sec { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; margin-bottom: 10px; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.contact { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.contact .btn { white-space: normal; text-align: left; min-height: 46px; padding-top: 8px; padding-bottom: 8px; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-weight: 600; font-size: 15px; cursor: pointer; margin-bottom: 12px; }
.check input { width: 22px; height: 22px; flex: none; accent-color: var(--brand); }
.linkbtn--in { min-height: 44px; display: inline-flex; align-items: center; padding: 0 4px; }
.dogname { font-size: 21px; font-weight: 800; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toasts { top: calc(var(--bar-h) + 10px); bottom: auto; }

/* minimalna wielkość drobnego tekstu: 13 px */
.stat__label, .tl__k, .prow__k, .tbl th, .sample, .stat__note, .daysep { font-size: 13px; }
.chart text { font-size: 13px; }
.badge { font-size: 13px; }

/* kafle „Dziś wymaga uwagi” */
.qtiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.qtile { display: flex; align-items: center; gap: 12px; text-align: left; min-height: 64px; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; color: var(--text); transition: border-color .15s ease, background-color .15s ease; }
.qtile:hover { border-color: var(--brand); }
.qtile[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.qtile__n { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; min-width: 34px; }
.qtile__l { font-size: 13.5px; font-weight: 700; line-height: 1.25; }

/* lista pacjentek: gęsta tabela na komputerze, zwarte karty na telefonie */
.sortsel { display: none; flex: 1 1 200px; }
.phead, .prow { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.2fr) 104px 112px 118px 170px; gap: 12px; align-items: center; }
.phead { padding: 0 16px 6px; }
.phead__b { background: none; border: 0; padding: 0; min-height: 32px; text-align: left; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); cursor: pointer; }
span.phead__b { cursor: default; display: flex; align-items: center; }
.phead__b[aria-pressed="true"] { color: var(--text); }
.plist { display: grid; gap: 6px; }
.prow { min-height: 48px; padding: 6px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); font-size: 15px; transition: border-color .15s ease, background-color .15s ease; }
.prow:hover { border-color: var(--brand); background: var(--brand-soft); }
.prow > span { min-width: 0; }
.prow__name { display: flex; gap: 4px 8px; align-items: center; flex-wrap: wrap; }
.prow__name b { font-weight: 800; font-size: 16px; }
.prow__breed { color: var(--muted); font-size: 14px; }
.prow__breeder, .prow__last { color: var(--muted); font-size: 14.5px; }
.prow__breeder { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow__v { font-weight: 700; font-variant-numeric: tabular-nums; }
.prow__k { display: none; color: var(--muted); font-weight: 600; }

.chead__act { display: flex; gap: 10px; flex-wrap: wrap; }

/* działania */
.todo li { flex-wrap: nowrap; }
.todo__txt { flex: 1 1 auto; }
.todo__txt a { font-weight: 700; }
.todo__sub { display: block; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; }
.todo__sub--late { color: var(--danger); font-weight: 700; }
.todo .late .todo__date { color: var(--danger); font-weight: 700; }
.todo__date { margin-left: 0; }
.dotmark { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; margin: 0 6px 0 4px; }
.dotmark--done { background: var(--ok); border-color: var(--ok); }
.iconbtn--plain { border-color: transparent; background: transparent; color: var(--muted); flex: none; margin: 0 -6px; }
.iconbtn--plain:hover { color: var(--brand); border-color: transparent; background: var(--brand-soft); }
.inline-form { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 160px auto; }
.rlist { list-style: none; margin: 0; padding: 0; }
.rlist li { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border); }
.rlist li:last-child { border-bottom: 0; }
.optrow > span:first-child { min-width: 0; }

/* wpisy: popraw / usuń */
.tl__tools { display: flex; gap: 4px; flex-wrap: wrap; margin: 10px -10px -6px; }

/* dziennik hodowcy */
.tday { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--info); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; font-size: 15px; }
.tday .hint { flex: 1 1 100%; }
.tday__p { color: var(--muted); font-weight: 600; }
.tday__p--ok { color: var(--ok); font-weight: 700; }
.input--key { border-width: 2px; border-color: var(--brand); font-weight: 700; }
details.more { margin-top: 14px; border-top: 1px solid var(--border); }
details.more > summary { min-height: 48px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; font-weight: 700; color: var(--brand); }
details.more[open] > summary { margin-bottom: 8px; }

/* formularz badania */
.seg--sm span { min-height: 44px; padding: 0 12px; font-size: 14.5px; }
.footsel { display: flex; align-items: center; gap: 8px; margin-right: auto; font-size: 14px; font-weight: 700; flex-wrap: wrap; }
.footsel .input { width: auto; min-height: 44px; padding: 6px 10px; font-size: 15px; }
.modal { position: relative; }
.discard { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; background: var(--surface); border-top: 2px solid var(--danger); border-radius: 0 0 18px 18px; padding: 16px 22px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; box-shadow: 0 -12px 30px rgba(0, 0, 0, .18); }
.cols--prog { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }

@media (max-width: 1020px) {
  .qtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phead { display: none; }
  .sortsel { display: block; }
  .prow { display: flex; flex-wrap: wrap; gap: 2px 14px; padding: 12px 14px; align-items: baseline; }
  .prow__name { flex: 1 1 100%; }
  .prow__breeder { flex: 1 1 100%; white-space: normal; }
  .prow__k { display: inline; }
  .prow__st { margin-left: auto; }
  .inline-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .inline-form .field:first-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .bottomnav a { font-size: 12.5px; }
  .chead__act { width: 100%; }
  .chead__act .btn { flex: 1 1 auto; }
  .footsel { flex: 1 1 100%; margin-right: 0; }
  .footsel .input { flex: 1 1 auto; }
  .discard { border-radius: 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .cols--prog { grid-template-columns: minmax(0, 1fr); }
  .inline-form { grid-template-columns: minmax(0, 1fr); }
  .todo li { flex-wrap: wrap; }
  .todo__txt { flex: 1 1 0; min-width: 55%; }
}
@media (max-width: 420px) {
  .qtile { padding: 10px; gap: 8px; }
  .qtile__n { font-size: 24px; min-width: 26px; }
  .qtile__l { font-size: 13px; }
}

/* poprawki po przeglądzie zrzutów (audyt) */
.avatar { border: 1px solid var(--border-strong); }
@media (max-width: 860px) {
  .todo li { flex-wrap: wrap; row-gap: 0; }
  .todo__txt { flex: 1 1 0; min-width: 40%; }
  .todo__date { order: 9; flex: 1 1 100%; margin: -6px 0 6px 46px; }
  .todo .dotmark ~ .todo__date { margin-left: 24px; }
}

/* lista pacjentek na komputerze: jeden wiersz = jedna linia */
@media (min-width: 1021px) {
  .phead, .prow { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.1fr) 104px 104px 118px 160px; }
  /* 15.11: rasa nie jest ucinana — przy kilku znacznikach znaczniki przechodzą do drugiej linii */
  .prow__name { flex-wrap: wrap; row-gap: 4px; }
  .prow__name b, .prow__name .badge { flex: none; }
  .prow__breed { flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (min-width: 861px) {
  .modal__foot { flex-wrap: nowrap; }
  .footsel { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; white-space: nowrap; }
  .footsel .input { min-width: 0; flex: 0 1 190px; }
}

/* formularz „Nowe działanie”: nazwa w pełnej szerokości, pod nią rodzaj, termin i przycisk */
.inline-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
.inline-form .field:first-child { grid-column: 1 / -1; margin-bottom: 4px; }
@media (max-width: 860px) {
  .inline-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .inline-form .btn { grid-column: 1 / -1; }
}
@media (max-width: 420px) { .inline-form { grid-template-columns: minmax(0, 1fr); } }
/* dopisek pod działaniem nie dziedziczy przekreślenia */
.todo__sub { display: inline-block; width: 100%; text-decoration: none; }

/* ---------- rejestracja i akceptacja kont ---------- */
.linkrow { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; min-height: 48px; margin: 8px 0 12px; font-size: 15.5px; color: var(--text); text-decoration: none; border-radius: 10px; }
.linkrow strong { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.linkrow:hover { background: var(--brand-soft); }
.passwrap { display: flex; gap: 8px; }
.passwrap .input { flex: 1 1 auto; min-width: 0; }
.passwrap .btn { min-height: 48px; flex: none; min-width: 78px; }
.check--top { align-items: flex-start; margin-bottom: 4px; }
.check--top input { margin-top: 10px; }
.check--top > span { line-height: 1.5; padding-top: 0; }
.check--top .linkbtn--in { padding: 0 2px; }
.steps { margin: 16px 0 0; padding-left: 22px; display: grid; gap: 10px; }
.steps li { padding-left: 4px; }
.steps li::marker { color: var(--brand); font-weight: 800; }
.rowcard--wait { border-color: var(--accent); border-left: 4px solid var(--accent); }
.qtiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.qtile--go { border-style: dashed; }
@media (max-width: 1250px) { .qtiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1020px) { .qtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .qtile--go { grid-column: 1 / -1; } }
/* zgoda przy rejestracji: linki w zdaniu, bez odrywania kropki na telefonie */
.check--top .linkbtn--in { display: inline; min-height: 0; padding: 0 1px; margin: 0; line-height: inherit; font-size: inherit; vertical-align: baseline; position: relative; }
/* strefa dotyku ~44 px bez rozpychania wiersza (pseudo-element zamiast paddingu) */
.check--top .linkbtn--in::after { content: ""; position: absolute; inset: -11px -2px; }

/* ==========================================================================
   Przejścia między ekranami — bez pustej klatki.
   Nowa treść jest wstawiana od razu i wchodzi krótkim ruchem od krycia 0,6
   (nigdy od zera). Tylko transform i opacity. Przełącznik „Wyłącz animacje”
   wyłącza wszystko ([data-noanim]).
   ========================================================================== */
@keyframes enter { from { opacity: .6; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes enter-r { from { opacity: .6; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes enter-l { from { opacity: .6; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes rowin { from { opacity: .6; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes modalin { from { opacity: .6; transform: scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sheet { from { opacity: .7; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: .6; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes flash { from { opacity: .9; } to { opacity: 0; } }
.page { animation: none; }
.enter { animation: enter .17s cubic-bezier(.2, .7, .2, 1) both; }
.enter-r { animation: enter-r .17s cubic-bezier(.2, .7, .2, 1) both; }
.enter-l { animation: enter-l .17s cubic-bezier(.2, .7, .2, 1) both; }
.login__card { animation: enter .18s cubic-bezier(.2, .7, .2, 1) both; }
/* bardzo krótka kaskada tylko pierwszych wierszy listy; reszta bez opóźnienia */
.enter .plist > .prow:nth-child(-n+6), .enter #blist > .rowcard:nth-child(-n+6) { animation: rowin .16s ease-out both; }
.enter .plist > .prow:nth-child(2), .enter #blist > .rowcard:nth-child(2) { animation-delay: .02s; }
.enter .plist > .prow:nth-child(3), .enter #blist > .rowcard:nth-child(3) { animation-delay: .04s; }
.enter .plist > .prow:nth-child(4), .enter #blist > .rowcard:nth-child(4) { animation-delay: .06s; }
.enter .plist > .prow:nth-child(5), .enter #blist > .rowcard:nth-child(5) { animation-delay: .08s; }
.enter .plist > .prow:nth-child(6), .enter #blist > .rowcard:nth-child(6) { animation-delay: .1s; }
/* okna: tło pojawia się płynnie na osobnej warstwie, treść okna jest widoczna od pierwszej klatki */
.modal-back { animation: none; background: transparent; }
.modal-back::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(8, 16, 14, .55); animation: fade .2s ease-out both; }
.modal { animation: modalin .18s cubic-bezier(.2, .7, .2, 1) both; }
@media (max-width: 860px) { .modal, .modal--sm { animation: sheet .2s cubic-bezier(.2, .7, .2, 1) both; } }
/* zakładki: przesuwane podkreślenie */
.tabs { position: relative; }
.tab[aria-current="page"] { border-bottom-color: transparent; }
.tabs__ink { position: absolute; left: 0; bottom: 0; width: 100px; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand-logo); transform-origin: 0 50%; transform: scaleX(0); transition: transform .2s cubic-bezier(.2, .7, .2, 1); pointer-events: none; }
/* podświetlenie świeżego wpisu: ramka na osobnej warstwie (opacity), bez animowania cienia */
.tl__item--fresh { animation: none; position: relative; }
.tl__item--fresh::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; border: 3px solid var(--accent); opacity: 0; pointer-events: none; animation: flash 1.4s ease-out 1; }
.progress__bar, .chart .dot { transition: none; }

/* ==========================================================================
   SYSTEM RUCHU (wersja „premium”)
   Krzywe: --ease (miękka) do wszystkich przejść, --spring (sprężysta) do drobnych akcentów.
   Czasy: mikrointerakcje 180–260 ms · treść i zakładki 380–520 ms · ekrany i okna 450–650 ms
          · kaskady co 40–60 ms (całość <= 700 ms).
   Wejścia treści steruje app.js (Web Animations API): start od krycia >= 0,6, tylko
   transform / opacity / clip-path, bez stylów pozostawianych po animacji.
   „Wyłącz animacje” ([data-noanim]) wyłącza wszystko poniżej.
   ========================================================================== */
:root { --ease: cubic-bezier(.22, 1, .36, 1); --spring: cubic-bezier(.34, 1.56, .64, 1); --t-micro: .22s; }

/* wejścia sterowane wcześniej klasami CSS — teraz robi je app.js */
.login__card, .modal, .toast, .modal-back::before { animation: none; }
@media (max-width: 860px) { .modal, .modal--sm { animation: none; } }
#modal-exit { position: fixed; inset: 0; z-index: 59; pointer-events: none; }

/* --- przyciski, kafle, wiersze: uniesienie, wciśnięcie, fala --- */
.btn, .chip, .qtile, .prow, .tab, .nav__item, .iconbtn, .linkrow, .notif, .phead__b, .bottomnav a { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; background: var(--brand-logo); pointer-events: none; opacity: 0; transform: scale(0); will-change: transform, opacity; }
.btn--primary .ripple, .btn--accent .ripple, .chip[aria-pressed="true"] .ripple { background: #fff; }
[data-noanim] .ripple { display: none; }
.btn { transition: background-color var(--t-micro) ease, border-color var(--t-micro) ease, color var(--t-micro) ease, transform .26s var(--spring); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.96); transition-duration: .1s; }
.chip, .iconbtn, .qtile, .linkrow { transition: background-color var(--t-micro) ease, border-color var(--t-micro) ease, color var(--t-micro) ease, transform .26s var(--spring); }
.chip:hover, .iconbtn:hover { transform: translateY(-1px); }
.qtile:hover { transform: translateY(-3px); }
.chip:active, .iconbtn:active, .qtile:active { transform: scale(.96); transition-duration: .1s; }
.prow { transition: border-color var(--t-micro) ease, background-color var(--t-micro) ease, transform .26s var(--ease); }
.prow:hover { transform: translateX(4px); }
.prow:active { transform: translateX(4px) scale(.992); }
.notif { transition: border-color var(--t-micro) ease, transform .26s var(--ease); }
a.notif:hover { transform: translateY(-2px); border-color: var(--brand); }
.rowcard, .tl__item, .card, .stat { transition: border-color var(--t-micro) ease; }
.btn.is-saved { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn svg, .iconbtn svg { transition: transform .26s var(--spring); }
.iconbtn:hover svg { transform: rotate(-8deg) scale(1.08); }

/* --- rysowany ptaszek --- */
@keyframes draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.okmark { display: inline-flex; width: 20px; height: 20px; flex: none; }
.okmark svg { width: 20px; height: 20px; animation: draw .48s var(--ease) .1s both; }

/* --- menu: ikona aktywnej pozycji „wskakuje”, zakładki: przesuwane podkreślenie --- */
@keyframes pop { from { transform: scale(.72); } to { transform: none; } }
.nav__item, .bottomnav a { transition: background-color .26s ease, color .26s ease; }
.nav__item[aria-current="page"] svg, .bottomnav a[aria-current="page"] svg { animation: pop .46s var(--spring); }
.tab { transition: color .26s ease; }
.tabs__ink { transition: transform .46s var(--ease); }

/* --- przełączniki, pola wyboru, „ptaszki” działań --- */
.switch i { transition: background-color .26s ease; }
.switch i::after { transition: transform .36s var(--spring); }
.switch:active i::after { transform: scaleX(1.15); }
.switch input:checked:active + i::after { transform: translateX(22px) scaleX(1.15); }
.check input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; margin: 0; flex: none; border: 2px solid var(--border-strong); border-radius: 7px; background: var(--surface); display: inline-grid; place-content: center; cursor: pointer; transition: background-color var(--t-micro) ease, border-color var(--t-micro) ease, transform .26s var(--spring); }
.check input::after { content: ""; width: 12px; height: 7px; border-left: 2.5px solid var(--on-brand); border-bottom: 2.5px solid var(--on-brand); transform: translateY(-1px) rotate(-45deg); clip-path: inset(0 100% 0 0); transition: clip-path .3s var(--ease); }
.check input:checked { background: var(--brand); border-color: var(--brand); }
.check input:checked::after { clip-path: inset(0 0 0 0); }
.check input:active { transform: scale(.9); }
.check input:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
.check--top input { margin-top: 8px; }
.tick i { transition: background-color var(--t-micro) ease, border-color var(--t-micro) ease, transform .3s var(--spring); }
.tick:active i { transform: scale(.86); }
.tick svg { opacity: 1; clip-path: inset(0 100% 0 0); transition: clip-path .32s var(--ease); }
.tick[aria-pressed="true"] svg { clip-path: inset(0 0 0 0); }
.seg span { transition: background-color var(--t-micro) ease, border-color var(--t-micro) ease, color var(--t-micro) ease, transform .26s var(--spring); }
.seg input:active + span { transform: scale(.96); }

/* --- pola formularzy: obwódka i etykieta przy fokusie --- */
.input, select.input, textarea.input { transition: border-color var(--t-micro) ease, box-shadow var(--t-micro) ease; }
.field > label, .fs > legend { transition: color var(--t-micro) ease; }
.field:focus-within > label { color: var(--brand); }

/* --- znaczki statusu: subtelny, skończony puls (3 razy, 0,4 Hz), tylko na listach --- */
@keyframes pulse { from { opacity: .55; transform: scale(1); } to { opacity: 0; transform: scale(2.6); } }
@keyframes pulse-b { from { opacity: .6; transform: scale(1); } to { opacity: 0; transform: scale(1.16, 1.5); } }
.prow .badge--brand i, .prow .badge--danger i { position: relative; }
.prow .badge--brand i::after, .prow .badge--danger i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; opacity: 0; animation: pulse 2.4s ease-out .6s 3; }
.rowcard--wait .badge--new { position: relative; overflow: visible; }
.rowcard--wait .badge--new::after { content: ""; position: absolute; inset: 0; border-radius: 999px; border: 2px solid var(--accent); opacity: 0; animation: pulse-b 2.4s ease-out .6s 3; }

/* --- wykres --- */
.chart .dot { transform-box: fill-box; transform-origin: center; transition: transform .24s var(--spring); }
.chart .dot.on { r: 5; transform: scale(1.5); }
.chart .cross { transition: opacity .2s ease; }
.chart__tip { transform: translate(-50%, -100%) translateY(10px) scale(.94); transition: opacity .2s ease, transform .28s var(--ease); }
.chart__tip.on { transform: translate(-50%, -100%); }
.progress__bar { width: 100%; }

/* --- powiadomienia --- */
.toast { position: relative; overflow: hidden; display: flex; gap: 10px; align-items: center; text-align: left; padding-bottom: 14px; }
.toast__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--brand-logo); transform-origin: 0 50%; }
[data-noanim] .toast__bar { display: none; }

/* --- puste stany i ekran oczekiwania --- */
@keyframes turn { from { transform: rotate(-90deg) scale(.7); } to { transform: none; } }
@keyframes hand { from { transform: rotate(-50deg); } to { transform: none; } }
.empty::before { content: ""; display: block; width: 34px; height: 34px; margin: 0 auto 10px; border-radius: 50%; border: 2px dashed var(--border-strong); animation: turn .7s var(--ease) both; }
.hero-ico { width: 68px; height: 68px; margin-top: 22px; color: var(--brand); }
.hero-ico svg { width: 68px; height: 68px; animation: pop .6s var(--spring) both; }
.hero-ico__hand { transform-box: view-box; transform-origin: 24px 24px; animation: hand 1.6s var(--ease) .25s 2 both; }

/* --- motyw: nowy wygląd odsłania się kołem od przycisku (View Transitions API) --- */
::view-transition { pointer-events: none; }
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: theme-reveal .62s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes theme-reveal { from { clip-path: circle(0px at var(--tx, 50%) var(--ty, 0px)); } to { clip-path: circle(150vmax at var(--tx, 50%) var(--ty, 0px)); } }

/* --- intro: trochę dłuższe i bogatsze (1,55 s) --- */
@keyframes intro-settle { from { transform: scale(1.07); } to { transform: none; } }
.intro { animation: intro-out .32s ease 1.23s both; }
.intro .logo { animation: intro-settle 1.25s var(--ease) both; }
.intro__cover { animation: intro-wipe .7s var(--ease) .06s both; }
.intro__box--line .intro__cover { animation-duration: .62s; animation-delay: .44s; }
.intro__ecg { animation: intro-settle 1.1s var(--ease) .3s both; }

/* ==========================================================================
   TEMPERATURA WYJŚCIOWA, PRÓG SPADKU, ALERT, EKSPORT I WYDRUK
   Kolor ostrzegawczy = --danger; pomiar poniżej progu ma też inny kształt (romb).
   Ruch: tylko transform / opacity; [data-noanim] wyłącza wszystko.
   ========================================================================== */
.btn--wrap { white-space: normal; text-align: center; line-height: 1.25; padding-top: 8px; padding-bottom: 8px; }
.btn--del { color: var(--danger); }
.btn--del:hover { background: var(--danger-soft); }
.input--note, textarea.input--note { min-height: 60px; }

/* --- wykres: próg, punkty poniżej progu, godziny na osi --- */
.chart .thr { stroke: var(--danger); stroke-width: 2; stroke-dasharray: 7 5; }
.chart .thrlbl { fill: var(--danger); font-weight: 800; font-size: 13px; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.chart .dot--low { fill: var(--danger); stroke: var(--surface); stroke-width: 2; }
.chart .grid--day { stroke-dasharray: 2 4; }
.chart text.hr { font-size: 12px; }
.chart text.day { font-weight: 700; fill: var(--text); }
.chart__tip i { display: block; font-style: normal; font-weight: 800; }
.legend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.legend svg { width: 16px; height: 16px; flex: none; }
.legend svg.lg-w { width: 28px; }
.lg-dot { fill: var(--info); }
.lg-low { fill: var(--danger); }
.lg-thr { stroke: var(--danger); stroke-width: 2; stroke-dasharray: 6 4; }
.nudge { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14.5px; color: var(--muted); }
.nudge svg { width: 18px; height: 18px; flex: none; color: var(--info); }
.nudge .linkbtn { text-align: left; }

/* --- karta „Próg spadku temperatury” --- */
.thr__sum { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.thr__sum > div { flex: 1 1 130px; min-width: 0; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.thr__sum b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.thr__sum > i { align-self: center; font-style: normal; font-weight: 800; font-size: 20px; color: var(--muted); }
.thr__sum .thr__res { background: var(--danger-soft); box-shadow: inset 0 0 0 1px var(--danger); }
.thr__sum .thr__res b { color: var(--danger); }
.thr .btnrow .btn { flex: 1 1 220px; }
#thr-card:focus { outline: none; }

/* --- tabela „Historia pomiarów” --- */
.mtbl td { vertical-align: middle; }
.mtbl__d, .mtbl__h, .mtbl__t { white-space: nowrap; }
.mtbl__n { overflow-wrap: break-word; min-width: 0; }
.mtbl__a { white-space: nowrap; text-align: right; width: 1%; }
.mtbl__a .btn { padding: 0 10px; }
.mtbl tr.low .mtbl__t b { color: var(--danger); }
.lowmark { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; padding: 2px 9px; border-radius: 999px; background: var(--danger-soft); color: var(--danger); font-size: 13px; font-weight: 700; white-space: nowrap; }
.lowmark svg { width: 11px; height: 11px; fill: currentColor; }
.exp { margin-left: auto; }
@media (max-width: 700px) {
  .mtbl, .mtbl tbody { display: block; }
  .mtbl thead { display: none; }
  .mtbl tr { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 2px 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .mtbl td { border: 0; padding: 0; }
  .mtbl__d, .mtbl__h { color: var(--muted); font-size: 14px; }
  .mtbl__t { text-align: right; white-space: normal; }
  .mtbl__n, .mtbl__a { grid-column: 1 / -1; text-align: left; width: auto; }
  .mtbl__n { font-size: 14.5px; }
  .mtbl__a { margin: 2px 0 -6px -10px; }
  .exp { margin-left: 0; width: 100%; }
  .exp .btn { flex: 1 1 0; padding: 0 8px; }
}

/* --- alert: baner w karcie --- */
.alertbox { display: flex; gap: 14px; align-items: flex-start; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; border: 1px solid var(--border); border-left-width: 5px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.alertbox__ico { width: 42px; height: 42px; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.alertbox__ico svg { width: 22px; height: 22px; }
.alertbox__main { min-width: 0; flex: 1 1 auto; }
.alertbox__main > strong { display: block; font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.alertbox__main p + p { margin-top: 6px; }
.alertbox .btnrow { margin-top: 12px; }
.alertbox--new { border-color: var(--danger); background: var(--danger-soft); }
.alertbox--new .alertbox__ico { background: var(--danger); color: #fff; position: relative; }
[data-theme="dark"] .alertbox--new .alertbox__ico { color: #2a0a07; }
.alertbox--new .alertbox__main > strong { color: var(--danger); }
.alertbox--seen { border-left-color: var(--danger); }
.alertbox--seen .alertbox__ico { background: var(--danger-soft); color: var(--danger); }
.alertbox--ended { border-left-color: var(--ok); }
.alertbox--ended .alertbox__ico { background: var(--ok-soft); color: var(--ok); }
.alertbox--calm { background: var(--info-soft); border-color: transparent; border-left-color: var(--info); box-shadow: none; }
.alertbox--calm .alertbox__ico { background: var(--surface); color: var(--info); }
@keyframes ring { from { opacity: .55; transform: scale(1); } to { opacity: 0; transform: scale(1.55); } }
.alertbox--new .alertbox__ico::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid var(--danger); opacity: 0; animation: ring 2.4s ease-out .5s 3; pointer-events: none; }
@media (max-width: 520px) {
  .alertbox { padding: 14px; gap: 12px; }
  .alertbox__ico { width: 36px; height: 36px; border-radius: 10px; }
  .alertbox .btnrow .btn { flex: 1 1 100%; }
}

/* --- alert: lista pacjentek i kafel --- */
.badge--alert { background: var(--danger); color: #fff; }
[data-theme="dark"] .badge--alert { color: #2a0a07; }
.badge--alert.badge--alert-seen { background: var(--danger-soft); color: var(--danger); }
.prow--alert { border-color: var(--danger); box-shadow: inset 4px 0 0 var(--danger); }
.prow .badge--alert i { position: relative; }
.prow--alert .badge--alert i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; opacity: 0; animation: pulse 2.4s ease-out .6s 3; }
.qtiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qtile--hot { border-color: var(--danger); box-shadow: inset 4px 0 0 var(--danger), var(--shadow); }
.qtile--hot .qtile__n { color: var(--danger); }
@media (max-width: 1250px) { .qtiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1020px) { .qtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .qtile--go { grid-column: auto; } }
@media (min-width: 1021px) { .phead, .prow { grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr) 96px 100px 112px 160px; } }

/* --- zdarzenia alertu w historii --- */
.tl__sys { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 16px; border-radius: var(--radius); border: 1px dashed var(--border-strong); background: var(--surface-2); min-width: 0; }
.tl__sys > div { flex: 1 1 200px; min-width: 0; }
.tl__sys strong { display: block; font-size: 15px; }
.tl__sysico { width: 34px; height: 34px; border-radius: 10px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--danger-soft); color: var(--danger); }
.tl__sysico svg { width: 18px; height: 18px; }
.tl__sys--end .tl__sysico { background: var(--ok-soft); color: var(--ok); }
.tl__sys .tl__date { margin-left: auto; }
.notif--spadek .notif__ico { background: var(--info-soft); color: var(--info); }

/* --- wskazówka kliniczna (treść gabinetu) --- */
.tipbox { margin: 14px 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); border-left: 4px solid var(--accent); font-size: 14.5px; line-height: 1.5; }
.tipbox strong { color: var(--accent); }

/* --- ustawienia: reguła alertu --- */
.rule { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 8px; }
.rule .check { margin: 0; }
.rule__n { width: 128px; flex: none; }
.rule__n .input { padding-right: 62px; }
.rule__t { font-weight: 600; font-size: 15px; }
.optrow .todo__sub { font-weight: 500; }

/* --- arkusz do druku („Drukuj / PDF”) --- */
#print-root { display: none; }
.ps { --surface: #fff; --surface-2: #f3f1ee; --border: #dcd7d1; --border-strong: #a59f98; --text: #1d1d21; --muted: #55524f; --info: #2a6b68; --danger: #b0352d;
  color: #1d1d21; background: #fff; font-family: var(--font); font-size: 12.5px; line-height: 1.4; width: 720px; max-width: 100%; margin: 0 auto; }
.ps__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 2px solid #e4599a; }
.ps__head img { height: 44px; width: auto; }
.ps__head div { text-align: right; display: grid; }
.ps__head strong { font-size: 14px; }
.ps__head span { color: #55524f; }
.ps h1 { font-family: var(--font-head); font-size: 30px; margin: 14px 0 8px; }
.ps h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin: 16px 0 6px; color: #55524f; }
.ps__kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 18px; margin: 0; }
.ps__kv dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: #55524f; }
.ps__kv dd { margin: 0; font-weight: 700; overflow-wrap: break-word; }
.ps .chart { min-height: 0; }
.ps .chart__tip { display: none; }
.ps__note { color: #55524f; font-size: 11.5px; margin-top: 4px; }
.ps__tbl { width: 100%; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.ps__tbl th, .ps__tbl td { text-align: left; padding: 4px 6px; border-bottom: 1px solid #dcd7d1; vertical-align: top; overflow-wrap: break-word; }
.ps__tbl th { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: #55524f; border-bottom: 1.5px solid #a59f98; }
.ps__tbl th, .ps__tbl td:nth-child(-n+6) { white-space: nowrap; overflow-wrap: normal; }
.ps__tbl td:nth-child(8) { width: 34%; }
.ps__tbl td:nth-child(9) { width: 15%; }
.ps__tbl tr.low td:nth-child(3) { font-weight: 800; color: #b0352d; }
.ps__tbl tr { break-inside: avoid; }
.ps__tbl thead { display: table-header-group; }
.ps__foot { margin-top: 14px; padding-top: 8px; border-top: 1px solid #dcd7d1; color: #55524f; font-size: 10.5px; }
@media print {
  @page { size: A4; margin: 14mm 13mm; }
  html[data-print], html[data-print] body { background: #fff !important; color: #1d1d21 !important; min-height: 0 !important; overflow: visible !important; }
  html[data-print] body > *:not(#print-root) { display: none !important; }
  html[data-print] #print-root { display: block !important; }
  html[data-print] .ps { width: auto; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html[data-print] .ps .chart, html[data-print] .ps__kv { break-inside: avoid; }
  /* wydruk zawsze jasny — także w ciemnym motywie i przy „Grafika tła: wł.” */
  html, body { background: #fff !important; color-scheme: light !important; }
  /* nagłówek sekcji nie zostaje sam na dole strony */
  .ps h1, .ps h2, .ps h3 { break-after: avoid; page-break-after: avoid; break-inside: avoid; }
}

/* poprawki po przeglądzie zrzutów (telefon) */
@media (max-width: 560px) {
  .thr__sum { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .thr__sum > i:last-of-type { display: none; }
  .thr__sum .thr__res { grid-column: 1 / -1; }
  .thr__sum b { font-size: 20px; }
}
@media (max-width: 700px) { .mtbl__n--empty { display: none; } }
@media (min-width: 1021px) { .prow .bx { display: none; } }

/* ==========================================================================
   Runda napraw 15.11 (testy: alert, telefon, wydruk, konta, teksty, ruch)
   ========================================================================== */
/* przejścia przesuwające treść w bok nie poszerzają strony (dolne menu stoi w miejscu) */
#app, .main { overflow-x: clip; }
/* okno modalne nie przesuwa treści o szerokość paska przewijania */
html { scrollbar-gutter: stable; }

/* zakładki karty: nie są ściskane; na telefonie krótkie nazwy, przewijanie w bok z wygaszoną krawędzią */
.tab { flex: none; }
@media (max-width: 860px) {
  .tab__x { display: none; }
  .tabs--more:not(.tabs--end) { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
  .tabs--more.tabs--end:not(.tabs--start) { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
}
@media (max-width: 400px) { .tab { padding: 0 10px; } }

/* dolne menu: szerokość pozycji według podpisu — „Przypomnienia” mieści się w jednej linii także na 360 px */
@media (max-width: 860px) {
  .bottomnav a { flex: 1 1 auto; padding: 0 2px; white-space: nowrap; }
}
@media (max-width: 380px) { .bottomnav a { font-size: 12px; letter-spacing: -.01em; } }

/* klawiatura telefonu: dolne menu chowa się, „Zapisz wpis” przykleja się do dołu ekranu */
@media (max-width: 860px) {
  .kbd .bottomnav { display: none; }
  .kbd .savebar { position: sticky; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 6; }
  .kbd .savebar .btn { box-shadow: 0 6px 22px rgba(0, 0, 0, .28); }
}

/* komunikaty u góry nie zasłaniają miejsca, do którego przewija się strona */
.alertbox, #chart-card, #thr-card, .tl__item { scroll-margin-top: calc(var(--bar-h) + 12px); }
@media (max-width: 860px) { .toasts { top: auto; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } .kbd .toasts { bottom: 76px; } }
.alertbox:focus { outline: none; }
.alertbox--now { box-shadow: 0 0 0 3px var(--info); }

/* wykres: gęste pomiary przewijane w bok z przyklejoną osią wartości, odczyt punktu nad wykresem */
.chart { min-width: 0; max-width: 100%; }
.cols--prog > div { min-width: 0; }
.chart__scroll { overflow-x: auto; overflow-y: hidden; touch-action: pan-x pan-y; scrollbar-width: thin; }
.chart--wide .chart__scroll svg { width: auto; }
.chart__y { position: absolute; left: 0; top: 0; background: var(--surface); pointer-events: none; }
.chart-wide-hint { display: none; }
#chart-card:has(.chart--wide) .chart-wide-hint { display: inline; }
.chart__tip { top: 2px; display: flex; gap: 8px; align-items: baseline; padding: 4px 10px; white-space: nowrap; transform: translateX(-50%) translateY(-4px) scale(.96); }
.chart__tip.on { transform: translateX(-50%); }
.chart__tip b { display: inline; font-size: 14px; }
.chart__tip i { display: inline; }

/* „Dzisiejsze pomiary”: lista godzin */
.tday__list { display: flex; flex-wrap: wrap; gap: 4px 14px; flex: 1 1 100%; }
.tday__p { white-space: nowrap; }

/* ustawienia: reguła alertu bez skrótów, ostrzeżenia */
.rule__n { width: 84px; flex: none; }
.rule__n .input { padding-right: 10px; }
.warn-txt { color: var(--danger); font-weight: 700; }
#set-warn:empty { display: none; }
.modal .btn--block.btn--wrap { min-height: 46px; }

/* pola formularzy: obwódka o kontraście co najmniej 3:1 */
.input, select.input, textarea.input, .check input { border-color: #8f8881; }
[data-theme="dark"] .input, [data-theme="dark"] select.input, [data-theme="dark"] textarea.input, [data-theme="dark"] .check input { border-color: #7a7a83; }
.input:focus { border-color: var(--brand); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.check input:checked { border-color: var(--brand); }

/* wydruk: jeden wiersz = jedna linia (bez łamania nazwisk), notatki z podziałem na linie, większe pismo */
.ps__tbl { font-size: 12px; }
.ps__tbl th { font-size: 11px; text-transform: none; letter-spacing: 0; white-space: normal; }
.ps__tbl td { overflow-wrap: break-word; }
.ps__tbl td:nth-child(8) { width: auto; }
.ps__tbl td:nth-child(9) { width: auto; }
.ps__tbl td.ps__a { white-space: nowrap; overflow-wrap: normal; }
.ps__tbl td.ps__n { white-space: pre-line; overflow-wrap: break-word; min-width: 120px; }
.ps__tbl td.ps__n i { color: #55524f; font-style: italic; }
.ps__note, .ps__foot { font-size: 12px; }
.ps__kv dt { font-size: 11px; }
.ps__al { margin: 0; padding-left: 18px; font-size: 12px; }
.ps__al li + li { margin-top: 3px; }
/* druk bez przycisku (np. strona inna niż karta): zawsze ciemny tekst na jasnym tle, bez przycisków */
@media print {
  html:not([data-print]) { --bg: #fff; --surface: #fff; --surface-2: #f3f1ee; --border: #dcd7d1; --border-strong: #a59f98; --text: #1d1d21; --muted: #55524f; --brand: #b42f6c; --brand-strong: #962458; --brand-soft: #fbeaf2; --info: #2a6b68; --info-soft: #e3f0ef; --danger: #b0352d; --danger-soft: #fbe9e7; --accent: #8a570c; --accent-soft: #f6ecdc; --ok: #24744a; --ok-soft: #e1f2e8; color-scheme: light; }
  html:not([data-print]) body { background: #fff; color: #1d1d21; }
  html:not([data-print]) .btn, html:not([data-print]) .iconbtn, html:not([data-print]) .chips, html:not([data-print]) .tabs, html:not([data-print]) .footer, html:not([data-print]) .toasts, html:not([data-print]) form, html:not([data-print]) .intro { display: none !important; }
  html:not([data-print]) .card, html:not([data-print]) .tl__item, html:not([data-print]) .stat { box-shadow: none; break-inside: avoid; }
}

/* ===== 15.11: decyzje gabinetu — cesarskie cięcie, notatka wewnętrzna, wykonane badania, termin porodu jako przedział ===== */
.badge--cc { background: var(--info-soft); color: var(--info); border: 1px solid currentColor; white-space: normal; text-align: left; }
.stat__value--range { font-size: clamp(22px, 5.4vw, 30px); white-space: nowrap; }
.lockbox { border: 1px dashed var(--border-strong); border-left: 4px solid var(--muted); border-radius: var(--radius-sm); background: var(--surface-2); padding: 10px 12px; }
.lockbox .tl__k, .lockfield > label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lockbox .tl__k svg, .lockfield > label svg { width: 15px; height: 15px; flex: none; }
.lockfield { border: 1px dashed var(--border-strong); border-left: 4px solid var(--muted); border-radius: var(--radius-sm); background: var(--surface-2); padding: 12px 12px 10px; }
.lockfield textarea.input { background: var(--surface); }
.tchecks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; }
.check--sm { margin-bottom: 4px; font-size: 14.5px; font-weight: 600; }
.check--sm > span { min-width: 0; overflow-wrap: break-word; }
.lenpair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.lenpair .unit { min-width: 0; }
.login__invite { margin: 4px 0 12px; }
.login__invite .btn { width: 100%; }
/* 5 kafli „Dziś wymaga uwagi” (bez kafla akceptacji kont) */
@media (min-width: 1251px) { .qtiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1020px) { .qtiles > .qtile--alert { grid-column: 1 / -1; } }
/* termin porodu jako przedział dat — szersza kolumna */
@media (min-width: 1021px) { .phead, .prow { grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr) 96px 104px 112px 160px; } .prow__due .prow__v { font-size: 13.5px; letter-spacing: -.01em; } }
.rem__always { width: 52px; height: 32px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.rem__always svg { width: 18px; height: 18px; }
#go-activate svg { width: 18px; height: 18px; color: var(--brand); flex: none; }
.todo__visit .dotmark { border-color: var(--brand); background: var(--brand-soft); }
.nowrap { white-space: nowrap; }
/* zasada ruchu: animowane wyłącznie transform / opacity / clip-path — kolory, tła i ramki zmieniają się od razu (bez przejścia) */
*, *::before, *::after { transition-property: transform, opacity, clip-path !important; }
.lockbox .tl__k { display: block; }
.lockbox .tl__k svg { display: inline-block; vertical-align: -2px; margin-right: 6px; }
.lockfield > label { flex-wrap: nowrap; align-items: flex-start; }
.lockfield > label svg { margin-top: 3px; }
/* przejście motywu: grupa widoku bez domyślnej animacji rozmiaru (width/height/backdrop-filter) — zostaje samo odsłanianie kołem (clip-path) */
::view-transition-group(root) { animation: none; }

/* ==========================================================================
   Runda 16.11 — decyzje gabinetu (badanie, krycie, poprawki 24 h, zgody, wydruk z wyborem, alerty dla hodowcy)
   ========================================================================== */
/* alert „ciąża trwa dłużej niż 61 dni” */
.alertbox--over { border-color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.alertbox--over .alertbox__ico { background: var(--accent); color: #fff; }
.alertbox--over .alertbox__main > strong { color: var(--accent); }
[data-theme="dark"] .alertbox--over .alertbox__ico { color: #1d1d21; }
.notif--alert .notif__ico { background: var(--accent-soft); color: var(--accent); }
/* poprawki wpisów: okno 24 h i historia zmian (lekarz) */
.tl__until { align-self: center; padding: 0 10px; }
.tl__locked { display: flex; gap: 6px; align-items: flex-start; margin: 10px 0 0; line-height: 1.45; }
.tl__locked svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.tl__hist { margin: 12px 0 0; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); padding: 0 12px; }
.tl__hist > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--info); list-style: none; }
.tl__hist > summary::-webkit-details-marker { display: none; }
.tl__hist > summary svg { width: 16px; height: 16px; flex: none; }
.tl__hist ul { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.tl__hist li { display: grid; gap: 2px; font-size: 14px; min-width: 0; }
.tl__chg { overflow-wrap: break-word; }
.tl__chg s { color: var(--danger); text-decoration-thickness: 1.5px; }
.tl__sys--removed .tl__sysico { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
/* HR płodów (zakres) — pole nieaktywne przed 46. dobą */
.fs--sub { margin-bottom: 4px; }
.fs--sub > legend { font-size: 14.5px; font-weight: 700; }
.fs--sub[disabled] .input { opacity: .55; cursor: not-allowed; }
/* wskazówka okresu pomiarów i zachęta do temperatury wyjściowej */
.tphase { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--text); }
.tphase svg { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--info); }
.base-nudge { margin-bottom: 16px; }
.base-nudge a { font-weight: 700; color: var(--brand-strong); display: inline-block; padding: 4px 0; }
/* krycie i progesteron */
.mat__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; }
.mat__h { font-size: 14px; font-weight: 800; margin: 4px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mat .mat__h + .tbl, .mat .tbl + .matforms { margin-top: 4px; }
.matlist, .matplan { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.matlist li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 2px 4px 2px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.matlist li > span:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.matlist__n { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-content: center; background: var(--brand-soft); color: var(--brand-strong); font-weight: 800; font-size: 13px; flex: none; }
.matplan li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 14px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.matplan__d { font-weight: 800; font-variant-numeric: tabular-nums; }
.matplan__s { font-size: 13px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.matplan__s svg { width: 14px; height: 14px; }
.matplan li.is-done .matplan__s { color: var(--ok); }
.matplan li.is-miss .matplan__s { color: var(--danger); }
.mattbl td { vertical-align: top; }
.mattbl__a { width: 48px; text-align: right; }
.matforms { margin: 6px 0 0; }
.inline-form--mat { grid-template-columns: minmax(0, 1fr) auto; }
.inline-form--mat3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; }
.unit--sel { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 6px; }
.unit--sel .input { padding-right: 10px; }
.matvet { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); display: grid; gap: 8px; justify-items: start; }
.matvet .hint { display: flex; gap: 6px; align-items: flex-start; }
.matvet .hint svg { width: 14px; height: 14px; flex: none; margin-top: 3px; }
/* 20.11 naprawa 1: zastąpione zapytaniem o szerokość karty (@container mat) na końcu pliku */
@media (max-width: 560px) {
  .mat__grid { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .inline-form.inline-form--mat, .inline-form.inline-form--mat3 { grid-template-columns: minmax(0, 1fr); }
  .inline-form--mat .field:first-child, .inline-form--mat3 .field:first-child { grid-column: auto; }
  .mattbl th:nth-child(2), .mattbl td:nth-child(2) { font-size: 13px; }
}
@media (max-width: 860px) and (min-width: 561px) { .inline-form.inline-form--mat3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .inline-form--mat3 .btn { grid-column: 1 / -1; } }
/* zgody */
.consents { margin-top: 4px; }
.consents > legend { font-weight: 800; }
.consents .check--top { margin-bottom: 2px; font-weight: 500; font-size: 14.5px; }
.consents .err { margin: 0 0 8px 34px; }
/* wydruk: wybór sekcji */
.printopt { margin-bottom: 6px; }
.printopt > span { display: grid; gap: 1px; }
.ps__ex { margin: 0; padding-left: 18px; font-size: 11.5px; display: grid; gap: 6px; }
.ps__ex li { break-inside: avoid; overflow-wrap: break-word; }
.ps__tbl--sm td:nth-child(n) { width: auto; white-space: normal; }
/* lista pacjentek z kalendarzem porodów (moduł etapu 2): PC — boczna kolumna, węższe ekrany — pod kaflami */
.pgrid { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "tiles" "kal" "list"; column-gap: 24px; }
.pgrid__head { grid-area: head; }
.pgrid__tiles { grid-area: tiles; min-width: 0; }
.pgrid__kal { grid-area: kal; min-width: 0; margin: 0 0 18px; }
.pgrid__list { grid-area: list; min-width: 0; }
@media (min-width: 1280px) {
  .pgrid--kal { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "head head" "tiles kal" "list kal"; grid-template-rows: auto auto 1fr; }
  .pgrid--kal .pgrid__kal { margin: 0; align-self: start; position: sticky; top: 16px; }
  .pgrid--kal .qtiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.cols--mods { margin-top: 0; }
/* 1280–1599 px z kalendarzem w kolumnie: wiersze listy jako karty (jak na tablecie), sortowanie z listy rozwijanej */
@media (min-width: 1280px) { /* 20.11: z kalendarzem w kolumnie lista ma ok. 690 px przy każdej szerokości (.page max 1120 px) — zawsze karty */
  .pgrid--kal .phead { display: none; }
  .pgrid--kal .sortsel { display: block; }
  .pgrid--kal .prow { display: flex; flex-wrap: wrap; gap: 2px 14px; padding: 12px 14px; align-items: baseline; }
  .pgrid--kal .prow__name { flex: 1 1 100%; }
  .pgrid--kal .prow__breeder { flex: 1 1 100%; white-space: normal; }
  .pgrid--kal .prow__k { display: inline; }
  .pgrid--kal .prow__st { margin-left: auto; }
}
.mattbl__rel { display: none; }
@media (max-width: 560px) {
  .mattbl .mattbl__r, .mattbl th:nth-child(2) { display: none; }
  .mattbl__rel { display: block; font-size: 13px; font-weight: 700; color: var(--info); white-space: normal; }
}

/* 18.11: karta „Funkcje etapu 2 (podgląd)” na liście pacjentek (zwijana, stan w przeglądarce) */
.e2 { margin-top: 16px; padding: 0; }
.e2__sum { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; font-weight: 700; min-height: 44px; }
.e2__sum::-webkit-details-marker { display: none; }
.e2__sum::after { content: ""; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; flex: none; margin-left: 4px; }
.e2[open] > .e2__sum::after { transform: rotate(-135deg); }
.e2__t { flex: 1; }
.e2__list { list-style: none; margin: 0; padding: 0 18px; display: grid; gap: 10px; }
.e2__list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--border); line-height: 1.45; }
.e2__list li > span:first-child { flex: 1 1 260px; min-width: 0; }
.e2__a { flex: none; }
.e2__foot { padding: 4px 18px 16px; margin: 0; }
.matlist li.is-plan strong { color: var(--info); }


/* 18.11: sekcja „Wykresy” w Przeglądzie karty (progesteron · temperatura · wagi), zwijana; ruch tylko transform/opacity */
.ovch { margin-bottom: 16px; padding: 0; }
.ovch__h { margin: 0; }
.ovch__tgl { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; width: 100%; min-height: 52px; padding: 12px 18px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius); }
.ovch__tgl:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.ovch__ttl { font-size: 17px; font-weight: 800; }
.ovch__sub { font-size: 13px; font-weight: 600; color: var(--muted); flex: 1 1 auto; min-width: 0; }
.ovch__chev { margin-left: auto; display: inline-flex; width: 22px; height: 22px; flex: none; transform: rotate(90deg); transition: transform .24s var(--ease, ease); }
.ovch__chev svg { width: 22px; height: 22px; }
.ovch.is-closed .ovch__chev { transform: rotate(-90deg); }
.ovch__body { padding: 0 18px 16px; }
.ovch__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), minmax(0, 1fr))); gap: 14px; }
.ovch__note { margin: 12px 0 0; }
.ovc { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px 6px; background: var(--surface); display: flex; flex-direction: column; }
.ovc__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ovc__t { font-size: 15px; font-weight: 800; margin: 0; }
.ovc__body { flex: 1 1 auto; min-width: 0; }
.ovc__body .chart { min-height: 0; }
.ovc__body .legend { margin-top: 8px; font-size: 13px; gap: 4px 14px; }
.ovc__body .hint { margin-top: 6px; }
.ovc__empty { color: var(--muted); font-size: 14px; line-height: 1.45; padding: 18px 0 10px; }
.ovc__links { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 4px; }
.ovc__go { display: inline-flex; align-items: center; min-height: 44px; color: var(--brand); font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.ovc .wg-chart--mini { margin-top: 2px; }
.ovc .wg-chart--mini .wg-chart__plot { height: 190px; }
.chart .dot--sq { fill: var(--accent); }
.chart .dot--tri { fill: var(--brand); }
.lg-sq { fill: var(--accent); }
.lg-tri { fill: var(--brand); }
.chart__src { font-size: 12px; opacity: .85; }
.chart--prog .chart__tip { flex-wrap: wrap; white-space: normal; max-width: min(280px, 96%); justify-content: center; text-align: center; row-gap: 0; }
.ps__h3 { font-size: 12px; margin: 10px 0 4px; color: #55524f; }
.ps .chart .dot--sq { fill: #8a570c; }
.ps .chart .dot--tri { fill: #b42f6c; }
@media (max-width: 380px) { .ovch__sub { display: none; } }
@media (max-width: 420px) {
  .ovch__tgl { padding: 12px 14px; }
  .ovch__body { padding: 0 12px 14px; }
  .ovc { padding: 10px 10px 4px; }
}

/* 19.11: suki hodowcy (lista hodowców + szczegóły hodowcy), wiek z daty urodzenia, progesteron „poza planem” */
.rowcard__dogs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 6px; }
.rowcard__lbl { font-weight: 800; color: var(--text); }
.rowcard__when { margin-top: 6px; }
.dogcnt { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 13px; color: var(--muted); }
.dogcnt b { color: var(--text); font-variant-numeric: tabular-nums; }
.dogcnt__i--act b { color: var(--ok); }
.dogchips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dogchip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 3px 4px 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 700; font-size: 14px; max-width: 100%; transition: border-color var(--t-micro, .15s) ease, transform .15s ease; }
.dogchip:hover { border-color: var(--brand); transform: translateY(-1px); }
.dogchip__n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.dogchip .badge { min-height: 22px; font-size: 12px; padding: 1px 8px; }
.dogchip--fin { background: var(--surface-2); }
.dogchip--fin .dogchip__n { color: var(--muted); }
.dogchip--more { padding-right: 12px; color: var(--brand-strong); }
.bstats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bdogs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bdog { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); animation: rowin .18s ease-out both; }
.bdog--fin { border-left-color: var(--border-strong); background: var(--surface-2); }
.bdog__main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.bdog__name { font-weight: 800; font-size: 16.5px; color: var(--text); overflow-wrap: break-word; }
.bdog__sub, .bdog__info, .bdog__cards { flex: 1 0 100%; font-size: 14px; color: var(--muted); overflow-wrap: break-word; }
.bdog__info { color: var(--text); }
.bdog__cards a { white-space: nowrap; }
#bdetail .page__head .rowcard__act { justify-content: flex-end; }
@media (max-width: 860px) { .bstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .bdog { grid-template-columns: minmax(0, 1fr); }
  .bdog__go { justify-self: start; }
  #bdetail .page__head .rowcard__act { justify-content: flex-start; }
}
.badge--plan { background: var(--accent-soft); color: var(--text); border: 1px dashed var(--accent); min-height: 20px; font-size: 11.5px; padding: 0 7px; }
.matplan li.is-extra { background: transparent; border: 1px dashed var(--accent); }
.matplan__v { display: block; font-size: 13px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.matplan__note { margin: -6px 0 10px; }
.mattbl tr.is-extra td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.age { white-space: nowrap; }
.ovc__al { margin: 0 0 8px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-weight: 800; font-size: 13.5px; border: 1px solid var(--danger); }
.ovc__al--crit { border-width: 2px; border-left-width: 5px; }
.rowcard--br { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto; }
@media (max-width: 860px) { .rowcard--br { grid-template-columns: minmax(0, 1fr); } }

/* ---------- 20.11: prośby lekarki — gatunek (kotka), nazwa hodowli, masa ciała pacjentki ---------- */
.badge--cat { background: var(--info-soft); color: var(--info); border: 1px solid color-mix(in srgb, var(--info) 35%, transparent); margin-left: 6px; font-size: 11.5px; vertical-align: middle; }
.dogchip .badge--cat { margin-left: 0; }
.rowcard__kennel { display: flex; align-items: center; gap: 6px; margin: 2px 0 2px; font-size: 13.5px; color: var(--muted); overflow-wrap: break-word; }
.rowcard__kennel svg { width: 14px; height: 14px; flex: none; }
.rowcard__kennel b { color: var(--text); font-weight: 600; }
.page__kennel { margin: 2px 0 4px; font-size: 15px; color: var(--muted); overflow-wrap: break-word; }
.page__kennel b { color: var(--text); }
.kennel { color: var(--muted); }
.masa-gain { margin: 8px 0 6px; font-size: 14.5px; overflow-wrap: break-word; }
.masa-gain b { color: var(--info); font-variant-numeric: tabular-nums; }
.masatbl { margin-top: 10px; }
.masatbl td, .masatbl th { vertical-align: top; }
.masatbl b { font-variant-numeric: tabular-nums; }
.mat-cat { font-size: 13.5px; }
#masa-card .chart, #masa-card table { animation: masaIn .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes masaIn { from { opacity: .6; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media print { #masa-card .chart, #masa-card table { animation: none; } }

/* ---------- 20.11 wieczór: zrzuty lekarki — karta hodowcy bez nachodzenia, tabela masy, „Edytuj dane pacjentki” ---------- */
/* karta hodowcy: 2 kolumny treści (min-width:0) + rząd przycisków na dole karty, zawsze w tym samym miejscu */
.rowcard--br { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); align-items: start; gap: 10px 22px; }
.rowcard--br > div { min-width: 0; }
.rowcard--br .brc__id, .rowcard--br .brc__dogs { min-width: 0; max-width: 100%; }
.rowcard--br .rowcard__name { overflow-wrap: break-word; }
.rowcard--br .brc__nm { min-width: 0; }
.rowcard--br .rowcard__name .badge { flex: none; white-space: nowrap; }
.rowcard--br .brc__dogs .dogchips { min-width: 0; max-width: 100%; }
.rowcard--br .brc__dogs .dogchips > li { min-width: 0; max-width: 100%; display: flex; }
.rowcard--br .dogchip { min-width: 0; max-width: 100%; }
.rowcard--br .dogchip__n { flex: 0 1 auto; }
.rowcard--br .dogchip .badge { flex: none; white-space: nowrap; }
.rowcard--br .rowcard__when { overflow-wrap: normal; word-break: normal; }
.rowcard--br > .brc__act { grid-column: 1 / -1; justify-content: flex-end; padding-top: 10px; border-top: 1px dashed var(--border); margin-top: 2px; }
.rowcard--br > .brc__act .btn { flex: none; white-space: nowrap; }
@media (max-width: 860px) {
  .rowcard--br { grid-template-columns: minmax(0, 1fr); }
  .rowcard--br > .brc__act { justify-content: flex-start; }
}
@media (max-width: 480px) {
  .rowcard--br > .brc__act .btn { flex: 1 1 auto; white-space: normal; }
}

/* tabela masy ciała: #app ma overflow-wrap:anywhere — w tabeli to ściskało „Źródło” do 1 litery; tu słowa zawijają się normalnie */
#masa-card { container-type: inline-size; }
.masatbl-wrap { max-width: 100%; }
.masatbl { table-layout: auto; }
.masatbl th, .masatbl td { overflow-wrap: normal; word-break: normal; hyphens: manual; }
.masatbl th { white-space: nowrap; }
.masatbl .masa-c-d { white-space: nowrap; }
.masatbl .masa-day { display: block; white-space: nowrap; }
.masatbl .masa-c-v, .masatbl .masa-c-p, .masatbl .masa-c-f { white-space: nowrap; }
.masatbl .masa-c-s { min-width: 120px; width: 28%; }
.masa-chg { font-weight: 700; font-variant-numeric: tabular-nums; }
.masa-chg.is-down { color: var(--danger); }
.masa-chg.is-up { color: var(--ok); }
.masa-sum { display: grid; gap: 4px; margin: 8px 0 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); background: var(--surface-2); animation: masaIn .45s cubic-bezier(.2,.8,.2,1) both; }
.masa-sum p { margin: 0; font-size: 14.5px; overflow-wrap: break-word; }
.masa-sum .masa-gain { margin: 0; }
.masa-gain b.masa-chg.is-down, .masa-prev b.masa-chg.is-down { color: var(--danger); }
.masa-gain b.masa-chg.is-up, .masa-prev b.masa-chg.is-up { color: var(--ok); }
.masa-gain b.masa-chg:not(.is-up):not(.is-down) { color: var(--text); }
.masa-order { margin-top: 6px; }
/* wąska karta (kolumna Przeglądu albo telefon): wiersze jako kafelki zamiast tabeli */
@container (max-width: 720px) { /* 20.11: było 600 — przy 768 tabela wystawała 29 px */
  .masatbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .masatbl, .masatbl tbody { display: block; width: 100%; }
  .masatbl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 12px; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); background: var(--surface); }
  .masatbl td { display: block; padding: 0; border: 0; white-space: normal; }
  .masatbl .masa-c-d { grid-column: 1; }
  .masatbl .masa-c-v { grid-column: 2; grid-row: 1; text-align: right; font-size: 16px; }
  .masatbl .masa-c-p, .masatbl .masa-c-f, .masatbl .masa-c-s { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; width: auto; min-width: 0; }
  .masatbl .masa-c-p::before, .masatbl .masa-c-f::before, .masatbl .masa-c-s::before { content: attr(data-l) ":"; color: var(--muted); font-size: 12.5px; font-weight: 600; min-width: 112px; }
  .masatbl .masa-c-s { font-size: 13.5px; }
}
@supports not (container-type: inline-size) {
  @media (max-width: 1100px) {
    .masatbl .masa-c-f { display: none; }
  }
}
.btn--edit-p { border-color: var(--brand); color: var(--brand-strong); }
.btn--edit-p:hover { background: var(--brand-soft); }

/* 20.11 wieczór: przycisk „Napisz na WhatsApp” (kontakt hodowcy z lekarzem; numer z Ustawień) — zielony akcent w obu motywach */
:root { --wa: #127a43; --wa-soft: #e3f5ea; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --wa: #5fd394; --wa-soft: #143222; } }
:root[data-theme="dark"] { --wa: #5fd394; --wa-soft: #143222; }
.btn--wa { color: var(--wa); border-color: var(--wa); background: var(--wa-soft); transition: transform .15s ease, opacity .15s ease; }
.btn--wa:hover { border-color: var(--wa); opacity: .9; transform: translateY(-1px); }
.btn--wa .wa-ico { width: 19px; height: 19px; flex: none; }
.wa-prev { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
/* 20.11 wieczór: „Zadzwoń: <imię i tytuł>” — kontakt bezpośredni z Ustawień (obok „Zadzwoń do gabinetu”) */
.btn--direct { color: var(--brand-strong); border-color: var(--brand); background: var(--brand-soft); transition: transform .15s ease, opacity .15s ease; }
.btn--direct:hover { opacity: .92; transform: translateY(-1px); }

/* ===== 20.11 NAPRAWA 1 (audyt układu): koniec „litery pod literą” =====
   overflow-wrap: anywhere zaniżało min-content do 1 znaku i kolumny gridów/tabel ściskały się do szerokości litery.
   Teraz wszędzie break-word (łamie tylko słowo, które samo nie mieści się w linii); „anywhere” tylko dla e-maili/URL. */
.u-any, a[href^="mailto:"], a[href^="http"], .brc__mail, .page__sub, .czat__csub, .email__head, .mtbl__n { overflow-wrap: anywhere; }
/* dzieci gridów/flexów mogą się zwężać, ale tekst łamie się tylko między słowami */
.rowcard > *, .tl__grid > *, .kv > *, .stats > *, .stat, .matplan li > *, .matlist li > *, .notif > *, .email > * { min-width: 0; }
/* nagłówki kolumn tabel nie łamią słów */
.tbl th, .phead__b { overflow-wrap: normal; word-break: normal; hyphens: manual; }
.phead__b, .mtbl th { white-space: nowrap; }
/* lista pacjentek (PC, bez kalendarza w kolumnie): kolumna „Hodowca” nie węższa niż jej nagłówek */
@media (min-width: 1021px) {
  .phead, .prow { grid-template-columns: minmax(12ch, 2.6fr) minmax(88px, 1fr) 96px 104px 112px 160px; }
}
/* „Najważniejsze działania”: data pod opisem bez ujemnego marginesu (nachodziła na opis i przycisk) */
@media (max-width: 860px) {
  .todo__date, .todo .dotmark ~ .todo__date { margin-top: 2px; }
  .todo li { align-items: flex-start; padding-top: 6px; padding-bottom: 6px; }
  .todo li > .tick, .todo li > .iconbtn { align-self: center; }
}
/* kafel „Termin porodu” (zakres dat): może przejść do 2. linii po myślniku, rok zostaje przy dacie */
.stat__value--range { white-space: normal; }
.stat__value--range small { white-space: nowrap; }
/* chronologia: wartości (np. masa) bez łamania w środku liczby */
.tl__grid { grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), minmax(0, 1fr))); }
/* numer chipa w jednej linii */
.kv__chip { white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
@media (max-width: 380px) { .kv__chip { white-space: normal; overflow-wrap: anywhere; } }
/* karta „Krycie i progesteron”: układ wg szerokości KARTY, nie okna (w wąskiej kolumnie przy 1280–1920 była 2-kolumnowa) */
.mat { container: mat / inline-size; }
@container mat (max-width: 720px) {
  .mat__grid { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
@container mat (max-width: 560px) {
  .mattbl .mattbl__r, .mattbl th:nth-child(2) { display: none; }
  .mattbl__rel { display: block; font-size: 13px; font-weight: 700; color: var(--info); white-space: normal; }
  .inline-form.inline-form--mat, .inline-form.inline-form--mat3 { grid-template-columns: minmax(0, 1fr); }
  .inline-form--mat .field:first-child, .inline-form--mat3 .field:first-child { grid-column: auto; }
}
.matplan li { grid-template-columns: 52px minmax(9ch, 1fr) auto; }
.matplan__l, .matlist li strong { overflow-wrap: normal; }
.matlist li strong { white-space: nowrap; }
.mattbl th { hyphens: manual; }
.mattbl th:nth-child(2), .mattbl__r { white-space: nowrap; }
.mattbl { max-width: 100%; }
/* tabela masy ciała: data może przejść do 2. linii (nie wystaje na kolumnę masy) */
.masatbl .masa-c-d { white-space: normal; min-width: 11ch; }
/* długie przyciski (np. „Zadzwoń: tech. wet. … Dydak-Przybylska”) na telefonie zawijają tekst zamiast go ucinać */
@media (max-width: 560px) {
  .btn { white-space: normal; text-align: center; line-height: 1.25; padding-top: 6px; padding-bottom: 6px; }
  .btn--direct, .btn--wa { justify-content: flex-start; text-align: left; }
}
/* lista pacjentek na PC: bardzo długie imię nie wychodzi poza kolumnę — wielokropek, pełne imię w title */
@media (min-width: 1021px) {
  .prow__name b { flex: 0 1 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.btn--direct, .btn--wa { white-space: normal; height: auto; min-height: 44px; }
.matplan__v { white-space: nowrap; }
.matplan li > span:nth-child(2) { min-width: 0; }
.todo__date { flex: none; }
@media (min-width: 1021px) {
  .prow__name .badge { flex: 0 1 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.cols > * { min-width: 0; }
/* „Najważniejsze działania” na PC/tablecie (2 kolumny): data nie wystaje — gdy brak miejsca, przechodzi pod opis */
@media (min-width: 861px) {
  .todo li { flex-wrap: wrap; }
  .todo__txt { flex: 1 1 0; min-width: min(14ch, 100%); }
}

/* ---------- 20.11: pasek „Jest nowa wersja aplikacji” (wdrożenie w trakcie pracy; app.js → verBar) ----------
   w układzie strony (sticky u góry) — przesuwa treść w dół zamiast ją zasłaniać; --bar-h przesuwa też boczny pasek */
:root.has-verbar { --bar-h: 56px; }
.verbar {
  position: sticky; top: 0; z-index: 55; box-sizing: border-box; height: var(--bar-h);
  display: flex; align-items: center; justify-content: center; gap: 14px; padding: 0 16px;
  background: var(--brand); color: var(--on-brand); font-size: 14.5px; line-height: 1.3;
  box-shadow: 0 2px 12px rgba(38, 38, 43, .16); animation: fade .25s ease both;
}
.verbar[hidden] { display: none; }
.verbar__txt { display: flex; align-items: center; gap: 10px; min-width: 0; }
.verbar__txt > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verbar svg { width: 18px; height: 18px; flex: none; }
.verbar .verbar__btn { flex: none; min-height: 40px; background: var(--surface); color: var(--brand); border-color: transparent; font-weight: 800; }
.verbar .verbar__btn:hover { background: var(--brand-soft); color: var(--brand-strong); }
.verbar .verbar__btn:focus-visible { outline: 2px solid var(--on-brand); outline-offset: 2px; }
@media (max-width: 860px) { .verbar__more { display: none; } }
@media (min-width: 861px) { .has-verbar .netbar { top: calc(var(--bar-h) + 10px); } }
@media print { .verbar { display: none; } }
/* 20.11 audyt Firefox: data krycia u hodowcy łamana „202⏎6” — lista kv na pełną szerokość sekcji, daty bez łamania */
.matvet > .kv { justify-self: stretch; width: 100%; }
.matvet .kv dd { overflow-wrap: break-word; word-break: normal; }
/* 20.11 S-SKALA (zoom/skalowanie Windows): przedział 861–1060 px CSS — karty w 1 kolumnie, kafle hodowcy 2×2; kv bez ściskania etykiet */
@media (min-width: 861px) and (max-width: 1060px) {
  .cols, .cols--prog { grid-template-columns: minmax(0, 1fr); }
  .bstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 421px) {
  .kv { grid-template-columns: minmax(96px, 40%) minmax(0, 1fr); }
}
