/* ====================================================================
   Lokal Biznes — CRM  ·  design system 2026 (light + dark)
   ==================================================================== */
:root {
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #f3f4fb;
  --elev: #f7f8ff;
  --text: #1a1f2e;
  --muted: #707892;
  --border: #e8eaf2;
  --border-soft: #eef0f6;
  --brand: #5b5bf0;
  --brand-d: #4747d6;
  --brand-soft: #ecedff;
  --input-bg: #ffffff;
  --overlay: rgba(20, 25, 50, .42);
  --shadow: 0 1px 2px rgba(20, 25, 50, .04), 0 6px 20px rgba(20, 25, 50, .05);
  --shadow-lg: 0 10px 40px rgba(20, 25, 50, .14);
  --ok: #16a34a; --warn: #d97706; --bad: #dc2626;
}
[data-theme="dark"] {
  --bg: #0d0f17;
  --surface: #161a26;
  --surface-2: #1c2130;
  --elev: #1e2433;
  --text: #e7eaf3;
  --muted: #8a93a8;
  --border: #262c3c;
  --border-soft: #222838;
  --brand: #7d7dff;
  --brand-d: #6a6aff;
  --brand-soft: #20223c;
  --input-bg: #1c2130;
  --overlay: rgba(0, 0, 0, .58);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .28);
  --shadow-lg: 0 14px 50px rgba(0, 0, 0, .5);
  --ok: #34d399; --warn: #fbbf24; --bad: #f87171;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
  -webkit-font-smoothing: antialiased; transition: background .2s, color .2s;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; border: 2px solid var(--bg); }

/* ============ LAYOUT ============ */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 252px; flex: 0 0 252px; background: var(--surface);
  border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 18px 14px; gap: 16px; z-index: 70;
}
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 24px 30px 64px; flex: 1; }

/* ---- Sidebar internals ---- */
.side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 2px; }
.logo {
  width: 40px; height: 40px; border-radius: 11px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--brand), #9333ea);
  color: #fff; font-weight: 800; letter-spacing: .5px; display: grid; place-items: center; font-size: 15px;
}
.side-brand-txt { display: flex; flex-direction: column; line-height: 1.25; }
.side-brand-txt b { font-size: 15px; font-weight: 700; }
.side-brand-txt span { font-size: 11.5px; color: var(--muted); }

.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; transition: .14s; user-select: none;
}
.nav-item .ni-ic { font-size: 16px; width: 20px; text-align: center; }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); }
.nav-item.disabled { opacity: .5; cursor: default; }
.nav-item.disabled:hover { background: none; }
.ni-count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 1px 8px; border-radius: 99px; }
.ni-soon { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.side-group { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.side-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 8px 6px 2px; }
.side-tools { display: flex; flex-direction: column; gap: 5px; }
.side-tools .btn { justify-content: flex-start; text-align: left; font-weight: 500; }
.btn.block { width: 100%; justify-content: center; }

.side-foot { border-top: 1px solid var(--border); padding-top: 12px; }
.theme-toggle {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 13.5px; cursor: pointer; transition: .14s;
}
.theme-toggle:hover { border-color: var(--brand); }
.sidebar-backdrop { display: none; }

/* ============ TOPBAR ============ */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 14px 30px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 19px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.hamburger { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text); }
.top-search { margin-left: auto; flex: 0 1 360px; }
.top-search input {
  width: 100%; padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--input-bg); color: var(--text); font-size: 13.5px; font-family: inherit; outline: none; transition: .14s;
}
.top-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ============ BUTTONS ============ */
.btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 9px 15px; border-radius: 10px; font-size: 13.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: .15s; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
}
.btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn.primary:hover { background: var(--brand-d); border-color: var(--brand-d); }
.btn.ghost { background: var(--surface); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.btn.small { padding: 6px 12px; font-size: 12.5px; }

/* ============ STATS CARDS ============ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after { content: ""; position: absolute; right: -10px; top: -10px; width: 64px; height: 64px; border-radius: 50%; background: var(--brand-soft); opacity: .5; }
.stat .num { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.02em; position: relative; }
.stat .lbl { color: var(--muted); font-size: 12.5px; margin-top: 8px; position: relative; }
.stat.accent .num { color: var(--brand); }
.stat.green .num { color: var(--ok); }

/* ============ DASHBOARD ============ */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px 22px; box-shadow: var(--shadow); }
.chart-card.wide { grid-column: 1 / -1; }
.chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.chart-title { font-size: 14.5px; font-weight: 700; }
.chart-sub { font-size: 12px; color: var(--muted); }
.bar-row { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 12px; padding: 5px 0; font-size: 13px; }
.bar-row .bl { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 9px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--brand); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.bar-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.donuts { display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-around; }
.donut { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.donut svg { width: 96px; height: 96px; }
.donut .ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 9; }
.donut .ring-c { font-size: 20px; font-weight: 800; fill: var(--text); }
.donut-lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ============ TOOLBAR / FILTERS ============ */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--input-bg); font-size: 13.5px; color: var(--text); outline: none; cursor: pointer; font-family: inherit;
}
.toolbar select:focus { border-color: var(--brand); }
.check { display: flex; align-items: center; gap: 7px; color: var(--muted); cursor: pointer; user-select: none; font-size: 13px; }

