/* ─── Skryba: atrament na porcelanie ─────────────────────────── */
:root {
  --paper: #f5f6f8;
  --card: #ffffff;
  --ink: #15171f;
  --muted: #6c7180;
  --line: #e3e5eb;
  --accent: #2b44e7;
  --accent-dark: #1f34bd;
  --accent-soft: #e8ecfe;
  --danger: #c02942;
  --danger-soft: #fbe9ec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(21, 23, 31, .05), 0 8px 24px rgba(21, 23, 31, .06);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font-body); cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .65; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }

/* ─── szyna nawigacji (sygnatura) ────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.rail {
  width: 72px;
  flex: 0 0 72px;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  transition: width .2s, flex-basis .2s;
}
.rail-logo { display: block; margin-bottom: 14px; }
.rail-logo svg { display: block; }
.rail-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .34em;
  color: #fff;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  margin-bottom: auto;
  user-select: none;
}
.rail-links { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.rail-links a, .rail-logout, .rail-toggle {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  color: #9aa0b5;
  transition: background .15s, color .15s;
}
.rail-toggle { border: 0; background: transparent; margin-bottom: 4px; flex: 0 0 auto; }
.rail-links a:hover, .rail-logout:hover, .rail-toggle:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.rail-links a.active { color: #fff; background: var(--accent); }
.nav-label { display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

html.rail-expanded .rail { width: 230px; flex-basis: 230px; align-items: stretch; padding-inline: 14px; }
html.rail-expanded .rail-logo { align-self: flex-start; margin-left: 6px; }
html.rail-expanded .rail-word {
  writing-mode: horizontal-tb;
  transform: none;
  margin: -42px 0 30px 50px;
  letter-spacing: .18em;
  color: #fff;
}
html.rail-expanded .rail-links { width: 100%; margin-bottom: auto; }
html.rail-expanded .rail-links a,
html.rail-expanded .rail-logout,
html.rail-expanded .rail-toggle {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding: 0 12px;
}
html.rail-expanded .rail-links svg,
html.rail-expanded .rail-logout svg,
html.rail-expanded .rail-toggle svg { flex: 0 0 auto; }
html.rail-expanded .nav-label { display: block; font-size: 13px; font-weight: 600; }
html.rail-expanded .rail-toggle svg { transform: rotate(180deg); }

.main {
  flex: 1;
  min-width: 0;
  padding: 34px clamp(20px, 4vw, 56px) 60px;
  max-width: 1480px;
}

/* ─── nagłówek strony ────────────────────────────────────────── */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.page-head h1 { font-size: clamp(26px, 3.4vw, 36px); margin-top: 4px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.btn-small { padding: 6px 10px; font-size: 12px; }

/* ─── przyciski ──────────────────────────────────────────────── */
.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { background: #a9b3ef; cursor: default; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #fff; border-color: #c9ccd6; }
.btn-block { width: 100%; }

/* ─── karty dokumentów ───────────────────────────────────────── */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}
.doc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow .15s, border-color .15s;
}
.doc-card:hover { text-decoration: none; box-shadow: var(--shadow); border-color: #d3d6de; }
.doc-card h3 { font-size: 17px; }
.doc-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.doc-card time { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: auto; }
.doc-card-top { display: flex; justify-content: space-between; align-items: center; }
.doc-delete {
  background: none; border: none; color: var(--muted);
  padding: 5px; border-radius: 8px; line-height: 0;
}
.doc-delete:hover { color: var(--danger); background: var(--danger-soft); }

.tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.tag-translate { background: #e6f5ee; color: #14724a; }
.tag-rewrite { background: #fdf1e2; color: #9a5b12; }
.tag-style { background: #f3e8fd; color: #6d28b8; }

.empty {
  text-align: center;
  padding: 90px 20px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
}
.empty h2 { margin: 14px 0 6px; }
.empty p { color: var(--muted); max-width: 420px; margin: 0 auto 22px; }

/* ─── logowanie / rejestracja ────────────────────────────────── */
.auth-body {
  background:
    radial-gradient(700px 420px at 12% -8%, var(--accent-soft), transparent 65%),
    var(--paper);
}
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 32px 18px;
}
.auth-brand { text-align: center; }
.auth-brand h1 {
  font-size: 42px;
  letter-spacing: .18em;
  margin-top: 8px;
}
.auth-brand p { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 30px 28px;
}
.auth-card h2 { font-size: 23px; margin: 6px 0 18px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-switch { margin: 18px 0 0; font-size: 13.5px; color: var(--muted); text-align: center; }

.alert {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13.5px;
  margin-bottom: 14px;
}

/* ─── pola formularzy ────────────────────────────────────────── */
label { display: block; font-size: 13px; font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: 400 14px var(--font-body);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ─── edytor ─────────────────────────────────────────────────── */
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 22px;
  align-items: start;
}
.doc-pane {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 26px 26px;
  min-height: calc(100vh - 130px);
  display: flex;
  flex-direction: column;
}
.doc-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.doc-actions { display: flex; align-items: center; gap: 8px; }
.word-count { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-right: 4px; }
.featured-image-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background:
    radial-gradient(180px 90px at 100% 0%, rgba(43,68,231,.09), transparent 72%),
    var(--paper);
}
.featured-image-preview {
  display: grid;
  place-items: center;
  width: 92px;
  height: 60px;
  overflow: hidden;
  border-radius: 9px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #d5dbfd;
}
.featured-image-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.featured-image-copy { display: flex; flex-direction: column; min-width: 0; }
.featured-image-copy b { font-size: 13px; }
.featured-image-copy small {
  color: var(--muted);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.featured-image-copy .eyebrow { margin-bottom: 2px; font-size: 9px; }
.featured-image-card .btn { padding: 6px 9px; font-size: 11px; white-space: nowrap; }
.featured-image-picker { margin: -8px 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.featured-image-picker-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 11px; }
.featured-image-picker-head > div { display: flex; flex-direction: column; gap: 2px; }
.featured-image-picker-head small { color: var(--muted); }
.featured-image-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.featured-image-option { padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; }
.featured-image-option:hover { border-color: var(--accent); }
.featured-image-option img { width: 100%; aspect-ratio: 4/3; display: block; object-fit: cover; }
.featured-image-option span { display: block; padding: 7px 8px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 800px) { .featured-image-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.doc-title {
  border: none !important;
  box-shadow: none !important;
  padding: 4px 0 !important;
  font: 700 clamp(22px, 2.6vw, 30px)/1.2 var(--font-display) !important;
  background: transparent !important;
}
.doc-title::placeholder { color: #c4c7d1; }
.doc-content {
  flex: 1;
  border: none !important;
  box-shadow: none !important;
  padding: 10px 0 !important;
  font-size: 15.5px !important;
  line-height: 1.75 !important;
  background: transparent !important;
  min-height: 420px;
}
.doc-content::placeholder { color: #c4c7d1; }

/* panel asystenta */
.assist-pane {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.assist-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.assist-model {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--danger);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assist-model.ok { color: var(--muted); }

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: var(--paper);
  border-radius: 11px;
  padding: 4px;
  margin-bottom: 16px;
}
.mode-tab {
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.mode-tab:hover { color: var(--ink); }
.mode-tab.active { background: var(--ink); color: #fff; }

.mode-form { display: none; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.mode-form.active { display: flex; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  font-size: 15px;
}
.gen-spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.assist-error {
  margin-top: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13px;
}

.result { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.result-head .btn { padding: 6px 10px; font-size: 12.5px; }
#result-text {
  margin: 0;
  white-space: pre-wrap;
  font: 400 13.5px/1.65 var(--font-body);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  max-height: 340px;
  overflow-y: auto;
}

/* ─── ustawienia ─────────────────────────────────────────────── */
.settings-card {
  max-width: 560px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}
.notice svg { flex: 0 0 auto; margin-top: 1px; }
.key-field { display: flex; gap: 8px; margin-top: 6px; }
.key-field input { margin-top: 0; flex: 1; }
.key-toggle { flex: 0 0 auto; font-size: 12.5px; padding: 8px 12px; }
.settings-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }
.settings-saved { color: #14724a; font-size: 13.5px; font-weight: 600; margin: 0; }
.backup-card { margin-top: 20px; }
.backup-card h2 { margin: 4px 0 0; }
.backup-warning { color: var(--danger); background: var(--danger-soft); border-color: #efbdc6; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.backup-file-button { cursor: pointer; }
.site-name-link { color: inherit; text-decoration: none; }
.site-name-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.team-api-settings { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.team-api-settings h3 { margin: 3px 0 0; }
.team-key-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.team-api-form { display: grid; gap: 14px; margin-top: 14px; }

/* ─── responsywność ──────────────────────────────────────────── */
@media (max-width: 1060px) {
  .editor-layout { grid-template-columns: 1fr; }
  .assist-pane { position: static; max-height: none; }
  .doc-pane { min-height: auto; }
}
@media (max-width: 640px) {
  .shell { flex-direction: column; }
  .rail {
    width: 100%;
    height: auto;
    flex-direction: row;
    padding: 10px 16px;
    position: static;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .rail::-webkit-scrollbar { display: none; }
  .rail-word { display: none; }
  .rail-logo { margin: 0 auto 0 0; }
  .rail-links { flex-direction: row; margin: 0 8px 0 0; }
  .rail-toggle { display: none; }
  html.rail-expanded .rail { width: 100%; height: auto; flex-direction: row; padding: 10px 16px; }
  html.rail-expanded .rail-logo { margin: 0 auto 0 0; }
  html.rail-expanded .rail-word, html.rail-expanded .nav-label { display: none; }
  html.rail-expanded .rail-links { width: auto; flex-direction: row; margin: 0 8px 0 0; }
  html.rail-expanded .rail-links a, html.rail-expanded .rail-logout {
    width: 42px; height: 42px; padding: 0; justify-content: center;
  }
  .main { padding: 22px 16px 48px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .field-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ─── v2: wspólne drobiazgi ──────────────────────────────────── */
.page-sub { color: var(--muted); max-width: 640px; margin: -14px 0 24px; font-size: 14px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 13px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
}
.chip:hover { text-decoration: none; border-color: #c9ccd6; color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto; }
.doc-meta time { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.mini-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
}
.mini-badge.team { background: var(--accent-soft); border-color: transparent; color: var(--accent-dark); }
.mini-badge.success { background: #e6f5ee; border-color: transparent; color: #14724a; }
.assist-desc { font-size: 13px; color: var(--muted); margin: 0 0 4px; line-height: 1.5; }

/* ─── kreator (wizard) ───────────────────────────────────────── */
.wizard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px clamp(18px, 3vw, 34px) 22px;
  max-width: 880px;
}
.wiz-steps {
  list-style: none;
  display: flex;
  gap: 6px;
  padding: 0;
  margin: 0 0 28px;
}
.wiz-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding-bottom: 12px;
  border-bottom: 3px solid var(--line);
  transition: border-color .2s, color .2s;
}
.wiz-step b {
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}
.wiz-step.active { color: var(--ink); border-color: var(--accent); }
.wiz-step.active b { background: var(--accent); color: #fff; }

.wiz-panel { display: none; }
.wiz-panel.active { display: block; animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } }
.wiz-panel h2 { font-size: 22px; margin-bottom: 6px; }
.wiz-sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.wiz-hint { font-size: 13px; color: var(--muted); margin-top: 16px; }
.wiz-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* krok 1: wybór strony */
.site-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.site-option {
  text-align: left;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .15s, background .15s;
}
.site-option:hover { border-color: #c9ccd6; }
.site-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.site-option-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.site-option-meta { font-size: 12px; color: var(--muted); }

/* krok 2: tematy */
.topic-split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: start;
}
.topic-split > div { display: flex; flex-direction: column; gap: 12px; }
.topic-or {
  align-self: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
}
.topic-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.topic-card {
  text-align: left;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .15s, background .15s;
}
.topic-card:hover { border-color: #c9ccd6; }
.topic-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.topic-card-title { font-weight: 600; font-size: 14px; }
.topic-card-kw { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* krok 3: styl */
.wiz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.element-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.element-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 13px;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  background: var(--card);
  cursor: pointer;
  user-select: none;
  transition: border-color .15s, background .15s;
}
.element-chip:hover { border-color: #c9ccd6; }
.element-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.element-chip input { accent-color: var(--accent); margin: 0; }

/* krok 4 */
.wiz-generating { text-align: center; padding: 26px 0; }
.summary-card {
  max-width: 460px;
  margin: 20px auto 0;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 15px;
  font-size: 13.5px;
}
.summary-row:nth-child(odd) { background: var(--paper); }
.summary-row span { color: var(--muted); flex: 0 0 auto; }
.summary-row b { font-weight: 600; text-align: right; }
.big-spinner {
  width: 44px; height: 44px;
  margin: 0 auto 18px;
  border: 4px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ─── quill ──────────────────────────────────────────────────── */
#quill-editor { flex: 1; display: flex; flex-direction: column; min-height: 420px; }
.ql-toolbar.ql-snow {
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 8px 0 12px;
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 5;
}
.ql-container.ql-snow { border: none; flex: 1; font-family: var(--font-body); font-size: 15.5px; }
.ql-editor { padding: 18px 2px; line-height: 1.75; min-height: 380px; }
#quill-editor .ql-editor p { margin: 0 0 1em; }
#quill-editor .ql-editor p:last-child { margin-bottom: 0; }
.ql-editor h2, .ql-editor h3, .ql-editor h4 { font-family: var(--font-display); margin: 1.2em 0 .5em; }
.ql-editor img { max-width: 100%; border-radius: 10px; margin: 8px 0; }
.ql-editor blockquote { border-left: 3px solid var(--accent); color: var(--muted); }
.ql-snow .ql-picker.ql-header { font-family: var(--font-body); }

/* ─── panel grafik ───────────────────────────────────────────── */
.img-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.img-thumb {
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  background: var(--paper);
  aspect-ratio: 4 / 3;
  transition: border-color .15s, transform .1s;
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-thumb:hover { border-color: var(--accent); transform: scale(1.02); }
.img-thumb.inserted { border-color: #14724a; }
.img-loading { grid-column: 1 / -1; font-size: 13px; color: var(--muted); text-align: center; padding: 14px 0; }
.result-preview {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  max-height: 340px;
  overflow-y: auto;
  font-size: 13.5px;
  line-height: 1.65;
}
.result-preview p { margin: 0 0 1em; }
.result-preview p:last-child { margin-bottom: 0; }
.result-preview h1, .result-preview h2, .result-preview h3 { font-size: 1.1em; margin: .8em 0 .3em; }
.result-preview img { max-width: 100%; border-radius: 8px; }

/* ─── modal ──────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(21, 23, 31, .45);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(21,23,31,.25);
  padding: 26px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 { margin-bottom: 18px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-head h2 { margin: 3px 0 0; }
.modal form { display: flex; flex-direction: column; gap: 14px; }

/* ─── strony / zespoły ───────────────────────────────────────── */
.site-card { cursor: default; }
.site-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 24px;
  align-items: start;
}
.site-list { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.site-form-card { max-width: none; position: sticky; top: 24px; }
.site-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.site-card-actions .btn { padding: 6px 12px; font-size: 12.5px; }
.settings-divider { border: none; border-top: 1px solid var(--line); margin: 6px 0; }

.team-create-row { display: flex; gap: 10px; }
.team-create-row input { margin-top: 0; flex: 1; }
.team-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  max-width: 640px;
  margin-bottom: 16px;
}
.team-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.team-card h3 { font-size: 19px; }
.member-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.member-list li { display: flex; align-items: center; gap: 10px; }
.member-avatar {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  flex: 0 0 auto;
}
.member-email { font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.member-add { display: flex; gap: 8px; }
.member-add input { margin-top: 0; flex: 1; }
.member-add select, .member-role { margin-top: 0; width: auto; min-width: 120px; padding: 7px 9px; }
.setting-check { border-radius: 10px; align-items: flex-start; }
.setting-check input { margin-top: 3px; flex: 0 0 auto; }
.source-download-limit { margin-top: 0; width: auto; padding: 7px 9px; font-size: 12px; }
.wp-publish-modal { max-width: 680px; }
.wp-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 8px;
}
.field-label { font-size: 13px; font-weight: 600; }
.wp-category-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* ─── tematy, kolejka i źródła ───────────────────────────────── */
.content-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .8fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}
.content-split.single-view > * { grid-column: 1 / -1; }
.wide-card { max-width: none; }
.compact { grid-template-columns: 1fr; margin-top: 0; }
.compact .topic-card { flex-direction: row; align-items: flex-start; cursor: pointer; }
.compact .topic-card input { margin-top: 4px; accent-color: var(--accent); }
.compact .topic-card span { display: flex; flex-direction: column; gap: 2px; }
.compact .topic-card small { color: var(--muted); }
.queue-panel, .table-card, .source-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.queue-panel { padding: 22px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-head h2 { margin-top: 3px; font-size: 21px; }
.queue-list, .data-list { display: flex; flex-direction: column; }
.queue-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.queue-row:last-child { border-bottom: none; }
.queue-row div, .data-main { min-width: 0; display: flex; flex-direction: column; }
.queue-row b, .data-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.queue-row small, .data-main small, .muted { color: var(--muted); font-size: 12px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #a8adba; }
.status-generating { background: #d89519; box-shadow: 0 0 0 4px #fdf1e2; }
.status-done { background: #1e9a64; }
.status-error { background: var(--danger); }
.queue-progress { margin: 8px 0 12px; }
.queue-progress p { margin: 5px 0; color: var(--muted); font-size: 12px; }
.queue-progress-bar { height: 7px; border-radius: 99px; background: var(--paper); overflow: hidden; }
.queue-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #7c5cff);
  transition: width .25s;
}
.queue-page-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.danger-ghost { color: var(--danger); }
.danger-ghost:hover { background: var(--danger-soft); border-color: #efbdc6; }
.queue-command-panel {
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(320px 160px at 100% 0%, rgba(43,68,231,.13), transparent 70%),
    var(--card);
}
.queue-command-head { padding: 20px 20px 13px; }
.queue-command-title { display: flex; align-items: center; gap: 12px; }
.queue-command-title h2 { font-size: 21px; margin-top: 2px; }
.queue-command-title p { color: var(--muted); font-size: 11.5px; line-height: 1.45; margin: 4px 0 0; }
.queue-page-visual, .queue-visual {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--accent);
  background: linear-gradient(145deg, #fff, var(--accent-soft));
  border: 1px solid #d9defd;
  box-shadow: 0 7px 18px rgba(43,68,231,.12);
}
.queue-page-visual { width: 50px; height: 50px; border-radius: 15px; }
.queue-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 20px 16px;
}
.queue-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.76);
}
.queue-stat > span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font: 700 12px var(--font-mono);
}
.queue-stat strong { font: 700 17px/1 var(--font-display); }
.queue-stat small { color: var(--muted); font-size: 9.5px; line-height: 1.1; }
.queue-stat.pending > span { color: var(--accent); background: var(--accent-soft); }
.queue-stat.working > span { color: #a66512; background: #fdf1e2; }
.queue-stat.success > span { color: #14724a; background: #e6f5ee; }
.queue-stat.failed > span { color: var(--danger); background: var(--danger-soft); }
.queue-command-panel > .queue-progress { margin: 0 20px 12px; }
.queue-page-message { margin: 0 20px 10px; }
.queue-page-list { border-top: 1px solid var(--line); }
.queue-page-row {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  transition: background .15s;
}
.queue-page-row:hover { background: rgba(245,246,248,.72); }
.queue-page-row:last-child { border-bottom: 0; }
.queue-page-row .queue-row-copy { min-width: 0; }
.queue-row-copy b { font-size: 12.5px; }
.queue-row-copy small { color: var(--muted); font-size: 10.5px; }
.queue-row-copy em {
  color: var(--danger);
  font-size: 10px;
  font-style: normal;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.queue-job-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--paper);
  color: var(--accent);
  font: 700 12px var(--font-mono);
}
.status-card-generating .queue-job-icon { color: #a66512; background: #fdf1e2; }
.status-card-done .queue-job-icon { color: #14724a; background: #e6f5ee; }
.status-card-error .queue-job-icon { color: var(--danger); background: var(--danger-soft); }
.queue-status-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 99px;
  background: var(--paper);
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}
.queue-status-generating { color: #9a5b12; background: #fdf1e2; }
.queue-status-done { color: #14724a; background: #e6f5ee; }
.queue-status-error { color: var(--danger); background: var(--danger-soft); }
.queue-row-actions { display: inline-flex; align-items: center; gap: 4px; }
.queue-mini-action {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
  font: 600 16px/1 var(--font-body);
}
a.queue-mini-action:hover { text-decoration: none; }
.queue-mini-action:hover { background: var(--accent-soft); color: var(--accent); }
.queue-mini-action.remove:hover { background: var(--danger-soft); color: var(--danger); }
.queue-mini-action.retry { color: #9a5b12; background: #fdf1e2; }
.queue-mini-action.open { color: #14724a; background: #e6f5ee; font-size: 12px; }
.queue-live-pulse {
  width: 10px;
  height: 10px;
  margin: 8px;
  border-radius: 50%;
  background: #d89519;
  box-shadow: 0 0 0 0 rgba(216,149,25,.38);
  animation: queuePulse 1.5s infinite;
}
@keyframes queuePulse {
  70% { box-shadow: 0 0 0 7px rgba(216,149,25,0); }
  100% { box-shadow: 0 0 0 0 rgba(216,149,25,0); }
}
.table-card { padding: 22px; margin-top: 20px; }
.content-table-wrap { overflow-x: auto; padding: 0; margin-top: 0; }
.content-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  text-align: left;
}
.content-table th {
  padding: 11px 14px;
  background: var(--paper);
  color: var(--muted);
  font: 500 10.5px var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.content-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 13px;
}
.content-table tbody tr:last-child td { border-bottom: 0; }
.content-table tbody tr:hover { background: #fafbfc; }
.content-table td > small {
  display: block;
  max-width: 440px;
  margin-top: 3px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-title { color: var(--ink); font-weight: 600; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; white-space: nowrap; }
.table-actions .btn { padding: 6px 10px; font-size: 12px; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
}
.pagination .disabled { opacity: .45; pointer-events: none; }
.compact-pagination { margin: 12px 0 0; }
.compact-pagination .btn { padding: 5px 10px; }
.filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(140px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 16px;
  margin-bottom: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.data-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(150px, 220px) auto auto;
  gap: 13px;
  align-items: center;
  padding: 12px 4px;
  border-top: 1px solid var(--line);
  font-weight: 400;
}
.data-row > select { margin-top: 0; padding: 7px 9px; font-size: 12.5px; }
.data-row > input { accent-color: var(--accent); }
.source-form { margin-bottom: 22px; }
.source-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: -10px 0 20px;
}
.analysis-report {
  border: 1px solid #cfd6fa;
  background: var(--accent-soft);
  border-radius: 11px;
  padding: 13px 15px;
  font-size: 12.5px;
}
.analysis-report p { margin: 5px 0 0; }
.analysis-report ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }
.analysis-report .analysis-warning { color: #8a5a0a; }
.advanced-source-fields {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 14px;
}
.advanced-source-fields summary {
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.advanced-source-fields .wiz-grid { padding: 2px 12px 14px; }
.inline-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
.source-card { padding: 19px; display: flex; flex-direction: column; gap: 9px; }
.source-card h3 { font-size: 18px; }
.source-card p { margin: 0; color: var(--muted); font-size: 13px; }
.source-card > a { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-card details { background: var(--paper); padding: 8px 10px; border-radius: 8px; font-size: 12px; }
.source-card code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.source-error-text { color: var(--danger) !important; }
.tag-queued, .tag-generating { background: #fdf1e2; color: #9a5b12; }
.tag-generated, .tag-imported, .tag-done { background: #e6f5ee; color: #14724a; }
.tag-error { background: var(--danger-soft); color: var(--danger); }

/* ─── pulpit / centrum strony ───────────────────────────────── */
.dashboard-head { align-items: center; margin-bottom: 22px; }
.dashboard-head p { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.dashboard-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.site-switcher {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 13px;
  position: sticky;
  top: 24px;
}
.site-switcher-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 5px 10px;
}
.site-switcher-list { display: flex; flex-direction: column; gap: 4px; }
.site-switcher-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  transition: background .15s, border-color .15s;
}
.site-switcher-item:hover { text-decoration: none; background: var(--paper); }
.site-switcher-item.active { background: var(--accent-soft); border-color: #cbd3ff; color: var(--accent-dark); }
.site-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font: 700 14px var(--font-display);
  flex: 0 0 auto;
}
.site-switcher-item.active .site-avatar { background: var(--accent); }
.site-avatar.large { width: 48px; height: 48px; border-radius: 13px; font-size: 19px; }
.site-switcher-copy, .row-copy { min-width: 0; display: flex; flex-direction: column; }
.site-switcher-copy b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-switcher-copy small { color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-chevron { color: #9ca1af; font-size: 18px; line-height: 1; }
.site-add-link {
  display: block;
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding: 11px 8px 2px;
  font-size: 12.5px;
  font-weight: 600;
}
.command-center { min-width: 0; }
.site-overview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}
.site-overview-main { display: flex; align-items: center; gap: 13px; min-width: 0; }
.site-overview-main .site-avatar { background: var(--accent); }
.site-overview-main h2 { font-size: 21px; }
.site-overview-main p { margin: 3px 0 0; color: #aeb4c5; font-size: 12px; }
.site-overview-main a { display: inline-block; color: #cbd3ff; font-size: 11.5px; margin-top: 2px; }
.overview-title-line { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 99px;
  padding: 3px 8px;
  color: #bfc4d2;
  font-size: 10px;
}
.connection-pill span { width: 6px; height: 6px; border-radius: 50%; background: #858b9b; }
.connection-pill.connected { color: #9ee1c2; border-color: rgba(92,205,151,.28); }
.connection-pill.connected span { background: #48bd82; }
.overview-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.site-overview-card .btn-ghost { color: #fff; border-color: rgba(255,255,255,.2); }
.site-overview-card .btn-ghost:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.35); }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.metric-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.metric-card:hover { text-decoration: none; border-color: #c9ccd6; transform: translateY(-1px); box-shadow: var(--shadow); }
.metric-card > span:not(.metric-icon) { display: flex; flex-direction: column; min-width: 0; }
.metric-card strong { font: 700 21px/1 var(--font-display); }
.metric-card small { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.metric-card em {
  position: absolute;
  top: 8px;
  right: 9px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}
.metric-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font: 600 17px var(--font-display);
  flex: 0 0 auto;
}
.metric-blue { color: var(--accent); background: var(--accent-soft); }
.metric-amber { color: #a66512; background: #fdf1e2; }
.metric-green { color: #14724a; background: #e6f5ee; }
.metric-violet { color: #6d28b8; background: #f3e8fd; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dashboard-card {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 17px;
}
.dashboard-card-wide { grid-column: 1 / -1; }
.compact-head { margin-bottom: 8px; }
.compact-head h2 { font-size: 17px; margin-top: 2px; }
.compact-head > a { font-size: 11.5px; font-weight: 600; }
.compact-list { display: flex; flex-direction: column; }
.compact-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 2px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
a.compact-row:hover { text-decoration: none; background: #fafbfc; }
.row-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
  font: 600 11px var(--font-mono);
}
.row-copy b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-copy small { color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-empty { padding: 24px 12px; text-align: center; color: var(--muted); }
.card-empty p { margin: 0 0 5px; font-size: 12.5px; }
.card-empty a { font-size: 12px; font-weight: 600; }
.two-column-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
.downloaded-row .row-copy { color: var(--ink); }
.downloaded-row .row-copy:hover { text-decoration: none; }
.downloaded-actions { display: flex; align-items: center; gap: 6px; }
.compact-action { padding: 5px 8px; font-size: 10.5px; white-space: nowrap; }
.action-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 14px;
  border-radius: 11px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 14px 40px rgba(21,23,31,.24);
  font-size: 12.5px;
  transform: translateX(-50%);
}
.action-toast.error { background: #721c2d; }
.action-toast a { color: #fff; font-weight: 700; text-decoration: underline; white-space: nowrap; }
.single-rewrite.is-loading { position: relative; }
.wp-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(220px, .8fr); gap: 22px; }
.wp-dashboard-grid h3 { font-size: 13px; margin: 5px 0 8px; }
.wp-post-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 2px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.wp-post-row:hover { text-decoration: none; }
.wp-post-row > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.wp-post-row b { font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wp-post-row small { color: var(--muted); font-size: 10.5px; }
.category-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.category-chip {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
}
.wp-state { min-height: 100px; display: grid; place-items: center; align-content: center; color: var(--muted); }
.wp-state p { margin: 8px 0 0; font-size: 12px; }
.small-spinner {
  width: 22px; height: 22px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.dashboard-welcome {
  min-height: 440px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 1.5px dashed #cfd2dc;
  border-radius: var(--radius);
  background: rgba(255,255,255,.45);
  padding: 30px;
}
.dashboard-welcome h2, .dashboard-first-run h2 { margin: 10px 0 7px; font-size: 24px; }
.dashboard-welcome p { max-width: 480px; color: var(--muted); margin: 0; font-size: 13.5px; }
.welcome-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 25px var(--font-display);
  margin-bottom: 13px;
}
.dashboard-first-run .welcome-mark { margin-inline: auto; }

/* ─── globalny widget kolejki ───────────────────────────────── */
.queue-dock {
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
}
.queue-dock-toggle {
  order: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 13px;
  background: linear-gradient(135deg, var(--ink), #292d3b);
  color: #fff;
  box-shadow: 0 10px 28px rgba(21,23,31,.22);
  font-weight: 600;
}
.queue-dock-toggle:hover { background: #242733; }
.queue-dock.open .queue-dock-toggle { box-shadow: 0 0 0 3px var(--accent-soft), 0 10px 28px rgba(21,23,31,.22); }
.queue-dock-toggle b {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent);
  font: 600 10px var(--font-mono);
}
.queue-drawer {
  width: min(410px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 90px));
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 20px 60px rgba(21,23,31,.24);
  padding: 0;
}
.queue-drawer[hidden] { display: none; }
.queue-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 17px 12px;
  background:
    radial-gradient(170px 100px at 80% 0%, rgba(43,68,231,.15), transparent 72%),
    #fff;
}
.queue-drawer-title { display: flex; align-items: center; gap: 10px; }
.queue-visual { width: 40px; height: 40px; border-radius: 12px; }
.queue-drawer-head h2 { font-size: 21px; margin-top: 2px; }
.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--paper);
  color: var(--muted);
  font-size: 20px;
}
.icon-button:hover { background: var(--danger-soft); color: var(--danger); }
.icon-button.subtle { width: 36px; height: 36px; border: 1px solid var(--line); }
.icon-button.subtle:disabled { opacity: .4; }
.queue-widget-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding: 0 17px 12px;
}
.queue-widget-stats > div {
  display: flex;
  flex-direction: column;
  padding: 8px 9px;
  border-radius: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.queue-widget-stats strong { font: 700 16px/1.1 var(--font-display); }
.queue-widget-stats span { color: var(--muted); font-size: 9.5px; }
.queue-widget-progress { padding: 0 17px 9px; }
.queue-widget-progress p { margin: 5px 0 0; color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-widget-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  padding: 0 17px 10px;
}
.queue-widget-toolbar .btn { min-height: 36px; padding: 7px 11px; font-size: 11.5px; }
.queue-run-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.queue-run-button.is-running svg { animation: queueBlink .8s alternate infinite; }
@keyframes queueBlink { to { opacity: .35; transform: scale(.85); } }
.queue-drawer-summary {
  color: var(--muted);
  font-size: 11.5px;
  margin: 0;
  padding: 0 17px 10px;
}
.queue-widget-list {
  max-height: 260px;
  overflow-y: auto;
  border-block: 1px solid var(--line);
  background: #fafbfc;
  padding: 7px;
}
.queue-widget-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  margin-bottom: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.queue-widget-row:last-child { margin-bottom: 0; }
.queue-widget-row .row-copy b { font-size: 12.5px; }
.queue-widget-row .row-copy em {
  color: var(--danger);
  font-size: 9.5px;
  font-style: normal;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.queue-widget-empty {
  padding: 22px 8px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.queue-widget-empty > span { color: var(--accent); font-size: 22px; margin-bottom: 3px; }
.queue-widget-empty b { color: var(--ink); font-size: 12.5px; }
.queue-widget-empty small { font-size: 10.5px; }
.queue-add { margin: 11px 17px 0; border: 1px solid var(--line); border-radius: 11px; }
.queue-add summary { padding: 10px 12px; cursor: pointer; color: var(--accent); font-size: 12.5px; font-weight: 600; }
.queue-add form { display: flex; flex-direction: column; gap: 10px; padding: 2px 12px 12px; }
.queue-add label { font-size: 11.5px; }
.queue-add input, .queue-add select { margin-top: 4px; padding: 8px 10px; font-size: 12.5px; }
.form-message { margin: 0; color: #14724a; font-size: 11.5px; }
.form-message.error { color: var(--danger); }
.queue-manage-link { display: block; margin: 11px 17px 15px; text-align: center; font-size: 11.5px; font-weight: 600; }

/* ─── v3: spójna warstwa wizualna całej aplikacji ───────────── */
body {
  background:
    radial-gradient(700px 420px at 92% -10%, rgba(43,68,231,.09), transparent 68%),
    radial-gradient(520px 360px at 30% 110%, rgba(109,40,184,.055), transparent 72%),
    var(--paper);
}
.main { position: relative; isolation: isolate; }
.main::before {
  content: "";
  position: fixed;
  inset: 0 0 0 72px;
  z-index: -1;
  pointer-events: none;
  opacity: .32;
  background-image: radial-gradient(circle, rgba(108,113,128,.18) .7px, transparent .8px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000, transparent 38%);
}
html.rail-expanded .main::before { left: 230px; }
.rail {
  background:
    radial-gradient(140px 220px at 50% 0%, rgba(43,68,231,.28), transparent 72%),
    var(--ink);
  box-shadow: 8px 0 32px rgba(21,23,31,.08);
  z-index: 20;
}
.rail-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(255,255,255,.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 8px 24px rgba(0,0,0,.15);
}
.rail-links a.active { box-shadow: 0 7px 18px rgba(43,68,231,.38); }
.page-head {
  position: relative;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(207,210,220,.75);
}
.page-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 72px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #8066ff);
}
.page-head h1 { letter-spacing: -.035em; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; }
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 1px 1px rgba(21,23,31,.04);
  transition: background .15s, border-color .15s, transform .12s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, #3450f0, var(--accent));
  box-shadow: 0 7px 18px rgba(43,68,231,.2);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 9px 22px rgba(43,68,231,.28);
}
.btn-ghost { background: rgba(255,255,255,.62); }
.btn-ghost:hover { box-shadow: 0 6px 16px rgba(21,23,31,.07); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  border-color: #dcdfe7;
  box-shadow: inset 0 1px 2px rgba(21,23,31,.025);
}
input:hover, select:hover, textarea:hover { border-color: #c9ccd6; }
.settings-card, .team-card, .source-card, .dashboard-card,
.table-card, .queue-panel, .doc-card, .doc-pane {
  background-image: linear-gradient(145deg, rgba(255,255,255,.98), rgba(252,252,254,.98));
  border-color: rgba(218,221,229,.92);
  box-shadow: 0 2px 3px rgba(21,23,31,.035), 0 12px 34px rgba(21,23,31,.055);
}
.settings-card, .team-card, .source-card, .dashboard-card, .doc-card {
  position: relative;
}
.settings-card::after, .team-card::after, .source-card::after,
.dashboard-card::after, .doc-card::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 18px;
  width: 42px;
  height: 2px;
  border-radius: 0 0 99px 99px;
  background: linear-gradient(90deg, var(--accent), #8c70ff);
  opacity: .72;
}
.source-card, .team-card, .dashboard-card, .doc-card {
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.source-card:hover, .team-card:hover, .dashboard-card:hover, .doc-card:hover {
  transform: translateY(-2px);
  border-color: #cdd2e2;
  box-shadow: 0 4px 8px rgba(21,23,31,.05), 0 18px 42px rgba(21,23,31,.08);
}
.content-table th { background: linear-gradient(180deg, #f8f9fb, #f2f3f6); }
.content-table tbody tr { transition: background .12s; }
.content-table tbody tr:hover { background: #f7f8ff; }
.text-list-cell { display: flex; align-items: center; gap: 11px; min-width: 300px; }
.text-list-copy { display: flex; flex-direction: column; min-width: 0; }
.text-miniature { width: 48px; height: 38px; flex: 0 0 48px; overflow: hidden; border-radius: 8px; background: var(--paper-2, #f1f2f5); color: var(--muted); display: grid; place-items: center; border: 1px solid var(--line); }
.text-miniature img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Centrum publikacji */
.publish-site-tabs .chip span { opacity: .6; margin-left: 4px; }
.publish-console { display: grid; gap: 18px; }
.publish-settings, .bulk-categories, .bulk-toolbar {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 8px 24px rgba(23, 28, 41, .06); padding: 20px;
}
.publish-settings { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.publish-settings h2 { margin: 4px 0; }
.publish-settings p { color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.publish-options { display: flex; gap: 12px; align-items: end; min-width: min(100%, 460px); }
.publish-options label { flex: 1; }
.bulk-categories-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.bulk-categories-head small { display: block; color: var(--muted); margin-top: 3px; }
.bulk-toolbar { display: flex; align-items: center; gap: 18px; position: sticky; top: 12px; z-index: 4; }
.bulk-toolbar #bulk-count { color: var(--muted); }
.bulk-toolbar .btn { margin-left: auto; }
.bulk-select-all { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.bulk-progress { padding: 0 4px; }
.bulk-progress p { color: var(--muted); margin: 7px 0 0; }
.publish-table th:first-child, .publish-table td:first-child { width: 46px; text-align: center; }
.publish-table th:last-child, .publish-table td:last-child { width: 190px; }
.bulk-error { color: var(--danger); display: block; max-width: 260px; }
@media (max-width: 760px) {
  .publish-settings, .publish-options { flex-direction: column; align-items: stretch; }
  .publish-options { width: 100%; }
  .bulk-categories-head { align-items: flex-start; flex-direction: column; }
  .bulk-toolbar { flex-wrap: wrap; }
}
.empty {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(260px 140px at 50% 0%, var(--accent-soft), transparent 75%),
    rgba(255,255,255,.62);
}
.empty::after {
  content: "✦";
  position: absolute;
  right: 24px;
  top: 13px;
  color: var(--accent);
  opacity: .16;
  font-size: 34px;
}
.notice {
  border: 1px solid #d3dafd;
  background: linear-gradient(135deg, #eef1ff, var(--accent-soft));
}
.assist-pane {
  background:
    radial-gradient(260px 120px at 100% 0%, rgba(43,68,231,.09), transparent 72%),
    var(--card);
  border-color: #d9dce6;
}
.mode-tabs {
  padding: 4px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.mode-tab { border-radius: 8px; }
.mode-tab.active {
  background: linear-gradient(135deg, var(--ink), #343846);
  box-shadow: 0 5px 14px rgba(21,23,31,.18);
}
.doc-pane { position: relative; overflow: hidden; }
.doc-pane::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #8f71ff, #39a879);
}
.modal-backdrop { backdrop-filter: blur(5px); }
.modal {
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: 0 28px 90px rgba(21,23,31,.3);
  background:
    radial-gradient(300px 150px at 100% 0%, rgba(43,68,231,.11), transparent 72%),
    var(--card);
}
.tag { box-shadow: inset 0 0 0 1px rgba(43,68,231,.07); }
.mini-badge { background: rgba(255,255,255,.72); backdrop-filter: blur(6px); }

/* ─── responsywność v2 ───────────────────────────────────────── */
@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .topic-split { grid-template-columns: 1fr; }
  .topic-or { justify-self: center; }
  .topic-list, .wiz-grid { grid-template-columns: 1fr; }
  .wiz-step { font-size: 0; gap: 0; justify-content: center; }
  .wiz-step b { font-size: 12px; }
  .site-workspace, .content-split { grid-template-columns: 1fr; }
  .site-form-card { position: static; }
  .data-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .data-row > select { grid-column: 2; }
  .data-row > a { grid-column: 2; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .site-switcher { position: static; padding: 11px; }
  .site-switcher-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  .site-add-link { text-align: center; }
  .site-overview-card { align-items: flex-start; flex-direction: column; }
  .overview-actions { width: 100%; justify-content: flex-start; }
  .two-column-list, .wp-dashboard-grid { grid-template-columns: 1fr; }
  .queue-page-actions { width: 100%; }
  .queue-page-actions .btn { flex: 1; }
}
@media (max-width: 640px) {
  .main::before { left: 0; }
  .dashboard-head .head-actions { width: 100%; }
  .dashboard-head .head-actions .btn { flex: 1; text-align: center; }
  .site-switcher-list { grid-template-columns: 1fr; }
  .metric-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-card-wide { grid-column: auto; }
  .site-overview-main { align-items: flex-start; }
  .overview-actions .btn { flex: 1; text-align: center; }
  .queue-dock { right: 12px; bottom: 12px; }
  .queue-dock-toggle span { display: none; }
  .queue-drawer { width: calc(100vw - 24px); max-height: calc(100vh - 78px); }
  .queue-page-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .queue-page-actions #run-queue { grid-column: 1 / -1; }
  .queue-page-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .queue-status-label { display: none; }
  .queue-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .main { padding-bottom: 80px; }
  .downloaded-row { align-items: start; }
  .downloaded-actions { grid-column: 2 / -1; justify-content: flex-start; }
  .action-toast { bottom: 70px; align-items: flex-start; flex-direction: column; gap: 4px; }
  .featured-image-card { grid-template-columns: auto minmax(0, 1fr); }
  .featured-image-card .btn { grid-column: 2; justify-self: start; }
}

/* ─── v4: warstwa UX — toasty, potwierdzenia, skeletony ─────── */

/* wejście strony */
@keyframes pageRise { from { opacity: 0; transform: translateY(8px); } }
.main > * { animation: pageRise .32s cubic-bezier(.22,.8,.36,1) backwards; }
.main > *:nth-child(2) { animation-delay: .04s; }
.main > *:nth-child(3) { animation-delay: .08s; }
.main > *:nth-child(4) { animation-delay: .12s; }

/* toasty */
.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 78px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 12px 11px 13px;
  border-radius: 13px;
  background: var(--ink);
  color: #fff;
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 14px 40px rgba(21,23,31,.28);
  font-size: 13px;
  line-height: 1.45;
  animation: toastIn .28s cubic-bezier(.22,.8,.36,1);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.toast-leaving { animation: toastOut .22s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }
.toast-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto; }
.toast-success .toast-icon { color: #7ce0b3; background: rgba(30,154,100,.22); }
.toast-error .toast-icon { color: #ffb3c0; background: rgba(192,41,66,.3); }
.toast-info .toast-icon { color: #b9c5ff; background: rgba(43,68,231,.32); }
.toast-body { display: flex; flex-direction: column; gap: 3px; padding-top: 3px; min-width: 0; }
.toast-action {
  align-self: flex-start;
  background: none; border: 0; padding: 0;
  color: #cbd3ff; font-size: 12px; font-weight: 700;
  text-decoration: underline; cursor: pointer;
}
.toast-action:hover { color: #fff; }
.toast-close {
  display: grid; place-items: center;
  width: 24px; height: 24px; flex: 0 0 auto;
  margin: 1px -2px 0 2px;
  border: 0; border-radius: 7px;
  background: transparent; color: #8b90a3;
}
.toast-close:hover { background: rgba(255,255,255,.1); color: #fff; }

/* modal potwierdzenia */
body.modal-open { overflow: hidden; }
.confirm-backdrop { animation: confirmFade .18s ease; z-index: 90; }
@keyframes confirmFade { from { opacity: 0; } }
.confirm-leaving { animation: confirmFadeOut .16s ease forwards; }
@keyframes confirmFadeOut { to { opacity: 0; } }
.confirm-modal {
  max-width: 400px;
  text-align: center;
  padding: 28px 26px 24px;
  animation: confirmPop .22s cubic-bezier(.22,.8,.36,1);
}
@keyframes confirmPop { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.confirm-leaving .confirm-modal { animation: none; }
.confirm-icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  margin: 0 auto 13px;
  border-radius: 14px;
  color: var(--accent);
  background: var(--accent-soft);
}
.confirm-icon.danger { color: var(--danger); background: var(--danger-soft); }
.confirm-modal h2 { font-size: 19px; margin-bottom: 7px; }
.confirm-copy { margin: 0 0 20px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.btn-danger { background: linear-gradient(135deg, #d13853, var(--danger)); color: #fff; box-shadow: 0 7px 18px rgba(192,41,66,.22); }
.btn-danger:hover { background: linear-gradient(135deg, var(--danger), #a02036); box-shadow: 0 9px 22px rgba(192,41,66,.3); }

/* spinner w przyciskach */
.btn-spinner {
  width: 14px; height: 14px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: .85;
  animation: spin .65s linear infinite;
}

/* skeletony */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #e9ebf1;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.wp-skeleton { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(220px, .8fr); gap: 22px; padding: 6px 0 2px; }
.wp-skeleton-col { display: flex; flex-direction: column; gap: 11px; }
.wp-skeleton .skeleton { height: 13px; }
.wp-skeleton .skeleton.title { height: 11px; width: 34%; margin-bottom: 2px; }
.wp-skeleton .skeleton.chip { height: 24px; width: 74px; border-radius: 99px; display: inline-block; }
.wp-skeleton-chips { display: flex; flex-wrap: wrap; gap: 7px; }
@media (max-width: 860px) { .wp-skeleton { grid-template-columns: 1fr; } }

/* płynne usuwanie wierszy */
tr.row-leaving { opacity: 0; transition: opacity .28s ease; }
tr.row-leaving td { padding-top: 0; padding-bottom: 0; border-bottom-width: 0; transition: padding .28s ease; }
div.row-leaving, a.row-leaving {
  overflow: hidden;
  opacity: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  transition: height .28s ease, opacity .2s ease, padding .28s ease;
}

/* pasek wyszukiwania nad tabelami */
.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.search-field {
  position: relative;
  flex: 0 1 320px;
  min-width: 220px;
}
.search-field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-field input {
  margin-top: 0;
  padding-left: 36px;
  border-radius: 99px;
  background: rgba(255,255,255,.8);
}
.search-field input:focus { background: #fff; }
.table-counter { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.filter-empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* dopieszczenie drobnych akcji */
.doc-delete { transition: background .15s, color .15s, transform .12s; }
.doc-delete:hover { transform: scale(1.06); }
.icon-button, .queue-mini-action { transition: background .15s, color .15s, transform .12s; }
.queue-mini-action:hover { transform: translateY(-1px); }
.metric-icon svg, .row-icon svg { display: block; }
.chip { transition: background .15s, color .15s, border-color .15s, transform .12s; }
.chip:hover { transform: translateY(-1px); }
.site-switcher-item .site-chevron { transition: transform .15s; }
.site-switcher-item:hover .site-chevron { transform: translateX(2px); }

@media (max-width: 640px) {
  .toast-stack { right: 12px; left: 12px; bottom: 72px; align-items: stretch; }
  .toast { max-width: none; }
  .confirm-actions { grid-template-columns: 1fr; }
}

/* ─── v5: ekran logowania „atrament na porcelanie” ──────────── */
.auth-split {
  display: grid;
  grid-template-columns: minmax(440px, 1fr) minmax(0, 1.05fr);
  min-height: 100vh;
}

/* lewa scena: atrament */
.auth-stage {
  position: relative;
  overflow: hidden;
  display: flex;
  color: #fff;
  background:
    radial-gradient(560px 420px at 18% 8%, rgba(43,68,231,.4), transparent 65%),
    radial-gradient(520px 460px at 92% 96%, rgba(124,92,255,.22), transparent 70%),
    #101219;
}
.auth-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image: radial-gradient(circle, rgba(255,255,255,.10) .7px, transparent .8px);
  background-size: 22px 22px;
  mask-image: radial-gradient(600px 600px at 30% 20%, #000, transparent 80%);
}
.auth-stage-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: clamp(28px, 4vw, 52px);
  gap: 20px;
}
.auth-stage-brand { display: flex; align-items: center; gap: 12px; }
.auth-logo {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.09), 0 10px 28px rgba(0,0,0,.28);
}
.auth-wordmark {
  font: 700 17px var(--font-display);
  letter-spacing: .3em;
  text-transform: lowercase;
}
.auth-stage-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(24px, 4.5vh, 44px);
  max-width: 520px;
}

/* sygnatura: kartka, która pisze się sama */
.auth-sheet {
  position: relative;
  align-self: flex-start;
  width: min(420px, 100%);
  padding: 16px 20px 20px;
  border-radius: 15px;
  background: linear-gradient(160deg, #fff, #f7f8fc);
  color: var(--ink);
  box-shadow:
    0 2px 4px rgba(0,0,0,.25),
    0 26px 60px rgba(0,0,0,.4),
    0 0 90px rgba(43,68,231,.2);
  transform: rotate(-1.6deg);
  animation: sheetFloat 7s ease-in-out infinite;
}
@keyframes sheetFloat {
  0%, 100% { transform: rotate(-1.6deg) translateY(0); }
  50% { transform: rotate(-1.2deg) translateY(-7px); }
}
.auth-sheet::before {
  content: "";
  position: absolute;
  inset: 14px -10px auto auto;
  width: 74%;
  height: 100%;
  z-index: -1;
  border-radius: 15px;
  background: rgba(255,255,255,.09);
  transform: rotate(3.4deg);
}
.auth-sheet-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font: 500 10.5px var(--font-mono);
  color: var(--muted);
}
.auth-sheet-dots { display: inline-flex; gap: 4px; }
.auth-sheet-dots i { width: 8px; height: 8px; border-radius: 50%; background: #e3e5eb; }
.auth-sheet-dots i:first-child { background: #f6bdc8; }
.auth-sheet-dots i:nth-child(2) { background: #f4d9a5; }
.auth-sheet-dots i:last-child { background: #b9e3cd; }
.auth-sheet-eyebrow {
  margin: 0 0 6px;
  font: 500 9.5px var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.auth-sheet-title {
  min-height: 2.5em;
  margin: 0 0 12px;
  font: 700 17px/1.25 var(--font-display);
  letter-spacing: -.01em;
}
.auth-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -.12em;
  background: var(--accent);
  animation: caretBlink 1s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }
.auth-sheet-lines { display: flex; flex-direction: column; gap: 8px; }
.auth-sheet-lines span { height: 9px; border-radius: 99px; background: #edeef3; }
.auth-sheet-chip {
  position: absolute;
  right: 16px;
  bottom: -13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 99px;
  background: #14724a;
  color: #fff;
  font: 600 10px var(--font-mono);
  letter-spacing: .04em;
  box-shadow: 0 8px 20px rgba(20,114,74,.45);
  opacity: 0;
  transform: translateY(6px) scale(.94);
  transition: opacity .3s, transform .3s;
}
.auth-sheet-chip.show { opacity: 1; transform: translateY(0) scale(1); }

.auth-claim {
  margin: 0;
  font: 700 clamp(27px, 3vw, 38px)/1.14 var(--font-display);
  letter-spacing: -.03em;
}

/* proces produktu — sekwencja uzasadnia numerację */
.auth-steps {
  list-style: none;
  display: flex;
  gap: clamp(14px, 2.4vw, 30px);
  margin: 0;
  padding: 20px 0 0;
  border-top: 1px solid rgba(255,255,255,.12);
}
.auth-steps li { display: flex; align-items: center; gap: 9px; min-width: 0; }
.auth-steps b {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: rgba(43,68,231,.3);
  box-shadow: inset 0 0 0 1px rgba(139,157,255,.35);
  color: #c6cfff;
  font: 600 10px var(--font-mono);
}
.auth-steps span { font-size: 11.5px; line-height: 1.35; color: #aeb4c5; }

/* prawa strona: porcelana i formularz */
.auth-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 40px clamp(20px, 5vw, 64px);
  background:
    radial-gradient(640px 420px at 85% -6%, var(--accent-soft), transparent 65%),
    var(--paper);
}
.auth-side-brand {
  display: none;
  align-items: center;
  gap: 10px;
  font: 700 19px var(--font-display);
  letter-spacing: .26em;
}
.auth-panel {
  position: relative;
  width: 100%;
  max-width: 410px;
  padding: 32px 30px 28px;
  border-radius: 19px;
  border: 1px solid rgba(218,221,229,.92);
  background: linear-gradient(150deg, rgba(255,255,255,.99), rgba(251,251,254,.97));
  box-shadow: 0 2px 4px rgba(21,23,31,.04), 0 22px 60px rgba(21,23,31,.09);
}
.auth-panel::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 30px;
  width: 46px;
  height: 2.5px;
  border-radius: 0 0 99px 99px;
  background: linear-gradient(90deg, var(--accent), #8c70ff);
}
.auth-heading { font-size: 27px; margin: 6px 0 7px; letter-spacing: -.02em; }
.auth-lede { margin: 0 0 20px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }

.auth-form { display: flex; flex-direction: column; }
.auth-form > label { margin-bottom: 6px; }
.auth-form > label + .auth-field { margin-bottom: 15px; }
.auth-field { position: relative; }
.auth-field > svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  transition: color .15s;
}
.auth-field:focus-within > svg { color: var(--accent); }
.auth-field input {
  margin-top: 0;
  padding: 11.5px 42px 11.5px 38px;
  border-radius: 11px;
}
.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.password-toggle:hover { background: var(--paper); color: var(--ink); }
.password-toggle .eye-closed { display: none; }
.password-toggle.is-visible .eye-open { display: none; }
.password-toggle.is-visible .eye-closed { display: block; }

.caps-warning {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: -7px 0 12px;
  color: #9a5b12;
  font-size: 12px;
  font-weight: 600;
}
.caps-warning[hidden] { display: none; }

.strength { display: flex; align-items: center; gap: 10px; margin: -7px 0 13px; }
.strength[hidden] { display: none; }
.strength-bar {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.strength-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  transition: width .25s, background .25s;
}
.strength-label { flex: 0 0 auto; font: 600 10.5px var(--font-mono); }

.auth-submit { margin-top: 4px; padding: 12.5px; font-size: 15px; }
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  animation: authShake .4s cubic-bezier(.36,.07,.19,.97);
}
.auth-alert svg { flex: 0 0 auto; margin-top: 2px; }
@keyframes authShake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}
.auth-footnote {
  margin: 0;
  max-width: 410px;
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

/* wejście */
@keyframes authRise { from { opacity: 0; transform: translateY(12px); } }
.auth-panel { animation: authRise .4s cubic-bezier(.22,.8,.36,1) backwards .05s; }
.auth-footnote { animation: authRise .4s cubic-bezier(.22,.8,.36,1) backwards .14s; }
.auth-stage-brand, .auth-stage-center, .auth-steps { animation: authRise .5s cubic-bezier(.22,.8,.36,1) backwards; }
.auth-stage-center { animation-delay: .08s; }
.auth-steps { animation-delay: .16s; }

@media (max-width: 980px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-stage { display: none; }
  .auth-side { min-height: 100vh; }
  .auth-side-brand { display: flex; }
  .auth-side-brand span { font-size: 16px; }
}
@media (max-height: 760px) {
  .auth-steps { display: none; }
  .auth-stage-center { gap: 26px; }
}
@media (max-width: 420px) {
  .auth-panel { padding: 26px 20px 24px; }
}
