/* =====================================================================
   Napisy AI – arkusz stylów 2.0 (kierunek: Apple Human Interface Guidelines)
   Bez zewnętrznych fontów i CDN (CSP + RODO). Jasny i ciemny wygląd według
   ustawień systemu albo wyboru użytkownika (przycisk w nagłówku → <html data-theme>,
   ciasteczko „theme”; brak atrybutu = systemowy).

   Zasada koloru – jeden kolor, jedno znaczenie:
   · niebieski  = interakcja (linki, przyciski, zaznaczenie, fokus)
   · żółty      = napisy (podświetlone słowo – znak rozpoznawczy produktu)
   · zielony / pomarańczowy / czerwony = status (zawsze razem z tekstem)
   ===================================================================== */

/* ---------- 1. Tokeny ---------- */
:root {
  color-scheme: light dark;

  /* tła (system / grouped) */
  --bg: #ffffff;
  --bg-grouped: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .2);
  --row-hover: rgba(118, 118, 128, .06);

  /* tekst – kontrast na #fff: 16.8 / 5.1 / 3.6 (trzeci poziom tylko dla treści pomocniczych, np. placeholder) */
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --separator: rgba(60, 60, 67, .14);
  --separator-opaque: #d2d2d7;
  --field-bg: #ffffff;
  --field-border: #86868b;   /* 3.6:1 na białym – granica pola widoczna (WCAG 1.4.11) */

  /* interakcja */
  --link: #0066cc;           /* 5.6:1 na #fff */
  --accent: #0071e3;         /* biały tekst na nim: 4.7:1 */
  --accent-hover: #0062c4;
  --on-accent: #ffffff;
  --focus-ring: rgba(0, 113, 227, .45);
  --selected: rgba(0, 113, 227, .12);

  /* napisy – znak rozpoznawczy */
  --caption: #ffd60a;
  --caption-ink: #1d1d1f;    /* 11.9:1 */

  /* status (tekst na 12% tincie ≥ 4.5:1) */
  --success: #187030;
  --warning: #96490a;
  --danger: #c9001b;
  --info: #0062c4;
  --on-success: #ffffff;

  --header-bg: rgba(255, 255, 255, .72);
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, .12);

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.25, .1, .25, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c10;
    --bg-grouped: #0b0c10;
    --surface: #15171c;
    --surface-2: #1e2129;
    --fill: rgba(118, 118, 128, .24);
    --fill-2: rgba(118, 118, 128, .34);
    --row-hover: rgba(118, 118, 128, .1);

    --text: #f5f5f7;
    --text-2: #a1a1a6;       /* 6.6:1 na #1c1c1e */
    --text-3: #8d8d93;
    --separator: rgba(255, 255, 255, .1);
    --separator-opaque: #2e3139;
    --field-bg: #111318;
    --field-border: #8e8e93;

    --link: #2997ff;         /* 5.6:1 na #1c1c1e */
    --accent: #0071e3;
    --accent-hover: #0062c4;
    --focus-ring: rgba(41, 151, 255, .6);
    --selected: rgba(41, 151, 255, .2);

    --success: #30d158;
    --warning: #ff9f0a;
    --danger: #ff6961;
    --info: #409cff;
    --on-success: #000000;

    --header-bg: rgba(11, 12, 16, .82);
    --shadow-pop: 0 12px 40px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
    --bg: #0b0c10;
    --bg-grouped: #0b0c10;
    --surface: #15171c;
    --surface-2: #1e2129;
    --fill: rgba(118, 118, 128, .24);
    --fill-2: rgba(118, 118, 128, .34);
    --row-hover: rgba(118, 118, 128, .1);

    --text: #f5f5f7;
    --text-2: #a1a1a6;       /* 6.6:1 na #1c1c1e */
    --text-3: #8d8d93;
    --separator: rgba(255, 255, 255, .1);
    --separator-opaque: #2e3139;
    --field-bg: #111318;
    --field-border: #8e8e93;

    --link: #2997ff;         /* 5.6:1 na #1c1c1e */
    --accent: #0071e3;
    --accent-hover: #0062c4;
    --focus-ring: rgba(41, 151, 255, .6);
    --selected: rgba(41, 151, 255, .2);

    --success: #30d158;
    --warning: #ff9f0a;
    --danger: #ff6961;
    --info: #409cff;
    --on-success: #000000;

    --header-bg: rgba(11, 12, 16, .82);
    --shadow-pop: 0 12px 40px rgba(0, 0, 0, .6);
  }

/* Wybór użytkownika ma pierwszeństwo przed ustawieniem systemu (kontrolki formularzy, paski przewijania) */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* Zwiększony kontrast (HIG: Color – wariant „increased contrast” dla każdego koloru) */
@media (prefers-contrast: more) {
  :root {
    --text-2: #424245; --text-3: #5e5e63; --separator: rgba(0, 0, 0, .35); --separator-opaque: #86868b;
    --field-border: #1d1d1f; --link: #0040a0; --success: #0b5a22; --warning: #7a3a00; --danger: #a00016;
  }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text-2: #d1d1d6; --text-3: #aeaeb2; --separator: rgba(255, 255, 255, .45); --separator-opaque: #8e8e93;
    --field-border: #f5f5f7; --link: #6cb6ff; --success: #5be37d; --warning: #ffb340; --danger: #ff8a84;
  }
}
@media (prefers-contrast: more) {
  :root[data-theme="dark"] {
    --text-2: #d1d1d6; --text-3: #aeaeb2; --separator: rgba(255, 255, 255, .45); --separator-opaque: #8e8e93;
    --field-border: #f5f5f7; --link: #6cb6ff; --success: #5be37d; --warning: #ffb340; --danger: #ff8a84;
  }
}

/* ---------- 2. Podstawa ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg-grouped); color: var(--text);
  font: 400 1rem/1.5 var(--font); letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
main { flex: 1; }
img, video, iframe { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .18em; }
/* linki w zdaniach są podkreślone – kolor nie może być jedynym wyróżnikiem (WCAG 1.4.1) */
:where(p, li, dd, .alert, .prose, .hint) a:where(:not(.btn):not(.l-btn):not(.l-link)) {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 1.25rem + 1.6vw, 2.25rem); font-weight: 700; line-height: 1.12; letter-spacing: -.028em; }
h2, .h2 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); font-weight: 700; line-height: 1.2; letter-spacing: -.022em; }
h3, .h3 { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; letter-spacing: -.016em; }
.h4 { font-size: 1rem; font-weight: 600; margin: 20px 0 6px; }
p { margin: 0 0 1em; }
strong, b { font-weight: 600; }
code { font-family: var(--mono); font-size: .875em; background: var(--fill); padding: .1em .4em; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--separator); margin: 24px 0; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 6px; }

/* ---------- 3. Narzędzia ---------- */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 28px); }
.narrow { max-width: 760px; }
.wide { max-width: 1360px; }
.center { text-align: center; }
.muted { color: var(--text-2); }
.small { font-size: .875rem; }
.page-pad { padding-top: clamp(28px, 4vw, 44px); padding-bottom: 72px; }
.eyebrow { font-size: .8125rem; font-weight: 600; color: var(--text-2); letter-spacing: -.005em; margin-bottom: .35em; }
.lead { font-size: 1.1875rem; line-height: 1.45; color: var(--text-2); }
.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 999px; font-weight: 600; }
.skip-link:focus { left: 8px; }
.inline { display: inline; margin: 0; }
.show-sm { display: none; }
.upper { text-transform: uppercase; }
.nowrap { white-space: nowrap; }
.text-ok { color: var(--success); }
.text-warn { color: var(--warning); }
.dots::after { content: "…"; }
.mono-wrap { font-family: var(--mono); font-size: .8125rem; overflow-wrap: anywhere; }

