/* ==========================================================
   Portal Infornacji — powłoka aplikacji: pasek boczny, górny
   pasek, kafle, samouczek. Ładowany PO style.css.
   Wszystkie klasy z przedrostkiem p-, żeby nie gryzły się
   z przewodnikiem i pokojami.
   ========================================================== */

/* ==========================================================
   ETAP 10 — jasna skóra portalu. Biblioteka (przewodnik, pokoje,
   słownik, dla dzieci) zostaje na atramencie; portal, którym
   zarządza się państwem, ma być jasny, błękitny, spokojny.
   Zmienne nadpisane na body.portal, więc każdy moduł i każda
   klasa ze style.css dostaje je automatycznie.
   ========================================================== */
body.portal {
  /* Trzy warstwy, żeby nic się nie zlewało: strona (błękitnoszara),
     karta (biała, z cieniem), wnętrze karty (jasnobłękitne wiersze). */
  --bg: #e6edf7;
  --bg-alt: #dbe5f2;
  --surface: #ffffff;
  --surface-2: #f2f6fc;
  --line: rgba(24, 48, 92, .14);
  --line-strong: rgba(24, 48, 92, .26);
  --text: #141d33;
  --muted: #4f5d78;
  --card-shadow: 0 1px 2px rgba(24, 48, 92, .06), 0 10px 28px rgba(24, 48, 92, .08);
  --fire: #d97a12;
  --fire-2: #c2410c;
  --gold: #a8730a;
  --good: #1f8a4c;
  --blue: #2b6fd6;
  --bad: #cf3b3b;
  --accent: #2b6fd6;
  --accent-2: #1d4ed8;
  --accent-soft: rgba(43, 111, 214, .10);
  --shadow: 0 18px 44px rgba(24, 48, 92, .14);
  color-scheme: light;
}
.portal { padding: 0; background: var(--bg); }
/* Elementy ze style.css, które miały kolory wpisane na sztywno pod ciemne tło. */
.portal, .portal * { scrollbar-color: rgba(24, 48, 92, .28) transparent; }
.portal ::-webkit-scrollbar-thumb { background: rgba(24, 48, 92, .22); background-clip: content-box; }
.portal ::-webkit-scrollbar-thumb:hover { background: rgba(43, 111, 214, .5); background-clip: content-box; }
.portal ::selection { background: rgba(43, 111, 214, .22); }
.portal a { color: var(--accent); }
.portal .btn { border-color: var(--line-strong); background: var(--surface); }
.portal .btn:hover { border-color: var(--accent); }
.portal .btn--primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(43, 111, 214, .22); }
.portal .btn--primary:hover { filter: brightness(1.06); }
.portal .btn--ghost { color: var(--text); }
.portal .skiplink { color: #fff; background: var(--accent); }
.portal .bar { background: rgba(24, 48, 92, .09); }
.portal .eyebrow { color: var(--accent); }
.portal :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline-color: var(--accent); }
.portal .field textarea:focus { outline-color: rgba(43, 111, 214, .45); border-color: var(--accent); }
.portal .callout { background: radial-gradient(120% 140% at 0% 0%, rgba(43, 111, 214, .10), rgba(43, 111, 214, 0) 60%), var(--surface); }
.portal .note { border-left-color: var(--accent); background: linear-gradient(90deg, rgba(43, 111, 214, .08), transparent); }
.portal .tip { box-shadow: var(--shadow); border-color: rgba(43, 111, 214, .35); }
.portal .tip::before { border-color: rgba(43, 111, 214, .35); }
.portal .term { text-decoration-color: rgba(43, 111, 214, .6); }
.portal .term:hover, .portal .term.is-open { background: rgba(43, 111, 214, .12); text-decoration-color: var(--accent); }
.portal .footer { background: var(--bg-alt); }
.portal input[type="range"] { accent-color: var(--accent); }
.portal select, .portal input[type="text"], .portal input[type="search"], .portal input[type="number"], .portal textarea { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.p-app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

/* ---------- Pasek boczny ---------- */
.p-side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  background: #ffffff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px 20px; box-shadow: 4px 0 24px rgba(24, 48, 92, .05);
}
/* Na niskim ekranie spis modułów nie mieści się w całości. Dopóki jest jeszcze
   coś niżej, dolny brzeg się rozmywa; przy samym dole maska znika, żeby
   ostatni wiersz był pełny. Klasę zakłada skrypt. */
.p-side.is-przewijalny {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent);
}
.p-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; color: var(--text); }
.p-brand:hover { text-decoration: none; }
.p-brand__flame { width: 26px; height: 26px; flex: none; }
.p-brand b { font-family: var(--font-display); font-weight: 500; font-size: 19px; display: block; line-height: 1.1; }
.p-brand span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.p-nav { display: grid; gap: 2px; }
.p-nav__head { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 16px 10px 6px; }
/* Biblioteka zwinięta: dziewięć modułów wystarczy na start; wyjaśnienia „po kolei” są na życzenie. */
.p-lib > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.p-lib > summary::-webkit-details-marker { display: none; }
.p-lib > summary::before { content: '▸'; font-size: 11px; transition: transform .15s; }
.p-lib[open] > summary::before { transform: rotate(90deg); }
.p-lib > summary:hover { color: var(--accent); }
.p-nav a {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px; color: var(--text); font-size: 14.5px; line-height: 1.25;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.p-nav a:hover { background: var(--surface-2); text-decoration: none; }
.p-nav a[aria-current="page"] { background: var(--accent-soft); border-color: rgba(43, 111, 214, .35); }
.p-nav a[aria-current="page"] .p-nav__ico { color: var(--accent); }
.p-nav__ico { width: 20px; height: 20px; color: var(--muted); }
.p-nav__ico svg { width: 20px; height: 20px; display: block; }
.p-nav__sub { display: block; font-size: 11.5px; color: var(--muted); }
.p-nav__done { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.p-nav__done.is-done { background: var(--good); box-shadow: 0 0 0 3px rgba(123, 211, 137, .18); }
.p-nav--lib a { grid-template-columns: 1fr; font-size: 13.5px; color: var(--muted); padding: 6px 10px; }
.p-nav--lib a:hover { color: var(--text); }

.p-side__foot { margin-top: auto; padding: 14px 8px 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.p-side__foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

.p-tutor-card {
  margin-top: 16px; padding: 12px 12px 10px; border-radius: 12px;
  border: 1px solid rgba(43, 111, 214, .3); background: linear-gradient(160deg, rgba(43, 111, 214, .09), transparent 70%);
}
.p-tutor-card b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.p-tutor-card p { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.p-tutor-card .progress { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.p-tutor-card .progress__bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; transition: width .4s; }

/* ---------- Górny pasek ---------- */
.p-main { min-width: 0; display: flex; flex-direction: column; }
.p-top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px; padding: 10px 22px;
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); box-shadow: 0 2px 12px rgba(24, 48, 92, .05);
}
.p-top__toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.p-top__toggle span { display: block; width: 18px; height: 2px; background: var(--text); margin: 4px auto; }
.p-top__where { display: grid; line-height: 1.15; min-width: 0; }
.p-top__where span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.p-top__where b { font-family: var(--font-display); font-weight: 500; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-top__spacer { flex: 1; }
.p-top__btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; font-size: 13.5px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); white-space: nowrap;
}
.p-top__btn:hover { border-color: var(--accent); text-decoration: none; }
.p-top__btn--fire { border-color: rgba(43, 111, 214, .5); color: var(--accent); }
.p-me { display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }
.p-me:hover { border-color: var(--fire); text-decoration: none; }
.p-me__ava { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 600; }
.p-me__txt { display: grid; line-height: 1.15; }
.p-me__txt b { font-size: 13px; }
.p-me__txt span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* ---------- Treść ---------- */
/* Treść rozpycha kolumnę, więc stopka siada na dole okna, a nie w połowie
   ekranu na krótkich modułach (UWI, Giełda). */
/* Szeroki ekran ma być użyty: wcześniej treść kończyła się na 1240 px,
   a trzecia część monitora stała pusta. */
.p-content { padding: 26px 30px 60px; max-width: 1760px; width: 100%; flex: 1 0 auto; }

/* Górny pasek jest przyklejony, więc skok do kotwicy musi zostawić na niego
   miejsce. Bez tego nagłówek celu chował się pod paskiem. */
.portal :target, .portal [id] { scroll-margin-top: 84px; }
.p-head { margin-bottom: 22px; }
.p-head h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(26px, 3vw, 36px); line-height: 1.15; margin: 4px 0 8px; letter-spacing: -.01em; }
.p-head .lead { margin: 0; max-width: 820px; }
.p-head .lead + .lead { margin-top: 10px; }

