/* Dywidendix — wygląd „redakcyjny finansowy”: ciepłe tło, głęboka zieleń jako jedyny akcent,
   Fraunces (nagłówki, kwoty), Geist (tekst), Geist Mono (liczby w tabelach).
   Fonty z aplikacji (CSP: font-src 'self'); licencje OFL w static/fonts. */

@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(fonts/fraunces-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(fonts/fraunces-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/geist-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/geist-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(fonts/geist-mono-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(fonts/geist-mono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #F4F2EC;
  --surface: #FFFFFF;
  --surface-2: #FAF8F3;
  --text: #15171C;
  --text-2: #3E4450;
  --muted: #5B6270;
  --border: #E4E0D6;
  --border-strong: #D9D4C7;
  --accent: #17653F;
  --accent-strong: #0F4A2D;
  --accent-soft: #E3EFE7;
  --accent-contrast: #FFFFFF;
  --ink: #15171C;
  --ink-text: #F4F2EC;
  --ink-muted: #B9BDC6;
  --ink-track: #2A2E36;
  --ink-accent: #6FD39F;
  --danger-bg: #FBE9E5;
  --danger-border: #F2C9C0;
  --danger-text: #A1261B;
  --danger-strong: #7C1D14;
  --warn-bg: #FBF0DC;
  --warn-text: #8A5200;
  --info-bg: #E6ECF7;
  --info-text: #1F3F7A;
  --radius: 18px;
  --radius-sm: 10px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1114;
    --surface: #171A1F;
    --surface-2: #13161A;
    --text: #ECEDEF;
    --text-2: #C9CDD4;
    --muted: #9BA3AF;
    --border: #262A31;
    --border-strong: #333842;
    --accent: #6FD39F;
    --accent-strong: #9BE3BD;
    --accent-soft: #16301F;
    --accent-contrast: #0F2A1C;
    --ink: #0B0D10;
    --ink-track: #262A31;
    --danger-bg: #2A1614;
    --danger-border: #5A2621;
    --danger-text: #F08A7A;
    --danger-strong: #F4A597;
    --warn-bg: #2E2412;
    --warn-text: #F3C46A;
    --info-bg: #16213A;
    --info-text: #9DB7EE;
  }
}

/* --- podstawy ------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 650; letter-spacing: -0.015em; }
h1 { margin: 0; font-size: 40px; line-height: 1.1; letter-spacing: -0.02em; }
h2 { margin: 0 0 14px; font-size: 22px; line-height: 1.25; }
h3 { margin: 18px 0 8px; font-size: 17px; }
h2 a.small, h2 .small { font-family: var(--font-body); font-weight: 500; letter-spacing: 0; }
p { margin: 0 0 10px; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
.muted { color: var(--muted); margin: 4px 0; }
.small { font-size: 13px; }
small { font-size: .55em; font-weight: 500; color: var(--muted); font-family: var(--font-body); letter-spacing: 0; }
code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 6px; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* --- układ: boczna nawigacja ------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 24px;
  padding: 28px 18px; background: var(--surface-2); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: var(--accent-contrast); flex-shrink: 0; }
.brand-name { font-family: var(--font-display); font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px;
  border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; font-size: 15px;
}
.nav a:hover { background: var(--bg); color: var(--text); }
.nav a[aria-current=page] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.nav svg { flex-shrink: 0; }
.nav-secondary { padding-top: 14px; border-top: 1px solid var(--border); }
.nav-secondary a { min-height: 38px; font-size: 14px; color: var(--muted); }
.nav .pill { margin-left: auto; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-text); }
.userbox { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.avatar { width: 34px; height: 34px; border-radius: 999px; background: var(--text); color: var(--bg); display: grid; place-items: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.userbox .who { display: flex; flex-direction: column; min-width: 0; flex-grow: 1; font-size: 14px; font-weight: 600; }
.userbox form { margin: 0; }
.userbox button.link { font-size: 13px; }

.container { width: 100%; max-width: 1360px; padding: 36px 48px 64px; display: grid; gap: 20px; align-content: start; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.page-head .eyebrow { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }

.mobilebar, .tabbar { display: none; }

/* --- karty i liczby ------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  min-width: 0;
}
.card > h2:first-child { margin-top: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpis > .kpi.card { padding: 20px 22px; border-radius: 16px; }
.kpi-label { color: var(--muted); font-size: 14px; }
.kpi-value { font-family: var(--font-display); font-size: 30px; font-weight: 650; line-height: 1.1; letter-spacing: -0.015em; }
.kpi-value.small-value { font-size: 20px; }
.kpi-note { color: var(--muted); font-size: 13px; }
.card .kpis .kpi { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; background: var(--surface-2); }
.ok { color: var(--accent); }
p.card.ok { font-weight: 500; }

/* Pulpit: cel i pilne */
.hero { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; }
.goal-hero {
  background: var(--ink); color: var(--ink-text); border-radius: 22px; padding: 30px 32px;
  display: flex; flex-direction: column; gap: 18px; border: 1px solid var(--ink);
}
.goal-hero h2 { font-family: var(--font-body); font-size: 15px; font-weight: 500; color: var(--ink-muted); letter-spacing: 0; margin: 0; }
.goal-hero .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.goal-hero .goal-chip { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--ink-track); color: #D7DAE0; white-space: nowrap; }
.goal-hero .big { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.goal-hero .amount { font-family: var(--font-display); font-size: clamp(48px, 6vw, 80px); font-weight: 650; letter-spacing: -0.03em; line-height: 1; }
.goal-hero .share { font-size: 18px; color: var(--ink-muted); }
.goal-hero .track { display: block; width: 100%; height: 10px; }
.goal-hero .ticks { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; color: #9BA3AF; }
.goal-hero p { color: #C9CDD4; margin: 0; }
.goal-hero a { color: var(--ink-accent); }
.goal-hero strong { color: #FFFFFF; }

.urgent { background: var(--danger-bg); border: 1px solid var(--danger-border); border-radius: 22px; padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.urgent h2 { display: flex; align-items: center; gap: 10px; font-family: var(--font-body); font-size: 17px; font-weight: 600; letter-spacing: 0; color: var(--danger-strong); margin: 0; }
.urgent .item { background: var(--surface); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.urgent .item .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.urgent .item .sym { font-family: var(--font-mono); font-weight: 500; }
.urgent .item p { margin: 0; font-size: 14px; color: var(--text-2); }
.calm { background: var(--accent-soft); border-color: transparent; }
.calm h2 { color: var(--accent-strong); }

/* paski (SVG — style inline blokuje CSP) */
.bar { display: block; width: 100%; height: 8px; }
.bar .bg { fill: var(--border); }
.bar .fg { fill: var(--accent); }
.goal-hero .track .bg { fill: var(--ink-track); }
.goal-hero .track .fg { fill: var(--ink-accent); }
.progress {
  width: 100%; height: 10px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; overflow: hidden;
  background: var(--border);
}
.progress::-webkit-progress-bar { background: var(--border); }
.progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }

/* --- przyciski i formularze ------------------------------------------------------------ */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 12px; min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-contrast);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
}
button:hover, .btn:hover { background: var(--accent-strong); color: var(--accent-contrast); }
button:disabled { opacity: .55; cursor: not-allowed; }
button.secondary, .btn.secondary {
  margin: 0; background: var(--surface); color: var(--text); border-color: var(--border-strong); font-weight: 500;
}
button.secondary:hover, .btn.secondary:hover { background: var(--surface-2); color: var(--text); }
button.link { margin: 0; min-height: 0; padding: 0; background: none; color: var(--muted); font-weight: 400; border: 0; }
button.link:hover { background: none; color: var(--danger-text); }
.btn-danger { background: var(--danger-text); color: #FFFFFF; }
.btn-danger:hover { background: var(--danger-strong); color: #FFFFFF; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar button { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.stack button { margin-top: 4px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }

label { font-size: 14px; color: var(--text-2); }
input[type=text], input[type=password], input[type=date], input[type=number], input:not([type]), select, textarea,
.grid-form input:not([type=checkbox]) {
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 15px;
}
textarea { width: 100%; min-height: 96px; margin-bottom: 8px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 16px; margin-top: 14px; align-items: end; }
.grid-form label { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.grid-form label.check { flex-direction: row; align-items: center; gap: 10px; grid-column: 1 / -1; }
.grid-form button { margin: 0; justify-self: start; }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
label.inline input { min-height: 40px; }
details summary { cursor: pointer; color: var(--accent); font-weight: 500; min-height: 32px; }
details.add-holding { margin-top: 16px; }

/* --- tabele ------------------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
thead th { color: var(--muted); font-weight: 500; font-size: 13px; white-space: nowrap; border-bottom-color: var(--border-strong); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13.5px; }
thead th.num { font-family: var(--font-body); font-size: 13px; }
td.neg { color: var(--danger-text); }
td.pos { color: var(--accent); }
tr.current td { background: var(--accent-soft); }
tr.excluded td { opacity: .55; }
table.screener th a { color: inherit; }

/* --- etykiety ---------------------------------------------------------------------------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; margin: 1px 0;
  font-family: var(--font-body); letter-spacing: 0; vertical-align: middle;
}
.badge.warn { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.badge.okb { background: var(--accent-soft); color: var(--accent-strong); border-color: transparent; }
.chip { margin: 0; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip-growth { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.tag-sell { background: var(--danger-text); color: #FFFFFF; }
.tag-buy { background: var(--accent); color: var(--accent-contrast); }
.tag-etf { background: var(--info-bg); color: var(--info-text); }
.tag-stock { background: var(--accent-soft); color: var(--accent-strong); }
.tag-growth { background: var(--warn-bg); color: var(--warn-text); }
.alert { background: var(--danger-bg); color: var(--danger-strong); padding: 12px 14px; border-radius: 12px; border: 1px solid var(--danger-border); }
.score { display: inline-grid; place-items: center; min-width: 2.4em; padding: 2px 8px; border-radius: 8px; font-family: var(--font-mono); font-weight: 600; background: var(--surface-2); }
.score.hi { background: var(--accent); color: var(--accent-contrast); }
.score.mid { background: var(--warn-bg); color: var(--warn-text); }
.score.lo { background: var(--danger-bg); color: var(--danger-text); }
a.inst-link { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
a.inst-link:hover { color: var(--accent); }
a.inst-link strong, td strong { font-family: var(--font-mono); font-weight: 500; }

/* --- wykresy ----------------------------------------------------------------------------- */
.chart { width: 100%; height: 320px; }
.chart-small { height: 200px; }
.donuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.chart.donut { height: 280px; }

/* --- plan -------------------------------------------------------------------------------- */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 10px; }
.steps li { counter-increment: step; display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.steps li::before {
  content: counter(step); flex-shrink: 0; width: 26px; height: 26px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; font-size: 13px; display: grid; place-items: center;
}
.order { border: 1px solid var(--border); border-radius: 16px; padding: 20px 22px; margin: 14px 0; background: var(--surface); }
.order-done { border-color: var(--accent); background: var(--accent-soft); }
.order-skipped { opacity: .6; }
.order-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.order-head strong a.inst-link { font-family: var(--font-mono); font-size: 17px; }
.order-income { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.order-income .kpi-value { font-size: 24px; color: var(--accent); }
.rationale { margin: 10px 0; padding-left: 18px; font-size: 14px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }

/* --- komunikaty, asystent, różne ---------------------------------------------------------- */
.docs { display: grid; gap: 14px; }
.doc { padding: 4px 0 14px 14px; border-left: 3px solid var(--border); border-bottom: 1px solid var(--border); }
.doc:last-child { border-bottom: 0; }
.doc-threat { border-left-color: var(--danger-text); }
.doc p { margin: 6px 0; }
.components { display: grid; gap: 8px; margin: 14px 0 18px; }
.component { display: grid; grid-template-columns: minmax(180px, 2fr) 3fr 3em; gap: 12px; align-items: center; font-size: 14px; }
.filters { align-items: end; }
.result + .result { border-top: 1px solid var(--border); margin-top: 12px; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { margin: 8px 0; }
.forecast-box { margin: 14px 0; }
.stacked { display: block; width: 100%; height: 30px; border-radius: 8px; overflow: hidden; }
.stacked .up { fill: var(--accent); }
.stacked .flat { fill: var(--border-strong); }
.stacked .down { fill: var(--danger-text); }
.qa .question { margin-top: 0; }
.answer { font-size: 15px; line-height: 1.6; }
.answer p { margin: 6px 0; }
.answer ul, .answer ol { margin: 6px 0 6px 20px; padding: 0; }
.qr { background: #FFFFFF; display: inline-block; padding: 10px; border-radius: 12px; }
.qr svg { display: block; width: 200px; height: 200px; }
.contrib { margin: 14px 0; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.contrib h3 { margin-top: 0; }

/* --- logowanie ---------------------------------------------------------------------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 8px; padding: 32px; }
.login-card h1 { font-size: 32px; margin-bottom: 8px; }
.login-card label { margin-top: 8px; }

/* --- telefon ------------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .app { display: block; }
  .sidebar { display: none; }
  .mobilebar {
    display: flex; position: sticky; top: 0; z-index: 10; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  }
  .mobilebar details { position: relative; }
  .mobilebar summary { list-style: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
  .mobilebar summary::-webkit-details-marker { display: none; }
  .mobilebar .menu {
    position: absolute; right: 0; top: 52px; width: min(88vw, 320px); max-height: 75vh; overflow-y: auto;
    padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    padding: 6px 6px calc(10px + env(safe-area-inset-bottom)); background: var(--surface-2); border-top: 1px solid var(--border);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; font-size: 11px; color: var(--muted); text-decoration: none; }
  .tabbar a[aria-current=page] { color: var(--accent); font-weight: 600; }
  .container { padding: 20px 16px 100px; gap: 14px; }
  h1 { font-size: 30px; }
  .card { padding: 18px; border-radius: 16px; }
  .hero { grid-template-columns: 1fr; }
  .goal-hero { padding: 22px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpis > .kpi.card { padding: 14px; }
  .kpi-value { font-size: 22px; }
  .grid-form { grid-template-columns: 1fr; }
  th, td { padding: 9px 6px; }
  .component { grid-template-columns: 1fr 1.4fr 2.6em; }
}
tfoot tr.total th, tfoot tr.total td { border-top: 1px solid var(--border-strong); border-bottom: 0; font-weight: 600; padding-top: 12px; }
tfoot tr.total th { text-align: left; font-family: var(--font-body); font-size: 14px; color: var(--text); }
.account-update { margin-top: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.account-update details { width: 100%; }

/* Paski narzędzi: wszystkie elementy w jednej linii i tej samej wysokości (44 px). */
.btn { margin-top: 0; }
.toolbar > *, .toolbar button, .toolbar .btn, .toolbar form, .inline-form button { margin: 0; }
.toolbar .muted, .toolbar p { margin: 0; }
.toolbar form { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
label.inline input, label.inline select, .inline-form input { min-height: 44px; }
.toolbar input, .toolbar select { margin: 0; }
.tag-sell { background: var(--danger-text); color: #FFFFFF; }
.kpi-value.neg { color: var(--danger-text); }
.sell-list { grid-column: 1 / -1; border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 16px; }
.sell-list legend { font-weight: 600; padding: 0 6px; }
.warn-text { color: var(--warn-text); font-weight: 500; }
.inline-form input { width: 7.5em; }
.guide-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; line-height: 1.6; }
.guide details { margin-top: 12px; }
tr.group th { padding-top: 18px; font-family: var(--font-display); font-size: 16px; font-weight: 650; color: var(--text); background: transparent; border-bottom-color: var(--border-strong); }
tbody tr.total th, tbody tr.total td { border-top: 1px solid var(--border-strong); font-weight: 600; }
tbody tr.total th { text-align: left; font-family: var(--font-body); font-size: 14px; color: var(--text); }

/* Rekomendacja (kup / trzymaj / sprzedaj) */
.advice { margin: 8px 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }
.advice.advice-box-warn { background: var(--warn-bg); border-color: transparent; }
.advice.advice-box-neg { background: var(--danger-bg); border-color: var(--danger-border); }
.advice-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.advice-text { margin: 8px 0 4px; font-size: 14px; line-height: 1.55; color: var(--text); }
.advice-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.advice-tag.advice-ok { background: var(--accent-soft); color: var(--accent-strong); }
.advice-tag.advice-warn { background: var(--warn-bg); color: var(--warn-text); }
.advice-tag.advice-neg { background: var(--danger-bg); color: var(--danger-text); }
.pretrade-list { margin: 8px 0 2px; padding-left: 0; list-style: none; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.pretrade-list li { padding-left: 20px; position: relative; color: var(--text-2); }
.pretrade-list li::before { position: absolute; left: 4px; font-weight: 600; }
.pretrade-list .sig-warn::before { content: "−"; color: var(--warn-text); }
.pretrade-list .sig-ok::before { content: "+"; color: var(--accent); }
