/* Omni Menu WWW. Kolory, skala, promienie i fonty: zmienne z `tokens.css` (wygenerowane z crates/omni-theme/tokens.json).
   Ten plik nie ma żadnych kolorów motywów; przezroczystość składamy z `rgb(var(--x-rgb) / a)`. */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--raised) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--raised);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--hover);
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: var(--lh-ui);
  font-feature-settings: "tnum" 1;
  transition: background var(--motion);
}

/* Stopka o stałej wysokości przyklejona do dołu: `main` rośnie, stopka nie. */
body { display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; -webkit-text-size-adjust: 100%; }

[hidden] { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Fokus klawiatury na każdym elemencie interaktywnym (token: obrys 2 px w kolorze akcentu, odstęp 2 px) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-control); }
.input:focus-visible { outline: none; }

h1 { font-size: var(--fs-xxl); font-weight: 650; line-height: var(--lh-tight); letter-spacing: -0.015em; margin-bottom: var(--sp-2); }
h2 { font-size: var(--fs-lg); font-weight: 600; line-height: var(--lh-tight); margin-bottom: var(--sp-3); }
h3 { font-size: var(--fs-md); font-weight: 600; margin-bottom: 6px; }

.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.center { text-align: center; }
.mono { font-family: var(--font-log); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.bold { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- Nagłówek --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  min-height: 60px;
  padding: var(--sp-2) var(--sp-6);
  background: rgb(var(--bg-rgb) / 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

/* Wordmark „omni.”: krój marki, kropka w kolorze akcentu */
.brand { color: var(--text); font: 700 18px/1 var(--font-brand); letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand i { font-style: normal; color: var(--accent); }

.site-nav, .tabs { display: flex; gap: var(--sp-1); }
.site-nav a { white-space: nowrap; }
.site-nav a {
  padding: 6px var(--sp-3);
  border-radius: var(--r-control);
  color: var(--muted);
  font-weight: 500;
  transition: background var(--motion), color var(--motion);
}
.site-nav a:hover { background: var(--raised); color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); }

/* Zakładki panelu z podkreśleniem */
.tabs {
  margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tabs a {
  margin-bottom: -1px;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-color: var(--accent); }

.user-name { font-size: var(--fs-md); }

.theme-picker { display: flex; gap: var(--sp-1); }
.swatch {
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--accent);
  cursor: pointer;
  transition: transform var(--motion), border-color var(--motion);
}
.swatch:hover { transform: scale(1.12); }
.swatch[aria-checked="true"] { border-color: var(--text); }

/* Przełącznik języka PL/EN */
.lang {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--r-control);
  border: 1px solid var(--line);
}
.lang button {
  min-width: 36px;
  height: 28px;
  padding: 0 var(--sp-2);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { background: var(--raised); color: var(--text); }
.lang.floating { position: absolute; top: var(--sp-4); right: var(--sp-4); }

/* --- Układ --- */
.site-main { flex: 1 0 auto; width: 100%; max-width: 1100px; margin: 0 auto; padding: var(--sp-8) var(--sp-6) var(--sp-8); }
.site-footer {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 var(--sp-6);
  border-top: 1px solid var(--line);
}

.page-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: var(--sp-4); align-items: start; }
.page-stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.page-grid > * { min-width: 0; }
.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--sp-4); align-items: start; }
.split > * { min-width: 0; }

.page-title { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: space-between; align-items: flex-end; margin-bottom: var(--sp-4); }
.page-title h1 { margin: 0; font-size: var(--fs-xxl); }

.card {
  padding: var(--sp-4) var(--sp-6) var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.card.narrow { max-width: 440px; margin: var(--sp-6) auto; position: relative; }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); }
.card-head h1, .card-head h2 { margin: 0; }
.card > h2 { margin-top: var(--sp-2); }
.card-hint { margin: calc(var(--sp-1) * -1) 0 var(--sp-4); max-width: 72ch; font-size: var(--fs-sm); color: var(--muted); }
.back { color: var(--muted); font-size: var(--fs-md); }
.back:hover { color: var(--text); }
.crumbs { display: flex; gap: var(--sp-2); align-items: center; font-size: var(--fs-sm); color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }

