/*
 * Portfel — wspólny arkusz stylów, projekt v2 (docs/spec/design-v2/README.md).
 * Jedyny arkusz aplikacji; szablony nie mają atrybutów style= ani bloków <style>.
 *
 * Słownik klas dla wszystkich stron (także Analiza/Analizy i Ustawienia):
 *   układ:      .page-main (.is-narrow), .page-head, .page-kicker, .page-title, .page-lead,
 *               .split (+ .split-main, .split-aside), .stack, .row-wrap, .grid-2, .grid-3
 *   karty:      .card (.is-flush, .is-highlight, .is-success), .card-head, .card-body, .card-foot,
 *               .section-title, .section-lead
 *   KPI:        .kpi-grid (.is-4, .is-5), .kpi, .kpi-label, .kpi-value, .kpi-sub
 *   liczby:     .num, .pos, .neg, .warn, .muted, .dim (wygaszone „—”), .unit, .sub, .strong
 *   plakietki:  .badge + .act-buy/.act-add/.act-hold/.act-wait/.act-trim/.act-sell/.act-none,
 *               .badge.is-struck (poprzednia akcja), .zrank + .z1…z5/.z-none, .tag (źródło),
 *               .chg-pill + .pos/.neg/.zero/.none (zmiana dnia), .signal-kind + .pos/.neg
 *   przyciski:  .btn, .btn-primary, .btn-secondary, .btn-sm, .btn-ghost, .btn-block, .icon-btn
 *   pola:       .form-field, .form-grid, .form-hint, .stack-form, .inline-form, .choice, .check,
 *               .input-short, .errorlist, .alert-error, .alert-info, .alert-success
 *   filtry:     .pills (+ .pill, .pill.is-active, aria-current), .tabs (podkreślenie; przewijane)
 *   tabele:     .table-wrap (.is-sticky), .table (.is-wide, .is-compact, .is-portfolio), .sticky-col,
 *               th .sort-link (.is-sorted, .sort-icon ↕, .sort-dir), .col-* (szerokości Portfela)
 *   paski:      svg.bar (.bar-track, .bar-fill + .is-info/.is-warning/.is-breach/.is-accent/.is-pos/.is-neg,
 *               .bar-mark + .is-warning/.is-limit/.is-price/.is-target), svg.range (52 tyg.),
 *               svg.alloc (+ .c1…c8, .swatch.c1…c8)
 *   szerokości: .w-0 … .w-100 (procent szerokości), .l-0 … .l-100 (przesunięcie od lewej) —
 *               dla pasków HTML/CSS (np. scenariusze bear/base/bull) bez stylów w szablonie
 *   raport:     .report (Markdown, Source Serif 4), .report .footnotes/.sources, .report-changes
 *   scenariusze:.scenario-chart, .scenario-row, .scenario-name, .scenario-track,
 *               .scenario-range + .is-bear/.is-base/.is-bull, .scenario-marker + .is-price/.is-target,
 *               .scenario-legend
 *   fakty:      .fact-grid, .fact, .fact-label, .fact-value
 *   telefon:    .d-only (tylko ≥ 768 px), .m-only (tylko < 768 px), .m-list, .m-row, .m-row-main,
 *               .m-row-mid, .m-head, .tabbar (dolny pasek), .scroll-row (przewijany rząd)
 */

:root {
  --bg: #0A0D12;
  --header: #0D1117;
  --card: #11161D;
  --well: #0D1117;
  --border-card: #1E2631;
  --border-field: #263040;
  --line: #1A212B;
  --hover: #1A212B;
  --text: #E6EAF0;
  --text-strong: #D2D8E1;
  --text-2: #9AA4B2;
  --text-3: #C6CFDB;
  --dim: #6B7685;
  --accent: #F5B547;
  --on-accent: #1A1405;
  --link-hover: #FFD08A;
  --pos: #3DD68C;
  --neg: #FF6B6B;
  --warn: #F5B547;
  --info: #5B8DEF;
  --target: #A78BFA;
  --orange: #FF9F5A;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Space Grotesk", Inter, system-ui, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --radius-card: 14px;
  --radius-kpi: 12px;
  --radius-ctl: 8px;
  --tabbar-h: 72px;
  color-scheme: dark;
}

/* --- podstawy ------------------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.app {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  overflow-x: hidden;
}
.app a { color: var(--accent); text-decoration: none; }
.app a:hover { color: var(--link-hover); }
.app a:focus-visible, .app button:focus-visible, .app input:focus-visible,
.app select:focus-visible, .app textarea:focus-visible, .app summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.app h1, .app h2, .app h3, .app h4 { font-family: var(--font-head); margin: 0; letter-spacing: -0.01em; }
.app h1 { font-size: 32px; letter-spacing: -0.02em; }
.app h2 { font-size: 20px; }
.app h3 { font-size: 16px; }
.app h4 { font-size: 14px; }
.app p { margin: 0 0 8px; }
.app p:last-child { margin-bottom: 0; }
.app small { font-size: 12px; }
.app img, .app svg { max-width: 100%; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.num-left { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.dim { color: var(--dim); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.warn { color: var(--warn); }
.info { color: var(--info); }
.strong { font-weight: 600; }
.sub { display: block; color: var(--text-2); font-size: 12px; font-weight: 400; margin-top: 2px; }
a.sub { color: var(--accent); }
.unit { color: var(--text-2); font-size: 0.85em; font-weight: 400; }
.note { color: var(--text-2); font-size: 12px; line-height: 1.6; margin: 8px 0 0; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- nagłówek i nawigacja ------------------------------------------------------------------ */

