/* platform/public/assets/css/app.css — wspólne style platformy
   Redesign wg handoffu "MultiInbox Redesign" v2 (Claude Design):
   Hanken Grotesk (UI) + Bricolage Grotesque (display) + JetBrains Mono (dane),
   ciepła paleta, ikony SVG zamiast emoji. */

:root {
  --primary: #1F4B99;       /* per-tenant nadpisywane inline w inbox.php */
  --primary-soft: #EAF0FB;
  --bg: #FAF9F6;
  --surface: #FFFFFF;
  --border: #E6E0D1;
  --border-soft: #F3EFE4;
  --text: #14171C;
  --muted: #4B5563;
  --muted-2: #8B8F98;
  --white: #fff;

  --success: #1F7A4D;
  --success-soft: #E4F5EA;
  --warn: #9A6300;
  --warn-soft: #FBF0D9;
  --danger: #B3261E;
  --danger-soft: #FBE8E6;

  /* pary tło/tekst awatarów (nadpisywane przez motyw ciemny) */
  --av1-bg: #EAF0FB; --av1-fg: #1F4B99;  /* niebieski */
  --av2-bg: #E4F5EA; --av2-fg: #1F7A4D;  /* zielony */
  --av3-bg: #FBF0D9; --av3-fg: #9A6300;  /* bursztyn */
  --av4-bg: #FBE8E6; --av4-fg: #B3261E;  /* czerwony */
  --av5-bg: #F0E9FB; --av5-fg: #6B3FA0;  /* fioletowy */
  --av6-bg: #E2F3F5; --av6-fg: #0F6674;  /* morski */
  --av7-bg: #FBE9F2; --av7-fg: #A62667;  /* różowy */
  --av8-bg: #EDF3E2; --av8-fg: #4F6F1F;  /* oliwkowy */
  --av-al-bg: #FDEBD7; --av-al-fg: #B45A00; /* awatar systemowy Allegro */

  /* paleta kafelków skrzynek/przycisków (pastelowe + żywe) — motyw ciemny
     podmienia je na swoje odpowiedniki */
  --pal-blue-bg: #EAF0FB; --pal-blue-fg: #1F4B99;
  --pal-green-bg: #E4F5EA; --pal-green-fg: #1F7A4D;
  --pal-amber-bg: #FBF0D9; --pal-amber-fg: #9A6300;
  --pal-red-bg: #FBE8E6; --pal-red-fg: #B3261E;
  --pal-violet-bg: #F0E9FB; --pal-violet-fg: #6B3FA0;
  --pal-teal-bg: #E2F3F5; --pal-teal-fg: #0F6674;
  --pal-pink-bg: #FBE9F2; --pal-pink-fg: #A62667;
  --pal-olive-bg: #EDF3E2; --pal-olive-fg: #4F6F1F;
  --pal-orange-bg: #FDEBD7; --pal-orange-fg: #B45A00;
  --pal-graphite-bg: #ECEDEF; --pal-graphite-fg: #3A3F47;
  --pal-blue-v-bg: #2563EB; --pal-blue-v-fg: #FFFFFF;
  --pal-green-v-bg: #16A34A; --pal-green-v-fg: #FFFFFF;
  --pal-amber-v-bg: #F59E0B; --pal-amber-v-fg: #FFFFFF;
  --pal-red-v-bg: #DC2626; --pal-red-v-fg: #FFFFFF;
  --pal-violet-v-bg: #7C3AED; --pal-violet-v-fg: #FFFFFF;
  --pal-teal-v-bg: #0D9488; --pal-teal-v-fg: #FFFFFF;
  --pal-pink-v-bg: #DB2777; --pal-pink-v-fg: #FFFFFF;
  --pal-olive-v-bg: #65A30D; --pal-olive-v-fg: #FFFFFF;
  --pal-orange-v-bg: #EA580C; --pal-orange-v-fg: #FFFFFF;
  --pal-graphite-v-bg: #374151; --pal-graphite-v-fg: #FFFFFF;

  --font-ui: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --font-display: 'Bricolage Grotesque', 'Hanken Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

/* ---------- Paski przewijania — smukłe, w kolorach motywu ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb, #D5D0C4) transparent; } /* Firefox */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb, #D5D0C4);
  border-radius: 8px;
  border: 2px solid transparent; /* "odchudza" uchwyt do ~5px */
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover, #B9B3A4); background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-corner { background: transparent; }
body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-weight: 700; }
code { background: var(--border-soft); padding: 1px 5px; border-radius: 4px; font-size: 12px; font-family: var(--font-mono); }
pre { background: var(--border-soft); padding: 10px; border-radius: 10px; overflow-x: auto; font-family: var(--font-mono); }
svg { vertical-align: -2px; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }

/* ---------- Przyciski / formularze ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(0.95); text-decoration: none; }
.btn-outline { background: var(--surface); color: var(--primary); border-color: var(--border); }
.btn-sm { padding: 4px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 13px 28px; font-size: 15.5px; }

/* przyciski-ikony (pasek akcji nad listą) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px;
  border: 1px solid transparent; background: none; color: var(--muted);
  cursor: pointer; padding: 0;
}
.icon-btn:hover { background: var(--border-soft); color: var(--text); }
.icon-btn.icon-active { background: var(--primary-soft); color: var(--primary); }

label { display: block; margin: 10px 0; font-weight: 600; }
label small { font-weight: 400; color: var(--muted-2); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="color"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  margin-top: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
label.checkbox { font-weight: 400; }
label.checkbox input { width: auto; margin-right: 6px; }
textarea { resize: vertical; }
.form { max-width: 860px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 20px; }
.form-inline { display: flex; gap: 10px; align-items: center; max-width: 500px; }

.flash { padding: 10px 16px; border-radius: 10px; margin: 10px 16px; }
.flash-success { background: var(--success-soft); color: var(--success); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-info { background: var(--primary-soft); color: var(--primary); }
.text-error { color: var(--danger); }
.nowrap { white-space: nowrap; }
.hint { color: var(--muted); }

.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border-soft); }
.table th { background: var(--border-soft); font-weight: 600; font-size: 12.5px; }
.table td small { color: var(--muted-2); }

/* ---------- Górny pasek ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--topbar-bg, var(--surface));
  border-bottom: 1px solid var(--border);
  padding: 9px 18px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; color: var(--text); font-family: var(--font-display); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand svg { color: var(--primary); }
.brand-logo { height: 30px; }
.topbar-search { flex: 1; max-width: 640px; position: relative; }
.topbar-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.topbar-search input { border-radius: 24px; background: var(--search-bg, var(--bg)); border: 1px solid var(--search-border, transparent); padding: 10px 18px 10px 38px; margin-top: 0; }
.topbar-search input:focus { background: var(--surface); border-color: var(--border); }
.topbar-nav { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.topbar-nav a { color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.topbar-nav a:hover { color: var(--text); text-decoration: none; }
.topbar-nav a.active { font-weight: 700; color: var(--text); }
.topbar-user { color: var(--muted-2); }

/* ---------- Szybka zmiana wyglądu (pasek górny) ---------- */
.tb-appear { position: relative; display: inline-flex; }
.tb-appear-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--search-bg, var(--bg)); color: var(--muted);
  border: 1px solid var(--search-border, var(--border)); border-radius: 22px;
  padding: 7px 12px; font-weight: 500; font-size: 14px; cursor: pointer;
}
.tb-appear-btn:hover { color: var(--text); border-color: var(--border); }
.tb-appear-btn .tb-chev { color: var(--muted-2); }
.tb-appear-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: 260px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 12px 34px rgba(0,0,0,.18); padding: 12px;
}
.tb-appear-pop .apx-head {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); margin: 4px 2px 7px;
}
.tb-appear-pop .apx-head:not(:first-child) { margin-top: 12px; }

