/*
  System wizualny First Light
  Układ i gęstość: Spotify (trzy panele na Macu, treść i zdjęcia artykułów na pierwszym planie).
  Szkło: przybliżenie Apple Liquid Glass na webie (Safari nie wspiera refrakcji SVG w backdrop-filter,
  więc soczewkę udajemy odblaskiem krawędzi i lekkim rozjaśnieniem).
  Czcionka: SF Pro z systemu (-apple-system), rozmiary wg Apple HIG.
  Kolor: czerń u góry, fiolet od dołu.
  Promienie: kapsuły = przyciski, filtry, paski; 6-10px = miniatury; 14px = panele; 20px = duże karty.
*/
:root {
  --bg: #0B0913;
  --panel: #15111F;
  --accent: #BBA8FF;
  --accent-fill: #A68FFF;
  --on-accent: #170F2E;
  --text: #F4F1FB;
  --text-2: #B7B0CB;
  --text-3: #938CAA;
  --start: #86D9A9;
  --later: #E8BC7A;
  --wash: rgba(120, 92, 235, .5);

  --r-pill: 999px;
  --r-panel: 14px;
  --r-card: 20px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, sans-serif;

  --large-title: 700 34px/1.2 var(--font);
  --title-2: 700 22px/1.27 var(--font);
  --headline: 600 17px/1.3 var(--font);
  --subhead: 400 15px/1.33 var(--font);
  --footnote: 400 13px/1.38 var(--font);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  font: var(--subhead); color: var(--text); background: var(--bg);
  min-height: 100dvh; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
/* Fioletowe światło od dołu ekranu */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(70vw 45vh at 20% 105%, rgba(150, 115, 255, .30), transparent 70%),
    radial-gradient(50vw 40vh at 90% 100%, rgba(170, 110, 220, .16), transparent 70%);
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
i.ph, i.ph-fill, i.ph-bold, i.ph-duotone { font-size: 22px; line-height: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/*
  Liquid Glass (przybliżenie). Na wzór Centrum sterowania w iOS 26:
  prawie przejrzysty środek, gruba jasna krawędź jak szlif soczewki (światło z lewej-góry i prawej-dołu),
  miękka poświata wewnątrz krawędzi. Bez refrakcji SVG, bo Safari jej nie renderuje.
*/
.glass {
  position: relative; isolation: isolate;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0) 60%);
  -webkit-backdrop-filter: blur(2px) saturate(170%) brightness(1.06);
  backdrop-filter: blur(2px) saturate(170%) brightness(1.06);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.10),
    inset 2px 2.5px 1.5px -1.5px rgba(255,255,255,.9),
    inset -2px -2.5px 1.5px -1.5px rgba(255,255,255,.6),
    inset 0 0 18px 0 rgba(255,255,255,.10),
    0 6px 18px rgba(6, 3, 16, .25);
}
/* Szlif krawędzi: jaśniejszy rąbek, grubszy na rogach, na które pada światło */
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,.15) 28%, rgba(255,255,255,0) 50%, rgba(255,255,255,.12) 72%, rgba(255,255,255,.7));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
/* Wciśnięty przycisk i sekcja, w której jesteś: jeden równy, nasycony fiolet (bez jaśniejszej strony),
   półprzezroczysty, z równą krawędzią dookoła i mocną poświatą. */