.p-grid { display: grid; gap: 20px; grid-template-columns: repeat(12, 1fr); }
.p-col-4 { grid-column: span 4; } .p-col-5 { grid-column: span 5; } .p-col-6 { grid-column: span 6; }
.p-col-7 { grid-column: span 7; } .p-col-8 { grid-column: span 8; } .p-col-12 { grid-column: span 12; }

.p-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; box-shadow: var(--card-shadow); }
.p-box--alt { background: var(--surface-2); }
/* Wnętrze karty: wiersze na jasnym błękicie, karta biała, strona szarobłękitna. */
.p-box .p-row, .p-box .p-task, .p-box .k-konto, .p-box .z-offer, .p-box .z-makro, .p-box .z-zlec, .p-box .g-src, .p-box .g-tick, .p-box .f-skill, .p-box .f-ev, .p-box .f-sit__row, .p-box .f-ethic, .p-box .u-rec, .p-box .u-wnio, .p-box .u-termin, .p-box .w-node, .p-box .z-hala__r, .p-box .y-galazka { background: var(--surface-2); }
.p-box--fire { border-color: rgba(43, 111, 214, .38); box-shadow: 0 0 0 3px rgba(43, 111, 214, .06); }
/* Rozstrzygnięcie wniosku: zielona ramka przy zgodzie, pomarańczowa przy poprawce. */
.p-box--good { border-color: rgba(123, 211, 137, .55); box-shadow: 0 0 0 3px rgba(123, 211, 137, .08); }
.p-box--warn { border-color: rgba(255, 179, 71, .55); box-shadow: 0 0 0 3px rgba(255, 179, 71, .08); }
.p-box__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.p-box__head h2, .p-box__head h3 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 20px; letter-spacing: -.01em; }
.p-col-12 > .p-box__head { border-bottom: 0; padding-bottom: 0; margin-top: 8px; }
.p-box__head .small { margin: 0; }
.p-box h4 { margin: 14px 0 6px; font-size: 15px; }
.p-box p { font-size: 15px; color: var(--muted); margin: 0 0 10px; }
.p-box p:last-child { margin-bottom: 0; }
.p-box p strong, .p-box li strong { color: var(--text); }
.p-box ul, .p-box ol { padding-left: 20px; color: var(--muted); font-size: 15px; margin: 6px 0 10px; }
.p-box li { margin: 4px 0; }
.p-box .lead { font-size: 16.5px; }

/* wyjaśnienia dłuższe (moduł Drzewo, Profil) */
.p-prose { max-width: 780px; }
.p-prose h2 { font-family: var(--font-display); font-weight: 500; font-size: 26px; line-height: 1.2; margin: 34px 0 12px; }
.p-prose h3 { font-family: var(--font-display); font-weight: 500; font-size: 20px; margin: 26px 0 8px; }
.p-prose p, .p-prose li { font-size: 16.5px; color: var(--muted); }
.p-prose p strong, .p-prose li strong { color: var(--text); }
.p-prose .callout p { color: var(--text); }
.p-prose table { border-collapse: collapse; width: 100%; font-size: 14.5px; margin: 10px 0 16px; }
.p-prose th, .p-prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.p-prose th { color: var(--muted); font-weight: 500; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.p-prose td { color: var(--muted); }
.p-prose td:first-child { color: var(--text); }
.p-tablewrap { overflow-x: auto; }

/* ---------- Kafle na kokpicie ---------- */
.p-tile { display: grid; gap: 6px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); transition: border-color .2s, transform .15s, box-shadow .2s; min-width: 0; align-content: start; box-shadow: var(--card-shadow); }
.p-tile:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.p-tile__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.p-tile__top span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.p-tile__ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.p-tile__ico svg { width: 20px; height: 20px; display: block; }
.p-tile b { font-family: var(--font-display); font-weight: 500; font-size: 20px; line-height: 1.15; }
.p-tile__num { font-family: var(--font-mono); font-size: 26px; color: var(--accent); line-height: 1; margin: 4px 0; }
.p-tile__num small { font-size: 12px; color: var(--muted); margin-left: 6px; }
.p-tile p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ---------- Listy, wiersze, wskaźniki ---------- */
.p-list { display: grid; gap: 8px; }
.p-row {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; align-items: center;
  padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
  color: var(--text); text-align: left; width: 100%; font: inherit;
}
button.p-row { cursor: pointer; transition: border-color .15s; }
button.p-row:hover, a.p-row:hover { border-color: var(--accent); text-decoration: none; }
.p-row.is-active { border-color: var(--accent); background: rgba(43, 111, 214, .07); }
.p-row__t { display: grid; gap: 2px; min-width: 0; }
.p-row__t b { font-size: 15px; line-height: 1.25; }
.p-row__t span { font-size: 12.5px; color: var(--muted); }
.p-row__r { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); text-align: right; white-space: nowrap; max-width: 45%; }
.p-row--stack { grid-template-columns: 1fr; }
.p-row--stack .p-row__r { text-align: left; white-space: normal; max-width: none; }
.p-row__r b { display: block; color: var(--text); font-size: 15px; }

.p-lvl { display: inline-block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--muted); margin-right: 6px; vertical-align: middle; }
.p-lvl--ulica { color: var(--good); border-color: rgba(123, 211, 137, .45); }
.p-lvl--dzielnica { color: var(--blue); border-color: rgba(127, 178, 255, .45); }
.p-lvl--miasto { color: var(--fire); border-color: rgba(255, 179, 71, .45); }
.p-lvl--wojewodztwo { color: var(--gold); border-color: rgba(168, 115, 10, .45); }
.p-lvl--region, .p-lvl--kraj { color: var(--accent-2); border-color: rgba(43, 111, 214, .45); }

