/* ============================================================
   ANALIZA PORTFELOWA LPP S.A. – STYLES
   Paleta inspirowana raportami konsultingowymi (BCG / McKinsey)
   ============================================================ */

:root {
  /* Light theme */
  --bg: #f7f8fa;
  --bg-elev: #ffffff;
  --bg-soft: #eef1f5;
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;

  --accent: #0a3d62;        /* deep navy */
  --accent-2: #1e6091;
  --gold: #c9a449;
  --highlight: #f4d35e;

  /* BCG quadrant colors */
  --star: #2563eb;          /* niebieski */
  --cow: #16a34a;           /* zielony */
  --question: #f59e0b;      /* pomarańczowy */
  --dog: #dc2626;           /* czerwony */

  /* Brand colors */
  --c-sinsay:   #ec4899;
  --c-reserved: #0a3d62;
  --c-cropp:    #ea580c;
  --c-house:    #7c3aed;
  --c-mohito:   #be123c;

  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow:    0 4px 16px rgba(15,23,42,.08);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.12);

  --radius: 14px;
  --radius-sm: 8px;

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --serif: 'Playfair Display', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --maxw: 1320px;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --bg-elev: #111a2e;
  --bg-soft: #16223b;
  --ink: #f1f5f9;
  --ink-2: #cbd5e1;
  --ink-3: #94a3b8;
  --line: #1e293b;
  --line-strong: #334155;
  --accent: #60a5fa;
  --accent-2: #93c5fd;
  --gold: #facc15;
  --highlight: #fbbf24;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 6px 24px rgba(0,0,0,.45);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

/* ============== TOPBAR ============== */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
[data-theme="dark"] .topbar { background: rgba(11,18,32,.85); }
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 32px;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  background: var(--accent); color: #fff;
  font-weight: 800; letter-spacing: .8px;
  padding: 8px 11px; border-radius: 8px;
  font-size: 15px;
}
.brand-text { font-weight: 600; font-size: 15px; }
.brand-sub { color: var(--ink-3); font-weight: 400; }

.topnav { margin-left: auto; display: flex; gap: 18px; }
.topnav a {
  color: var(--ink-2); text-decoration: none; font-size: 14px;
  font-weight: 500; padding: 6px 0; position: relative;
}
.topnav a:hover { color: var(--accent); }
.topnav a::after {
  content: ''; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 2px; background: var(--accent);
  transition: width .25s ease;
}
.topnav a:hover::after { width: 100%; }

.theme-toggle {
  background: var(--bg-soft); border: 1px solid var(--line);
  width: 36px; height: 36px; border-radius: 8px;
  cursor: pointer; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { background: var(--line); }

.progressbar {
  height: 3px; background: transparent;
}
#progressFill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width .15s linear;
}