/* wybór układu */
.apx-layouts { display: flex; gap: 8px; }
.apx-layout {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 9px 6px; border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text); font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.apx-layout:hover { border-color: var(--muted-2); }
.apx-layout.sel { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.apx-lp { display: flex; gap: 3px; width: 100%; height: 30px; }
.apx-lp > span { border-radius: 4px; border: 1px solid var(--border); background: var(--surface); }
.apx-lp-classic > span:first-child { flex: 1; }
.apx-lp-classic > span:last-child { flex: 1.4; }
.apx-lp-focus > span:first-child { flex: 2; }
.apx-lp-focus > span:last-child { width: 12px; flex: none; background: var(--primary-soft); }

/* wybór motywu */
.apx-themes { display: flex; flex-direction: column; gap: 4px; }
.apx-theme {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 8px; border: 1.5px solid transparent; border-radius: 9px;
  background: transparent; color: var(--text); font-size: 13.5px; cursor: pointer; text-align: left;
}
.apx-theme:hover { background: var(--bg); }
.apx-theme.sel { border-color: var(--primary); background: var(--primary-soft); }
.apx-sw { display: inline-flex; gap: 3px; flex-shrink: 0; }
.apx-sw > span { width: 16px; height: 16px; border-radius: 5px; border: 1px solid rgba(0,0,0,.12); }
.apx-tn { flex: 1; }
.apx-check { color: var(--primary); display: inline-flex; }
.apx-custom {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 10px; padding: 9px; border: 1px dashed var(--border); border-radius: 10px;
  color: var(--primary); font-weight: 600; font-size: 13.5px;
}
.apx-custom:hover { background: var(--primary-soft); text-decoration: none; }

.footer { text-align: center; color: var(--muted-2); padding: 22px; font-size: 13px; }

/* ---------- Logowanie / rejestracja (split-screen) + instalator ---------- */

.auth-box {
  max-width: 420px;
  margin: 60px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 30px 34px;
}
.auth-box h1 { margin-top: 0; }
.auth-box .flash { margin: 10px 0; }

.auth-split { display: flex; min-height: 100vh; }
.auth-left {
  flex: 0 0 55%;
  background: var(--text);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 56px;
}
.auth-left .brand { color: #fff; font-size: 19px; }
.auth-left .brand svg { color: #fff; }
.auth-quote { font-size: 27px; font-weight: 700; line-height: 1.35; max-width: 480px; }
.auth-quote small { display: block; margin-top: 16px; font-size: 14px; font-weight: 400; color: rgba(255,255,255,.65); }
.auth-copy { color: rgba(255,255,255,.5); font-size: 13px; }
.auth-right {
  flex: 1;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
}
.auth-card {
  width: 400px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px;
}
.auth-card h1 { margin: 0 0 4px; font-size: 24px; }
.auth-card .auth-sub { color: var(--muted-2); margin: 0 0 14px; }
.auth-card .btn { width: 100%; justify-content: center; }
.auth-card .auth-alt { text-align: center; margin-top: 14px; color: var(--muted); }
.auth-card .flash { margin: 10px 0; }

/* ---------- Landing ---------- */

.landing { background: var(--surface); }
.landing-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 34px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 10;
}
.landing-brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; color: var(--text); font-family: var(--font-display); letter-spacing: -.01em; }
.landing-brand svg { color: var(--primary); }
.landing-header nav { display: flex; gap: 22px; align-items: center; }
.landing-header nav a { color: var(--muted); font-weight: 500; }
.landing-header nav a:hover { color: var(--text); text-decoration: none; }
.landing-header nav a.btn { color: #fff; }

.hero { text-align: center; padding: 76px 20px 60px; background: var(--bg); }
.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--primary); background: var(--primary-soft);
  padding: 6px 16px; border-radius: 20px; margin-bottom: 22px;
}
.hero h1 { font-size: 48px; font-weight: 800; margin: 0 0 16px; line-height: 1.12; font-family: var(--font-display); letter-spacing: -.01em; }
.hero p { font-size: 17px; color: var(--muted); max-width: 600px; margin: 0 auto 30px; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  max-width: 1100px;
  margin: 48px auto;
  padding: 0 20px;
}
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.feature-icon {
  width: 38px; height: 38px; border-radius: 9px; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.feature h3 { margin: 0 0 6px; font-size: 16.5px; font-weight: 600; }
.feature p { color: var(--muted); font-size: 14px; margin: 0; }

.pricing { text-align: center; padding: 44px 20px 64px; background: var(--bg); border-top: 1px solid var(--border); }
.pricing h2 { font-size: 28px; font-family: var(--font-display); letter-spacing: -.01em; }
.pricing-grid { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.price-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 26px; width: 264px; }
.price-card.featured { border-color: var(--primary); }
.price-tag {
  position: absolute; top: -11px; left: 18px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
  background: var(--primary); color: #fff; border-radius: 12px; padding: 3px 12px;
}
.price-card .price { font-size: 32px; font-weight: 800; margin: 10px 0; }
.price-card .price span { font-size: 14px; color: var(--muted-2); font-weight: 400; }
.price-card ul { text-align: left; padding-left: 20px; color: var(--muted); }
.pricing-note { color: var(--muted-2); max-width: 700px; margin: 26px auto 0; }

/* ---------- Panel ustawień ---------- */

.settings-wrap { display: flex; min-height: calc(100vh - 100px); background: var(--surface); }
.settings-nav { width: 230px; padding: 18px 0; background: var(--surface); border-right: 1px solid var(--border); }
.settings-nav ul { list-style: none; margin: 0; padding: 0; }
.settings-nav li a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; color: var(--muted);
  border-radius: 0 20px 20px 0; font-weight: 500;
}
.settings-nav li a svg { flex-shrink: 0; }
.settings-nav li a:hover { background: var(--border-soft); color: var(--text); text-decoration: none; }
.settings-nav li.active a { background: var(--primary-soft); font-weight: 700; color: var(--primary); }
.settings-main { flex: 1; background: var(--surface); padding: 28px 34px; }
.settings-main h1 { display: flex; align-items: center; gap: 16px; font-size: 22px; margin-top: 0; }
.cards { display: flex; gap: 16px; flex-wrap: wrap; }
.card { border: 1px solid var(--border); border-radius: 12px; padding: 18px 26px; min-width: 150px; text-align: center; background: var(--surface); }
.card-num { font-size: 28px; font-weight: 800; color: var(--primary); }
.steps li { margin: 6px 0; color: var(--muted); line-height: 1.9; }

/* ---------- Skrzynka (styl Gmail) ---------- */

.inbox-page { overflow: hidden; }
.inbox-layout { display: flex; height: calc(100vh - 53px); }

.inbox-sidebar {
  width: 230px;
  padding: 14px 8px 14px 0;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: stretch;
  background: var(--sidebar-bg, var(--surface));
  border-right: 1px solid var(--border);
  transition: width .15s ease;
}

/* przycisk zwijania menu do ikon — przyklejony na dole menu */
.side-toggle {
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  width: 30px; height: 30px;
  margin: 14px 8px 0 auto;    /* dociśnięty do prawej */
  margin-top: auto;           /* zawsze na dole menu */
  position: sticky; bottom: 0; /* widoczny też przy przewiniętej liście */
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--sidebar-bg, var(--surface)); color: var(--muted); cursor: pointer;
  box-shadow: 0 -2px 6px rgba(20,23,28,.06);
}
.side-toggle:hover { color: var(--primary); border-color: var(--primary); }

/* --- MENU ZWINIĘTE DO IKON (tylko szerokie ekrany; na wąskich menu jest
   nad listą i zwijanie nie ma zastosowania) --- */
@media (min-width: 1001px) {
  /* szerokość mieści kafelek 30 px + chmurkę z licznikiem obok */
  .inbox-sidebar.collapsed { width: 84px; padding-right: 0; }
  .inbox-sidebar.collapsed .side-toggle { margin-left: auto; margin-right: auto; }
  .inbox-sidebar.collapsed .side-toggle svg { transform: rotate(180deg); }
  .inbox-sidebar.collapsed .sidebar-section,
  .inbox-sidebar.collapsed .sidebar-empty,
  .inbox-sidebar.collapsed .ch-info,
  .inbox-sidebar.collapsed .folder-label,
  .inbox-sidebar.collapsed .folder-total,
  .inbox-sidebar.collapsed .grp-unread,
  .inbox-sidebar.collapsed .bc-label,
  .inbox-sidebar.collapsed li.ch-group { display: none !important; }
  /* pozycje ukryte przez zwinięte grupy wracają widoczne (nagłówków grup nie ma) */
  .inbox-sidebar.collapsed #channel-list li[data-channel],
  .inbox-sidebar.collapsed #status-list li[data-status],
  .inbox-sidebar.collapsed .folder-list li[data-folder] { display: flex !important; }
  /* wszystkie ikony wyrównane do LEWEJ w jednej kolumnie (nie tylko te
     z licznikiem); mniejsze ikony folderów/statusów dostają większy odstęp,
     żeby ich środek pokrywał się ze środkiem kafelków skrzynek */
  .inbox-sidebar.collapsed .channel-list li,
  .inbox-sidebar.collapsed .folder-list li {
    justify-content: flex-start; padding: 7px 2px 7px 12px; margin: 0 6px;
    border-radius: 10px; gap: 4px;
  }
  .inbox-sidebar.collapsed .folder-list li { padding-left: 19px; }
  .inbox-sidebar.collapsed .folder-list li.sub { padding: 5px 2px 5px 19px; }
  /* liczniki nieprzeczytanych zostają widoczne obok ikony — mniejsze,
     żeby razem z kafelkiem mieściły się w pasku */
  .inbox-sidebar.collapsed .ch-unread,
  .inbox-sidebar.collapsed .folder-unread {
    margin-left: 0; font-size: 10px; padding: 1px 5px; min-width: 0;
  }
  .inbox-sidebar.collapsed #status-list .folder-unread { margin-left: 0; }
  .inbox-sidebar.collapsed .btn-compose {
    width: 40px; margin: 4px 0 6px 13px; padding: 11px 0;
  }
}
.btn-compose {
  display: flex; justify-content: center;
  width: calc(100% - 32px); margin: 4px 16px 6px;
  padding: 12px; border-radius: 10px; font-size: 14.5px;
  box-shadow: 0 1px 3px rgba(20,23,28,.14);
}
.sidebar-section {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  color: var(--muted-2); padding: 12px 16px 5px; letter-spacing: .06em;
}
/* pierwszy nagłówek (SKRZYNKI) bliżej przycisku Napisz */
.btn-compose + .sidebar-section { padding-top: 2px; }
.sidebar-empty { padding: 4px 16px; color: var(--muted-2); }
.channel-list, .folder-list { list-style: none; margin: 0; padding: 0; }
.channel-list li, .folder-list li {
  padding: 7px 16px;
  border-radius: 0 20px 20px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  overflow: hidden;
  color: var(--text);
}
#channel-list li { align-items: center; padding: 7px 16px; }
/* kafelek skrzynki: kolor + ikona zamiast kropki */
.ch-ico {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.ch-ico svg { vertical-align: 0; }
/* własna wgrana ikona kafelka */
.ch-ico-img { padding: 0; overflow: hidden; background: var(--border-soft); }
.ch-ico-img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
/* litera jako ikona kafelka (kolory z wybranej palety) */
.ch-ico-letter { font-weight: 700; font-size: 14px; font-family: var(--font-ui); line-height: 1; }
/* oficjalny znak Allegro (pomarańczowy kafelek z białym "a") */
.ch-ico-allegro {
  background: #FF5A00; color: #fff; font-weight: 800; font-size: 19px;
  font-family: var(--font-display); line-height: 1; padding-bottom: 4px;
}

/* wybór koloru/ikony kafelka skrzynki (Ustawienia → Skrzynki → Wygląd) */
.tile-preview-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 16px; }
.pick-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.pick-swatch { cursor: pointer; }
.pick-swatch input { display: none; }
.pick-swatch .ch-ico { width: 34px; height: 34px; border: 2px solid transparent; }
.pick-swatch input:checked + .ch-ico { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.pick-swatch:hover .ch-ico { border-color: var(--border); }
.pick-swatch .avatar { width: 36px; height: 36px; border: 2px solid transparent; box-sizing: border-box; }
.pick-swatch input:checked + .avatar { border-color: var(--text); box-shadow: 0 0 0 2px var(--primary-soft); }
.pick-swatch:hover .avatar { border-color: var(--border); }
.pick-dot { width: 12px; height: 12px; border-radius: 50%; }
.pick-auto { background: var(--border-soft); color: var(--muted); font-weight: 700; font-size: 13px; }
.pick-neutral { background: var(--border-soft); color: var(--muted); }
.ch-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ch-info small { overflow: hidden; text-overflow: ellipsis; }
.channel-list li small, .folder-list li small { color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.channel-list li:hover, .folder-list li:hover { background: var(--border-soft); }
/* podpunkty folderów (Dyskusje/Reklamacje → Otwarte/Zamknięte/…) */
.folder-list li.sub { padding: 5px 16px 5px 28px; font-size: 13.5px; color: var(--text); }
.folder-list li.sub .folder-ico { opacity: 1; color: var(--primary); width: 13px; height: 13px; }
/* drugi wskaźnik przy "Otwarte": liczba wszystkich otwartych spraw —
   zaraz za etykietą; licznik nieprzeczytanych zostaje przy prawej krawędzi */
.folder-total {
  flex-shrink: 0;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--badge-total-fg, var(--primary)); background: var(--badge-total-bg, var(--primary-soft)); border: none;
  border-radius: 10px; padding: 0 7px; line-height: 17px;
}
.channel-list li.active, .folder-list li.active { background: var(--primary-soft); font-weight: 700; }
.channel-list li.disabled { color: var(--muted-2); cursor: default; opacity: .7; }
.channel-list li.disabled:hover { background: none; }
.ch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); flex-shrink: 0; }