.p-kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: 14px; color: var(--muted); }
.p-kv b { font-family: var(--font-mono); color: var(--text); font-weight: 500; text-align: right; }
.p-kv b.is-fire { color: var(--fire); }
.p-kv b.is-good { color: var(--good); }
.p-kv b.is-bad { color: var(--bad); }

.p-meter { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.p-meter > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .35s; }
.p-meter--good > i { background: var(--good); }
.p-meter--gold > i { background: var(--gold); }
.p-meter--blue > i { background: var(--blue); }
.p-meter--bad > i { background: var(--bad); }

.p-big { font-family: var(--font-mono); font-size: 30px; color: var(--accent); line-height: 1; }
.p-big small { font-size: 13px; color: var(--muted); margin-left: 6px; font-family: var(--font-body); }

/* Wzór łamie się na spacjach, a te stoją przy znakach działań, więc w wąskiej
   kolumnie przechodzi do drugiego wiersza zamiast urywać się w połowie. */
.p-eq { font-family: var(--font-mono); font-size: 15px; line-height: 1.7; padding: 12px 14px; background: var(--bg); border-radius: 10px; border: 1px solid var(--line); overflow-x: auto; overflow-wrap: break-word; margin: 10px 0; }
.p-eq b { color: var(--fire); font-weight: 600; }

.p-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.p-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.p-seg button { padding: 7px 12px; font-size: 13px; background: var(--surface); border: 0; color: var(--muted); }
.p-seg button + button { border-left: 1px solid var(--line); }
.p-seg button[aria-pressed="true"] { background: rgba(43, 111, 214, .15); color: var(--accent); }

.p-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.p-tabs button { padding: 10px 14px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14.5px; white-space: nowrap; margin-bottom: -1px; }
.p-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.p-tabs button:hover { color: var(--text); }

.p-note { padding: 12px 14px; border-radius: 10px; background: rgba(127, 178, 255, .08); border: 1px solid rgba(127, 178, 255, .3); font-size: 14px; color: var(--muted); margin: 10px 0; }
.p-note strong { color: var(--text); }
.p-note--fire { background: rgba(255, 179, 71, .08); border-color: rgba(255, 179, 71, .35); }
.p-note--good { background: rgba(123, 211, 137, .08); border-color: rgba(123, 211, 137, .35); }
.p-note--bad { background: rgba(255, 107, 107, .08); border-color: rgba(255, 107, 107, .35); }

.p-log { display: grid; gap: 6px; margin-top: 12px; }
.p-log__line { font-size: 13.5px; color: var(--muted); padding: 8px 12px; background: var(--bg); border-radius: 8px; border-left: 2px solid var(--line-strong); animation: fadeUp .3s ease; }
.p-log__line--good { border-left-color: var(--good); }
.p-log__line--warn { border-left-color: var(--fire); }
.p-log__line--bad { border-left-color: var(--bad); }
.p-log__line--money { border-left-color: var(--gold); color: var(--text); }

.p-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12.5px; color: var(--muted); }
.p-chip--fire { color: var(--fire); border-color: rgba(255, 179, 71, .5); }
.p-chip--good { color: var(--good); border-color: rgba(123, 211, 137, .5); }
.p-chip--bad { color: var(--bad); border-color: rgba(255, 107, 107, .5); }
.p-chip--blue { color: var(--blue); border-color: rgba(127, 178, 255, .5); }

.p-doors { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 14px; }

/* powiadomienia na kokpicie */
.p-notif { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.p-notif:first-child { border-top: 0; padding-top: 0; }
.p-notif__ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--bg); color: var(--accent); }
.p-notif__ico svg { width: 18px; height: 18px; }
.p-notif__t { font-size: 14.5px; line-height: 1.35; }
.p-notif__t small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.p-notif__go { font-size: 12.5px; white-space: nowrap; }

/* drabina kont */
.p-ladder { display: grid; gap: 6px; }
.p-ladder__row { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; font-size: 13.5px; }
.p-ladder__row .p-meter { height: 10px; }
.p-ladder__row b { font-family: var(--font-mono); font-weight: 500; font-size: 13px; white-space: nowrap; }

/* ---------- Samouczek ---------- */
.p-hl { position: relative; z-index: 61 !important; box-shadow: 0 0 0 3px var(--accent), 0 0 0 9px rgba(43, 111, 214, .25) !important; border-radius: 12px; }
.p-tutor-veil { position: fixed; inset: 0; z-index: 60; background: rgba(22, 33, 58, .42); animation: fadeIn .2s ease; }
.p-tutor {
  position: fixed; z-index: 62; width: min(380px, calc(100vw - 24px));
  background: var(--surface-2); border: 1px solid rgba(43, 111, 214, .45); border-radius: 14px; box-shadow: var(--shadow);
  padding: 16px 18px 14px; animation: fadeUp .25s ease;
}
/* Miejsce po prawej jest zarezerwowane na głośniczek: gdyby pasek był
   flexem, licznik „1 z 7” łamał się na dwie linie obok przycisku. */
.p-tutor__k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 4px; padding-right: 96px; line-height: 1.5; }
.p-tutor__k span { color: var(--muted); }

/* Odsłuch kroku. Głośniczek stoi w rogu karty, żeby nie konkurował
   z „Dalej”: to propozycja, a nie droga przez samouczek. */
.p-audio-grupa { position: absolute; top: 12px; right: 14px; display: flex; align-items: center; gap: 6px; }
.p-audio {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface);
  color: var(--accent); cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.p-audio svg { width: 17px; height: 17px; fill: currentColor; }
