/* Ramka telefonu, powłoka 3 zakładek i komponenty. Wartości z ekranów design/screens/NN-*.dc.html. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: #E9EDF2; color: #111214; font-family: 'Inter Tight', system-ui, sans-serif; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 10; padding: 10px 14px; background: var(--card); color: var(--text); border-radius: 12px; }
.skip:focus { top: 8px; }

/* Scena: telefon 390x844 na środku ekranu komputera, na telefonie pełny ekran. */
.stage { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px 16px; }
.phone { position: relative; width: var(--phone-w); height: var(--phone-h); flex-shrink: 0; overflow: hidden; border-radius: 40px;
  background: var(--bg); color: var(--text); font-family: var(--font); box-shadow: 0 0 0 10px #111214, 0 24px 60px rgba(17, 18, 20, .35); }
.disclaimer { max-width: 390px; margin: 0; text-align: center; font-size: .8125rem; line-height: 1.4; color: #3A3B40; }
@media (max-width: 430px) {
  body { background: var(--bg); }
  .stage { display: block; padding: 0; }
  .phone { width: 100%; height: 100vh; height: 100dvh; border-radius: 0; box-shadow: none; }
  .disclaimer { padding: 16px; margin: 0 auto; }
}

/* Powłoka zakładki */
.screen { height: 100%; display: flex; flex-direction: column; background: var(--bg); color: var(--text); }
.tab-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 16px 10px; flex-shrink: 0; }
.tab-head__titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tab-head h1 { margin: 0; font-size: 1.625rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.mono { font-family: var(--font-mono); }
.sub { font-family: var(--font-mono); font-size: .6875rem; color: var(--text-2); }
.avatar { width: 44px; height: 44px; min-width: 44px; border-radius: 22px; background: var(--avatar-bg); color: var(--avatar-text); display: flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: .9375rem; text-decoration: none; flex-shrink: 0; }
.avatar:hover { color: var(--avatar-text); }
.tab-body { display: flex; flex-direction: column; gap: 10px; padding: 4px 14px 10px; flex-grow: 1; min-height: 0; overflow-y: auto; }
.tab-body--tight { gap: 8px; }
.tab-body--flush { padding-top: 0; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }

/* Karty */
.card { display: flex; flex-direction: column; gap: 10px; padding: 10px 14px; border-radius: var(--radius-card); background: var(--card); border: 1px solid var(--line); flex-shrink: 0; }
.card--warn { border-color: var(--warn); }
.card--p12 { padding: 12px 14px; gap: 9px; }
.card--p14 { padding: 14px; }
.card--list { padding: 0; gap: 0; overflow: hidden; }
.card--accent { border-left: 6px solid var(--primary); }
.card--dashed { flex-direction: row; align-items: center; gap: 12px; border: 1px dashed var(--line-dash); }
.card__row { display: flex; gap: 10px; align-items: flex-start; }
.card__text { font-size: .9375rem; line-height: 1.4; }
.dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 5px; flex-shrink: 0; }
.dot--uwaga { background: var(--warn); }
.dot--blad { background: var(--error); }
.dot--ok { background: var(--ok); }
.dot--center { margin-top: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions--indent { padding-left: 46px; }

/* Przyciski: każdy cel >= 44 px */
.btn { min-height: var(--target); padding: 0 14px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; justify-content: center;
  font-size: .875rem; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; font-family: inherit; line-height: 1.2; }
.btn--primary { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.btn--primary:hover { color: var(--on-primary); background: var(--primary-hover); }
.btn--outline { background: var(--card); border-color: var(--line-btn); color: var(--text); }
.btn--outline:hover { color: var(--text); border-color: var(--text-2); }
.btn--block { width: 100%; border-radius: 14px; }
.btn--warn { background: var(--card); border-color: var(--warn); color: var(--warn-text); font-size: .8125rem; font-weight: 700; padding: 0 12px; border-radius: 18px; flex-shrink: 0; }
.btn--warn:hover { color: var(--warn-text); }
.btn--small { font-size: .8125rem; font-weight: 700; padding: 0 12px; flex-shrink: 0; }
.chips { display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; padding-top: 2px; }
.chip { flex-shrink: 0; white-space: nowrap; min-height: 44px; padding: 0 12px; border-radius: 22px; background: var(--primary-soft); color: var(--on-primary-soft);
  text-decoration: none; display: flex; align-items: center; font-size: .875rem; font-weight: 600; }
.chip:hover { color: var(--on-primary-soft); }
.textlink { min-height: 44px; min-width: 44px; display: flex; align-items: center; justify-content: center; font-size: .8125rem; font-weight: 600; text-decoration: none; flex-shrink: 0; padding: 0 6px; }

/* Etykiety */
.badge { padding: 3px 8px; border-radius: 999px; font-size: .6875rem; font-weight: 700; flex-shrink: 0; white-space: nowrap; }
.badge--ok { background: var(--ok-bg); color: var(--ok-text); }
.badge--uwaga { background: var(--warn-bg); color: var(--warn-text); }
.badge--neutralny { background: var(--neutral-bg); color: var(--neutral-text); }

/* Kompozytor (pole rozmowy) */
.composer { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--bg); flex-shrink: 0; }
.composer__input { flex-grow: 1; min-height: 46px; padding: 0 16px; border-radius: 23px; background: var(--card); border: 1px solid var(--line); display: flex;
  align-items: center; text-decoration: none; color: var(--text-2); font-size: .9375rem; }
.composer__input:hover { color: var(--text); }
.composer__mic { width: 46px; height: 46px; border-radius: 23px; background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Dolny pasek 3 zakładek (skopiowany z 02-asystent) */
.tabbar { min-height: 70px; flex-shrink: 0; padding: 8px 24px 14px; background: var(--card); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; }
.tabbar a { min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none;
  color: var(--text-2); font-size: .75rem; font-weight: 600; }
.tabbar a[aria-current="page"] { color: var(--primary); font-weight: 700; }

/* Portfel */
.notice-ok { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--ok-bg); color: var(--ok-text); flex-shrink: 0; }
.notice-ok span { font-size: .8125rem; line-height: 1.35; font-weight: 600; }
.answer { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-card); background: var(--primary); color: var(--on-primary); text-decoration: none; flex-shrink: 0; }
.answer:hover { color: var(--on-primary); background: var(--primary-hover); }
.answer__icon { width: 40px; height: 40px; border-radius: 20px; background: var(--card); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.answer__title { font-size: 1rem; font-weight: 700; }
.answer__desc { font-size: .8125rem; line-height: 1.35; }
.stack { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.stack--1 { gap: 1px; }
.doc-kind { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.doc-name { font-size: 1.125rem; font-weight: 800; }
.doc-nums { font-family: var(--font-mono); font-size: .75rem; color: var(--text-2); }
.between { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cert { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--warn-bg); }
.cert span { font-size: .8125rem; line-height: 1.35; color: var(--warn-text); flex-grow: 1; }
.row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border: 0; border-bottom: 1px solid var(--line-soft); background: var(--card);
  font-family: inherit; color: var(--text); text-align: left; text-decoration: none; cursor: pointer; width: 100%; }
.row:last-child { border-bottom: 0; }
.row:hover { color: var(--text); background: var(--primary-tint); }
.row__title { font-size: .9375rem; font-weight: 700; }
.row__desc { font-family: var(--font-mono); font-size: .6875rem; color: var(--text-2); }
.eu { font-family: var(--font-mono); font-size: .75rem; font-weight: 600; width: 36px; height: 36px; border-radius: 18px; background: var(--primary-soft); color: var(--on-primary-soft);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.eu-title { font-size: .875rem; font-weight: 700; }
.eu-desc { font-size: .75rem; line-height: 1.35; color: var(--text-2); }

/* Zaufanie */
.time { font-family: var(--font-mono); font-size: .75rem; font-weight: 600; color: var(--text-2); padding-top: 2px; flex-shrink: 0; }
.read-title { font-size: .9375rem; font-weight: 700; }
.read-desc { font-size: .8125rem; line-height: 1.35; color: var(--text-2); }
.log-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.log-row__title { font-size: .875rem; font-weight: 600; }
.log-row__desc { font-size: .78125rem; color: var(--text-2); }
.log-row--last { border-bottom-color: var(--line); }
.log-row--ai { align-items: center; padding: 6px 8px 6px 14px; background: var(--primary-tint); border-bottom: 0; }
.log-row--ai .time { padding-top: 0; }
.with-icon { display: flex; align-items: center; gap: 6px; }
.keys-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 14px 0; }
.keys-title { display: flex; align-items: center; gap: 8px; font-size: .9375rem; font-weight: 700; }
.key-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); }
.keys-head + .key-row { padding-top: 6px; }
.key-row:last-child { border-bottom: 0; padding-bottom: 10px; }
.link-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-card); background: var(--card); border: 1px solid var(--line);
  text-decoration: none; color: var(--text); flex-shrink: 0; }