/* --- Zwijane karty (components/collapse.rs) --- */
.collapse-title button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.collapse-title button:hover { color: var(--accent); }
.collapse-title button:focus-visible { outline-offset: 4px; border-radius: 4px; }
.chevron {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin: 0 2px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--motion);
}
.card.collapsed .chevron { transform: rotate(-45deg); }
.card.collapsed > :not(.card-head) { display: none !important; }
.card.collapsed > .card-head { margin-bottom: 0; }

/* --- Strona główna --- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--sp-8);
  align-items: end;
  padding: clamp(24px, 6vw, 72px) 0 var(--sp-8);
}
.hero > * { min-width: 0; }
.hero h1 { margin: 0 0 var(--sp-4); max-width: 18ch; font-size: clamp(30px, 4.2vw, 44px); line-height: 1.1; }
.lead { margin: 0 0 var(--sp-6); max-width: 46ch; font-size: var(--fs-lg); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.hero .fine { margin-top: var(--sp-3); }

/* Znak firmowy strony: lista gier składana krojem marki */
.games { list-style: none; border-top: 1px solid var(--line); }
.games li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); }
.games .g { font: 700 clamp(22px, 3vw, 34px)/1.05 var(--font-brand); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.games small { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.games .soon .g { color: var(--muted); }
.games .live small { color: var(--accent); }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); padding: var(--sp-8) 0; border-top: 1px solid var(--line); }
.facts h3 { font-size: var(--fs-lg); }
.facts p { max-width: 36ch; color: var(--muted); }

.demo { margin-bottom: var(--sp-8); }
.landing-download { margin-bottom: var(--sp-8); }
.download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4) var(--sp-6);
  padding: var(--sp-6);
}
.download-info { flex: 1 1 320px; min-width: 0; }
.download-info h2 { margin: 0 0 var(--sp-1); font-size: var(--fs-xl); font-weight: 650; }
.download-info p { margin: 0; }
.download-action { flex: 0 1 auto; }
.download-state { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3); }
.download-state .note { margin: 0; }
.demo-frame {
  height: 600px;
  max-width: 980px;
  margin: 0 auto var(--sp-2);
  border-radius: var(--r-window);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.5), 0 0 0 1px var(--line), 0 0 40px rgb(var(--accent-rgb) / 0.12);
  overflow: hidden;
}
.demo-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: transparent; }

/* --- Formularze --- */
.form { display: flex; flex-direction: column; gap: var(--sp-3); margin: var(--sp-3) 0; }
.form.inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.form.inline .field { flex: 1 1 180px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); color: var(--muted); }
.field > span, .field .field-label { color: var(--muted); font-weight: 500; font-size: var(--fs-sm); }
.field .field-hint, .field small { color: var(--muted); font-size: var(--fs-xs); }
.check { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--h-input); font-size: var(--fs-md); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.check.danger input { accent-color: var(--danger); }

.input {
  width: 100%;
  min-height: var(--h-input);
  padding: 0 var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color var(--motion), box-shadow var(--motion);
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.search { width: 300px; max-width: 100%; }
.input[type="date"] { color-scheme: dark; }
select.input {
  appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
textarea.input { min-height: 96px; padding: var(--sp-2) var(--sp-3); resize: vertical; }
.counter { align-self: flex-end; font-size: var(--fs-xs); color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: var(--h-control);
  padding: 0 var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--raised);
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--motion), border-color var(--motion), transform 60ms;
}
.btn:hover { background: var(--hover); color: var(--text); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn.danger { background: transparent; border-color: rgb(var(--danger-rgb) / 0.35); color: var(--danger); }
.btn.danger:hover { background: rgb(var(--danger-rgb) / 0.12); color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: transparent; color: var(--bg); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--raised); color: var(--text); }
.btn.lg { height: var(--h-control-lg); padding: 0 var(--sp-6); font-size: var(--fs-lg); }
.btn.sm, .btn-sm { height: 28px; padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.button-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }

.copy-field { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
.copy-field .input { min-width: 0; font-family: var(--font-log); font-size: 12.5px; }
.invite-result { margin-top: var(--sp-4); padding: var(--sp-4); border-radius: var(--r-control); background: var(--accent-soft); }
.invite-result p { margin-bottom: var(--sp-2); font-size: var(--fs-md); }

/* --- Komunikaty, plakietki, spinner --- */
.note { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-control); font-size: var(--fs-md); margin: var(--sp-2) 0; }
.note.error { background: rgb(var(--danger-rgb) / 0.14); color: var(--danger); }
.note.warn { background: rgb(var(--warn-rgb) / 0.14); color: var(--warn); }
.note.ok { background: rgb(var(--ok-rgb) / 0.12); color: var(--ok); }
.note.info { background: rgb(var(--info-rgb) / 0.12); color: var(--info); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  padding: 0 var(--sp-2);
  border-radius: var(--r-pill);
  background: var(--raised);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}