.glass.tint, .chip[aria-pressed="true"], .glass[aria-pressed="true"], .glass[aria-current] {
  background: rgba(132, 88, 255, .7);
  color: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(205, 185, 255, .45),
    0 0 6px rgba(150, 105, 255, .75),
    0 0 24px rgba(132, 88, 255, .55);
}
.glass.tint::after, .chip[aria-pressed="true"]::after, .glass[aria-pressed="true"]::after, .glass[aria-current]::after { display: none; }
/* Najechanie na szklany przycisk: delikatne fioletowe zabarwienie */
@media (hover: hover) and (pointer: fine) {
  a.glass:hover:not([aria-current]), button.glass:hover:not([aria-pressed="true"]), label.glass:hover {
    background: linear-gradient(180deg, rgba(185, 160, 255, .24), rgba(130, 100, 240, .14));
  }
}
/* Szkło na zdjęciach: lekko przyciemnione i z cieniem pod tekstem, żeby było czytelne na jasnym niebie */
.glass.on-photo { background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.02)), rgba(14, 10, 28, .26); text-shadow: 0 1px 3px rgba(0,0,0,.7), 0 0 10px rgba(0,0,0,.35); }
@media (prefers-reduced-transparency: reduce) {
  .glass, .glass.on-photo { background: #2A2340; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.press { transition: transform 160ms var(--ease-out), background-color 160ms ease; }
.press:active { transform: scale(.97); }

/* Miniatura: zdjęcie artykułu albo kafelek obszaru (kolory przychodzą z data.js jako --bg-t i --ink) */
.art {
  --bg-t: #2A2340; --ink: #BBA8FF;
  position: relative; flex: none; overflow: hidden; display: grid; place-items: center;
  border-radius: 8px; background: linear-gradient(170deg, color-mix(in srgb, var(--bg-t) 88%, #fff), var(--bg-t));
}
.art > i.ph { color: var(--ink); }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Kafelek obszaru jak systemowe kafelki Spotify („Twoje odcinki”):
   głębokie tło i duża wypełniona ikona w jasnym odcieniu tego samego koloru */
.art.area, .art.sys { container-type: size; }
.art i.glyph { font-size: 50cqw; color: var(--ink); }
/* Kafelki systemowe: Zapisane (jak „Polubione utwory”) i Raporty (jak „Twoje odcinki”) */
.art.sys-saved { background: linear-gradient(135deg, #4A1FD8, #9C86FF 55%, #D9F0E6); --ink: #fff; }
.art.sys-reports { background: #173F3A; --ink: #4BE3A8; }
.art.sys i.glyph { font-size: 42cqw; }

/* Mac: pasek u góry + trzy panele */
.app {
  display: grid; height: 100dvh; padding: 0 8px 8px; gap: 8px;
  grid-template-columns: 300px minmax(0, 1fr) 360px; grid-template-rows: 64px minmax(0, 1fr);
}
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none; display: block;
}
.top-center { flex: 1; display: flex; justify-content: center; gap: 8px; }
/* Wstecz / Dalej jak w Spotify; wyszarzone, gdy nie ma dokąd iść */
.nav-arrows { display: flex; gap: 8px; margin-left: 24px; }
.nav-arrows .circle i { font-size: 18px; }
.nav-arrows button:disabled { opacity: .35; cursor: default; pointer-events: none; }
.tylko-tel { display: none; }
.circle { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.circle i { font-size: 20px; }
.search { width: min(480px, 100%); height: 44px; border-radius: var(--r-pill); display: flex; align-items: center; gap: 10px; padding: 0 16px; color: var(--text-2); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font: var(--subhead); color: var(--text); }
.search input::placeholder { color: var(--text-2); }
.search:focus-within { box-shadow: inset 0 1px 1px rgba(255,255,255,.3), 0 0 0 2px var(--accent); }

.panel { background: var(--panel); border-radius: var(--r-panel); overflow: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }

/* Lewy panel: biblioteka */
.library { padding: 18px 10px 10px; }
.library h2 { font: var(--headline); padding: 0 10px 12px; }
.lib-list { list-style: none; }
.lib-row { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 8px; }
.lib-row .art { width: 52px; height: 52px; border-radius: 6px; }
.lib-row b { display: block; font-size: 15px; font-weight: 600; }
.lib-row b + span { font-size: 13px; color: var(--text-2); }
.lib-row[aria-current] { background: rgba(255,255,255,.08); }
.lib-row[aria-current] b { color: var(--accent); }
.pin { font-size: 12px !important; color: var(--accent); margin-right: 5px; vertical-align: -1px; }

/* Środkowy panel: czarny u góry, fiolet od dołu (tło nie przewija się z treścią) */
.panel.main { background: linear-gradient(to top, var(--wash), transparent 62%), var(--panel); }
.content { position: relative; padding: 20px 28px 48px; }
.greeting { display: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 16px; margin: -16px; }
.chips::-webkit-scrollbar { display: none; }
.content > .chips { padding-bottom: 34px; }
.chip { flex: none; padding: 7px 15px; border-radius: var(--r-pill); font-size: 14px; font-weight: 500; }
.chip[aria-pressed="true"] { font-weight: 600; }

/* Karty z akcjami: cały kafelek klika się przez rozciągnięty link, przyciski leżą nad nim */
.card { position: relative; }
.stretch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.stretch:focus-visible { outline: none; }
.card:has(.stretch:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.save, .fab, .icon-btn, .nr-open { z-index: 2; }

/* Przyciski pokazujące się po najechaniu (Spotify), wjeżdżają lekko od dołu */
.hov { opacity: 0; transform: translateY(6px); transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), background-color 160ms ease, scale 160ms var(--ease-out); }
.hov[aria-pressed="true"] { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) {
  .card:hover .hov, .card:focus-within .hov { opacity: 1; transform: none; }
}
@media (hover: none) { .hov:not([aria-pressed="true"]) { display: none; } }

/* Otwórz artykuł: szkło jak przycisk zapisu w drugim rogu, bez pełnego fioletowego koła */
.fab { position: absolute; right: 8px; bottom: 8px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.fab i { font-size: 18px; }
.fab.pill { width: auto; display: flex; gap: 8px; padding: 0 16px; border-radius: var(--r-pill); font: 600 14px/1 var(--font); }
.mini { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
.mini i { font-size: 17px; }
.icon-btn { position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.icon-btn i { font-size: 19px; }
.save[aria-pressed="true"]:not(.glass) { color: var(--accent); }

/* Skróty do obszarów */
.shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 36px; }
.shortcut { display: flex; align-items: center; gap: 12px; height: 56px; padding-right: 12px; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.08); font: 700 14px/1.2 var(--font); }
.shortcut .art { width: 56px; height: 56px; border-radius: 0; }
.sc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shortcut .new { flex: none; margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); display: grid; place-items: center; background: var(--accent-fill); color: var(--on-accent); font-size: 12px; font-weight: 700; transition: opacity 150ms ease; }
/* Po najechaniu: fioletowe zabarwienie i cienka strzałka obok liczby (liczba zostaje widoczna) */
.shortcut .sc-name { margin-right: auto; }
.shortcut .sc-caret { flex: none; margin-left: -6px; font-size: 15px; color: var(--text); opacity: 0; transform: translateX(-6px); transition: opacity 160ms ease, transform 220ms cubic-bezier(.23, 1, .32, 1); }
.shortcut { transition: background-color 160ms ease; }

section { margin-bottom: 36px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.sec-head small { display: block; font: var(--footnote); color: var(--text-2); margin-bottom: 2px; }
.sec-head h2 { font: var(--title-2); letter-spacing: -.01em; }
/* Nagłówek zwijanych kafelków obszarów: klik rozwija i zwija, strzałka się obraca */
.sec-toggle { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 28px; padding: 4px 0; background: none; border: 0; color: var(--text); text-align: left; cursor: pointer; }
.sec-toggle h2 { font: var(--title-2); letter-spacing: -.01em; }
.sec-toggle span { font: var(--footnote); color: var(--text-2); }
.sec-toggle i { margin-left: auto; font-size: 20px; color: var(--text-2); transition: transform 220ms cubic-bezier(.23, 1, .32, 1); }
.sec-toggle[aria-expanded="true"] { margin-bottom: 14px; }
.sec-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
@media (hover: hover) { .sec-toggle:hover i, .sec-toggle:hover span { color: var(--accent); } }
.sec-head a { font: 700 13.5px/1 var(--font); color: var(--text-2); white-space: nowrap; }

/* Duża karta: widoczna, gdy nie ma prawego panelu */
.hero { display: block; border-radius: var(--r-card); overflow: hidden; aspect-ratio: 21 / 9; margin-bottom: 36px; box-shadow: 0 18px 50px rgba(6,3,16,.55); }
.hero > .art { position: absolute; inset: 0; border-radius: 0; }
.hero > .art > i.ph { font-size: 64px; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(10,7,20,0) 35%, rgba(10,7,20,.88)); }
.hero-body { position: absolute; z-index: 1; left: 22px; right: 22px; bottom: 20px; }
.hero .score-chip { position: absolute; z-index: 2; top: 14px; right: 14px; }
.hero .mini { top: 14px; right: auto; left: 14px; }
.hero .fab { right: 18px; bottom: 18px; height: 40px; }
.hero h3 { font: 700 24px/1.2 var(--font); letter-spacing: -.015em; max-width: 32ch; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tag { padding: 5px 12px; border-radius: var(--r-pill); font: 600 12.5px/1.2 var(--font); }
.score-chip { padding: 6px 12px; border-radius: var(--r-pill); font: 700 15px/1 var(--font); font-variant-numeric: tabular-nums; }

/* Rząd kart ze zdjęciami */
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: 200px; gap: 12px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; padding: 10px; margin: -10px; }
.shelf::-webkit-scrollbar { display: none; }
.feature { scroll-snap-align: start; padding: 10px; border-radius: 10px; }
.feature .art { width: 100%; aspect-ratio: 1; border-radius: 8px; box-shadow: 0 10px 28px rgba(6,3,16,.5); }
.feature .art > i.ph { font-size: 48px; }
.feature .score-chip { position: absolute; left: 8px; bottom: 8px; font-size: 13px; padding: 5px 10px; }
.feature h3 { font: 600 15.5px/1.3 var(--font); margin: 10px 0 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feature p { font: var(--footnote); color: var(--text-2); }

/* Lista sygnałów */
.rows { list-style: none; }
.row { display: flex; align-items: center; gap: 14px; padding: 8px; margin: 0 -8px; border-radius: 10px; }
.row .art { width: 56px; height: 56px; }
.row-body { min-width: 0; flex: 1; }
.row h3 { font: 600 15.5px/1.3 var(--font); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-actions { display: flex; gap: 2px; }
.meta { display: flex; flex-wrap: wrap; gap: 0 12px; margin-top: 3px; font: var(--footnote); color: var(--text-3); }
.start { color: var(--start); }
.mikro { color: #7DD3FC; }
/* Pomysł bez budżetu: trzecie okno pod Dlaczego to szansa */
.idea { border-radius: 14px; padding: 18px; margin-top: 8px; background: rgba(125, 211, 252, .1); box-shadow: inset 0 0 0 1px rgba(125, 211, 252, .25); }
.idea h3 { display: flex; align-items: center; gap: 8px; font: var(--headline); color: #7DD3FC; margin-bottom: 8px; }
.idea p { font: 600 16px/1.4 var(--font); }
.later { color: var(--later); }
.score { flex: none; width: 40px; text-align: right; font: 700 17px/1 var(--font); color: var(--accent); font-variant-numeric: tabular-nums; }

/* Tabela sygnałów na podstronach (jak lista utworów) */
.trk-head, .trk { display: grid; grid-template-columns: 28px minmax(0, 1fr) 64px 140px 56px 36px 40px; align-items: center; gap: 14px; padding: 6px 12px; }
.trk-head { font: 500 12.5px/1 var(--font); color: var(--text-2); padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.1); }
.trk-head .r { text-align: right; }
.tracks { list-style: none; }
.trk { border-radius: 8px; }
.trk .nr { position: relative; display: grid; place-items: center; height: 36px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.trk .nr-open { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; color: var(--text); }
.trk .nr-open i { font-size: 17px; }
.trk .t { display: flex; align-items: center; gap: 12px; min-width: 0; }
.trk .art { width: 44px; height: 44px; border-radius: 6px; }
.trk .art > i.ph { font-size: 18px; }
.t-body { min-width: 0; }
.trk h3 { font: 600 15px/1.3 var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trk .c { font: var(--footnote); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Zaznaczenie ma sens tylko obok prawego panelu ze szczegółami */
@media (min-width: 1201px) {
  [aria-selected="true"] { background: rgba(255,255,255,.10); }
  [aria-selected="true"] h3 { color: var(--accent); }
}

/* Nagłówki podstron (jak strona playlisty) */
.page-head { display: flex; align-items: flex-end; gap: 24px; padding: 20px 0 24px; }
.page-head > .art, .page-head > .mosaic { width: 200px; height: 200px; border-radius: 10px; box-shadow: 0 16px 48px rgba(0,0,0,.5); }
.page-head small { font: 600 13px/1 var(--font); }
.page-head h1 { font: 800 clamp(28px, 8cqi, 64px)/1.05 var(--font); letter-spacing: -.03em; margin: 8px 0 12px; overflow-wrap: anywhere; }
.page-head p { color: var(--text-2); }
.page-head p b { color: var(--text); }
.page-title { padding: 8px 0 22px; }
.page-title h1 { font: var(--large-title); letter-spacing: -.01em; }
.page-title p { color: var(--text-2); margin-top: 6px; }
.actions-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.fab-lg { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-fill); color: var(--on-accent); box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.fab-lg[aria-pressed="true"] { background: var(--text); }
.hint { color: var(--text-2); font: var(--footnote); }
.track-pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.track-pills li { padding: 8px 14px; border-radius: var(--r-pill); font-size: 14px; }
.track-pills.muted li { color: var(--text-3); background: rgba(255,255,255,.04); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.25); }
.sub-h { font: var(--headline); margin: 18px 0 10px; }

/* Przeglądaj obszary (jak kafelki kategorii w wyszukiwarce Spotify) */
.browse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.browse { position: relative; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 10px; padding: 16px; background: color-mix(in srgb, var(--bg-t) 72%, var(--ink)); }
.browse h3 { position: relative; z-index: 1; font: 700 20px/1.2 var(--font); max-width: 70%; hyphens: auto; overflow-wrap: anywhere; }
.browse-sub { position: relative; z-index: 1; font: var(--footnote); color: rgba(255,255,255,.78); }
.browse .art { position: absolute; width: 44%; aspect-ratio: 1; right: -6%; bottom: -8%; transform: rotate(25deg); box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.type-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 14px; }
.type-card i { font-size: 28px; color: var(--accent); margin-bottom: 8px; }
.type-card b { font: var(--headline); }
.type-card span { font: var(--footnote); color: var(--text-2); }
.content > .search { width: 100%; margin-bottom: 26px; }

/* Raporty: kolaż 2x2 ze zdjęć artykułów */
.mosaic { display: grid; grid-template-columns: 1fr 1fr; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #2A2340; box-shadow: 0 10px 28px rgba(6,3,16,.5); }
.mosaic img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.report { padding: 10px; border-radius: 10px; }
.report h3 { font: 600 15.5px/1.3 var(--font); margin-top: 10px; }
.report p { font: var(--footnote); color: var(--text-2); }
.note { color: var(--text-3); font: var(--footnote); margin-top: 18px; }

/* Puste stany */
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 56px 16px; }
.empty > i { font-size: 44px; color: var(--text-3); }
.empty h2 { font: var(--title-2); }
.empty p { color: var(--text-2); max-width: 40ch; }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: var(--r-pill); background: var(--text); color: #120E1C; font: 700 14.5px/1 var(--font); margin-top: 8px; }

/* Szczegóły sygnału: prawy panel na Macu, osobna strona na telefonie */
.detail, .sig-page { position: relative; --fade: var(--panel); }
.detail-photo { position: relative; aspect-ratio: 4 / 5; }
.detail-photo > .art { position: absolute; inset: 0; border-radius: 0; }
.detail-photo > .art > i.ph { font-size: 80px; }
.detail-photo::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(21,17,31,.55), rgba(21,17,31,0) 22%, rgba(21,17,31,0) 55%, var(--fade)); }
.detail-top { position: absolute; z-index: 1; top: 18px; left: 20px; right: 20px; font: var(--headline); }
.open-btn { position: absolute; z-index: 1; left: 20px; bottom: 112px; display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--r-pill); font: 600 14px/1 var(--font); }
.detail-body { position: relative; z-index: 1; margin-top: -96px; padding: 0 20px 24px; }
.detail-title { display: flex; align-items: flex-start; gap: 12px; }
.detail-title h2 { flex: 1; font: 700 23px/1.22 var(--font); letter-spacing: -.015em; }
.detail-title .score { font-size: 24px; width: auto; }
.detail-org { font: var(--footnote); color: var(--text-3, var(--text-2)); opacity: .8; margin: -8px 0 14px; }
.detail-src { font: var(--subhead); color: var(--text-2); margin: 6px 0 14px; }
.detail-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.save-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--r-pill); font: 600 14px/1 var(--font); }
.save-pill i { font-size: 17px; }
/* Co się stało: same fakty, spokojna szara karta przed fioletową kartą "Dlaczego to szansa" */
.what { border-radius: 14px; padding: 18px; background: rgba(255,255,255,.06); margin-top: 18px; }
.what h3 { display: flex; align-items: center; gap: 8px; font: var(--headline); margin-bottom: 10px; color: var(--text-2); }
.what h3 i { font-size: 18px; }
.what ul { display: grid; gap: 8px; padding-left: 18px; }
.what li { font: var(--subhead); font-size: 15.5px; line-height: 1.45; color: var(--text); }
.what li::marker { color: var(--accent); }
.what p { font: var(--subhead); font-size: 15.5px; line-height: 1.45; }
.why { border-radius: 14px; padding: 18px; background: linear-gradient(160deg, #6E55E0, #3F2C99); margin-top: 18px; }
.why h3 { font: var(--headline); margin-bottom: 8px; }
.why p { font: 600 19px/1.35 var(--font); letter-spacing: -.01em; color: #fff; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.fact { border-radius: 14px; padding: 14px; background: rgba(255,255,255,.06); }
.fact span { display: block; font: var(--footnote); color: var(--text-2); }
.fact b { font: var(--headline); font-size: 15.5px; }
.back-row { margin-bottom: 14px; }
.sig-page { max-width: 640px; }
.sig-page .detail-photo { border-radius: 18px; overflow: hidden; aspect-ratio: 4 / 3; }
.sig-page .detail-body { padding: 0 4px; }
.sig-page .detail-body { margin-top: 16px; }
.sig-page .open-btn { bottom: 16px; left: 16px; }
.sig-page .detail-top { top: 16px; left: 16px; }
.sig-page .detail-photo::after { background: linear-gradient(180deg, rgba(11,9,19,.55), rgba(11,9,19,0) 30%, rgba(11,9,19,0) 60%, rgba(11,9,19,.6)); }

/* Komunikat po zapisaniu (wjeżdża od dołu, znika szybciej niż wjeżdża) */
.toast {
  position: fixed; z-index: 30; left: 50%; bottom: 28px; padding: 11px 18px; border-radius: var(--r-pill);
  font: 600 14px/1 var(--font); opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out); }

@media (hover: hover) and (pointer: fine) {
  .lib-row:hover, .row:hover, .feature:hover, .trk:hover, .report:hover { background: rgba(255,255,255,.07); }
  .shortcut:hover { background: rgba(132, 88, 255, .2); }
  .shortcut:hover .sc-caret { opacity: 1; transform: none; margin-left: 0; }
  .trk:hover .nr .num { opacity: 0; }
  .trk:hover .nr-open, .trk:focus-within .nr-open { opacity: 1; }
  .icon-btn:hover { color: var(--text); background: rgba(255,255,255,.08); }
  .fab:hover, .fab-lg:hover { scale: 1.06; }
  .browse:hover .art { transform: rotate(20deg) scale(1.04); }
  .sec-head a:hover { color: var(--text); text-decoration: underline; }
}
@media (hover: none) { .nr-open { display: none; } }
.browse .art { transition: transform 300ms var(--ease-out); }

.tabbar-wrap { display: none; }

/* Węższy Mac: bez prawego panelu, sygnał dnia jako duża karta */
@media (max-width: 1200px) {
  .app { grid-template-columns: 280px minmax(0, 1fr); }
  .detail { display: none; }
  .trk-head, .trk { grid-template-columns: 28px minmax(0, 1fr) 56px 36px 40px; }
  .trk .wide, .trk-head .wide { display: none; }
}
@media (min-width: 1201px) { .hero { display: none; } }

/* iPhone */
@media (max-width: 760px) {
  .tylko-tel { display: block; }
  .app { display: block; height: auto; padding: 0; }
  .topbar, .library { display: none; }
  .panel, .panel.main { overflow: visible; background: none; border-radius: 0; }
  .content { padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 120px); }
  .brief-head { flex-wrap: wrap; }
  .brief-head span { flex-basis: 100%; }
  .greeting { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
  .greeting h1 { font: var(--large-title); font-size: 30px; letter-spacing: -.01em; margin-right: auto; }
  .greeting .circle { width: 40px; height: 40px; }
  .hero { aspect-ratio: 4 / 3; margin-bottom: 30px; }
  .hero h3 { font-size: 22px; }
  .shortcuts { margin-bottom: 30px; }
  .shortcut { height: 48px; font-size: 13px; gap: 8px; padding-right: 8px; }
  .shortcut .art { width: 42px; height: 48px; }
  .shelf { grid-auto-columns: 160px; margin-right: -16px; padding-right: 26px; }
  .sec-head h2 { font-size: 20px; }
  .page-head { flex-direction: column; align-items: center; text-align: center; padding-top: 8px; }
  .page-head > .art, .page-head > .mosaic { width: 180px; height: 180px; }
  .page-head h1 { font-size: 32px; }
  .actions-bar { justify-content: center; }
  .trk-head { display: none; }
  .trk { grid-template-columns: minmax(0, 1fr) 36px 40px; padding: 6px 0; gap: 10px; }
  .trk .nr, .trk .c { display: none; }
  .browse-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .browse h3 { font-size: 16px; }
  .sig-page { --fade: var(--bg); }
  .sig-page .detail-photo { aspect-ratio: 4 / 3; }
  body::after {
    content: ""; position: fixed; z-index: 50; inset: 0 0 auto; height: env(safe-area-inset-top); pointer-events: none;
    background: rgba(11, 9, 19, .72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
  .toast { bottom: calc(env(safe-area-inset-bottom) + 96px); }

  /* Pływający pasek zakładek + osobny okrągły przycisk szukania (iOS 26) */
  .tabbar-wrap { display: flex; gap: 10px; align-items: center; position: fixed; z-index: 10; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 12px); }
  .tabbar-wrap::before { content: ""; position: fixed; inset: auto 0 0; height: 130px; z-index: -1; pointer-events: none; background: linear-gradient(180deg, rgba(11,9,19,0), rgba(20,14,40,.85) 65%); }
  .tabbar { flex: 1; display: flex; padding: 5px; border-radius: var(--r-pill); }
  .tabbar a { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border-radius: var(--r-pill); font: 600 10.5px/1.1 var(--font); color: var(--text-2); }
  .tabbar a[aria-current] {
    color: #fff; background: rgba(132, 88, 255, .7);
    box-shadow: inset 0 0 0 1px rgba(205, 185, 255, .45), 0 0 16px rgba(132, 88, 255, .5);
  }
  .search-fab { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; flex: none; }
  .search-fab i { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .press, .hov, .browse .art { transition: opacity 160ms ease, background-color 160ms ease; }
  .press:active { transform: none; }
  .hov { transform: none; }
}

/* Na Macu szuka się górnym polem, więc pole na stronie Szukaj jest tylko na telefonie */
@media (min-width: 761px) { .content > .search { display: none; } }

/* Tempo obszaru (jak status w Exploding Topics): ikona + słowo, nie sam kolor */
.ped { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: var(--r-pill); background: rgba(255,255,255,.06); font: 600 12.5px/1 var(--font); }
.ped i { font-size: 13px; }
.ped.up, .ped-mini.up { color: var(--start); }
.ped.flat, .ped-mini.flat { color: var(--text-2); }
.ped.down, .ped-mini.down { color: var(--later); }
.ped.on-tile { position: relative; z-index: 1; margin-top: 10px; background: rgba(0,0,0,.28); color: #fff; }
.ped-mini { font-weight: 600; }
.ped-mini i { font-size: 12px; margin-right: 3px; vertical-align: -1px; }
.head-ped { margin-top: 10px; }
.spark { flex: none; vertical-align: middle; }

/* Wykres tygodni: cienkie słupki zaokrąglone u góry, podpowiedź po najechaniu */
.weeks { margin: 0; }
.wk-plot { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); align-items: end; height: 140px; border-bottom: 1px solid rgba(255,255,255,.12); }
.wk { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; border-radius: 6px 6px 0 0; }
.wk .bar { width: min(28px, 56%); border-radius: 4px 4px 0 0; }
.wk .bar.zero { opacity: .35; }
.wk .tip {
  position: absolute; z-index: 3; left: 50%; top: 0; transform: translate(-50%, calc(-100% - 6px));
  padding: 6px 10px; border-radius: 8px; background: #2A2340; box-shadow: 0 8px 20px rgba(0,0,0,.45);
  font: 600 12.5px/1 var(--font); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 120ms ease;
}
.wk:hover, .wk:focus-visible { background: rgba(255,255,255,.05); outline: none; }
.wk:hover .tip, .wk:focus-visible .tip { opacity: 1; }
.wk-axis { display: grid; grid-template-columns: repeat(8, 1fr); margin-top: 6px; text-align: center; font: var(--footnote); color: var(--text-3); }
.weeks figcaption { margin-top: 8px; font: var(--footnote); color: var(--text-3); }

/* Przegląd tygodnia (jak AI Overview w Feedly) */
.brief { border-radius: 16px; padding: 16px 18px; margin-bottom: 26px; }
.brief-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.brief-head i { font-size: 18px; color: var(--accent); }
.brief-head b { font: var(--headline); }
.brief-head span { margin-left: auto; font: var(--footnote); color: var(--text-2); }
.brief ul { list-style: none; display: grid; gap: 10px; }
.brief li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 14.5px; }
.brief-k { flex: none; width: 140px; font: var(--footnote); color: var(--text-2); }
.brief a { font-weight: 600; }

/* Źródła (jak w Particle) i ocena trafności (jak w Feedly) */
.sources, .feedback { margin-top: 20px; }
.sources h3, .feedback > span { display: block; margin-bottom: 8px; font: var(--headline); }
.sources h3 span { margin-left: 4px; font-weight: 500; color: var(--text-3); }
.sources ul { list-style: none; display: grid; gap: 6px; }
.src { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05); }
.src > i { font-size: 18px; color: var(--text-2); }
.src span { flex: 1; min-width: 0; }
.src b { display: block; font-size: 14.5px; font-weight: 600; }
.src small { font: var(--footnote); color: var(--text-3); }
.feedback div { display: flex; flex-wrap: wrap; gap: 8px; }
.hint { display: block; margin-top: 8px; font: var(--footnote); color: var(--text-3); }
.chips.sort .chip { padding: 5px 12px; font-size: 13px; }
.toast { display: flex; align-items: center; gap: 14px; }
.toast-undo { font-weight: 700; color: var(--accent); }

@media (hover: hover) and (pointer: fine) {
  .brief a:hover, .src:hover b { color: var(--accent); }
  .src:hover { background: rgba(255,255,255,.09); }
}
@media (max-width: 760px) {
  .brief-k { width: 100%; }
}
.actions-bar .hint { margin-top: 0; }

/* Tabela i nagłówek reagują na szerokość środkowego panelu, nie całego okna */
.main { container-type: inline-size; }
@container (max-width: 700px) {
  .trk-head, .trk { grid-template-columns: 28px minmax(0, 1fr) 56px 36px 40px; }
  .trk .wide, .trk-head .wide { display: none; }
}
@container (max-width: 520px) {
  .trk-head { display: none; }
  .trk { grid-template-columns: minmax(0, 1fr) 36px 40px; padding: 6px 0; gap: 10px; }
  .trk .nr, .trk .c { display: none; }
  .page-head { flex-direction: column; align-items: center; text-align: center; }
  .page-head > .art, .page-head > .mosaic { width: 160px; height: 160px; }
}

/* Osoby (kółka, jak wykonawcy w Spotify) i firmy (kwadraty z logo albo monogramem) */
.avatar {
  --bg-t: #2A2340; --ink: #BBA8FF;
  position: relative; flex: none; overflow: hidden; display: grid; place-items: center; border-radius: 50%;
  container-type: inline-size; background: linear-gradient(170deg, color-mix(in srgb, var(--bg-t) 85%, #fff), var(--bg-t));
}
.avatar .mono, .art .mono { font: 800 38cqw/1 var(--font); color: var(--ink); letter-spacing: -.02em; }
.art.logo { container-type: inline-size; }
.art.logo img { position: static; width: 50%; height: 50%; object-fit: contain; }
.lib-row .avatar { width: 52px; height: 52px; }
.library .lib-chips { padding: 16px 26px 28px; margin: -16px -16px -16px; }
.library .lib-chips .chip { padding: 6px 13px; font-size: 13px; }
.page-head > .avatar { width: 200px; height: 200px; box-shadow: 0 16px 48px rgba(0,0,0,.5); }

.ent-shelf { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 6px; margin: -6px; }
.ent-shelf::-webkit-scrollbar { display: none; }
.ent-card { display: grid; gap: 4px; padding: 10px; border-radius: 10px; }
.ent-card > .avatar, .ent-card > .art { width: 130px; height: 130px; margin-bottom: 6px; box-shadow: 0 8px 22px rgba(6,3,16,.45); }
.ent-card b { font: 600 15px/1.25 var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent-card > span:last-child { font: var(--footnote); color: var(--text-2); }

.ents { margin-top: 18px; }
.ents h3 { font: var(--headline); margin-bottom: 8px; }
.ent-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ent-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: var(--r-pill); background: rgba(255,255,255,.07); font: 600 13.5px/1 var(--font); }
.ent-chip > .avatar, .ent-chip > .art { width: 28px; height: 28px; }
.ent-chip > .art { border-radius: 7px; }

@media (hover: hover) and (pointer: fine) {
  .ent-card:hover { background: rgba(255,255,255,.07); }
  .ent-chip:hover { background: rgba(255,255,255,.13); }
}
@media (max-width: 760px) {
  .ent-shelf { grid-auto-columns: 128px; margin-right: -16px; padding-right: 22px; }
  .ent-card > .avatar, .ent-card > .art { width: 108px; height: 108px; }
  .page-head > .avatar { width: 180px; height: 180px; }
}
@container (max-width: 520px) { .page-head > .avatar { width: 160px; height: 160px; } }

/* Zdjęcia osób i loga firm */
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
/* Loga są zwykle ciemne albo kolorowe na przezroczystym tle, więc leżą na jasnym kafelku jak ikona aplikacji */
.art.logo.has-img { background: #F6F4FA; }
.art.logo img { position: absolute; inset: 16%; width: 68%; height: 68%; object-fit: contain; }
.has-img > .mono { visibility: hidden; }
.note a { color: var(--text-2); text-decoration: underline; }
.group-title { font: var(--large-title); font-size: 28px; letter-spacing: -.01em; margin: 8px 0 18px; }
.ent-card > span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Sygnały bez oceny AI: data zamiast liczby, streszczenie zamiast „dlaczego” */
.score.date { width: auto; min-width: 44px; font: 600 13px/1 var(--font); color: var(--text-3); }
.why.muted { background: rgba(255,255,255,.06); }
.why.muted p { font: var(--subhead); font-size: 15.5px; color: var(--text); }
.note.demo { margin: -6px 0 18px; }
.note.warn { color: var(--later); }
.link-btn { color: var(--accent); font-weight: 600; text-decoration: underline; }

/* Znak w górnym pasku: płaska wersja czytelna w małym rozmiarze i nazwa */
.brandmark { display: flex; align-items: center; gap: 10px; font: 700 16px/1 var(--font); letter-spacing: -.01em; }
@media (max-width: 1000px) { .brandmark span { display: none; } }

/* Znak marki pulsuje, dopóki dane się wczytują (zamiast pustego ekranu) */
.boot { display: grid; place-items: center; min-height: 60vh; }
.boot img { width: 72px; height: 72px; animation: boot 1.4s ease-in-out infinite alternate; }
@keyframes boot { from { opacity: .35; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .boot img { animation: none; } }

/* Dzwonek: liczba nowych sygnałów w fioletowej kropce */
.dzwonek { position: relative; }
.dzwonek[data-nowe]:not([data-nowe=""])::before {
  content: attr(data-nowe); position: absolute; z-index: 3; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill); display: grid; place-items: center; background: rgb(132, 88, 255); color: #fff;
  font: 700 11px/1 var(--font); box-shadow: 0 0 10px rgba(132, 88, 255, .7);
}

/* Ustawienia: wiersze z opisem i przełącznikiem jak w iOS */
.ust-lista { list-style: none; border-radius: 14px; background: rgba(255,255,255,.05); margin-bottom: 28px; }
.ust { display: flex; align-items: center; gap: 16px; padding: 14px 18px; }
.ust + .ust { border-top: 1px solid rgba(255,255,255,.07); }
.ust > div { flex: 1; min-width: 0; }
.ust b { display: block; font: var(--headline); font-size: 15px; }
.ust span { font: var(--footnote); color: var(--text-2); }
.przelacznik { flex: none; position: relative; width: 50px; height: 30px; border-radius: 15px; border: 0; background: rgba(255,255,255,.16); cursor: pointer; transition: background-color 200ms ease; }
.przelacznik span { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform 220ms cubic-bezier(.23, 1, .32, 1); }
.przelacznik[aria-checked="true"] { background: rgb(132, 88, 255); }
.przelacznik[aria-checked="true"] span { transform: translateX(20px); }
.ust .pill-btn { margin-top: 0; padding: 8px 16px; font-size: 13px; }