/* ---------- 4. Nagłówek (warstwa funkcjonalna – materiał) i stopka ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--separator);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; }
.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; color: var(--text); font-weight: 600; font-size: 1.0625rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 24px; height: 24px; }
.nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 22px; }
.nav a:not(.btn) { color: var(--text); opacity: .8; font-size: .875rem; transition: opacity .15s var(--ease); }
.nav a:not(.btn):hover { opacity: 1; text-decoration: none; }
.header-user { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-footer { padding: 44px 0 28px; border-top: 1px solid var(--separator); color: var(--text-2); font-size: .875rem; background: var(--bg); }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px 48px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.footer-brand { max-width: 340px; display: grid; gap: 10px; }
.footer-brand .brand { color: var(--text); }
.footer-brand p { line-height: 1.5; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 28px 56px; }
.footer-cols > div { display: grid; gap: 8px; align-content: start; }
.footer-head { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text); }
.footer-inner a, .footer-bottom a { color: var(--text-2); }
.footer-inner a:hover, .footer-bottom a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--separator); font-size: .8125rem; }
.footer-bottom p { margin: 0; }
.lang-switch { display: inline-flex; gap: 12px; }
.lang-switch a[aria-current="true"] { color: var(--text); font-weight: 600; }

/* ---------- 5. Przyciski (HIG: Buttons – rozpoznawalny kształt, rola, stany) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 8px 18px; border: 0; border-radius: 980px;
  font: inherit; font-size: .9375rem; font-weight: 600; line-height: 1.2; letter-spacing: -.01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s var(--ease), color .15s var(--ease), opacity .15s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { opacity: .82; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--fill); color: var(--link); }
.btn-ghost:hover { background: var(--fill-2); }
.btn-danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.btn-oauth { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--separator-opaque); }
.btn-oauth:hover { background: var(--surface-2); }
.oauth .btn { min-height: 44px; }
.btn-sm { min-height: 30px; padding: 5px 14px; font-size: .8125rem; }
.btn-lg { min-height: 48px; padding: 12px 26px; font-size: 1.0625rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .4; cursor: not-allowed; }
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
}

/* ---------- 6. Karty, siatki, nagłówki stron ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: clamp(18px, 2.4vw, 24px); margin-bottom: 16px; min-width: 0; overflow-wrap: anywhere; }
.card p:last-child { margin-bottom: 0; }
.card code, .stat code { white-space: normal; overflow-wrap: anywhere; }
.card h2, .card h3 { margin-bottom: .4em; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-2 > *, .grid-3 > *, .admin-layout > *, .stats > *, .form-grid > * { min-width: 0; }
.grid-3 .card, .grid-2 .card { margin-bottom: 0; }
.card-head, .page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head { margin-bottom: 24px; }
.page-head h1, .card-head h2, .card-head h3 { margin: 0; }
.card-danger { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 45%, transparent); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--fill); color: var(--text); font-size: .75rem; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.badge-warn { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }
.prose { line-height: 1.6; }
.prose h2 { margin-top: 1.6em; }
@media (prefers-contrast: more) {
  .card, .stat, .table-wrap, .auth-card, .msg { box-shadow: inset 0 0 0 1px var(--separator-opaque); }
}

/* ---------- 7. Formularze (HIG: Text fields, Entering data) ---------- */
label { display: block; margin: 16px 0 6px; font-size: .875rem; font-weight: 600; color: var(--text); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=number], input[type=url], input[type=tel], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px;
  border: 1px solid var(--field-border); border-radius: 12px;
  background: var(--field-bg); color: var(--text); font: inherit; font-size: 1rem;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
select { padding-right: 10px; accent-color: var(--accent); }
textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
::placeholder { color: var(--text-3); opacity: 1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus-ring); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; }
input[type=file] { width: 100%; padding: 12px; border: 1px dashed var(--field-border); border-radius: 12px; background: var(--surface-2); color: var(--text-2); font: inherit; }
form .btn-primary, form .btn-block { margin-top: 20px; }
fieldset { min-width: 0; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.label-row a { font-size: .875rem; }
.pw-field { position: relative; }
.pw-field input { padding-right: 84px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 32px; padding: 5px 12px; border: 0; border-radius: 8px; background: var(--fill); color: var(--link); font: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer; }
.hint { margin: 6px 0 0; font-size: .8125rem; color: var(--text-2); }
.field-error { margin: 6px 0 0; font-size: .875rem; color: var(--danger); }
.check { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; font-weight: 400; font-size: .9375rem; }
.check input { flex: none; margin-top: 2px; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; margin: 0 14px 6px 0; font-weight: 400; font-size: .875rem; }
.row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.row select { width: auto; flex: 1; }
.search { display: flex; gap: 8px; }
.search input { min-width: 220px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: 1 / -1; }
.form-grid .btn { margin-top: 8px; }
.row-inline { display: flex; align-items: center; gap: 8px; margin: 0; }
.row-inline.wrap { flex-wrap: wrap; }
.row-inline .btn, .actions .btn, .offer-actions .btn { margin: 0; }
.row-inline > form, .actions > form, .offer-actions { margin: 0; }
.row-inline input[type=email] { flex: 1; min-width: 220px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions form { margin: 0; }
.input-xs { width: 76px !important; min-height: 36px !important; padding: 6px 8px !important; }
.input-sm { max-width: 140px; min-height: 36px; padding: 6px 10px; }
.label-text { font-size: .875rem; font-weight: 600; }
.code-input { max-width: 240px; font-family: var(--mono); font-size: 1.25rem !important; letter-spacing: .2em; }
textarea.tall { min-height: 260px; font-family: var(--mono); font-size: .875rem; }
.promo-row input { max-width: 260px; }
.inline-form { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--separator); }
.inline-form summary { cursor: pointer; color: var(--link); font-weight: 600; font-size: .9375rem; }

/* ---------- 8. Komunikaty ---------- */
.flash-stack { padding-top: 16px; }
.alert { margin-bottom: 14px; padding: 12px 16px; border-radius: 12px; font-size: .9375rem; color: var(--text); background: var(--fill); box-shadow: inset 3px 0 0 var(--text-3); }
.alert a { margin-left: 6px; font-weight: 600; }
.alert-success { background: color-mix(in srgb, var(--success) 11%, var(--surface)); box-shadow: inset 3px 0 0 var(--success); }
.alert-error { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); box-shadow: inset 3px 0 0 var(--danger); }
.alert-info { background: color-mix(in srgb, var(--info) 10%, var(--surface)); box-shadow: inset 3px 0 0 var(--info); }
.announce { font-size: .875rem; border-bottom: 1px solid var(--separator); }
.announce-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.announce p { margin: 0; }
.announce a { margin-left: 8px; font-weight: 600; }
.announce-info { background: color-mix(in srgb, var(--info) 10%, var(--bg)); }
.announce-warning { background: color-mix(in srgb, var(--warning) 13%, var(--bg)); }
.announce-critical { background: color-mix(in srgb, var(--danger) 13%, var(--bg)); }
.announce-close { flex: none; min-width: 32px; min-height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.announce-close:hover { background: var(--fill); color: var(--text); }
.impersonation-bar { background: color-mix(in srgb, var(--warning) 16%, var(--bg)); border-bottom: 1px solid color-mix(in srgb, var(--warning) 50%, transparent); font-size: .875rem; }
.impersonation-bar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 8px; padding-bottom: 8px; }
.impersonation-bar form { margin: 0; }
.offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 16px 0; padding: 16px 18px; border-radius: var(--radius-md); background: var(--selected); }
.offer p { margin: 0; }
.offer-card { background: linear-gradient(180deg, var(--selected), transparent 60%), var(--surface); }
.offer-card h1 { margin: 4px 0 10px; font-size: clamp(1.6rem, 4vw, 2.25rem); }
.offer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 18px 0 12px !important; }

