/* TP-APP — „Energia / performance”: grafit jak sprzęt na siłowni, koralowy akcent energii.
 * Fonty Barlow / Barlow Condensed (SIL OFL) we wtyczce — bez Google Fonts (RODO). */
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/barlow-latin-400.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: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/barlow-latin-ext-400.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: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/barlow-latin-500.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: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/barlow-latin-ext-500.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: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/barlow-latin-600.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: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/barlow-latin-ext-600.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: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/barlow-condensed-latin-600.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: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/barlow-condensed-latin-ext-600.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: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/barlow-condensed-latin-700.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: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/barlow-condensed-latin-ext-700.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; }

:root {
	color-scheme: dark;
	--tp-bg: #0f1114;
	--tp-bar: #0b0d0f;
	--tp-surface: #171a1e;
	--tp-surface-2: #1f2328;
	--tp-text: #eef0f2;
	--tp-muted: #a3aab2;
	--tp-line: #2b3036;
	--tp-accent: #ff5a2c;
	--tp-accent-hover: #ff7148;
	--tp-accent-fg: #1a0904;
	--tp-accent-text: #ff8463;
	--tp-accent-soft: #2a1812;
	--tp-danger: #ff7a8a;
	--tp-radius: 8px;
	--tp-side: 228px;
	--tp-ok-bg: #12271d; --tp-ok-fg: #5fe0a3; --tp-ok-line: #1f4130;
	--tp-warn-bg: #2a2210; --tp-warn-fg: #f6c453; --tp-warn-line: #46381a;
	--tp-bad-bg: #2d1418; --tp-bad-fg: #ff8b99; --tp-bad-line: #4c2229;
	--tp-muted-bg: #1f2328; --tp-muted-fg: #a3aab2; --tp-muted-line: #2b3036;
	--tp-font: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	--tp-display: "Barlow Condensed", "Barlow", "Arial Narrow", sans-serif;
	--tp-shadow: 0 8px 24px rgba(0, 0, 0, .45);
	--tp-safe-b: env(safe-area-inset-bottom, 0px);
	--tp-male: #5b9cf5;
	--tp-female: #f472b6;
	--tp-gnone: #4a525b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
	margin: 0;
	background: var(--tp-bg);
	color: var(--tp-text);
	font: 15px/1.5 var(--tp-font);
	-webkit-text-size-adjust: 100%;
}

a { color: var(--tp-accent-text); text-underline-offset: 3px; }
svg { width: 18px; height: 18px; flex: none; }

.tp-loading, .tp-gate {
	max-width: 480px;
	margin: 15vh auto;
	padding: 0 16px;
	color: var(--tp-muted);
}
.tp-gate h1 { color: var(--tp-text); font-size: 20px; }

/* ---------- Szkielet ---------- */

.tp-shell { min-height: 100vh; }

.tp-top {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 10px;
	height: 52px;
	padding: 0 16px;
	background: var(--tp-surface);
	border-bottom: 1px solid var(--tp-line);
}
.tp-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.tp-brand img { max-height: 28px; max-width: 120px; }
.tp-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-top .tp-spacer { flex: 1; }

.tp-iconbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid transparent;
	border-radius: var(--tp-radius);
	background: none;
	color: var(--tp-muted);
	cursor: pointer;
}
.tp-iconbtn:hover { background: var(--tp-muted-bg); color: var(--tp-text); }
.tp-iconbtn.is-ok { color: var(--tp-ok-fg); }
.tp-iconbtn.is-bad { color: var(--tp-bad-fg); }

.tp-nav {
	position: fixed;
	z-index: 20;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	background: var(--tp-surface);
	border-top: 1px solid var(--tp-line);
	padding-bottom: var(--tp-safe-b);
}
.tp-nav a {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 8px 2px 6px;
	color: var(--tp-muted);
	text-decoration: none;
	font-size: 11px;
}
.tp-nav a svg { width: 22px; height: 22px; }
.tp-nav a.is-active { color: var(--tp-accent); font-weight: 600; }

.tp-main {
	max-width: 1080px;
	margin: 0 auto;
	padding: 16px 16px calc(84px + var(--tp-safe-b));
}

@media (min-width: 900px) {
	.tp-nav {
		top: 52px;
		right: auto;
		bottom: 0;
		width: var(--tp-side);
		flex-direction: column;
		padding: 12px 8px;
		border-top: 0;
		border-right: 1px solid var(--tp-line);
	}
	.tp-nav a {
		flex: none;
		flex-direction: row;
		gap: 10px;
		padding: 9px 12px;
		border-radius: var(--tp-radius);
		font-size: 14px;
	}
	.tp-nav a svg { width: 18px; height: 18px; }
	.tp-nav a.is-active { background: var(--tp-accent-soft); }
	.tp-main { margin-left: var(--tp-side); padding: 24px 32px 48px; }
}

/* ---------- Elementy ---------- */