/* nagłówek grupy skrzynek — zwijany (także "Folder <skrzynka>" w statusach) */
.channel-list li.ch-group, .folder-list li.ch-group {
  padding: 8px 16px 3px; cursor: pointer; border-radius: 0;
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted-2); gap: 6px;
}
.channel-list li.ch-group:hover, .folder-list li.ch-group:hover { background: none; color: var(--muted); }
.channel-list li.ch-group .grp-chev, .folder-list li.ch-group .grp-chev { transition: transform .15s; flex-shrink: 0; }
.channel-list li.ch-group.collapsed .grp-chev, .folder-list li.ch-group.collapsed .grp-chev { transform: rotate(-90deg); }
/* suma nieprzeczytanych w grupie — delikatna chmurka */
.channel-list li.ch-group .grp-unread {
  margin-left: auto; flex-shrink: 0;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0; text-transform: none;
  color: var(--badge-chan-fg, var(--primary)); background: var(--badge-chan-bg, var(--primary-soft));
  border-radius: 10px; padding: 1px 7px;
}

/* licznik nieprzeczytanych przy skrzynce — stonowany (piaskowy, nie niebieski) */
.ch-unread {
  margin-left: auto;
  flex-shrink: 0;
  align-self: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--badge-chan-fg, var(--primary));
  background: var(--badge-chan-bg, var(--primary-soft));
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 1px 7px;
}
.ch-unread:empty { display: none; }

/* statusy zbiorcze (nad skrzynkami) */
.sidebar-section .status-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 6px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0; text-transform: none;
  cursor: pointer; vertical-align: -3px;
}
.sidebar-section .status-help:hover { background: var(--primary); color: #fff; text-decoration: none; }
#status-list { margin-bottom: 4px; }
#status-list .folder-unread { margin-left: auto; }
/* ikona skrzynki zamiast inicjałów na liście statusu — rozmiar jak awatar */
.ti-side .ch-ico { width: 27px; height: 27px; border-radius: 8px; }
.ti-side .ch-ico svg { width: 14px; height: 14px; }
/* etykieta skrzynki źródłowej w wierszu listy (widok statusu zbiorczego) */
.ti-chan {
  flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted-2); font-size: 11px; margin: 2px 6px 0 auto; max-width: 40%;
}

/* ikony folderów w lewym menu */
.folder-ico { flex-shrink: 0; color: var(--muted-2); }
.folder-list li.active .folder-ico { color: var(--primary); }
.folder-label { overflow: hidden; text-overflow: ellipsis; }