.badge.ok { background: rgb(var(--ok-rgb) / 0.14); color: var(--ok); }
.badge.warn { background: rgb(var(--warn-rgb) / 0.14); color: var(--warn); }
.badge.danger { background: rgb(var(--danger-rgb) / 0.14); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

.spinner-row { display: flex; align-items: center; gap: 10px; padding: var(--sp-3) 0; }
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--raised);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.spinner.small { width: 14px; height: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { padding: var(--sp-6) 0; text-align: center; color: var(--muted); }

/* --- Listy i tabele --- */
/* Dane w siatce: `<dl class="props"><div><dt/><dd/></div>…</dl>` */
.props { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-4); font-size: var(--fs-md); }
.props dt { font-size: var(--fs-sm); color: var(--muted); }
.props dd { min-width: 0; margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.actions-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--line); }

/* Wiersze listy (licencje, sesje, ogłoszenia): linia między wierszami zamiast ramek */
.list { list-style: none; display: flex; flex-direction: column; }
.list-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
}
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row > div:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list-row b { display: block; font-weight: 600; }
.row-end { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); flex: none; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.table th {
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.table td { padding: var(--sp-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgb(var(--raised-rgb) / 0.4); }
.table .actions { text-align: right; white-space: nowrap; }
.table .btn { height: 30px; font-size: var(--fs-sm); }
.table tr.clickable { cursor: pointer; }
.table td.empty { text-align: center; }
.table th.num { text-align: right; }
.user-link { color: var(--text); font-weight: 600; }
.user-link:hover { color: var(--accent); }
.sub-line { display: block; font-size: var(--fs-sm); color: var(--muted); font-weight: 400; }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: space-between; align-items: center; margin-bottom: var(--sp-3); }
.action-code { display: inline-block; padding: 1px 6px; border-radius: 5px; background: var(--raised); font-family: var(--font-log); font-size: 12px; }
.more { display: flex; justify-content: center; margin-top: var(--sp-4); }

/* --- Ogłoszenia: podgląd tego, co zobaczy gracz --- */
.preview { display: flex; flex-direction: column; gap: var(--sp-3); }
.preview .lbl { font-size: var(--fs-sm); color: var(--muted); }
.pv-launcher {
  padding: var(--sp-3);
  border-radius: var(--r-card);
  font-size: var(--fs-sm);
  background: rgb(var(--info-rgb) / 0.1);
  border: 1px solid rgb(var(--info-rgb) / 0.3);
  overflow-wrap: anywhere;
}
.pv-launcher.warn { background: rgb(var(--warn-rgb) / 0.1); border-color: rgb(var(--warn-rgb) / 0.3); }
.pv-toast {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px var(--sp-3);
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-card);
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}
.pv-toast i { grid-row: span 2; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.pv-toast.warn i { background: var(--warn); }

/* --- Okna dialogowe (components/modal.rs, confirm.rs) --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: var(--sp-4);
  background: rgb(0 0 0 / 0.6);
  backdrop-filter: blur(4px);
  animation: modal-fade-in 160ms ease-out;
}
.modal-content {
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.8);
  animation: modal-scale-in 160ms ease-out;
}
.modal-content.wide { width: min(640px, 100%); }
.modal-content h2 { margin: 0 0 var(--sp-2); }
.modal-content > p { margin: 0 0 var(--sp-4); color: var(--muted); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); }
.modal-close { width: 30px; padding: 0; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); margin-top: var(--sp-6); }
.modal-check { margin-bottom: var(--sp-2); font-size: var(--fs-sm); }
.modal-code-box {
  margin: 0;
  padding: var(--sp-3);
  max-height: 260px;
  overflow: auto;
  border-radius: var(--r-control);
  background: var(--bg);
  border: 1px solid var(--line);
  font: 12.5px/1.5 var(--font-log);
  white-space: pre-wrap;
  word-break: break-all;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modal-scale-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

/* Toast z akcją w czasie przeszłym; nad stopką */
.toast-region { position: fixed; z-index: 1100; right: var(--sp-4); bottom: calc(56px + var(--sp-4)); max-width: calc(100vw - 2 * var(--sp-4)); }
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px -20px rgb(0 0 0 / 0.8);
  animation: modal-fade-in 160ms ease-out;
}
.toast i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