/* ---------- 9. Statusy (zawsze z tekstem – kolor nie jest jedynym nośnikiem) ---------- */
.pill, .status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; line-height: 1.5; white-space: nowrap; vertical-align: middle; }
.pill-ok, .status-open { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.pill-warn { background: color-mix(in srgb, var(--warning) 12%, transparent); color: var(--warning); }
.pill-bad { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.pill-muted, .status-closed { background: var(--fill); color: var(--text-2); }
.pill-accent, .pill-beta { background: color-mix(in srgb, var(--info) 12%, transparent); color: var(--info); }
.pill-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.tag { display: inline-block; margin: 0 4px 4px 0; padding: 2px 9px; border-radius: 999px; background: var(--fill); font-size: .75rem; white-space: nowrap; }

/* ---------- 10. Logowanie i rejestracja ---------- */
.auth-wrap { display: grid; place-items: center; padding: clamp(32px, 6vw, 72px) 16px 80px; }
.auth-card { width: 100%; max-width: 440px; padding: clamp(28px, 5vw, 44px) clamp(22px, 4vw, 40px); border-radius: var(--radius-lg); background: var(--surface); }
.auth-split { grid-template-columns: minmax(0, 380px) minmax(0, 440px); justify-content: center; align-items: start; gap: 24px; }
.auth-aside { padding: clamp(28px, 4vw, 40px); border-radius: var(--radius-lg); background: #0b0c10; color: #f4f5f7; }
.auth-aside-eyebrow { margin: 0 0 10px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #a7abb6; }
.auth-aside-title { margin: 0 0 22px; font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; line-height: 1.1; letter-spacing: -.03em; }
.auth-aside-title span { background: var(--caption); color: #111; padding: 0 .14em; border-radius: .12em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.auth-aside ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.auth-aside li { position: relative; padding-left: 28px; color: #d6d8de; line-height: 1.45; }
.auth-aside li::before { content: ""; position: absolute; left: 0; top: .15em; width: 18px; height: 18px; border-radius: 50%; background: var(--caption) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.6 2.6L14.2 7.4' fill='none' stroke='%23111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; }
@media (max-width: 860px) { .auth-split { grid-template-columns: minmax(0, 440px); } .auth-aside { order: 2; } }
.auth-card h1 { margin-bottom: .6em; font-size: clamp(1.75rem, 4vw, 2rem); text-align: center; }
.oauth { display: grid; gap: 10px; margin: 16px 0; }
.oauth-mark { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--text); color: var(--bg); font-size: .75rem; font-weight: 700; }
.oauth-terms { margin: 4px 0 0; text-align: center; }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 4px; color: var(--text-2); font-size: .8125rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--separator); }

/* ---------- 11. Panel: menu boczne (HIG: Sidebars – maks. dwa poziomy, zwijane grupy) ---------- */
.side-nav {
  --g: var(--accent);
  display: flex; gap: 6px; margin: 0 0 24px; padding-bottom: 2px;
  overflow-x: auto; scrollbar-width: none;
}
.side-nav::-webkit-scrollbar { display: none; }
.side-group { display: contents; }
details.side-group { display: block; flex: none; }
.side-links { display: flex; gap: 6px; }
.side-heading { display: none; }
.side-nav a {
  display: block; padding: 8px 14px; border-radius: 999px; white-space: nowrap;
  background: var(--fill); color: var(--text); font-size: .875rem; font-weight: 500;
  transition: background-color .15s var(--ease);
}
.side-nav a:hover { background: var(--fill-2); text-decoration: none; }
.side-nav a.active { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.side-nav .admin-search { display: none; }
.side-nav .side-back { font-size: .8125rem; background: transparent; color: var(--link); }
.side-nav-tools { display: none; }
/* kolor grupy pokazuje tylko kropka – znaczenie: produkt (HIG: Sidebars › icon colors) */
.g-yellow { --g: #f5b800; } .g-blue { --g: #0071e3; } .g-violet { --g: #8e5cf0; } .g-green { --g: #28a745; }
.g-orange { --g: #ff8a00; } .g-pink { --g: #ff375f; } .g-teal { --g: #14a5a5; }

@media (min-width: 960px) {
  .page-pad:has(> .side-nav) { max-width: 1280px; display: grid; grid-template-columns: 232px minmax(0, 1fr); column-gap: 44px; align-content: start; }
  .page-pad:has(> .side-nav) > * { grid-column: 2; min-width: 0; }
  .page-pad > .side-nav {
    grid-column: 1; grid-row: 1 / span 60; align-self: start; position: sticky; top: 72px;
    max-height: calc(100vh - 92px); overflow-y: auto; overflow-x: visible;
    flex-direction: column; gap: 14px; margin: 0; padding: 0 6px 0 0;
  }
  .side-group { display: block; }
  .side-group-top { display: flex; flex-direction: column; gap: 2px; }
  .side-links { flex-direction: column; gap: 2px; padding-top: 2px; }
  .side-heading {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px;
    font-size: .8125rem; font-weight: 600; color: var(--text-2); cursor: pointer; list-style: none; user-select: none;
  }
  .side-heading::-webkit-details-marker { display: none; }
  .side-heading:hover { color: var(--text); }
  .side-heading:focus-visible { outline-offset: -2px; }
  .side-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--g); }
  .side-title { flex: 1; }
  .side-count { font-size: .75rem; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
  .side-chevron { flex: none; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s var(--ease); }
  .side-group:not([open]) .side-chevron { transform: rotate(-45deg); }
  .side-nav a { padding: 7px 10px; border-radius: 8px; background: transparent; font-size: .9375rem; font-weight: 400; }
  .side-nav a:hover { background: var(--fill); }
  .side-nav a.active { background: var(--selected); color: var(--text); font-weight: 600; }
  .side-nav .admin-search { display: block; margin: 0 0 4px; }
  .side-nav .admin-search input { width: 100%; max-width: none; min-height: 36px; padding: 7px 12px; border-radius: 10px; font-size: .875rem; background: var(--fill); border-color: transparent; }
  .side-nav .side-back { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--separator); border-radius: 0; }
  .side-nav-tools { display: flex; justify-content: flex-end; gap: 12px; padding: 0 4px; font-size: .75rem; }
  .side-nav-tools button { padding: 2px 0; border: 0; background: none; color: var(--text-2); font: inherit; cursor: pointer; }
  .side-nav-tools button:hover { color: var(--link); }
}
body:has(.side-nav) .site-header .container, body:has(.side-nav) .site-footer .container, body:has(.side-nav) .announce .container { max-width: 1280px; }

/* ---------- 12. Panel: listy, tabele, wskaźniki (HIG: Lists and tables) ---------- */
.subnav { display: flex; gap: 4px; margin-bottom: 24px; padding: 4px; width: max-content; max-width: 100%; border-radius: 999px; background: var(--fill); overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { padding: 7px 16px; border-radius: 999px; color: var(--text); font-size: .875rem; font-weight: 500; white-space: nowrap; }
.subnav a:hover { text-decoration: none; background: var(--fill); }
.subnav a.active { background: var(--surface); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.meter { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 6px; margin: 12px 0 6px; border: 0; border-radius: 999px; overflow: hidden; background: var(--fill); color: var(--accent); }
.meter::-webkit-progress-bar { background: var(--fill); border-radius: 999px; }
.meter::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.meter::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.meter.is-high::-webkit-progress-value { background: var(--warning); } .meter.is-high::-moz-progress-bar { background: var(--warning); }
.meter.is-full::-webkit-progress-value { background: var(--danger); } .meter.is-full::-moz-progress-bar { background: var(--danger); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv-tight { gap: 6px 14px; font-size: .9375rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--separator); }
.list li:first-child { border-top: 0; }
.list li > strong { font-variant-numeric: tabular-nums; }
.list-main { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; }
.list form, .list .btn { margin: 0; }

.table-wrap { overflow-x: auto; border-radius: var(--radius-md); background: var(--surface); }
.card .table-wrap { border-radius: 0; background: transparent; }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th, .table td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--separator); }
.table th { font-size: .8125rem; font-weight: 600; color: var(--text-2); white-space: nowrap; background: transparent; }
.table td { overflow-wrap: break-word; }
.table td.nowrap, .table td code { overflow-wrap: normal; }
.table tr:last-child td { border-bottom: 0; }
@media (hover: hover) { .table tbody tr:hover > td { background: var(--row-hover); } }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.break-any { overflow-wrap: anywhere; min-width: 130px; }
.table form, .table .btn { margin: 0; }
.is-dim td { opacity: .5; }
.row-error td { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; margin-top: 14px; }
.pager a, .pager-current { min-width: 34px; padding: 6px 11px; border-radius: 8px; background: var(--fill); color: var(--text); font-size: .875rem; text-align: center; font-variant-numeric: tabular-nums; }
.pager a:hover { background: var(--fill-2); text-decoration: none; }
.pager-current { background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* tabele: karty „etykieta: wartość”, gdy się nie mieszczą (klasa is-stacked z app.js) */
.table.is-stacked thead { display: none; }
.table.is-stacked, .table.is-stacked tbody, .table.is-stacked tr, .table.is-stacked td { display: block; width: 100%; }
.table.is-stacked tr { padding: 10px 0; border-bottom: 1px solid var(--separator); }
.table.is-stacked tr:last-child { border-bottom: 0; }
.table.is-stacked td { position: relative; min-height: 1.6em; padding: 5px 16px 5px calc(min(32%, 170px) + 28px); border: 0; text-align: left !important; }
.table.is-stacked td::before { content: attr(data-label); position: absolute; left: 16px; top: 7px; width: min(32%, 170px); color: var(--text-2); font-size: .8125rem; font-weight: 600; overflow-wrap: anywhere; }
.table.is-stacked td[data-label=""] { padding-left: 16px; }
.table.is-stacked td[data-label=""]::before { display: none; }
.table.is-stacked td.actions, .table.is-stacked td.nowrap { white-space: normal; }
.table.is-stacked td.actions { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 16px; }
.table.is-stacked td.actions::before { display: none; }
.table.is-stacked td, .table.is-stacked td code, .table.is-stacked td pre { overflow-wrap: anywhere; white-space: normal; }
.table.is-stacked td pre { max-width: 100%; overflow-x: auto; }
@media (hover: hover) { .table.is-stacked tbody tr:hover > td { background: transparent; } }
.table-wrap.is-stacked-wrap { overflow-x: visible; }

/* rozmowy w zgłoszeniach */
.thread { display: grid; gap: 12px; margin-bottom: 20px; }
.msg { padding: 16px 18px; border-radius: var(--radius-md); background: var(--surface); }
.msg-staff { box-shadow: inset 3px 0 0 var(--accent); }
.msg-user { box-shadow: inset 3px 0 0 var(--fill-2); }
.msg header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.msg-body { white-space: normal; overflow-wrap: anywhere; }
.ticket-title { overflow-wrap: anywhere; }
.reply-form textarea { min-height: 120px; }
.reply-form label { margin-top: 0; }

/* ---------- 13. Statystyki i zaplecze ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; margin-bottom: 16px; }
.stats-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stats-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stats-5 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat { min-width: 0; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); overflow-wrap: anywhere; }
.stat p { margin: 0; }
.stat-warn { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning) 55%, transparent); }
.stat-label { margin-bottom: 6px !important; font-size: .8125rem; font-weight: 600; color: var(--text-2); }
.stat-value { margin-bottom: 4px !important; font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; line-height: 1.15; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: .875rem; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.stat-value-sm { font-size: 1.1875rem; }
.user-title { margin: 0; font-size: clamp(1.4rem, 3.2vw, 2rem); overflow-wrap: anywhere; }
.admin-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 16px; align-items: start; }
.admin-side .card, .admin-main .card { margin-bottom: 16px; }
.admin-side textarea { min-height: 80px; }
.admin-side form .btn { margin-top: 10px; }
.admin-side .row { margin-bottom: 10px; }
.admin-side .row .btn { margin-top: 0; }
.admin-side .table td { padding: 9px 10px; }
.note { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--separator); }
.note p { margin: 0; font-size: .9375rem; overflow-wrap: anywhere; }
.note-meta { margin-bottom: 4px !important; }
.license-key { display: inline-block; margin-left: 6px; font-size: 1rem; letter-spacing: .04em; user-select: all; }
.admin-search { margin-bottom: 12px; }
.admin-search input { max-width: 520px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li span { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; font-size: .75rem; font-weight: 700; }
.checklist li.is-ok span { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.checklist li.is-bad span { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.log-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.log-list code { white-space: pre-wrap; word-break: break-word; }
.trace { margin: 8px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font: .8125rem/1.55 var(--mono); overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.trace span { display: block; }
.trace .tc { color: var(--info); } .trace .ts { color: var(--success); } .trace .te { color: var(--danger); } .trace .tn { color: var(--text-2); }
.tips { margin: 0; padding-left: 1.1em; font-size: .9375rem; }
.tips li { margin-bottom: 6px; }
.legal-editor { min-height: 520px; font-family: var(--mono); font-size: .875rem; }
.legal-preview { max-height: 70vh; overflow: auto; }

/* filtry list */
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.filter-bar > div { display: flex; flex-direction: column; flex: 1 1 130px; min-width: 0; }
.filter-bar > div:first-child { flex: 2 1 200px; }
.filter-bar label { margin: 0 0 4px; font-size: .8125rem; color: var(--text-2); }
.filter-bar input, .filter-bar select { width: 100%; height: 44px; margin: 0; }
.filter-bar input[type=date] { padding-inline: 10px; }
.filter-bar > .filter-actions { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 6px; }
.filter-bar .filter-actions .btn { height: 44px; margin: 0; }
.source-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.source-tabs a { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--fill); color: var(--text); font-size: .875rem; }
.source-tabs a:hover { background: var(--fill-2); text-decoration: none; }
.source-tabs a span { font-weight: 700; font-variant-numeric: tabular-nums; }
.source-tabs a small { color: var(--text-2); }
.source-tabs a.active { background: var(--selected); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); }
.range-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-bottom: 14px; }
.range-form label { margin: 0 0 4px; font-size: .8125rem; }
.range-form input { width: auto; }

/* ---------- 14. 2FA ---------- */
.qr-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.qr { padding: 10px; border-radius: 14px; background: #ffffff; line-height: 0; }
.qr svg { display: block; width: 200px; height: 200px; }
.secret { font-size: 1rem; letter-spacing: .08em; user-select: all; }
.setup-steps { padding-left: 1.2em; color: var(--text-2); }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 24px; }
.codes code { font-size: 1.0625rem; user-select: all; }

/* ---------- 15. Pakiety i płatności ---------- */
.period-switch { display: flex; gap: 20px; margin: 0 0 12px; padding: 0; border: 0; }
.period-switch label { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 20px 0; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; padding: 24px; border-radius: var(--radius); background: var(--surface); margin: 0; font-weight: 400; }
.plan h3 { margin-bottom: .3em; font-size: 1.25rem; font-weight: 700; }
.plan .price { margin: 0; font-family: var(--font-display); font-size: 2rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.plan .price small { font-size: .9375rem; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.plan ul { flex: 1; margin: 14px 0 0; padding-left: 1.1em; }
.plan li { margin-bottom: 6px; }
.plan-featured { box-shadow: 0 0 0 2px var(--accent); }
.plan .badge { position: absolute; top: -11px; left: 20px; background: var(--accent); color: var(--on-accent); }
.plan-pick { cursor: pointer; transition: box-shadow .15s var(--ease); }
.plan-pick:hover { box-shadow: 0 0 0 1px var(--separator-opaque); }
.plan-pick input[type=radio] { position: absolute; top: 18px; right: 18px; }
.plan-pick:has(input:checked) { box-shadow: 0 0 0 2px var(--accent); }
.plan-pick:has(input:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.plan-products { margin: 18px 0; padding: 14px 18px 6px; border: 1px solid var(--separator); border-radius: var(--radius-md); }
.plan-products legend { padding: 0 6px; font-weight: 600; }
.plan-product { padding: 10px 0; border-top: 1px solid var(--separator); }
.plan-product:first-of-type { border-top: 0; }
.plan-limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 8px 0 4px 28px; }
.plan-limits span { display: block; margin-top: 2px; }
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.pack { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius-md); background: var(--surface-2); }
.pack form { margin: 0; }
.pack strong { font-size: 1.125rem; }
.copy-field { display: flex; align-items: center; gap: 8px; }
.copy-field input { flex: 1; min-width: 0; }
.reasons { display: grid; gap: 2px; margin: 0 0 12px; padding: 0; border: 0; }
.reasons legend { margin-bottom: 8px; }

/* ---------- 16. Transkrypcje, edytor napisów, wykres ---------- */
.subs-preview { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.subs-preview li { display: flex; gap: 12px; }
.token-value { display: block; margin-top: 8px; word-break: break-all; }
.replace-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.replace-form > div { flex: 1; min-width: 160px; }
.replace-form label { margin: 0 0 4px; }
.replace-form .check { margin: 0 0 10px; }
.editor-table td { vertical-align: top; }
.editor-table textarea { min-height: 44px; margin: 0; resize: vertical; }
.editor-table .time-input { width: 132px; margin: 0; font-family: var(--mono); font-size: .875rem; }
.editor-table .center { text-align: center; }
.editor-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; }

.onboarding .meter { margin-bottom: 8px; }
.steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.steps-list li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--separator); }
.steps-list li:first-child { border-top: 0; }
.step-mark { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border: 1.5px solid var(--separator-opaque); border-radius: 50%; font-size: .75rem; font-weight: 700; }
.steps-list li.is-done .step-mark { background: var(--success); border-color: var(--success); color: var(--on-success); }
.steps-list li.is-done strong { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--text-3); }
.step-body { display: flex; flex-direction: column; gap: 2px; }

