/* NaszeFinanse — friendly, beginner-first design system */

:root {
    /* Brand & UI */
    --brand: #2f6df0;
    --brand-700: #1e4fd0;
    --brand-50: #eaf1ff;
    --ink: #16233b;
    --muted: #5b6b82;
    --bg: #f3f6fb;
    --card: #ffffff;
    --line: #e5ecf4;
    --line-strong: #d3deea;

    /* Semantic */
    --growth: #12a06a;     /* "your money grows" green */
    --growth-50: #e6f7ef;
    --warm: #f59e0b;       /* highlight / high yield */
    --warm-50: #fff5e1;
    --danger: #e23b3b;

    /* Category tints */
    --fixed: #2563eb;
    --fixed-50: #e8efff;
    --variable: #0f9d6b;
    --variable-50: #e3f6ee;
    --inflation: #d97706;
    --inflation-50: #fdf0db;
    --zero: #7c3aed;
    --zero-50: #f1e9ff;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(16, 35, 59, 0.06), 0 1px 3px rgba(16, 35, 59, 0.05);
    --shadow-md: 0 6px 18px rgba(16, 35, 59, 0.08);
    --shadow-lg: 0 18px 50px rgba(16, 35, 59, 0.18);
    --maxw: 1140px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.65;
    font-size: 17px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--brand-700); }

/* ---------- Header / nav ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 64px;
}

.brand {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}
.brand .dot { color: var(--brand); }

.nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav a:hover { background: var(--brand-50); color: var(--brand-700); }
.nav a.active { background: var(--brand); color: #fff; }

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(135deg, #1e3a8a 0%, var(--brand) 55%, #4f86ff 100%);
    color: #fff;
    padding: 3rem 0 3.25rem;
}
.hero .container { max-width: 820px; }
.hero h1 {
    font-size: clamp(1.9rem, 4.5vw, 2.9rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
    font-weight: 800;
    margin-bottom: 0.85rem;
}
.hero p { font-size: 1.12rem; opacity: 0.94; max-width: 60ch; }
.hero .lead-actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.hero.compact { padding: 2rem 0; }

/* Hero photo backgrounds (url() under img-src 'self'; gradient keeps text legible) */
.hero--img { background-size: cover; background-position: center; }
.hero-warszawa { background-image: linear-gradient(135deg, rgba(13,27,56,0.86), rgba(30,58,138,0.66)), url("../img/warszawa.jpg"); }
.hero-monety { background-image: linear-gradient(135deg, rgba(13,27,56,0.88), rgba(30,58,138,0.7)), url("../img/monety.jpg"); }

/* Section banner photos */
.banner { display: block; width: 100%; height: 240px; object-fit: cover; border-radius: var(--radius); margin: 1.4rem 0; box-shadow: var(--shadow-sm); }
.banner.short { height: 180px; }

/* Image credits */
.credits { font-size: 0.74rem; opacity: 0.7; margin-top: 0.7rem; }
.credits a { color: inherit; }
.hero .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    font-weight: 700;
    opacity: 0.85;
    margin-bottom: 0.6rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font: inherit;
    font-weight: 700;
    font-size: 0.98rem;
    padding: 0.7rem 1.15rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-700); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-light { background: #fff; color: var(--brand-700); }
.btn-light:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: rgba(255,255,255,0.14); color: #fff; border-color: rgba(255,255,255,0.4); }
.btn-ghost:hover { background: rgba(255,255,255,0.24); }

/* ---------- Main / sections ---------- */
main { flex: 1; padding: 2rem 0 3rem; }
.section { padding: 2.25rem 0; }
.section-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.4rem; }
.section-sub { color: var(--muted); margin-bottom: 1.4rem; max-width: 65ch; }

/* ---------- Cards ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.4rem 1.5rem;
}
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.1rem;
}
.card h3 { font-size: 1.12rem; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.card .ico { display: block; margin-bottom: 0.6rem; color: var(--brand); }
.card .ico svg { width: 34px; height: 34px; }
.card p { color: var(--muted); font-size: 0.98rem; }

/* ---------- Prose (educational content) ---------- */
.prose { max-width: 720px; margin: 0 auto; }
.prose h2 { font-size: 1.7rem; letter-spacing: -0.02em; margin: 2.4rem 0 0.8rem; scroll-margin-top: 80px; }
.prose h3 { font-size: 1.2rem; margin: 1.6rem 0 0.5rem; }
.prose p { margin-bottom: 1rem; }
.prose ul, .prose ol { margin: 0 0 1rem 1.3rem; }
.prose li { margin-bottom: 0.4rem; }
.prose strong { color: var(--ink); }
.prose .lead { font-size: 1.15rem; color: var(--muted); }