/* mini edytor HTML stopki */
.html-editor { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin: 6px 0 14px; }
.he-toolbar { display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.he-toolbar button {
  border: 1px solid transparent; background: none; border-radius: 6px;
  padding: 3px 9px; cursor: pointer; font-size: 13px; color: var(--muted);
}
.he-toolbar button:hover { background: var(--bg); border-color: var(--border); color: var(--text); }
.he-toolbar button[data-cmd="strikeThrough"] s { text-decoration: line-through; }
/* separator sekcji paska */
.he-sep { width: 1px; align-self: stretch; margin: 2px 3px; background: var(--border-soft); }
/* kolor tekstu: literka „A" nad ukrytym próbnikiem koloru */
.he-color-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 26px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; }
.he-color-wrap:hover { background: var(--bg); border-color: var(--border); }
.he-color-a { font-size: 13px; font-weight: 700; color: var(--text); border-bottom: 3px solid #1F4B99; line-height: 1; padding-bottom: 1px; }
.he-color { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: none; padding: 0; cursor: pointer; }
.he-area { min-height: 96px; padding: 10px 12px; outline: none; font-size: 14px; line-height: 1.5; }
.he-area blockquote { border-left: 3px solid var(--border); margin: 6px 0; padding: 2px 0 2px 12px; color: var(--muted); }
.he-area:focus { background: var(--surface); }
.he-area a { color: var(--primary); }
.he-area:empty::before { content: attr(data-placeholder); color: var(--muted-2); pointer-events: none; }
.rich-editor { margin: 6px 0 8px; }
.rich-editor .he-area { max-height: 320px; overflow-y: auto; }

/* autouzupełnianie adresów (jak w Gmailu) */
.ac-box {
  position: fixed; z-index: 400; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(20, 23, 28, .14);
  max-height: 320px; overflow-y: auto; padding: 4px;
}
.ac-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px; cursor: pointer;
}
.ac-item:hover, .ac-item.active { background: var(--primary-soft); }
.ac-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 14px;
}
.ac-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ac-main b { font-size: 13.5px; font-weight: 600; }
.ac-main small { color: var(--muted-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }

.thread-list-pane {
  width: 360px;
  background: var(--surface);
  border-top: none;
  border-bottom: none;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.pane-header { display: none; }
.thread-list { overflow-y: auto; flex: 1; }
.loading { padding: 20px; color: var(--muted-2); text-align: center; }

.thread-item { padding: 12px 14px; box-shadow: inset 0 -1px 0 0 rgba(100, 121, 143, 0.12); cursor: pointer; }
/* przeczytane: ledwo zauważalnie przygaszone tło (jak w Gmailu); nieprzeczytane
   czysto białe. Odcień celowo JAŚNIEJSZY niż wyszukiwarka (--bg #FAF9F6). */
.thread-item:not(.unread) { background: var(--read-bg, #FEFDFB); }
.thread-item:hover { background: var(--thread-hover-bg, var(--bg)); }
.thread-item.active { background: var(--thread-active-bg, var(--primary-soft)); }
.thread-item.unread .ti-from, .thread-item.unread .ti-subject { font-weight: 700; }
/* awatar z inicjałami — zaokrąglony kwadracik jak w projekcie */
.avatar {
  width: 27px; height: 27px; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; user-select: none;
}
.avatar-sm { width: 26px; height: 26px; border-radius: 7px; font-size: 10.5px; }
.avatar-lg { width: 64px; height: 64px; border-radius: 16px; font-size: 24px; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.profile-preview { display: flex; align-items: center; gap: 16px; margin: 8px 0 4px; }
.msg-who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.msg-who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ti-top { display: flex; justify-content: space-between; align-items: baseline; }
/* nick + liczba wiadomości jako jedna grupa po lewej (nazwa sklepu i data
   zostają na swoich miejscach jak wcześniej) */
.ti-fromwrap { display: inline-flex; align-items: baseline; gap: 5px; min-width: 0; overflow: hidden; }
.ti-from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; flex: 0 1 auto; min-width: 0; font-size: 15.5px; color: var(--list-text, var(--text)); }
/* dyskretna liczba wiadomości w wątku (jak w Gmailu) — obok nicku */
.ti-count { flex-shrink: 0; color: var(--muted-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.thread-item.unread .ti-count { color: var(--muted); font-weight: 600; }
.ti-date { color: var(--muted-2); font-size: 11.5px; flex-shrink: 0; font-family: var(--font-mono); }
.ti-subject { margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; color: var(--list-text, var(--text)); }
.ti-snippet { color: var(--muted-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* wysyłka w tle: stan przy wiadomości i plakietka na liście */
.badge-fail { background: #FDE8E8; color: #B42318; border: 1px solid #F5B5B1; }
.send-state { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.send-state.send-queued { opacity: .85; }
.send-state.send-failed {
  padding: 8px 10px; border: 1px solid #F5B5B1; border-radius: 8px;
  background: #FDF1F0; color: #B42318;
}
.send-state.send-failed .btn { margin-left: 6px; }
#send-failed-banner {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 3000; max-width: min(680px, calc(100vw - 32px));
  padding: 10px 16px; border-radius: 10px;
  background: #B42318; color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .45);
}

/* chipy załączników na liście wątków (jak w Gmailu) */
.ti-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.ti-att {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 190px; padding: 2px 9px 2px 5px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg); color: var(--muted);
  font-size: 11.5px; line-height: 18px; cursor: pointer;
}
.ti-att:hover { border-color: var(--muted-2); background: var(--bg-2, var(--bg)); }
.ti-att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ti-att-more { padding: 2px 8px; cursor: default; }
.ti-att-ic {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 3px; border-radius: 4px;
  font-style: normal; font-size: 8px; font-weight: 800; letter-spacing: .2px; color: #fff;
}
.ti-att-ic.ic-pdf { background: #D93025; }
.ti-att-ic.ic-img { background: #C5221F; }
.ti-att-ic.ic-doc { background: #1A73E8; }
.ti-att-ic.ic-xls { background: #1E8E3E; }
.ti-att-ic.ic-zip { background: #8A6D3B; }
.ti-att-ic.ic-file { background: #5f6b7c; }

/* etykieta „inny pracownik odpowiada" na liście wątków */
.ti-busy { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 4px;
  padding: 2px 8px 2px 3px; background: #DC2626; color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 600; max-width: 100%; }
.ti-busy .avatar-sm { width: 16px; height: 16px; font-size: 8.5px; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.5); }
.ti-busy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge { background: var(--border-soft); border-radius: 10px; padding: 1px 8px; font-size: 11px; color: var(--muted); }
.badge-ok { background: var(--success-soft); color: var(--success); }
.badge-draft { background: var(--warn-soft); color: var(--warn); }
.badge-open { background: var(--primary-soft); color: var(--primary); }
.issue-link { font-size: 13px; font-weight: 500; margin-left: 10px; white-space: nowrap; }
/* pasek akcji opinii (nad polem odpowiedzi) */
.rating-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 20px; border-top: 1px solid var(--border); background: var(--bg);
}
.rating-actions .hint { color: var(--muted); font-size: 12.5px; }
/* wybór motywu kolorów (Ustawienia → Motyw kolorów) */
.theme-grid { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
.theme-card {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  border: 2px solid var(--border); border-radius: 12px; padding: 14px 16px;
  cursor: pointer; min-width: 180px; font-weight: 400;
}
.theme-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.theme-card input { width: auto; }
.theme-swatches { display: flex; gap: 6px; }
.theme-swatch { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border); }
.theme-name { font-weight: 600; }
.theme-custom-row { display: flex; align-items: center; gap: 10px; }

/* wybór układu skrzynki (klasyczny / skupiony) — miniatura + nazwa + opis */
.layout-grid { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0 4px; }
.layout-card {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  border: 2px solid var(--border); border-radius: 12px; padding: 12px 14px;
  cursor: pointer; width: 260px; font-weight: 400;
}
.layout-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.layout-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.layout-name { font-weight: 600; }
.layout-desc { color: var(--muted); line-height: 1.35; }
/* miniatura układu */
.layout-preview { display: flex; gap: 4px; width: 100%; height: 76px;
  border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: var(--bg); }
.layout-preview .lp-side { width: 16px; border-radius: 4px; background: var(--pal-graphite-bg, #2A3B5C); flex-shrink: 0; }
.layout-preview .lp-list { flex: 1; border-radius: 4px; background: var(--surface);
  border: 1px solid var(--border); }
.layout-preview .lp-list-wide { flex: 2; }
.layout-preview .lp-view { flex: 1.4; border-radius: 4px; background: var(--surface);
  border: 1px solid var(--border); }
.layout-preview .lp-right { width: 34px; border-radius: 4px; background: var(--primary-soft);
  border: 1px solid var(--border); flex-shrink: 0; }
.theme-custom-row input[type="color"] { width: 44px; height: 30px; padding: 2px; margin: 0; flex-shrink: 0; }

/* foldery własne skrzynki: wiersz checkbox + usuwanie; tworzenie przy zapisie */
.sync-folder-row { display: flex; align-items: center; gap: 6px; }
.sync-folder-row label { margin: 4px 0; }
.folder-del {
  border: none; background: none; cursor: pointer; color: var(--muted-2);
  font-size: 12px; line-height: 1; padding: 3px 6px; border-radius: 5px;
}
.folder-del:hover { color: var(--danger); background: var(--danger-soft); }
.save-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.folder-create-inline { display: inline-flex; align-items: center; gap: 8px; margin-left: 14px; }
.folder-create-inline input[type="text"] { width: 220px; margin-top: 0; }

/* własne przyciski użytkownika (pole odpowiedzi + pasek statusów) */
.reply-btns { display: inline-flex; align-items: center; gap: 6px; }
.cbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px; border: none; cursor: pointer;
  font-weight: 700; font-size: 12px; font-family: var(--font-ui); flex-shrink: 0; padding: 0;
}
.cbtn:hover { filter: brightness(0.93); }
.cbtn svg { vertical-align: 0; }
/* przycisk w trybie "pełny tytuł" */
.cbtn-label { width: auto; padding: 0 11px; white-space: nowrap; }
/* selektor "Przenieś do…" przy polu odpowiedzi (statusy) */
.reply-move { width: auto; margin: 0; padding: 4px 8px; font-size: 12.5px; border-radius: 8px; }
.cbtn-more { width: auto; padding: 3px 6px; margin: 0; font-size: 12px; border-radius: 7px; }
.cbtn-menu {
  position: absolute; top: 30px; left: 0; z-index: 120;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(20,23,28,.14); padding: 5px; min-width: 190px;
}
.cbtn-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px; border-radius: 7px; cursor: pointer; white-space: nowrap; font-size: 13px;
}
.cbtn-menu-item:hover { background: var(--primary-soft); }

/* skromne strzałki zmiany kolejności + wyrównanie akcji w tabelach */
.btn-move {
  border: none; background: none; cursor: pointer; color: var(--muted-2);
  font-size: 10px; padding: 2px 4px; line-height: 1; border-radius: 4px;
}
.btn-move:hover { color: var(--primary); background: var(--primary-soft); }
td.ta-right { text-align: right; }

/* zwijane sekcje konfiguracji statusów (Ustawienia → Statusy) */
.status-details {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; margin: 10px 0; background: var(--surface);
}
.status-details summary {
  cursor: pointer; font-size: 14.5px;
  display: flex; align-items: center; gap: 8px; list-style: none;
}
.status-details summary::-webkit-details-marker { display: none; }
.status-details summary small { color: var(--muted-2); font-weight: 400; }
.status-details[open] summary { margin-bottom: 8px; }
.status-details.status-new summary { color: var(--primary); }
/* kontrolki w nagłówku statusu: strzałki po lewej, grupa + główny/kosz po prawej */
.status-details .sd-right { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.status-details .sd-ctl { display: inline-flex; align-items: center; gap: 4px; }
.status-details .sd-ctl select { width: auto; margin: 0; padding: 3px 7px; font-size: 12px; border-radius: 7px; }

/* grupy statusów w jednej linii: chipy z ✕ + dodawanie obok */
.sgroup-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sgroup-chip {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--border); border-radius: 16px; padding: 4px 6px 4px 13px;
  background: var(--surface); font-weight: 600; font-size: 13px;
}
.sgroup-add { display: inline-flex; align-items: center; gap: 8px; }
.sgroup-add input[type="text"] { width: 200px; margin: 0; padding: 6px 11px; }

/* zwijany wybór folderów w edycji reguły */
.folders-details { margin: 14px 0 4px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; background: var(--bg); }
.folders-details summary { cursor: pointer; color: var(--text); }
.folders-details[open] summary { margin-bottom: 8px; }
/* chmurka z prośbą o zmianę oceny (negatywna opinia, jeszcze nie wysłano) */
.rating-request-card {
  width: 100%; display: flex; flex-direction: column; gap: 8px;
  background: var(--warn-soft); border: 1px solid var(--warn-border, #EBD9A9); border-radius: 10px;
  padding: 12px 14px;
}
.rating-request-card .rrc-head { font-size: 13px; color: var(--text); }
.rating-request-card textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-family: var(--font-ui); font-size: 13.5px; resize: vertical;
  background: var(--surface);
}
.rating-request-card .rrc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* karta zwrotu Allegro (jak w Responso) */
.return-card { display: flex; flex-direction: column; gap: 6px; max-width: 640px; }
.return-card .rc-label {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted-2); margin-top: 2px;
}
.return-card .rc-gap { margin-top: 10px; }
.return-card .rc-grid { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 6px; }
.return-card .rc-right { text-align: right; }
.return-card table.rc-items { border-collapse: collapse; width: 100%; margin: 2px 0 4px; }
.return-card .rc-items td { padding: 7px 0; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.return-card .rc-items td.rc-price { text-align: right; white-space: nowrap; color: var(--muted); }
.return-card .rc-comment { color: var(--muted); }
.return-card .rc-total { text-align: right; margin: 2px 0 4px; }
.return-card .rc-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.return-card .rc-actions a.btn { text-decoration: none; }
.badge-closed { background: var(--border-soft); color: var(--muted); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-customer {
  background: var(--success-soft); color: var(--success); cursor: pointer;
  font-size: 12.5px; padding: 5px 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}

.thread-view-pane {
  flex: 1;
  background: var(--thread-bg, var(--surface));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.thread-empty { margin: auto; color: var(--muted-2); font-size: 16px; }
.thread-content { display: flex; flex-direction: column; height: 100%; }
.thread-header { padding: 14px 20px 8px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.thread-header h2 { margin: 0; font-size: 18px; }
/* chmurka skrzynki/sklepu przed tytułem wątku (widok statusu zbiorczego) */
.thread-chan {
  display: inline-block; border-radius: 12px; padding: 2px 11px;
  font-size: 12.5px; font-weight: 700; vertical-align: 3px; white-space: nowrap;
}
.sellasist-panel { margin: 0 20px 8px; display: flex; flex-direction: column; gap: 6px; }
/* każde źródło (Allegro / Sellasist) jako osobna karta z odstępem */
.ss-bar {
  display: flex; gap: 26px; align-items: center; flex-wrap: wrap; font-size: 13.5px;
  background: var(--orderbar-bg, var(--bg)); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px;
}
.ss-bar b { font-weight: 700; }
.ss-bar .ss-link { margin-left: auto; font-weight: 600; white-space: nowrap; }
.ss-orders { display: none; margin-top: 10px; }
.ss-orders.open { display: block; }

/* rozwijanie szczegółów zamówienia Sellasist — strzałka na początku paska */
.ss-exp {
  width: 24px; height: 24px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--primary); cursor: pointer; font-size: 12px;
  margin-right: -16px; /* pasek ma duży odstęp między polami — strzałka blisko napisu */
}
.ss-exp:hover { border-color: var(--primary); }
/* znacznik "inne zamówienia (30 dni)" na pasku */
.ss-more { color: var(--primary); cursor: pointer; font-weight: 600; white-space: nowrap; position: relative; }
.ss-more-menu {
  position: absolute; z-index: 30; margin-top: 26px;
  display: flex; flex-direction: column; min-width: 210px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 6px 20px rgba(20,23,28,.14); padding: 4px; font-weight: 400;
}
.ss-more-item { padding: 6px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.ss-more-item:hover { background: var(--border-soft); }

/* rozwinięty panel zamówienia */
.ss-detail {
  background: var(--orderbar-bg, var(--bg)); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; font-size: 13.5px;
}
.ssd-top { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-bottom: 10px; }
.ssd-chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ssd-chip small, .ssd-ro small, .ssd-f { color: var(--muted-2); }
.ssd-chip select { padding: 4px 8px; }
.ssd-lock {
  background: var(--warn-soft, #FDF3DC); border: 1px solid var(--warn-border, #EAD9AC);
  border-radius: 8px; padding: 7px 12px; margin-bottom: 10px; font-size: 13px;
}
.ssd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ssd-sec { min-width: 0; }
.empik-incident-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}
.empik-incident-title .ssd-status { font-weight: 400; }
.empik-incident-title { flex-wrap: wrap; }
.empik-incident-title select {
  width: auto;
  min-width: 210px;
  max-width: 340px;
  margin: 0;
  padding: 5px 30px 5px 9px;
  font-size: 12.5px;
}

#empik-refund-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--danger-soft) 45%, var(--surface));
}
#empik-refund-panel input:not([type="checkbox"]),
#empik-refund-panel select { width: 100%; margin-top: 5px; }
#empik-refund-panel .empik-refund-shipping {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  font-size: 12.5px;
}
#empik-refund-panel .empik-refund-shipping input { width: auto; margin: 0; }
#empik-refund-panel .ssd-actions { margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#empik-refund-confirm { color: #fff; background: var(--danger); border-color: var(--danger); }
#empik-refund-confirm:hover { filter: brightness(.94); }
#empik-refund-confirm:disabled { opacity: .55; cursor: wait; }

.empik-products-scroll {
  max-height: 230px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.empik-products-scroll .table { border: 0; border-radius: 0; }
.empik-products-scroll .table th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.ssd-sec h4 { margin: 0 0 7px; font-size: 13px; }
.ssd-sec .ssd-f { display: flex; flex-direction: column; gap: 2px; margin: 0 0 7px; font-size: 12px; }
.ssd-sec .ssd-f input { padding: 6px 9px; font-size: 13px; }
.ssd-ro { margin: 0 0 7px; font-size: 13.5px; }
.ssd-ro small { display: block; font-size: 12px; }
.ssd-sec .ssd-save { margin-top: 2px; }
.ssd-status { margin-left: 8px; font-size: 12.5px; }
.ssd-oth { color: var(--primary); cursor: pointer; font-weight: 600; margin-right: 6px; white-space: nowrap; }
.ssd-oth:hover { text-decoration: underline; }
.ssd-muted { color: var(--muted-2); }
.ssd-pencil {
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  cursor: pointer; font-size: 11px; padding: 2px 6px; vertical-align: 1px;
}
.ssd-pencil:hover { border-color: var(--primary); }
.ssd-diag { margin-top: 10px; font-size: 12px; }
.ssd-diag summary { color: var(--muted); cursor: pointer; }
.ssd-diag pre { max-height: 260px; overflow: auto; font-size: 11px; }
.sellasist-panel h3 { margin: 4px 0 8px; font-size: 13.5px; }
.sellasist-panel .table { font-size: 13px; }
.ss-prods { max-width: 260px; font-size: 12px; color: var(--muted-2); }

.thread-messages { flex: 1; overflow-y: auto; padding: 8px 20px; }
/* wiadomość = nagłówek (awatar + nadawca) NAD dymkiem, jak w projekcie */
.msg-block { margin: 16px 0; }
.msg-block-out { margin-left: 96px; }
/* dymki rozmowy: miękkie karty — duży promień, delikatna ramka i cień,
   wygodna interlinia (mniej „systemowo", bardziej jak rozmowa) */
.msg { border: 1px solid var(--border-soft, var(--border)); border-radius: 14px; padding: 13px 17px; }
.msg-in { background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.msg-out { background: var(--primary-soft); border-color: transparent; }
.msg-draft { background: var(--warn-soft); border-color: var(--warn-border, #EBD9A9); }
/* komunikaty systemowe Allegro w dyskusjach/reklamacjach — pomarańczowe */
.msg-system { background: var(--sys-soft, #FFF4E8); border-color: var(--sys-border, #F3D7B0); }
.msg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted-2); font-size: 12.5px; margin-bottom: 7px; padding: 0 2px; }
/* kto pisze: większy awatar, wyraźne imię, adres dyskretnie obok */
.msg-head .avatar-sm { width: 30px; height: 30px; border-radius: 9px; font-size: 11.5px; }
.msg-head b { color: var(--text); font-weight: 700; font-size: 13.5px; }
.msg-mail { color: var(--muted-2); font-size: 12px; margin-left: 7px; }
.msg-head > span:last-child { flex-shrink: 0; }
.msg-head-right { display: inline-flex; align-items: center; gap: 6px; }
.msg-head .msg-date { font-size: 12px; }

/* starsze wiadomości wątku email zwinięte (jak w Gmailu): klikalny pasek —
   pierwsza linia nadawca + data, pod spodem zajawka treści na całą
   szerokość (do 2 linii); paski oddzielone od siebie poziomą kreską */
.msg-collapsible .msg-head { cursor: pointer; border-radius: 10px; padding: 4px 6px; margin-left: -6px; margin-right: -6px; }
.msg-collapsible .msg-head:hover { background: var(--border-soft, rgba(0, 0, 0, .04)); }
.msg-snippet { display: none; }
.msg-collapsed .msg-head { flex-wrap: wrap; margin-bottom: 0; }
.msg-collapsed .msg-snippet {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; flex: 1 1 100%; order: 3; min-width: 0;
  margin: 2px 0 0 38px; /* wyrównanie do nazwiska (awatar 30px + odstęp) */
  color: var(--muted-2); font-size: 12.5px; line-height: 1.45;
}
.msg-collapsed .msg-who { flex-shrink: 1; min-width: 0; }
.msg-collapsed .msg { display: none; }
/* kreska oddziela kolejne zwinięte paski (i ostatni pasek od rozwiniętej) */
.msg-block.msg-collapsed { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--border); }
/* zwinięty pasek zajmuje całą szerokość — wcięcie wraca po rozwinięciu */
.msg-block-out.msg-collapsed { margin-left: 0; }
/* skromny przycisk „przetłumacz tę wiadomość" (pojawia się przy najechaniu) */
.msg-tr { border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 6px; padding: 1px 6px; font-size: 12px; line-height: 1.4; cursor: pointer;
  opacity: .55; transition: opacity .12s; }
.msg-block:hover .msg-tr { opacity: 1; }
.msg-tr:hover { color: var(--text); border-color: var(--muted-2); background: var(--bg); }
.msg-tr:disabled { cursor: default; opacity: .5; }
.msg-body { font-size: 14px; line-height: 1.6; }
.msg-text { white-space: pre-wrap; word-break: break-word; }
.msg-html { word-break: break-word; }
.msg-html p { margin: .45em 0; }
.msg-html > :first-child { margin-top: 0; }
.msg-html > :last-child { margin-bottom: 0; }
.msg-html img { max-width: 100%; }
/* długie wiadomości email: przyciemniona krawędź + „Pokaż całą wiadomość" */
.msg-body { position: relative; }
.msg-body.msg-clamped { max-height: 320px; overflow: hidden; }
.msg-body.msg-clamped::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 104px;
  background: linear-gradient(transparent, var(--surface)); pointer-events: none;
}
.msg-out .msg-body.msg-clamped::after { background: linear-gradient(transparent, var(--primary-soft)); }
.msg-show-full {
  display: inline-block; margin: 8px 0 2px; padding: 5px 14px;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--bg); color: var(--primary); font-weight: 600; font-size: 12.5px; cursor: pointer;
}
.msg-show-full:hover { background: var(--primary-soft); }
.msg-translation { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 6px; }
.msg-translation summary { cursor: pointer; color: var(--primary); }
.draft-actions { margin-top: 8px; }

/* blokada odpowiedzi: inny pracownik już zajmuje się wątkiem */
.presence-lock { display: flex; align-items: center; gap: 12px;
  margin: 12px 20px 16px; padding: 12px 14px;
  background: rgba(220,38,38,.06); border: 1px solid #DC2626;
  border-radius: 10px; }
.presence-lock .avatar { flex-shrink: 0; }
.presence-lock .pl-text { font-size: 13px; color: var(--text); line-height: 1.35; }
.presence-lock .pl-text b { color: #DC2626; }
.presence-lock .pl-text span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* pole odpowiedzi */
.reply-box { border-top: 1px solid var(--border); padding: 12px 20px 16px; background: var(--reply-bg, var(--bg)); }
.reply-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
/* odbiorcy w górnym wierszu: cała szerokość bez własnych przycisków,
   około połowa gdy przyciski są (reply-box.has-cbtns) */
.reply-head .reply-recipients { flex: 1 1 auto; min-width: 240px; margin-bottom: 0; }
.reply-box.has-cbtns .reply-head .reply-recipients { flex: 0 1 50%; }
.reply-toggles { margin-left: auto; display: flex; gap: 16px; flex-shrink: 0; }
.reply-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
#send-status, #compose-status { color: var(--muted-2); }

/* przycisk zwijania pola odpowiedzi (Góra/Dół) — stan zapamiętany na sesję */
.reply-collapse {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 28px; margin-left: 6px; padding: 0; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  color: var(--muted); cursor: pointer;
}
.reply-collapse:hover { color: var(--text); border-color: var(--muted-2); }
.reply-collapse .rc-ico { transition: transform .15s; }
/* zwinięte: edytor niski, bez paska formatowania i paneli AI */
.reply-box.reply-collapsed .he-toolbar { display: none; }
.reply-box.reply-collapsed .he-area { min-height: 34px; max-height: 90px; }
.reply-box.reply-collapsed .ai-suggest,
.reply-box.reply-collapsed .ai-chat { display: none !important; }
.reply-box.reply-collapsed .reply-collapse .rc-ico { transform: rotate(180deg); }

/* suwak (switch) */
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 400; font-size: 13px; margin: 0; color: var(--muted); }
.switch input { display: none; }
.switch .slider {
  width: 34px; height: 18px; background: var(--switch-bg, #DAD6CB); border-radius: 10px; position: relative; transition: .2s;
}
.switch .slider::after {
  content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px; transition: .2s;
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::after { left: 18px; }

/* AI: podpowiedzi + czat */
.ai-suggest, .ai-chat { border: 1px solid var(--border); border-radius: 12px; margin-top: 10px; padding: 11px 15px; background: var(--surface); }
.ai-suggest-head, .ai-chat-head { font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* przełącznik "uwzględnij wskazówki" — dosunięty do przycisku Generuj */
.ai-hints-switch { margin-left: auto; font-size: 12.5px; }
.ai-suggest-head svg, .ai-chat-head svg { color: var(--primary); }
.ai-suggest-body { white-space: pre-wrap; color: var(--text); margin-bottom: 6px; }
.ai-suggest .link-btn { font-weight: 600; }
.ai-chat-log { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.chat-msg { padding: 6px 10px; border-radius: 10px; max-width: 85%; white-space: pre-wrap; }
.chat-user { background: var(--primary-soft); align-self: flex-end; }
.chat-assistant { background: var(--border-soft); align-self: flex-start; }
.chat-use { border: none; background: none; cursor: pointer; color: var(--primary); }
.ai-chat-input { display: flex; gap: 8px; }
.ai-chat-input input { margin-top: 0; }

/* modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(20,23,28,.4);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal { background: var(--surface); border-radius: 14px; padding: 20px 24px; width: 560px; max-width: 94vw; max-height: 90vh; overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.modal-close { border: none; background: none; font-size: 16px; cursor: pointer; color: var(--muted); }

/* ---------- Wybór dostawcy integracji ---------- */

.provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; max-width: 900px; }
.provider-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: center;
  color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--surface);
}
.provider-card:hover { text-decoration: none; border-color: var(--primary); box-shadow: 0 1px 6px rgba(20,23,28,.08); }
.provider-card.disabled { opacity: .55; }
.provider-card .provider-icon { font-size: 32px; }
.provider-card h3 { margin: 4px 0; }
.provider-card p { color: var(--muted); font-size: 13px; margin: 0 0 8px; }

/* ---------- Odbiorcy Do/DW w odpowiedzi ---------- */

/* Do i DW w jednej linii (oszczędność miejsca) */
.reply-recipients { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 6px; }
.recipient-row { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; flex: 1 1 240px; min-width: 200px; }
.recipient-row input { margin-top: 0; flex: 1; width: auto; min-width: 0; }
.link-btn { border: none; background: none; color: var(--primary); cursor: pointer; padding: 0; font-size: 13px; font-family: var(--font-ui); }
.msg-recipients { color: var(--muted-2); font-size: 12px; margin-bottom: 4px; }

/* ---------- Załączniki ---------- */

.msg-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; }
.att-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); border-radius: 8px; padding: 4px 12px;
  color: var(--text); font-size: 13px; max-width: 280px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; background: var(--surface);
}
.att-chip:hover { text-decoration: none; border-color: var(--primary); }
.att-chip small { color: var(--muted-2); }
.att-chip .att-name { overflow: hidden; text-overflow: ellipsis; }

/* plakietka typu pliku (PDF czerwona, DOC niebieska, XLS zielona...) */
.att-ext {
  flex-shrink: 0; font-size: 9.5px; font-weight: 800; letter-spacing: .04em;
  border-radius: 5px; padding: 3px 6px; color: #fff; font-family: var(--font-mono);
}
.att-ext-pdf  { background: #D93025; }
.att-ext-doc  { background: #1A73E8; }
.att-ext-xls  { background: #188038; }
.att-ext-ppt  { background: #E8710A; }
.att-ext-zip  { background: #7B5EA7; }
.att-ext-txt  { background: #5F6368; }
.att-ext-file { background: #80868B; }

/* zablokowany załącznik (opcja bezpieczeństwa skrzynki) */
.att-blocked {
  border-style: dashed; color: var(--muted-2); cursor: help; background: var(--bg);
}

/* miniaturki obrazków z powiększeniem */
.msg-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.msg-thumbs img {
  height: 110px; max-width: 180px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border); display: block;
}
.msg-thumbs .att-thumb:hover img { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.12); }

#lightbox {
  position: fixed; inset: 0; z-index: 300; display: none;
  align-items: center; justify-content: center; cursor: zoom-out;
  background: rgba(10, 10, 8, .82);
}
#lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,.5); }
/* strzałki galerii (kilka zdjęć w jednej wiadomości) + licznik */
#lightbox .lb-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 64px; border: none; border-radius: 10px;
  background: rgba(255,255,255,.12); color: #fff; font-size: 34px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
#lightbox .lb-arrow:hover { background: rgba(255,255,255,.24); }
#lightbox .lb-prev { left: 18px; }
#lightbox .lb-next { right: 18px; }
#lightbox .lb-count {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; background: rgba(0,0,0,.45);
  padding: 3px 12px; border-radius: 999px;
}
/* przycisk doładowania kolejnej strony listy wątków */
.threads-more { display: block; margin: 10px auto 14px; }

/* zwinięta cytowana historia (jak w Gmailu) */
.quote-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--bg); color: var(--muted);
  border-radius: 8px; padding: 0 8px; height: 14px; line-height: 1;
  cursor: pointer; margin: 4px 0 0; font-size: 12px; letter-spacing: 1.5px;
}
.quote-toggle:hover { background: var(--border-soft); color: var(--text); }
.msg-quote {
  border-left: 3px solid var(--border); margin-top: 6px; padding-left: 10px;
  color: var(--muted);
}

/* wybrane pliki przed wysyłką */
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; }
.attach-list:not(:empty) { margin: 8px 0 2px; }
.att-pick {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px;
  font-size: 12.5px; background: var(--surface);
}
.att-pick small { color: var(--muted-2); }
.att-pick button { border: none; background: none; cursor: pointer; color: var(--muted-2); padding: 0 2px; }
.att-pick button:hover { color: #D93025; }

/* ---------- Pasek akcji listy + zaznaczanie + gwiazdki ---------- */

.list-toolbar {
  display: flex; align-items: center; gap: 3px;
  padding: 7px 8px; border-bottom: 1px solid var(--border);
  flex-wrap: nowrap; background: var(--toolbar-bg, var(--bg)); /* jeden rząd — ikony się nie łamią */
}
.list-toolbar .toolbar-checkall { margin: 0 2px; flex-shrink: 0; }
.list-toolbar .icon-btn { flex-shrink: 0; }
.list-toolbar .btn-sm { border-radius: 7px; padding: 4px 9px; font-size: 12px; }
.list-toolbar select {
  width: auto; padding: 4px 4px; margin: 0; font-size: 12px; border-radius: 7px;
  flex: 0 1 auto; min-width: 0; max-width: 118px; /* zwęża się zamiast spychać ikony */
  overflow: hidden; text-overflow: ellipsis;
}
.toolbar-count {
  margin-left: auto; color: var(--muted-2); font-size: 12px; padding-right: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0;
}

.folder-unread {
  background: var(--badge-folder-bg, var(--primary)); color: var(--badge-folder-fg, #fff); border-radius: 10px;
  font-size: 11px; padding: 0 7px; margin-left: auto; font-family: var(--font-mono);
}
.ti-row { display: flex; align-items: flex-start; gap: 8px; }
/* kolumna awatar + gwiazdka pod spodem — więcej miejsca na treść wiersza */
.ti-side { display: flex; flex-direction: column; align-items: center; gap: 3px; flex-shrink: 0; }
.ti-check { margin-top: 4px; flex-shrink: 0; }
.ti-star { cursor: pointer; flex-shrink: 0; margin-top: 2px; line-height: 0; color: var(--muted-2); }
.ti-star svg { fill: none; stroke: var(--muted-2); }
.ti-star.starred svg { fill: #F4B400; stroke: #F4B400; }
.ti-star:hover { transform: scale(1.12); }
.ti-main { flex: 1; min-width: 0; cursor: pointer; }

/* responsywność */
@media (max-width: 1000px) {
  .inbox-layout { flex-direction: column; height: auto; }
  .inbox-sidebar, .thread-list-pane { width: 100%; }
  /* na wąskim ekranie menu jest nad listą — zwijanie do ikon nie ma sensu */
  .inbox-sidebar.collapsed { width: 100%; }
  .side-toggle { display: none; }
  .thread-list { max-height: 40vh; }
  .settings-wrap { flex-direction: column; }
  .settings-nav { width: 100%; }
  .auth-split { flex-direction: column; }
  .auth-left { flex: none; padding: 26px 24px; gap: 20px; }
  .auth-quote { font-size: 20px; }
  .hero h1 { font-size: 32px; }
}

/* ================================================================
   LANDING V2 — projekt marketingowy Multinbox, lipiec 2026
   Izolowany przez .landing-v2, bez wpływu na panel aplikacji.
   ================================================================ */

.landing-v2 {
  --landing-primary: #5146ea;
  --landing-primary-dark: #3528d5;
  --landing-ink: #10183b;
  --landing-muted: #5e6782;
  --landing-line: #e8eaf4;
  --landing-soft: #f7f8ff;
  --landing-shadow: 0 28px 70px rgba(40, 43, 112, .13);
  background: #fff;
  color: var(--landing-ink);
  overflow-x: hidden;
}
.landing-v2 .btn { background: var(--landing-primary); border-color: var(--landing-primary); }
.landing-v2 .btn:hover { background: var(--landing-primary-dark); border-color: var(--landing-primary-dark); filter: none; transform: translateY(-1px); }
.landing-v2-header {
  height: 76px;
  padding: 0 max(32px, calc((100vw - 1440px) / 2));
  border-bottom: 0;
  box-shadow: 0 1px 0 rgba(22, 28, 65, .06);
  position: relative;
}
.landing-v2-brand { font-size: 22px; color: var(--landing-ink); letter-spacing: -.04em; }
.landing-logo-mark {
  width: 42px; height: 42px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: linear-gradient(135deg, #6255f4, #4338df);
  box-shadow: 0 9px 22px rgba(81, 70, 234, .25);
}
.landing-main-nav { position: absolute; left: 50%; transform: translateX(-50%); gap: 34px !important; }
.landing-main-nav a { color: #2e3655 !important; font-size: 14px; }
.landing-main-nav a:hover { color: var(--landing-primary) !important; }
.landing-nav-actions { display: flex; align-items: center; gap: 22px; }
.landing-login-link { color: #2e3655; font-weight: 600; }
.landing-top-cta { padding: 12px 21px; border-radius: 10px; }
.landing-mobile-login { display: none; color: var(--landing-primary); }

.landing-hero { position: relative; background: linear-gradient(180deg, #fff 0%, #fbfcff 80%, #f6f8ff 100%); padding: 92px 30px 82px; overflow: hidden; }
.landing-hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 210px;
  background-image: radial-gradient(#dfe3ff 1px, transparent 1px);
  background-size: 17px 17px; opacity: .5;
  mask-image: linear-gradient(transparent, #000);
}
.landing-hero-glow { position: absolute; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.landing-hero-glow-one { width: 520px; height: 520px; right: -230px; top: -180px; background: radial-gradient(circle, rgba(141, 126, 255, .13), transparent 69%); }
.landing-hero-glow-two { width: 420px; height: 420px; left: -230px; bottom: -120px; background: radial-gradient(circle, rgba(100, 196, 255, .12), transparent 69%); }
.landing-hero-inner {
  position: relative; z-index: 2; max-width: 1420px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(430px, .83fr) minmax(650px, 1.17fr);
  gap: 66px; align-items: center;
}
.landing-hero-copy { padding-left: 8px; }
.landing-kicker, .section-kicker, .landing-section-heading > span {
  display: inline-flex; align-items: center;
  color: var(--landing-primary); background: #f3f1ff; border: 1px solid #e4e0ff;
  border-radius: 9px; padding: 7px 15px; font-size: 11px; line-height: 1;
  font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
}
.landing-hero-copy h1 { margin: 24px 0 21px; font-size: clamp(48px, 4.5vw, 72px); line-height: 1.06; letter-spacing: -.055em; font-weight: 800; }
.landing-hero-copy > p { max-width: 600px; margin: 0 0 31px; color: var(--landing-muted); font-size: 19px; line-height: 1.7; }
.landing-hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.landing-primary-cta, .landing-secondary-cta { border-radius: 11px !important; padding: 14px 26px !important; }
.landing-secondary-cta { color: var(--landing-primary) !important; background: #fff !important; border: 1.5px solid var(--landing-primary) !important; }
.landing-secondary-cta:hover { color: var(--landing-primary-dark) !important; background: #f9f8ff !important; }
.landing-trust-row { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 25px; color: #46506e; font-size: 13px; }
.landing-trust-row span { display: inline-flex; align-items: center; gap: 7px; }
.landing-trust-row svg { padding: 2px; border-radius: 50%; color: #fff; background: var(--landing-primary); }

.landing-product-wrap { position: relative; min-width: 0; }
.product-window {
  position: relative; z-index: 2; height: 576px; overflow: hidden;
  background: #fff; border: 1px solid #dfe3ef; border-radius: 16px;
  box-shadow: var(--landing-shadow); transform: perspective(1400px) rotateY(-1deg);
}
.product-window-top { height: 56px; padding: 0 18px; display: flex; align-items: center; gap: 17px; border-bottom: 1px solid #edf0f6; background: rgba(255,255,255,.96); }
.window-dots { display: flex; gap: 6px; }
.window-dots i { width: 8px; height: 8px; border-radius: 50%; background: #fa6867; }
.window-dots i:nth-child(2) { background: #f6bd4d; }
.window-dots i:nth-child(3) { background: #50c878; }
.product-mini-brand { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; }
.product-mini-brand span { width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: var(--landing-primary); color: #fff; }
.product-search { margin-left: 10px; width: 300px; border: 1px solid #e1e4ef; border-radius: 6px; color: #9aa1b5; padding: 8px 13px; font-size: 10px; display: flex; gap: 7px; align-items: center; }
.product-avatar { margin-left: auto; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: #a992f4; color: #fff; font-size: 10px; }
.product-ui { height: calc(100% - 56px); display: grid; grid-template-columns: 165px 238px minmax(300px, 1fr); font-size: 10px; }
.product-sidebar { padding: 15px 9px; background: #fafbff; border-right: 1px solid #e9ebf3; }
.product-compose { margin-bottom: 15px; padding: 9px 8px; border-radius: 6px; text-align: center; background: linear-gradient(135deg, #5d4ff2, #4437df); color: #fff; font-weight: 600; }
.product-label { color: #858da5; padding: 3px 8px 7px; text-transform: uppercase; letter-spacing: .06em; font-size: 8px; }
.product-account, .product-folder { min-height: 32px; display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 5px; color: #35405e; }
.product-account.active, .product-folder.active { background: #eef0ff; color: #282272; }
.product-account i { width: 18px; height: 18px; border-radius: 4px; position: relative; }
.product-account i::after { content: '✉'; color: #fff; position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 9px; }
.product-account .acc-blue { background: #427cf5; } .product-account .acc-green { background: #39b854; } .product-account .acc-pink { background: #ef6592; }
.product-account b, .product-folder b { margin-left: auto; font-size: 8px; color: #8b93aa; }
.product-folder:first-of-type { margin-top: 12px; }
.product-list { overflow: hidden; border-right: 1px solid #e9ebf3; }
.product-list-head { height: 38px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e9ebf3; }
.product-thread { position: relative; min-height: 70px; padding: 10px 8px 8px 17px; display: flex; align-items: flex-start; border-bottom: 1px solid #eef0f5; }
.product-thread.selected { background: #eff3ff; }
.thread-line { position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 4px; background: #6771f5; }
.thread-line.green { background:#53bd63; } .thread-line.pink { background:#f16a9b; } .thread-line.yellow { background:#edc948; } .thread-line.violet { background:#9b63ee; } .thread-line.cyan { background:#41bddd; }
.product-thread-copy { min-width: 0; flex: 1; }
.product-thread-copy > div { display: flex; justify-content: space-between; }
.product-thread-copy b { font-size: 9px; } .product-thread-copy time { color: #8e96ab; font-size: 8px; }
.product-thread-copy strong, .product-thread-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.product-thread-copy strong { margin: 4px 0 3px; color: #303952; font-size: 8px; }
.product-thread-copy small { color: #9299ab; font-size: 8px; }
.product-thread em { width: 15px; height: 15px; margin: 23px 0 0 5px; display: grid; place-items: center; border-radius: 50%; background: var(--landing-primary); color: #fff; font-size: 7px; font-style: normal; }
.product-conversation { min-width: 0; display: flex; flex-direction: column; background: #fff; }
.conversation-head { height: 55px; padding: 10px 14px; display: flex; justify-content: space-between; border-bottom: 1px solid #eaecf3; }
.conversation-head b, .conversation-head small { display: block; } .conversation-head b { font-size: 11px; } .conversation-head small { margin-top: 4px; color: #9299ad; font-size: 8px; }
.conversation-head > span { color: #68718a; display: flex; gap: 10px; }
.conversation-scroll { flex: 1; padding: 15px; overflow: hidden; background: #fcfcfe; }
.preview-message { position: relative; width: 75%; padding: 10px 11px 20px; margin-bottom: 12px; border-radius: 8px; line-height: 1.5; font-size: 8.5px; }
.message-customer { background: #fff; border: 1px solid #e3e6ef; }
.message-agent { margin-left: auto; color: #fff; background: linear-gradient(135deg, #5969f4, #414dde); }
.preview-message time { position: absolute; right: 7px; bottom: 6px; font-size: 7px; opacity: .75; }
.customer-context { padding: 10px; border: 1px solid #e6e8f1; border-radius: 8px; background: #fff; }
.context-title { color: #9097aa; font-size: 7px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.context-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 8px; }
.context-grid b, .context-grid small { display: block; } .context-grid b { font-size: 8px; }
.context-grid b span { margin-left: 5px; padding: 2px 5px; border-radius: 8px; background: #eeedff; color: var(--landing-primary); font-size: 6px; }
.context-grid small { margin-top: 6px; color: #8b93a8; font-size: 7px; } .context-grid small strong { float: right; color: #3b435b; }
.context-product { display: flex; align-items: center; gap: 7px; border-left: 1px solid #eceef5; padding-left: 9px; }
.product-thumb { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 6px; background: #f4f5f9; font-size: 22px; }
.preview-composer { height: 104px; padding: 8px 12px; border-top: 1px solid #e9ebf3; background: #fff; }
.composer-tabs { display: flex; gap: 16px; color: #999fb0; border-bottom: 1px solid #edf0f5; padding-bottom: 6px; font-size: 7px; }
.composer-tabs b { color: var(--landing-primary); }
.composer-field { height: 42px; padding: 10px 0; color: #a4a9b8; font-size: 8px; }
.composer-actions { display: flex; justify-content: space-between; color: #6f778c; }
.composer-actions button { border: 0; border-radius: 5px; padding: 6px 9px; background: var(--landing-primary); color: #fff; font: inherit; font-size: 7px; }
.landing-float-card {
  position: absolute; z-index: 4; display: flex; align-items: center; gap: 10px;
  padding: 12px 15px; background: rgba(255,255,255,.97); border: 1px solid #e0e3ef;
  border-radius: 13px; box-shadow: 0 12px 35px rgba(49, 51, 107, .15); color: var(--landing-primary);
}
.landing-float-card span, .landing-float-card b, .landing-float-card small { display: block; }
.landing-float-card b { color: #202846; font-size: 11px; } .landing-float-card small { margin-top: 2px; color: #7b8399; font-size: 9px; }
.float-mailboxes { top: 58px; right: -44px; } .float-ai { right: -51px; bottom: 145px; }

.landing-benefits { padding: 88px 30px 96px; background: #fff; }
.landing-section-heading { max-width: 760px; margin: 0 auto 43px; text-align: center; }
.landing-section-heading > span { margin-bottom: 18px; }
.landing-section-heading h2 { margin: 0; color: var(--landing-ink); font-size: clamp(31px, 3vw, 43px); line-height: 1.2; letter-spacing: -.04em; }
.landing-section-heading p { margin: 16px auto 0; max-width: 650px; color: var(--landing-muted); font-size: 16px; line-height: 1.7; }
.landing-benefit-grid { max-width: 1250px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.landing-benefit-grid article { min-height: 225px; padding: 30px; border: 1px solid var(--landing-line); border-radius: 16px; background: #fff; box-shadow: 0 12px 35px rgba(34, 39, 87, .045); transition: .25s ease; }
.landing-benefit-grid article:hover { transform: translateY(-4px); border-color: #d7d7fb; box-shadow: 0 18px 45px rgba(45, 44, 114, .09); }
.benefit-icon { width: 58px; height: 58px; margin-bottom: 22px; display: grid; place-items: center; border-radius: 16px; }
.benefit-indigo { color: #5548e9; background: #eeecff; } .benefit-blue { color: #2275e6; background: #e9f3ff; } .benefit-violet { color: #8246dd; background: #f3ebff; }
.landing-benefit-grid h3 { margin: 0 0 10px; font-size: 20px; }
.landing-benefit-grid p { margin: 0; color: var(--landing-muted); line-height: 1.7; }

.landing-showcase { padding: 105px 30px; background: linear-gradient(135deg, #121939, #1a2250); color: #fff; }
.landing-showcase-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: .9fr 1.1fr; gap: 90px; align-items: center; }
.showcase-copy .section-kicker { color: #c8c3ff; background: rgba(103,87,243,.18); border-color: rgba(180,173,255,.2); }
.showcase-copy h2 { margin: 22px 0 18px; font-size: 42px; line-height: 1.18; letter-spacing: -.04em; }
.showcase-copy p { color: #c3c9dc; font-size: 17px; line-height: 1.75; }
.showcase-copy ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.showcase-copy li { display: flex; align-items: center; gap: 11px; font-weight: 600; }
.showcase-copy li svg { color: #9b91ff; }
.showcase-card { padding: 28px; border: 1px solid rgba(255,255,255,.13); border-radius: 19px; background: #fff; color: var(--landing-ink); box-shadow: 0 30px 70px rgba(0,0,0,.25); }
.showcase-card-head { display: flex; align-items: center; gap: 13px; padding-bottom: 20px; border-bottom: 1px solid #eceef4; }
.showcase-avatar { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: #eeeaff; color: var(--landing-primary); font-weight: 800; }
.showcase-card-head div { flex: 1; } .showcase-card-head b, .showcase-card-head small { display: block; } .showcase-card-head small { color: #8c94aa; margin-top: 3px; }
.showcase-card-head em, .showcase-order em { padding: 5px 10px; border-radius: 13px; background: #e8f8ee; color: #278251; font-size: 11px; font-style: normal; }
.showcase-stats { display: grid; grid-template-columns: repeat(3,1fr); margin: 22px 0; padding: 18px 0; background: #f8f9fc; border-radius: 12px; }
.showcase-stats div { padding: 0 15px; border-right: 1px solid #e4e6ef; } .showcase-stats div:last-child { border: 0; }
.showcase-stats small, .showcase-stats b { display: block; } .showcase-stats small { color: #8991a8; font-size: 11px; } .showcase-stats b { margin-top: 5px; font-size: 20px; }
.showcase-order { display: flex; align-items: center; gap: 12px; padding: 15px 0; border-top: 1px solid #edf0f5; }
.order-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; color: var(--landing-primary); background: #efefff; }
.showcase-order div { flex: 1; } .showcase-order b, .showcase-order small { display: block; } .showcase-order small { margin-top: 4px; color: #8a92a7; font-size: 11px; }
.showcase-order em { background: #fff2d8; color: #9c6900; } .showcase-order em.done { background: #e8f8ee; color: #278251; }

.landing-integrations { padding: 96px 30px; background: #fafbff; }
.integration-row { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.integration-row > div { padding: 25px 16px; border: 1px solid var(--landing-line); border-radius: 14px; background: #fff; text-align: center; }
.integration-row span { width: 50px; height: 50px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 14px; font-size: 20px; font-weight: 800; }
.integration-row b, .integration-row small { display: block; } .integration-row b { font-size: 16px; } .integration-row small { margin-top: 5px; color: #9299ab; }
.integration-gmail { color: #e64b42; background: #fff0ef; } .integration-imap { color: #2979ef; background: #edf5ff; } .integration-sellasist { color: #19a579; background: #eaf9f3; } .integration-ai { color: #7c4bea; background: #f2edff; }

.landing-pricing { padding: 95px 30px; border-top: 0; background: #fff; }
.landing-pricing .price-card { border-color: var(--landing-line); border-radius: 16px; box-shadow: 0 10px 30px rgba(39,45,98,.05); }
.landing-pricing .price-card.featured { border-color: var(--landing-primary); box-shadow: 0 18px 45px rgba(81,70,234,.13); }
.landing-pricing .price-tag { background: var(--landing-primary); }

.landing-final-cta { padding: 60px 30px 90px; background: #fff; }
.landing-final-cta > div { max-width: 1180px; margin: 0 auto; padding: 66px 30px; border-radius: 24px; text-align: center; color: #fff; background: linear-gradient(135deg, #4e42e8, #6d58ef); box-shadow: 0 25px 60px rgba(81,70,234,.2); }
.landing-final-cta > div > span { width: 46px; height: 46px; margin: 0 auto 17px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.15); }
.landing-final-cta h2 { margin: 0; font-size: 38px; letter-spacing: -.04em; }
.landing-final-cta p { margin: 13px 0 26px; color: rgba(255,255,255,.8); font-size: 16px; }
.landing-final-cta .btn { color: var(--landing-primary); background: #fff; border-color: #fff; }
.landing-final-cta .btn:hover { color: var(--landing-primary-dark); background: #fff; }
.final-login-link { margin-left: 19px; color: #fff; font-weight: 600; }
.final-login-link:hover { color: #fff; }
.landing-footer { max-width: 1250px; margin: 0 auto; min-height: 90px; padding: 22px 30px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--landing-line); }
.landing-footer .landing-brand { font-size: 17px; } .landing-footer .landing-logo-mark { width: 32px; height: 32px; border-radius: 9px; }
.landing-footer small { color: #9299ab; }

@media (max-width: 1220px) {
  .landing-main-nav { gap: 18px !important; }
  .landing-hero-inner { grid-template-columns: .8fr 1.2fr; gap: 35px; }
  .product-ui { grid-template-columns: 140px 205px minmax(280px,1fr); }
  .float-mailboxes, .float-ai { right: -15px; }
}
@media (max-width: 1050px) {
  .landing-main-nav { display: none !important; }
  .landing-hero { padding-top: 65px; }
  .landing-hero-inner { grid-template-columns: 1fr; max-width: 830px; text-align: center; }
  .landing-hero-copy { padding: 0; }
  .landing-hero-copy > p { margin-left: auto; margin-right: auto; }
  .landing-hero-actions, .landing-trust-row { justify-content: center; }
  .landing-product-wrap { margin-top: 30px; text-align: left; }
  .landing-showcase-inner { gap: 45px; }
}
@media (max-width: 760px) {
  .landing-v2-header { height: 66px; padding: 0 18px; }
  .landing-logo-mark { width: 37px; height: 37px; }
  .landing-nav-actions { display: none; }
  .landing-mobile-login { display: inline-flex; margin-left: auto; }
  .landing-hero { padding: 55px 18px 60px; }
  .landing-hero-copy h1 { font-size: 43px; }
  .landing-hero-copy > p { font-size: 16px; }
  .landing-trust-row { gap: 12px; font-size: 11px; }
  .landing-product-wrap { margin-left: -4px; margin-right: -4px; }
  .product-window { height: 450px; overflow: hidden; transform: none; }
  .product-window-top { height: 46px; }
  .window-dots, .product-search, .product-avatar { display: none; }
  .product-ui { height: calc(100% - 46px); grid-template-columns: 105px 1fr; }
  .product-sidebar { padding: 8px 5px; }
  .product-compose { padding: 8px 2px; font-size: 7px; }
  .product-label { font-size: 6px; padding-left: 4px; }
  .product-account, .product-folder { min-height: 26px; gap: 4px; padding: 4px; font-size: 7px; }
  .product-account i { width: 14px; height: 14px; }
  .product-folder svg { width: 9px; }
  .product-conversation { display: none; }
  .product-list { border-right: 0; }
  .product-thread { min-height: 58px; }
  .float-mailboxes { right: -5px; top: 33px; transform: scale(.78); transform-origin: right top; }
  .float-ai { display: none; }
  .landing-benefits, .landing-integrations, .landing-pricing { padding: 70px 18px; }
  .landing-benefit-grid, .integration-row { grid-template-columns: 1fr; }
  .landing-benefit-grid article { min-height: auto; }
  .landing-showcase { padding: 75px 18px; }
  .landing-showcase-inner { grid-template-columns: 1fr; }
  .showcase-copy { text-align: center; }
  .showcase-copy h2 { font-size: 34px; }
  .showcase-copy li { justify-content: center; }
  .showcase-card { padding: 17px; }
  .showcase-stats { grid-template-columns: 1fr; gap: 15px; }
  .showcase-stats div { border-right: 0; border-bottom: 1px solid #e4e6ef; padding-bottom: 12px; }
  .showcase-stats div:last-child { border-bottom: 0; padding-bottom: 0; }
  .showcase-order em { display: none; }
  .landing-final-cta { padding: 30px 18px 65px; }
  .landing-final-cta > div { padding: 48px 20px; }
  .landing-final-cta h2 { font-size: 31px; }
  .landing-final-cta .btn, .final-login-link { display: flex; justify-content: center; margin: 10px auto; max-width: 260px; }
  .landing-footer { flex-direction: column; gap: 15px; text-align: center; }
}
@media (max-width: 420px) {
  .landing-v2-brand { font-size: 18px; }
  .landing-hero-copy h1 { font-size: 37px; }
  .landing-hero-actions a { width: 100%; justify-content: center; }
  .landing-trust-row { flex-direction: column; align-items: center; }
}



/* LANDING V2.1 — zgodność proporcji z zaakceptowaną makietą na szerokich ekranach */
@media (min-width: 1051px) {
  .landing-v2-header {
    padding-left: max(42px, calc((100vw - 1740px) / 2));
    padding-right: max(42px, calc((100vw - 1740px) / 2));
  }
  .landing-hero {
    padding: 48px 42px 42px;
  }
  .landing-hero-inner {
    width: 100%;
    max-width: 1740px;
    grid-template-columns: minmax(540px, .8fr) minmax(760px, 1.2fr);
    gap: 54px;
  }
  .landing-hero-copy {
    padding-left: 0;
    align-self: center;
  }
  .landing-hero-copy h1 {
    max-width: 700px;
    font-size: clamp(58px, 3.8vw, 73px);
    line-height: 1.055;
  }
  .landing-hero-copy > p {
    max-width: 600px;
  }
  .landing-product-wrap {
    width: 100%;
    max-width: 900px;
    justify-self: end;
  }
  .product-window {
    height: 610px;
  }
  .float-mailboxes {
    top: 58px;
    right: -42px;
  }
  .float-ai {
    right: -48px;
    bottom: 155px;
  }
}
@media (min-width: 1500px) {
  .product-ui {
    grid-template-columns: 174px 252px minmax(330px, 1fr);
  }
  .landing-benefits {
    padding-top: 72px;
  }
}



/* LANDING V2.2 — granatowa kolorystyka panelu/logowania i spokojniejsze proporcje */
.landing-v2 {
  --landing-primary: #1F4B99;
  --landing-primary-dark: #173B78;
  --landing-ink: #101B38;
  --landing-muted: #5D677B;
  --landing-line: #E2E7EF;
  --landing-soft: #F5F7FB;
  --landing-shadow: 0 24px 64px rgba(22, 52, 96, .12);
}
.landing-logo-mark {
  background: linear-gradient(135deg, #285AA8, #1F4B99);
  box-shadow: 0 8px 20px rgba(31, 75, 153, .22);
}
.landing-kicker,
.section-kicker,
.landing-section-heading > span {
  color: var(--landing-primary);
  background: #EEF3FA;
  border-color: #DCE6F3;
}
.landing-hero {
  background:
    radial-gradient(circle at 88% 14%, rgba(78, 137, 207, .08), transparent 30%),
    linear-gradient(180deg, #FFFFFF 0%, #FBFCFE 80%, #F3F6FA 100%);
}
.landing-hero::after {
  background-image: radial-gradient(#D5E0ED 1px, transparent 1px);
}
.product-mini-brand span,
.product-compose,
.composer-actions button {
  background: #1F4B99;
}
.message-agent {
  background: linear-gradient(135deg, #285AA8, #1F4B99);
}
.product-account.active,
.product-folder.active,
.product-thread.selected {
  background: #EAF0FB;
  color: #173B78;
}
.thread-line {
  background: #2A5AA2;
}
.landing-trust-row svg {
  background: #1F4B99;
}
.benefit-indigo {
  color: #1F4B99;
  background: #EAF0FB;
}
.benefit-violet {
  color: #466B9E;
  background: #EDF2F7;
}
.landing-showcase {
  background: linear-gradient(135deg, #102343, #1B3F70);
}
.showcase-copy .section-kicker {
  color: #D8E8FB;
  background: rgba(95, 151, 216, .14);
  border-color: rgba(180, 207, 237, .22);
}
.showcase-copy li svg {
  color: #7FA9D8;
}
.landing-final-cta > div {
  background: linear-gradient(135deg, #234F91, #173B70);
  box-shadow: 0 22px 55px rgba(22, 58, 111, .2);
}
.landing-pricing .price-card.featured {
  border-color: #1F4B99;
  box-shadow: 0 16px 40px rgba(31, 75, 153, .12);
}
.landing-float-card {
  color: #1F4B99;
  box-shadow: 0 12px 32px rgba(32, 62, 107, .13);
}

@media (min-width: 1051px) {
  .landing-v2-header {
    padding-left: max(52px, calc((100vw - 1640px) / 2));
    padding-right: max(52px, calc((100vw - 1640px) / 2));
  }
  .landing-hero {
    padding: 56px 52px 50px;
  }
  .landing-hero-inner {
    max-width: 1640px;
    grid-template-columns: minmax(520px, .82fr) minmax(720px, 1.18fr);
    gap: 68px;
  }
  .landing-hero-copy h1 {
    max-width: 660px;
    font-size: clamp(56px, 3.45vw, 68px);
    line-height: 1.07;
  }
  .landing-product-wrap {
    max-width: 850px;
  }
  .product-window {
    height: 588px;
  }
  .float-mailboxes {
    right: -28px;
  }
  .float-ai {
    right: -34px;
    bottom: 150px;
  }
}
@media (min-width: 1500px) {
  .product-ui {
    grid-template-columns: 166px 238px minmax(320px, 1fr);
  }
}

/* podgląd logu synchronizacji (Ustawienia → Dziennik → Log) */
.sync-log-pre {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5;
  max-height: 70vh; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