/* filtry kontaktu (kwadraciki) + licznik wyników */
.contact-filter { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.contact-filter .check { flex: 0 0 auto; }
.cf-label { color: var(--muted); font-size: 13px; }
.lead-count { color: var(--muted); font-size: 13px; margin-left: auto; white-space: nowrap; }

/* klikalne nagłówki = sortowanie */
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover { color: var(--brand); }
.th-sort .arr { font-size: 10px; margin-left: 2px; letter-spacing: -1px; }
.sort-on { color: var(--brand); }
.th-seo .th-sort { display: inline-block; margin-right: 9px; }

/* ============ TABLE ============ */
table.leads {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
}
.leads th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-weight: 700;
}
.leads td { padding: 13px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.leads tbody tr { cursor: pointer; transition: background .12s; }
.leads tbody tr:hover { background: var(--elev); }
.leads tbody tr:last-child td { border-bottom: none; }
.firma-name { font-weight: 650; }
.muted { color: var(--muted); }
.chevron { color: var(--muted); }

.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; }
.www-yes { color: var(--ok); font-weight: 600; }
.www-no { color: var(--bad); font-weight: 700; }
.www-social { color: var(--warn); font-weight: 700; }
.empty { text-align: center; padding: 70px 20px; color: var(--text); }
.empty .muted { font-weight: 400; }