/* --- Węższe ekrany --- */
@media (max-width: 820px) {
  .hero, .split { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; gap: var(--sp-4); }
}

/* --- Telefony --- */
@media (max-width: 640px) {
  h1 { font-size: 22px; }

  /* Nagłówek: logo, język i konto w pierwszym wierszu, nawigacja w drugim (przewijana w poziomie);
     motyw jest wtedy w profilu. */
  .site-header { gap: var(--sp-2) var(--sp-3); padding: var(--sp-2) var(--sp-4); }
  .site-header .spacer { display: none; }
  .site-header .theme-picker, .user-name { display: none; }
  .site-header .lang { margin-left: auto; }
  .site-header > .btn { height: 32px; padding: 0 var(--sp-3); }
  .site-nav {
    order: 10;
    width: calc(100% + 32px);
    margin: 0 -16px -8px;
    padding: 6px var(--sp-4);
    border-top: 1px solid var(--line);
    overflow-x: auto;
  }
  .site-nav:empty { display: none; }
  .tabs { margin: 0 -16px var(--sp-4); padding: 0 var(--sp-4); }

  .site-main { padding: var(--sp-4) var(--sp-4) var(--sp-6); }
  .site-footer { padding: 0 var(--sp-4); }
  .card { padding: var(--sp-4); }
  .card.narrow { margin: var(--sp-2) auto; }
  .card-head .input.search, .toolbar .input.search { width: 100%; }

  .hero { padding-top: var(--sp-2); }
  .hero h1 { font-size: 30px; }
  .lead { font-size: var(--fs-md); }
  .hero-actions .btn { flex: 1 1 140px; }
  .demo-frame { height: min(75vh, 560px); border-radius: 10px; }
  .download-action, .download-action .btn { width: 100%; }

  /* iOS powiększa stronę przy fokusie pola z fontem < 16px. */
  .input, select, textarea { font-size: 16px; }
  .form.inline { flex-direction: column; align-items: stretch; }
  .form.inline .field { flex: 1 1 auto; }
  .form.inline > .btn { width: 100%; }
  .button-row .btn { flex: 1 1 auto; }
  .copy-field { flex-wrap: wrap; }
  .copy-field .input { flex: 1 1 100%; }
  .copy-field .btn { flex: 1 1 auto; }

  .list-row { flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); }
  .list-row > div:first-child { flex: 1 1 100%; }

  .table-wrap { margin: 0 calc(var(--sp-4) * -1); padding: 0 var(--sp-4); }
  .table { font-size: var(--fs-sm); }
  .table th, .table td { padding: var(--sp-2) 6px; }
  .table td { white-space: nowrap; }

  /* Tabela jako karty: każdy wiersz to blok z etykietami z `data-label` (tylko `.table.responsive`) */
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; }
  .table.responsive { font-size: var(--fs-md); }
  .table.responsive thead { display: none; }
  .table.responsive tr { padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); }
  .table.responsive tbody tr:last-child { border-bottom: 0; }
  .table.responsive td { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 2px 0; border: 0; text-align: right; white-space: normal; }
  .table.responsive td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: var(--fs-sm); text-align: left; }
  .table.responsive td.actions { justify-content: flex-start; margin-top: var(--sp-2); }
  .table.responsive td.actions::before, .table.responsive td[data-label=""]::before { content: none; }
  .table.responsive td.empty { display: block; text-align: center; }
  .table.responsive tbody tr:hover td { background: none; }

  .modal-backdrop { padding: 0; align-items: end; }
  .modal-content, .modal-content.wide { width: 100%; max-height: 92vh; border-radius: var(--r-window) var(--r-window) 0 0; padding: var(--sp-4); }
  .modal-actions .btn { flex: 1 1 auto; }
  .toast-region { left: var(--sp-4); }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 26px; }
}

/* Bez animacji u osób, które o to poprosiły (token: przy `prefers-reduced-motion` wszystko staje) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .spinner { animation: spin 1.6s linear infinite !important; }
}