.link-card:hover { color: var(--text); background: var(--primary-tint); }

/* Ekran zastępczy (ekrany z mapy, które powstaną w kolejnych zadaniach) */
.back { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--text); border-radius: 22px; flex-shrink: 0; }
.placeholder { display: flex; flex-direction: column; gap: 14px; padding: 8px 16px 16px; flex-grow: 1; min-height: 0; overflow-y: auto; }
.placeholder p { margin: 0; font-size: 1rem; line-height: 1.45; }

/* Tryb seniora */
[data-theme="senior"] .screen { font-size: 1.375rem; }
.senior-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; }
.senior-btn { min-height: var(--target-senior); padding: 0 20px; border-radius: 34px; display: flex; align-items: center; justify-content: center; text-decoration: none;
  font-size: 1.375rem; font-weight: 700; border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.senior-btn:hover { color: var(--primary-hover); }
.senior-btn--fill { background: var(--primary); color: var(--on-primary); }
.senior-btn--fill:hover { color: var(--on-primary); background: var(--primary-hover); }
.senior-body { display: flex; flex-direction: column; gap: 18px; padding: 8px 20px 20px; flex-grow: 1; min-height: 0; overflow-y: auto; }
.senior-body h1 { margin: 0; font-size: 2.125rem; line-height: 1.2; }
.senior-body p { margin: 0; font-size: 1.5rem; line-height: 1.4; color: var(--text-2); }

/* Pomocnicze klasy (CSP blokuje atrybuty style) */
.m0 { margin: 0; }
.ic-primary { color: var(--primary); }
.ic-fixed { flex-shrink: 0; }
.tab-head--start { justify-content: flex-start; }
.h1-small.h1-small { font-size: 1.25rem; }
.placeholder .btn { align-self: flex-start; }
#ekran { height: 100%; }

/* Duży tekst (do 200%): wiersze z godziną i etykietą łamią się, zamiast ściskać treść */
.card__row, .log-row, .key-row, .between { flex-wrap: wrap; }
.card__row > .card__text, .card__row > .stack, .log-row > .stack, .key-row > .stack, .between > .stack { flex: 1 1 10rem; }
.avatar { width: max(44px, 2.75rem); height: max(44px, 2.75rem); border-radius: 999px; }

/* Zgodność z projektem: w plikach .dc.html linki z ramką mają box-sizing: content-box,
   więc są o 2 px (ramka) wyższe niż 44 px. Odtwarzamy te wysokości, żeby układ się zgadzał. */
a.btn--outline, a.btn--warn { min-height: calc(var(--target) + 2px); }
.composer__input { min-height: 48px; }
a.row { min-height: 69px; }
[data-sprawa] .btn--outline { min-height: calc(var(--target) + 2px); }
.btn--primary { border: 0; }

/* Mniej ruchu (WCAG 2.3.3): bez przejść i animacji, gdy system o to prosi. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Barwy państwowe: biało-czerwony pasek u góry ekranu i strony (bez godła i logo). */
.phone::before { content: ""; position: absolute; z-index: 5; inset: 0 0 auto 0; height: 6px; pointer-events: none;
  background: linear-gradient(to bottom, var(--flag-white) 0 50%, var(--flag-red) 50% 100%); box-shadow: 0 1px 0 var(--line); }
body::before { content: ""; position: fixed; z-index: 0; inset: 0 0 auto 0; height: 10px; pointer-events: none;
  background: linear-gradient(to bottom, #FFFFFF 0 50%, #D4213D 50% 100%); box-shadow: 0 1px 0 #CDD3DB; }
@media (max-width: 430px) { body::before { display: none; } }