/* ============ DRAWER ============ */
.drawer-overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 80; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 470px; max-width: 92vw;
  background: var(--surface); z-index: 90; box-shadow: var(--shadow-lg); overflow-y: auto; padding: 26px;
}
.drawer h2 { margin: 0 0 4px; font-size: 20px; }
.drawer .close { position: absolute; top: 18px; right: 20px; font-size: 22px; cursor: pointer; color: var(--muted); border: none; background: none; }
.field { margin: 14px 0; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 13.5px; font-family: inherit; outline: none; background: var(--input-bg); color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 24px 0 8px; font-weight: 700; }
.notes { display: flex; flex-direction: column; gap: 8px; }
.note { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.note .when { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.note-add { display: flex; gap: 8px; margin-top: 8px; }
.note-add input { flex: 1; }
.drawer-footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--border); }
.demo-panel { display: grid; gap: 10px; }
.demo-create { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.demo-create select { min-width: 0; }
.demo-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface-2); }
.demo-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.demo-card-head > div { display: grid; gap: 2px; }
.demo-card-head .muted { font-size: 11px; }
.demo-status { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.demo-status.queued { color: #7c5b13; background: #fff4cf; }
.demo-status.running { color: #075985; background: #dff4ff; }
.demo-status.succeeded { color: #166534; background: #dcfce7; }
.demo-status.failed { color: #991b1b; background: #fee2e2; }
.demo-thumb { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; margin-top: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.demo-card-actions { display: flex; align-items: center; justify-content: flex-end; margin-top: 10px; font-size: 12px; }
.demo-error { padding: 9px 10px; border-radius: 8px; color: #991b1b; background: #fee2e2; font-size: 12px; }
.demo-empty,.demo-loading { padding: 14px; border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); font-size: 12px; text-align: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ============ MODAL ============ */
.modal-overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 100; display: grid; place-items: center; padding: 20px; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; width: 560px; max-width: 100%; max-height: 90vh; overflow-y: auto; padding: 28px; box-shadow: var(--shadow-lg); }
.modal h2 { margin: 0 0 18px; font-size: 20px; }
.modal .drawer-footer { margin-top: 22px; }

/* ============ SCRAPER ============ */
.branze-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px 12px; max-height: 230px; overflow-y: auto; padding: 4px 2px; margin-top: 4px; }
.branze-grid label { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; padding: 6px 9px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); }
.branze-grid label:hover { border-color: var(--brand); }
.branze-grid label input { width: auto; flex: 0 0 auto; }
.branze-grid input:checked + span { font-weight: 600; color: var(--brand); }
.branze-tools { display: flex; gap: 12px; margin: 6px 0 2px; }
.branze-tools a { color: var(--brand); font-size: 12.5px; cursor: pointer; }
.hint { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--border)); color: var(--text); padding: 10px 12px; border-radius: 10px; font-size: 12.5px; margin-top: 10px; }
.scrape-progress { text-align: center; padding: 22px 10px; }
.spinner { width: 42px; height: 42px; margin: 0 auto 14px; border: 4px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scrape-progress .big { font-size: 16px; font-weight: 600; margin: 4px 0; }

/* ============ TOAST ============ */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: #11141f; color: #fff; padding: 13px 22px; border-radius: 12px; font-size: 13.5px; z-index: 200; box-shadow: var(--shadow-lg); max-width: 92vw; text-align: center; }

/* ============ COVERAGE MAP ============ */
.cov-summary { background: var(--surface-2); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin: 4px 0 12px; }
.cov-list { display: flex; flex-direction: column; gap: 6px; }
.cov-item { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cov-item.full { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.cov-item.partial { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.cov-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; font-size: 14px; }
.cov-item.full .cov-row { background: color-mix(in srgb, var(--ok) 10%, transparent); }
.cov-item.partial .cov-row { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.cov-dot { flex: 0 0 auto; font-size: 13px; }
.cov-name { flex: 0 0 auto; min-width: 140px; font-weight: 600; }
.cov-name small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.cov-prog { flex: 1; display: flex; align-items: center; gap: 8px; }
.cov-bar { flex: 1; height: 8px; max-width: 220px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.cov-bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .3s; }
.cov-item.partial .cov-bar i { background: var(--warn); }
.cov-prog b { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cov-badge { flex: 0 0 auto; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cov-item.full .cov-badge { color: var(--ok); }
.cov-item.partial .cov-badge { color: var(--warn); }
.cov-caret { flex: 0 0 auto; color: var(--muted); transition: transform .2s; }
.cov-item.open .cov-caret { transform: rotate(180deg); }
.cov-detail { display: none; padding: 8px 14px 12px; border-top: 1px dashed var(--border); }
.cov-item.open .cov-detail { display: block; }
.cov-tier { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13.5px; flex-wrap: wrap; }
.cov-tier > span:first-child { min-width: 210px; }
.cov-tcount { color: var(--muted); font-variant-numeric: tabular-nums; }
.cov-tier small { color: var(--muted); flex-basis: 100%; padding-left: 24px; }
.cov-detail-actions { display: flex; align-items: center; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.cov-allgood { color: var(--ok); font-size: 13px; font-weight: 600; }
.cov-forget { color: var(--bad); cursor: pointer; font-weight: 600; text-decoration: none; font-size: 13px; }
.cov-forget:hover { opacity: .75; }
.cov-tabs { display: flex; gap: 6px; margin: 2px 0 10px; }
.cov-tabs button { border: 1px solid var(--border); background: var(--surface); padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.cov-tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.cov-region { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cov-region.full { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.cov-region.partial { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.cov-rhead { display: flex; align-items: center; gap: 10px; padding: 11px 12px; cursor: pointer; font-weight: 700; }
.cov-region.full .cov-rhead { background: color-mix(in srgb, var(--ok) 10%, transparent); }
.cov-region.partial .cov-rhead { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.cov-region.todo .cov-rhead { background: var(--surface-2); }
.cov-rname { flex: 0 0 auto; min-width: 140px; }
.cov-rbadge { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.cov-region.full .cov-rbadge { color: var(--ok); }
.cov-region.partial .cov-bar i { background: var(--warn); }
.cov-region .cov-caret { transition: transform .2s; }
.cov-region:not(.open) .cov-caret { transform: rotate(-90deg); }
.cov-rbody { display: none; flex-direction: column; gap: 6px; padding: 0 8px 8px; }
.cov-region.open .cov-rbody { display: flex; }

/* ============ RESPONSIVE ============ */
@media (max-width: 880px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 65; }
  .hamburger { display: block; }
  .content { padding: 18px 16px 56px; }
  .topbar { padding: 12px 16px; }
  .dash-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .topbar h1 { font-size: 17px; }
  .top-search { flex-basis: auto; }
  .stat .num { font-size: 24px; }
  .toolbar select, .check { flex: 1 1 100%; min-width: 0; }
  /* tabela -> karty */
  table.leads, .leads tbody, .leads tr, .leads td { display: block; width: 100%; }
  .leads { border: none; background: transparent; box-shadow: none; }
  .leads thead { display: none; }
  .leads tbody tr { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 12px; padding: 10px 14px 12px; box-shadow: var(--shadow); }
  .leads td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border-soft); border-bottom: none; text-align: right; }
  .leads td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; flex: 0 0 auto; text-align: left; }
  .leads td.firma-name { display: block; border-top: none; text-align: left; font-size: 16.5px; font-weight: 700; padding: 2px 0 6px; }
  .leads td.firma-name::before { display: none; }
  .leads td[data-label="Kontakt"] { display: block; text-align: left; }
  .leads td[data-label="Kontakt"]::before { display: block; margin-bottom: 3px; }
  .leads td.chevron { display: none; }
  .drawer { width: 100%; max-width: 100%; padding: 18px; }
  .modal-overlay { padding: 10px; }
  .modal { padding: 18px; width: 100%; max-width: 94vw; }
  .row2 { grid-template-columns: 1fr; }
  .branze-grid { grid-template-columns: 1fr; max-height: 220px; }
  .cov-row { flex-wrap: wrap; }
  .cov-name { min-width: 0; }
  .cov-prog { flex-basis: 100%; order: 3; }
  .cov-tier > span:first-child { min-width: 0; }
  .cov-rname { min-width: 0; }
  .bar-row { grid-template-columns: 110px 1fr 40px; }
}
/* Keyboard-accessible PL / EN language switch, also used on the login page. */
.language-toggle{display:flex;align-items:center;justify-content:center;gap:9px;min-height:44px;margin:0 0 10px;padding:7px 14px;border:1px solid var(--line,#2c3346);border-radius:10px;background:transparent;color:inherit;font:600 13px/1.4 system-ui;cursor:pointer;width:100%}
.language-toggle:focus-visible{outline:3px solid #ff5a3c;outline-offset:3px}
.language-track{display:block;width:38px;height:22px;padding:3px;border-radius:20px;background:#64748b}
.language-thumb{display:block;width:16px;height:16px;background:#fff;border-radius:50%;transition:transform .15s}
.language-toggle[aria-checked=true] .language-track{background:#ff5a3c}
.language-toggle[aria-checked=true] .language-thumb{transform:translateX(16px)}
@media(prefers-reduced-motion:reduce){.language-thumb{transition:none}}
.demo-create .agent-demo { grid-column: 1 / -1; }
.demo-engine { font-weight: 700; color: var(--brand); }
