/* MaxWeb Studio — interfejs inspirowany v0.dev (Vercel design language)
   Sidebar po lewej (stały), centered prompt, czarny monochromatyczny dark mode
   Backup oryginału: backup/index-pre-v0-2026-07-28.html + backup/app-pre-v0-2026-07-28.css */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================================
   DESIGN TOKENS — v0.dev / Vercel Zinc palette
   ============================================================ */
:root {
  /* Zinc dark — identyczny z v0.dev */
  --bg:          #09090b;   /* zinc-950 — główne tło */
  --bg-2:        #18181b;   /* zinc-900 — sidebar, karty */
  --bg-3:        #27272a;   /* zinc-800 — hover, secondary */
  --bg-4:        #3f3f46;   /* zinc-700 — border hover, input bg */
  --border:      #27272a;   /* zinc-800 */
  --border-soft: #1c1c1f;
  --text:        #fafafa;   /* zinc-50 */
  --muted:       #a1a1aa;   /* zinc-400 */
  --muted-2:     #71717a;   /* zinc-500 */
  --accent:      #ffffff;   /* v0 używa białego jako primary akcent — nie koloru */
  --accent-2:    #e4e4e7;   /* zinc-200 */
  --accent-brand:#6366f1;   /* indigo — zachowamy dla gradientu logo i CTA */
  --ok:          #4ade80;   /* green-400 */
  --err:         #f87171;   /* red-400 */

  --radius:    8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 24px;
  --gap-xl: 32px;

  --sidebar-w: 260px;
  --chat-w: 400px;         /* szerokość panelu czatu gdy sidebar + split */
  --canvas-bg: #000000;
  --empty-bg: radial-gradient(ellipse at 50% 60%, #18181b 0%, #09090b 80%);
  --glass: rgba(9, 9, 11, .92);
  --shadow: rgba(0, 0, 0, .7);
  --shadow-soft: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.4);
  --ring: 0 0 0 2px rgba(250,250,250,.2);
}

[data-theme="light"] {
  --bg:          #ffffff;
  --bg-2:        #fafafa;
  --bg-3:        #f4f4f5;   /* zinc-100 */
  --bg-4:        #e4e4e7;   /* zinc-200 */
  --border:      #e4e4e7;
  --border-soft: #f0f0f2;
  --text:        #09090b;
  --muted:       #71717a;
  --muted-2:     #a1a1aa;
  --accent:      #09090b;
  --accent-2:    #27272a;
  --ok:          #16a34a;
  --err:         #dc2626;
  --canvas-bg:   #f4f4f5;
  --empty-bg:    radial-gradient(ellipse at 50% 60%, #ffffff 0%, #f4f4f5 80%);
  --glass:       rgba(255, 255, 255, .92);
  --shadow:      rgba(0, 0, 0, .12);
  --shadow-soft: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.08);
  --ring:        0 0 0 2px rgba(9,9,11,.2);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }
button, a, .btn, [role="button"] { -webkit-tap-highlight-color: rgba(250,250,250,.1); }

#app {
  display: flex;
  flex-direction: row;   /* sidebar + main — poziomo */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ============================================================
   IKONY SVG
   ============================================================ */
.ico {
  width: 15px; height: 15px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.ico-logo { width: 20px; height: 20px; stroke: #6366f1; stroke-width: 2.2; }
.empty-logo svg {
  width: 56px; height: 56px; fill: none; stroke: var(--muted-2);
  stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
}

/* ============================================================
   SIDEBAR — stały panel lewej strony (v0 style)
   ============================================================ */
.v0-sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  z-index: 10;
}

/* Brand w sidebarze */
.v0-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.logo-mark {
  width: 28px; height: 28px; flex: 0 0 auto;
  filter: drop-shadow(0 2px 6px rgba(99, 102, 241, .4));
}
.logo-word { display: flex; flex-direction: column; line-height: 1; }
.logo-word b {
  font-size: 15px; font-weight: 800; letter-spacing: .2px;
  background: linear-gradient(90deg, #a5b4fc, #d8b4fe);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme="light"] .logo-word b {
  background: linear-gradient(90deg, #4f46e5, #9333ea);
  -webkit-background-clip: text; background-clip: text;
}
.logo-word i {
  font-style: normal; font-size: 7px; letter-spacing: 3px;
  color: var(--muted-2); font-weight: 700; margin-top: 3px;
}

/* Przyciski narzędziowe w sidebarze (górna część) */
.v0-sidebar-top {
  flex: 0 0 auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}
.sidebar-collapse-btn {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
}
.sidebar-collapse-btn:hover {
  background: var(--bg-3);
  color: var(--text);
}
.sidebar-collapse-btn .ico {
  width: 16px;
  height: 16px;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s, color .12s, border-color .12s;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
.sidebar-btn:hover { background: var(--bg-3); color: var(--text); border-color: rgba(255,255,255,.05); }
.sidebar-btn.active { background: var(--bg-3); color: var(--text); border-color: var(--border); }
.sidebar-btn .ico { width: 15px; height: 15px; flex: 0 0 auto; }
.sidebar-btn .sb-new {
  margin-left: auto;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 10px;
  color: var(--muted);
  padding: 1px 6px;
  line-height: 1.6;
}

/* Lista projektów w sidebarze (ciemny, zaokrąglony design) */
.v0-sidebar-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.v0-sidebar-list::-webkit-scrollbar { width: 4px; }
.v0-sidebar-list::-webkit-scrollbar-track { background: transparent; }
.v0-sidebar-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

#sidebarProjectsList {
  display: flex; flex-direction: column; gap: 3px;
}
#sidebarProjectsList .sidebar-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: var(--text);
  font-size: 12.5px;
  padding: 8px 10px;
}
#sidebarProjectsList .sidebar-btn:hover {
  background: var(--bg-3);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}
#sidebarProjectsList .sidebar-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* Zwijanie sidebara */
body.sidebar-collapsed .v0-sidebar {
  display: none !important;
}
body.sidebar-collapsed .v0-main {
  width: 100% !important;
}
body.sidebar-collapsed .sidebar-expand-btn {
  display: inline-flex !important;
}

.sidebar-section-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 8px 10px 4px;
  user-select: none;
}

/* Dolna część sidebara (ustawienia, profil) */
.v0-sidebar-bottom {
  flex: 0 0 auto;
  padding: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.v0-sidebar-bottom .sidebar-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius);
  border: 0; background: transparent; color: var(--muted);
  font-size: 13px; cursor: pointer; font-family: inherit;
  transition: background .12s, color .12s;
  text-decoration: none; white-space: nowrap;
}
.v0-sidebar-bottom .sidebar-btn:hover { background: var(--bg-3); color: var(--text); }
.v0-sidebar-bottom .sidebar-btn .ico { width: 15px; height: 15px; flex: 0 0 auto; }

/* Badge alfa (sidebar) */
.badge.alfa {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  color: #fbbf24; border: 1px solid rgba(251,191,36,.4);
  border-radius: 999px; padding: 2px 7px;
}

/* ============================================================
   MAIN — prawa część (czat + splitter + canvas)
   ============================================================ */
.v0-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

/* Mini-topbar w main (projekt + narzędzia prawej strony) */
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
  min-height: 49px;
}
/* brand ukryty — jest w sidebarze */
.brand { display: none; }

.proj-name-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  margin-left: 8px;
}
.proj-name-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  padding-left: 10px;
}
.proj-name-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.proj-name {
  padding: 3px 10px; border-radius: 6px;
  color: #6366f1; font-weight: 500; font-size: 14.5px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px;
  transition: background .12s, color .12s;
  line-height: 1.2;
}
.proj-name:hover { background: var(--bg-3); color: #818cf8; }
.proj-name.editing {
  background: var(--bg-2); color: var(--text); outline: none;
  border: 1px solid var(--border); cursor: text; min-width: 120px;
}
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Badge koszt tokenów */
.badge {
  font-size: 11.5px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px;
}
.badge.ok  { color: var(--ok);  border-color: rgba(74,222,128,.3); }
.badge.err { color: var(--err); border-color: rgba(248,113,113,.3); }

/* ---- Custom Model Dropdown (zamiast <select>) ---- */

.model-dropdown {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  user-select: none;
  z-index: 90;
}

.md-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 10px 4px 8px;
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 0;
}
.md-trigger:hover,
.model-dropdown[aria-expanded="true"] .md-trigger {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.22);
  background: rgba(255, 255, 255, 0.07);
}
.model-dropdown[aria-expanded="true"] .md-chevron {
  transform: rotate(180deg);
}
.md-chevron { transition: transform 0.18s ease; color: var(--muted); }

.md-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.md-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* Świecąca zielona dioda LED "Pracuje" */
.status-lamp {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 8px #22c55e, 0 0 16px rgba(34, 197, 94, 0.6);
  animation: pulse-green 2s infinite ease-in-out;
  flex-shrink: 0;
}
@keyframes pulse-green {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 8px #22c55e, 0 0 14px rgba(34, 197, 94, 0.7);
  }
  50% {
    opacity: 0.65;
    transform: scale(0.85);
    box-shadow: 0 0 4px #22c55e, 0 0 8px rgba(34, 197, 94, 0.3);
  }
}

