/* October Invest — system wizualny
   Papier + atrament: jasne tło, ciemna zieleń, serif do liczb. */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #f4f4ef;
  --surface: #fbfbf8;
  --ink: #121a15;
  --ink-soft: #46514a;
  --muted: #63706a;
  --line: #e0e1d8;
  --line-strong: #cfd1c5;

  --sidebar: #0e1f17;
  --sidebar-ink: #e9ece5;
--sidebar-muted:#9dafa2;
  --sidebar-line: #23382c;

  --accent: #1f6b45;
  --accent-dark: #175336;
  --accent-soft: #e6efe8;
  --gold: #a97a24;
  --up: #1c7a4b;
  --down: #a63a31;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  --radius: 8px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --z-nav: 20;
  --z-dropdown: 40;
  --z-modal: 60;
  --z-toast: 80;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: "ss01" on;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
img, svg { display: block; }

::selection { background: #cfe0d2; color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── Szkielet ─────────────────────────────────────────────────────────── */

.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100dvh; }

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  padding: 26px 18px 20px;
  position: sticky;
  top: 0;
  height: 100dvh;
}

.wordmark { display: block; padding: 0 8px 30px; }
.wordmark .name {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
}
.wordmark .sub {
  display: block;
  margin-top: 7px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 42px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--sidebar-muted);
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.nav a svg { width: 17px; height: 17px; stroke-width: 1.6; opacity: 0.9; }
.nav a:hover { color: var(--sidebar-ink); background: #172a20; }
.nav a.active { color: #ffffff; background: #1b3125; }
.nav a.active svg { color: #d8c08a; opacity: 1; }

.side-bottom { margin-top: auto; padding-top: 22px; }

.switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  background: #0a1811;
  border: 1px solid var(--sidebar-line);
  border-radius: 7px;
  padding: 3px;
  margin-bottom: 14px;
}
.switch a {
  text-align: center;
  padding: 7px 4px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--sidebar-muted);
  border-radius: 5px;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.switch a.on { background: #20362a; color: #fff; }
.switch.three { grid-template-columns: repeat(3, 1fr); }

.chip.ai { border-color: #a9c9b2; background: #e8f2e9; color: #1c5c3a; }
.chip.ai .dot { background: var(--accent); }

.side-note { font-size: 11.5px; color: var(--sidebar-muted); line-height: 1.45; padding: 0 2px; }
.side-note strong { color: #d8c08a; font-weight: 500; }

.main { min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 66px;
  padding: 0 40px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
}

.search { position: relative; width: min(420px, 46vw); }
.search input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-size: 13.5px;
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--accent); background: #fff; outline: none; }
.search .lens {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--muted); pointer-events: none;
}
.search .kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 4px; padding: 1px 5px;
}

.search-results {
  position: absolute;
  top: 44px; left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 16px 32px -20px rgba(18, 26, 21, 0.35);
  overflow: hidden;
  z-index: var(--z-dropdown);
  display: none;
}
.search-results.open { display: block; }
.search-results a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  transition: background-color 140ms var(--ease-out);
}
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a:focus { background: var(--accent-soft); }
.search-results .r-name { font-size: 13.5px; }
.search-results .r-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.search-results .empty { padding: 12px 14px; font-size: 13px; color: var(--muted); }

.top-right { display: flex; align-items: center; gap: 18px; }
.datestamp { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px;
  border: 1px solid #d9c9a3;
  background: #f6efde;
  color: #7a5a19;
  border-radius: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
}
.chip .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }

.content { padding: 36px 40px 72px; max-width: 1420px; }