h1.tp-h { font-size: 20px; margin: 0 0 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h1.tp-h .tp-spacer { flex: 1; }
h2.tp-h2 { font-size: 15px; margin: 24px 0 8px; color: var(--tp-muted); font-weight: 600; }

.tp-banner {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 10px 14px;
	margin-bottom: 16px;
	border: 1px solid var(--tp-bad-line);
	background: var(--tp-bad-bg);
	color: var(--tp-bad-fg);
	border-radius: var(--tp-radius);
	font-size: 14px;
}

.tp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.tp-kpi {
	padding: 14px 16px;
	background: var(--tp-surface);
	border: 1px solid var(--tp-line);
	border-radius: var(--tp-radius);
}
.tp-kpi small { display: block; color: var(--tp-muted); font-size: 12px; }
.tp-kpi strong { display: block; font-size: 22px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tp-kpi.is-main strong { color: var(--tp-accent); }

.tp-card {
	background: var(--tp-surface);
	border: 1px solid var(--tp-line);
	border-radius: var(--tp-radius);
	margin-bottom: 12px;
}
.tp-card-h {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-bottom: 1px solid var(--tp-line);
	font-weight: 600;
}
.tp-card-h .tp-spacer { flex: 1; }
.tp-card-b { padding: 14px; }

.tp-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tp-table th, .tp-table td { padding: 9px 12px; border-bottom: 1px solid var(--tp-line); text-align: left; vertical-align: middle; }
.tp-table th { font-size: 12px; font-weight: 600; color: var(--tp-muted); background: var(--tp-surface); }
.tp-table tr:last-child td { border-bottom: 0; }
.tp-table td.num, .tp-table th.num { text-align: right; white-space: nowrap; }
.tp-table tr.is-click { cursor: pointer; }
.tp-table tr.is-click:hover td { background: var(--tp-muted-bg); }
.tp-table tfoot td { font-weight: 600; border-top: 1px solid var(--tp-line); }
.tp-wrap { overflow-x: auto; }

/* Lista mobilna zamiast tabeli */
.tp-list { list-style: none; margin: 0; padding: 0; }
.tp-list li {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 14px;
	border-bottom: 1px solid var(--tp-line);
}
.tp-list li:last-child { border-bottom: 0; }
.tp-list li.is-click { cursor: pointer; }
.tp-list li.is-click:hover { background: var(--tp-muted-bg); }
.tp-list .tp-grow { flex: 1; min-width: 0; }
.tp-list .tp-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-list .tp-sub { color: var(--tp-muted); font-size: 13px; }
.tp-list .tp-amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tp-empty { padding: 24px 14px; color: var(--tp-muted); text-align: center; }

.tp-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 1px 8px;
	border-radius: 999px;
	border: 1px solid var(--tp-muted-line);
	background: var(--tp-muted-bg);
	color: var(--tp-muted-fg);
	font-size: 12px;
	white-space: nowrap;
}
.tp-badge svg { width: 13px; height: 13px; }
.tp-badge.is-ok { background: var(--tp-ok-bg); color: var(--tp-ok-fg); border-color: var(--tp-ok-line); }
.tp-badge.is-warn { background: var(--tp-warn-bg); color: var(--tp-warn-fg); border-color: var(--tp-warn-line); }
.tp-badge.is-bad { background: var(--tp-bad-bg); color: var(--tp-bad-fg); border-color: var(--tp-bad-line); }

/* Przyciski */
.tp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 38px;
	padding: 0 14px;
	border: 1px solid var(--tp-line);
	border-radius: var(--tp-radius);
	background: var(--tp-surface);
	color: var(--tp-text);
	font: inherit;
	font-size: 14px;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
}
.tp-btn:hover { border-color: var(--tp-muted); }
.tp-btn.is-primary { background: var(--tp-accent); border-color: var(--tp-accent); color: var(--tp-accent-fg); }
.tp-btn.is-danger { color: var(--tp-danger); }
.tp-btn.is-small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.tp-btn:disabled { opacity: .5; cursor: default; }

.tp-fab {
	position: fixed;
	z-index: 19;
	right: 16px;
	bottom: calc(72px + var(--tp-safe-b));
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 48px;
	padding: 0 18px;
	border: 0;
	border-radius: 24px;
	background: var(--tp-accent);
	color: var(--tp-accent-fg);
	font: inherit;
	font-weight: 600;
	box-shadow: var(--tp-shadow);
	cursor: pointer;
}
@media (min-width: 900px) { .tp-fab { bottom: 24px; right: 32px; } }

/* Formularze */
.tp-form { display: grid; gap: 14px; }
.tp-row2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.tp-field label { display: block; font-size: 13px; color: var(--tp-muted); margin-bottom: 4px; }
.tp-field input, .tp-field select, .tp-field textarea, .tp-filters input, .tp-filters select {
	width: 100%;
	min-height: 42px;
	padding: 8px 10px;
	border: 1px solid var(--tp-line);
	border-radius: var(--tp-radius);
	background: var(--tp-surface);
	color: var(--tp-text);
	font: inherit;
	font-size: 16px; /* iOS nie powiększa przy fokusie */
}
.tp-field textarea { min-height: 70px; resize: vertical; }
.tp-field input:focus, .tp-field select:focus, .tp-field textarea:focus { outline: 2px solid var(--tp-accent); outline-offset: -1px; }
.tp-hint { font-size: 13px; color: var(--tp-muted); }
.tp-calc {
	display: flex;
	justify-content: space-between;
	padding: 10px 12px;
	background: var(--tp-accent-soft);
	border-radius: var(--tp-radius);
	font-variant-numeric: tabular-nums;
}
.tp-calc strong { color: var(--tp-accent); }
.tp-check { display: flex; align-items: center; gap: 8px; }
.tp-check input { width: 18px; height: 18px; }
.tp-radio { display: grid; gap: 6px; }
.tp-radio label { display: flex; gap: 8px; align-items: flex-start; color: var(--tp-text); font-size: 14px; }

.tp-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tp-filters > * { flex: 1 1 140px; }
.tp-filters input[type=search] { flex: 2 1 200px; }

.tp-seg { display: inline-flex; border: 1px solid var(--tp-line); border-radius: var(--tp-radius); overflow: hidden; }
.tp-seg button { border: 0; background: var(--tp-surface); color: var(--tp-text); padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.tp-seg button + button { border-left: 1px solid var(--tp-line); }
.tp-seg button.is-active { background: var(--tp-accent); color: var(--tp-accent-fg); }

/* Rozliczenia — miesiąc */
.tp-month .tp-list li { flex-wrap: wrap; }
.tp-paybtn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 34px;
	padding: 0 10px;
	border: 1px solid var(--tp-line);
	border-radius: var(--tp-radius);
	background: var(--tp-surface);
	color: var(--tp-muted);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}
.tp-paybtn.is-paid { background: var(--tp-ok-bg); border-color: var(--tp-ok-line); color: var(--tp-ok-fg); }
.tp-paybtn.is-part { background: var(--tp-warn-bg); border-color: var(--tp-warn-line); color: var(--tp-warn-fg); }