.site-header { background: var(--header); border-bottom: 1px solid var(--border-card); }
.nav-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 32px;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.nav-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 700; font-size: 18px; letter-spacing: -0.01em;
  color: var(--text);
}
.app a.nav-brand { color: var(--text); }
.nav-brand::before {
  content: ""; width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: inline-block;
}
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.app .nav-link {
  display: inline-block; padding: 8px 14px; border-radius: var(--radius-ctl);
  color: var(--text-2); font-weight: 500;
}
.app .nav-link:hover { color: var(--text); background: var(--hover); }
.app .nav-link.is-active { background: var(--hover); color: var(--text); font-weight: 600; }
.nav-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav-search { display: flex; gap: 8px; align-items: center; }
.nav-search input[type="text"] { width: 180px; }
.nav-logout { margin: 0; }
.mobile-head { display: none; }

/* Dolny pasek zakładek (telefon < 768 px). */
.tabbar { display: none; }

/* --- układ strony -------------------------------------------------------------------------- */

.page-main {
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px 32px 56px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.page-main.is-narrow { max-width: 760px; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.page-head-text { min-width: 0; }
.page-kicker { color: var(--text-2); font-size: 13px; }
.page-title { margin: 6px 0 0; }
.page-lead { color: var(--text-2); font-size: 13px; margin: 6px 0 0; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row-wrap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.split { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.split-main { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.split-aside { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.section-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.section-lead { color: var(--text-2); }

/* Czas danych i odświeżanie. */
.data-time { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--text-2); font-size: 13px; }
.data-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pos); display: inline-block; flex: none; }
.data-dot.is-stale { background: var(--warn); }
.data-dot.is-none { background: var(--dim); }
.refresh-form { display: inline-flex; margin: 0; }

/* --- karty --------------------------------------------------------------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  min-width: 0;
}
.card > h2:first-child, .card > h3:first-child { margin-bottom: 12px; }
.card.is-flush { padding: 0; overflow: hidden; }
.card.is-highlight { border-color: #3A2C0E; box-shadow: inset 3px 0 0 var(--accent); }
.card.is-success { border-color: #123A27; }
.card-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 16px 18px 12px;
}
.card-head h2, .card-head h3 { font-size: 16px; }
.card-body { padding: 16px 18px; }
.card-foot { color: var(--text-2); font-size: 12px; line-height: 1.6; padding: 12px 18px 16px; margin: 0; border-top: 1px solid var(--line); }
.card:not(.is-flush) > .card-foot { padding: 12px 0 0; margin-top: 12px; }

/* --- KPI ----------------------------------------------------------------------------------- */

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi-grid.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-grid.is-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi {
  background: var(--card); border: 1px solid var(--border-card); border-radius: var(--radius-kpi);
  padding: 16px 18px; display: flex; flex-direction: column; min-width: 0;
}
.kpi-label { color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.kpi-value {
  font-family: var(--font-head); font-size: 26px; font-weight: 600; margin-top: 8px;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.kpi-value .unit { font-size: 16px; }
.kpi-sub { font-size: 13px; margin-top: 4px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.kpi-list { list-style: none; padding: 0; margin: 6px 0 0; font-size: 13px; }

/* --- plakietki ----------------------------------------------------------------------------- */

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; line-height: 1.4;
  background: #1F2733; color: var(--text-3); white-space: nowrap; vertical-align: middle;
}
.badge.act-buy, .badge.act-add, .badge-buy { background: #123A27; color: #3DD68C; }
.badge.act-hold, .badge-hold { background: #1F2733; color: #C6CFDB; }
.badge.act-wait, .badge-wait { background: #3A2C0E; color: #F5B547; }
.badge.act-trim, .badge-trim { background: #3D2412; color: #FF9F5A; }
.badge.act-sell, .badge-sell { background: #3F1618; color: #FF6B6B; }
.badge.act-none { background: #151B23; color: #6B7685; }
.badge.is-struck { background: var(--hover); color: var(--text-2); text-decoration: line-through; }
.badge.is-warning, .badge.warn { background: #3A2C0E; color: var(--warn); }
.badge.is-breach { background: #3F1618; color: var(--neg); }
.badge.is-held, .badge.is-confirmed { background: #123A27; color: var(--pos); }
.badge.is-draft { background: #3A2C0E; color: var(--warn); }
.badge.is-info { background: #16223A; color: var(--info); }
.badge.is-rank { border-radius: 6px; min-width: 24px; text-align: center; }

.zrank {
  display: inline-block; min-width: 24px; padding: 3px 6px; border-radius: 6px;
  font-weight: 700; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums;
  background: #151B23; color: #6B7685;
}
.zrank.z1 { background: #123A27; color: #3DD68C; }
.zrank.z2 { background: #173326; color: #8FE3B5; }
.zrank.z3 { background: #1F2733; color: #C6CFDB; }
.zrank.z4 { background: #3D2412; color: #FF9F5A; }
.zrank.z5 { background: #3F1618; color: #FF6B6B; }

.tag {
  display: inline-block; padding: 3px 8px; border-radius: 6px; background: var(--hover);
  color: var(--text-3); font-size: 12px; white-space: nowrap;
}
.signal-kind {
  display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 700;
  background: #1F2733; color: #C6CFDB; white-space: nowrap; justify-self: start;
}
.signal-kind.pos { background: #123A27; color: #3DD68C; }
.signal-kind.neg { background: #3F1618; color: #FF6B6B; }

.chg-pill {
  display: inline-block; min-width: 66px; padding: 6px 4px; border-radius: 6px; text-align: center;
  font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums;
  background: #151B23; color: var(--dim);
}
.chg-pill.pos { background: var(--pos); color: var(--bg); }
.chg-pill.neg { background: var(--neg); color: var(--bg); }
.chg-pill.zero { background: #1F2733; color: var(--text-3); }

.analysis-cell { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.analysis-cell .muted { font-size: 12px; }
.rec-cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.rec-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* --- przyciski i pola ---------------------------------------------------------------------- */

.btn, .app button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 8px 14px; border-radius: var(--radius-ctl);
  border: 1px solid var(--border-field); background: transparent; color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; text-align: center; white-space: nowrap;
}
.app a.btn { color: var(--text); }
.btn:hover, .app a.btn:hover { background: var(--hover); color: var(--text); }
.btn-sm, .app button.btn-sm { min-height: 32px; padding: 6px 12px; font-size: 13px; }
.btn-primary, .app button.btn-primary, .app a.btn-primary {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700;
}
.btn-primary:hover, .app a.btn-primary:hover, .app button.btn-primary:hover {
  background: var(--link-hover); border-color: var(--link-hover); color: var(--on-accent);
}
.btn-secondary, .app button.btn-secondary { background: var(--hover); }
.btn-ghost, .app button.btn-ghost { border-color: transparent; color: var(--text-2); }
.btn-block { width: 100%; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border-field);
  background: var(--card); color: var(--text); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.app button:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

.app input[type="text"], .app input[type="password"], .app input[type="email"], .app input[type="number"],
.app input[type="search"], .app input[type="date"], .app input[type="file"], .app input[type="url"],
.app select, .app textarea {
  background: var(--card); border: 1px solid var(--border-field); border-radius: var(--radius-ctl);
  color: var(--text); padding: 9px 12px; font: inherit; min-height: 38px; max-width: 100%;
}
.app textarea { min-height: 96px; width: 100%; resize: vertical; line-height: 1.5; }
.app input[type="file"] { padding: 7px 10px; width: 100%; }
.app input::placeholder, .app textarea::placeholder { color: var(--dim); }
.app input[type="checkbox"], .app input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
.input-short { width: 140px; }
.inline-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; flex-wrap: wrap; }
.inline-form label { color: var(--text-2); font-size: 13px; }
.stack-form { display: flex; flex-direction: column; gap: 16px; }
.stack-form .btn-primary { align-self: flex-start; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field > label, .form-field legend { color: var(--text-2); font-size: 13px; font-weight: 500; }
.form-field fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.form-field legend { padding: 0; margin-bottom: 8px; }
.form-field input, .form-field select { width: 100%; }
.form-hint { color: var(--text-2); font-size: 12px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.choice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border-field); background: var(--well); cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--accent); }
.check { display: inline-flex; gap: 8px; align-items: center; color: var(--text-3); cursor: pointer; }
.app .errorlist { list-style: none; margin: 4px 0 0; padding: 0; color: var(--neg); font-size: 13px; }
.alert-error, .alert-info, .alert-success {
  border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.5;
}
.alert-error { background: #2A1215; border: 1px solid #3F1618; color: #FFB3B3; }
.alert-info { background: #121C2E; border: 1px solid #1E2E4A; color: #B9CCF5; }
.alert-success { background: #0F2A1D; border: 1px solid #123A27; color: #A9EFCB; }

/* --- filtry i zakładki --------------------------------------------------------------------- */

.pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.app .pill {
  display: inline-flex; align-items: center; min-height: 36px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border-field); color: var(--text-3); font-size: 13px; white-space: nowrap;
  background: transparent;
}
.app .pill:hover { color: var(--text); background: var(--hover); }
.app .pill.is-active, .app .pill[aria-current="page"], .app .pill[aria-current="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600;
}
.pill .count { opacity: 0.8; margin-left: 4px; }

.tabs {
  display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; border-bottom: 1px solid var(--border-card);
  scrollbar-width: none; margin: 0; padding: 0; list-style: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button, .tabs .tab {
  flex: none; padding: 10px 14px; min-height: 44px; display: inline-flex; align-items: center;
  color: var(--text-2); background: none; border: 0; border-bottom: 2px solid transparent;
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs [aria-current="page"], .tabs [aria-selected="true"], .tabs [aria-pressed="true"], .tabs .is-active {
  color: var(--accent); border-bottom-color: var(--accent);
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters label { color: var(--text-2); font-size: 13px; }
.scroll-row { display: flex; gap: 8px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-row > * { flex: none; }

/* --- tabele -------------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 12px 10px; text-align: left; vertical-align: middle; }
.table td { border-top: 1px solid var(--line); }
.table th:first-child, .table td:first-child { padding-left: 18px; }
.table th:last-child, .table td:last-child { padding-right: 18px; }
.table thead th {
  color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
  font-weight: 600; padding-top: 14px; padding-bottom: 14px; white-space: nowrap;
}
.table tbody th { font-weight: 400; border-top: 1px solid var(--line); text-align: left; }
.table .num { text-align: right; }
.table .center { text-align: center; }
.table .ticker { font-weight: 700; font-size: 15px; }
.table .actions { text-align: right; white-space: nowrap; }
.table.is-wide { min-width: 1180px; }
.table.is-compact th, .table.is-compact td { padding-top: 9px; padding-bottom: 9px; }
.table tbody tr:hover td, .table tbody tr:hover th { background: rgba(26, 33, 43, 0.5); }
.app .sort-link { color: var(--text-2); display: inline-flex; gap: 4px; align-items: center; }
.app .sort-link:hover { color: var(--text); }
.app .sort-link.is-sorted { color: var(--accent); }
.share-cell { min-width: 130px; }
.app .sort-link .sort-icon { color: var(--dim); font-size: 11px; }
.app .sort-link .sort-dir { font-size: 11px; }

/* Portfel (desktop): od 1280 px (np. 1440 px → ramka ok. 1294 px) wszystkie kolumny bez
   poziomego przewijania — stały układ, szerokości kolumn w % sumują się do 100.
   Nagłówek i kolumna „Spółka” przyklejone; przodkowie bez kontenera przewijania (clip/visible),
   więc nagłówek trzyma się okna. Węższe okno: ramka przewija się w obu osiach (nagłówek
   i kolumna przyklejone wewnątrz niej). */
.card.is-sticky-table { overflow: clip; }
.table-wrap.is-sticky { overflow: visible; }
.table.is-portfolio { table-layout: fixed; width: 100%; font-size: 13px; }
.table.is-portfolio th, .table.is-portfolio td { padding: 9px 6px; overflow: hidden; }
.table.is-portfolio th:first-child, .table.is-portfolio td:first-child { padding-left: 14px; }
.table.is-portfolio th:last-child, .table.is-portfolio td:last-child { padding-right: 14px; }
.table.is-portfolio thead th {
  position: sticky; top: 0; z-index: 2; background: var(--card); box-shadow: inset 0 -1px 0 var(--line);
  white-space: normal; font-size: 11px; letter-spacing: 0.03em; padding-top: 10px; padding-bottom: 10px;
}
.table.is-portfolio .sticky-col { position: sticky; left: 0; z-index: 1; background: var(--card); }
.table.is-portfolio thead .sticky-col { z-index: 3; }
.table.is-portfolio tbody tr:hover .sticky-col { background: #161C24; }
.table.is-portfolio .ticker { font-size: 14px; }
.table.is-portfolio .sub { font-size: 11px; }
.table.is-portfolio .ellipsis { display: block; }
.table.is-portfolio .share-cell { min-width: 0; }
.table.is-portfolio .rec-cell { gap: 2px; }
.table.is-portfolio .actions .btn-sm { padding-left: 10px; padding-right: 10px; }
.col-company { width: 13%; }
.col-quote { width: 9%; }
.col-value { width: 9%; }
.col-share { width: 8%; }
.col-day { width: 14%; }
.col-pnl { width: 8%; }
.col-rec { width: 12%; }
.col-potential { width: 10%; }
.col-zacks { width: 9%; }
.col-actions { width: 8%; }
@media (max-width: 1279.98px) {
  .table-wrap.is-sticky { overflow: auto; max-height: calc(100vh - 96px); }
}

/* --- listy ---------------------------------------------------------------------------------- */

.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 10px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list.is-cards { display: flex; flex-direction: column; gap: 8px; }
.list.is-cards > li {
  border: 1px solid var(--border-card); border-radius: 10px; padding: 12px 14px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center;
}
.inline-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.bullets { margin: 6px 0 0; padding-left: 20px; }
.bullets > li + li { margin-top: 4px; }
.sub-heading { margin: 16px 0 6px; font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.card > .side-head + * { margin-top: 8px; }
.source-list { list-style: none; margin: 0; padding: 0; }
.source-list > li + li { margin-top: 4px; }
.app details > summary { cursor: pointer; color: var(--text-2); }
details.disclosure { margin-top: 12px; }
details.disclosure > summary { padding: 4px 0; }

/* --- Dzisiaj: karty „Do decyzji”, sygnały, wyniki ------------------------------------------- */

.decision-card {
  background: var(--card); border: 1px solid var(--border-card); border-radius: var(--radius-card);
  padding: 18px 20px; display: flex; gap: 18px; align-items: flex-start;
}
.decision-card.is-review { box-shadow: inset 3px 0 0 var(--accent); }
.decision-id { min-width: 88px; }
.decision-ticker { font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.decision-name { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.decision-body { flex: 1; min-width: 0; }
.decision-change { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.decision-why { margin: 10px 0 0; line-height: 1.55; color: var(--text-strong); }
.decision-facts {
  display: flex; gap: 18px; margin-top: 10px; color: var(--text-2); font-size: 12px; flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}
.decision-facts b { color: var(--text); font-weight: 600; }
.decision-facts b.pos { color: var(--pos); }
.decision-facts b.neg { color: var(--neg); }
.decision-actions { display: flex; flex-direction: column; gap: 8px; }
.arrow { color: var(--text-2); flex: none; }

.signal-list { background: var(--card); border: 1px solid var(--border-card); border-radius: var(--radius-card); overflow: hidden; }
.signal-row {
  display: grid; grid-template-columns: 70px 130px minmax(0, 1fr) 150px 90px; gap: 12px; align-items: center;
  padding: 13px 18px; border-top: 1px solid var(--line);
}
.signal-row:first-child { border-top: 0; }
.signal-ticker { font-weight: 700; }
.signal-text { color: var(--text-strong); min-width: 0; }
.signal-rel { color: var(--text-2); font-size: 12px; }
.signal-cta { font-size: 13px; font-weight: 600; text-align: right; }
.signal-empty { padding: 14px 18px; color: var(--text-2); }

.side-card h3 { font-size: 16px; }
.side-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.side-head .muted { font-size: 12px; }
.conc-list { display: flex; flex-direction: column; gap: 11px; margin-top: 14px; }
.conc-line { display: flex; justify-content: space-between; font-size: 13px; font-variant-numeric: tabular-nums; }
.conc-line .strong.is-warning { color: var(--warn); }
.conc-line .strong.is-breach { color: var(--neg); }
.conc-line .strong.is-info { color: var(--info); }
.earn-row {
  display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 10px; padding: 9px 0;
  border-top: 1px solid var(--line); align-items: center; font-variant-numeric: tabular-nums;
}
.earn-row:first-of-type { border-top: 0; }
.earn-when { color: var(--text-2); font-size: 13px; }
.earn-eps { font-size: 13px; text-align: right; }
.budget-line { display: flex; justify-content: space-between; color: var(--text-2); font-size: 12px; margin-top: 8px; gap: 8px; flex-wrap: wrap; }

/* --- paski SVG ------------------------------------------------------------------------------ */

svg.bar { display: block; width: 100%; height: 8px; overflow: visible; margin-top: 5px; }
svg.bar.is-thin { height: 5px; }
svg.bar.is-thick { height: 14px; }
.bar-track { fill: var(--line); }
.bar-fill { fill: var(--info); }
.bar-fill.is-info { fill: var(--info); }
.bar-fill.is-warning { fill: var(--warn); }
.bar-fill.is-breach { fill: var(--neg); }
.bar-fill.is-accent { fill: var(--accent); }
.bar-fill.is-pos { fill: var(--pos); }
.bar-fill.is-neg { fill: var(--neg); }
.bar-mark { stroke-width: 1; vector-effect: non-scaling-stroke; }
.bar-mark.is-warning { stroke: var(--warn); }
.bar-mark.is-limit { stroke: var(--neg); }
.bar-mark.is-price { stroke: var(--text); stroke-width: 2; }
.bar-mark.is-target { stroke: var(--target); stroke-width: 2; }

svg.range { display: block; width: 100%; max-width: 140px; height: 10px; margin-left: auto; overflow: visible; }
.range-track { fill: var(--line); }
.range-dot { fill: var(--text); }
.range-labels { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--text-2); max-width: 140px; margin-left: auto; }

svg.alloc { display: block; width: 100%; height: 14px; margin-top: 12px; border-radius: 7px; }
.alloc .c1, .swatch.c1 { fill: #5B8DEF; background: #5B8DEF; }
.alloc .c2, .swatch.c2 { fill: #36C2B4; background: #36C2B4; }
.alloc .c3, .swatch.c3 { fill: #A78BFA; background: #A78BFA; }
.alloc .c4, .swatch.c4 { fill: #F5B547; background: #F5B547; }
.alloc .c5, .swatch.c5 { fill: #F472B6; background: #F472B6; }
.alloc .c6, .swatch.c6 { fill: #FF9F5A; background: #FF9F5A; }
.alloc .c7, .swatch.c7 { fill: #3DD68C; background: #3DD68C; }
.alloc .c8, .swatch.c8 { fill: #4B5563; background: #4B5563; }
.alloc-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.alloc-item { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

/* --- Portfel / Obserwowane: lista na telefon ------------------------------------------------- */

.m-only { display: none; }
.m-list { background: var(--card); border: 1px solid var(--border-card); border-radius: var(--radius-card); overflow: hidden; }
.m-head, .m-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 78px; gap: 10px; align-items: center; padding: 11px 14px;
}
.m-head { padding: 8px 14px; color: var(--text-2); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.m-head > :not(:first-child) { text-align: right; }
.app a.m-row, .m-row { border-top: 1px solid var(--line); color: var(--text); min-height: 44px; }
.m-row-main { min-width: 0; }
.m-row-title { display: flex; align-items: center; gap: 6px; }
.m-row-title .ticker { font-weight: 700; font-size: 15px; }
.m-row-title .badge { padding: 1px 7px; font-size: 10px; font-weight: 800; }
.m-row-sub { display: block; color: var(--text-2); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Zacks i data raportu: osobne wiersze, zawijane — data raportu nigdy nie jest ucinana. */
.m-row-sub.m-row-wrap { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.m-row-mid { text-align: right; font-variant-numeric: tabular-nums; }
.m-row-mid .strong { font-size: 14px; }
.m-row-mid .sub { margin-top: 0; }
.m-row .chg-pill { justify-self: end; }

/* --- Analiza: raport, scenariusze, fakty (szablony zadania B) -------------------------------- */

.report { font-family: var(--font-serif); font-size: 17px; line-height: 1.7; color: var(--text-strong); max-width: 760px; }
.report h1, .report h2, .report h3, .report h4 { font-family: var(--font-head); color: var(--text); margin: 28px 0 10px; line-height: 1.3; }
.report h1 { font-size: 26px; }
.report h2 { font-size: 21px; }
.report h3 { font-size: 18px; }
.report h4 { font-size: 16px; }
.report > :first-child { margin-top: 0; }
.report p { margin: 0 0 14px; }
.report ul, .report ol { margin: 0 0 14px; padding-left: 24px; }
.report li { margin: 4px 0; }
.report li > ul, .report li > ol { margin: 4px 0; }
.report strong { color: var(--text); font-weight: 600; }
.report em { font-style: italic; }
.report a { color: var(--accent); }
.report blockquote { margin: 0 0 14px; padding: 4px 0 4px 16px; border-left: 3px solid var(--border-field); color: var(--text-2); }
.report table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-family: var(--font); font-size: 14px; font-variant-numeric: tabular-nums; display: block; overflow-x: auto; }
.report th, .report td { padding: 8px 10px; border-top: 1px solid var(--line); text-align: left; }
.report thead th { color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; border-top: 0; }
.report td[align="right"], .report th[align="right"] { text-align: right; }
.report sup, .report .footnote-ref { font-family: var(--font); font-size: 11px; line-height: 0; }
.report sup a, .report .footnote-ref a { color: var(--accent); padding: 0 1px; }
.report .footnotes, .report .sources { font-family: var(--font); font-size: 13px; color: var(--text-2); border-top: 1px solid var(--line); margin-top: 24px; padding-top: 12px; }
.report .footnotes ol, .report .sources ol { padding-left: 20px; }
.report hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.report code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; background: var(--well); padding: 1px 5px; border-radius: 4px; }
.report-changes { background: var(--well); border: 1px solid var(--border-card); border-radius: 12px; padding: 14px 16px; margin-bottom: 20px; font-family: var(--font); font-size: 14px; }
.report-changes h3 { font-size: 14px; margin-bottom: 6px; }

.scenario-chart { display: flex; flex-direction: column; gap: 12px; }
.scenario-row { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; align-items: center; }
.scenario-name { font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.scenario-track { position: relative; height: 14px; background: var(--line); border-radius: 7px; }
.scenario-range { position: absolute; top: 0; bottom: 0; border-radius: 7px; background: var(--info); }
.scenario-range.is-bear { background: var(--neg); }
.scenario-range.is-base { background: var(--info); }
.scenario-range.is-bull { background: var(--pos); }
.scenario-marker { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); }
.scenario-marker.is-price { background: var(--text); }
.scenario-marker.is-target { background: var(--target); }
.scenario-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.scenario-values { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }

.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.fact { background: var(--card); border: 1px solid var(--border-card); border-radius: var(--radius-kpi); padding: 12px 14px; min-width: 0; }
.fact-label { color: var(--text-2); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.fact-value { font-family: var(--font-head); font-size: 18px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* --- logowanie ------------------------------------------------------------------------------ */

.auth-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border-card);
  border-radius: 16px; padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 16px;
}
.auth-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 18px; }
.auth-brand::before { content: ""; width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: inline-block; }
.auth-card h1 { font-size: 26px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form input[type="text"], .auth-form input[type="password"] { width: 100%; min-height: 44px; }
.auth-form .btn-primary { min-height: 44px; width: 100%; }
.auth-card .alert-error { margin: 0; }

/* --- szerokości pasków HTML/CSS (bez stylów w szablonach) ----------------------------------- */
/* .w-N = szerokość N% rodzica, .l-N = przesunięcie N% od lewej (elementy absolutne). */
.w-0 { width: 0%; }
.w-1 { width: 1%; }
.w-2 { width: 2%; }
.w-3 { width: 3%; }
.w-4 { width: 4%; }
.w-5 { width: 5%; }
.w-6 { width: 6%; }
.w-7 { width: 7%; }
.w-8 { width: 8%; }
.w-9 { width: 9%; }
.w-10 { width: 10%; }
.w-11 { width: 11%; }
.w-12 { width: 12%; }
.w-13 { width: 13%; }
.w-14 { width: 14%; }
.w-15 { width: 15%; }
.w-16 { width: 16%; }
.w-17 { width: 17%; }
.w-18 { width: 18%; }
.w-19 { width: 19%; }
.w-20 { width: 20%; }
.w-21 { width: 21%; }
.w-22 { width: 22%; }
.w-23 { width: 23%; }
.w-24 { width: 24%; }
.w-25 { width: 25%; }
.w-26 { width: 26%; }
.w-27 { width: 27%; }
.w-28 { width: 28%; }
.w-29 { width: 29%; }
.w-30 { width: 30%; }
.w-31 { width: 31%; }
.w-32 { width: 32%; }
.w-33 { width: 33%; }
.w-34 { width: 34%; }
.w-35 { width: 35%; }
.w-36 { width: 36%; }
.w-37 { width: 37%; }
.w-38 { width: 38%; }
.w-39 { width: 39%; }
.w-40 { width: 40%; }
.w-41 { width: 41%; }
.w-42 { width: 42%; }
.w-43 { width: 43%; }
.w-44 { width: 44%; }
.w-45 { width: 45%; }
.w-46 { width: 46%; }
.w-47 { width: 47%; }
.w-48 { width: 48%; }
.w-49 { width: 49%; }
.w-50 { width: 50%; }
.w-51 { width: 51%; }
.w-52 { width: 52%; }
.w-53 { width: 53%; }
.w-54 { width: 54%; }
.w-55 { width: 55%; }
.w-56 { width: 56%; }
.w-57 { width: 57%; }
.w-58 { width: 58%; }
.w-59 { width: 59%; }
.w-60 { width: 60%; }
.w-61 { width: 61%; }
.w-62 { width: 62%; }
.w-63 { width: 63%; }
.w-64 { width: 64%; }
.w-65 { width: 65%; }
.w-66 { width: 66%; }
.w-67 { width: 67%; }
.w-68 { width: 68%; }
.w-69 { width: 69%; }
.w-70 { width: 70%; }
.w-71 { width: 71%; }
.w-72 { width: 72%; }
.w-73 { width: 73%; }
.w-74 { width: 74%; }
.w-75 { width: 75%; }
.w-76 { width: 76%; }
.w-77 { width: 77%; }
.w-78 { width: 78%; }
.w-79 { width: 79%; }
.w-80 { width: 80%; }
.w-81 { width: 81%; }
.w-82 { width: 82%; }
.w-83 { width: 83%; }
.w-84 { width: 84%; }
.w-85 { width: 85%; }
.w-86 { width: 86%; }
.w-87 { width: 87%; }
.w-88 { width: 88%; }
.w-89 { width: 89%; }
.w-90 { width: 90%; }
.w-91 { width: 91%; }
.w-92 { width: 92%; }
.w-93 { width: 93%; }
.w-94 { width: 94%; }
.w-95 { width: 95%; }
.w-96 { width: 96%; }
.w-97 { width: 97%; }
.w-98 { width: 98%; }
.w-99 { width: 99%; }
.w-100 { width: 100%; }
.l-0 { left: 0%; }
.l-1 { left: 1%; }
.l-2 { left: 2%; }
.l-3 { left: 3%; }
.l-4 { left: 4%; }
.l-5 { left: 5%; }
.l-6 { left: 6%; }
.l-7 { left: 7%; }
.l-8 { left: 8%; }
.l-9 { left: 9%; }
.l-10 { left: 10%; }
.l-11 { left: 11%; }
.l-12 { left: 12%; }
.l-13 { left: 13%; }
.l-14 { left: 14%; }
.l-15 { left: 15%; }
.l-16 { left: 16%; }
.l-17 { left: 17%; }
.l-18 { left: 18%; }
.l-19 { left: 19%; }
.l-20 { left: 20%; }
.l-21 { left: 21%; }
.l-22 { left: 22%; }
.l-23 { left: 23%; }
.l-24 { left: 24%; }
.l-25 { left: 25%; }
.l-26 { left: 26%; }
.l-27 { left: 27%; }
.l-28 { left: 28%; }
.l-29 { left: 29%; }
.l-30 { left: 30%; }
.l-31 { left: 31%; }
.l-32 { left: 32%; }
.l-33 { left: 33%; }
.l-34 { left: 34%; }
.l-35 { left: 35%; }
.l-36 { left: 36%; }
.l-37 { left: 37%; }
.l-38 { left: 38%; }
.l-39 { left: 39%; }
.l-40 { left: 40%; }
.l-41 { left: 41%; }
.l-42 { left: 42%; }
.l-43 { left: 43%; }
.l-44 { left: 44%; }
.l-45 { left: 45%; }
.l-46 { left: 46%; }
.l-47 { left: 47%; }
.l-48 { left: 48%; }
.l-49 { left: 49%; }
.l-50 { left: 50%; }
.l-51 { left: 51%; }
.l-52 { left: 52%; }
.l-53 { left: 53%; }
.l-54 { left: 54%; }
.l-55 { left: 55%; }
.l-56 { left: 56%; }
.l-57 { left: 57%; }
.l-58 { left: 58%; }
.l-59 { left: 59%; }
.l-60 { left: 60%; }
.l-61 { left: 61%; }
.l-62 { left: 62%; }
.l-63 { left: 63%; }
.l-64 { left: 64%; }
.l-65 { left: 65%; }
.l-66 { left: 66%; }
.l-67 { left: 67%; }
.l-68 { left: 68%; }
.l-69 { left: 69%; }
.l-70 { left: 70%; }
.l-71 { left: 71%; }
.l-72 { left: 72%; }
.l-73 { left: 73%; }
.l-74 { left: 74%; }
.l-75 { left: 75%; }
.l-76 { left: 76%; }
.l-77 { left: 77%; }
.l-78 { left: 78%; }
.l-79 { left: 79%; }
.l-80 { left: 80%; }
.l-81 { left: 81%; }
.l-82 { left: 82%; }
.l-83 { left: 83%; }
.l-84 { left: 84%; }
.l-85 { left: 85%; }
.l-86 { left: 86%; }
.l-87 { left: 87%; }
.l-88 { left: 88%; }
.l-89 { left: 89%; }
.l-90 { left: 90%; }
.l-91 { left: 91%; }
.l-92 { left: 92%; }
.l-93 { left: 93%; }
.l-94 { left: 94%; }
.l-95 { left: 95%; }
.l-96 { left: 96%; }
.l-97 { left: 97%; }
.l-98 { left: 98%; }
.l-99 { left: 99%; }
.l-100 { left: 100%; }

/* --- responsywność -------------------------------------------------------------------------- */

@media (max-width: 1200px) {
  .kpi-grid.is-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .kpi-grid.is-4, .kpi-grid.is-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signal-row { grid-template-columns: 64px 120px minmax(0, 1fr) 80px; }
  .signal-rel { display: none; }
}

@media (max-width: 767.98px) {
  body.app { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); font-size: 14px; }
  .d-only { display: none !important; }
  .m-only { display: block; }
  .site-header .nav-main, .site-header .nav-tools { display: none; }
  .nav-container { padding: 0 16px; min-height: 56px; justify-content: space-between; gap: 12px; flex-wrap: nowrap; }
  .nav-brand { font-size: 17px; }
  .nav-brand::before { width: 18px; height: 18px; border-radius: 5px; }
  .mobile-head { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--text-2); font-size: 12px; }
  .mobile-head .icon-btn { width: 44px; height: 44px; }

  .page-main { padding: 16px 16px 24px; gap: 12px; }
  .page-title { font-size: 24px; margin-top: 2px; }
  .app h2 { font-size: 18px; }
  .page-head { align-items: flex-start; }
  .page-actions, .page-actions .inline-form { width: 100%; }

  .kpi-grid, .kpi-grid.is-4, .kpi-grid.is-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px; border-radius: 12px; }
  .kpi-label { font-size: 11px; letter-spacing: 0.05em; }
  .kpi-value { font-size: 20px; margin-top: 4px; }
  .kpi-value .unit { font-size: 13px; }
  .kpi-sub { font-size: 12px; margin-top: 2px; }
  .kpi.is-wide-m { grid-column: 1 / -1; }

  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .split { gap: 12px; }
  .split-main, .split-aside { flex-basis: 100%; }
  .card { padding: 14px 16px; }
  .card-head { padding: 12px 14px 8px; }
  .card-foot { padding: 10px 14px 12px; }

  .decision-card { flex-direction: column; gap: 10px; padding: 14px 16px; }
  .decision-id { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .decision-ticker { font-size: 17px; }
  .decision-why { font-size: 13px; margin-top: 8px; }
  .decision-actions { flex-direction: row; width: 100%; }
  .decision-actions .btn { flex: 1; min-height: 44px; }

  .signal-row { grid-template-columns: 58px minmax(0, 1fr) auto; gap: 8px; padding: 12px 14px; }
  .signal-row .signal-text { grid-column: 1 / -1; grid-row: 2; font-size: 13px; }
  .signal-rel { display: none; }

  .pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .pills::-webkit-scrollbar { display: none; }
  .pills > * { flex: none; }
  .app .pill { min-height: 44px; padding: 9px 14px; }
  .btn, .app button.btn { min-height: 44px; }
  .btn-sm, .app button.btn-sm { min-height: 40px; }
  .nav-search input[type="text"], .input-short { width: 100%; }
  .inline-form { width: 100%; }
  .inline-form input[type="text"] { flex: 1 1 140px; min-width: 0; }
  .app input[type="text"], .app input[type="password"], .app select, .app textarea { font-size: 16px; min-height: 44px; }
  .table-wrap { margin: 0; }
  .m-sort.m-only { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .m-sort select { flex: 1 1 120px; min-width: 0; }
  .m-sort label { color: var(--text-2); font-size: 13px; }
  .report { font-size: 16px; }

  /* Dolny pasek zakładek: 72 px, aktywna zakładka w akcencie, „Więcej” rozwija menu. */
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--header); border-top: 1px solid var(--border-card);
  }
  .app .tabbar-link, .tabbar-more > summary {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    font-size: 11px; color: var(--text-2); min-height: 44px; list-style: none; cursor: pointer;
  }
  .tabbar-more > summary::-webkit-details-marker { display: none; }
  .tabbar-link::before, .tabbar-more > summary::before {
    content: ""; width: 22px; height: 4px; border-radius: 2px; background: transparent;
  }
  .app .tabbar-link.is-active, .tabbar-more.is-active > summary { color: var(--accent); }
  .tabbar-link.is-active::before, .tabbar-more.is-active > summary::before { background: var(--accent); }
  .tabbar-more { position: relative; }
  .tabbar-menu {
    position: absolute; right: 8px; bottom: calc(100% + 8px); min-width: 200px;
    background: var(--card); border: 1px solid var(--border-card); border-radius: 12px;
    padding: 6px; display: flex; flex-direction: column; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  }
  .app .tabbar-menu a, .tabbar-menu button {
    display: flex; align-items: center; min-height: 44px; padding: 10px 12px; border-radius: 8px;
    color: var(--text); font: inherit; font-size: 14px; background: none; border: 0; text-align: left;
    width: 100%; cursor: pointer;
  }
  .app .tabbar-menu a:hover, .tabbar-menu button:hover { background: var(--hover); }
  .app .tabbar-menu a.is-active { color: var(--accent); }
  .tabbar-menu form { margin: 0; }
}

@media (max-width: 380px) {
  .kpi-value { font-size: 18px; }
  .m-head, .m-row { grid-template-columns: minmax(0, 1fr) auto 70px; gap: 8px; padding-left: 12px; padding-right: 12px; }
  .chg-pill { min-width: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