/* Callout boxes */
.callout {
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    margin: 1.4rem 0;
    border: 1px solid var(--line);
    background: var(--card);
}
.callout .tag { font-weight: 800; display: block; margin-bottom: 0.3rem; }
.callout.tip { background: var(--growth-50); border-color: #bce7d4; }
.callout.tip .tag { color: var(--growth); }
.callout.note { background: var(--brand-50); border-color: #cfe0ff; }
.callout.note .tag { color: var(--brand-700); }
.callout.warn { background: var(--warm-50); border-color: #f4d99a; }
.callout.warn .tag { color: #b45309; }

/* "Tom" / analogy figure */
.figure-quote {
    border-left: 4px solid var(--brand);
    padding: 0.4rem 0 0.4rem 1.1rem;
    color: var(--muted);
    font-style: italic;
    margin: 1.4rem 0;
}

/* Numbered steps */
.steps { counter-reset: step; list-style: none; margin: 1.2rem 0; }
.steps li {
    position: relative;
    padding: 0 0 1rem 3rem;
    border-left: 2px dashed var(--line-strong);
    margin-left: 1rem;
}
.steps li:last-child { border-left-color: transparent; }
.steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: -1rem; top: -0.15rem;
    width: 2rem; height: 2rem;
    background: var(--brand); color: #fff;
    border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 700; font-size: 0.95rem;
}
.steps li strong { display: block; }

/* anchor sub-nav (sticky chips) */
.toc {
    display: flex; gap: 0.5rem; flex-wrap: wrap;
    margin: 1.5rem 0 0.5rem;
}
.toc a {
    font-size: 0.88rem; font-weight: 600; text-decoration: none;
    background: var(--card); border: 1px solid var(--line);
    color: var(--muted); padding: 0.4rem 0.8rem; border-radius: 999px;
}
.toc a:hover { border-color: var(--brand); color: var(--brand-700); }

/* ---------- Controls (bond tables) ---------- */
.controls {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem;
}
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-btn {
    padding: 0.5rem 1rem; border: 1px solid var(--line-strong);
    background: var(--card); color: var(--ink);
    border-radius: 999px; cursor: pointer; font: inherit; font-size: 0.9rem; font-weight: 600;
    transition: all 0.15s ease;
}
.filter-btn:hover { background: var(--brand-50); border-color: var(--brand); }
.filter-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.update-info { font-size: 0.85rem; color: var(--muted); }

/* ---------- Tables ---------- */
.table-container {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    overflow-x: auto; margin-bottom: 1.5rem;
}
table { width: 100%; border-collapse: collapse; }
thead th {
    background: #f7faff; color: var(--muted);
    text-align: left; font-weight: 700; font-size: 0.78rem;
    text-transform: uppercase; letter-spacing: 0.04em;
    padding: 0.85rem 1rem; white-space: nowrap;
    border-bottom: 1px solid var(--line);
}
th.sortable { cursor: pointer; user-select: none; position: relative; padding-right: 1.6rem; }
th.sortable::after { content: '↕'; position: absolute; right: 0.6rem; opacity: 0.4; font-size: 0.75rem; }
th.sortable.asc::after { content: '↑'; opacity: 1; color: var(--brand); }
th.sortable.desc::after { content: '↓'; opacity: 1; color: var(--brand); }
th.sortable:hover { color: var(--brand-700); }
tbody tr { border-bottom: 1px solid var(--line); transition: background 0.12s ease; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f7faff; }
td { padding: 0.85rem 1rem; font-size: 0.95rem; }
td.loading { text-align: center; padding: 3rem; color: var(--muted); }
td.loading.error { color: var(--danger); }

.symbol { font-family: "SFMono-Regular", Menlo, Consolas, monospace; font-weight: 700; letter-spacing: -0.01em; }
.bond-type { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }
.bond-row { cursor: pointer; }
.rate { font-weight: 700; color: var(--ink); }
.rate-high { color: var(--growth); }
.rate .na, .rate.na { color: var(--muted); font-weight: 500; }
.computed-mark { color: var(--muted); margin-left: 2px; font-weight: 500; }
.chart-col { text-align: right; width: 2.5rem; color: var(--brand); opacity: 0.5; }
.chart-col svg { width: 18px; height: 18px; vertical-align: middle; }
.bond-row:hover .chart-col { opacity: 1; }

/* Category badges */
.category-badge {
    display: inline-block; padding: 0.25rem 0.6rem; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
}
.category-badge.fixed { background: var(--fixed-50); color: var(--fixed); }
.category-badge.variable { background: var(--variable-50); color: var(--variable); }
.category-badge.inflation { background: var(--inflation-50); color: var(--inflation); }
.category-badge.zero_coupon { background: var(--zero-50); color: var(--zero); }

/* ---------- Comparison table (brokers) ---------- */
.compare { width: 100%; }
.compare td, .compare th { vertical-align: middle; }
.compare .broker { font-weight: 700; }
.compare .fee { font-weight: 700; color: var(--ink); }
.yes { color: var(--growth); font-weight: 700; }
.no { color: var(--muted); }

/* ---------- Legend ---------- */
.legend { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; box-shadow: var(--shadow-sm); }
.legend h3 { font-size: 1.05rem; margin-bottom: 0.8rem; }
.legend ul { list-style: none; }
.legend li { margin-bottom: 0.5rem; font-size: 0.92rem; color: var(--muted); }

/* ---------- Chart modal ---------- */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16, 35, 59, 0.55); backdrop-filter: blur(2px); }
.modal-card {
    position: relative; background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); width: min(860px, 100%); max-height: 92vh; overflow: auto;
    padding: 1.3rem 1.6rem 1.6rem;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.modal-head h3 { font-size: 1.1rem; color: var(--ink); }
.modal-close { border: none; background: var(--bg); color: var(--ink); width: 2.1rem; height: 2.1rem; border-radius: 50%; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.modal-close:hover { background: var(--line); }
.chart-toolbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 0.4rem 0 0.8rem; font-size: 0.85rem; color: var(--muted); }
.chart-toolbar .seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.chart-toolbar .seg button { font: inherit; font-size: 0.82rem; font-weight: 600; border: none; background: #fff; color: var(--muted); padding: 0.32rem 0.7rem; cursor: pointer; }
.chart-toolbar .seg button.active { background: var(--brand); color: #fff; }
.chart-wrap { position: relative; height: 380px; }
.chart-note { margin-top: 0.75rem; font-size: 0.82rem; color: var(--muted); min-height: 1rem; }

/* ---------- Footer ---------- */
footer { background: #0f1b30; color: #c7d2e0; padding: 2.25rem 0; margin-top: 2.5rem; }
footer .foot-grid { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
footer a { color: #9fc0ff; text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer p { font-size: 0.88rem; margin-bottom: 0.4rem; }
footer .disclaimer { font-size: 0.78rem; opacity: 0.7; max-width: 60ch; }
footer .foot-brand { font-weight: 800; color: #fff; font-size: 1.05rem; }
footer strong { color: #fff; }
.foot-about { max-width: 34ch; }

/* small utilities (kept here to honour the strict CSP — no inline styles) */
.hero a { color: #fff; text-decoration: underline; }
.muted-note { color: var(--muted); font-size: 0.85rem; margin-top: 0.6rem; }
.mt-1 { margin-top: 0.8rem; }
.mt-2 { margin-top: 1.6rem; }
.mt-3 { margin-top: 2rem; }

/* ---------- Gamified learning ---------- */
.progress-bar {
    position: sticky; top: 64px; z-index: 30;
    background: var(--card); border: 1px solid var(--line); border-radius: 999px;
    padding: 0.55rem 1rem; display: flex; align-items: center; gap: 0.9rem;
    box-shadow: var(--shadow-sm); margin-bottom: 1.6rem;
}
.progress-bar .track { flex: 1; height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar .fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--growth)); transition: width 0.5s ease; }
.progress-bar .plabel { font-size: 0.82rem; font-weight: 700; color: var(--muted); white-space: nowrap; }

.step {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 1.5rem 1.6rem; margin-bottom: 1.2rem;
}
.step.done { border-color: #bce7d4; }
.step-head { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 0.7rem; }
.step-num { width: 2.2rem; height: 2.2rem; flex: none; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); font-weight: 800; display: grid; place-items: center; }
.step.done .step-num { background: var(--growth); color: #fff; }
.step-head h2 { font-size: 1.25rem; margin: 0; letter-spacing: -0.01em; }
.step .lead-q { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.4rem; }
.step p { margin-bottom: 0.7rem; }

.widget { background: var(--bg); border-radius: var(--radius-sm); padding: 1.1rem 1.2rem; margin: 1rem 0; }
.widget-row { margin-bottom: 0.85rem; }
.widget-row label { font-size: 0.85rem; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; margin-bottom: 0.25rem; }
.widget-row label b { color: var(--brand-700); font-variant-numeric: tabular-nums; }
.widget input[type="range"] { width: 100%; accent-color: var(--brand); }
.seg-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.seg-toggle button { font: inherit; font-size: 0.85rem; font-weight: 600; border: none; background: #fff; color: var(--muted); padding: 0.4rem 0.9rem; cursor: pointer; }
.seg-toggle button.active { background: var(--brand); color: #fff; }

.result { text-align: center; padding: 0.7rem 0 0.2rem; }
.bignum { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.02em; color: var(--brand-700); font-variant-numeric: tabular-nums; line-height: 1.1; }
.bignum.good { color: var(--growth); }
.bignum.bad { color: var(--danger); }
.result small { display: block; color: var(--muted); font-size: 0.86rem; margin-top: 0.3rem; }

.bars { display: flex; flex-direction: column; gap: 0.45rem; margin: 0.8rem 0 0.2rem; }
.bars .bar { height: 28px; border-radius: 7px; display: flex; align-items: center; padding: 0 0.6rem; color: #fff; font-size: 0.78rem; font-weight: 700; white-space: nowrap; transition: width 0.6s ease; box-sizing: border-box; }
.bar.b-in { background: var(--brand); }
.bar.b-profit { background: var(--growth); }
.bar.b-alt { background: #94a3b8; }

/* Quiz */
.quiz .q { margin-bottom: 1.4rem; }
.quiz .q-text { font-weight: 700; margin-bottom: 0.6rem; }
.q-opts { display: flex; flex-direction: column; gap: 0.5rem; }
.q-opt { text-align: left; font: inherit; font-size: 0.95rem; padding: 0.7rem 0.95rem; border: 1px solid var(--line-strong); background: var(--card); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.12s ease; }
.q-opt:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-50); }
.q-opt:disabled { cursor: default; }
.q-opt.correct { border-color: var(--growth); background: var(--growth-50); color: var(--growth); font-weight: 700; }
.q-opt.wrong { border-color: var(--danger); background: #fdecec; color: var(--danger); }
.q-explain { margin-top: 0.55rem; font-size: 0.88rem; color: var(--ink); background: var(--brand-50); border-radius: var(--radius-sm); padding: 0.6rem 0.85rem; }
.quiz-score { text-align: center; font-size: 1.15rem; font-weight: 800; margin-top: 1rem; color: var(--brand-700); }

.badge-done { text-align: center; padding: 2.2rem 1.5rem; border-radius: var(--radius); background: linear-gradient(135deg, var(--growth-50), var(--brand-50)); border: 1px solid #bce7d4; margin-top: 1.6rem; }
.badge-done .medal { color: var(--warm); margin-bottom: 0.4rem; }
.badge-done .medal svg { width: 56px; height: 56px; }
.badge-done h3 { font-size: 1.5rem; margin-bottom: 0.3rem; }
.is-hidden { display: none !important; }
.reveal { animation: reveal 0.4s ease; }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Finance life-sim (Życie Janka) ---------- */
.sim-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.sim-who { display: flex; align-items: center; gap: 0.85rem; }
.face { width: 60px; height: 60px; flex: none; border-radius: 50%; background: linear-gradient(135deg, var(--brand-50), #fff); border: 1px solid var(--line-strong); overflow: hidden; box-shadow: var(--shadow-sm); }
.face svg { width: 100%; height: 100%; display: block; }
.age-badge { font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.age-badge span { color: var(--muted); font-weight: 600; font-size: 0.95rem; }

.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.6rem; margin-bottom: 1.3rem; }
.acct { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.65rem 0.8rem; box-shadow: var(--shadow-sm); }
.acct .k { font-size: 0.72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.acct .v { font-size: 1.02rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); margin-top: 0.1rem; }
.acct.networth { background: linear-gradient(135deg, var(--brand), var(--brand-700)); border-color: var(--brand); }
.acct.networth .k, .acct.networth .v { color: #fff; }
.acct.debt .v { color: var(--danger); }

/* New Life / plan setup screen */
.newlife { max-width: 680px; margin: 0 auto; }
.newlife .card { padding: 1.4rem 1.6rem; }
.newlife h2 { font-size: 1.4rem; margin-bottom: 0.2rem; }
.newlife .sub { color: var(--muted); margin-bottom: 1.2rem; }
.field { margin-bottom: 1.1rem; }
.field > label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 0.4rem; }
.field .hintline { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }
.field input[type="text"], .field input[type="number"] { font: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); width: 100%; }
.field input[type="range"] { width: 100%; accent-color: var(--brand); }
.seg2 { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; }
.seg2 button { font: inherit; font-size: 0.88rem; font-weight: 600; border: 1px solid var(--line-strong); background: #fff; color: var(--muted); padding: 0.45rem 0.9rem; border-radius: 999px; cursor: pointer; }
.seg2 button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 1.4rem; }
@media (max-width: 560px) { .plan-grid { grid-template-columns: 1fr; } }
.kids-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.4rem; }
.plan-warn { color: #b45309; font-size: 0.85rem; font-weight: 600; }

/* Toasts (floating +/- feedback) */
#toasts { position: fixed; top: 74px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 0.4rem; pointer-events: none; }
.toast { background: var(--card); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.4rem 0.85rem; font-size: 0.85rem; font-weight: 700; box-shadow: var(--shadow-md); animation: toastIn 0.25s ease, toastOut 0.4s ease 2.1s forwards; }
.toast.good { color: var(--growth); border-color: #bce7d4; }
.toast.bad { color: var(--danger); border-color: #f4caca; }
.toast.info { color: var(--brand-700); border-color: #cfe0ff; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* Achievements */
.badges { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.badge-chip { font-size: 0.72rem; font-weight: 700; padding: 0.28rem 0.6rem; border-radius: 999px; background: var(--warm-50); color: #b45309; border: 1px solid #f4d99a; }
.badge-chip.locked { background: var(--bg); color: var(--muted); border-color: var(--line); opacity: 0.7; }

/* Markets chart */
.chartbox { position: relative; height: 168px; }

/* read-only plan summary */
.plansum { font-size: 0.82rem; color: var(--muted); }
.plansum b { color: var(--ink); }
.plansum .ln { display: flex; justify-content: space-between; margin: 0.15rem 0; }

/* Main console: live month-by-month chart (savings vs salary vs kredyt vs leasing) */
.console-panel { padding: 0.9rem 1rem 1.1rem; }
.consolebar { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.cc-left { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.btn-play { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--brand); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; box-shadow: var(--shadow-sm); transition: background 0.12s ease; }
.btn-play:hover:not(:disabled) { background: var(--brand-700); }
.btn-play:disabled { opacity: 0.4; cursor: default; }
.btn-play svg { width: 19px; height: 19px; }
.btn-buy { padding: 0.45rem 0.9rem; font-size: 0.85rem; font-weight: 800; border: none; border-radius: 999px; background: var(--growth); color: #fff; cursor: pointer; box-shadow: var(--shadow-sm); }
.btn-buy:hover { filter: brightness(0.94); }
/* present income lines in the Janek card */
.whoinc { margin: 0.5rem 0 0.7rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0.5rem 0; }
.whoinc .il { display: flex; justify-content: space-between; font-size: 0.82rem; margin: 0.16rem 0; }
.whoinc .il .nm { color: var(--muted); font-weight: 600; }
.whoinc .il .v { font-weight: 800; font-variant-numeric: tabular-nums; }
.whoinc .il.extra .v { color: var(--growth); }
.whoinc .il.cost .v { color: var(--danger); }
.modal-card .bad { color: var(--danger); font-weight: 700; }
/* car picker (wizard) */
.carpick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-top: 0.35rem; }
@media (max-width: 560px) { .carpick { grid-template-columns: repeat(2, 1fr); } }
.caropt { border: 1px solid var(--line-strong); background: var(--card); border-radius: var(--radius-sm); padding: 0.55rem 0.4rem; cursor: pointer; text-align: center; transition: all 0.12s ease; }
.caropt:hover { border-color: var(--brand); background: var(--brand-50); }
.caropt.active { border-color: var(--brand); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand); }
.caropt .cargfx { color: var(--ink); height: 30px; display: flex; align-items: center; justify-content: center; }
.caropt .cargfx svg { width: 56px; height: 28px; }
.caropt .carn { font-size: 0.8rem; font-weight: 700; margin-top: 0.2rem; }
.caropt .carp { font-size: 0.74rem; color: var(--muted); font-weight: 600; }
.cc-right { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.cc-restart { font: inherit; font-size: 0.78rem; font-weight: 700; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.7rem; cursor: pointer; }
.cc-restart:hover { color: var(--danger); border-color: var(--danger); }
.cc-age { display: flex; flex-direction: column; line-height: 1.12; }
.cc-big { font-size: 1rem; font-weight: 700; color: var(--muted); }
.cc-big b { font-size: 1.7rem; font-weight: 900; color: var(--ink); }
.cc-yr { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
/* desk-calendar widget that flips each month */
.cal { width: 52px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--card); box-shadow: var(--shadow-sm); flex: none; }
.cal-top { height: 11px; background: var(--danger); position: relative; }
.cal-top::before, .cal-top::after { content: ""; position: absolute; top: -3px; width: 3px; height: 7px; background: var(--muted); border-radius: 2px; }
.cal-top::before { left: 14px; } .cal-top::after { right: 14px; }
.cal-m { text-align: center; font-weight: 900; font-size: 1.15rem; padding: 0.25rem 0 0.1rem; color: var(--ink); letter-spacing: 0.02em; }
.cal-y { text-align: center; font-weight: 700; font-size: 0.62rem; padding-bottom: 0.28rem; color: var(--muted); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.cal.flip { animation: calflip 0.32s ease; }
@keyframes calflip { 0% { transform: perspective(200px) rotateX(-82deg); opacity: 0.4; } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cal.flip { animation: none; } }
.cc-ctr { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.btn-sm { padding: 0.5rem 1.1rem; font-size: 0.9rem; }
.cc-speed { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.cc-speed button { font: inherit; font-size: 0.8rem; font-weight: 700; padding: 0.42rem 0.72rem; border: none; background: var(--card); color: var(--muted); cursor: pointer; }
.cc-speed button + button { border-left: 1px solid var(--line); }
.cc-speed button.active { background: var(--brand); color: #fff; }
.consolebox { position: relative; height: 348px; min-width: 0; }
.consolebox canvas, .chartbox canvas { max-width: 100%; }
.consolebox.is-hidden { display: none; }
/* "Liczby" breakdown view */
.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
@media (max-width: 760px) { .figures { grid-template-columns: repeat(2, 1fr); } }
.fig { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.6rem 0.7rem; background: var(--bg); }
.fig-l { font-size: 0.74rem; color: var(--muted); font-weight: 700; min-height: 2rem; }
.fig-v { font-size: 1.15rem; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 0.15rem; }
.fig-s { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }
.fig.net { grid-column: 1 / -1; background: var(--brand-50); border-color: #cfe0ff; }
.fig.net .fig-v { color: var(--brand-700); font-size: 1.35rem; }
.fig.neg .fig-v { color: var(--danger); }
/* kafelek: ikona w rogu + miejsce na nią w etykiecie */
.fig { position: relative; }
.fig-l { padding-right: 1.7rem; }
.fig-ic { position: absolute; top: 0.5rem; right: 0.55rem; width: 22px; height: 22px; color: var(--muted); opacity: 0.45; }
.fig-ic svg { width: 100%; height: 100%; display: block; }
.fig.net .fig-ic { color: var(--brand-700); opacity: 0.5; }
.fig.neg .fig-ic { color: var(--danger); opacity: 0.5; }
.fig-note { display: block; font-size: 0.66rem; opacity: 0.85; margin-top: 0.1rem; }
.fig-bar { height: 6px; border-radius: 4px; background: var(--line); margin-top: 0.5rem; overflow: hidden; }
.fig-bar i { display: block; height: 100%; background: var(--growth); border-radius: 4px; transition: width 0.3s ease; }
.fig-car .fig-ic { width: 30px; opacity: 0.55; }
/* fundusz awaryjny — pierścień postępu (cel vs zebrane) */
.fig-ef .ef-row { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.25rem; }
.fig-ef .ef-txt { min-width: 0; }
.fig-ef .ef-txt .fig-v { margin-top: 0; }
.ef-donut { --p: 0; --fill: #0ea5e9; position: relative; flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--fill) calc(var(--p) * 1%), var(--line) 0); }
.ef-donut::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--bg); }
/* makler — pie obligacje (zielony) vs ETF (niebieski) */
.split-pie { --seg: 0; flex: none; width: 52px; height: 52px; border-radius: 50%; background: conic-gradient(#0f9d6b 0 calc(var(--seg) * 1%), #2f6df0 calc(var(--seg) * 1%) 100%); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 2px 0 0; vertical-align: middle; }
.dot-b { background: #0f9d6b; } .dot-e { background: #2f6df0; }
/* wartość netto — poziomy wykres słupkowy składników (obsługuje wartości ujemne: dom na kredycie, dług) */
.nw-bars { margin-top: 0.55rem; display: grid; gap: 0.32rem; }
.nw-bar { display: grid; grid-template-columns: 8.5rem 1fr auto; align-items: center; gap: 0.5rem; font-size: 0.74rem; }
.nw-bl { color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nw-bt { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.nw-bt i { display: block; height: 100%; border-radius: 4px; }
.nw-ba { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.nw-ba.neg { color: var(--danger); }
@media (max-width: 560px) { .nw-bar { grid-template-columns: 6.5rem 1fr auto; font-size: 0.68rem; } }
.ef-donut.ef-low { --fill: #f59e0b; }
.ef-donut.ef-mid { --fill: #0ea5e9; }
.ef-donut.ef-ok { --fill: #12a06a; }
.ef-pct { position: relative; z-index: 1; font-size: 0.7rem; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }
/* przyciski Dom / Inwestuj w kafelku konta */
.fig-btns { display: flex; gap: 0.4rem; margin-top: 0.55rem; }
.fig-btn { font-size: 0.72rem; font-weight: 700; padding: 0.32rem 0.62rem; border-radius: 0.5rem; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); cursor: pointer; }
.fig-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-700); }
.fig-btn.go { background: var(--brand); border-color: var(--brand); color: #fff; }
.fig-btn.go:hover:not(:disabled) { background: var(--brand-700); }
.fig-btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* wiersz „Wydatki razem" w panelu przepływów */
.whoinc .il.total { border-top: 1px dashed var(--line-strong); margin-top: 0.3rem; padding-top: 0.3rem; }
.whoinc .il.total .nm { color: var(--ink); font-weight: 900; }
.whoinc .il.total .v { font-weight: 900; }
/* modal close (×) + hint */
.modal-card { position: relative; }
.modal-close { position: absolute; top: 0.5rem; right: 0.6rem; width: 2rem; height: 2rem; border: none; background: none; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 8px; }
.modal-close:hover { background: var(--bg); color: var(--ink); }
.modal-hint { font-size: 0.76rem; color: var(--muted); text-align: center; margin-top: 0.7rem; }
/* prevent grid/flex blowout on mobile (charts won't force horizontal scroll) */
.sim-layout { min-width: 0; }
.sim-main, .sim-side { min-width: 0; }
@media (max-width: 900px) { .consolebox { height: 280px; } }

/* "Start your life!" gate */
.scene.startlife { text-align: center; border-top: 4px solid var(--brand); }
.scene.startlife .ev { font-size: 1.05rem; }

/* "Co to jest?" beginner explainers */
.whatis { margin: 0.1rem 0 0.5rem; }
.whatis > summary { cursor: pointer; font-size: 0.78rem; font-weight: 700; color: var(--brand-700); list-style: none; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0; }
.whatis > summary::-webkit-details-marker { display: none; }
.whatis > summary::before { content: "?"; display: inline-flex; align-items: center; justify-content: center; width: 1.05rem; height: 1.05rem; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-weight: 900; font-size: 0.72rem; }
.whatis[open] > summary { color: var(--ink); }
.whatis .wi-body { font-size: 0.84rem; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.75rem; margin-top: 0.35rem; line-height: 1.55; }

/* 100%-summing allocation control */
.allocbox { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.6rem 0.85rem 0.7rem; margin-top: 0.3rem; }
.alloc-total { text-align: right; font-weight: 800; font-size: 0.9rem; margin-top: 0.4rem; padding-top: 0.5rem; border-top: 1px dashed var(--line); }
.alloc-total.ok { color: var(--growth); }
.alloc-total.bad { color: var(--danger); }

/* Markets view: stock + rates charts (your majątek is the left Konta panel) */
.marketsview { margin-top: 1rem; }
.mkt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 760px) { .mkt-grid { grid-template-columns: 1fr; } }
.mkt-col { min-width: 0; }
.mkt-h { font-size: 0.78rem; font-weight: 700; color: var(--muted); margin-bottom: 0.4rem; text-align: center; }

/* Decision question pops as a MODAL above the charts (BitLife-style) */
#scene:not(:empty) { margin-top: 1rem; }
.modal-overlay { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 1.2rem; background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(2px); animation: fadeIn 0.18s ease; }
.modal-overlay.is-hidden { display: none; }
.modal-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 1.5rem 1.6rem; max-width: 520px; width: 100%; max-height: 88vh; overflow-y: auto; border-top: 5px solid var(--warm); animation: popIn 0.22s ease; }
.modal-tag { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--warm); margin-bottom: 0.5rem; }
.modal-card .ev { font-size: 1.08rem; margin-bottom: 1.1rem; }
.modal-card .ev b { color: var(--brand-700); }
.modal-card .ev2 { font-size: 0.85rem; color: var(--muted); font-weight: 700; margin-bottom: 0.5rem; }
.modal-slider { margin: 0.2rem 0 1rem; }
.modal-slider label { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 0.35rem; }
.modal-slider input { width: 100%; }
/* wheel of fortune */
.wheel-wrap { position: relative; width: 240px; height: 240px; margin: 0.6rem auto 0.4rem; }
.wheel { display: block; border-radius: 50%; box-shadow: var(--shadow-md); }
.wheel-ptr { position: absolute; top: -4px; left: 50%; margin-left: -11px; width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-top: 20px solid var(--danger); z-index: 2; }
.wheel-res { text-align: center; font-size: 1.02rem; margin: 0.5rem 0; min-height: 1.2rem; }
.wheel-res b { color: var(--growth); }
.quiz-correct { background: var(--brand-50); border: 1px solid #cfe0ff; border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; font-size: 1rem; margin-bottom: 0.7rem; }
.quiz-correct b { color: var(--brand-700); }
.quiz-why { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.6rem 0.85rem; font-size: 0.9rem; color: var(--muted); margin-bottom: 1rem; line-height: 1.5; }
.quiz-why b { color: var(--ink); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { transform: translateY(8px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* Life diary: collapsible secondary log under the console */
.diary-wrap { margin-top: 1rem; }
.diary-wrap > summary { cursor: pointer; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 800; padding: 0.4rem 0.2rem; list-style: revert; }
.diary-wrap .diary { margin-top: 0.5rem; max-height: 300px; }

/* mobile: put the console first, side panels after */
@media (max-width: 900px) { .sim-main { order: -1; } }

/* Two-column game layout: side panel (accounts+stats) next to the diary */
.sim-layout { display: grid; grid-template-columns: 330px 1fr; gap: 1.3rem; align-items: start; }
.sim-side { position: sticky; top: 80px; }
@media (max-width: 900px) { .sim-layout { grid-template-columns: 1fr; } .sim-side { position: static; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.1rem 1.2rem; }
.panel + .panel { margin-top: 1rem; }
.panel h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 0.6rem; }
.face.big { width: 92px; height: 92px; margin: 0 auto 0.5rem; }
.who-name { text-align: center; font-weight: 800; font-size: 1.1rem; }
.who-sub { text-align: center; color: var(--muted); font-size: 0.85rem; margin-bottom: 0.3rem; }

/* Account bar charts */
.abars { display: flex; flex-direction: column; gap: 0.5rem; }
.abar .top { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 0.18rem; }
.abar .top .nm { color: var(--muted); font-weight: 600; }
.abar .top .v { font-weight: 800; font-variant-numeric: tabular-nums; }
.abar .track { height: 9px; background: var(--line); border-radius: 999px; overflow: hidden; }
.abar .track i { display: block; height: 100%; border-radius: 999px; transition: width 0.5s ease; }
.cost-line { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.8rem; margin-top: 0.4rem; }
.cost-line .nm { color: var(--muted); font-weight: 600; }
.cost-line .v { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.cost-line.good .v { color: var(--growth); }
.cost-line:first-of-type { margin-top: 0.7rem; padding-top: 0.6rem; border-top: 1px solid var(--line); }
.networth-line { margin-top: 0.7rem; padding-top: 0.7rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; }
.networth-line .nm { font-weight: 700; }
.networth-line .v { font-weight: 800; font-size: 1.15rem; color: var(--brand-700); font-variant-numeric: tabular-nums; }

/* Stat bars (Szczęście / Zdrowie / Wiedza) */
.statwrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.7rem 1rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm); }
.statline { display: flex; align-items: center; gap: 0.6rem; font-size: 0.82rem; margin: 0.3rem 0; }
.statline .nm { width: 130px; color: var(--muted); font-weight: 700; }
.statline .bar { flex: 1; height: 9px; background: var(--line); border-radius: 999px; overflow: hidden; }
.statline .bar i { display: block; height: 100%; border-radius: 999px; transition: width 0.4s ease, background 0.4s ease; }
.statline .pc { width: 34px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }

/* Per-year actions */
.act-label { font-size: 0.82rem; color: var(--muted); font-weight: 700; margin-bottom: 0.4rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.9rem; }
.act { font: inherit; font-size: 0.86rem; font-weight: 600; padding: 0.5rem 0.85rem; border: 1px solid var(--line-strong); background: var(--card); border-radius: 999px; cursor: pointer; transition: all 0.12s ease; }
.act:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.act:disabled { opacity: 0.4; cursor: default; }

/* Diary / life-log (BitLife-style feed) */
.diary { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 0.4rem 0.9rem; max-height: 360px; overflow-y: auto; margin-bottom: 1rem; }
.entry { padding: 0.7rem 0.2rem; border-bottom: 1px dashed var(--line); }
.entry:last-child { border-bottom: none; }
.entry-age { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--brand-700); margin-bottom: 0.2rem; }
.entry .body { font-size: 0.96rem; }
.entry .body b { color: var(--brand-700); }
.entry .why { margin-top: 0.45rem; font-size: 0.83rem; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 0.45rem 0.65rem; }
.entry .why b { color: var(--ink); }
.entry.bad .entry-age { color: var(--danger); }
.entry.good .entry-age { color: var(--growth); }
.entry.event .entry-age { color: var(--warm); }
.btn-age { width: 100%; font-size: 1.08rem; padding: 0.95rem; margin-top: 0.9rem; justify-content: center; }
.strat-label { font-size: 0.85rem; color: var(--muted); font-weight: 600; margin-bottom: 0.4rem; }

.scene { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.5rem 1.6rem; }
.scene .ev { font-size: 1.08rem; margin-bottom: 1.1rem; }
.scene .ev b { color: var(--brand-700); }
.choices { display: flex; flex-direction: column; gap: 0.6rem; }
.choice { text-align: left; font: inherit; font-size: 0.98rem; font-weight: 600; padding: 0.8rem 1rem; border: 1px solid var(--line-strong); background: var(--card); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.12s ease; display: flex; justify-content: space-between; gap: 0.6rem; align-items: center; }
.choice:hover { border-color: var(--brand); background: var(--brand-50); }
.choice .hint { font-size: 0.8rem; color: var(--muted); font-weight: 500; }

.conseq { margin-top: 0.4rem; }
.conseq .what { background: var(--bg); border-radius: var(--radius-sm); padding: 0.95rem 1.1rem; margin-bottom: 0.7rem; font-size: 1rem; }
.conseq .why { background: var(--brand-50); border: 1px solid #cfe0ff; border-radius: var(--radius-sm); padding: 0.75rem 0.95rem; font-size: 0.92rem; }
.conseq .why .lbl { font-weight: 800; color: var(--brand-700); display: block; margin-bottom: 0.15rem; }
.delta-up { color: var(--growth); font-weight: 700; }
.delta-down { color: var(--danger); font-weight: 700; }

.gameover { text-align: center; }
.gameover .medal svg { width: 52px; height: 52px; color: var(--warm); }
.gameover.bad .medal svg { color: var(--danger); }
/* ending modal: top action row (one line, compact) + two columns (profile | wynik) */
.modal-card.gameover { max-width: 640px; }
.go-actions { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: nowrap; margin: 0 0 0.7rem; }
.go-btn { font-size: 0.8rem; padding: 0.45rem 0.8rem; flex: 0 1 auto; white-space: nowrap; }
.go-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin: 0.6rem 0; text-align: left; }
.go-col { min-width: 0; }
.go-col .widget { margin: 0 0 0.6rem; padding: 0.75rem 0.85rem; }
.go-col .widget-row { margin-bottom: 0.5rem; }
.go-col .widget-row label { font-size: 0.8rem; }
.go-h { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.45rem; }
.go-sub { font-size: 0.72rem; font-weight: 800; color: var(--muted); margin-bottom: 0.35rem; }
.go-tt { background: var(--brand-50); border: 1px solid #cfe0ff; border-radius: var(--radius-sm); padding: 0.8rem 0.9rem; margin: 0.6rem 0; text-align: left; }
.go-tt-range { width: 100%; accent-color: var(--brand); margin: 0.3rem 0 0.5rem; }
.go-tt-line { font-size: 0.85rem; line-height: 1.5; }
.go-tt-line b { color: var(--brand-700); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .go-cols { grid-template-columns: 1fr; } .go-actions { flex-wrap: wrap; } }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
    body { font-size: 16px; overflow-x: hidden; }
    .header-inner { height: auto; min-height: 56px; flex-wrap: wrap; padding: 0.45rem 0; gap: 0.4rem; }
    .nav { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
    .brand { font-size: 1.05rem; }
    .nav a { padding: 0.45rem 0.6rem; font-size: 0.88rem; }
    #toasts { top: auto; bottom: 14px; left: 12px; right: 12px; align-items: center; }
    .toast { max-width: 100%; }
    .consolebar { gap: 0.6rem; }
    .cc-ctr { width: 100%; justify-content: space-between; }
    .controls { flex-direction: column; align-items: flex-start; }
    .filters { width: 100%; }
    .filter-btn { flex: 1; text-align: center; }
    th, td { padding: 0.7rem 0.6rem; font-size: 0.85rem; }
}
@media (max-width: 480px) {
    .table-container { border-radius: var(--radius); }
    /* hide volume column on tiny screens to keep the bank-style layout readable */
    th:nth-child(5), td:nth-child(5) { display: none; }
}

@media print {
    .site-header, footer, .controls, .modal { display: none; }
    .table-container { box-shadow: none; border: none; }
    tbody tr { page-break-inside: avoid; }
    /* „Zapisz plan i wynik" — drukuje sam modal końcowy do PDF (body.printing ustawiane tylko na czas druku) */
    body.printing > *:not(#modal) { display: none !important; }
    body.printing #modal { position: static; display: block !important; background: #fff; padding: 0; overflow: visible; }
    body.printing #modal .modal-card { box-shadow: none; max-height: none; max-width: 100%; width: 100%; border-top: none; animation: none; overflow: visible; }
    body.printing .go-actions, body.printing .modal-close, body.printing .modal-hint, body.printing .callout { display: none !important; }
}