/* ── Nagłówki ─────────────────────────────────────────────────────────── */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-head h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 3.2vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}
.page-head .sub { margin-top: 8px; color: var(--ink-soft); font-size: 14px; max-width: 62ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.section-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 14px;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  gap: 56px;
  padding: 4px 0 34px;
  border-bottom: 1px solid var(--line);
}
.hero .label { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.hero .value {
  font-family: var(--serif);
  font-size: clamp(46px, 6.4vw, 76px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 0.98;
  margin: 12px 0 10px;
  font-variant-numeric: tabular-nums;
}
.hero .value .cur { font-size: 0.42em; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.delta { display: flex; align-items: baseline; gap: 12px; font-size: 14px; flex-wrap: wrap; }
.hero-meta { margin-top: 10px; color: var(--muted); font-size: 12.5px; row-gap: 3px; }
.delta .abs { font-family: var(--mono); font-size: 13px; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }

.snapshot { border-left: 1px solid var(--line); padding-left: 32px; align-self: end; }
.snap-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.snap-row:last-child { border-bottom: 0; }
.snap-row .s-label { font-size: 13px; color: var(--ink-soft); }
.snap-row .s-price { font-family: var(--mono); font-size: 13px; }
.snap-row .s-chg { font-family: var(--mono); font-size: 11.5px; min-width: 58px; text-align: right; }

/* ── Wykresy ──────────────────────────────────────────────────────────── */

.chart-block { padding: 26px 0 30px; border-bottom: 1px solid var(--line); }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.chart-head .t { font-size: 13px; color: var(--ink-soft); }
.ranges { display: flex; gap: 2px; }
.ranges button {
  border: 0; background: transparent; color: var(--muted);
  font-size: 11.5px; font-family: var(--mono); padding: 5px 9px; border-radius: 4px;
  cursor: pointer;
  transition: color 140ms var(--ease-out), background-color 140ms var(--ease-out);
}
.ranges button:hover { color: var(--ink); background: #e9eae2; }
.ranges button.on { color: #fff; background: var(--accent); font-weight: 500; }

.legend { display: flex; gap: 18px; margin: 2px 0 10px; font-size: 11.5px; color: var(--ink-soft); }
.legend .swatch { display: inline-block; width: 14px; height: 2px; margin-right: 6px; vertical-align: middle; }
.legend .swatch.strategy { background: var(--accent); }
.legend .swatch.benchmark { background: var(--gold); }
.legend .swatch.benchmark2 { background: #7b8c82; }
.chart { width: 100%; height: 300px; }
.chart.tall { height: 380px; }

.chart-empty {
  height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--muted); font-size: 13.5px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.chart-empty strong { color: var(--ink-soft); font-weight: 500; }

/* ── Tabele ───────────────────────────────────────────────────────────── */

.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); padding: 0 12px 9px; border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
table.data td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr { transition: background-color 140ms var(--ease-out); }
table.data tbody tr:hover { background: #eceee6; }
table.data th.r, table.data td.r { text-align: right; }
table.data td.num { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
table.data .name { font-weight: 500; }
table.data .sym { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-left: 7px; letter-spacing: 0.03em; }
table.data tr.clickable { cursor: pointer; }

.weight-bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 6px; width: 110px; }
.weight-bar span { display: block; height: 100%; background: var(--accent); opacity: 0.75; }

.empty-row { text-align: center; color: var(--muted); padding: 30px 0 !important; font-size: 13px; }

/* ── Sekcje dwukolumnowe ──────────────────────────────────────────────── */

.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 48px; padding-top: 34px; }
.cols > *, .bt-grid > *, .shell > * { min-width: 0; }
.table-wrap { max-width: 100%; }
.cols.narrow { grid-template-columns: minmax(0, 1fr) 340px; }

.alloc { display: flex; flex-direction: column; gap: 14px; }
.alloc-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.alloc-row .a-name { color: var(--ink-soft); }
.alloc-row .a-val { font-family: var(--mono); font-size: 12px; }
.alloc-bar { height: 2px; background: var(--line); margin-top: 6px; }
.alloc-bar span { display: block; height: 100%; background: var(--accent); }
.alloc-total { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line-strong); }
.alloc-total .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.alloc-total .v { font-family: var(--mono); font-size: 15px; margin-top: 4px; }

/* ── Instrument ───────────────────────────────────────────────────────── */

.crumbs { display: flex; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { opacity: 0.5; }

.inst-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.inst-head h1 { font-family: var(--serif); font-size: clamp(30px, 4vw, 44px); font-weight: 500; margin: 0 0 4px; letter-spacing: -0.02em; line-height: 1; }
.inst-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); }
.badge { display: inline-block; padding: 2px 7px; border: 1px solid var(--line-strong); border-radius: 4px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; color: var(--ink-soft); }
.price-line { display: flex; align-items: baseline; gap: 14px; margin-top: 14px; }
.price-line .p { font-family: var(--serif); font-size: 44px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.panel { border-top: 1px solid var(--line-strong); padding-top: 22px; position: sticky; top: 92px; }
.panel h2 { font-family: var(--serif); font-size: 23px; font-weight: 500; margin: 0 0 4px; letter-spacing: -0.01em; }
.panel .hint { font-size: 12px; color: var(--muted); margin: 0 0 18px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: #e9eae2; border-radius: 7px; padding: 3px; margin-bottom: 16px; }
.seg button { height: 34px; border: 0; background: transparent; border-radius: 5px; font-size: 13px; cursor: pointer; color: var(--ink-soft); transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out); }
.seg button.on { background: #fff; color: var(--accent-dark); border: 1px solid #bcd2c2; font-weight: 500; box-shadow: 0 1px 2px rgba(18,26,21,.06); }
.seg button[data-side="SELL"].on { color: var(--down); }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select {
  width: 100%; height: 42px; padding: 0 12px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 6px;
  font-family: var(--mono); font-size: 13px;
  transition: border-color 160ms var(--ease-out);
}
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; }
.field .suffix { position: relative; }
.field .suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--muted); }
.field .suffix input { padding-right: 44px; }

.calc { border-top: 1px solid var(--line); margin-top: 4px; padding: 10px 0 14px; }
.calc-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 3px 0; color: var(--ink-soft); }
.calc-row .v { font-family: var(--mono); font-size: 12px; }
.calc-row.total { color: var(--ink); font-weight: 500; }
.calc-row.total .v { font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 7px;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 120ms var(--ease-out);
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink-soft); background: #eceee6; }
.btn.danger { background: transparent; border-color: #d8b4b0; color: var(--down); }
.btn.danger:hover { background: #f6e9e7; }
.btn.block { width: 100%; }
.btn.sell { background: var(--down); color: #fff; }
.btn.sell:hover { background: #8d2e26; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 26px 0; }
.stat { background: var(--bg); padding: 14px 16px; }
.stat .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.stat .v { font-family: var(--mono); font-size: 14px; margin-top: 5px; }

/* ── Backtest ─────────────────────────────────────────────────────────── */

.bt-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 48px; align-items: start; }
.bt-form .btn { margin-top: 6px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 26px; }
.metric { background: var(--surface); padding: 16px 18px; }
.metric .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.metric .v { font-family: var(--serif); font-size: 26px; margin-top: 6px; letter-spacing: -0.01em; }
.metric .v.small { font-family: var(--mono); font-size: 17px; }
.bt-empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 48px 32px; text-align: center; color: var(--muted); font-size: 13.5px; min-height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 62ch; margin: 0 auto; line-height: 1.6; }
.bt-empty strong { display: block; font-family: var(--serif); font-size: 22px; color: var(--ink-soft); font-weight: 500; margin-bottom: 6px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.params[hidden] { display: none; }

/* ── Tosty ────────────────────────────────────────────────────────────── */

.toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; z-index: var(--z-toast); }
.toast {
  background: #16241c; color: #eef1ea; border-radius: 7px; padding: 12px 16px;
  font-size: 13px; max-width: 360px;
  box-shadow: 0 14px 30px -18px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(8px);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #5c211c; }
.toast .t-title { font-weight: 500; margin-bottom: 2px; }
.toast .t-body { color: #c4cdc3; font-size: 12.5px; }

/* ── Cel miesięczny AI ────────────────────────────────────────────────── */

.goal-band {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.goal-band .k {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted);
}
.goal-band .v {
  font-family: var(--serif); font-size: 27px; letter-spacing: -0.01em; margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.goal-band .v .cur { font-family: var(--sans); font-size: 11px; color: var(--muted); letter-spacing: 0; }
.goal-band .goal-pct {
  font-family: var(--mono); font-size: 11px; color: var(--muted); margin-left: 8px;
}
.goal-band .bar { height: 4px; background: var(--line); margin-top: 9px; }
.goal-band .bar span { display: block; height: 100%; background: var(--accent); }
.goal-band .note { font-size: 10.5px; color: var(--muted); margin-top: 7px; }
.goal-stats { display: flex; gap: 32px; justify-content: flex-end; }
.goal-stats .v { font-family: var(--mono); font-size: 15px; }

@media (max-width: 900px) {
  .goal-band { grid-template-columns: 1fr; gap: 18px; }
  .goal-stats { justify-content: flex-start; }
}

/* ── Dziennik AI ──────────────────────────────────────────────────────── */

.mandate {
  display: flex; flex-wrap: wrap; gap: 8px 26px;
  padding: 14px 0 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.mandate b { color: var(--ink-soft); font-weight: 500; }

.journal { display: flex; flex-direction: column; }
.j-item {
  display: grid; grid-template-columns: 118px minmax(0, 1fr);
  gap: 22px; padding: 18px 0; border-bottom: 1px solid var(--line);
}
.j-item:first-child { border-top: 1px solid var(--line-strong); }
.j-when { font-family: var(--mono); font-size: 11px; color: var(--muted); line-height: 1.7; }
.j-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.j-title { font-weight: 500; font-size: 14px; }
.j-value { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }
.j-reason { font-size: 13px; color: var(--ink-soft); line-height: 1.55; max-width: 82ch; white-space: pre-line; }
.j-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 11px; color: var(--muted); }
.j-meta a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.conf { display: inline-flex; align-items: center; gap: 7px; }
.conf .bar { width: 54px; height: 2px; background: var(--line-strong); }
.conf .bar span { display: block; height: 100%; background: var(--accent); }

.badge-action {
  display: inline-block; padding: 3px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--line-strong); color: var(--ink-soft);
}
.badge-action.buy { color: var(--up); border-color: #bcd2c2; background: #eaf3ec; }
.badge-action.sell { color: var(--down); border-color: #e0c3bf; background: #f7ecea; }
.badge-action.hold { color: #7a6320; border-color: #ddcfae; background: #f7f1e1; }
.badge-action.rotate { color: #5b4a86; border-color: #cfc6e2; background: #f1eef8; }

.ai-empty { padding: 46px 0; color: var(--muted); font-size: 13.5px; text-align: center; }

/* ── Logowanie ────────────────────────────────────────────────────────── */

.auth-body {
  background: var(--sidebar);
  color: var(--sidebar-ink);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
}
.auth-wrap { width: min(430px, 100%); }
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-name {
  display: block;
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  color: #fff;
}
.auth-sub {
  display: block;
  margin-top: 8px;
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}
.auth-card {
  background: var(--bg);
  color: var(--ink);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.6);
}
.auth-card h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.auth-hint { font-size: 13px; color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
.auth-card .field input { font-family: var(--sans); font-size: 15px; height: 46px; }
.auth-card .btn { margin-top: 6px; height: 46px; }
.auth-error {
  background: #f7ecea;
  border: 1px solid #e0c3bf;
  color: var(--down);
  font-size: 12.5px;
  border-radius: 6px;
  padding: 9px 12px;
  margin-bottom: 14px;
}
.auth-note { font-size: 11px; color: var(--muted); margin: 16px 0 0; line-height: 1.55; }
.auth-foot { text-align: center; font-size: 10.5px; color: var(--sidebar-muted); margin: 20px 0 0; line-height: 1.6; }
.side-logout {
  display: inline-block;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--sidebar-muted);
  border-bottom: 1px solid var(--sidebar-line);
  padding-bottom: 2px;
}
.side-logout:hover { color: #fff; }

/* ── Stopka ───────────────────────────────────────────────────────────── */

.footnote { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); line-height: 1.6; max-width: 78ch; }

/* ── Animacje ─────────────────────────────────────────────────────────── */

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.content > * { animation: rise 260ms var(--ease-out) both; }
.content > *:nth-child(2) { animation-delay: 40ms; }
.content > *:nth-child(3) { animation-delay: 80ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Responsywność ────────────────────────────────────────────────────── */

@media (max-width: 1080px) {
  .cols, .cols.narrow { grid-template-columns: 1fr; gap: 34px; }
  .bt-grid { grid-template-columns: 1fr; gap: 30px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; padding: 14px 16px 12px;
    flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap;
  }
  .wordmark { order: 1; }
  .side-bottom { order: 2; margin-left: auto; }
  .nav { order: 3; width: 100%; flex: 0 0 100%; }
  .nav a { flex: 0 0 auto; }
  .wordmark { padding: 0; }
  .wordmark .name { font-size: 21px; }
  .wordmark .sub { display: none; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; flex: 0 0 100%; order: 3; width: 100%; }
  .nav a { height: 36px; padding: 0 9px; font-size: 13px; white-space: nowrap; }
  .nav a svg { display: none; }
  .side-bottom { margin: 0 0 0 auto; padding: 0; }
  .side-note { display: none; }
  .switch { margin: 0; width: 186px; }
  .topbar { height: 58px; padding: 0 18px; position: static; }
  .datestamp { display: none; }
  .search { width: 100%; max-width: none; }
  .search .kbd { display: none; }
  .content { padding: 24px 18px 60px; }
  .hero { grid-template-columns: 1fr; gap: 26px; padding-bottom: 26px; }
  .snapshot { border-left: 0; border-top: 1px solid var(--line); padding: 14px 0 0; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .chart { height: 240px; }
  .panel { position: static; }
  .inst-head { gap: 14px; }
  .price-line .p { font-size: 34px; }
  table.data { min-width: 640px; }
}

@media (max-width: 520px) {
  .metrics { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero .value { font-size: 44px; }
  .hero-meta { display: grid; grid-template-columns: 1fr; gap: 2px; }
  .hero-meta > span:nth-child(even) { display: none; }
  .ranges button { min-height: 34px; padding: 7px 10px; }
  .snap-row { grid-template-columns: 1fr auto; }
  .snap-row .s-chg { display: none; }
}