.p-audio:hover { background: var(--accent-soft); border-color: var(--accent); }
.p-audio:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.p-audio[data-stan="pauza"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.p-audio[data-stan="czeka"] { color: var(--muted); cursor: progress; }
.p-audio[data-stan="blad"] { color: var(--bad); border-color: var(--bad); }
.p-audio__wir { animation: pAudioWir 1s linear infinite; transform-origin: 50% 50%; }
@keyframes pAudioWir { to { transform: rotate(360deg); } }
.p-audio__tempo {
  padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; color: var(--muted); cursor: pointer;
}
.p-audio__tempo:hover { color: var(--accent); border-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .p-audio__wir { animation-duration: 3s; } }
.p-tutor h3 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 500; font-size: 19px; line-height: 1.2; }
.p-tutor p { margin: 0 0 8px; font-size: 14.5px; color: var(--muted); line-height: 1.55; }
.p-tutor p strong { color: var(--text); }
.p-tutor__foot { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.p-tutor__foot .btn { padding: 8px 14px; font-size: 13.5px; }
.p-tutor__foot .p-tutor__close { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.p-tutor__dots { display: flex; gap: 4px; margin-left: 4px; }
.p-tutor__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.p-tutor__dots i.is-on { background: var(--accent); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Wąski ekran ---------- */
@media (max-width: 960px) {
  .p-app { grid-template-columns: 1fr; }
  .p-side { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); z-index: 70; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow); }
  .p-side.is-open { transform: translateX(0); }
  .p-side-veil { position: fixed; inset: 0; z-index: 69; background: rgba(22, 33, 58, .42); }
  .p-top__toggle { display: block; }
  .p-content { padding: 18px 14px 50px; }
  .p-col-4, .p-col-5, .p-col-6, .p-col-7, .p-col-8 { grid-column: span 12; }
  .p-me__txt { display: none; }
  .p-top__btn--tutor span { display: none; }
}

/* ==========================================================
   ETAP 7 — portal ma być programem, nie artykułem.
   Wyjaśnienia schodzą z ekranu do trzech miejsc, wszystkie
   widoczne bez czytania: znaczek „i” przy kontrolce, panel
   zasad modułu, samouczek. Plus zadania i powiadomienia
   zwrotne, żeby każde kliknięcie miało skutek.
   ========================================================== */

/* ---------- Znaczek „i”: wyjaśnienie przypięte do elementu ---------- */
.p-i {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 18px; height: 18px; padding: 0; margin-left: 6px; vertical-align: middle;
  border: 1px solid var(--line-strong); border-radius: 50%; background: transparent;
  color: var(--muted); font-family: var(--font-mono); font-size: 10.5px; line-height: 1;
  cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
/* Kółko zostaje małe, żeby nie rozpychało wiersza, ale pole kliknięcia ma
   dwadzieścia cztery piksele w obie strony: tyle, ile trzeba pod palec. */
.p-i::after { content: ''; position: absolute; top: 50%; left: 50%; width: 24px; height: 24px; transform: translate(-50%, -50%); }
.p-i:hover, .p-i[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); background: rgba(43, 111, 214, .12); }
body.is-explain .p-i { color: var(--accent); border-color: var(--accent); background: rgba(43, 111, 214, .14); box-shadow: 0 0 0 3px rgba(43, 111, 214, .12); }
.p-pop {
  position: fixed; z-index: 78; width: min(330px, calc(100vw - 24px));
  background: var(--surface-2); border: 1px solid rgba(43, 111, 214, .45); border-radius: 12px;
  box-shadow: var(--shadow); padding: 13px 15px; animation: fadeUp .18s ease;
}
.p-pop .p-pop__t { display: block; font-family: var(--font-display); font-weight: 500; font-size: 15px; margin-bottom: 5px; }
.p-pop p { margin: 0 0 7px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.p-pop p:last-child { margin: 0; }
.p-pop p strong { color: var(--text); }
.p-pop__more { display: inline-block; margin-top: 8px; font-size: 12.5px; }

/* ---------- Panel zasad modułu (wysuwany z prawej) ---------- */
.p-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 82; width: min(560px, 94vw);
  background: var(--bg-alt); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow);
  display: flex; flex-direction: column; transform: translateX(101%); transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
.p-drawer.is-open { transform: none; }
.p-drawer__top { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.p-drawer__top b { font-family: var(--font-display); font-weight: 500; font-size: 18px; flex: 1; }
.p-drawer__x { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font-size: 15px; }
.p-drawer__x:hover { color: var(--accent); border-color: var(--accent); }
.p-drawer__tabs { display: flex; gap: 4px; padding: 10px 20px 0; overflow-x: auto; border-bottom: 1px solid var(--line); }
.p-drawer__tabs button { padding: 8px 12px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: 13.5px; white-space: nowrap; margin-bottom: -1px; }
.p-drawer__tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.p-drawer__body { padding: 18px 20px 40px; overflow-y: auto; }
.p-drawer__body h3 { font-family: var(--font-display); font-weight: 500; font-size: 19px; margin: 22px 0 8px; }
.p-drawer__body h3:first-child { margin-top: 0; }
.p-drawer__body h4 { font-size: 15px; margin: 16px 0 6px; }
.p-drawer__body p, .p-drawer__body li { font-size: 15px; line-height: 1.65; color: var(--muted); }
.p-drawer__body p { margin: 0 0 10px; }
.p-drawer__body strong { color: var(--text); }
.p-drawer__body em { color: var(--text); font-style: italic; }
.p-drawer__body ul, .p-drawer__body ol { padding-left: 20px; margin: 8px 0 12px; }
.p-drawer__body li { margin: 5px 0; }
.p-drawer__body table { border-collapse: collapse; width: 100%; font-size: 13.5px; margin: 8px 0 14px; }
.p-drawer__body th, .p-drawer__body td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--muted); }
.p-drawer__body th { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; }
.p-drawer__body td:first-child { color: var(--text); }
.p-drawer__body .p-eq { white-space: normal; }
.p-drawer__body svg { max-width: 100%; height: auto; }
.p-veil { position: fixed; inset: 0; z-index: 81; background: rgba(22, 33, 58, .4); animation: fadeIn .2s ease; }