/* Okno dialogowe — na telefonie arkusz od dołu */
.tp-modal-bg {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	background: rgba(4, 5, 6, .72);
}
.tp-modal {
	width: 100%;
	max-width: 520px;
	max-height: 92vh;
	overflow-y: auto;
	background: var(--tp-surface);
	border-radius: 12px 12px 0 0;
	padding: 18px 16px calc(18px + var(--tp-safe-b));
}
.tp-modal h2 { margin: 0 0 14px; font-size: 18px; display: flex; align-items: center; }
.tp-modal h2 .tp-spacer { flex: 1; }
.tp-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.tp-actions .tp-left { margin-right: auto; }
@media (min-width: 600px) {
	.tp-modal-bg { align-items: center; }
	.tp-modal { border-radius: 10px; padding: 22px 24px; }
}

.tp-pop {
	position: absolute;
	right: 12px;
	top: 50px;
	z-index: 30;
	width: 290px;
	padding: 14px;
	background: var(--tp-surface);
	border: 1px solid var(--tp-line);
	border-radius: var(--tp-radius);
	box-shadow: var(--tp-shadow);
	font-size: 14px;
}
.tp-pop p { margin: 0 0 8px; }
.tp-pop .tp-btn { width: 100%; margin-top: 6px; }

.tp-toast {
	position: fixed;
	z-index: 60;
	left: 50%;
	bottom: calc(84px + var(--tp-safe-b));
	transform: translateX(-50%);
	max-width: calc(100% - 32px);
	padding: 10px 16px;
	border-radius: var(--tp-radius);
	background: var(--tp-text);
	color: var(--tp-bg);
	font-size: 14px;
}
.tp-toast.is-error { background: var(--tp-bad-bg); color: var(--tp-bad-fg); border: 1px solid var(--tp-bad-line); }

.tp-muted { color: var(--tp-muted); }
.tp-right { text-align: right; }
.tp-nowrap { white-space: nowrap; }

@media (max-width: 599px) {
	.tp-hide-m { display: none !important; }
	.tp-row2 { grid-template-columns: 1fr; }
}
@media (min-width: 600px) {
	.tp-hide-d { display: none !important; }
}

.tp-banner.is-demo { border-color: var(--tp-warn-line); background: var(--tp-warn-bg); color: var(--tp-warn-fg); }
.tp-banner.is-demo a { color: inherit; font-weight: 600; }

/* Instrukcja (assets/help.html, generowana z docs/instrukcja.md) */
.tp-help { max-width: 760px; line-height: 1.6; }
.tp-help-toc { padding: 12px 16px; margin-bottom: 20px; background: var(--tp-surface); border: 1px solid var(--tp-line); border-radius: var(--tp-radius); }
.tp-help-toc ol { margin: 6px 0 0; padding-left: 20px; columns: 2 220px; }
.tp-help h2 { scroll-margin-top: 64px; font-size: 18px; margin: 32px 0 8px; padding-top: 16px; border-top: 1px solid var(--tp-line); }
.tp-help h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.tp-help h3 { font-size: 15px; margin: 20px 0 6px; }
.tp-help p, .tp-help li { color: var(--tp-text); }
.tp-help figure { margin: 14px 0; }
.tp-help img { display: block; max-width: 100%; height: auto; border: 1px solid var(--tp-line); border-radius: var(--tp-radius); }
.tp-help figure.is-phone img { max-width: 300px; }
.tp-help figcaption { font-size: 13px; color: var(--tp-muted); margin-top: 4px; }
.tp-help table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 14px; }
.tp-help th, .tp-help td { border: 1px solid var(--tp-line); padding: 6px 10px; text-align: left; vertical-align: top; }
.tp-help th { background: var(--tp-muted-bg); }
.tp-help .tp-note { padding: 10px 14px; border: 1px solid var(--tp-line); background: var(--tp-accent-soft); border-radius: var(--tp-radius); }