/* Lista opcji dropdownu */
.md-list {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 290px;
  background: #16181f;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.3);
  padding: 6px;
  backdrop-filter: blur(20px);
  overflow: hidden;
  z-index: 200;
}
/* DWIE KOLUMNY. Zgloszone dwukrotnie: "lista sie nie miesci". Szesnascie modeli w jednej
   kolumnie to okolo 1100 px wysokosci - wiecej niz ma laptop. W dwoch kolumnach lista miesci
   sie na ekranie bez przewijania, a naglowki grup ida przez cala szerokosc, zeby podzial
   na "twoje modele" i "darmowe" nadal byl czytelny. */
/* UWAGA na specyficznosc: `.md-list.md-dwie { display: grid }` bylo MOCNIEJSZE niz
   `.md-list { display: none }`, wiec lista przestawala sie chowac i otwieranie "nie dzialalo"
   za pierwszym klknieciem (zgloszone). Uklad siatki wlaczamy WYLACZNIE w stanie otwartym. */
@media (min-width: 900px) {
  .model-dropdown[aria-expanded="true"] .md-list.md-dwie {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0 6px;
  }
  /* max-width pilnuje, zeby szeroka lista nie wyszla poza ekran przy prawej krawedzi
     (na zrzucie wystawala w lewo poza okno przegladarki). */
  .md-list.md-dwie { min-width: 620px; max-width: calc(100vw - 24px);
    max-height: min(74vh, 700px); overflow-y: auto; }
  .md-list.md-dwie .md-opt-group { grid-column: 1 / -1; }
}
.model-dropdown[aria-expanded="true"] .md-list {
  display: block;
  animation: mdOpen 0.18s cubic-bezier(0.16,1,0.3,1);
}
@keyframes mdOpen {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Światełko stanu konta przy modelu — kolor mówi o ZMIERZONYM zużyciu, nie o nastroju */
.md-lamp {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
  flex-shrink: 0;
}
.md-lamp--zielone  { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.75); }
.md-lamp--zolte    { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,.75); }
.md-lamp--czerwone { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,.75); }
.md-lamp--nieznane { background: #64748b; }

/* podmodele w wyborze generatora grafiki (trzy najtańsze) */
.md-submodels { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px 10px 8px 34px; }
.md-chip {
  font-size: 10.5px; line-height: 1;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.md-chip:hover { border-color: rgba(99,102,241,.45); color: var(--text); }
.md-chip.active { background: rgba(99,102,241,.2); border-color: rgba(99,102,241,.5); color: #c7d2fe; font-weight: 600; }

.md-opt-group {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 10px 10px 4px;
}
.md-opt-group:first-child {
  padding-top: 4px;
}
.md-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
  border: 1px solid transparent;
}
.md-option:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.2);
}
.md-option.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.35);
}
.md-opt-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
/* Ikony konturowe (generatory grafiki) MUSZĄ mieć jawnie fill:none — bez tego przeglądarka
   wypełnia je czernią i w liście widać czarne prostokąty zamiast rysunku.
   Ikony modeli (#model-*) są wypełnione, więc celujemy tylko w te z prefiksem #i-. */
.md-opt-icon.md-opt-icon--kontur,
.md-icon.md-icon--kontur {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.md-opt-text {
  flex: 1;
  min-width: 0;
}
.md-opt-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.md-opt-sub {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}
.md-opt-rank {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.03em;
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
  padding: 2px 5px;
  border-radius: 4px;
}
.md-option.active .md-opt-rank {
  background: rgba(99,102,241,0.25);
  color: #a5b4fc;
}

/* stary .model-sel (hidden, kompatybilność) */
.model-sel { display: none !important; }

/* ============================================================
   SPLIT (czat + splitter + canvas)
   ============================================================ */
.split { display: flex; flex: 1 1 auto; min-height: 0; overflow: hidden; }

/* ============================================================
   PANEL CZATU
   ============================================================ */
.chat-pane {
  width: var(--chat-w); min-width: 280px; max-width: 860px;
  display: flex; flex-direction: column;
  background: var(--bg);
  flex: 0 0 auto;
  position: relative;
  border-right: 1px solid var(--border);
}

/* Nagłówek czatu */
.chat-head {
  flex: 0 0 auto; padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
}
.chat-head .ch-title { font-weight: 600; color: var(--text); font-size: 13px; }
.chat-head .ch-hint { margin-left: auto; opacity: .5; font-size: 11px; }

/* ========= SWARM DROPDOWN — custom pill + popup ========= */
.swarm-dd {
  position: relative;
  flex-shrink: 0;
}
.swarm-dd__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 9px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--muted);
  font-size: 12px; font-weight: 500; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: all .18s cubic-bezier(0.4,0,0.2,1);
  outline: none;
}
.swarm-dd__btn:hover {
  border-color: #6366f1;
  color: var(--text);
  background: var(--bg-3);
  box-shadow: 0 2px 8px rgba(99,102,241,.12);
}
.swarm-dd__icon { width: 13px; height: 13px; }
.swarm-dd__caret {
  transition: transform .2s cubic-bezier(0.4,0,0.2,1);
}
/* Aktywny (swarm > 0) */
.swarm-dd.active .swarm-dd__btn {
  color: #fff;
  border-color: #6366f1;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 3px 10px rgba(99,102,241,.30);
  font-weight: 600;
}
.swarm-dd.active .swarm-dd__btn:hover {
  box-shadow: 0 4px 14px rgba(99,102,241,.40);
  filter: brightness(1.08);
}
/* Caret obraca się gdy otwarty */
.swarm-dd__btn[aria-expanded="true"] .swarm-dd__caret {
  transform: rotate(180deg);
}

/* Popup menu */
.swarm-dd__menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 230px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.12);
  padding: 6px;
  z-index: 9999;
  opacity: 0; transform: translateY(-6px) scale(.97);
  pointer-events: none;
  transition: opacity .18s cubic-bezier(0.4,0,0.2,1),
              transform .18s cubic-bezier(0.4,0,0.2,1);
}
.swarm-dd__menu.open {
  opacity: 1; transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Pozycja - jeśli brakuje miejsca w dół, otwieramy w górę (JS dodaje klasę .up) */
.swarm-dd__menu.up {
  top: auto; bottom: calc(100% + 6px);
  transform: translateY(6px) scale(.97);
}
.swarm-dd__menu.up.open {
  transform: translateY(0) scale(1);
}

/* Opcja w menu */
.swarm-dd__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  cursor: pointer;
  transition: background .12s;
  user-select: none;
}
.swarm-dd__item:hover {
  background: var(--bg-3);
}
.swarm-dd__item.selected {
  background: rgba(99,102,241,.1);
}
.swarm-dd__item.selected .swarm-dd__info strong {
  color: #818cf8;
}