.usage-chart { margin: 0; }
.chart-body { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: stretch; }
.usage-chart svg { display: block; width: 100%; height: 140px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; min-width: 20px; color: var(--text-2); font-size: .75rem; line-height: 1; text-align: right; font-variant-numeric: tabular-nums; }
.chart-x { display: flex; justify-content: space-between; margin: 6px 0 8px 28px; color: var(--text-2); font-size: .75rem; }
.chart-grid { stroke: var(--separator); stroke-width: 1; }
.chart-bar { fill: color-mix(in srgb, var(--accent) 40%, transparent); }
.chart-bar.is-today { fill: var(--accent); }

/* ---------- 17. Wtyczka i parowanie ---------- */
.pair-page { display: flex; justify-content: center; }
.pair-card { width: 100%; max-width: 460px; margin-top: 24px; padding: 36px 30px; text-align: left; }
.pair-card h1 { margin: 0 0 .4em; }
.pair-code { margin: 22px 0; padding: 18px 12px; border-radius: var(--radius-md); background: var(--surface-2); font-family: var(--mono); font-size: clamp(1.9rem, 7vw, 2.4rem); font-weight: 600; letter-spacing: .14em; text-align: center; color: var(--text); }
.pair-facts { display: grid; margin: 0 0 20px; border-top: 1px solid var(--separator); }
.pair-facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--separator); }
.pair-facts dt { color: var(--text-2); font-size: .9375rem; }
.pair-facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-size: .9375rem; }
.pair-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.pair-actions .btn { margin: 0; }
.pair-lookup { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 14px; }
.pair-lookup input { font-family: var(--mono); font-size: 1.5rem; letter-spacing: .16em; text-align: center; text-transform: uppercase; }
.pair-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 16px; border-radius: 50%; }
.pair-icon-ok { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.plugin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.plugin-head h2 { margin: 0 0 4px; }
.plugin-dl { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.install-title { margin: 32px 0 0; }
.page-pad .install-steps li { background: var(--surface); }
.install-guide .install-steps li { background: var(--surface-2); }
.install-more { margin: 4px 0 12px; }
.install-more > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.install-guide {
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto;
  padding: clamp(22px, 4vw, 34px); border: 0; border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop);
}
.install-guide::backdrop { background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.install-guide-head h2 { margin: 4px 0 6px; font-size: clamp(1.4rem, 3vw, 1.75rem); }
.install-guide-head p { margin: 0; }
.install-guide-ok { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--success); }
.install-guide-ok span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--success); color: var(--on-success); font-size: .75rem; }
.install-guide .install-steps { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.install-guide-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin: 6px 0 14px; }
.install-guide-actions form { margin: 0; }
@media (max-width: 640px) {
  .plugin-dl { align-items: stretch; width: 100%; }
  .install-guide .install-steps { grid-template-columns: minmax(0, 1fr); }
  .install-guide-actions .btn, .install-guide-actions form { flex: 1 1 100%; }
  .install-guide-actions form .btn { width: 100%; }
}
.install-steps { list-style: none; counter-reset: is; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; margin: 20px 0 12px; padding: 0; }
.install-steps li { counter-increment: is; position: relative; padding: 18px 18px 18px 58px; border-radius: var(--radius-md); background: var(--surface-2); color: var(--text-2); line-height: 1.55; }
.install-steps li::before { content: counter(is); position: absolute; left: 18px; top: 17px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: .8125rem; font-weight: 700; }
.install-steps strong { display: block; margin-bottom: 4px; color: var(--text); }

/* ---------- 18. Produkty i Viral Radar ---------- */
.product-grid { margin-bottom: 28px; }
.product-card { display: flex; flex-direction: column; gap: 4px; }
.product-card h2, .product-card h3 { margin: 0; }
.product-card > p:last-child { margin-top: auto; padding-top: 10px; }
.product-card.is-locked { background: transparent; box-shadow: inset 0 0 0 1px var(--separator-opaque); }
.product-meta { list-style: none; margin: 4px 0 0; padding: 0; font-size: .9375rem; color: var(--text); }
.viral-cats { margin-bottom: 20px; }
.card-link { display: block; color: inherit; transition: box-shadow .15s var(--ease); }
.card-link:hover { text-decoration: none; box-shadow: 0 0 0 1px var(--separator-opaque), var(--shadow-pop); }
.card-link h3 { margin: 0 0 4px; }
.viral-fetch { position: relative; }
.viral-fetch > summary { list-style: none; cursor: pointer; }
.viral-fetch > summary::-webkit-details-marker { display: none; }
.viral-fetch-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; margin-top: 10px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.viral-fetch-form label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: .8125rem; }
.viral-fetch-form select { width: auto; }
.viral-structure { display: grid; gap: 6px; margin: 8px 0 12px; padding-left: 20px; }
.viral-video .card-head { align-items: flex-start; }
.viral-video h2 a { color: inherit; }
.viral-video-head { display: flex; align-items: flex-start; gap: 12px; }
.viral-pick { margin-top: 4px; }
.viral-script td { vertical-align: top; }
.viral-limits { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; }
.viral-limit { display: flex; flex-direction: column; gap: 2px; min-width: 150px; padding: 12px 16px; border-radius: var(--radius-md); background: var(--surface); }
.viral-limit .eyebrow { margin: 0; }
.viral-limit strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.viral-limit.is-full { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 55%, transparent); }
.viral-limit.is-full strong { color: var(--danger); }