@media print {
	.tp-top, .tp-nav, .tp-fab, .tp-banner, #tp-help-print { display: none !important; }
	.tp-main { margin: 0 !important; padding: 0 !important; }
	body { background: #fff; color: #000; }
	.tp-help h2 { break-before: auto; }
	.tp-help figure { break-inside: avoid; }
}

/* Klienci — karta, wykresy pomiarów */
.tp-back { margin: 0 0 6px; font-size: 14px; }
.tp-back a { color: var(--tp-muted); text-decoration: none; }
.tp-unit { font-size: 13px; font-weight: 400; color: var(--tp-muted); }
.tp-kpis-6 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.tp-kpi small + small { margin-top: 2px; }
.tp-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.tp-chart { margin: 0; padding: 12px 12px 6px; background: var(--tp-surface); border: 1px solid var(--tp-line); border-radius: var(--tp-radius); }
.tp-chart figcaption { font-size: 14px; margin-bottom: 4px; }
.tp-ch-wrap { position: relative; }
.tp-ch-wrap svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.tp-ch-grid { stroke: var(--tp-line); stroke-width: 1; }
.tp-ch-ax { fill: var(--tp-muted); font-size: 10px; font-family: var(--tp-font); }
.tp-ch-val { fill: var(--tp-text); font-size: 11px; font-weight: 600; font-family: var(--tp-font); }
.tp-ch-line { fill: none; stroke: var(--tp-accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tp-ch-dot { fill: var(--tp-accent); stroke: var(--tp-surface); stroke-width: 1.5; }
.tp-ch-last { fill: var(--tp-accent); stroke: var(--tp-surface); stroke-width: 2; }
.tp-ch-goal { stroke: var(--tp-muted); stroke-width: 1; stroke-dasharray: 4 3; }
.tp-ch-cross { stroke: var(--tp-muted); stroke-width: 1; }
.tp-ch-hover { fill: var(--tp-surface); stroke: var(--tp-accent); stroke-width: 2; }
.tp-tip { position: absolute; top: 0; width: 150px; padding: 6px 8px; font-size: 12px; line-height: 1.4; background: var(--tp-surface); border: 1px solid var(--tp-line); border-radius: var(--tp-radius); box-shadow: var(--tp-shadow); pointer-events: none; }
@media (max-width: 599px) { .tp-row2.tp-row2-m { grid-template-columns: 1fr 1fr; } }
@media print {
	.tp-noprint, .tp-back, .tp-fab { display: none !important; }
	.tp-qa dd { break-inside: avoid; }
	.tp-charts { grid-template-columns: 1fr 1fr; }
	.tp-chart, .tp-kpi, .tp-card { break-inside: avoid; }
}

/* Sylwetka — start (kontur przerywany) vs ostatni pomiar (wypełnienie) */
.tp-sil-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 13px; margin-bottom: 8px; }
.tp-sil-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tp-sil-key { display: inline-block; width: 18px; height: 10px; border-radius: 2px; }
.tp-sil-key.is-start { border: 1.5px dashed var(--tp-muted); }
.tp-sil-key.is-now { background: color-mix(in srgb, var(--tp-accent) 28%, transparent); border: 1.5px solid var(--tp-accent); }
.tp-sil-svg { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto 6px; }
.tp-sil-now path, .tp-sil-now ellipse { fill: color-mix(in srgb, var(--tp-accent) 22%, var(--tp-surface)); stroke: var(--tp-accent); stroke-width: 1.5; stroke-linejoin: round; }
.tp-sil-start path, .tp-sil-start ellipse { fill: none; stroke: var(--tp-muted); stroke-width: 1.5; stroke-dasharray: 5 4; stroke-linejoin: round; }
.tp-sil-lead { fill: none; stroke: var(--tp-line); stroke-width: 1; }
.tp-sil-lab { fill: var(--tp-muted); font-size: 11px; font-family: var(--tp-font); }
.tp-sil-val { fill: var(--tp-text); font-size: 13px; font-weight: 600; font-family: var(--tp-font); }
@media print { .tp-sil { break-inside: avoid; } }

/* ---------- Energia / performance — warstwa stylu ---------- */

::selection { background: var(--tp-accent); color: var(--tp-accent-fg); }
html { scrollbar-color: #3a4048 var(--tp-bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--tp-bg); }
::-webkit-scrollbar-thumb { background: #3a4048; border-radius: 10px; border: 2px solid var(--tp-bg); }
input, textarea, select { caret-color: var(--tp-accent); }
:focus-visible { outline: 2px solid var(--tp-accent); outline-offset: 2px; }
.tp-field input:focus, .tp-field select:focus, .tp-field textarea:focus { outline: 2px solid var(--tp-accent); outline-offset: 0; border-color: transparent; }
body { font-variant-numeric: tabular-nums; }

/* Pasek i znak marki */
.tp-top { background: var(--tp-bar); border-bottom-color: var(--tp-line); }
.tp-brand { font-family: var(--tp-display); font-size: 19px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.tp-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: var(--tp-accent); color: var(--tp-accent-fg); }
.tp-mark svg { width: 19px; height: 19px; stroke-width: 2.2; }
.tp-iconbtn.is-ok { color: var(--tp-ok-fg); }

/* Nawigacja */
.tp-nav { background: var(--tp-bar); border-color: var(--tp-line); }
.tp-nav a { font-family: var(--tp-display); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--tp-muted); }
.tp-nav a.is-active { color: var(--tp-text); font-weight: 700; }
.tp-nav a.is-active svg { color: var(--tp-accent); }
@media (min-width: 900px) {
	.tp-nav a { font-size: 15px; }
	.tp-nav a.is-active { background: var(--tp-surface-2); }
}

/* Typografia */
h1.tp-h { font-family: var(--tp-display); font-size: 30px; font-weight: 700; line-height: 1.1; text-transform: uppercase; letter-spacing: .01em; margin-bottom: 18px; }
h2.tp-h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--tp-display); font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--tp-muted); margin: 28px 0 10px; }
h2.tp-h2 svg { color: var(--tp-accent); width: 17px; height: 17px; }
.tp-card-h { font-family: var(--tp-display); font-size: 16px; text-transform: uppercase; letter-spacing: .04em; }
.tp-card-h svg { color: var(--tp-accent); }
.tp-modal h2 { font-family: var(--tp-display); font-size: 22px; text-transform: uppercase; letter-spacing: .02em; }
.tp-table th { font-family: var(--tp-display); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; background: var(--tp-surface); }
.tp-gate h1 { font-family: var(--tp-display); font-size: 28px; text-transform: uppercase; }

/* Karty i kafelki */
.tp-card, .tp-kpi, .tp-chart { background: var(--tp-surface); border-color: var(--tp-line); }
.tp-kpi { position: relative; }
.tp-kpi strong { font-family: var(--tp-display); font-size: 32px; font-weight: 700; line-height: 1.15; letter-spacing: .01em; }
.tp-kpi small { color: var(--tp-muted); }
.tp-kpi.is-main { background: var(--tp-accent); border-color: var(--tp-accent); }
.tp-kpi.is-main small, .tp-kpi.is-main strong { color: var(--tp-accent-fg); }
.tp-kpi-ic > svg { position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; color: var(--tp-muted); opacity: .8; }
.tp-unit { font-family: var(--tp-font); }
.tp-list li.is-click:hover, .tp-table tr.is-click:hover td { background: var(--tp-surface-2); }
.tp-calc { background: var(--tp-accent-soft); }
.tp-calc strong { color: var(--tp-accent-text); }
.tp-help-toc, .tp-help .tp-note { background: var(--tp-surface); }