/* ---------- Powiadomienia zwrotne ---------- */
.p-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); }
.p-toast {
  display: grid; grid-template-columns: 26px 1fr; gap: 11px; align-items: start;
  padding: 12px 14px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow); animation: toastIn .3s cubic-bezier(.2, .9, .3, 1);
}
.p-toast.is-out { animation: toastOut .25s ease forwards; }
.p-toast__i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--bg); color: var(--accent); font-size: 13px; }
.p-toast em { display: block; font-style: normal; font-size: 14px; line-height: 1.3; margin-bottom: 2px; color: var(--text); }
.p-toast span { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.p-toast--good { border-color: rgba(123, 211, 137, .5); } .p-toast--good .p-toast__i { color: var(--good); }
.p-toast--money { border-color: rgba(245, 196, 81, .5); } .p-toast--money .p-toast__i { color: var(--accent-2); }
.p-toast--bad { border-color: rgba(255, 107, 107, .5); } .p-toast--bad .p-toast__i { color: var(--bad); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* ---------- Zadania ---------- */
.p-task {
  display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; align-items: center;
  padding: 11px 13px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
  color: var(--text); text-align: left; width: 100%; font: inherit; transition: border-color .15s, opacity .2s;
}
.p-task + .p-task { margin-top: 7px; }
a.p-task { transition: border-color .15s, background .15s, opacity .2s; }
a.p-task:hover { border-color: var(--accent); background: var(--surface-2); text-decoration: none; }
a.p-task:hover .p-task__box { border-color: var(--accent); }
.p-task__box { width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--line-strong); display: grid; place-items: center; color: transparent; font-size: 12px; }
.p-task.is-done { opacity: .55; }
.p-task.is-done .p-task__box { background: var(--good); border-color: var(--good); color: #fff; }
.p-task.is-done .p-task__t em { text-decoration: line-through; }
.p-task__t { display: grid; gap: 2px; min-width: 0; }
.p-task__t em { font-style: normal; font-size: 14.5px; font-weight: 500; line-height: 1.3; }
.p-task__t span { font-size: 12.5px; color: var(--muted); }
.p-task__r { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.p-task__r b { display: block; color: var(--gold); font-size: 13px; }

/* Rozwinięcie reszty listy zadań. */
.p-task-more {
  display: block; width: 100%; margin-top: 8px; padding: 10px 12px;
  border: 1px dashed var(--line-strong); border-radius: 12px; background: none;
  color: var(--muted); font-size: 13.5px; transition: color .15s, border-color .15s;
}
.p-task-more:hover { color: var(--accent); border-color: var(--accent); }

.p-ring { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; margin-bottom: 14px; }
.p-ring__wrap { position: relative; display: grid; place-items: center; width: 56px; height: 56px; }
.p-ring__wrap svg { width: 56px; height: 56px; transform: rotate(-90deg); }
.p-ring__wrap i { position: absolute; font-family: var(--font-mono); font-style: normal; font-size: 14px; color: var(--accent); }
.p-ring__bg { fill: none; stroke: var(--line); stroke-width: 5; }
.p-ring__fg { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; transition: stroke-dasharray .5s; }
.p-ring__t b { display: block; font-size: 15px; }
.p-ring__t span { font-size: 12.5px; color: var(--muted); }

/* ---------- Górny pasek: samouczek i zasady bardziej widoczne ---------- */
.p-top__btn--tutor { border-color: rgba(43, 111, 214, .55); color: var(--accent); background: rgba(43, 111, 214, .1); }
.p-top__btn--tutor.is-new { animation: nudge 2.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(43, 111, 214, .38); } 50% { box-shadow: 0 0 0 7px rgba(43, 111, 214, 0); } }
.p-top__btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: rgba(43, 111, 214, .12); }

/* ---------- Nagłówek modułu: jedna linia, nie akapit ---------- */
.p-head--app { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.p-head--app h1 { font-size: clamp(23px, 2.4vw, 30px); margin: 2px 0 4px; }
.p-head--app .p-sub { margin: 0; font-size: 14.5px; color: var(--muted); max-width: 720px; }
.p-head--app .p-sub strong { color: var(--text); }
.p-head__acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* pasek stanu modułu: liczby zamiast akapitu */
.p-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.p-stat { flex: 1 1 158px; padding: 12px 14px 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); min-width: 0; box-shadow: var(--card-shadow); }
/* Etykieta musi zostać zwykłym wierszem tekstu. Jako pojemnik zginający
   każdy kawałek zdania stawał się osobnym elementem, a spacje między nimi
   znikały: „Twój dochód podstawowy” czytało się jako „Twójdochód”. */
.p-stat > span { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.p-stat b { display: block; font-family: var(--font-mono); font-size: 19px; margin-top: 3px; }
.p-stat b.is-fire { color: var(--fire); } .p-stat b.is-good { color: var(--good); } .p-stat b.is-bad { color: var(--bad); } .p-stat b.is-gold { color: var(--gold); }
.p-stat small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

/* ---------- Pierwsze wejście do modułu: nakładka startowa ---------- */
.p-first {
  display: grid; gap: 10px; padding: 16px 18px; margin-bottom: 20px; border-radius: var(--radius); box-shadow: var(--card-shadow); background-color: var(--surface);
  border: 1px solid rgba(43, 111, 214, .4); background: linear-gradient(140deg, rgba(43, 111, 214, .12), transparent 65%);
}
.p-first b { font-family: var(--font-display); font-weight: 500; font-size: 18px; }
.p-first p { margin: 0; font-size: 14.5px; color: var(--muted); max-width: 640px; }
.p-first__acts { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.p-first__skip { border: 0; background: transparent; padding: 6px 2px; font-size: 13.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.p-first__skip:hover { color: var(--text); }

@media (max-width: 960px) {
  .p-toasts { right: 10px; left: 10px; bottom: 10px; width: auto; }
  .p-head--app { align-items: flex-start; }
}


/* ==========================================================
   ETAP 7a — telefon. Na wąskim ekranie portal był nieczytelny:
   moduły chowały się za hamburgerem, górny pasek był zestawem
   nieopisanych znaczków, samouczek pokazywał panel boczny,
   którego na telefonie nie widać, a dymki wypadały poza ekran.
   Poniżej wszystko, co dotyczy tylko wąskiego ekranu.
   ========================================================== */

/* ---------- Dolny pasek modułów: na telefonie to jest nawigacja ---------- */
.p-bottom { display: none; }

@media (max-width: 960px) {
  .p-bottom {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 68;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line-strong);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .p-bottom a, .p-bottom button {
    display: grid; justify-items: center; gap: 3px; padding: 9px 2px 8px;
    background: none; border: 0; color: var(--muted); font: inherit; font-size: 10.5px; line-height: 1.15; text-align: center;
  }
  .p-bottom a:hover, .p-bottom button:hover { text-decoration: none; }
  .p-bottom svg { width: 21px; height: 21px; display: block; }
  .p-bottom [aria-current="page"] { color: var(--fire); }
  .p-bottom__dot { position: relative; }
  .p-bottom__dot::after { content: ''; position: absolute; top: 6px; right: calc(50% - 14px); width: 6px; height: 6px; border-radius: 50%; background: var(--fire); }

  .p-content { padding: 16px 14px 96px; }

  /* ---------- Górny pasek: hamburger, tytuł, jeden opisany przycisk ---------- */
  .p-top { gap: 10px; padding: 9px 12px; }
  .p-top__where span { display: none; }
  .p-top__where b { font-size: 16px; }
  #pExplain, #pRules { display: none; }
  .p-top__btn--tutor { padding: 9px 13px; font-size: 13.5px; }
  .p-top__btn--tutor span { display: inline; }
  .p-top__toggle { width: 42px; height: 42px; }
  .p-me { padding: 4px; }
  .p-me__ava { width: 32px; height: 32px; }

  /* ---------- Nagłówek modułu ---------- */
  .p-head--app { gap: 12px; margin-bottom: 14px; }
  .p-head--app h1 { font-size: 25px; line-height: 1.2; }
  .p-head--app .p-sub { font-size: 15px; }
  .p-head__acts { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .p-head__acts .btn { justify-content: center; padding: 11px 10px; font-size: 13.5px; }
  .p-head__acts .btn--wide { grid-column: 1 / -1; }
  .p-head__acts.is-solo .btn { grid-column: 1 / -1; }
  .eyebrow { font-size: 10.5px; letter-spacing: .1em; }

  /* ---------- Pasek stanu: dwie kolumny, czytelne etykiety ---------- */
  .p-stats { gap: 8px; margin-bottom: 14px; }
  .p-stat { flex: 1 1 calc(50% - 4px); padding: 10px 11px; }
  .p-stat > span { font-size: 10px; letter-spacing: .06em; line-height: 1.3; }
  .p-stat b { font-size: 17px; }
  .p-stat small { font-size: 11px; }

  /* ---------- Znaczek „i”: palec, nie kursor ---------- */
  .p-i { width: 22px; height: 22px; font-size: 11.5px; margin-left: 7px; }

  /* ---------- Kafle modułów: zwarte, dwie kolumny ---------- */
  .p-tile { padding: 13px 14px; gap: 3px; }
  .p-tile b { font-size: 16.5px; }
  .p-tile__num { font-size: 20px; }
  .p-tile__num small { display: block; margin: 3px 0 0; font-size: 11px; }
  .p-tile__top span { font-size: 10px; }
  .p-tile p { font-size: 12.5px; }

  .p-box { padding: 15px 15px; }
  .p-box__head h2, .p-box__head h3 { font-size: 17.5px; }

  /* ---------- Dymek i samouczek jako arkusz od dołu ---------- */
  .p-pop, .p-tutor {
    left: 0 !important; right: 0; top: auto !important; bottom: 0;
    width: 100%; max-height: 76vh; overflow-y: auto;
    border-radius: 18px 18px 0 0; border-bottom: 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
    animation: sheetIn .26s cubic-bezier(.2, .9, .3, 1);
  }
  .p-pop { padding: 18px 18px calc(20px + env(safe-area-inset-bottom, 0)); z-index: 78; }
  .p-pop p { font-size: 15px; }
  .p-pop .p-pop__t { font-size: 17px; }
  .p-tutor { padding: 18px 18px calc(16px + env(safe-area-inset-bottom, 0)); }
  .p-tutor h3 { font-size: 20px; }
  .p-tutor p { font-size: 15px; }
  .p-tutor__foot { position: sticky; bottom: 0; background: var(--surface-2); padding-top: 10px; margin-top: 14px; }
  .p-tutor__foot .btn { padding: 11px 16px; font-size: 14px; }
  .p-tutor__dots { display: none; }
  @keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }

  /* Zasłona samouczka nie może chować dolnego paska pod arkuszem */
  .p-tutor-veil { z-index: 72; }
  .p-hl { z-index: 73 !important; }
  .p-tutor { z-index: 76; }

  /* ---------- Panel zasad ---------- */
  .p-drawer { width: 100%; }
  .p-drawer__body { padding: 16px 16px calc(40px + env(safe-area-inset-bottom, 0)); }
  .p-drawer__body p, .p-drawer__body li { font-size: 15.5px; }

  /* ---------- Powiadomienia nad dolnym paskiem ---------- */
  .p-toasts { right: 10px; left: 10px; bottom: calc(72px + env(safe-area-inset-bottom, 0)); width: auto; }

  /* ---------- Listy i wiersze ---------- */
  .p-row { grid-template-columns: 1fr; gap: 6px; }
  .p-row__r { text-align: left; max-width: none; white-space: normal; }
  .p-task { grid-template-columns: 22px 1fr; }
  .p-task__r { grid-column: 2; text-align: left; }
  .p-notif { grid-template-columns: 30px 1fr; }
  .p-notif__go { grid-column: 2; }
  .p-ladder__row { grid-template-columns: 78px 1fr; }
  .p-ladder__row b { grid-column: 2; text-align: right; }
  .p-eq { font-size: 13px; }
}

@media (max-width: 400px) {
  .p-top__btn--tutor span { display: none; }
}

/* Dymek wyjaśnienia: zamknięcie widoczne, nie tylko kliknięcie obok */
.p-pop { position: fixed; }
.p-pop__x {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px;
  border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--muted); font-size: 13px; line-height: 1;
}
.p-pop__x:hover { color: var(--accent); border-color: var(--accent); }
.p-pop .p-pop__t, .p-pop p:first-child { padding-right: 34px; }
@media (max-width: 960px) { .p-pop__x { top: 12px; right: 12px; width: 34px; height: 34px; font-size: 15px; } }

/* ==========================================================
   ETAP 8 — Patenty Infokratyczne (karta owocu) i moduł Hale.
   Karta patentu to szuflada z siedmioma zakładkami: przegląd
   plus sześć części patentu. Te same klasy w Drzewie Wiedzy,
   w Halach i w Zamówieniach.
   ========================================================== */
.pt-drawer .p-drawer__top b small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.pt-znak { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(245, 196, 81, .14); border: 1px solid rgba(245, 196, 81, .5); color: var(--gold); font-size: 15px; flex: none; }
.pt-lead { font-size: 15.5px; color: var(--text) !important; }
/* Patent przełożony: pochodzenie z naszego świata, nad opisem owocu. */
.pt-zrodlo { margin: 0 0 12px; padding: 11px 13px; border-radius: 12px; background: rgba(124, 58, 237, .09); border: 1px solid rgba(124, 58, 237, .38); border-left-width: 3px; }
.pt-zrodlo__k { display: inline-block; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: #a78bfa; padding: 2px 7px; border-radius: 999px; background: rgba(124, 58, 237, .16); margin-bottom: 6px; }
.pt-zrodlo p { margin: 0 !important; font-size: 14px; }
.pt-zrodlo p.small { margin-top: 4px !important; color: var(--muted) !important; font-size: 13px !important; }
.pt-kv { margin: 10px 0 16px; }
.pt-kv b.pt-kv__txt { font-family: var(--font-body); font-weight: 500; text-align: right; }
.pt-kv b small { font-family: var(--font-mono); font-size: 10.5px; color: var(--gold); margin-left: 6px; }
.pt-korzenie { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.pt-korzen { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px 6px 7px; border-radius: 999px; background: rgba(245, 196, 81, .1); border: 1px solid rgba(245, 196, 81, .45); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.pt-korzen i { font-style: normal; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); padding: 2px 6px; border-radius: 999px; background: rgba(245, 196, 81, .16); }
.pt-korzen:hover { border-color: var(--gold); }
.pt-korzen--owoc { background: rgba(255, 179, 71, .1); border-color: rgba(255, 179, 71, .45); }
.pt-korzen--owoc i { color: var(--fire); background: rgba(255, 179, 71, .16); }
.pt-ok { color: var(--good) !important; font-family: var(--font-mono); }
.pt-brak { color: var(--bad) !important; font-family: var(--font-mono); }
.pt-hist { display: grid; gap: 8px; margin: 8px 0 12px; }
.pt-hist__r { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: start; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.pt-hist__rok { font-family: var(--font-mono); font-size: 13px; color: var(--fire); padding-top: 2px; }
.pt-hist__r b { font-size: 14px; }
.pt-hist__r p { margin: 2px 0 0 !important; font-size: 13px !important; }
.pt-hist__u { font-family: var(--font-mono); font-weight: 500; color: var(--gold); font-size: 15px; }

/* Tryb „ustaw wartości sztucznie”: suwaki wyników i uczciwości widać dopiero po świadomym odsłonięciu */
body:not(.is-sztucznie) .tylko-sztucznie { display: none !important; }
body:not(.is-sztucznie) #fDomains input[type="range"], body:not(.is-sztucznie) #fESlider, body:not(.is-sztucznie) #wTree input[type="range"] { display: none; }
body:not(.is-sztucznie) #fSkills button { pointer-events: none; opacity: .55; }
body.is-sztucznie [data-sztucznie] { border-color: var(--bad); color: var(--bad); }
.p-sztucznie { padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--line-strong); font-size: 13px; color: var(--muted); margin: 0 0 12px; display: grid; gap: 8px; }
.p-sztucznie strong { color: var(--text); }

/* ==========================================================
   RYSUNEK PATENTU — schemat na ciemnym granacie, jak kalka
   techniczna. Kolory wpisane wprost, nie ze zmiennych skóry:
   rysunek ma wyglądać tak samo w jasnym portalu i w ciemnej
   bibliotece, bo to jeden i ten sam dokument.
   ========================================================== */
.pt-rys { margin: 12px 0 16px; }
.pt-rys__svg { display: block; width: 100%; height: auto; border-radius: 10px; background: #0e2748; }
.pt-rys figcaption { display: grid; gap: 5px; margin-top: 7px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.pt-rys figcaption > span:first-child { color: var(--text); }
.pt-rys__stopka { color: var(--muted); }
.pt-rys__nota { color: var(--muted); font-family: var(--font-mono); font-size: 11px; opacity: .85; }
.br-bg { fill: #0e2748; }
.br-g { fill: none; stroke: rgba(126, 200, 255, .085); stroke-width: .4; }
.br-ramka { fill: none; stroke: rgba(180, 220, 255, .38); stroke-width: .7; }
/* Wypełnienie i szrafura idą atrybutem fill z renderera; reguła `fill: none`
   w klasie nadpisywałaby ten atrybut i gasiła wszystkie wypełnienia. */
.br-o { stroke: #cfe6ff; stroke-width: 1; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
line.br-o, polyline.br-o { fill: none; }
.br-o.br--d { stroke-dasharray: 3 2.4; stroke-width: .8; }
.br-o.br--m { stroke: rgba(180, 220, 255, .3); }
.br-hx { stroke: rgba(126, 200, 255, .42); stroke-width: .6; }
.br-a { stroke: #7ec8ff; stroke-width: 1; fill: none; }
.br-ah { fill: #7ec8ff; }
.br-w { stroke: rgba(158, 208, 255, .75); stroke-width: .6; }
.br-l { stroke: rgba(158, 208, 255, .55); stroke-width: .5; }
.br-l__k { fill: #7ec8ff; }
.br-t { fill: #dbeaff; font-family: var(--font-mono); font-size: 7.4px; letter-spacing: .01em; }
.br-t--b { font-weight: 700; fill: #fff; }
.br-t--s { font-size: 6.4px; }
.br-t--m { fill: rgba(190, 220, 255, .62); }
.br-t--w { fill: #9ed0ff; font-size: 6.4px; }
.br-t--tyt { fill: #fff; font-size: 8px; letter-spacing: .05em; text-transform: uppercase; }
.br-n circle { fill: #f5c451; stroke: none; }
.br-n text { fill: #0e2748; font-family: var(--font-mono); font-size: 6.4px; font-weight: 700; }
@media (max-width: 560px) { .br-t { font-size: 8.2px; } .br-t--s, .br-t--w { font-size: 7.2px; } .br-t--tyt { font-size: 8.8px; } }

/* Kafelek owocu na listach */
.pt-tile { display: grid; gap: 5px; padding: 16px 18px; background: var(--surface); border: 1px solid rgba(245, 196, 81, .28); border-radius: var(--radius); color: var(--text); text-align: left; font: inherit; cursor: pointer; transition: border-color .2s, transform .15s; min-width: 0; align-content: start; }
.pt-tile:hover { border-color: var(--gold); transform: translateY(-2px); }
.pt-tile__top { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pt-tile__ico { color: var(--gold); font-size: 15px; letter-spacing: 0; }
.pt-tile > b { font-family: var(--font-display); font-weight: 500; font-size: 18px; line-height: 1.2; }
.pt-tile__num { font-family: var(--font-mono); font-size: 22px; color: var(--gold); line-height: 1; margin: 2px 0; }
.pt-tile__num small { font-size: 11.5px; color: var(--muted); margin-left: 6px; }
.pt-tile__korz { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.pt-tile__foot { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 4px; }
.pt-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; border: 1px solid rgba(245, 196, 81, .45); background: rgba(245, 196, 81, .1); color: var(--gold); font: inherit; font-size: 11.5px; cursor: pointer; white-space: nowrap; }
.pt-chip:hover { border-color: var(--gold); }
.pt-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ==========================================================
   ETAP 10 — kokpit: budżety poziomów i profil przez pryzmat sprawy.
   ========================================================== */
.k-konta { display: grid; gap: 10px; }
/* Wiersz konta: kto, saldo, trzy liczby, a pod spodem pasek spraw, które
   właśnie po to konto sięgają. Wcześniej sprawy stały w wąskiej czwartej
   kolumnie i łamały się w połowie słowa. */
.k-konto {
  display: grid; grid-template-columns: minmax(150px, 1fr) minmax(120px, auto) minmax(190px, auto);
  gap: 12px 20px; align-items: center;
  padding: 14px 16px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line);
  transition: border-color .15s;
}
.k-konto:hover { border-color: var(--line-strong); }
.k-konto__kto { display: grid; gap: 3px; min-width: 0; }
.k-konto__kto .p-lvl { justify-self: start; margin: 0 0 1px; }
.k-konto__kto b { font-size: 15.5px; line-height: 1.2; }
.k-konto__kto small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.k-konto__saldo { display: grid; gap: 3px; justify-items: end; text-align: right; }
.k-konto__saldo b { font-family: var(--font-mono); font-size: 20px; line-height: 1.05; color: var(--accent-2); white-space: nowrap; }
.k-konto__saldo small { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.k-konto__pasek { display: block; width: 100%; max-width: 130px; height: 4px; border-radius: 999px; background: rgba(24, 48, 92, .12); overflow: hidden; margin-top: 3px; }
.k-konto__pasek i { display: block; height: 100%; background: var(--bad); opacity: .65; }
.k-konto__kv { display: grid; grid-template-columns: auto auto; gap: 3px 14px; align-items: baseline; font-size: 12.5px; color: var(--muted); }
.k-konto__kv b { font-family: var(--font-mono); font-weight: 500; font-size: 13px; color: var(--text); text-align: right; white-space: nowrap; }
.k-konto__kv b.is-good { color: var(--good); } .k-konto__kv b.is-bad { color: var(--bad); }
.k-konto__kv b.is-free { color: var(--text); border-top: 1px solid var(--line); padding-top: 3px; }
.k-konto__kv span:last-of-type { padding-top: 3px; border-top: 1px solid transparent; }
/* Sprawy: pełna szerokość wiersza, pastylki w jednej linii każda. */
.k-konto__sprawy {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding-top: 11px; border-top: 1px dashed var(--line-strong);
}
.k-konto__spr-l { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.k-konto__pusto { font-size: 12.5px; color: var(--muted); }
.k-sprawa {
  display: inline-flex; align-items: baseline; gap: 7px; max-width: 100%;
  padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden;
  transition: border-color .15s, background .15s;
}
.k-sprawa:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.k-sprawa b { font-family: var(--font-mono); font-weight: 500; font-size: 12.5px; color: var(--accent-2); overflow: hidden; text-overflow: ellipsis; }
.k-sprawa i { font-style: normal; }
.k-sprawa i::before { content: '·'; margin-right: 8px; opacity: .6; }
.k-sprawa em { font-style: normal; font-family: var(--font-mono); color: var(--text); }
.k-sprawa em::before { content: '·'; margin-right: 8px; opacity: .6; color: var(--muted); }
@media (max-width: 900px) {
  .k-konto { grid-template-columns: 1fr auto; }
  .k-konto__kv { grid-column: 1 / -1; grid-template-columns: auto 1fr; justify-items: start; }
  .k-konto__kv b { text-align: left; }
  .k-sprawa i:last-of-type { display: none; }
}
.k-pryzmat { display: grid; gap: 4px; margin: -4px 0 12px; font-size: 12px; color: var(--muted); }
.k-pryzmat select { width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; font-size: 13.5px; color: var(--text); }
.k-waga { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid rgba(43, 111, 214, .3); margin-bottom: 10px; }
.k-waga b { font-family: var(--font-mono); font-size: 32px; line-height: 1; color: var(--accent-2); }
.k-waga span { font-size: 13.5px; line-height: 1.35; }
.k-waga small { color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) { .k-konto { grid-template-columns: 1fr auto; } .k-konto__kv, .k-konto__sprawy { grid-column: 1 / -1; } }

/* Drzwi „nb” (trzy wejścia na kokpicie) były stylowane tylko w room.css, więc w portalu stały gołe. */
.portal .nb { display: grid; gap: 4px; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); transition: border-color .15s, transform .15s; }
.portal .nb:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.portal .nb span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.portal .nb b { font-family: var(--font-display); font-weight: 500; font-size: 18px; line-height: 1.2; }
.portal .nb p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.k-konto__kv span { white-space: nowrap; }
.k-konto { grid-template-columns: minmax(140px, 1fr) auto minmax(210px, auto) minmax(170px, 1.2fr); }

/* Podświetlenie w rytm mowy: element, o którym lektor właśnie mówi.
   Złote, żeby nie mylić z niebieskim celem kroku (.p-hl). */
.p-hl-mowa { position: relative; z-index: 61 !important; box-shadow: 0 0 0 3px var(--gold), 0 0 0 9px rgba(168, 115, 10, .22) !important; border-radius: 10px; transition: box-shadow .25s ease; }
@media (max-width: 960px) { .p-hl-mowa { z-index: 73 !important; } }
.portal .p-tutor { font-family:Inter,system-ui,sans-serif; }
.portal .p-tutor { width:400px; max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); overflow:auto; border:1px solid #d8e3f3; border-radius:20px; padding:0; background:#fff; box-shadow:0 24px 72px #0d234538,0 4px 12px #0d234514; animation:none; }
.p-tutor h3 { font-size:19px; line-height:1.3; }
.p-tutor p { font-size:14px; line-height:1.65; }
.p-tutor__k { font-size:10px!important; }
.p-tutor__foot { flex-wrap:wrap; }
.p-tutor__dots { display:none; }
.p-tutor__close { min-height:36px; }
.p-guide-top { display:flex; align-items:center; gap:11px; padding:20px 22px 17px; background:linear-gradient(120deg,#f0f5ff,#fbfcff); }
.p-guide-icon { display:grid; place-items:center; width:40px; height:40px; border:1px solid #d4e2fc; border-radius:12px; background:#fff; color:#245ec7; box-shadow:0 2px 4px #245ec708; }
.p-guide-icon svg { width:25px; height:25px; }
.p-guide-label { display:block; font-size:10px; line-height:1.5; text-transform:uppercase; letter-spacing:.13em; color:#5c6e89; font-weight:600; }
.p-guide-module { display:block; font-size:13px; font-weight:600; color:#253c5c; margin-top:2px; }
.p-guide-close { display:grid; place-items:center; width:36px; height:36px; margin-left:auto; flex:none; border:1px solid transparent; background:transparent; border-radius:10px; color:#60718a; font-size:25px; line-height:1; cursor:pointer; }
.p-guide-close:hover { background:#e6eefb; border-color:#d4e0f3; color:#183d76; }
.p-guide-progress { display:flex; gap:5px; padding:0 22px; background:linear-gradient(#f7faff,#fff); }
.p-guide-progress span { flex:1; height:4px; border-radius:8px; background:#e7edf5; }
.p-guide-progress .is-complete { background:#9ab9eb; }
.p-guide-progress .is-current { background:#245ec7; }
.p-guide-body { padding:22px 24px 8px; }
.p-guide-step { display:block; margin-bottom:10px; color:#245ec7; font-size:11px; font-weight:650; letter-spacing:.04em; font-variant-numeric:tabular-nums; }
.p-guide-step span { color:#8995a7; font-weight:400; }
.portal .p-guide-body h3 { margin:0 0 12px; font-size:23px; letter-spacing:-.035em; line-height:1.25; font-weight:650; color:#182b48; }
.portal .p-guide-body p { margin:0 0 12px; font-size:14px; line-height:1.75; color:#52627b; }
.portal .p-guide-footer { display:flex; justify-content:space-between; flex-wrap:nowrap; padding:16px 24px 20px; margin:0; background:#fff; border-top:1px solid #edf1f7; }
.portal .p-guide-footer .btn { display:flex; align-items:center; justify-content:center; gap:12px; min-width:108px; min-height:42px; border-radius:10px; font-size:13px; font-weight:600; }
.portal .p-guide-footer .btn--ghost { border-color:transparent; background:transparent; color:#52627b; }
.portal .p-guide-footer .btn--ghost:hover:not(:disabled) { background:#f1f5fb; }
.portal .p-guide-footer .btn:disabled { opacity:.35; cursor:default; }
.portal .p-guide-footer .btn--primary { background:linear-gradient(135deg,#326ed7,#2455b7); box-shadow:0 3px 8px #245ec724; }
.p-guide-controls { display:flex; align-items:center; gap:5px; margin-left:auto; flex:none; }
.p-guide-top>div:not(.p-guide-controls) { min-width:0; }
.p-guide-audio { display:flex; padding:0; }
.p-guide-audio .p-audio-grupa { position:static; display:flex; gap:8px; }
.p-guide-audio .p-audio--toggle { display:grid; place-items:center; width:36px; height:36px; border-radius:10px; border:1px solid #d7e3f6; background:#fff; color:#6b7d97; padding:0; }
.p-guide-audio .p-audio svg { width:18px; height:18px; flex:none; }
.p-guide-audio .p-audio:hover { background:#e9f0fc; border-color:#b6ccee; }
.p-guide-audio .p-audio[data-stan=pauza] { background:#245ec7; border-color:#245ec7; color:#fff; box-shadow:0 2px 6px #245ec72a; }
.p-guide-audio .p-audio[data-stan=blad] { color:#62718a; border-color:#dce3ed; background:#f5f7fa; }
.p-guide-audio .p-audio__tempo { min-width:44px; border-radius:10px; font-size:12px; }
.portal .p-tutor-veil { background:rgba(17,32,55,.36); }
.portal .p-hl { box-shadow:0 0 0 2px #3773d5,0 0 0 7px #8eb6fa44!important; }
@media(max-width:600px) { .p-guide-top { padding:14px 18px 13px; } .p-guide-progress { padding:0 18px; } .p-guide-body { padding:16px 20px 4px; } .portal .p-guide-body h3 { font-size:21px; margin-bottom:9px; } .portal .p-guide-body p { font-size:13px; line-height:1.65; } .portal .p-guide-footer { padding:12px 18px 14px; } .p-guide-icon { width:34px; height:34px; border-radius:10px; } }
.portal .p-guide-body h3 { font-family:Inter,system-ui,sans-serif; }
