/* E-wywiad — tokeny i komponenty z makiet (zestaw B, 27.09.2026). Generowane: tools/build-css-edytora.py */
@font-face { font-family: 'Geist'; src: url('/fonts/geist/Geist-Variable.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/fonts/geist/GeistMono-Variable.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
:root { --demo-h: 0px; --topbar-h: 64px; --bg: #f6f7fb; --surface: #ffffff; --s2: #f4f5fa; --ink: #0d1226; --ink2: #43476a; --ink3: #5a5e7a; --line: #e5e7f0; --navy: #0a1230; --navy2: #142244;
  --green: #1f9d6b; --amber: #ed8a2e; --red: #e5484d;
  --accent: #1f8a9d; --accent-text: #15707f; --accent-50: rgba(31,138,157,.12);
  --green-50: rgba(31,157,107,.12); --amber-50: rgba(237,138,46,.14); --red-50: rgba(229,72,77,.10);
  --blue: #2f6bd1; --blue-text: #25579f; --blue-50: rgba(47,107,209,.12);
  --violet: #8e4ec6; --violet-50: rgba(142,78,198,.12);
  /* 0.42 (#82): czcionki emoji przed rodziną ogólną — symbole z arkuszy (np. 🏋️‍♀️ przy natężeniu wysiłku) zamiast kwadratów */
  --font: 'Geist', system-ui, 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', monospace;
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-pill: 999px;
  --sh-1: 0 1px 1px rgba(20,34,68,.04); --sh-2: 0 4px 16px -2px rgba(20,34,68,.08);
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; min-width: 1024px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
a { color: var(--accent-text); } a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
.ew-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ew-num { font-variant-numeric: tabular-nums; }
.ew-label { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }

/* ---- Powłoka aplikacji ---- */
.ew-app { display: flex; min-height: 100vh; }
.ew-sidebar { width: 236px; flex: none; background: var(--navy); color: rgba(255,255,255,.66); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.ew-sidebar__brand { padding: 22px 22px 18px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: baseline; gap: 8px; }
.ew-wordmark { color: #fff; font-weight: 700; font-size: 19px; letter-spacing: -.02em; text-decoration: none; }
.ew-wordmark--short { display: none; }
.ew-wordmark__tag { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: rgba(255,255,255,.4); }
.ew-nav { padding: 14px 12px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.ew-nav__group { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: rgba(255,255,255,.34); padding: 8px 12px 6px; }
.ew-nav__group + .ew-nav__item { margin-top: 0; }
.ew-nav__item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r); color: rgba(255,255,255,.7); text-decoration: none; font-size: 13.5px; font-weight: 500; border: 0; background: transparent; text-align: left; cursor: pointer; }
.ew-nav__item:hover { background: rgba(255,255,255,.06); color: #fff; }
.ew-nav__item[aria-current="page"] { background: rgba(255,255,255,.1); color: #fff; }
.ew-nav__item svg { flex: none; }
.ew-nav__item { position: relative; }
.ew-nav__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ew-nav__count { margin-left: auto; white-space: nowrap; font-family: var(--mono); font-size: 12px; color: rgba(255,255,255,.55); }
.ew-nav__count--hot { color: #fff; background: var(--accent); border-radius: var(--r-pill); padding: 1px 7px; font-weight: 600; }
.ew-sidebar__user { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.ew-avatar { width: 30px; height: 30px; flex: none; border-radius: var(--r-pill); background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; }
.ew-avatar--sm { width: 24px; height: 24px; font-size: 11px; }
.ew-avatar--ai { background: var(--violet); }
.ew-avatar--auto { background: var(--amber); }
.ew-sidebar__user-name { color: #fff; font-size: 13px; font-weight: 500; }
.ew-sidebar__user-role { font-family: var(--mono); font-size: 11px; color: rgba(255,255,255,.4); }
.ew-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ew-topbar { height: var(--topbar-h); flex: none; border-bottom: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; gap: 16px; padding: 0 26px; position: sticky; top: var(--demo-h); z-index: 20; }
.ew-crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; list-style: none; margin: 0; padding: 0; min-width: 0; }
.ew-crumbs a { color: var(--ink2); text-decoration: none; } .ew-crumbs a:hover { color: var(--ink); }
.ew-crumbs__sep { color: #b3b7cc; }
.ew-crumbs__current { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ew-search { position: relative; width: 320px; max-width: 30vw; margin-left: auto; }
.ew-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink3); }
.ew-search input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: var(--r); padding: 0 12px 0 34px; background: var(--s2); font-size: 13.5px; outline: none; }
.ew-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-50); background: var(--surface); }
.ew-main { flex: 1; min-width: 0; padding: 22px 26px 40px; }
@media (max-width: 1180px) {
  .ew-sidebar { width: 60px; }
  .ew-sidebar__brand { padding: 20px 0 16px; justify-content: center; }
  .ew-sidebar__brand .ew-wordmark { font-size: 15px; } .ew-sidebar__brand .ew-wordmark__tag { display: none; }
  .ew-wordmark--short { display: inline; } .ew-wordmark--full { display: none; }
  .ew-nav { padding: 12px 8px; }
  .ew-nav__group { height: 1px; padding: 0; margin: 8px 6px; background: rgba(255,255,255,.1); overflow: hidden; color: transparent; }
  .ew-nav__item { justify-content: center; padding: 10px 0; }
  .ew-nav__label { position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); background: var(--navy); color: #fff; font-size: 13px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; z-index: 40; box-shadow: var(--sh-2); overflow: visible; }
  .ew-nav__item:hover .ew-nav__label, .ew-nav__item:focus-visible .ew-nav__label { opacity: 1; }
  .ew-nav__count { position: absolute; top: 4px; right: 4px; margin: 0; font-size: 11px; padding: 0 5px; line-height: 16px; background: rgba(255,255,255,.14); color: #fff; border-radius: var(--r-pill); }
  .ew-nav__count:not(.ew-nav__count--hot) { display: none; }
  .ew-nav__count--hot { background: var(--accent); }
  .ew-nav__group { font-size: 0; }
  .ew-demo__note { display: none; }
  .ew-sidebar__user { justify-content: center; padding: 12px 8px; } .ew-sidebar__user > div { display: none; }
  .ew-topbar { padding: 0 18px; } .ew-main { padding: 18px 18px 40px; }
  .ew-search { width: 220px; }
}

/* ---- Przyciski ---- */
.ew-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid transparent; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: box-shadow .18s, border-color .18s, background .12s; }
.ew-btn--primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.ew-btn--primary:hover { border-color: var(--accent); box-shadow: 0 8px 24px -8px rgba(31,138,157,.5); color: #fff; } /* 0.38.4: odnośnik ze stylem przycisku dostawał z a:hover ciemny tekst na granacie */
.ew-btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.ew-btn--secondary:hover { border-color: var(--accent); }
.ew-btn--ghost { background: transparent; color: var(--ink2); border-color: transparent; }
.ew-btn--ghost:hover { background: var(--s2); color: var(--ink); }
.ew-btn--danger { background: var(--red-50); color: #b93338; border-color: rgba(229,72,77,.3); }
.ew-btn--danger:hover { background: rgba(229,72,77,.16); }
.ew-btn--sm { height: 30px; padding: 0 11px; font-size: 13px; }
.ew-btn--icon { width: 30px; padding: 0; border-radius: var(--r-sm); }
.ew-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ---- Chipy ---- */
.ew-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--r-pill); font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; background: var(--s2); color: var(--ink2); border: 1px solid transparent; }
.ew-chip svg { flex: none; }
.ew-chip--status-szkic { background: var(--s2); color: var(--ink3); }
.ew-chip--status-zgloszona { background: var(--blue-50); color: var(--blue-text); }
.ew-chip--status-wstepna { background: var(--accent-50); color: var(--accent-text); }
.ew-chip--status-zatwierdzona { background: var(--green-50); color: #157a52; }
.ew-chip--status-odrzucona { background: var(--red-50); color: #b93338; }
.ew-chip--status-wycofana { background: transparent; color: var(--ink3); border-color: var(--line); }
.ew-chip--status-konflikt { background: var(--amber-50); color: #a85a12; }
.ew-chip--pochodzenie-arkusz { background: var(--s2); color: var(--ink2); }
.ew-chip--pochodzenie-literatura { background: var(--blue-50); color: var(--blue-text); }
.ew-chip--pochodzenie-lekarz { background: var(--accent-50); color: var(--accent-text); }
.ew-chip--pochodzenie-ai { background: var(--violet-50); color: #6d3699; }
.ew-chip--pochodzenie-kontrola { background: var(--amber-50); color: #a85a12; }
.ew-chip--pewnosc { text-transform: none; letter-spacing: 0; font-family: var(--font); font-size: 12px; font-weight: 500; background: transparent; border-color: var(--line); color: var(--ink2); }
.ew-chip--marker { text-transform: none; letter-spacing: 0; font-family: var(--font); font-size: 12px; font-weight: 500; background: transparent; border: 1px dashed #c2c6d8; color: var(--ink3); }
.ew-chip--wyklucza { background: var(--red-50); color: #b93338; border-color: rgba(229,72,77,.25); text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.ew-chip--kontrola-ok { background: var(--green-50); color: #157a52; }
.ew-chip--kontrola-ostrzezenie { background: var(--amber-50); color: #a85a12; }
.ew-chip--kontrola-blokada { background: var(--red-50); color: #b93338; }
.ew-chip--rzad { background: var(--navy2); color: #fff; }
.ew-chip--spec { background: var(--s2); color: var(--ink2); border-color: var(--line); }

/* ---- Znacznik pochodzenia (zawsze dostępny, nie zaśmieca) ---- */
.ew-origin { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink3); font-family: var(--mono); font-size: 11px; line-height: 1; font-weight: 600; cursor: help; padding: 0; vertical-align: middle; flex: none; }
.ew-origin--arkusz { color: var(--ink3); }
.ew-origin--literatura { color: var(--blue-text); border-color: rgba(47,107,209,.4); }
.ew-origin--lekarz { color: var(--accent-text); border-color: rgba(31,138,157,.5); }
.ew-origin--ai { color: #6d3699; border-color: rgba(142,78,198,.45); }
.ew-origin--kontrola { color: #a85a12; border-color: rgba(237,138,46,.5); }
/* 0.45.0 (P1b): wartość z literatury bez cytatu potwierdzonego w źródle (np. brak możliwości weryfikacji automatycznej) */
.ew-origin--niepotwierdzone { border-style: dashed; border-color: rgba(237,138,46,.8); padding: 0 3px; }
/* 0.47.0 (rozmowa 26.10): kontekst propozycji na karcie, podświetlone miejsce zmiany, wartości spoza listy referencyjnej, legenda */
.ew-kontekst { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; padding: 10px 14px; margin: 0 0 12px; border: 1px solid rgba(237,138,46,.55); border-left: 4px solid var(--amber); border-radius: var(--r); background: #fdf3e8; font-size: 13.5px; position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 25; box-shadow: var(--sh-1, 0 1px 3px rgba(0,0,0,.08)); }
.ew-podswietl { box-shadow: 0 0 0 2px var(--amber), 0 0 0 6px rgba(237,138,46,.18); scroll-margin-top: 90px; }
.ew-chip--spoza-listy { background: var(--amber-50); color: #8a4a0e; border: 1px dashed rgba(237,138,46,.85); }
.ew-chip--spoza-listy a { color: inherit; }
.ew-legenda { margin: 0 0 12px; font-size: 12.5px; color: var(--ink2); }
.ew-legenda > summary { cursor: pointer; font-weight: 600; }
.ew-legenda__lista { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-top: 8px; }
.ew-legenda__lista > span { display: inline-flex; gap: 6px; align-items: center; }
.ew-origin__tip { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); background: var(--navy); color: #fff; font-family: var(--font); font-size: 13px; font-weight: 400; line-height: 1.45; padding: 8px 10px; border-radius: 8px; width: max-content; max-width: 260px; text-align: left; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 30; box-shadow: var(--sh-2); }
.ew-origin__tip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--navy); }
.ew-origin__tip strong { font-weight: 600; display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2px; color: rgba(255,255,255,.7); }
.ew-origin:hover .ew-origin__tip, .ew-origin:focus-visible .ew-origin__tip { opacity: 1; }
.ew-origin--right .ew-origin__tip { left: auto; right: 0; transform: none; } .ew-origin--right .ew-origin__tip::after { left: auto; right: 6px; }
.ew-origin--left .ew-origin__tip { left: 0; right: auto; transform: none; } .ew-origin--left .ew-origin__tip::after { left: 6px; margin-left: 0; }
.ew-origin--down .ew-origin__tip { bottom: auto; top: calc(100% + 8px); } .ew-origin--down .ew-origin__tip::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--navy); }
/* 0.31 (zgłoszenie #18): znacznik pochodzenia z komórką arkusza jest odnośnikiem do podglądu wiersza */
a.ew-origin { text-decoration: none; cursor: pointer; }
a.ew-origin:hover, a.ew-origin:focus-visible { border-color: var(--accent-text); color: var(--accent-text); }
.ew-origin__go { font-style: italic; opacity: .85; }
.ew-origin__tip { z-index: 80; }

/* ---- Karta / nagłówek tożsamości ---- */
.ew-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.ew-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ew-card__title { margin: 0; font-size: 14px; font-weight: 600; }
.ew-card__body { padding: 16px 18px; }
.ew-rail .ew-origin__tip { left: auto; right: 0; transform: none; } .ew-rail .ew-origin__tip::after { left: auto; right: 6px; }
.ew-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.ew-page-head__meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ew-page-head__actions { display: flex; gap: 8px; flex: none; }
.ew-identity { display: grid; grid-template-columns: minmax(200px,1.6fr) minmax(180px,1.4fr) minmax(140px,1fr) minmax(140px,1fr) minmax(120px,.9fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.ew-identity--card { border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.ew-identity--card .ew-field:first-child { border-radius: var(--r-lg) 0 0 var(--r-lg); } .ew-identity--card .ew-field:last-child { border-radius: 0 var(--r-lg) var(--r-lg) 0; }
.ew-field { position: relative; padding: 12px 16px 12px; border-right: 1px solid var(--line); min-width: 0; }
.ew-field:last-child { border-right: 0; }
.ew-field__label { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.ew-field__value { font-size: 17px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ew-field__value--course { font-family: var(--mono); font-weight: 500; font-size: 15px; }
.ew-field__value--muted { color: var(--ink3); font-weight: 400; }
.ew-field__propose { position: absolute; top: 10px; right: 10px; opacity: 0; width: 26px; height: 26px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: opacity .12s; }
.ew-field:hover .ew-field__propose, .ew-field__propose:focus-visible { opacity: 1; }
.ew-field__propose:hover { border-color: var(--accent); color: var(--accent-text); }
.ew-identity-title { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
.ew-identity-title .ew-dot { color: #b3b7cc; font-weight: 400; }
.ew-identity-title .ew-course { font-family: var(--mono); font-weight: 500; font-size: 19px; color: var(--ink2); }
.ew-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.ew-kv dt { color: var(--ink3); } .ew-kv dd { margin: 0; font-weight: 500; }

/* ---- Alert ---- */
.ew-alert { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; margin-bottom: 14px; }
.ew-alert svg { flex: none; margin-top: 1px; }
.ew-alert--konflikt { border-color: rgba(237,138,46,.45); background: #fff9f2; }
.ew-alert--info { border-color: rgba(31,138,157,.35); background: #f2f9fa; }
.ew-alert--odczyt { border-color: var(--line); background: var(--s2); }
.ew-alert--blad { border-color: rgba(229,72,77,.45); background: #fff5f5; }
.ew-alert__title { font-weight: 600; margin: 0 0 2px; }
.ew-alert__text { margin: 0; color: var(--ink2); }
.ew-alert__actions { margin-left: auto; display: flex; gap: 8px; flex: none; }

/* ---- Zakładki ---- */
.ew-tabs { display: flex; flex-wrap: wrap; gap: 0 2px; border-bottom: 1px solid var(--line); margin: 0 0 16px; }
.ew-tab { appearance: none; background: transparent; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 10px; font-size: 14px; font-weight: 500; color: var(--ink2); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.ew-tab:hover { color: var(--ink); }
.ew-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.ew-tab__count { font-family: var(--mono); font-size: 12px; color: var(--ink3); background: var(--s2); border-radius: var(--r-sm); padding: 1px 6px; font-variant-numeric: tabular-nums; }
.ew-tab[aria-selected="true"] .ew-tab__count { background: var(--accent-50); color: var(--accent-text); }
.ew-tab:disabled { color: #a3a7bd; cursor: not-allowed; }
.ew-panel[hidden] { display: none; }

/* ---- Układ karta + prawa szyna ---- */
.ew-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 16px; align-items: start; margin-top: 18px; }
@media (max-width: 1180px) { .ew-layout { grid-template-columns: 1fr; } .ew-identity { grid-template-columns: repeat(3, minmax(0,1fr)); } .ew-field:nth-child(3) { border-right: 0; } .ew-field:nth-child(n+4) { border-top: 1px solid var(--line); } }
.ew-rail { display: flex; flex-direction: column; gap: 12px; position: sticky; top: calc(var(--demo-h) + var(--topbar-h) + 22px); }

/* ---- Pasek narzędzi tabeli ---- */
.ew-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.ew-toolbar__stat { font-size: 13px; color: var(--ink2); }
.ew-toolbar__stat b { color: var(--ink); font-weight: 600; }
.ew-toolbar__spacer { flex: 1; }
.ew-seg { display: inline-flex; gap: 2px; background: var(--s2); border: 1px solid var(--line); border-radius: var(--r); padding: 3px; }
.ew-seg__btn { height: 28px; padding: 0 11px; border: 0; background: transparent; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--ink2); cursor: pointer; }
.ew-seg__btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); font-weight: 600; }

/* ---- Tabela gęsta ---- */
.ew-table-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); min-width: 0; }
.ew-table-wrap { overflow-x: auto; }
.ew-table--pary { min-width: 900px; }
.ew-table--pary th:nth-child(-n+2), .ew-table--pary td:nth-child(-n+2) { position: sticky; background: var(--surface); z-index: 2; }
.ew-table--pary th:nth-child(1), .ew-table--pary td:nth-child(1) { left: 0; } .ew-table--pary th:nth-child(2), .ew-table--pary td:nth-child(2) { left: 34px; box-shadow: 1px 0 0 var(--line); }
.ew-table--pary th:nth-child(-n+2) { background: var(--navy2); z-index: 6; } .ew-table--pary tbody tr:hover > td:nth-child(-n+2) { background: #fafbfe; }
.ew-table--pary .ew-row--conflict > td:nth-child(-n+2), [data-state="konflikt"] .ew-table--pary .ew-row--conflict-target > td:nth-child(-n+2) { background: #fff9f2; } [data-state="konflikt"] .ew-row--conflict-target > td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.ew-table--pary .ew-variants > td { position: static; }
.ew-layout > * { min-width: 0; }
.ew-table-wrap .ew-table thead th:first-child { border-top-left-radius: var(--r-lg); } .ew-table-wrap .ew-table thead th:last-child { border-top-right-radius: var(--r-lg); }
.ew-table-wrap .ew-table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--r-lg); } .ew-table-wrap .ew-table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--r-lg); }
.ew-table td .ew-origin__tip, .ew-variant .ew-origin__tip { left: auto; right: 0; transform: none; } .ew-table td .ew-origin__tip::after, .ew-variant .ew-origin__tip::after { left: auto; right: 6px; }
.ew-table tbody tr:first-child > td .ew-origin__tip, .ew-variants__list li:first-child .ew-origin__tip { bottom: auto; top: calc(100% + 8px); } .ew-table tbody tr:first-child > td .ew-origin__tip::after, .ew-variants__list li:first-child .ew-origin__tip::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--navy); }
.ew-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ew-table th { text-align: left; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: #fff; background: var(--navy2); padding: 10px 12px; white-space: nowrap; position: sticky; top: calc(var(--demo-h) + var(--topbar-h)); z-index: 5; }
.ew-table th:first-child { padding-left: 14px; } .ew-table th:last-child { padding-right: 14px; }
.ew-table th[aria-sort] { cursor: pointer; } .ew-table th[aria-sort] svg { vertical-align: -2px; margin-left: 4px; opacity: .7; }
.ew-table td { padding: 9px 12px; border-top: 1px solid #eef0f6; vertical-align: middle; }
.ew-table td:first-child { padding-left: 14px; } .ew-table td:last-child { padding-right: 14px; }
.ew-table tbody tr:hover > td { background: #fafbfe; }
.ew-table__num { text-align: right; font-variant-numeric: tabular-nums; }
.ew-table col.ew-col--toggle { width: 34px; } .ew-table col.ew-col--q { width: 150px; } .ew-table col.ew-col--pewnosc { width: 118px; } .ew-table col.ew-col--triage { width: 80px; } .ew-table col.ew-col--kanal { width: 92px; } .ew-table col.ew-col--pochodzenie { width: 130px; } .ew-table col.ew-col--actions { width: 76px; }
.ew-row__toggle { width: 22px; height: 22px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.ew-row__toggle svg { transition: transform .15s; }
.ew-row__toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.ew-row__toggle--empty { visibility: hidden; }
.ew-symptom { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ew-symptom__kind { font-weight: 600; }
.ew-symptom__dot { color: #b3b7cc; }
.ew-symptom__struct { color: var(--ink2); }
.ew-symptom__variants { font-family: var(--mono); font-size: 12px; color: var(--ink3); margin-left: 4px; }
.ew-row--conflict > td { background: #fff9f2; } .ew-row--conflict > td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.ew-row--conflict:hover > td { background: #fff5e8; }
.ew-row-actions { display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity .12s; }
tr:hover .ew-row-actions, .ew-row-actions:focus-within { opacity: 1; }
.ew-variants > td { padding: 0; background: var(--s2); border-top: 0; }
.ew-variants[hidden] { display: none; }
.ew-variants__list { margin: 0; padding: 6px 14px 10px 48px; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.ew-variant { display: grid; grid-template-columns: minmax(0,1fr) 130px 118px 28px; align-items: center; column-gap: 12px; padding: 7px 0 7px 12px; font-size: 13px; border-left: 2px solid #d5d8e6; }
.ew-variant__axes { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.ew-axis { display: inline-flex; align-items: baseline; gap: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px 7px; font-size: 13px; }
.ew-axis__code { font-family: var(--mono); font-size: 11px; color: var(--ink3); letter-spacing: .04em; }
.ew-variants__add { margin-top: 6px; }
.ew-variants__head { display: grid; grid-template-columns: minmax(0,1fr) 130px 118px 28px; column-gap: 12px; padding: 8px 0 4px 14px; }
.ew-variants__head .ew-label { font-size: 11px; }

/* ---- Q (występowalność) ---- */
.ew-q { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.ew-q__unit { color: var(--ink3); font-weight: 400; }
.ew-q--zero { color: #b93338; }
.ew-q--none { font-family: var(--font); font-weight: 400; color: var(--ink3); font-size: 13px; }
.ew-q--none .ew-q__work { font-family: var(--mono); font-size: 12px; color: #7f839f; }
.ew-q--range::after { content: ""; }

/* ---- Prawa szyna ---- */
.ew-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ew-list__item { padding: 10px 0; border-top: 1px solid #eef0f6; display: flex; flex-direction: column; gap: 5px; }
.ew-list__item:first-child { border-top: 0; padding-top: 0; }
.ew-list__item:last-child { padding-bottom: 0; }
.ew-list__row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.ew-list__title { font-size: 13.5px; font-weight: 500; line-height: 1.35; }
.ew-list__title a { color: inherit; text-decoration: none; } .ew-list__title a:hover { color: var(--accent-text); }
.ew-list__meta { font-size: 13px; color: var(--ink3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ew-diff { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.ew-diff__before { color: var(--ink3); text-decoration: line-through; text-decoration-color: #b3b7cc; }
.ew-diff__arrow { color: #b3b7cc; }
.ew-diff__after { font-weight: 600; }
.ew-comment { display: flex; gap: 9px; }
.ew-comment__body { min-width: 0; font-size: 13px; }
.ew-comment__who { font-weight: 600; } .ew-comment__when { color: var(--ink3); font-size: 13px; margin-left: 6px; }
.ew-comment__text { margin: 2px 0 0; color: var(--ink2); line-height: 1.45; }
.ew-comment-form { display: flex; gap: 8px; margin-top: 12px; }
.ew-comment-form input { flex: 1; height: 34px; border: 1px solid var(--line); border-radius: var(--r); padding: 0 11px; font-size: 13px; background: var(--s2); }
/* 0.48.7 (zgłoszenie #103): komentarz wieloliniowy (Enter — nowa linia, Ctrl+Enter — wysyła) */
.ew-comment-form textarea { flex: 1; min-height: 38px; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 11px; font: inherit; font-size: 13px; line-height: 1.4; background: var(--s2); resize: vertical; }
.ew-rule { font-size: 13px; color: var(--ink2); line-height: 1.45; }
.ew-rule__code { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink); background: var(--s2); border-radius: var(--r-sm); padding: 1px 6px; margin-right: 6px; }

/* ---- Stany: pusty, szkielet, tylko odczyt ---- */
.ew-empty { padding: 48px 32px; text-align: center; border: 1px dashed #d7dae8; border-radius: var(--r-lg); background: var(--surface); }
.ew-empty__icon { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 12px; background: var(--accent-50); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.ew-empty__title { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.ew-empty__text { margin: 0 0 18px; color: var(--ink2); font-size: 14px; }
.ew-skeleton { display: block; border-radius: var(--r-sm); background: linear-gradient(90deg, #eef0f6 25%, #e2e4ee 37%, #eef0f6 63%); background-size: 800px 100%; animation: ew-shimmer 1.4s infinite linear; height: 14px; }
@keyframes ew-shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.ew-skeleton-row { display: grid; grid-template-columns: 34px minmax(0,1fr) minmax(0,150px) minmax(0,118px) minmax(0,80px) minmax(0,92px) minmax(0,130px) 34px; min-width: 0; gap: 12px; padding: 12px 14px; border-top: 1px solid #eef0f6; align-items: center; }
[data-state="odczyt"] .ew-field__propose, [data-state="odczyt"] .ew-row-actions, [data-state="odczyt"] .ew-js-propose, [data-state="odczyt"] .ew-comment-form .ew-btn { display: none; }
[data-state="odczyt"] .ew-comment-form input, [data-state="odczyt"] .ew-comment-form textarea { opacity: .6; }
[data-role="lekarz"] .ew-only-kier-nav, [data-role="obserwator"] .ew-only-kier-nav { display: none !important; }
.ew-state-only { display: none; }
[data-state="pusty"] .ew-state-only--pusty, [data-state="ladowanie"] .ew-state-only--ladowanie, [data-state="konflikt"] .ew-state-only--konflikt, [data-state="odczyt"] .ew-state-only--odczyt, [data-state="blad"] .ew-state-only--blad { display: block; }
[data-state="pusty"] .ew-state-hide--pusty, [data-state="ladowanie"] .ew-state-hide--ladowanie { display: none; }
[data-state="pusty"] .ew-tab__count, [data-state="ladowanie"] .ew-tab__count { visibility: hidden; }
[data-state="konflikt"] .ew-row--conflict-target > td { background: #fff9f2; }

/* ---- Dialog ---- */
.ew-dialog { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; width: 560px; max-width: calc(100vw - 48px); box-shadow: 0 24px 80px rgba(10,18,48,.18); color: var(--ink); }
.ew-dialog::backdrop { background: rgba(10,18,48,.35); }
.ew-dialog__head { padding: 18px 22px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ew-dialog__title { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.ew-dialog__sub { margin: 4px 0 0; color: var(--ink2); font-size: 13.5px; }
.ew-dialog__body { padding: 18px 22px; display: flex; flex-direction: column; gap: 16px; }
.ew-dialog__foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--s2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.ew-form-field { display: flex; flex-direction: column; gap: 6px; }
.ew-form-field__label { font-size: 13px; font-weight: 600; }
.ew-form-field__hint { font-size: 13px; color: var(--ink3); }
.ew-form-field__error[hidden] { display: none; }
.ew-form-field__error { font-size: 13px; color: #b93338; display: flex; gap: 6px; align-items: center; }
.ew-input, .ew-select, .ew-textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--r); padding: 0 12px; height: 40px; background: var(--surface); font-size: 14px; outline: none; }
.ew-textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.ew-input:focus, .ew-select:focus, .ew-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-50); }
.ew-input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-50); }
.ew-before-after__box--after:has([aria-invalid="true"]) { border-color: var(--red); }
.ew-input--mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ew-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ew-before-after { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.ew-before-after__box { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; background: var(--s2); }
.ew-before-after__box--after { background: var(--surface); border-color: var(--accent); }
.ew-before-after__label { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); font-weight: 600; margin-bottom: 4px; }
.ew-before-after__value { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.ew-lookup { position: relative; }
.ew-lookup__results { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--sh-2); max-height: 200px; overflow: auto; }
.ew-lookup__item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); font-size: 13.5px; cursor: pointer; }
.ew-lookup__item:hover, .ew-lookup__item[aria-selected="true"] { background: var(--accent-50); }
.ew-lookup__item small { font-family: var(--mono); font-size: 12px; color: var(--ink3); }
.ew-radio-group { display: flex; gap: 6px; flex-wrap: wrap; }
.ew-radio { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 6px 12px; font-size: 13px; cursor: pointer; background: var(--surface); }
.ew-radio:has(input:checked) { border-color: var(--accent); background: var(--accent-50); color: var(--accent-text); font-weight: 500; }
.ew-radio input { margin: 0; accent-color: var(--accent); }

/* ---- Paginacja, przełącznik, statystyki, postęp, klawisze ---- */
.ew-pagination { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.ew-pagination__btn { min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--ink2); cursor: pointer; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; justify-content: center; }
.ew-pagination__btn:hover { background: var(--s2); color: var(--ink); }
.ew-pagination__btn[aria-current="page"] { background: var(--navy); color: #fff; font-weight: 600; }
.ew-pagination__btn:disabled { opacity: .4; cursor: not-allowed; }
.ew-pagination__info { color: var(--ink3); margin-right: 8px; font-variant-numeric: tabular-nums; }
.ew-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.ew-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ew-switch__track { width: 36px; height: 20px; border-radius: var(--r-pill); background: #c9cddc; position: relative; transition: background .15s; flex: none; }
.ew-switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.ew-switch input:checked + .ew-switch__track { background: var(--accent); } .ew-switch input:checked + .ew-switch__track::after { transform: translateX(16px); }
.ew-switch input:focus-visible + .ew-switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.ew-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; min-width: 120px; box-shadow: var(--sh-1); }
.ew-stat__label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); font-weight: 600; }
.ew-stat__value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; line-height: 1.15; }
.ew-stat__value--ok { color: #157a52; } .ew-stat__value--warn { color: #a85a12; } .ew-stat__value--bad { color: #b93338; }
.ew-stat__sub { font-size: 13px; color: var(--ink3); margin-top: 2px; }
.ew-stat--link { text-decoration: none; color: inherit; display: block; } .ew-stat--link:hover { border-color: var(--accent); }
.ew-progress { height: 6px; border-radius: var(--r-pill); background: var(--s2); overflow: hidden; }
.ew-progress__bar { height: 100%; background: var(--accent); border-radius: var(--r-pill); }
.ew-progress__bar--ok { background: var(--green); } .ew-progress__bar--bad { background: var(--red); }
.ew-kbd { display: inline-block; font-family: var(--mono); font-size: 12px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--surface); color: var(--ink2); line-height: 1.4; }
.ew-toast--error svg { stroke: #ff8b8f; }
/* 0.37.1 (test zadaniowy 25.10): błąd ma wykrzyknik, nie „ptaszek” sukcesu */
.ew-toast__blad { display: none; flex: none; }
.ew-toast--error .ew-toast__ok { display: none; }
.ew-toast--error .ew-toast__blad { display: block; }
.ew-toast__action { background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: var(--r-pill); padding: 3px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; margin-left: 6px; }
.ew-dialog--sm { width: 460px; }
.ew-confirm-count { font-family: var(--mono); font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ew-checkbox { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; cursor: pointer; }
.ew-section-title { margin: 0 0 12px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.ew-section-title .ew-label { font-weight: 600; }
.ew-page-title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.ew-page-kicker { margin-bottom: 6px; color: var(--accent-text); }
.ew-skeleton--text { height: 12px; } .ew-skeleton--title { height: 20px; width: 40%; } .ew-skeleton--chip { height: 22px; width: 80px; border-radius: var(--r-pill); }
.ew-content { position: relative; }
.ew-table-wrap .ew-table th { top: 0; }
.ew-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--navy); color: #fff; padding: 12px 16px; border-radius: var(--r); font-size: 13.5px; display: flex; align-items: center; gap: 10px; box-shadow: var(--sh-2); transition: .2s; pointer-events: none; z-index: 60; }
.ew-toast[data-open="true"] { opacity: 1; transform: translateX(-50%); }

/* ---- Wspólne dla ekranów zestawu B ---- */
[hidden] { display: none !important; }
.ew-sec { margin: 0 0 18px; } .ew-sec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 8px; flex-wrap: wrap; }
.ew-sec__title { margin: 0; font-size: 16px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; } .ew-sec__count { font-family: var(--mono); font-size: 12px; color: var(--ink3); font-weight: 500; }
.ew-sec__note { font-size: 13px; color: var(--ink3); margin: 0; max-width: 760px; }
.ew-table-wrap .ew-table th { top: 0; }
.ew-codeinl { font-family: var(--mono); font-size: 12px; color: var(--ink2); background: var(--s2); border-radius: var(--r-sm); padding: 1px 6px; }
.ew-fsel { height: 34px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 0 10px; font-size: 13.5px; color: var(--ink); }
.ew-muted { color: var(--ink3); } .ew-mono { font-family: var(--mono); }
.ew-dialog__body { max-height: calc(100vh - 220px); overflow: auto; }
.ew-sidebar__acct { display: block; font-size: 11px; font-family: var(--mono); color: rgba(255,255,255,.55); margin-top: 1px; }
a.ew-sidebar__user:hover { background: rgba(255,255,255,.05); }
a.ew-sidebar__user:hover .ew-sidebar__acct { color: #fff; }
@media (max-width: 1180px) { .ew-sidebar__acct { display: none; } }
a.ew-btn, a.ew-pagination__btn { text-decoration: none; }
.ew-chip--status-poprawa { background: var(--amber-50); color: #a85a12; }
.ew-toast[data-open="true"] .ew-toast__action { pointer-events: auto; }