/* ---------- 19. Zespoły, dźwięk ---------- */
.team-stats .card { display: flex; flex-direction: column; gap: 4px; }
.team-big { margin: 0; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.team-big .muted { font-size: 1rem; font-weight: 500; }
.team-seats { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.team-seats li { display: flex; justify-content: space-between; gap: 10px; font-size: .9375rem; }
.team-seats strong { font-variant-numeric: tabular-nums; }
.team-table td { vertical-align: top; }
.team-sub legend { padding: 0 6px; font-weight: 600; }
.team-sub .check { margin-top: 4px; }
.audio-stats { margin-bottom: 18px; }
.audio-steps { display: grid; gap: 4px; margin: 6px 0 0; padding-left: 18px; }
.plain-list { list-style: none; display: grid; gap: 4px; margin: 6px 0 0; padding: 0; }

/* ---------- 20. Responsywność ---------- */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 960px) and (max-width: 1240px) {
  .page-pad:has(> .side-nav) .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .page-pad:has(> .side-nav) .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) and (max-width: 1100px) {
  .page-pad:has(> .side-nav) .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1400px) {
  .page-pad:has(> .side-nav) .table th, .page-pad:has(> .side-nav) .table td { padding: 10px; }
  .page-pad:has(> .side-nav) .table th { white-space: normal; }
  .page-pad:has(> .side-nav) .table { font-size: .875rem; }
  .page-pad:has(> .side-nav) .table .hide-md { display: none; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .card-head .row-inline { flex-wrap: wrap; }
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .nav { flex-wrap: nowrap; gap: 14px; }
  .brand span { white-space: nowrap; }
  .nav .btn-sm { white-space: nowrap; }
  .header-inner { gap: 10px; }
  .search input { min-width: 0; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .plan-limits { margin-left: 0; }
}
@media (max-width: 380px) {
  .brand > span { display: none; }
  .nav { gap: 10px; }
  .nav .btn { padding-inline: 12px; }
}

/* ---------- 21. Ustawienia dostępności ---------- */
@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
@media (forced-colors: active) {
  .btn, .pill, .status, .side-nav a.active { border: 1px solid ButtonText; }
}

@media (max-width: 900px) { .nav .hide-md { display: none; } }

/* 22. Strona główna – osobny arkusz assets/css/landing.css (ładowany tylko na „/”). */

/* Przełącznik motywu w nagłówku (systemowy → jasny → ciemny) */
.theme-toggle {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; flex: none;
  border: 0; border-radius: 50%; background: var(--fill); color: var(--text); cursor: pointer;
  transition: background-color .15s var(--ease);
}
.theme-toggle:hover { background: var(--fill-2); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .ti { display: none; }
.theme-toggle[data-mode="system"] .ti-system, .theme-toggle[data-mode="light"] .ti-light, .theme-toggle[data-mode="dark"] .ti-dark { display: block; }
@media (max-width: 640px) { .theme-toggle { width: 40px; height: 40px; } }

/* ---------- Telefon: cele dotykowe ≥ 40 px (WCAG 2.5.8 / zalecenia Apple 44 pt) ---------- */
@media (max-width: 640px) {
  .brand { min-height: 40px; }
  .nav a:not(.btn) { padding-block: 10px; }   /* bez zmiany display – .hide-sm musi dalej ukrywać */
  .nav .btn, .btn-sm { min-height: 40px; }
  .btn { white-space: normal; overflow-wrap: normal; word-break: normal; max-width: 100%; text-align: center; }
  .viral-limits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .viral-limit { min-width: 0; padding: 12px; }
  .nav .btn, .badge { white-space: nowrap; }
  .page-head .row-inline, .card-head .row-inline { flex-wrap: wrap; }
  .row-inline input[type=email] { min-width: 0; }
  .viral-fetch-form { padding: 12px; }
  .viral-fetch-form .row-inline { flex-wrap: wrap; }
  .viral-fetch-form label { flex: 1 1 130px; min-width: 0; }
  .viral-fetch-form select { width: 100%; min-width: 0; }
  .viral-group, .viral-group > * { min-width: 0; max-width: 100%; }
  .list li:has(.viral-fetch[open]) { flex-wrap: wrap; }
  .list li:has(.viral-fetch[open]) > .row-inline { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-end; }
  .viral-fetch[open] { flex: 1 1 100%; order: 2; }
  .viral-fetch[open] > summary { margin-left: auto; width: max-content; display: flex; }
  /* edytor napisów: wiersz = [Od][Do][usuń] + tekst pod spodem, bez przewijania w bok */
  .editor-table thead { display: none; }
  .editor-table, .editor-table tbody { display: block; width: 100%; }
  .editor-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 8px 6px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--separator); }
  .page-pad .table.editor-table td { display: block; padding: 0; border: 0; }
  .page-pad .table.editor-table td.num { display: none; }
  .editor-table td:nth-child(2) { grid-column: 1; grid-row: 1; }
  .editor-table td:nth-child(3) { grid-column: 2; grid-row: 1; }
  .editor-table td:nth-child(4) { grid-column: 1 / -1; grid-row: 2; }
  .editor-table td:nth-child(5) { grid-column: 3; grid-row: 1; text-align: center; }
  .editor-table .time-input { width: 100%; max-width: none; padding-inline: 6px; letter-spacing: -.02em; }
  .editor-table textarea { width: 100%; field-sizing: content; min-height: 44px; }
  .footer-cols { gap: 20px 40px; }
  .footer-cols a, .footer-bottom a { padding-block: 6px; }
  .check, .check-inline { min-height: 40px; align-items: center; }
  .check input { margin-top: 0; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }
  details > summary { padding-block: 9px; }
  .inline-form summary, .viral-group > summary { padding-block: 8px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px; } /* iOS bez auto-zoomu */
}


/* =====================================================================
   23. Aplikacja 3.0 – panel klienta i zaplecze (body.is-app / .is-admin)
   Ten sam język co strona główna: ciemny pasek „monitora”, Montserrat w tytułach,
   żółty znacznik aktywnej pozycji (sygnatura: aktywne słowo napisów),
   karty z cienką ramką zamiast płaskich plam – czytelne w obu motywach.
   ===================================================================== */
@font-face {
  font-family: "Montserrat L2";
  src: url("../fonts/montserrat-var.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
:root { --font-brand: "Montserrat L2", var(--font-display); --ink: #0b0c10; --ink-2: #15171c; --ink-line: rgba(255, 255, 255, .09); }

/* ---------- przełącznik jasny / ciemny ---------- */
.theme-switch { flex: none; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 999px; }
.theme-switch:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.ts-track { position: relative; display: flex; align-items: center; justify-content: space-between; width: 58px; height: 30px; padding: 0 7px; border-radius: 999px; background: var(--fill); transition: background-color .2s var(--ease); }
.ts-track svg { position: relative; z-index: 1; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; color: var(--text-2); transition: color .2s var(--ease); }
.ts-knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .22s var(--ease); }
.theme-switch[aria-checked="false"] .ts-sun { color: #b07800; }
.theme-switch[aria-checked="true"] .ts-knob { transform: translateX(28px); background: #2a2d36; }
.theme-switch[aria-checked="true"] .ts-moon { color: var(--caption); }
.theme-switch:hover .ts-track { background: var(--fill-2); }
@media (prefers-reduced-motion: reduce) { .ts-knob, .ts-track { transition: none; } }

/* ---------- przełącznik języka PL / EN (obok motywu) ---------- */
.lang-pill { flex: none; display: inline-flex; align-items: center; height: 30px; padding: 3px; border-radius: 999px; background: var(--fill); font-size: .75rem; font-weight: 700; letter-spacing: .03em; }
.site-header .nav .lang-pill a { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 24px; padding: 0 7px; border-radius: 999px; color: var(--text-2); text-decoration: none; transition: background-color .15s var(--ease), color .15s var(--ease); }
.site-header .nav .lang-pill a:hover { color: var(--text); }
.site-header .nav .lang-pill a[aria-current="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.site-header .nav .lang-pill a:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }
.is-app .lang-pill, .is-home .lang-pill, .is-help .lang-pill { background: rgba(255, 255, 255, .12); }
.is-app .site-header .nav .lang-pill a, .is-home .site-header .nav .lang-pill a, .is-help .site-header .nav .lang-pill a { color: #a7abb6; }
.is-app .site-header .nav .lang-pill a[aria-current="true"], .is-home .site-header .nav .lang-pill a[aria-current="true"], .is-help .site-header .nav .lang-pill a[aria-current="true"] { background: #f4f5f7; color: #111; }

/* ---------- pasek nagłówka w aplikacji (zawsze ciemny – jak w montażowni) ---------- */
.brand-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.area-chip { padding: 3px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .02em; background: rgba(255, 255, 255, .1); color: #e7e8ec; }
.area-chip.is-admin { background: var(--caption); color: #111; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--caption); color: #111; font-size: .8125rem; font-weight: 800; }
.header-user { display: inline-flex; align-items: center; gap: 8px; }
.header-user-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-app .site-header, .is-home .site-header { background: rgba(11, 12, 16, .97); border-bottom-color: var(--ink-line); }
.is-app .site-header .brand, .is-app .site-header .nav a:not(.btn) { color: #f4f5f7; }
.is-app .site-header .btn-ghost { background: rgba(255, 255, 255, .1); color: #f4f5f7; }
.is-app .site-header .btn-ghost:hover { background: rgba(255, 255, 255, .18); }
.is-app .ts-track, .is-home .ts-track { background: rgba(255, 255, 255, .12); }
.is-app .ts-knob, .is-home .ts-knob { background: #f4f5f7; }
.is-app .theme-switch[aria-checked="true"] .ts-knob, .is-home .theme-switch[aria-checked="true"] .ts-knob { background: #3a3e49; }
.is-app .ts-track svg, .is-home .ts-track svg { color: #a7abb6; }
.is-app .theme-switch[aria-checked="false"] .ts-sun, .is-home .theme-switch[aria-checked="false"] .ts-sun { color: #b07800; }

/* ---------- przyciski: ten sam kształt co na stronie (zaokrąglony prostokąt) ---------- */
.btn { border-radius: 11px; }
.btn-sm { border-radius: 9px; }

/* ---------- treść aplikacji ---------- */
.is-app main { background: var(--bg-grouped); }
.is-app .page-pad > h1, .is-app .page-head h1, .is-app .user-title {
  font-family: var(--font-brand); font-weight: 800; letter-spacing: -.035em; font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.4rem);
}
.is-app .card, .is-app .stat, .is-app .table-wrap, .is-app .msg {
  border: 1px solid var(--separator); box-shadow: none;
}
.is-app .card { border-radius: 18px; }
.is-app .card .table-wrap { border: 0; }
.is-app .eyebrow { font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.is-app .stat { border-radius: 16px; padding: 18px 20px 16px; }
.is-app .stat-label { font-size: .6875rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.is-app .stat-value { font-family: var(--font-brand); font-weight: 800; letter-spacing: -.035em; font-size: 1.9rem; }
.is-app .stat-value-sm { font-size: 1.25rem; }
.is-app .table th { font-size: .6875rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-2); border-bottom-color: var(--separator); }
.is-app .card h2, .is-app .card .h3, .is-app .card-head h2 { letter-spacing: -.02em; }
.is-app .subnav { border-radius: 12px; }
.is-app .subnav a { border-radius: 9px; }
.is-app .badge { border-radius: 7px; }

/* ---------- menu boczne ---------- */
@media (min-width: 960px) {
  .is-app .page-pad:has(> .side-nav) { column-gap: 36px; }
  .is-app .page-pad > .side-nav {
    padding: 14px 10px; border: 1px solid var(--separator); border-radius: 18px; background: var(--surface);
    top: 70px; max-height: calc(100vh - 88px);
  }
  .is-app .side-nav a { position: relative; padding: 8px 12px; border-radius: 10px; font-size: .9375rem; color: var(--text); }
  .is-app .side-nav a:hover { background: var(--fill); }
  .is-app .side-nav a.active { background: var(--fill); font-weight: 700; }
  .is-app .side-nav a.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--caption); }
  .is-app .side-heading { padding: 10px 12px 4px; font-size: .6875rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
  .is-app .side-nav-tools { padding: 0 8px; }
  .is-app .side-nav .admin-search input { background: var(--bg-grouped); border: 1px solid var(--separator); }
  .is-app .side-nav .side-back { border-top-color: var(--separator); }
}
@media (max-width: 959px) {
  .is-app .side-nav a { border-radius: 10px; background: var(--surface); border: 1px solid var(--separator); }
  .is-app .side-nav a.active { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--caption); }
}
:root[data-theme="dark"] .is-app .side-nav a.active { box-shadow: inset 0 0 0 1px var(--separator); }

/* ---------- zwarta stopka w aplikacji ---------- */
.site-footer-app { padding: 18px 0 22px; background: var(--bg-grouped); }
.site-footer-app .footer-bottom { margin-top: 0; padding-top: 0; border-top: 0; }
.site-footer-app a { color: var(--text-2); }
.site-footer-app a:hover { color: var(--text); }
.site-footer { background: var(--bg); }

/* ---------- kroki w panelu: numeracja w stylu strony ---------- */
.is-app .install-steps li::before { background: var(--ink); color: var(--caption); border-radius: 8px; font-family: var(--font-brand); font-weight: 800; }
:root[data-theme="dark"] .is-app .install-steps li::before { background: var(--caption); color: #111; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .is-app .install-steps li::before { background: var(--caption); color: #111; } }

@media (max-width: 640px) {
  .header-user-name { display: none; }
  .area-chip { display: none; }
  .is-app .brand span { display: none; }
  .nav { gap: 14px; }
  .ts-track { width: 50px; height: 28px; padding: 0 6px; }
  .ts-knob { width: 22px; height: 22px; }
  .theme-switch[aria-checked="true"] .ts-knob { transform: translateX(22px); }
  .lang-pill { height: 28px; }
  .site-header .brand span { display: none; }   /* przy przełącznikach motywu i języka zostaje samo logo */
  .site-header .nav .lang-pill a { min-width: 26px; height: 22px; padding: 0 5px; }
}
@media (max-width: 380px) { .is-home .brand span { display: none; } }

/* Cloudflare Turnstile w formularzach logowania/rejestracji */
.turnstile-box { margin: 18px 0 4px; min-height: 65px; }
.turnstile-box .cf-turnstile { width: 100%; }

/* ---------- Regulamin i polityka prywatności (/regulamin, /prywatnosc) ---------- */
.legal-page { background: var(--bg); }
.legal-hero { padding: clamp(36px, 6vw, 72px) 0 clamp(20px, 3vw, 32px); border-bottom: 1px solid var(--separator); background: linear-gradient(180deg, var(--bg-grouped), var(--bg)); }
.legal-hero-in { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.legal-hero h1 { margin: 0; font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.5rem); letter-spacing: -.035em; line-height: 1.05; }
.legal-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--fill); max-width: 100%; }
.legal-switch a { padding: 7px 18px; border-radius: 999px; color: var(--text-2); font-size: .875rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .2s var(--ease), color .2s var(--ease); }
.legal-switch a:hover { color: var(--text); }
.legal-switch a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
.legal-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.legal-chip { padding: 4px 12px; border-radius: 999px; background: var(--fill); color: var(--text-2); font-size: .8125rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.legal-chip-ok { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); font-weight: 600; }
.legal-chip-warn { background: color-mix(in srgb, var(--warning) 12%, transparent); color: var(--warning); font-weight: 600; }
.legal-chip-muted { font-weight: 600; }

.legal-notices { max-width: 1120px; display: grid; gap: 10px; padding-top: 24px; }
.legal-notices:empty { display: none; }
.legal-note { padding: 14px 18px; border-radius: var(--radius-md); background: var(--surface-2); color: var(--text); font-size: .9375rem; line-height: 1.5; }
.legal-note a { font-weight: 600; }
.legal-note-accent { background: color-mix(in srgb, var(--info) 9%, var(--surface)); }
.legal-note-changes { margin: 6px 0; color: var(--text-2); }

.legal-layout { max-width: 1120px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; padding-top: clamp(28px, 4vw, 48px); padding-bottom: 96px; }
.legal-aside { display: none; }
.legal-main { min-width: 0; max-width: 720px; width: 100%; margin: 0 auto; }

.legal-toc-title { margin: 0 0 10px; color: var(--text-3); font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.legal-toc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.legal-toc-list a { display: flex; gap: 10px; padding: 6px 10px; border-radius: 8px; color: var(--text-2); font-size: .875rem; line-height: 1.35; text-decoration: none; transition: background .15s var(--ease), color .15s var(--ease); }
.legal-toc-list a:hover { background: var(--row-hover); color: var(--text); }
.legal-toc-list a[aria-current="true"] { background: var(--selected); color: var(--text); font-weight: 600; }
.legal-toc-num { flex: 0 0 1.6em; color: var(--text-3); font-variant-numeric: tabular-nums; }

.legal-toc-mobile { margin-bottom: 28px; border-radius: var(--radius-md); background: var(--surface-2); }
.legal-toc-mobile summary { display: flex; justify-content: space-between; padding: 14px 18px; font-weight: 600; cursor: pointer; list-style: none; }
.legal-toc-mobile summary::-webkit-details-marker { display: none; }
.legal-toc-mobile summary::after { content: "⌄"; margin-left: 8px; color: var(--text-3); transition: transform .2s var(--ease); }
.legal-toc-mobile[open] summary::after { transform: rotate(180deg); }
.legal-toc-mobile summary .muted { margin-left: auto; font-weight: 500; }
.legal-toc-mobile .legal-toc-list { padding: 0 8px 12px; }

@media (min-width: 960px) {
  .legal-layout:not(.legal-layout-single) { grid-template-columns: 240px minmax(0, 1fr); }
  .legal-aside { display: block; }
  .legal-toc { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; padding-right: 4px; }
  .legal-toc-mobile { display: none; }
  .legal-layout:not(.legal-layout-single) .legal-main { margin: 0; }
}

.legal-body { font-size: 1.0625rem; line-height: 1.65; color: var(--text); }
.legal-body > :first-child, .legal-body > div[lang] > :first-child { margin-top: 0; }
.legal-body h2 { display: flex; align-items: baseline; gap: 12px; margin: 2em 0 .8em; padding-top: 1.3em; border-top: 1px solid var(--separator); font-size: clamp(1.375rem, 1.2rem + .6vw, 1.75rem); letter-spacing: -.024em; scroll-margin-top: 84px; }
.legal-body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.legal-body h3 { margin: 1.8em 0 .5em; font-size: 1.1875rem; letter-spacing: -.016em; }
.legal-body h4 { margin: 1.4em 0 .4em; font-size: 1rem; }
.legal-num { flex: none; display: inline-grid; place-items: center; min-width: 1.75em; height: 1.75em; padding: 0 .4em; border-radius: 999px; background: var(--fill); color: var(--text-2); font-size: .6em; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums; transform: translateY(-.12em); }
.legal-body p { margin: 0 0 1em; }
.legal-body ul, .legal-body ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.legal-body li { margin: 0 0 .55em; padding-left: .25em; }
.legal-body li::marker { color: var(--text-3); font-variant-numeric: tabular-nums; }
.legal-body ol > li::marker { font-weight: 600; }
.legal-body strong { font-weight: 600; }
.legal-body a { overflow-wrap: anywhere; }

.legal-foot { display: grid; gap: 28px; margin-top: 64px; }
.legal-help { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border-radius: var(--radius-lg); background: var(--surface-2); }
.legal-help p { margin: 0; }
.legal-help-title { font-weight: 700; font-size: 1.0625rem; margin-bottom: 2px !important; }
.legal-help-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.legal-versions ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--separator); }
.legal-versions li a { display: flex; justify-content: space-between; gap: 16px; padding: 12px 4px; border-bottom: 1px solid var(--separator); color: var(--text); text-decoration: none; font-variant-numeric: tabular-nums; }
.legal-versions li a:hover { color: var(--link); }
.legal-versions li a[aria-current="page"] { font-weight: 600; }
.legal-top { margin: 0; text-align: center; font-size: .875rem; }
.legal-top a { color: var(--text-2); text-decoration: none; }

@media (max-width: 640px) {
  .legal-body { font-size: 1rem; }
  .legal-switch a { padding: 7px 14px; }
  .legal-help { padding: 18px; }
}

@media print {
  .site-header, .site-footer, footer.site-footer, .legal-switch, .legal-aside, .legal-toc-mobile, .legal-help, .legal-top, .lang-pill { display: none !important; }
  .legal-hero { background: none; padding: 0 0 12px; }
  .legal-hero-in { align-items: flex-start; text-align: left; }
  .legal-hero h1 { font-size: 22pt; }
  .legal-layout { display: block; padding: 12px 0 0; }
  .legal-main { max-width: none; }
  .legal-body { font-size: 10.5pt; line-height: 1.5; color: #000; }
  .legal-body h2 { break-after: avoid; border-top: 0; padding-top: 0; margin-top: 1.4em; font-size: 14pt; }
  .legal-body a::after { content: " (" attr(href) ")"; font-size: .85em; color: #555; }
  .legal-body a[href^="/"]::after { content: ""; }
}

/* ---------- Ikony i kafelki panelu (helpers.php: icon()) ---------- */
.ico { width: 22px; height: 22px; flex: none; vertical-align: -.3em; }
.ico-sm { width: 16px; height: 16px; vertical-align: -.2em; }
.side-nav a { display: flex; align-items: center; gap: 10px; }
.side-ico { width: 18px; height: 18px; color: var(--text-2); }
.side-nav a.active .side-ico { color: currentColor; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 4px 0 20px; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .tiles { grid-template-columns: minmax(0, 1fr); } .tile { min-height: 60px; } }
.tile { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--surface); color: var(--text); text-decoration: none; transition: box-shadow .15s var(--ease), transform .15s var(--ease); }
.tile:hover { text-decoration: none; box-shadow: 0 0 0 1px var(--separator-opaque), var(--shadow-pop); }
.tile:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.tile-ico { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--fill); color: var(--text); }
.tile:hover .tile-ico { background: var(--caption); color: #1d1d1f; }
.tile-text { display: grid; gap: 2px; min-width: 0; }
.tile-text strong { font-size: .9375rem; font-weight: 600; line-height: 1.25; }
.tile-text span { font-size: .8125rem; color: var(--text-2); line-height: 1.3; }
.dash-grid .card-head { align-items: flex-start; }
.dash-grid .card-head h2 { margin: 0; }
.product-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.product-head > div { display: grid; gap: 4px; justify-items: start; }
.product-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } }

/* ---- Zgłoszenia: styl Apple (grupowane listy, dymki, segmented control) ---- */
.tk { --tk-muted: color-mix(in srgb, var(--text) 62%, transparent); --tk-well: color-mix(in srgb, var(--text) 7%, var(--surface)); }
.tk-title { font-size: clamp(26px, 4vw, 34px); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin: 4px 0 6px; text-wrap: balance; }
.tk-meta { color: var(--tk-muted); font-size: 14px; margin: 0; }
.tk-head { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.tk-group { background: var(--surface); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--separator); overflow: hidden; }
.tk-group-label { font-size: 13px; font-weight: 600; color: var(--tk-muted); text-transform: uppercase; letter-spacing: .04em; margin: 14px 16px 6px; }
.tk-legend { display: block; font-size: 13px; font-weight: 600; color: var(--tk-muted); margin: 0 0 6px; }
.tk-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 44px; color: var(--text); text-decoration: none; }
.tk-row + .tk-row { border-top: 1px solid var(--separator); }
.tk-row:hover { background: color-mix(in srgb, var(--text) 4%, var(--surface)); }
.tk-row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tk-row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-row-sub { font-size: 13px; color: var(--tk-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-row-time { font-size: 13px; color: var(--tk-muted); white-space: nowrap; }
.tk-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--tk-well); color: var(--text); white-space: nowrap; }
.tk-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tk-dot, var(--tk-muted)); }
.tk-pill-open { --tk-dot: var(--success); }
.tk-pill-waiting { --tk-dot: var(--warning); }
.tk-pill-closed { --tk-dot: var(--tk-muted); }
.tk-thread { display: grid; gap: 10px; margin-bottom: 20px; }
.tk-bubble-wrap { display: grid; gap: 4px; max-width: min(78%, 560px); }
.tk-bubble-wrap.is-mine { justify-self: end; justify-items: end; }
.tk-bubble-wrap.is-team { justify-self: start; justify-items: start; }
.tk-who { font-size: 12px; color: var(--tk-muted); padding: 0 12px; }
.tk-bubble { padding: 10px 14px; border-radius: 18px; line-height: 1.45; overflow-wrap: anywhere; font-size: 16px; }
.is-mine .tk-bubble { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; }
.is-team .tk-bubble { background: var(--tk-well); color: var(--text); border-bottom-left-radius: 6px; }
.is-private .tk-bubble { background: color-mix(in srgb, var(--warning) 24%, var(--surface)); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning) 55%, transparent); }
.tk-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--tk-muted); padding: 0 12px; }
.tk-tag .ico { width: 13px; height: 13px; }
.tk-sent { font-size: 12px; color: var(--tk-muted); padding: 0 12px; }
.tk-msg-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 0 12px; }
.tk-note { font-size: 13px; color: var(--tk-muted); margin: 0; }
.tk-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: var(--tk-well); }
.tk-seg > label { position: relative; }
.tk-seg input { position: absolute; opacity: 0; pointer-events: none; }
.tk-seg span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; }
.tk-seg input:checked + span { background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.tk-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.tk-seg-hint { font-size: 12px; color: var(--tk-muted); margin: 6px 4px 0; }
.tk-reply { display: grid; gap: 12px; padding: 16px; }
.tk-reply textarea { width: 100%; min-height: 96px; border-radius: 12px; font: inherit; font-size: 16px; padding: 10px 12px; background: var(--field-bg, var(--bg)); color: var(--text); border: 1px solid var(--field-border, var(--separator)); resize: vertical; }
.tk-reply textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tk-btn { appearance: none; border: 0; border-radius: 999px; min-height: 44px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; text-decoration: none; line-height: 1; white-space: nowrap; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; background: var(--accent); color: var(--on-accent); }
.tk-btn-quiet { background: var(--tk-well); color: var(--text); }
.tk-btn-sm { min-height: 32px; padding: 0 12px; font-size: 14px; }
.tk-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tk-kv { display: grid; gap: 0; }
.tk-kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; font-size: 15px; }
.tk-kv > div + div { border-top: 1px solid var(--separator); }
.tk-kv dt { color: var(--tk-muted); }
.tk-kv dd { margin: 0; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.tk-sel { width: 100%; min-height: 40px; border-radius: 10px; font: inherit; font-size: 15px; padding: 0 10px; background: var(--field-bg, var(--bg)); color: var(--text); border: 1px solid var(--field-border, var(--separator)); }
.tk-form { display: grid; gap: 10px; padding: 12px 16px 16px; }
.tk-watchers { list-style: none; margin: 0; padding: 0; }
.tk-watchers li { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; }
.tk-watchers li + li { border-top: 1px solid var(--separator); }
.tk-events { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.tk-events li { padding: 9px 16px; }
.tk-events li + li { border-top: 1px solid var(--separator); }
.tk-events time { color: var(--tk-muted); display: block; }
.tk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.tk-side { display: grid; gap: 14px; min-width: 0; align-content: start; }
@media (max-width: 900px) { .tk-layout { grid-template-columns: 1fr; } }
.tk-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.tk-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text); background: var(--tk-well); text-decoration: none; }
.tk-chip[aria-current="true"] { background: var(--accent); color: var(--on-accent); }
.tk-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tk-muted); flex: none; }
.tk-dot-open { background: var(--success); }
.tk-dot-waiting { background: var(--warning); }
.tk-empty { padding: 28px 16px; text-align: center; color: var(--tk-muted); }
@media (prefers-reduced-motion: reduce) { .tk-row, .tk-btn, .tk-seg span { transition: none; } }