/* Kolorowy badge z liczbą */
.swarm-dd__badge {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  letter-spacing: -.5px;
}
.swarm-dd__badge--gray  { background: rgba(148,163,184,.15); color: var(--muted); }
.swarm-dd__badge--blue  { background: rgba(59,130,246,.15);  color: #60a5fa; }
.swarm-dd__badge--purple{ background: rgba(139,92,246,.18);  color: #a78bfa; }
.swarm-dd__badge--orange{ background: rgba(249,115,22,.15);  color: #fb923c; }

/* Teksty opcji */
.swarm-dd__info {
  display: flex; flex-direction: column; gap: 1px;
}
.swarm-dd__info strong {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  line-height: 1.3;
}
.swarm-dd__info span {
  font-size: 10.5px; color: var(--muted); line-height: 1.3;
}
/* Plakietki trybu: „eksperyment" (pomarańczowa) i „zalecany" (zielona).
   Selektor MUSI być mocniejszy niż „.swarm-dd__info span" powyżej — inaczej plakietka
   dziedziczy szary kolor opisu i ostrzeżenie przestaje być widoczne. */
.swarm-dd__info .swarm-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  font: 700 9.5px/1.5 inherit; letter-spacing: .3px; text-transform: uppercase;
  background: rgba(245, 158, 11, .16); color: #f59e0b; border: 1px solid rgba(245, 158, 11, .32);
  vertical-align: 1px;
}
.swarm-dd__info .swarm-tag--ok {
  background: rgba(52, 211, 153, .14); color: #34d399; border-color: rgba(52, 211, 153, .3);
}
.swarm-dd__menu .swarm-dd__stopka {
  margin: 4px 4px 2px; padding: 7px 9px; border-top: 1px solid var(--border);
  font: 500 10.5px/1.45 inherit; color: var(--muted);
}

/* Log czatu */
.chat-log {
  flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
  padding: 20px 14px 10px;
  display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.chat-log::-webkit-scrollbar { width: 4px; }
.chat-log::-webkit-scrollbar-track { background: transparent; }
.chat-log::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Wiadomości */
.msg {
  max-width: 90%; line-height: 1.6; font-size: 14px;
  border-radius: var(--radius-lg); padding: 10px 14px;
  word-wrap: break-word;
}
.msg.user {
  align-self: flex-end;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-right-radius: 3px;
}
.msg.ai {
  align-self: flex-start;
  background: transparent;
  color: var(--text);
  padding: 4px 0;
  max-width: 100%;
}
.msg.ai.err { color: var(--err); padding: 10px 14px; border: 1px solid rgba(248,113,113,.3); border-radius: var(--radius); background: rgba(248,113,113,.05); }
.msg.ai .cursor {
  display: inline-block; width: 2px; height: 15px;
  background: var(--text); vertical-align: text-bottom;
  animation: blink .8s infinite; border-radius: 1px;
}
@keyframes blink { 50% { opacity: 0; } }
.msg code {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; font-size: 12.5px;
}
.msg b { color: inherit; font-weight: 600; }

/* Zwijany blok myślenia */
.bubble-think {
  margin: 0 0 10px; padding: 8px 12px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-left: 2px solid var(--border);
  border-radius: var(--radius); font-size: 11.5px; color: var(--muted);
  font-family: ui-monospace, Consolas, monospace; line-height: 1.5;
}
.bubble-think summary {
  cursor: pointer; font-weight: 500; color: var(--muted-2);
  list-style: none; user-select: none; font-size: 11px; letter-spacing: .2px;
}
.bubble-think summary::-webkit-details-marker { display: none; }
.bubble-think summary::before { content: '💭 '; }
.bubble-think[open] summary { color: var(--text); margin-bottom: 6px; }
.bubble-think .think-body { white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow-y: auto; }

/* ============================================================
   KARTY PRACY (obieg pracy w czacie)
   ============================================================ */
.work-card {
  align-self: stretch; max-width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  cursor: default;
}
.wc-head { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.wc-time { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.wc-spin {
  width: 13px; height: 13px; flex: 0 0 auto; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--muted);
  animation: spin .7s linear infinite;
}
.wc-check { color: var(--ok); font-weight: 700; }
.shimmer {
  background: linear-gradient(90deg, var(--muted) 20%, var(--text) 40%, #e4e4e7 50%, var(--text) 60%, var(--muted) 80%);
  background-size: 240% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 2s linear infinite;
}
@keyframes shimmer { to { background-position: -240% 0; } }
.wc-steps { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.wc-steps.collapsed { display: none; }
.wc-step { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); opacity: .5; transition: opacity .25s, color .25s; }
.wc-step .wc-ico { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--bg); border: 1px solid var(--border); flex: 0 0 auto; }
.wc-step .wc-ico .ico { width: 10px; height: 10px; }
.wc-step .wc-mark { margin-left: auto; font-size: 11px; font-weight: 600; }
.wc-step.active { opacity: 1; color: var(--text); }
.wc-step.active .wc-ico { border-color: var(--bg-4); background: var(--bg-3); }
.wc-step.active .wc-mark::after { content: "…"; color: var(--muted); animation: blink .9s infinite; }
.wc-step.done { opacity: .8; }
.wc-step.done .wc-ico { border-color: rgba(74,222,128,.4); }
.wc-step.done .wc-ico .ico { color: var(--ok); }
.wc-step.done .wc-mark::after { content: "✓"; color: var(--ok); }
@keyframes pulse-ico { 50% { box-shadow: 0 0 0 4px rgba(250,250,250,.06); } }

/* ========= Panel wieloagentowy — premium dashboard ========= */
/* Wieloagentowy panel na warstwie (prawy panel) */
.wc-multiagent.ma-overlay-mode {
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  margin: auto;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  background: var(--bg-1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  z-index: 10;
}

.ma-body {
  display: flex; gap: 14px; margin-top: 10px; min-height: 120px;
}
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px; flex: 1 1 0; align-content: start;
}
.ma-timeline {
  flex: 0 0 260px; max-height: 380px; overflow: hidden;
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-2); font-size: 11px;
}
.ma-tl-title {
  padding: 6px 10px; font-weight: 600; font-size: 11px; color: var(--muted);
  border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .5px;
}
.ma-tl-list {
  flex: 1; overflow-y: auto; padding: 4px 0;
  scrollbar-width: thin; scrollbar-color: var(--bg-4) transparent;
}
.ma-tl-row {
  display: flex; align-items: flex-start; gap: 6px; padding: 3px 10px;
  border-left: 2px solid transparent; transition: background .15s;
  line-height: 1.4;
}
.ma-tl-row:hover { background: rgba(255,255,255,.03); }
.ma-tl-row.ok    { border-left-color: #4ade80; }
.ma-tl-row.fail  { border-left-color: #f87171; background: rgba(248,113,113,.04); }
.ma-tl-row.warn  { border-left-color: #fbbf24; }
.ma-tl-row.phase { border-left-color: #818cf8; background: rgba(99,102,241,.04); font-weight: 600; }
.ma-tl-ts  { flex: 0 0 36px; color: var(--muted-2); font-variant-numeric: tabular-nums; text-align: right; font-size: 10px; opacity: .7; }
.ma-tl-ico { flex: 0 0 16px; text-align: center; font-size: 11px; }
.ma-tl-msg { flex: 1; color: var(--text); word-break: break-word; }
.ma-tl-msg b { font-weight: 600; color: var(--text); }

/* Agent card */
.agent-card {
  display: flex; flex-direction: column; gap: 3px; position: relative;
  padding: 10px 12px; padding-right: 52px; /* room for ring */
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-3); font-size: 12px;
  transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: .55; overflow: hidden;
}
.agent-card.active {
  opacity: 1; border-color: #6366f1;
  background: linear-gradient(135deg, rgba(99,102,241,.08) 0%, var(--bg-3) 100%);
  box-shadow: 0 4px 20px rgba(99,102,241,.15), inset 0 1px 0 rgba(255,255,255,.04);
}
.agent-card.done {
  opacity: .92; border-color: rgba(74,222,128,.4);
  background: linear-gradient(135deg, rgba(74,222,128,.05) 0%, var(--bg-3) 100%);
}
.agent-card.err {
  opacity: .85; border-color: rgba(248,113,113,.45);
  background: linear-gradient(135deg, rgba(248,113,113,.06) 0%, var(--bg-3) 100%);
}
.agent-card.warn {
  opacity: 1; border-color: rgba(251,191,36,.45);
  background: linear-gradient(135deg, rgba(251,191,36,.06) 0%, var(--bg-3) 100%);
}
.agent-card.retry {
  border-color: rgba(251,191,36,.5);
  animation: card-retry-pulse 1.2s ease-in-out infinite alternate;
}
@keyframes card-retry-pulse { 0%{box-shadow: none} 100%{box-shadow: 0 0 12px rgba(251,191,36,.2)} }

.agent-head { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); flex-wrap: nowrap; }
.agent-head .ag-ico {
  width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--bg-4); color: var(--muted); transition: background .2s, color .2s;
}
.agent-card.active .ag-ico { background: rgba(99,102,241,.2); color: #818cf8; }
.agent-card.done .ag-ico   { background: rgba(74,222,128,.15); color: #4ade80; }
.agent-card.err .ag-ico    { background: rgba(248,113,113,.15); color: #f87171; }
.agent-card.warn .ag-ico   { background: rgba(251,191,36,.15); color: #fbbf24; }
.agent-head .ag-ico .ico { width: 12px; height: 12px; }
.agent-head .ag-name { white-space: nowrap; }
.agent-head .ag-role { font-size: 10px; color: var(--muted); font-weight: 400; margin-left: auto; white-space: nowrap; }

.agent-status { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; min-height: 16px; font-weight: 500; }
.agent-card.active .agent-status { color: var(--text); }
.agent-card.done   .agent-status { color: var(--ok); }
.agent-card.err    .agent-status { color: var(--err); }
.agent-card.warn   .agent-status { color: #fbbf24; }
.agent-status .ag-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.agent-card.active .ag-dot { animation: pulse-ico .8s ease-in-out infinite alternate; background: #6366f1; box-shadow: 0 0 8px #6366f1; }

/* Model badge */
.ag-model {
  font-size: 9px; color: var(--muted-2); font-family: var(--font-mono, monospace);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-height: 12px; opacity: .7; letter-spacing: .2px;
}
.agent-card.active .ag-model { color: #a5b4fc; opacity: 1; }
.agent-card.done   .ag-model { color: rgba(74,222,128,.6); }
.agent-card.err    .ag-model { color: rgba(248,113,113,.5); }

.ag-detail {
  font-size: 10px; color: var(--muted); line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-height: 14px; opacity: .85; transition: opacity .2s;
}
.agent-card.active .ag-detail { color: #c7d2fe; font-weight: 500; }
.agent-card.warn   .ag-detail { color: #fde68a; }
.agent-card.err    .ag-detail { color: #fca5a5; }

/* Time ring — positioned top-right of card */
.ag-ring-wrap {
  position: absolute; top: 8px; right: 8px;
  width: 38px; height: 38px; display: grid; place-items: center;
}
.ag-ring { width: 38px; height: 38px; transform: rotate(-90deg); }
.ag-ring-bg { stroke: var(--border); opacity: .3; }
.ag-ring-fg { stroke: #6366f1; transition: stroke-dasharray .3s ease; }
.agent-card.done .ag-ring-fg { stroke: #4ade80; }
.agent-card.err  .ag-ring-fg { stroke: #f87171; }
.agent-card.warn .ag-ring-fg { stroke: #fbbf24; }
.ag-ring-time {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 9px; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.agent-card.active .ag-ring-time { color: #a5b4fc; }
.agent-card.done   .ag-ring-time { color: #4ade80; }
.agent-card.err    .ag-ring-time { color: #f87171; }

/* Responsive: stack on narrow */
@media (max-width: 700px) {
  .ma-body { flex-direction: column; }
  .ma-timeline { flex: none; max-height: 180px; }
  .agent-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

.work-card.wc-done { cursor: pointer; border-color: rgba(74,222,128,.3); }
.work-card.wc-fail { border-color: rgba(248,113,113,.35); }
.think { font-size: 13.5px; }

/* Animacja myślenia */
.think-bubble { display: inline-flex; align-items: center; gap: 8px; }
.think-dots { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.think-dots i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  display: inline-block; animation: think-bounce 1.1s ease-in-out infinite;
}
.think-dots i:nth-child(2) { animation-delay: .16s; }
.think-dots i:nth-child(3) { animation-delay: .32s; }
@keyframes think-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

/* Kompaktowanie czatu */
.chat-fold { align-self: stretch; }
.chat-fold-btn {
  width: 100%; background: transparent; border: 1px dashed var(--border); border-radius: 8px;
  color: var(--muted); font-size: 12px; padding: 7px 12px; cursor: pointer; font-family: inherit;
  transition: color .12s, border-color .12s;
}
.chat-fold-btn:hover { color: var(--text); border-color: var(--bg-4); }
.chat-fold-body { display: none; flex-direction: column; gap: 12px; margin-top: 12px; }
.chat-fold.open .chat-fold-body { display: flex; }

/* Karty designu */
.designs { display: flex; flex-direction: column; gap: 8px; align-self: stretch; }
.design-card {
  display: flex; gap: 12px; align-items: center;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 12px; cursor: pointer; transition: border-color .12s, background .12s;
  text-align: left;
}
.design-card:hover { border-color: var(--bg-4); background: var(--bg-3); }
.design-card.chosen { border-color: var(--ok); }
.design-swatch { display: flex; flex-direction: column; gap: 3px; flex: 0 0 auto; }
.design-swatch i { display: block; width: 32px; height: 11px; border-radius: 3px; }
.design-info h4 { margin: 0 0 3px; font-size: 13.5px; }
.design-info h4 .sys {
  font-style: normal; font-weight: 500; font-size: 10px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; margin-left: 5px; vertical-align: 1px;
}
.design-info p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.design-info .fonts { font-size: 11px; color: var(--muted-2); margin-top: 4px; display: block; }

/* ===== KOLORY: próbki przy podpowiedziach + próbnik (pipeta) ===== */
.chip--kolor { display: inline-flex; align-items: center; gap: 7px; }
.chip-kolory { display: inline-flex; gap: 3px; flex: 0 0 auto; }
.chip-kolory i {
  display: block; width: 11px; height: 11px; border-radius: 3px;
  border: 1px solid rgba(255,255,255,.22); box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.chip--probnik { display: inline-flex; align-items: center; gap: 6px; border-style: dashed; }
.chip--probnik:hover { color: var(--accent); border-color: var(--accent); }

.design-kolory {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1px dashed var(--border); color: var(--muted);
  border-radius: 999px; padding: 4px 11px; font-size: 11.5px; cursor: pointer; margin: -2px 0 2px;
}
.design-kolory:hover { color: var(--accent); border-color: var(--accent); }
.design-kolory .ico { width: 13px; height: 13px; }
.design-card.design--wlasne { border-color: var(--accent); }
.design-info h4 .wlasne {
  font-style: normal; font-weight: 600; font-size: 10px; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 999px; padding: 1px 7px; margin-left: 5px; vertical-align: 1px;
}

.probnik-tlo {
  position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 18px;
  background: rgba(3, 6, 14, .62); backdrop-filter: blur(3px);
}
.probnik {
  width: min(560px, 96vw); max-height: 92vh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 26px 70px rgba(0,0,0,.55);
}
.probnik-head { display: flex; align-items: center; gap: 9px; padding: 13px 15px; border-bottom: 1px solid var(--border); }
.probnik-head b { flex: 1; font-size: 14px; }
.probnik-x { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 8px; }
.probnik-x:hover { background: var(--bg-3); color: var(--text); }
.probnik-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 15px; }
@media (max-width: 620px) { .probnik-body { grid-template-columns: 1fr; } }
.probnik-pola { display: flex; flex-direction: column; gap: 9px; }
.probnik-pole {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 11px; padding: 8px 10px;
}
.probnik-pole:hover { border-color: var(--bg-4); }
.probnik-pole input[type="color"] {
  width: 34px; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 9px;
  background: none; cursor: pointer; flex: 0 0 auto;
}
.probnik-pole span { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.probnik-pole b { font-size: 12.5px; }
.probnik-pole small { font-size: 10.5px; color: var(--muted); }
.probnik-pole code { font-family: Consolas, monospace; font-size: 10.5px; color: var(--muted); background: none; }

.probnik-podglad {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--pp-bg, #fff); color: var(--pp-text, #1e293b); min-height: 210px;
  display: flex; flex-direction: column;
}
.probnik-podglad .pp-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 11px; background: var(--pp-primary, #0f172a);
}
.probnik-podglad .pp-logo { width: 46px; height: 9px; border-radius: 3px; background: var(--pp-accent, #f59e0b); }
.probnik-podglad .pp-nav { display: flex; gap: 5px; }
.probnik-podglad .pp-nav i { width: 20px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.55); }
.probnik-podglad .pp-hero { padding: 15px 13px; display: flex; flex-direction: column; gap: 7px; }
.probnik-podglad .pp-hero b { font-size: 15px; color: var(--pp-primary, #0f172a); }
.probnik-podglad .pp-hero span { font-size: 11px; opacity: .8; line-height: 1.45; }
.probnik-podglad .pp-hero em {
  align-self: flex-start; font-style: normal; font-size: 11px; font-weight: 700;
  background: var(--pp-accent, #f59e0b); color: #111; border-radius: 8px; padding: 6px 13px; margin-top: 3px;
}
.probnik-podglad .pp-karty { display: flex; gap: 7px; padding: 0 13px 14px; margin-top: auto; }
.probnik-podglad .pp-karta {
  flex: 1; height: 42px; border-radius: 8px;
  background: color-mix(in srgb, var(--pp-primary, #0f172a) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--pp-primary, #0f172a) 22%, transparent);
}
.probnik-gotowe { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 15px 13px; }
.probnik-preset {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg-3); border: 1px solid var(--border); color: var(--muted);
  border-radius: 999px; padding: 5px 11px 5px 6px; font-size: 11.5px; cursor: pointer;
}
.probnik-preset:hover { color: var(--text); border-color: var(--bg-4); }
.probnik-preset span {
  width: 11px; height: 11px; border-radius: 3px; font-size: 0;
  border: 1px solid rgba(255,255,255,.2);
}
.probnik-stopka {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 12px 15px; border-top: 1px solid var(--border);
}

/* ============================================================
   DOLNA CZĘŚĆ CZATU (chipsy + input)
   ============================================================ */
.chat-bottom {
  flex: 0 0 auto; padding: 8px 14px 14px;
  border-top: 1px solid var(--border);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips:empty { margin: 0; }
.chip {
  background: var(--bg-2); border: 1px solid var(--border); color: var(--muted);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.chip:hover { background: var(--bg-3); color: var(--text); border-color: var(--bg-4); }
.chip.active { background: rgba(255, 255, 255, 0.05); color: var(--accent); border-color: var(--accent); }

.section-ctx {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: rgba(234,179,8,.08); border: 1px solid rgba(234,179,8,.3); border-radius: 8px;
  font-size: 12px; padding: 6px 10px; margin-bottom: 8px;
}
.section-ctx .sc-l { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.section-ctx code {
  display: block; font-family: Consolas, monospace; font-size: 10px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: none; padding: 0;
}
.section-ctx button { background: none; border: 0; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.section-ctx button:hover { color: var(--text); }
.section-ctx > span { display: inline-flex; align-items: center; gap: 6px; }

/* Input czatu — Manus / Claude / Antigravity Style: pływająca karta z pełną szerokością textarea i dolnym paskiem narzędzi */
.chat-input-box {
  display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px;
  padding: 12px 14px 10px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  position: relative;
}
.chat-input-box:focus-within {
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 10px 32px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.08);
}

.chat-input-top { display: flex; flex-direction: column; width: 100%; }
.chat-input-top textarea {
  width: 100%; box-sizing: border-box; resize: vertical;
  min-height: 52px; max-height: 35vh;
  background: transparent !important; color: var(--text);
  border: none !important; outline: none !important;
  padding: 2px 0 6px 0; font-size: 14px; font-family: inherit; line-height: 1.5;
  box-shadow: none !important;
}
.chat-input-top textarea::placeholder { color: var(--muted-2); }

/* Pasek narzędzi na dole karty */
.chat-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 6px; padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,.05);
}
.chat-toolbar-left, .chat-toolbar-right { display: flex; align-items: center; gap: 6px; }

/* Przyciski pomocnicze na pasku narzędzi */
.chat-tool-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: rgba(255,255,255,.03);
  color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all .12s ease;
}
.chat-tool-btn:hover {
  background: rgba(255,255,255,.08); color: var(--text); border-color: rgba(255,255,255,.15);
}
.chat-tool-btn .ico { width: 15px; height: 15px; stroke: currentColor; }
.chat-tool-btn.mic.rec {
  background: #dc2626; border-color: #ef4444; color: #fff; animation: pulse 1.2s infinite;
}

/* Główny przycisk wysłania / stop */
.chat-send-btn {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: var(--text); color: var(--bg); cursor: pointer;
  display: grid; place-items: center; transition: all .12s ease;
}
.chat-send-btn:hover { background: var(--accent-2); transform: translateY(-1px); }
.chat-send-btn:active { transform: scale(.93); }
.chat-send-btn .ico { width: 15px; height: 15px; stroke: var(--bg); }
.chat-send-btn.stop { background: #b91c1c; border: 1px solid #ef4444; }
.chat-send-btn.stop .ico { stroke: #fff; }

/* Pasek załączników */
.attach-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.attach-bar.hidden { display: none; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 7px;
  padding: 3px 4px 3px 4px; font-size: 12px; max-width: 180px;
  transition: border-color .12s;
}
.attach-chip:hover { border-color: var(--bg-4); }
.attach-chip .att-thumb { width: 28px; height: 28px; border-radius: 5px; object-fit: cover; flex: 0 0 auto; background: var(--bg-3); }
.attach-chip .att-fileico { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; background: var(--bg-3); border-radius: 5px; color: var(--muted); }
.attach-chip .att-fileico .ico { width: 14px; height: 14px; }
.attach-chip .att-info { min-width: 0; display: flex; flex-direction: column; gap: 1px; padding-right: 4px; }
.attach-chip .att-name { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px; }
.attach-chip .att-meta { color: var(--muted); font-size: 10px; }
.attach-chip .att-x { flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; align-self: flex-start; transition: background .12s, color .12s; }
.attach-chip .att-x:hover { background: var(--err); color: #fff; }
.attach-chip .att-x .ico { width: 10px; height: 10px; }
.attach-chip.uploading { opacity: .6; }
.attach-chip.uploading .att-x { display: none; }
.attach-chip .att-spin { width: 12px; height: 12px; border: 2px solid var(--border); border-top-color: var(--muted); border-radius: 50%; animation: att-spin .8s linear infinite; flex: 0 0 auto; }
@keyframes att-spin { to { transform: rotate(360deg); } }

.chat-bottom.dragging { background: rgba(255,255,255,.03); }
.chat-bottom.dragging .chat-input { outline: 1px dashed var(--bg-4); outline-offset: 2px; border-radius: var(--radius); }

/* Załączniki w dymku */
.bubble-atts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.bubble-atts img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.bubble-atts .ba-file { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; color: var(--text); }
.bubble-atts .ba-file .ico { width: 11px; height: 11px; color: var(--muted); }

/* Przyciski send/mic/stop */
.send {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 8px;
  border: 0; background: var(--text); color: var(--bg); cursor: pointer;
  transition: background .12s, transform .1s, opacity .12s;
  display: grid; place-items: center; padding: 0;
}
.send:hover { background: var(--accent-2); transform: translateY(-1px); }
.send:active { transform: scale(.93); }
.send .ico { width: 17px; height: 17px; display: block; stroke: var(--bg); }
.send.mic { background: var(--bg-2); border: 1px solid var(--border); color: var(--muted); }
.send.mic:hover { background: var(--bg-3); color: var(--text); border-color: var(--bg-4); }
.send.mic .ico { stroke: currentColor; }
.send.mic.rec { background: #dc2626; border-color: #ef4444; color: #fff; animation: pulse 1.2s infinite; }
.send.mic.rec .ico { stroke: #fff; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(239,68,68,.2); } }
.send.stop { background: #b91c1c; border: 1px solid #ef4444; }
.send.stop .ico { stroke: #fff; }
.send.attach { background: var(--bg-2); border: 1px solid var(--border); color: var(--muted); }
.send.attach .ico { stroke: var(--muted); }
.send.attach:hover { background: var(--bg-3); border-color: var(--bg-4); color: var(--text); }
.send:disabled { opacity: .3; cursor: not-allowed; }

/* ============================================================
   SPLITTER (Przeciąganie z precyzyjną pozycją krawędzi)
   ============================================================ */
.splitter {
  flex: 0 0 1px; background: var(--border);
  cursor: col-resize; position: relative; touch-action: none;
  transition: background .15s; z-index: 10;
}
.splitter::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: -8px; right: -8px; z-index: 5;
}
.splitter::after {
  content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 4px; height: 36px; border-radius: 4px;
  background: radial-gradient(circle, var(--bg-4) 1.2px, transparent 1.6px) 50% 8px / 4px 12px repeat-y;
  opacity: .5; transition: opacity .2s;
}
.splitter:hover, .splitter.drag { background: var(--bg-4); }
.splitter:hover::after, .splitter.drag::after { opacity: 1; }
body.mx-resizing { cursor: col-resize; user-select: none; }
body.mx-resizing iframe, body.mx-resizing .canvas-wrap { pointer-events: none; }

/* ============================================================
   CANVAS
   ============================================================ */
.canvas-pane {
  flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0;
  background: var(--canvas-bg);
}
.canvas-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 12px; background: var(--bg); border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.canvas-bar .group { display: flex; gap: 5px; }

.canvas-wrap { flex: 1 1 auto; position: relative; overflow: auto; display: flex; }
.frame-holder { flex: 1; display: flex; justify-content: center; padding: 0; min-height: 0; }
#preview {
  border: 0; background: #fff; width: 100%; height: 100%;
  display: block; transition: width .25s ease;
}
.vp-tablet .frame-holder { padding: 16px; }
.vp-mobile .frame-holder { padding: 16px; }
.vp-tablet #preview { width: 820px; max-width: 100%; border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.7); }
.vp-mobile #preview { width: 390px; max-width: 100%; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.7); }

.empty-state {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--empty-bg);
  text-align: center; color: var(--muted); gap: 6px; padding: 20px;
}
.empty-state.hidden { display: none; }
.empty-logo { margin-bottom: 6px; }
.empty-state h2 { margin: 0; color: var(--text); font-size: 20px; font-weight: 600; }
.empty-state p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.6; max-width: 340px; color: var(--muted); }

/* Overlay generowania */
.gen-overlay {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  background: var(--canvas-bg);
}
.gen-overlay.hidden { display: none; }
.gen-box { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(600px, 92%); }
.gen-ring { position: relative; width: 100px; height: 100px; }
.gen-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gr-bg { fill: none; stroke: var(--border); stroke-width: 7; }
.gr-fg { fill: none; stroke: var(--muted); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 301; stroke-dashoffset: 301; transition: stroke-dashoffset .4s ease; }
.gr-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.gr-txt b { font-size: 18px; font-weight: 700; }
.gr-txt span { font-size: 10px; color: var(--muted); }
/* Karta „trwa budowanie" w czacie — widoczna po powrocie do projektu, w którym coś się liczy.
   Zgłoszone: nakładka nad kanwą to za mało, czat po powrocie milczał o trwającej pracy. */
.karta-praca{border:1px solid var(--accent);background:linear-gradient(180deg,rgba(99,102,241,.10),transparent)}
.karta-praca b{display:block;margin-bottom:4px}
.karta-praca__czas{font-size:12px;color:var(--accent);font-weight:600;margin:2px 0 6px;display:flex;align-items:center;gap:7px}
.karta-praca__czas::before{content:'';width:8px;height:8px;border-radius:50%;background:var(--accent);
  animation:kartaPuls 1.4s ease-in-out infinite}
@keyframes kartaPuls{0%,100%{opacity:.35;transform:scale(.85)}50%{opacity:1;transform:scale(1.15)}}
.karta-praca small{color:var(--muted);font-size:11px;line-height:1.45;display:block}
@media (prefers-reduced-motion: reduce){.karta-praca__czas::before{animation:none}}
.gen-title { font-size: 14px; font-weight: 600; color: var(--text); }
/* ===== ŻYWA NAKŁADKA GENEROWANIA =====
   Zgłoszone: „niech podczas generowania zawsze jest animacja". Model potrafi myśleć 2-3 minuty
   bez jednego bajtu kodu — pierścień stoi wtedy na 2%, a ekran wygląda na zawieszony.
   Dlatego ruch jest NIEZALEŻNY od danych: pulsujący pierścień + płynąca fala + tykający czas. */
.gen-ring::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: .18; animation: genPuls 2.2s ease-in-out infinite;
}
@keyframes genPuls { 0%,100% { transform: scale(1); opacity: .16 } 50% { transform: scale(1.06); opacity: .34 } }
.gr-fg { animation: genOddech 2.6s ease-in-out infinite; }
@keyframes genOddech { 0%,100% { opacity: .75 } 50% { opacity: 1 } }
.gen-fala {
  width: min(260px, 70%); height: 3px; border-radius: 999px; overflow: hidden;
  background: var(--bg-3); position: relative;
}
.gen-fala i {
  position: absolute; top: 0; left: 0; height: 100%; width: 42%; border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: genFala 1.6s ease-in-out infinite;
}
@keyframes genFala { 0% { left: -45% } 100% { left: 100% } }
@media (prefers-reduced-motion: reduce) {
  .gen-ring::after, .gr-fg, .gen-fala i { animation: none; }
}
.gen-eta { font-size: 12px; color: var(--muted); min-height: 16px; }
.gen-term {
  width: 100%; background: #000; border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 14px 44px rgba(0,0,0,.6);
}
.gt-head { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,.06); }
.gt-head span { width: 9px; height: 9px; border-radius: 50%; background: #f87171; }
.gt-head span:nth-child(2) { background: #fbbf24; }
.gt-head span:nth-child(3) { background: #4ade80; }
.gt-head em { font-style: normal; font-size: 11px; color: var(--muted); margin-left: 6px; font-family: ui-monospace, Consolas, monospace; }
.gen-term pre {
  margin: 0; padding: 12px 14px; height: 200px; overflow: hidden;
  font: 11px/1.55 ui-monospace, Consolas, monospace;
  color: #71717a; white-space: pre-wrap; word-break: break-all;
}
.gen-term pre::after { content: '▌'; color: var(--muted); animation: gt-blink 1s steps(1) infinite; }
@keyframes gt-blink { 50% { opacity: 0; } }
/* LICZNIK pracy — zastąpił przewijający się kod (prośba: „tylko licznik").
   Trzy liczby zamiast animacji: ile kodu jest, jak szybko przychodzi, ile to trwa. */
.gen-licznik {
  display: flex; gap: 10px; width: 100%;
}
.gl-poz {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 8px; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.gl-poz b {
  font: 600 22px/1.1 ui-monospace, Consolas, monospace; color: var(--text);
  font-variant-numeric: tabular-nums;              /* liczby nie „skaczą" przy zmianie cyfr */
}
.gl-poz span { font-size: 11px; color: var(--muted); }
@media (max-width: 560px) { .gl-poz b { font-size: 18px; } }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--muted);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Kanwas graficzny */
.view-switch .btn.active { background: var(--bg-3); border-color: var(--border); color: var(--text); }
.board-count {
  font-size: 10px; font-weight: 700; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 5px; margin-left: 4px;
}
.image-board {
  position: absolute; inset: 0; overflow: hidden; z-index: 2;
  background: var(--canvas-bg);
  background-image: radial-gradient(circle, var(--border) .8px, transparent 1px);
  background-size: 24px 24px;
  cursor: default; touch-action: none;
}
.image-board.panning { cursor: grabbing; }
.board-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.board-img {
  position: absolute; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 10px; box-shadow: 0 10px 32px rgba(0,0,0,.5); width: 320px; transition: border-color .12s;
}
.board-img:hover { border-color: var(--bg-4); }
.board-img.sel { border-color: var(--bg-4); box-shadow: 0 0 0 2px rgba(255,255,255,.15); }
.board-img img { width: 100%; border-radius: 7px; display: block; background: var(--bg-3); min-height: 120px; }
.board-img .bi-cap { font-size: 10px; color: var(--muted); margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-img .bi-actions { display: flex; gap: 5px; margin-top: 7px; }
.board-img .bi-actions .btn { padding: 5px 9px; font-size: 11px; flex: 1; justify-content: center; }
.board-img.loading { display: grid; place-items: center; min-height: 200px; }
.board-hint {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: var(--muted); background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; pointer-events: none; white-space: nowrap;
}

/* ============================================================
   PRZYCISKI
   ============================================================ */
.btn {
  background: transparent; color: var(--muted);
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 6px 11px; font-size: 12.5px; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { background: var(--bg-3); color: var(--text); }
.btn:active { opacity: .8; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.icon { padding: 6px 8px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg-3); color: var(--text); }
.btn-primary {
  background: var(--text); border-color: var(--text); color: var(--bg);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--bg); }
.btn.active { background: var(--bg-3); color: var(--text); }
.btn.editing { background: rgba(234,179,8,.12); border-color: rgba(234,179,8,.4); color: #fbbf24; }
.wide { width: 100%; }

[data-theme="light"] .btn-primary { background: var(--text); color: #fff; border-color: var(--text); }
[data-theme="light"] .btn:hover { background: var(--bg-3); }

/* ============================================================
   SZUFLADA PROJEKTÓW (v0 sidebar style: szuflada zastąpiona
   przez sidebar; drawer zostaje jako fallback na mobile)
   ============================================================ */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; }
.backdrop.hidden { display: none; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 300px; z-index: 41;
  background: var(--bg-2); border-right: 1px solid var(--border);
  padding: 14px; transform: translateX(-105%); transition: transform .22s ease;
  display: flex; flex-direction: column; gap: 10px;
  overflow: hidden;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.drawer-head h3 { margin: 0; font-size: 15px; }
.drawer-tabs { display: flex; gap: 2px; flex-wrap: wrap; min-width: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.dtab {
  border: 0; background: transparent; color: var(--muted); border-radius: 7px;
  padding: 5px 9px; font-size: 12px; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.dtab.active { background: var(--bg-3); color: var(--text); font-weight: 600; }
.gal-open {
  justify-content: center; gap: 8px; padding: 10px 14px; font-size: 13px; font-weight: 600;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--muted); flex: 0 0 auto;
}
.gal-open:hover { border-color: var(--bg-4); color: var(--text); }
.gal-open .ico { width: 15px; height: 15px; }
/* Zgłoszone: wynik skanu importu URL (struktura sekcji, kolory, statystyki) się nie mieści
   i był ucinany — cała szuflada miała overflow:hidden. Widok przewija się teraz PIONOWO,
   a przewijanie w bok blokujemy, żeby długie słowa (np. lista kluczy sekcji) nie rozpychały
   szuflady w poziomie. */
.drawer-view { display: flex; flex-direction: column; gap: 10px; min-height: 0;
  overflow-y: auto; overflow-x: hidden; }
.tpl-actions { display: flex; gap: 4px; }
.tpl-actions .btn { padding: 4px 8px; font-size: 12px; }
.modal-body textarea {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; outline: none; resize: vertical; font-family: inherit;
}
.modal-body textarea:focus { border-color: var(--bg-4); }
.projects-list { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.proj-item {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: 8px 10px; cursor: pointer; transition: background .12s, border-color .12s;
}
.proj-item:hover { background: var(--bg-3); }
.proj-item.active { background: var(--bg-3); border-color: var(--border); }
.proj-item .pi-name { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-item .pi-meta { font-size: 11px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.proj-item .pi-meta .ico { width: 12px; height: 12px; }
.proj-item .pi-meta .ico.pub { color: var(--ok); }
.proj-item .pi-del { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 4px; display: grid; place-items: center; border-radius: 5px; }
.proj-item .pi-del:hover { color: var(--err); background: rgba(248,113,113,.1); }
.proj-item .pi-del .ico { width: 13px; height: 13px; }

/* GitHub search */
.gh-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; padding: 6px 10px;
}
.gh-search .ico { color: var(--muted); }
.gh-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font-size: 13px; font-family: inherit; }
.gh-results { display: flex; flex-direction: column; gap: 5px; overflow-y: auto; max-height: 40%; }
.tpl-sources { display: flex; flex-wrap: wrap; gap: 5px 8px; align-items: center; font-size: 11px; }
.tpl-sources .muted { width: 100%; }
.tpl-sources a { color: var(--muted); text-decoration: none; border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; transition: color .12s, border-color .12s; }
.tpl-sources a:hover { color: var(--text); border-color: var(--bg-4); }
.gh-results:empty { display: none; }
.gh-item { background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; }
.gh-item .gh-top { display: flex; align-items: center; gap: 8px; }
.gh-item a { color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.gh-item a:hover { color: var(--muted); }
.gh-item .gh-stars { font-size: 11px; color: var(--muted); white-space: nowrap; }
.gh-item p { margin: 4px 0 6px; font-size: 11.5px; color: var(--muted); line-height: 1.4; max-height: 32px; overflow: hidden; }
.gh-item .btn { padding: 4px 9px; font-size: 12px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal.hidden { display: none; }
.modal-box {
  width: 520px; max-width: 100%; max-height: 90vh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: 0 30px 80px rgba(0,0,0,.7);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-body label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.modal-body input, .modal-body select {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px; font-size: 14px; font-family: inherit; outline: none;
}
.modal-body input:focus, .modal-body select:focus { border-color: var(--bg-4); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.muted { color: var(--muted); font-size: 12px; }
.modal-foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); }
.test-result { font-size: 13px; border-radius: 8px; padding: 10px 12px; }
.test-result.ok  { background: rgba(74,222,128,.08);  border: 1px solid rgba(74,222,128,.3);  color: var(--ok); }
.test-result.err { background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.3); color: var(--err); }

/* Galeria */
.gal-box { width: min(1100px, 96vw); max-height: 90vh; display: flex; flex-direction: column; }
.gal-box .modal-head { flex-wrap: wrap; gap: 8px; }
.gal-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-left: auto; margin-right: 6px; }
.gal-body { overflow-y: auto; flex: 1; }
.gal-sec { margin-bottom: 18px; }
.gal-sec h4 { display: flex; align-items: center; gap: 6px; margin: 2px 0 10px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.gal-sec h4 .ico { color: var(--muted); }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.gal-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer; position: relative;
  transition: border-color .12s, transform .12s;
}
.gal-card:hover { border-color: var(--bg-4); transform: translateY(-1px); }
.gal-thumb { position: relative; aspect-ratio: 16/10; background: #fff; overflow: hidden; }
.gal-thumb iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
.gal-thumb .gal-ph { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg-3); color: var(--muted); }
.gal-thumb .gal-ph .ico { width: 26px; height: 26px; opacity: .5; }
.gal-thumb.gal-mod { background: var(--bg-3); display: grid; place-items: center; }
.gal-thumb.gal-mod .ico { width: 36px; height: 36px; color: var(--muted); }
.gal-info { padding: 9px 11px 10px; }
.gal-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gal-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.gal-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 5px; opacity: 0; transition: opacity .12s; }
.gal-card:hover .gal-actions, .gal-card:focus-within .gal-actions { opacity: 1; }
.gal-empty { color: var(--muted); font-size: 12px; padding: 6px 0 2px; }

/* Modal podglądu */
.pv-box { width: 700px; }
.pv-frame { height: 380px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.pv-frame iframe { width: 200%; height: 200%; border: 0; transform: scale(.5); transform-origin: 0 0; pointer-events: none; }
.pv-frame.pv-live { height: 500px; }
.pv-frame.pv-live iframe { width: 100%; height: 100%; transform: none; pointer-events: auto; }
.pv-box.pv-wide { width: min(940px, 96vw); }
.maks-row { display: flex; flex-direction: column; }
.pv-info { display: flex; gap: 12px; align-items: flex-start; padding: 6px 2px; font-size: 13px; line-height: 1.6; }
.pv-info .pv-ico { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 12px; background: var(--bg-3); border: 1px solid var(--border); display: grid; place-items: center; }
.pv-info .pv-ico .ico { width: 22px; height: 22px; color: var(--muted); }

/* Modal publikacji */
.pub-box { width: 660px; }
.pub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 720px) { .pub-grid { grid-template-columns: 1fr; } }
.pub-card { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pub-card.demo { opacity: .85; border-style: dashed; }
.pub-card h4 { margin: 0; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.pub-card h4 .ico { color: var(--muted); }
.pub-card p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; flex: 1; }
.pub-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.pub-sub { align-self: flex-start; font-size: 12px; padding: 5px 10px; }
.pill { font-size: 9px; font-weight: 700; letter-spacing: .8px; border-radius: 999px; padding: 2px 7px; margin-left: auto; }
.pill.ok   { color: var(--ok);  border: 1px solid rgba(74,222,128,.4); }
.pill.demo { color: var(--muted); border: 1px solid var(--border); }
.ftp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ftp-grid input { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 7px; padding: 7px 9px; font-size: 12px; font-family: inherit; outline: none; min-width: 0; }
.ftp-grid input:focus { border-color: var(--bg-4); }
.ftp-grid input:first-child { grid-column: 1 / -1; }
.share-line { display: flex; gap: 8px; }
.share-line input { flex: 1; min-width: 0; background: var(--bg); color: var(--ok); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 13px; font-family: Consolas, monospace; outline: none; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 18px; font-size: 13px; z-index: 60;
  box-shadow: 0 10px 36px rgba(0,0,0,.6);
  animation: toastIn .2s ease;
}
.toast.ok  { border-color: rgba(74,222,128,.4); }
.toast.err { border-color: rgba(248,113,113,.4); }
.toast.hidden { display: none; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 6px); } }

.hidden { display: none !important; }

/* ============================================================
   MAGAZYN SEKCJI
   ============================================================ */
.sec-panel {
  position: absolute; top: 50px; right: 10px; bottom: 10px; width: 280px; z-index: 6;
  display: flex; flex-direction: column; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: 0 16px 40px rgba(0,0,0,.6); overflow: hidden;
}
.sec-panel.hidden { display: none; }
.sec-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.sec-head b { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.sec-head b .ico { color: var(--muted); }
.sec-head .btn.icon { margin-left: auto; }
.sec-hint { padding: 8px 14px; font-size: 11.5px; color: var(--muted); line-height: 1.5; border-bottom: 1px solid var(--border); }
.sec-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.sec-row { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 8px; background: transparent; border: 1px solid transparent; cursor: pointer; transition: background .12s, border-color .12s; }
.sec-row:hover { background: var(--bg-3); border-color: var(--border); }
.sec-row.is-hidden { opacity: .55; }
.sec-row.is-hidden .sec-name { text-decoration: line-through; }
.sec-num { font-size: 10px; color: var(--muted-2); min-width: 16px; text-align: center; }
.sec-name { flex: 1; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec-tag { font-size: 10px; color: var(--muted-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
.sec-acts { display: flex; gap: 2px; }
.sec-acts button { border: 0; background: none; color: var(--muted); border-radius: 5px; padding: 4px; cursor: pointer; display: grid; place-items: center; }
.sec-acts button:hover { background: var(--bg-3); color: var(--text); }
.sec-acts button.on { color: var(--muted); }
.sec-acts .ico { width: 14px; height: 14px; }
.sec-empty { color: var(--muted); font-size: 12px; padding: 14px; text-align: center; }
@media (max-width: 720px) { .sec-panel { width: auto; left: 10px; } }

/* ============================================================
   BADGE RODZAJU PROJEKTU
   ============================================================ */
.kind-badge {
  font-size: 10px; font-weight: 600; letter-spacing: .02em;
  padding: 2px 7px; border-radius: 5px; cursor: default; white-space: nowrap;
}
.kind-badge.wp  { background: rgba(99,102,241,.12); color: #a5b4fc; cursor: pointer; }
.kind-badge.wp:hover { background: rgba(99,102,241,.2); }
.kind-badge.php { background: rgba(74,222,128,.1); color: var(--ok); }

/* ============================================================
   IMPORT URL (SCRAPER)
   ============================================================ */
.import-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.imp-opt { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; padding: 2px 0; }
.imp-opt input { accent-color: var(--text); width: 14px; height: 14px; }
.import-progress { margin: 8px 0; }
.imp-bar { height: 4px; background: var(--bg-3); border-radius: 99px; overflow: hidden; }
.imp-bar-fill { height: 100%; background: var(--text); width: 0%; transition: width .3s; }
.import-result { border: 1px solid var(--border); border-radius: 9px; padding: 10px; background: var(--bg-2); margin-top: 10px; }
.imp-res-head { font-size: 13px; font-weight: 600; margin-bottom: 6px; word-break: break-word; }
.imp-res-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.imp-stat { font-size: 11px; background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 3px 7px; color: var(--muted); }
.imp-stat b { color: var(--text); }
.imp-paleta { display: flex; gap: 4px; margin: 6px 0; flex-wrap: wrap; }
.imp-swatch { width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--border); cursor: pointer; }
.imp-kontakt { font-size: 11.5px; color: var(--muted); margin: 6px 0; line-height: 1.5; }
.imp-kontakt b { color: var(--text); }
.imp-modes { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.imp-mode { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 12px; transition: border-color .12s, background .12s; }
.imp-mode:hover { border-color: var(--bg-4); }
.imp-mode.sel { border-color: var(--bg-4); background: var(--bg-3); }
.imp-mode input { margin-top: 2px; accent-color: var(--text); }
.imp-mode-t { font-weight: 600; color: var(--text); }
.imp-mode-d { color: var(--muted); font-size: 11px; margin-top: 2px; }
.imp-actions { display: flex; gap: 6px; margin-top: 10px; }
.imp-preview-iframe { width: 100%; height: 180px; border: 1px solid var(--border); border-radius: 8px; background: white; margin-top: 8px; }
.imp-nieudane { font-size: 11px; color: var(--err); margin-top: 4px; }
.imp-sep { border: none; border-top: 1px solid var(--border); margin: 10px 0; }

/* Siatka obrazów */
.images-result { margin-top: 10px; }
.img-sekcja { margin-bottom: 12px; }
.img-sekcja-h { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 5px; text-transform: capitalize; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 7px; }
.img-card { border: 1px solid var(--border); border-radius: 7px; padding: 5px; background: var(--bg-2); cursor: pointer; transition: border-color .12s; }
.img-card:hover { border-color: var(--bg-4); }
.img-thumb { width: 100%; height: 72px; border-radius: 4px; overflow: hidden; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.img-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.img-meta { display: flex; gap: 4px; margin-top: 3px; font-size: 10px; }
.img-dim { color: var(--muted); }
.img-fmt { color: var(--muted); text-transform: uppercase; font-weight: 600; }
.img-alt { font-size: 10px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.img-path { display: block; font-size: 9px; color: var(--muted-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: monospace; }
.img-fails { margin: 5px 0; }

/* Sidebar projects list */
#sidebarProjectsList { display: flex; flex-direction: column; gap: 2px; }

/* Quick shortcuts */

.welcome-shortcuts-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin: 12px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.welcome-shortcuts-title .ico {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.welcome-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.welcome-shortcut-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  text-align: left;
  line-height: 1.2;
}

.welcome-shortcut-card:hover {
  background: var(--bg-3);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.2);
}

.welcome-shortcut-card .ico {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--accent);
  transition: transform .15s ease;
}

.welcome-shortcut-card:hover .ico {
  transform: scale(1.15);
}

/* ============================================================
   MOBILE - mcanvas defaults
   ============================================================ */
.mcanvas-fab, .mcanvas-back { display: none; }

@media (max-width: 860px), (orientation: landscape) and (max-height: 500px) {
  html, body, #app, .split { overflow-x: hidden; max-width: 100vw; }
  .v0-sidebar { display: none; }

  input, textarea, select, #chatText,
  .chat-input textarea, .gh-search input,
  .modal-body input, .modal-body select, .modal-body textarea,
  .ftp-grid input, .share-line input { font-size: 16px; }
  .chat-bottom { padding-bottom: max(12px, env(safe-area-inset-bottom)); }

  .proj-name-wrap, #costBadge, #btnClaim, .badge.alfa { display: none !important; }
  .logo-word i { display: none; }
  .topbar { gap: 4px; padding: max(6px, env(safe-area-inset-top)) 8px 6px; flex-wrap: nowrap; overflow: visible; }

  .brand { display: flex !important; align-items: center; gap: 0; flex-shrink: 0; }
  .brand .logo-word { display: none; }
  .brand .logo-mark { width: 26px; height: 26px; }

  .top-right { gap: 4px; flex-shrink: 0; align-items: center; display: flex; }

  .topbar .btn-ghost,
  .topbar .btn-primary { font-size: 0 !important; padding: 7px !important; min-width: 34px; min-height: 34px; flex-shrink: 0; }
  .topbar .btn-ghost .ico,
  .topbar .btn-primary .ico { width: 16px; height: 16px; }
  #btnPublishLabel { display: none; }

  .model-dropdown { flex-shrink: 1; min-width: 0; max-width: 175px; }
  .md-trigger { padding: 5px 8px 5px 7px; gap: 5px; border-radius: 8px; }
  .md-label { max-width: 105px; font-size: 11px; }
  .md-list { right: auto; left: 0; min-width: 255px; max-width: calc(100vw - 16px); z-index: 300; }

  .split { position: relative; }
  .splitter { display: none; }
  .chat-pane { width: 100%; max-width: none; height: 100%; border-right: 0; }
  .canvas-pane { position: fixed; inset: 0; z-index: 60; height: 100%; width: 100%; transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1); box-shadow: -10px 0 36px rgba(0,0,0,.7); }
  body.mx-mcanvas .canvas-pane { transform: translateX(0); }
  body.mx-mcanvas .topbar { display: none; }
  
  .ch-hint { display: none; }

  .mcanvas-fab { display: inline-flex; align-items: center; gap: 6px; position: fixed; right: 14px; top: calc(56px + env(safe-area-inset-top)); z-index: 58; background: var(--text); color: var(--bg); border: 0; border-radius: 999px; padding: 10px 16px; font-size: 13.5px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
  .mcanvas-fab .ico { width: 16px; height: 16px; stroke: var(--bg); }
  body.mx-mcanvas .mcanvas-fab { display: none; }

  .mcanvas-back { display: none; align-items: center; gap: 5px; position: fixed; left: 10px; top: calc(8px + env(safe-area-inset-top)); z-index: 63; background: var(--bg-2); color: var(--text); border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 40px; }
  body.mx-mcanvas .mcanvas-back { display: inline-flex; }

  .canvas-bar { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; gap: 4px; padding: max(8px, env(safe-area-inset-top)) 8px 8px 84px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .canvas-bar::-webkit-scrollbar { display: none; }
  .canvas-bar .group { flex-shrink: 0; }
  .canvas-bar .btn { padding: 5px 8px; font-size: 11.5px; white-space: nowrap; flex-shrink: 0; }
  .sec-panel { top: 48px; }
}

@media (max-width: 480px) {
  .md-label { max-width: 72px; font-size: 10.5px; }
  .model-dropdown { max-width: 140px; }
}

/* ===== pasek postępu sekcji (fabryka sekcji, tryb wieloagentowy) ===== */
.ma-sekcje { display: flex; align-items: center; gap: 12px; padding: 10px 14px 2px; }
.ma-sekcje.hidden { display: none; }
.ma-sek-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--bg-3, rgba(148,163,184,.2)); overflow: hidden; }
.ma-sek-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #a855f7); transition: width .5s ease; }
.ma-sek-txt { font-size: 12px; font-weight: 700; color: var(--muted, #94a3b8); white-space: nowrap; }

/* podpowiedź przy modelu w przełączniku czatu (np. czas oczekiwania w kolejce NVIDIA) */
/* Notka pod nazwa modelu MUSI zostac w jednej linijce - inaczej lista modeli rozlewa sie
   na trzy ekrany i nie miesci sie w oknie (zgloszone). Pelna tresc zostaje w tooltipie. */
.md-opt-hint { font-size: 10.5px; color: var(--muted); line-height: 1.35; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.md-opt-text { min-width: 0; }

/* kafelki kluczy: nowe grupy dostawców */
.kc-badge.nvidia { color: #76b900; border-color: rgba(118,185,0,.45); background: rgba(118,185,0,.10); }
.kc-badge.cline  { color: #22d3ee; border-color: rgba(34,211,238,.45); background: rgba(34,211,238,.08); }
.kc-badge.kilo   { color: #f472b6; border-color: rgba(244,114,182,.45); background: rgba(244,114,182,.08); }

/* markdown w czacie: nagłówki, listy, separator */
.msg .md-h { display: block; margin: 10px 0 4px; font-size: 14.5px; }
.msg .md-li { display: block; padding-left: 4px; }
.msg .md-hr { border: 0; border-top: 1px solid var(--border); margin: 10px 0; }
.kc-badge.cheapest { color: #f59e0b; border-color: rgba(245,158,11,.45); background: rgba(245,158,11,.10); }

/* Adres projektu w nagłówku: stała ścieżka /s/NAZWA, niezależna od nazwy projektu.
   Pokazujemy ją jawnie, bo to pod nią żyje opublikowana strona i jej podstrony. */
.proj-path {
  font-size: 10.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .12s, border-color .12s;
}
.proj-path:hover { color: var(--text); border-color: rgba(99, 102, 241, .45); }

/* PTASZEK SKILLI EKSPERYMENTALNYCH w pasku czatu. Wyglada jak przelacznik, nie jak formularz:
   wlaczony swieci akcentem, zeby bylo widac, ze strona powstanie inaczej niz zwykle. */
.ultra-ptaszek {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none;
  padding: 6px 9px; margin-right: 2px; border: 1px solid var(--border); border-radius: 999px;
  font: 700 11px/1 ui-sans-serif, system-ui; letter-spacing: .6px; color: var(--muted);
}
.ultra-ptaszek:hover { border-color: var(--accent); color: var(--text); }
.ultra-ptaszek input { accent-color: var(--accent); width: 13px; height: 13px; margin: 0; cursor: pointer; }
.ultra-ptaszek.on { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 2px rgba(99,102,241,.15); }

/* ===== OKNO WYBORU MODELI — dopracowanie =====
   Lista jest teraz dwukolumnowa i dluga, wiec potrzebuje wlasnej hierarchii: naglowki grup
   musza sie kleic przy przewijaniu, kolumny potrzebuja rozdzielenia, a pasek przewijania
   nie moze wygladac jak systemowy element wciety w ciemne tlo. */
.md-list.md-dwie { padding: 8px; row-gap: 2px; }
.md-list.md-dwie .md-opt-group {
  position: sticky; top: -8px; z-index: 2;
  background: #16181f; padding: 8px 6px 6px; margin: 0 -2px;
  font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
/* pionowa kreska miedzy kolumnami — bez niej dwie kolumny zlewaja sie w jedna plame */
.md-list.md-dwie .md-option:nth-child(odd) { box-shadow: 1px 0 0 rgba(255,255,255,.05); }
.md-list.md-dwie .md-option { border-radius: 10px; padding: 8px 10px; align-items: flex-start; }
.md-list.md-dwie .md-opt-name { font-size: 12.5px; line-height: 1.25; }
.md-list.md-dwie .md-opt-rank { align-self: center; }
/* pasek przewijania dopasowany do ciemnego okna */
.md-list.md-dwie::-webkit-scrollbar { width: 10px; }
.md-list.md-dwie::-webkit-scrollbar-track { background: transparent; }
.md-list.md-dwie::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.14); border-radius: 999px; border: 3px solid #16181f;
}
.md-list.md-dwie::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.24); }
/* na waskim ekranie wracamy do jednej kolumny — dwie kolumny na telefonie to nieczytelne slupki */
@media (max-width: 899px) {
  .model-dropdown[aria-expanded="true"] .md-list.md-dwie { display: block; }
  .md-list.md-dwie { min-width: 290px; max-height: 70vh; overflow-y: auto; }
}

/* ===== ANIMACJA NANOSZENIA POPRAWKI =====
   Zgloszone: "nie nanosi poprawek" - czesciowo dlatego, ze nie bylo tego WIDAC. Poprawka
   jednej sekcji trwa kilkanascie sekund i przez ten czas ekran wygladal jak zamarly.
   Pasek plynie od pierwszej chwili, jeszcze zanim przyjdzie pierwszy znak kodu. */
.gen-fala { position: relative; height: 3px; width: 100%; overflow: hidden;
  background: rgba(255,255,255,.07); border-radius: 999px; margin: 10px 0 4px; }
.gen-fala i { position: absolute; inset: 0; display: block; border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: mx-fala 1.15s cubic-bezier(.4,0,.2,1) infinite; }
@keyframes mx-fala { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
/* licznik przy poprawce: liczby pulsuja delikatnie, zeby bylo widac, ze rosna */
.gl-poz b { transition: color .18s ease; }
.gl-poz b.mx-tyka { color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .gen-fala i { animation: none; background: var(--accent); opacity: .5; }
}

/* ===== PRZEŁĄCZNIK JĘZYKA (PL/EN/RU) =====
   Prośba: "trzy języki... system sam wykrywa kraj i odpala odpowiedni język; przełącznik".
   Wzorowany na .sidebar-btn (ta sama wysokość i wcięcie), z rozwijaną listą trzech pozycji —
   jak przełącznik motywu, ale z wyborem zamiast dwustanowego kliknięcia. */
.lang-switch { position: relative; }
.lang-switch #langBtnLabel { font-weight: 700; letter-spacing: .4px; font-size: 12px; }
.lang-menu {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 0; min-width: 150px;
  background: #16181f; border: 1px solid rgba(255,255,255,.10); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.5); padding: 5px; z-index: 60;
}
.lang-switch.open .lang-menu { display: block; }
.lang-menu button {
  display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 7px;
  border: 0; background: transparent; color: var(--text); font: 13px/1.3 inherit; cursor: pointer;
}
.lang-menu button:hover { background: var(--bg-3); }
.lang-menu button.active { color: var(--accent); font-weight: 700; }

/* Przycisk Blog WYRÓŻNIONY — zgłoszone: "bardziej widoczny przycisk blog". Zwykły .btn-ghost
   jest celowo bezbarwny i zlewał się z resztą paska; Blog to osobna, warta kliknięcia
   podstrona, więc dostaje wyraźny obrys w kolorze akcentu zamiast neutralnego szarego. */
.btn-blog-highlight {
  border: 1.5px solid var(--accent); color: var(--accent); background: transparent;
}
.btn-blog-highlight:hover { background: var(--accent); color: #fff; }