/* Przyciski */
.tp-btn { background: var(--tp-surface-2); border-color: var(--tp-line); color: var(--tp-text); font-weight: 500; }
.tp-btn:hover { border-color: #4a525b; }
.tp-btn.is-primary { background: var(--tp-accent); border-color: var(--tp-accent); color: var(--tp-accent-fg); font-weight: 600; }
.tp-btn.is-primary:hover { background: var(--tp-accent-hover); border-color: var(--tp-accent-hover); }
.tp-btn.is-danger { color: var(--tp-danger); }
.tp-fab { color: var(--tp-accent-fg); font-family: var(--tp-display); font-size: 17px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; transition: transform .2s cubic-bezier(.2, .9, .3, 1), background .2s; }
.tp-fab:hover { background: var(--tp-accent-hover); transform: translateY(-2px); }
.tp-fab svg { stroke-width: 2.6; }
.tp-seg { border-color: var(--tp-line); }
.tp-seg button { background: var(--tp-surface-2); color: var(--tp-muted); font-family: var(--tp-display); font-weight: 600; letter-spacing: .04em; }
.tp-seg button.is-active { background: var(--tp-accent); color: var(--tp-accent-fg); }
.tp-paybtn { background: var(--tp-surface-2); border-color: var(--tp-line); }

/* Formularze */
.tp-field input, .tp-field select, .tp-field textarea, .tp-filters input, .tp-filters select { background: var(--tp-bg); border-color: var(--tp-line); color: var(--tp-text); }
.tp-field input::placeholder, .tp-filters input::placeholder { color: #8a929b; }
.tp-check input, .tp-radio input { accent-color: var(--tp-accent); }

/* Okna, podpowiedzi, wykresy */
.tp-modal, .tp-pop, .tp-tip { background: var(--tp-surface); border: 1px solid var(--tp-line); }
.tp-toast { background: var(--tp-surface-2); color: var(--tp-text); border: 1px solid var(--tp-line); box-shadow: var(--tp-shadow); }
.tp-ch-goal { stroke: #6b737c; }
.tp-ch-grid { stroke: #252a30; }
.tp-sil-now path, .tp-sil-now ellipse { fill: #2a3037; stroke: var(--tp-accent); stroke-width: 2; }
.tp-sil-start path, .tp-sil-start ellipse { stroke: #c5cbd1; stroke-width: 1.5; }
.tp-sil-key.is-now { background: #2a3037; border: 2px solid var(--tp-accent); }
.tp-sil-key.is-start { border-color: #c5cbd1; }
@media print { .tp-sil-now path, .tp-sil-now ellipse { fill: #f3e2dc; } .tp-sil-start path, .tp-sil-start ellipse { stroke: #555; } .tp-sil-key.is-now { background: #f3e2dc; } }

/* Jasny motyw (przełącznik w pasku). Akcent bez zmian; koral jako tekst przyciemniony do kontrastu 4,5:1 na bieli. */
:root[data-theme="light"] {
	color-scheme: light;
	--tp-bg: #f3f4f6;
	--tp-bar: #ffffff;
	--tp-surface: #ffffff;
	--tp-surface-2: #eef0f2;
	--tp-text: #15181b;
	--tp-muted: #5b636d;
	--tp-line: #dde1e5;
	--tp-accent-text: #c2410c;
	--tp-accent-soft: #fdeee8;
	--tp-danger: #c0263e;
	--tp-ok-bg: #e7f6ee; --tp-ok-fg: #17663b; --tp-ok-line: #c9e8d7;
	--tp-warn-bg: #fdf3dd; --tp-warn-fg: #7a5300; --tp-warn-line: #f0dba9;
	--tp-bad-bg: #fbe8eb; --tp-bad-fg: #a8233a; --tp-bad-line: #f2c6ce;
	--tp-muted-bg: #eef0f2; --tp-muted-fg: #5b636d; --tp-muted-line: #dde1e5;
	--tp-shadow: 0 8px 24px rgba(20, 24, 28, .12);
	--tp-male: #2563eb;
	--tp-female: #db2777;
	--tp-gnone: #c4c9cf;
}
:root[data-theme="light"] html, :root[data-theme="light"] { scrollbar-color: #c4c9cf var(--tp-bg); }
:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c4c9cf; }
:root[data-theme="light"] .tp-btn:hover { border-color: #b9bfc6; }
:root[data-theme="light"] .tp-field input::placeholder, :root[data-theme="light"] .tp-filters input::placeholder { color: #737b85; }
:root[data-theme="light"] .tp-ch-grid { stroke: #e6e9ec; }
:root[data-theme="light"] .tp-ch-goal { stroke: #8a929b; }
:root[data-theme="light"] .tp-sil-now path, :root[data-theme="light"] .tp-sil-now ellipse { fill: #f1f2f4; }
:root[data-theme="light"] .tp-sil-start path, :root[data-theme="light"] .tp-sil-start ellipse { stroke: #4b525a; }
:root[data-theme="light"] .tp-sil-key.is-now { background: #f1f2f4; }
:root[data-theme="light"] .tp-sil-key.is-start { border-color: #4b525a; }
:root[data-theme="light"] .tp-modal-bg { background: rgba(20, 24, 28, .45); }

/* Dzwonek w pasku — włączone powiadomienia w kolorze akcentu */
.tp-iconbtn.is-on { color: var(--tp-accent-text); }

/* Przejście między stronami po przesunięciu palcem */
@keyframes tp-in-left { from { transform: translateX(28px); opacity: .35; } to { transform: none; opacity: 1; } }
@keyframes tp-in-right { from { transform: translateX(-28px); opacity: .35; } to { transform: none; opacity: 1; } }
.tp-enter-left { animation: tp-in-left .24s cubic-bezier(.2, .9, .3, 1); }
.tp-enter-right { animation: tp-in-right .24s cubic-bezier(.2, .9, .3, 1); }
@media (prefers-reduced-motion: reduce) { .tp-enter-left, .tp-enter-right { animation: none; } }
.tp-main { overflow-x: clip; }

/* Wywiad: uwaga zdrowotna, pytania, odpowiedzi, edytor */
.tp-health { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin: 0 0 16px; border: 1px solid var(--tp-warn-line); background: var(--tp-warn-bg); color: var(--tp-text); border-radius: var(--tp-radius); }
.tp-health > svg { color: var(--tp-warn-fg); width: 22px; height: 22px; margin-top: 1px; }
.tp-health-h { display: block; font-family: var(--tp-display); font-size: 16px; text-transform: uppercase; letter-spacing: .04em; color: var(--tp-warn-fg); margin-bottom: 2px; }
.tp-health ul { margin: 0; padding-left: 18px; }
.tp-health li { margin: 4px 0; }
.tp-q { margin: 0; padding: 14px; border: 1px solid var(--tp-line); border-radius: var(--tp-radius); background: var(--tp-surface); }
.tp-q legend { padding: 0 4px; font-weight: 600; line-height: 1.4; }
.tp-q .tp-hint { margin: 4px 0 8px; }
.tp-q textarea, .tp-q input:not([type=checkbox]):not([type=radio]) { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--tp-line); border-radius: var(--tp-radius); background: var(--tp-bg); color: var(--tp-text); font: inherit; font-size: 16px; margin-top: 6px; }
.tp-q .tp-radio label { padding: 6px 0; }
.tp-q-rodo { background: var(--tp-accent-soft); border-color: var(--tp-accent-soft); }
.tp-q-rodo .tp-check { align-items: flex-start; }
.tp-q-rodo .tp-check input { margin-top: 3px; flex: none; }
.tp-qn { font-family: var(--tp-display); color: var(--tp-accent-text); font-weight: 700; }
.tp-req { color: var(--tp-accent-text); }
.tp-qa { margin: 0; padding: 4px 16px 12px; }
.tp-qa dt { margin-top: 14px; font-weight: 600; }
.tp-qa dd { margin: 4px 0 0; padding-bottom: 12px; border-bottom: 1px solid var(--tp-line); }
.tp-qa-info { color: var(--tp-muted); font-weight: 400 !important; }
.tp-qe { padding: 12px; border: 1px solid var(--tp-line); border-radius: var(--tp-radius); display: grid; gap: 8px; }
.tp-qe-h { display: flex; align-items: center; gap: 8px; }
.tp-qe-h select { max-width: 230px; }
.tp-qe textarea, .tp-qe input:not([type=checkbox]), .tp-qe select { width: 100%; padding: 7px 9px; border: 1px solid var(--tp-line); border-radius: var(--tp-radius); background: var(--tp-bg); color: var(--tp-text); font: inherit; font-size: 15px; }
.tp-qe-f { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.tp-sve-h { margin: 6px 0 0; font-family: var(--tp-display); text-transform: uppercase; letter-spacing: .04em; font-size: 16px; }
.tp-fill { max-width: 760px; }

/* Publiczna ankieta klienta (/tp/a/…) */
.tp-public .tp-pub-top { position: static; }
.tp-pub { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
.tp-pub-form { margin-top: 18px; }

/* Plany — edytor */
.tp-portal-row { display: flex; gap: 12px; align-items: center; }
.tp-portal-row > svg { color: var(--tp-accent-text); }
.tp-plan-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tp-plan-title { flex: 1; min-width: 0; font-family: var(--tp-display); font-size: 26px; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; background: transparent; border: 1px solid transparent; border-radius: var(--tp-radius); color: var(--tp-text); padding: 4px 6px; }
.tp-plan-title:hover, .tp-plan-title:focus { border-color: var(--tp-line); background: var(--tp-surface); }
.tp-plan-bar { position: sticky; top: 52px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; margin-bottom: 8px; background: var(--tp-bg); border-bottom: 1px solid var(--tp-line); }
.tp-plan-kcal { display: inline-flex; align-items: center; gap: 6px; font-family: var(--tp-display); text-transform: uppercase; letter-spacing: .04em; }
.tp-plan-kcal input { width: 84px; }
.tp-plan-grid { display: grid; gap: 16px; }
@media (min-width: 1100px) { .tp-plan-grid { grid-template-columns: minmax(0, 1fr) 300px; } .tp-plan-side { position: sticky; top: 120px; align-self: start; } }
.tp-plan-side .tp-card-b > div { margin-bottom: 12px; }
.tp-plan-side small { display: block; color: var(--tp-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.tp-plan-side strong { font-family: var(--tp-display); font-size: 24px; }
.tp-hint-health small { color: var(--tp-warn-fg) !important; display: flex !important; align-items: center; gap: 4px; }
.tp-plan-sec { margin: 18px 0; padding: 14px; border: 1px solid var(--tp-line); border-radius: var(--tp-radius); background: var(--tp-surface); }
.tp-plan-sech { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.tp-plan-main .tp-sec-name { font-family: var(--tp-display); font-size: 20px; font-weight: 700; text-transform: uppercase; width: 200px; flex: none; }
.tp-plan-main .tp-sec-goal { flex: 1; width: auto; min-width: 200px; }
.tp-sec-sum { color: var(--tp-muted); font-size: 13px; }
.tp-meal, .tp-block { padding: 12px; margin-bottom: 10px; border: 1px solid var(--tp-line); border-radius: var(--tp-radius); background: var(--tp-bg); }
.tp-meal-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.tp-plan-main .tp-meal-name { font-weight: 600; width: 180px; flex: none; }
.tp-meal-grid { display: grid; grid-template-columns: minmax(0, 1fr) repeat(4, 74px); gap: 8px; align-items: end; margin-bottom: 8px; }
.tp-meal-grid label, .tp-ex-grid label { display: grid; gap: 2px; font-size: 12px; color: var(--tp-muted); }
@media (max-width: 599px) { .tp-meal-grid { grid-template-columns: repeat(4, 1fr); } .tp-dish-title { grid-column: 1 / -1; } }
.tp-ing { display: grid; gap: 6px; margin-bottom: 8px; }
.tp-ing-row { display: grid; grid-template-columns: minmax(0, 2fr) 74px 96px minmax(0, 1.4fr) 36px; gap: 6px; align-items: center; }
@media (max-width: 599px) { .tp-ing-row { grid-template-columns: 1fr 70px 86px 36px; } .tp-ing-row input:nth-of-type(3) { grid-column: 1 / 4; } }
.tp-steps { display: grid; gap: 4px; font-size: 12px; color: var(--tp-muted); }
.tp-plan-main input, .tp-plan-main select, .tp-plan-main textarea, .tp-plan-kcal input { width: 100%; min-height: 36px; padding: 6px 8px; border: 1px solid var(--tp-line); border-radius: var(--tp-radius); background: var(--tp-surface); color: var(--tp-text); font: inherit; font-size: 15px; }
.tp-plan-main textarea { resize: vertical; }
.tp-plan-main .tp-check input { width: auto; min-height: 0; }
.tp-plan-main input.is-avoid { border-color: var(--tp-warn-fg); background: var(--tp-warn-bg); }
.tp-ex { padding: 10px 0; border-top: 1px solid var(--tp-line); }
.tp-ex:first-of-type { border-top: 0; }
.tp-ex.is-superset { padding: 10px; margin: 0 -10px; border-radius: var(--tp-radius); background: var(--tp-accent-soft); }
.tp-ex-top { display: flex; align-items: center; gap: 6px; }
.tp-plan-main .tp-ex-name { font-weight: 600; flex: 1; width: auto; }
.tp-ex-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
@media (max-width: 599px) { .tp-ex-grid { grid-template-columns: repeat(3, 1fr); } }
.tp-ex-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; margin-top: 6px; align-items: center; }
@media (max-width: 599px) { .tp-ex-grid2 { grid-template-columns: 1fr; } }

/* Plany — widok klienta (strona „Mój plan”, podgląd, PDF) */
.tp-pl-nav { position: sticky; top: 0; z-index: 4; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 10px 0; margin-bottom: 8px; background: var(--tp-bg); border-bottom: 1px solid var(--tp-line); font-family: var(--tp-display); text-transform: uppercase; letter-spacing: .04em; }
.tp-pl-nav a { color: var(--tp-text); text-decoration: none; }
.tp-pl-nav .tp-btn { margin-left: auto; }
.tp-pl-sec { scroll-margin-top: 60px; margin-bottom: 28px; }
.tp-pl-h { font-family: var(--tp-display); font-size: 24px; text-transform: uppercase; letter-spacing: .02em; margin: 24px 0 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tp-pl-v { font-family: var(--tp-display); font-size: 19px; text-transform: uppercase; letter-spacing: .03em; margin: 20px 0 8px; }
.tp-pl-v .tp-muted { font-family: var(--tp-font); font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.tp-pl-meal h4 { margin: 2px 0 8px; font-size: 17px; }
.tp-pl-mh { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.tp-pl-ing { list-style: none; margin: 0 0 8px; padding: 0; }
.tp-pl-ing li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--tp-line); }
.tp-pl-ing li span:last-child { color: var(--tp-muted); text-align: right; }
.tp-pl-steps { margin: 6px 0 0; padding-left: 20px; }
.tp-pl-steps li { margin: 3px 0; }
.tp-pl-tips { margin: 8px 0 0; padding-left: 20px; }
.tp-pl-tips li { margin: 4px 0; }
.tp-pl-ex { margin: 0; padding: 4px 14px 10px 34px; }
.tp-pl-ex li { padding: 8px 0; border-bottom: 1px solid var(--tp-line); }
.tp-pl-ex li:last-child { border-bottom: 0; }
.tp-pl-exn { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.tp-pl-vid { font-size: 13px; font-weight: 600; color: var(--tp-accent-text); }
.tp-pl-dose { font-family: var(--tp-display); font-size: 18px; font-weight: 600; letter-spacing: .02em; }
.tp-pl-ss { font-size: 12px; color: var(--tp-accent-text); }
.tp-pl-shop summary { cursor: pointer; }
.tp-banner.is-ok { border-color: var(--tp-ok-line); background: var(--tp-ok-bg); color: var(--tp-ok-fg); }
@media print { .tp-pl-nav, .tp-plan-bar { display: none !important; } .tp-pl-meal, .tp-pl-ex li { break-inside: avoid; } details.tp-card > *:not(summary) { display: block !important; } }

/* Płeć: niebieski ♂ / różowy ♀ — zawsze z symbolem (kolor nie jest jedynym nośnikiem informacji) */
.tp-g { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; vertical-align: -2px; }
.tp-g svg { width: 15px; height: 15px; stroke-width: 2.2; }
.tp-g-m { color: var(--tp-male); }
.tp-g-k { color: var(--tp-female); }
.tp-g-none { width: 12px; height: 12px; border-radius: 3px; background: var(--tp-gnone); }
.tp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tp-sil-m { --sil: var(--tp-male); }
.tp-sil-k { --sil: var(--tp-female); }
.tp-sil-m .tp-sil-now path, .tp-sil-m .tp-sil-now ellipse, .tp-sil-k .tp-sil-now path, .tp-sil-k .tp-sil-now ellipse { stroke: var(--sil); fill: color-mix(in srgb, var(--sil) 16%, var(--tp-surface)); }
.tp-sil-m .tp-sil-key.is-now, .tp-sil-k .tp-sil-key.is-now { border-color: var(--sil); background: color-mix(in srgb, var(--sil) 16%, var(--tp-surface)); }
.tp-monthsw { font-family: var(--tp-font); font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.tp-monthsw button { display: inline-grid; place-items: center; padding: 6px 8px; }
.tp-monthsw button:disabled { opacity: .35; cursor: default; }
.tp-monthsw svg { width: 18px; height: 18px; }
.tp-monthsw select { border: 0; border-left: 1px solid var(--tp-line); border-right: 1px solid var(--tp-line); background: var(--tp-surface); color: var(--tp-text); font: inherit; padding: 6px 10px; min-width: 150px; cursor: pointer; }
.tp-dash2 { display: grid; gap: 12px; margin-top: 12px; }
@media (min-width: 760px) { .tp-dash2 { grid-template-columns: 1fr 1fr; } }
.tp-dash2 .tp-card { margin-bottom: 0; }
.tp-dash-n { font-family: var(--tp-display); font-size: 22px; }
.tp-gbar { display: flex; gap: 2px; height: 14px; margin: 4px 0 12px; }
.tp-gbar span { min-width: 4px; }
.tp-gbar span:first-child { border-radius: 4px 0 0 4px; }
.tp-gbar span:last-child { border-radius: 0 4px 4px 0; }
.tp-gbar span:only-child { border-radius: 4px; }
.tp-gbar-m { background: var(--tp-male); }
.tp-gbar-k { background: var(--tp-female); }
.tp-gbar-none { background: var(--tp-gnone); }
.tp-glegend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tp-glegend li { display: grid; grid-template-columns: 24px 1fr auto 44px; align-items: center; gap: 6px; }
.tp-glegend strong { font-family: var(--tp-display); font-size: 18px; text-align: right; }
.tp-glegend .tp-muted { text-align: right; }
.tp-top3 { margin: 0; padding: 0; }
.tp-top-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tp-surface-2); font-family: var(--tp-display); font-weight: 700; color: var(--tp-accent-text); flex: none; }
.tp-top3 li:first-child .tp-top-n { background: var(--tp-accent); color: var(--tp-accent-fg); }

/* Druk (raport klienta, instrukcja): jasno, oszczędnie dla drukarki */
@media print {
	:root {
		color-scheme: light;
		--tp-bg: #fff; --tp-bar: #fff; --tp-surface: #fff; --tp-surface-2: #f3f4f5;
		--tp-text: #111; --tp-muted: #555; --tp-line: #d6d9dc;
		--tp-accent: #d9431a; --tp-accent-fg: #fff; --tp-accent-text: #b8360f; --tp-accent-soft: #fbeee9;
		--tp-ok-bg: #e9f6ef; --tp-ok-fg: #1d6b40; --tp-ok-line: #cfe7da;
		--tp-warn-bg: #fdf4e1; --tp-warn-fg: #7c5600; --tp-warn-line: #f0dcb0;
		--tp-bad-bg: #fbe9ec; --tp-bad-fg: #a3283c; --tp-bad-line: #f1c9d0;
		--tp-muted-bg: #f3f4f5; --tp-muted-fg: #555; --tp-muted-line: #d6d9dc;
		--tp-male: #2563eb; --tp-female: #db2777; --tp-gnone: #c4c9cf;
	}
	.tp-kpi.is-main { background: #fff; border-color: var(--tp-line); }
	.tp-kpi.is-main small, .tp-kpi.is-main strong { color: var(--tp-text); }
}

/* ===== Styl „Nocna siłownia” (Ustawienia → Firma → Styl wyglądu): czerń + niebieski, ostre krawędzie.
 * Fonty Big Shoulders Display + Archivo (SIL OFL) we wtyczce. Tokeny jasnego motywu powtórzone z wyższą specyficznością. */
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('fonts/archivo-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: 'Archivo'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('fonts/archivo-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Big Shoulders Display'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('fonts/big-shoulders-display-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: 'Big Shoulders Display'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('fonts/big-shoulders-display-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root[data-style="noc"] {
	--tp-bg: #0d1015;
	--tp-bar: #0d1015;
	--tp-surface: #161b22;
	--tp-surface-2: #1f252e;
	--tp-text: #f2f4f6;
	--tp-muted: #aeb6be;
	--tp-line: #2c333d;
	--tp-accent: #1863dc;
	--tp-accent-hover: #3575d3;
	--tp-accent-fg: #ffffff;
	--tp-accent-text: #6a9ff0;
	--tp-accent-soft: #12203a;
	--tp-radius: 2px;
	--tp-muted-bg: #1f252e; --tp-muted-fg: #aeb6be; --tp-muted-line: #2c333d;
	--tp-font: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	--tp-display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
	--tp-male: #38bdf8; /* błękit ≠ niebieski akcentu, żeby płeć nie myliła się z zaznaczeniem */
}
:root[data-style="noc"][data-theme="light"] {
	--tp-bg: #f2f4f6;
	--tp-bar: #ffffff;
	--tp-surface: #ffffff;
	--tp-surface-2: #e9ecef;
	--tp-text: #0d1015;
	--tp-muted: #5f656d;
	--tp-line: #dde1e5;
	--tp-accent-text: #1655c0;
	--tp-accent-soft: #e3ecfb;
	--tp-muted-bg: #e9ecef; --tp-muted-fg: #5f656d; --tp-muted-line: #dde1e5;
	--tp-male: #0284c7;
}
/* Big Shoulders jest węższy niż Barlow Condensed: grubiej i trochę większy, żeby czytał się tak samo */
[data-style="noc"] h1.tp-h, [data-style="noc"] .tp-plan-title { font-weight: 900; font-size: 34px; letter-spacing: 0; }
[data-style="noc"] .tp-brand, [data-style="noc"] .tp-kpi strong, [data-style="noc"] .tp-plan-main .tp-sec-name, [data-style="noc"] .tp-pl-h { font-weight: 900; }
[data-style="noc"] .tp-nav a, [data-style="noc"] .tp-card-h, [data-style="noc"] .tp-table th, [data-style="noc"] .tp-seg button, [data-style="noc"] h2.tp-h2 { font-weight: 800; letter-spacing: .06em; }
[data-style="noc"] .tp-kpi strong { font-size: 36px; }
[data-style="noc"] .tp-sil-key.is-now { background: #1f2a3a; }
@media print {
	:root[data-style="noc"], :root[data-style="noc"][data-theme="light"] {
		--tp-bg: #fff; --tp-bar: #fff; --tp-surface: #fff; --tp-surface-2: #f3f4f5;
		--tp-text: #111; --tp-muted: #555; --tp-line: #d6d9dc;
		--tp-muted-bg: #f3f4f5; --tp-muted-fg: #555; --tp-muted-line: #d6d9dc;
		--tp-accent: #1863dc; --tp-accent-fg: #fff; --tp-accent-text: #1655c0; --tp-accent-soft: #e3ecfb; --tp-male: #0284c7;
	}
	[data-style="noc"] .tp-sil-now path, [data-style="noc"] .tp-sil-now ellipse, [data-style="noc"] .tp-sil-key.is-now { fill: #dde7f7; background: #dde7f7; }
}

/* Ciemne logo firmy na ciemnym tle (Ustawienia → „Logo jest ciemne”); jasny motyw i wydruk bez zmian. */
@media screen { :root[data-logo-invert]:not([data-theme="light"]) .tp-brand img { filter: invert(1) hue-rotate(180deg); } }