/* ============== HERO ============== */
.hero {
  position: relative;
  padding: 80px 0 70px;
  background:
    radial-gradient(1200px 500px at 80% 0%, rgba(10,61,98,.08), transparent 60%),
    radial-gradient(900px 400px at 10% 100%, rgba(201,164,73,.10), transparent 60%),
    var(--bg);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: .25;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
}
.badge {
  display: inline-block;
  background: rgba(10,61,98,.08); color: var(--accent);
  padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: .3px;
  margin-bottom: 18px;
}
[data-theme="dark"] .badge { background: rgba(96,165,250,.15); }
.hero-title {
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.1; margin: 0 0 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.hl { color: var(--accent); }
.hero-sub { font-size: 18px; color: var(--ink-2); max-width: 620px; }
.hero-meta-row {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 28px;
  margin: 28px 0 28px; padding: 18px 22px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.hero-meta-row > div { display: flex; flex-direction: column; }
.meta-key { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .8px; font-weight: 600; }
.meta-val { font-size: 15px; color: var(--ink); font-weight: 600; margin-top: 2px; }

.hero-cta { display: flex; gap: 12px; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 10px;
  font-weight: 600; text-decoration: none; font-size: 15px;
  transition: transform .15s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { box-shadow: var(--shadow-lg); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* KPI grid */
.hero-kpis {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.kpi {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: 22px 20px;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.kpi::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: linear-gradient(180deg, var(--accent), var(--gold));
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-num {
  font-family: var(--serif); font-size: 30px; font-weight: 800;
  color: var(--accent); line-height: 1.05;
}
[data-theme="dark"] .kpi-num { color: var(--accent-2); }
.kpi-lab { font-size: 13px; color: var(--ink-3); margin: 4px 0 6px; font-weight: 500; }
.kpi-delta { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.kpi-delta.up { color: #16a34a; }
.kpi-delta.down { color: #dc2626; }

/* ============== LAYOUT ============== */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 50px;
  padding-top: 50px;
  padding-bottom: 80px;
}
.sidebar { position: relative; }
.sidebar-inner {
  position: sticky; top: 100px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
}
.toc-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--ink-3); font-weight: 700; margin-bottom: 14px;
}
.toc { list-style: none; padding: 0; margin: 0; counter-reset: tocc; }
.toc li { margin-bottom: 8px; font-size: 14px; }
.toc a {
  color: var(--ink-2); text-decoration: none; display: block;
  padding: 6px 10px; border-radius: 6px;
  border-left: 2px solid transparent;
  transition: all .15s;
}
.toc a:hover { background: var(--bg-soft); color: var(--accent); }
.toc a.active {
  color: var(--accent); border-left-color: var(--accent);
  background: rgba(10,61,98,.05); font-weight: 600;
}
[data-theme="dark"] .toc a.active { background: rgba(96,165,250,.12); }
.toc ol { list-style: none; padding-left: 16px; margin: 6px 0 0; }
.toc ol li { font-size: 13px; }

/* ============== SECTIONS ============== */
.section {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 44px 48px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}
.section-head {
  display: flex; align-items: baseline; gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px; margin-bottom: 28px;
}
.section-num {
  font-family: var(--mono); font-size: 14px;
  color: var(--accent); font-weight: 700;
  background: rgba(10,61,98,.07);
  padding: 6px 12px; border-radius: 6px;
}
[data-theme="dark"] .section-num { background: rgba(96,165,250,.15); }
.section h2 {
  font-family: var(--serif); font-size: 32px; margin: 0;
  font-weight: 700; letter-spacing: -.3px;
}
.section h3 {
  font-family: var(--serif); font-size: 22px;
  margin: 36px 0 16px; font-weight: 600;
  color: var(--accent);
}
[data-theme="dark"] .section h3 { color: var(--accent-2); }
.section h4, .section h5 { margin: 16px 0 8px; }

.lead { font-size: 17.5px; color: var(--ink-2); }

.bullets, .numbered { padding-left: 22px; }
.bullets li, .numbered li { margin-bottom: 8px; }

/* ============== CALLOUTS ============== */
.callout {
  margin: 24px 0;
  padding: 22px 26px;
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  background: linear-gradient(135deg, rgba(10,61,98,.04), rgba(201,164,73,.04));
}
.callout h4 { margin-top: 0; color: var(--accent); }
[data-theme="dark"] .callout { background: rgba(96,165,250,.08); }
[data-theme="dark"] .callout h4 { color: var(--accent-2); }
.callout-method { border-left-color: var(--gold); }
.callout-final { border-left-color: var(--star); }

/* ============== EXEC GRID ============== */
.exec-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-top: 24px;
}
.exec-card {
  padding: 22px; border-radius: var(--radius);
  background: var(--bg-soft); border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.exec-card .tag {
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; padding: 4px 10px; border-radius: 4px;
  display: inline-block; margin-bottom: 10px;
}
.exec-card.star    { border-top: 4px solid var(--star); }
.exec-card.star .tag    { background: rgba(37,99,235,.15);  color: var(--star); }
.exec-card.cow     { border-top: 4px solid var(--cow); }
.exec-card.cow .tag     { background: rgba(22,163,74,.15);  color: var(--cow); }
.exec-card.question{ border-top: 4px solid var(--question); }
.exec-card.question .tag{ background: rgba(245,158,11,.15); color: var(--question); }
.exec-card.dog     { border-top: 4px solid var(--dog); }
.exec-card.dog .tag     { background: rgba(220,38,38,.15);  color: var(--dog); }
.exec-card h5 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.exec-card p  { margin: 0; font-size: 14px; color: var(--ink-2); }

/* ============== BRAND CARDS ============== */
.brand-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin-bottom: 16px;
}
.brand-card {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
  transition: transform .2s, box-shadow .2s;
}
.brand-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.brand-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.brand-head h4 { margin: 0; font-size: 18px; flex: 1; }
.brand-share { font-weight: 700; color: var(--accent); font-family: var(--mono); }
[data-theme="dark"] .brand-share { color: var(--accent-2); }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; }
.brand-dot.s { background: var(--c-sinsay); }
.brand-dot.r { background: var(--c-reserved); }
.brand-dot.c { background: var(--c-cropp); }
.brand-dot.h { background: var(--c-house); }
.brand-dot.m { background: var(--c-mohito); }
.brand-pos { font-size: 13px; color: var(--ink-3); margin: 0 0 10px; }
.brand-card p { font-size: 14px; color: var(--ink-2); margin: 6px 0; }
.brand-mini { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 14px; }
.brand-mini li {
  background: var(--bg-elev); border-radius: 6px; padding: 8px;
  text-align: center; font-size: 12px; color: var(--ink-3);
}
.brand-mini b { display: block; color: var(--ink); font-size: 13px; margin-top: 2px; }
.up   { color: #16a34a; }
.down { color: #dc2626; }

/* ============== VALUE CHAIN ============== */
.value-chain {
  display: flex; align-items: stretch; gap: 8px; margin: 18px 0;
  flex-wrap: wrap;
}
.vc-step {
  flex: 1 1 200px; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; position: relative;
}
.vc-num {
  position: absolute; top: -12px; left: 16px;
  background: var(--accent); color: #fff;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.vc-step h5 { margin: 4px 0 6px; font-size: 15px; }
.vc-step p { margin: 0; font-size: 13px; color: var(--ink-3); }
.vc-arrow { display: flex; align-items: center; color: var(--ink-3); font-size: 22px; }

/* ============== METHOD GRID ============== */
.method-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-top: 14px;
}
.method-card {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 16px;
}
.method-card h5 { margin: 0 0 6px; font-size: 14px; color: var(--accent); }
[data-theme="dark"] .method-card h5 { color: var(--accent-2); }
.method-card p { margin: 0; font-size: 13px; color: var(--ink-3); }

/* ============== PESTEL ============== */
.pestel-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.pestel {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.pestel-h { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.pestel-h h5 { margin: 0; font-size: 16px; }
.p-letter {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-family: var(--serif);
}
.pestel.p .p-letter  { background: #1e6091; }
.pestel.e .p-letter  { background: #16a34a; }
.pestel.s .p-letter  { background: #d97706; }
.pestel.t .p-letter  { background: #7c3aed; }
.pestel.ec .p-letter { background: #059669; }
.pestel.l .p-letter  { background: #dc2626; }
.pestel ul { padding-left: 18px; margin: 8px 0 0; }
.pestel li { font-size: 13.5px; color: var(--ink-2); margin-bottom: 4px; }

/* ============== PORTER ============== */
.porter {
  display: grid;
  grid-template-areas:
    ".    top    .   "
    "left center right"
    ".    bottom .   ";
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 16px; margin: 18px 0;
}
.porter-center {
  grid-area: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-radius: var(--radius);
  padding: 26px; text-align: center;
}
.porter-center h4 { margin: 0 0 8px; font-size: 20px; }
.porter-center .lvl { font-weight: 800; font-size: 14px; letter-spacing: 1px; margin: 6px 0; }
.porter-arm {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.porter-arm h5 { margin: 0 0 6px; font-size: 15px; color: var(--accent); }
[data-theme="dark"] .porter-arm h5 { color: var(--accent-2); }
.porter-arm.top    { grid-area: top; }
.porter-arm.right  { grid-area: right; }
.porter-arm.bottom { grid-area: bottom; }
.porter-arm.left   { grid-area: left; }
.porter-arm p { margin: 6px 0; font-size: 13px; color: var(--ink-2); }
.lvl { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: .8px; }
.lvl.high { background: rgba(220,38,38,.15); color: #dc2626; }
.lvl.mid  { background: rgba(245,158,11,.15); color: #d97706; }
.lvl.low  { background: rgba(22,163,74,.15); color: #16a34a; }

/* ============== FINANCE GRID ============== */
.fin-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin: 18px 0;
}
.fin-card {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.fin-lab { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .8px; font-weight: 600; }
.fin-val {
  font-family: var(--serif); font-size: 28px; font-weight: 800;
  color: var(--accent); margin: 6px 0 4px; line-height: 1;
}
[data-theme="dark"] .fin-val { color: var(--accent-2); }
.fin-val span { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 6px; }
.fin-delta { font-size: 13px; font-weight: 600; }
.fin-delta.up   { color: #16a34a; }
.fin-delta.down { color: #dc2626; }
.fin-delta.neut { color: var(--ink-3); }
.fin-note { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }

/* ============== CHARTS ============== */
.chart-card {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
  margin: 16px 0;
  position: relative;
  overflow: hidden;
}
.chart-title { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.chart-note { margin: 8px 0 0; font-size: 12px; color: var(--ink-3); text-align: center; }
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-card.half { margin: 0; }

/* ---- Stałe wymiary canvasów (eliminuje nieskończony wzrost Chart.js
        przy responsive:true + maintainAspectRatio:false) ---- */
.chart-card > canvas {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}
#chartSales,
#chartShare       { height: 360px !important; max-height: 360px !important; }
#chartGeo         { height: 380px !important; max-height: 380px !important; }
#chartGrowth      { height: 360px !important; max-height: 360px !important; }
#chartCapex,
#chartCapex2026   { height: 340px !important; max-height: 340px !important; }
#chartScatter     { height: 460px !important; max-height: 460px !important; }
#chartPLC         { height: 420px !important; max-height: 420px !important; }

@media (max-width: 900px) {
  .charts-row { grid-template-columns: 1fr; }
  #chartSales, #chartShare, #chartGeo, #chartGrowth,
  #chartCapex, #chartCapex2026, #chartScatter, #chartPLC {
    height: 320px !important; max-height: 320px !important;
  }
}

/* ============== TABLE ============== */
.table-wrap { overflow-x: auto; margin: 14px 0; }
.datatable {
  width: 100%; border-collapse: collapse; font-size: 14px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.datatable th, .datatable td {
  padding: 12px 14px; text-align: right;
  border-bottom: 1px solid var(--line);
}
.datatable th:first-child, .datatable td:first-child { text-align: left; }
.datatable thead th {
  background: var(--bg-soft); color: var(--ink-2);
  font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .6px;
}
.datatable thead th span { display: block; font-weight: 400; font-size: 11px; color: var(--ink-3); text-transform: none; letter-spacing: 0; }
.datatable tbody tr:hover { background: var(--bg-soft); }
.datatable tfoot th {
  background: rgba(10,61,98,.05); font-weight: 700; color: var(--ink);
  border-top: 2px solid var(--accent);
}
[data-theme="dark"] .datatable tfoot th { background: rgba(96,165,250,.1); border-top-color: var(--accent-2); }
.rate { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 4px; }
.rate.hi { background: rgba(22,163,74,.15); color: #16a34a; }
.rate.mi { background: rgba(245,158,11,.15); color: #d97706; }
.rate.lo { background: rgba(220,38,38,.15); color: #dc2626; }

/* ============== BCG INTERACTIVE ============== */
.bcg-controls {
  display: flex; align-items: center; gap: 8px;
  margin: 14px 0;
}
.bcg-controls span { font-size: 13px; color: var(--ink-3); margin-right: 8px; }
.seg {
  background: var(--bg-soft); border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 8px;
  font-size: 13px; cursor: pointer;
  font-family: var(--font); color: var(--ink-2); font-weight: 500;
  transition: all .15s;
}
.seg:hover { border-color: var(--accent); }
.seg.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.bcg-wrap {
  display: grid; grid-template-columns: 1fr 320px; gap: 24px;
  margin: 18px 0;
}
.bcg-matrix {
  position: relative; aspect-ratio: 1.1;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.bcg-panel {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
  align-self: start; position: sticky; top: 100px;
}
.bcg-panel-title { margin: 0 0 8px; font-family: var(--serif); font-size: 22px; }
.muted { color: var(--ink-3); font-size: 14px; }
.bcg-panel.active { border-color: var(--accent); box-shadow: var(--shadow); }
.bcg-panel .bcg-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin: 10px 0;
}
.bcg-panel .bcg-meta div {
  background: var(--bg-elev); padding: 10px; border-radius: 8px;
}
.bcg-panel .bcg-meta b { display: block; color: var(--accent); font-family: var(--mono); }
[data-theme="dark"] .bcg-panel .bcg-meta b { color: var(--accent-2); }
.bcg-panel .bcg-meta span { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; }

/* SVG-based BCG matrix */
.bcg-matrix svg { width: 100%; height: 100%; display: block; }

/* ============== BCG CARDS ============== */
.bcg-cards {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px;
  margin-top: 18px;
}
.bcg-card {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px;
  border-top: 4px solid var(--ink-3);
}
.bcg-card.star { border-top-color: var(--star); }
.bcg-card.cow  { border-top-color: var(--cow); }
.bcg-card.dog  { border-top-color: var(--dog); }
.bcg-card.question { border-top-color: var(--question); }
.bcg-card header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.bcg-card h4 { margin: 0; font-size: 20px; }
.bcg-card .cls { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .8px; }
.bcg-card p { margin: 8px 0; font-size: 14px; color: var(--ink-2); }
.bcg-card .reco {
  margin-top: 12px; padding: 12px 14px;
  background: var(--bg-elev); border-radius: 8px;
  border-left: 3px solid var(--accent);
  font-size: 13.5px;
}

/* ============== GE / McKINSEY MATRIX ============== */
.ge-matrix {
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: 1fr 28px auto;
  gap: 8px;
  margin: 22px 0 10px;
  font-size: 13px;
}
.ge-yaxis {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--ink-2);
  border-right: 2px solid var(--line);
}
.ge-grid {
  display: grid;
  grid-template-columns: 90px repeat(3, minmax(0, 1fr));
  grid-template-rows: 28px repeat(3, minmax(140px, 1fr));
  gap: 6px;
}
.ge-col-head, .ge-row-label {
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 11.5px; letter-spacing: .9px;
  color: var(--ink-2); text-transform: uppercase;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.ge-corner { background: transparent; }
.ge-cell {
  border-radius: 10px;
  padding: 12px 14px;
  position: relative;
  display: flex; flex-direction: column;
  background: var(--bg-soft); border: 1px solid var(--line);
  min-height: 0;
  overflow: hidden;
}
.ge-cell.invest  { background: linear-gradient(135deg, rgba(22,163,74,.10), rgba(22,163,74,.22)); border-color: rgba(22,163,74,.45); }
.ge-cell.select  { background: linear-gradient(135deg, rgba(245,158,11,.10), rgba(245,158,11,.22)); border-color: rgba(245,158,11,.45); }
.ge-cell.harvest { background: linear-gradient(135deg, rgba(220,38,38,.08),  rgba(220,38,38,.18)); border-color: rgba(220,38,38,.45); }
.ge-zone {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.ge-cell h5 { margin: 0 0 6px; font-size: 14px; line-height: 1.25; color: var(--ink); font-weight: 700; }
.ge-cell p  { margin: 0; font-size: 11.5px; line-height: 1.35; color: var(--ink-2); }
.ge-pins { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.ge-pin {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  white-space: nowrap;
}
.ge-pin.sm { padding: 2px 8px; font-size: 10.5px; }
.ge-pin.s { background: var(--c-sinsay); }
.ge-pin.r { background: var(--c-reserved); }
.ge-pin.c { background: var(--c-cropp); }
.ge-pin.h { background: var(--c-house); }
.ge-pin.m { background: var(--c-mohito); }
.ge-xaxis {
  text-align: center;
  font-weight: 700; font-size: 12px; letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-top: 6px;
  border-top: 2px solid var(--line);
}
.ge-legend {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 14px 18px;
  align-items: center; justify-content: center;
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px; color: var(--ink-2);
}
.ge-leg-item { display: inline-flex; align-items: center; gap: 6px; }
.ge-leg-sw {
  width: 14px; height: 14px; border-radius: 4px;
  border: 1px solid rgba(0,0,0,.1);
}
.ge-leg-sw.invest  { background: linear-gradient(135deg, rgba(22,163,74,.20), rgba(22,163,74,.45)); border-color: rgba(22,163,74,.5); }
.ge-leg-sw.select  { background: linear-gradient(135deg, rgba(245,158,11,.20), rgba(245,158,11,.45)); border-color: rgba(245,158,11,.5); }
.ge-leg-sw.harvest { background: linear-gradient(135deg, rgba(220,38,38,.18), rgba(220,38,38,.40)); border-color: rgba(220,38,38,.5); }
.ge-leg-sep { width: 1px; align-self: stretch; background: var(--line); }

@media (max-width: 760px) {
  .ge-matrix { grid-template-columns: 28px 1fr; }
  .ge-grid { grid-template-columns: 72px repeat(3, minmax(0, 1fr)); }
  .ge-cell { padding: 10px; }
  .ge-cell h5 { font-size: 13px; }
  .ge-cell p  { font-size: 11px; }
  .ge-zone { font-size: 10px; }
}

/* ============== ANSOFF ============== */
.ansoff {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin: 16px 0;
}
.a-cell {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
  border-top: 4px solid var(--ink-3);
}
.a-cell.penetration    { border-top-color: var(--cow); }
.a-cell.product        { border-top-color: var(--question); }
.a-cell.market         { border-top-color: var(--star); }
.a-cell.diversification{ border-top-color: var(--dog); }
.a-cell h5 { margin: 0 0 4px; font-size: 17px; }
.a-cell > p { font-size: 12px; color: var(--ink-3); margin: 0 0 10px; }
.a-cell ul { padding-left: 18px; margin: 0; }
.a-cell li { margin-bottom: 4px; font-size: 13.5px; }

/* ============== SWOT ============== */
.swot {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin: 16px 0;
}
.swot-cell {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
  border-top: 4px solid var(--ink-3);
}
.swot-cell h5 { margin: 0 0 10px; font-size: 17px; }
.swot-cell.s { border-top-color: #16a34a; }
.swot-cell.s h5 { color: #16a34a; }
.swot-cell.w { border-top-color: #dc2626; }
.swot-cell.w h5 { color: #dc2626; }
.swot-cell.o { border-top-color: #2563eb; }
.swot-cell.o h5 { color: #2563eb; }
.swot-cell.t { border-top-color: #d97706; }
.swot-cell.t h5 { color: #d97706; }
.swot-cell ul { padding-left: 20px; margin: 0; }
.swot-cell li { margin-bottom: 6px; font-size: 13.5px; }

/* ============== HORIZONS ============== */
.horizons {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin: 18px 0;
}
.hz {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
  position: relative;
}
.hz header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.hz-num {
  background: var(--accent); color: #fff;
  width: 42px; height: 42px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-family: var(--serif);
}
.hz h4 { margin: 0; font-size: 17px; }
.hz ul { padding-left: 20px; margin: 0; }
.hz li { font-size: 13.5px; margin-bottom: 8px; }
.hz li ul { margin-top: 4px; }
.hz li ul li { font-size: 13px; }

/* ============== PUT MINI LOGO (topbar) ============== */
.put-mini {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  padding-right: 14px; border-right: 1px solid var(--line);
}
.put-mini img { width: 34px; height: 34px; display: block; }
.put-mini-txt { display: flex; flex-direction: column; line-height: 1.15; }
.put-mini-txt strong { font-size: 12.5px; font-weight: 700; letter-spacing: .2px; }
.put-mini-txt span { font-size: 10.5px; color: var(--ink-3); }
[data-theme="dark"] .put-mini img { filter: brightness(0) invert(1); }

/* ============== STRONA TYTUŁOWA ============== */
.title-page {
  min-height: 100vh;
  background:
    radial-gradient(1000px 600px at 90% -10%, rgba(201,164,73,.10), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(10,61,98,.10), transparent 60%),
    linear-gradient(180deg, var(--bg-elev), var(--bg) 80%);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 60px 24px;
}
.title-page-inner {
  max-width: 960px; margin: 0 auto; width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-top: 6px solid var(--accent);
  border-radius: 16px;
  padding: 56px 64px 44px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.title-page-inner::after {
  content: ""; position: absolute; inset: 8px; pointer-events: none;
  border: 1px solid var(--line); border-radius: 12px;
}
.tp-head {
  display: flex; align-items: center; gap: 22px;
  padding-bottom: 22px; border-bottom: 2px solid var(--accent);
  margin-bottom: 32px;
}
.tp-logo { width: 86px; height: 86px; flex-shrink: 0; }
[data-theme="dark"] .tp-logo { filter: brightness(0) invert(1); }
.tp-uni-name { font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: 1px; color: var(--accent); }
.tp-uni-fac  { font-size: 16px; font-weight: 600; color: var(--ink-2); margin-top: 2px; }
.tp-uni-sub  { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
[data-theme="dark"] .tp-uni-name { color: var(--accent-2); }

.tp-body { text-align: center; padding: 18px 0 26px; }
.tp-kind {
  display: inline-block;
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--gold); font-weight: 700;
  padding: 6px 14px; border: 1px solid var(--gold); border-radius: 999px;
  margin-bottom: 22px;
}
.tp-title {
  font-family: var(--serif);
  font-size: clamp(34px, 4.4vw, 52px);
  font-weight: 800; line-height: 1.12;
  margin: 0 0 14px; color: var(--ink);
}
.tp-title-em { color: var(--accent); }
[data-theme="dark"] .tp-title-em { color: var(--accent-2); }
.tp-subtitle {
  font-family: var(--serif);
  font-size: clamp(16px, 1.7vw, 20px);
  font-style: italic; font-weight: 500;
  color: var(--ink-2); margin: 0 0 22px;
}
.tp-rule { display: flex; align-items: center; justify-content: center; margin: 18px 0 22px; }
.tp-rule span {
  display: block; width: 80px; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.tp-context {
  max-width: 680px; margin: 0 auto;
  font-size: 14.5px; color: var(--ink-2);
}

.tp-meta-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin: 28px 0;
}
.tp-meta-card {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 14px 18px;
}
.tp-meta-label { font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.tp-meta-value { font-size: 14.5px; font-weight: 600; color: var(--ink); margin-top: 4px; }

.tp-authors {
  margin-top: 28px; padding-top: 22px;
  border-top: 1px solid var(--line);
}
.tp-authors-label {
  font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700; text-align: center; margin-bottom: 16px;
}
.tp-authors-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.tp-authors-list li {
  text-align: center;
  padding: 14px 10px;
  background: var(--bg-soft);
  border-radius: 8px;
  border: 1px solid var(--line);
}
.tp-author-name { display: block; font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--ink); }
.tp-author-id { display: block; font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.tp-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-3);
}
.tp-foot-cta a {
  color: var(--accent); text-decoration: none; font-weight: 600;
}
.tp-foot-cta a:hover { text-decoration: underline; }

/* ============== SEKCJA CEL/ZAKRES/HIPOTEZY ============== */
.goal-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin: 18px 0 22px;
}
.goal-card {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-sm); padding: 18px;
}
.goal-tag {
  display: inline-block;
  font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
  margin-bottom: 8px;
}
[data-theme="dark"] .goal-tag { color: var(--accent-2); }
.goal-card p { margin: 0; font-size: 13.5px; color: var(--ink-2); }

.hypotheses {
  list-style: none; padding: 0; margin: 0 0 22px;
  counter-reset: hyp;
}
.hypotheses li {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 10px;
  font-size: 14px;
}
.hypotheses li strong { color: var(--accent); margin-right: 4px; }
[data-theme="dark"] .hypotheses li strong { color: var(--accent-2); }

.scope-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
  margin: 18px 0 22px;
}
.scope-grid > div {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 16px 18px;
}
.scope-h {
  font-family: var(--serif); font-weight: 700;
  color: var(--accent); font-size: 15px; margin-bottom: 6px;
}
[data-theme="dark"] .scope-h { color: var(--accent-2); }
.scope-grid p { margin: 0; font-size: 13.5px; color: var(--ink-2); }

/* ============== AKADEMICKA STOPKA ============== */
.footer-academic {
  background: var(--bg-elev);
  border-top: 3px solid var(--accent);
  padding: 40px 24px 18px;
  margin-top: 40px;
  border-radius: var(--radius);
  text-align: left;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1.6fr 1.2fr 1.2fr; gap: 24px;
  padding-bottom: 24px; border-bottom: 1px solid var(--line);
}
.footer-col { font-size: 13px; color: var(--ink-2); }
.footer-h {
  font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700; margin-bottom: 8px;
}
.footer-uni {
  display: flex; gap: 14px; align-items: flex-start;
}
.footer-uni img { width: 54px; height: 54px; flex-shrink: 0; }
[data-theme="dark"] .footer-uni img { filter: brightness(0) invert(1); }
.footer-uni > div { display: flex; flex-direction: column; gap: 2px; }
.footer-uni strong { font-size: 14px; color: var(--ink); }
.footer-authors { list-style: none; padding: 0; margin: 0; }
.footer-authors li { padding: 4px 0; font-weight: 600; }
.footer-authors li span { color: var(--ink-3); font-weight: 400; font-family: var(--mono); font-size: 12px; }
.footer-bottom { padding-top: 16px; text-align: center; }
.footer-bottom .small { font-size: 11.5px; }

.footer { text-align: center; padding: 30px 0 10px; color: var(--ink-3); font-size: 13px; }
.footer .small { font-size: 11.5px; margin-top: 6px; }

/* ============== TO TOP ============== */
.to-top {
  position: fixed; bottom: 28px; right: 28px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #fff;
  border: none; cursor: pointer; font-size: 20px;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  z-index: 50;
}
.to-top.visible { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-3px); }

/* ============== RESPONSIVE ============== */
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .bcg-wrap { grid-template-columns: 1fr; }
  .bcg-panel { position: static; }
  .topnav { display: none; }
}
@media (max-width: 800px) {
  .container { padding: 0 18px; }
  .section { padding: 28px 22px; }
  .hero { padding: 50px 0 40px; }
  .hero-meta-row { grid-template-columns: 1fr; }
  .hero-kpis { grid-template-columns: 1fr 1fr; }
  .exec-grid, .brand-grid, .pestel-grid, .fin-grid, .method-grid,
  .horizons, .charts-row, .ansoff, .swot { grid-template-columns: 1fr; }
  .porter { grid-template-areas: "top" "left" "center" "right" "bottom"; grid-template-columns: 1fr; }
  .bcg-cards { grid-template-columns: 1fr; }
  .value-chain .vc-arrow { display: none; }

  /* Akademickie elementy */
  .title-page-inner { padding: 32px 22px 26px; }
  .title-page-inner::after { inset: 5px; }
  .tp-head { flex-direction: column; text-align: center; gap: 12px; }
  .tp-logo { width: 70px; height: 70px; }
  .tp-meta-grid, .tp-authors-list, .scope-grid, .goal-grid { grid-template-columns: 1fr; }
  .tp-foot { flex-direction: column; gap: 10px; text-align: center; }
  .footer-grid { grid-template-columns: 1fr; gap: 18px; }
  .put-mini-txt { display: none; }
  .put-mini { padding-right: 10px; }
}