/* ---------- Ekran zgody na cookies (partials/consent.php + js/consent.js) ----------
   Odrzuć i Akceptuj mają ten sam wygląd i wagę – odmowa tak łatwa jak zgoda. */
.consent { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
.consent[hidden] { display: none; }
.consent-backdrop { position: absolute; inset: 0; background: rgba(8, 9, 12, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.consent-card { position: relative; width: min(100%, 480px); max-height: calc(100vh - 32px); overflow: auto; padding: 28px 28px 22px; border-radius: 24px; background: var(--surface); color: var(--text); text-align: center; box-shadow: 0 24px 64px rgba(0, 0, 0, .35); outline: none; }
.consent-logo { display: block; width: 40px; height: 40px; margin: 0 auto 12px; }
.consent-title { margin: 0 0 10px; font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.consent-text { margin: 0 0 20px; color: var(--text-2); font-size: .875rem; line-height: 1.55; }
.consent-text a { color: var(--link); text-decoration: underline; }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.consent-btn { appearance: none; border: 0; border-radius: 999px; min-height: 48px; padding: 0 18px; font: inherit; font-size: .9375rem; font-weight: 700; cursor: pointer; background: var(--text); color: var(--bg); transition: opacity .15s var(--ease); }
.consent-btn:hover { opacity: .88; }
.consent-btn:focus-visible, .consent-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.consent-btn-wide { width: 100%; margin-top: 10px; }
.consent-btn[hidden], .consent-link[hidden] { display: none; }
.consent-link { appearance: none; border: 0; background: none; margin-top: 16px; padding: 4px; font: inherit; font-size: .875rem; font-weight: 600; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.consent-prefs { display: grid; gap: 8px; margin: 0 0 16px; text-align: left; }
.consent-prefs[hidden] { display: none; }
.consent-opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0; padding: 12px 14px; font-weight: 400; border: 1px solid var(--separator); border-radius: 14px; cursor: pointer; }
.consent-opt.is-locked { cursor: default; opacity: .75; }
.consent-opt span { display: grid; gap: 2px; }
.consent-opt strong { font-size: .9375rem; }
.consent-opt small { color: var(--text-2); font-size: .8125rem; font-weight: 400; line-height: 1.4; }
.consent-opt input { flex: none; width: 20px; height: 20px; accent-color: var(--accent); }
html.consent-open { overflow: hidden; }
@media (max-width: 420px) {
  .consent { align-items: end; padding: 8px; }
  .consent-card { padding: 24px 20px 18px; border-radius: 22px; }
  .consent-actions { grid-template-columns: 1fr; }
}

/* ---------- Admin → Baza wiedzy ---------- */
.help-video-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--separator); border-radius: 12px; }
.help-video-row input[type="text"] { flex: 1 1 220px; min-width: 0; }
.help-video-new { margin: 0; padding: 14px; border: 1px dashed var(--separator-opaque); border-radius: 12px; }
.help-video-new legend { padding: 0 6px; font-weight: 600; }
.help-faq-row { display: grid; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--separator); }
.help-faq-row:last-child { border-bottom: 0; padding-bottom: 0; }
details.card > summary.h3 { cursor: pointer; }
.help-reset { margin-top: 16px; }

/* ---------- Admin → Logi wtyczki (zakładki proste / rozszerzone) ---------- */
.text-bad { color: var(--danger); }
.log-stats { align-self: center; font-variant-numeric: tabular-nums; }
.log-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; margin: 0 0 16px; border-radius: var(--radius-md); background: var(--fill); max-width: 640px; }
.log-tabs a { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: calc(var(--radius-md) - 4px); color: var(--text-2); text-decoration: none; min-width: 0; }
.log-tabs a:hover { color: var(--text); }
.log-tabs a.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.log-tab-title { font-weight: 600; }
.log-tab-sub { font-size: .8125rem; color: var(--text-3); }
.log-licenses { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.log-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px; background: var(--fill); color: var(--text); font-size: .875rem; text-decoration: none; }
.log-chip:hover { background: var(--fill-2); }
.log-chip.is-active { background: var(--accent); color: var(--on-accent); }
.log-chip.is-active .muted { color: inherit; opacity: .8; }
.log-chip.is-dim { opacity: .6; }
.log-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.log-dot.is-on { background: var(--success); }
.log-count { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); font-size: .75rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.log-chip.is-active .log-count { background: rgba(255, 255, 255, .25); color: inherit; }
.log-level { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.log-error { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.log-warn { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }
.log-info { background: var(--fill); color: var(--text-2); }
.log-origin { font-size: .75rem; color: var(--text-3); white-space: nowrap; }
.log-msg { overflow-wrap: anywhere; }
.log-table .log-msg { display: block; margin: 4px 0; }
.log-ctx { margin-top: 4px; font-size: .8125rem; }
.log-ctx summary { cursor: pointer; color: var(--link); width: max-content; }
.log-ctx dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 6px 0 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--fill); font-family: var(--mono); font-size: .75rem; }
.log-ctx dt { color: var(--text-3); }
.log-ctx dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.log-empty { padding: 20px; }
.log-timeline { list-style: none; margin: 0 0 12px; padding: 0; border-radius: var(--radius-md); background: var(--surface); overflow: hidden; }
.log-day { padding: 8px 14px; background: var(--bg-grouped); color: var(--text-2); font-size: .8125rem; font-weight: 600; position: sticky; top: env(safe-area-inset-top, 0px); }
.log-row { display: grid; grid-template-columns: 72px auto auto minmax(0, 1fr); align-items: baseline; gap: 4px 10px; padding: 7px 14px; border-top: 1px solid var(--separator); font-size: .875rem; }
.log-row-error { background: color-mix(in srgb, var(--danger) 5%, transparent); }
.log-row-warn { background: color-mix(in srgb, var(--warning) 5%, transparent); }
.log-time { font-family: var(--mono); font-size: .8125rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.log-body { min-width: 0; }
.log-meta { display: block; font-size: .75rem; color: var(--text-3); }
.log-meta a { color: inherit; text-decoration: underline; }
/* ---------- Status usług (/status) ---------- */
.alert-warning { background: color-mix(in srgb, var(--warning) 11%, var(--surface)); box-shadow: inset 3px 0 0 var(--warning); }
.status-banner { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-top: 20px; border-radius: var(--radius); background: var(--fill); text-align: left; }
.status-banner-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; }
.status-banner-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.status-banner-icon svg rect { fill: currentColor; stroke: none; }
.status-banner-text { min-width: 0; }
.status-banner-title { font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem; letter-spacing: -.01em; }
.status-banner-meta { margin-top: 2px; font-size: .8125rem; color: var(--text-2); }
.status-banner-ok { background: color-mix(in srgb, var(--success) 10%, var(--surface)); }
.status-banner-ok .status-banner-icon { background: var(--success); }
.status-banner-warn { background: color-mix(in srgb, var(--warning) 11%, var(--surface)); }
.status-banner-warn .status-banner-icon { background: var(--warning); }
.status-banner-bad { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.status-banner-bad .status-banner-icon { background: var(--danger); }
.status-banner-accent { background: color-mix(in srgb, var(--info) 10%, var(--surface)); }
.status-banner-accent .status-banner-icon { background: var(--info); }
.status-banner-muted .status-banner-icon { background: var(--text-3); }
.status-group + .status-group { margin-top: 16px; }
.status-group h2 { margin: 0 0 4px; font-size: 1.0625rem; }
.status-group-sub { margin: 0 0 4px; font-size: .8125rem; color: var(--text-2); }
.status-list { list-style: none; margin: 10px 0 0; padding: 0; }
.status-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; margin: 0 -4px; border-top: 1px solid var(--separator); }
.status-row:first-child { border-top: none; }
@media (hover: hover) { .status-row:hover { background: var(--row-hover); border-radius: var(--radius-sm); } }
.status-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.status-dot-ok { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 18%, transparent); }
.status-dot-warn { background: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 18%, transparent); }
.status-dot-bad { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
.status-dot-accent { background: var(--info); box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 18%, transparent); }
.status-dot-muted { background: var(--text-3); }
.status-name { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.status-sub { display: block; margin-top: 1px; font-size: .75rem; color: var(--text-3); font-weight: 400; }
.status-uptime { flex: none; font-size: .8125rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.status-foot { margin-top: 20px; }
@media (max-width: 640px) {
  .status-row { flex-wrap: wrap; }
  .status-uptime { order: 3; flex: 1 1 100%; padding-left: 21px; }
}

@media (max-width: 640px) {
  .log-row { grid-template-columns: auto auto minmax(0, 1fr); }
  .log-body { grid-column: 1 / -1; }
}
