/* Wygląd jak „Paulinowe Przepisy” (motyw „Agenda”: fiolet #8F5FEA, belka z gradientem, karty 22 px),
   żeby moduł przewodnika dało się kiedyś dołączyć do tamtej aplikacji. Tokeny skopiowane 1:1. */

:root {
  --bg: #f6f4fb;
  --surface: #ffffff;
  --surface-2: #ece8f6;
  --text: #17141c;
  --muted: #5c566a;
  --faint: #8f889c;
  --line: #e2dcf0;
  --brand: #8f5fea;
  --brand-ink: #ffffff;
  --brand-soft: #efe7fd;
  --belka: linear-gradient(120deg, #7a49d9, #a985f2);
  --green: #2e7d32; --green-soft: #e8f5e9;
  --amber: #a05e00; --amber-soft: #fff4dc;
  --red: #c62828;   --red-soft: #fdecec;
  --tag: #8a5410;   --tag-soft: #f8eedf;
  --shadow: 0 2px 10px rgba(60, 30, 110, .07);
  --shadow-lg: 0 8px 24px rgba(40, 20, 80, .10);
  --radius: 22px;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #120f17;
  --surface: #1c1824;
  --surface-2: #262130;
  --text: #ebe7f2;
  --muted: #aaa3b8;
  --faint: #77708a;
  --line: #332c40;
  --brand: #b391ff;
  --brand-ink: #1a0f2e;
  --brand-soft: rgba(179, 145, 255, .16);
  --belka: linear-gradient(120deg, #3b2470, #5a3a9e);
  --green: #6fcf7a; --green-soft: rgba(111, 207, 122, .13);
  --amber: #ffbe55; --amber-soft: rgba(255, 190, 85, .13);
  --red: #ff6b6b;   --red-soft: rgba(255, 107, 107, .14);
  --tag: #efb877;   --tag-soft: rgba(239, 184, 119, .13);
  --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; overscroll-behavior-y: none; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
svg { flex: none; }

.app { min-height: 100dvh; max-width: 680px; margin: 0 auto; overflow-x: clip; }

/* ── Pasek górny ── */
.pasek {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 14px;
  background: var(--belka); color: #fff; border-radius: 0 0 22px 22px;
}
.pasek__logo { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.pasek__tytul { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.pasek__tytul small { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .8); }
.pasek__tytul span { font-size: 20px; font-weight: 800; line-height: 1.3; margin-bottom: -2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ikonowy { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); transition: background .15s; }
.pasek .ikonowy { color: #fff; }
.pasek .ikonowy:active { background: rgba(255, 255, 255, .18); }

/* ── Treść i sekcje ── */
.tresc { padding: 16px 16px calc(env(safe-area-inset-bottom) + 92px); }
.sekcja { margin-top: 20px; }
.sekcja__nag { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 10px; }
.sekcja__nag h2 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.sekcja__ile { font-size: 12px; font-weight: 700; color: var(--faint); background: var(--surface-2); border-radius: 99px; padding: 1px 8px; }
.lista { display: flex; flex-direction: column; gap: 10px; }
.karta { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.stopka { text-align: center; color: var(--faint); font-size: 12px; margin: 28px 0 0; }

/* ── Chipy ── */
.chipy { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 13px; border-radius: 99px;
  font-size: 13.5px; font-weight: 700; white-space: nowrap; background: var(--surface); color: var(--muted); box-shadow: var(--shadow);
}
.chip small { font-weight: 600; color: var(--faint); }
.chip--aktywny { background: var(--brand); color: var(--brand-ink); }
.chip--aktywny small { color: inherit; opacity: .8; }
.chip--maly { height: 24px; padding: 0 9px; font-size: 12px; box-shadow: none; background: var(--surface-2); }
.chip--technika { background: var(--brand-soft); color: var(--brand); }
.chip--przyroda { background: var(--green-soft); color: var(--green); }
.chip--historia { background: var(--tag-soft); color: var(--tag); }
.chip--sakralne, .chip--pamiec, .chip--miejscowosc, .chip--inne { background: var(--surface-2); color: var(--muted); }

/* ── Przyciski ── */
.btn {
  height: 50px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 15px; padding: 0 18px; text-align: center; line-height: 1.15; transition: transform .12s, filter .12s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn--glowny { background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn--drugi { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.btn--maly { height: 40px; font-size: 14px; padding: 0 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.rzad { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ── Start: duży okrągły przycisk (jak przycisk mowy w Przepisach) ── */
.start { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 28px 0 8px; }
.start__przycisk {
  width: 160px; height: 160px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: var(--brand-ink); font-weight: 800; font-size: 17px;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--brand) 40%, transparent), var(--shadow-lg); transition: transform .12s;
}
.start__przycisk:active { transform: scale(.96); }
.start__opis { color: var(--faint); font-size: 14px; text-align: center; max-width: 30ch; }

/* ── Stan jazdy ── */
.stan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stan__pole { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 10px 12px; min-width: 0; }
.stan__pole small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.stan__pole b { display: block; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Teraz opowiadam ── */
.teraz { display: flex; flex-direction: column; gap: 10px; border: 2px solid var(--brand); }
.teraz__nad { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.teraz__tytul { font-size: 19px; font-weight: 800; line-height: 1.25; text-wrap: balance; }
.teraz__zapowiedz { color: var(--muted); font-size: 14.5px; }
.teraz__zdanie { font-size: 15.5px; line-height: 1.5; min-height: 3em; }
.teraz__tor { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.teraz__pasek { height: 100%; background: var(--brand); border-radius: 99px; transition: width .3s; }
.fala { display: inline-flex; gap: 2px; align-items: end; height: 12px; }
.fala i { width: 3px; background: var(--brand); border-radius: 2px; animation: fala 1s ease-in-out infinite; }
.fala i:nth-child(2) { animation-delay: .15s; } .fala i:nth-child(3) { animation-delay: .3s; }
@keyframes fala { 0%, 100% { height: 4px; } 50% { height: 12px; } }

/* ── Element listy (kolejka, przed nami, opowiedziane) ── */
.el { display: flex; flex-direction: column; gap: 6px; }
.el__gora { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.el__tytul { font-weight: 700; font-size: 15px; line-height: 1.3; min-width: 0; }
.el__gdzie { flex: none; font-size: 13px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.el__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--faint); }
.el details { margin-top: 2px; }
.el summary { cursor: pointer; color: var(--brand); font-size: 13.5px; font-weight: 700; }
.el__tekst { margin-top: 8px; font-size: 14.5px; color: var(--muted); white-space: pre-wrap; }

/* ── Pasek postępu (czekanie na Gemini) — jak w Przepisach ── */
.postep { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.postep__napis { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14.5px; font-weight: 700; }
.postep__napis small { font-size: 12.5px; font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; }
.postep__tor { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.postep__pasek {
  height: 100%; width: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 55%, white), var(--brand));
  background-size: 200% 100%; animation: postep-blask 1.6s linear infinite;
}
@keyframes postep-blask { from { background-position: 200% 0; } to { background-position: 0 0; } }

/* ── Puste, komunikaty ── */
.pusto { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 16px; color: var(--faint); font-size: 14.5px; text-align: center; }
.komunikat { padding: 10px 14px; border-radius: 14px; font-size: 14px; background: var(--red-soft); color: var(--red); font-weight: 600; }
.komunikat--info { background: var(--amber-soft); color: var(--amber); }
.dymek {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40;
  width: max-content; max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 16px; background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg);
}

/* ── Ustawienia ── */
.pole { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.pole select, .pole input[type=text], .pole input[type=password], .pole input[type=number] {
  height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font: inherit; font-size: 16px; font-weight: 500; padding: 0 12px; width: 100%; min-width: 0;
}
.pole input[type=range] { width: 100%; accent-color: var(--brand); }
.pole small { font-weight: 500; color: var(--faint); }
.ustawienia { display: flex; flex-direction: column; gap: 16px; }
.dwie { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── Dolna nawigacja ── */
.nawigacja {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center; gap: 8px;
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 8px); background: var(--surface); box-shadow: 0 -4px 20px rgba(0, 0, 0, .06);
}
.nawigacja button {
  flex: 1; max-width: 220px; height: 54px; border-radius: 99px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 700; color: var(--faint);
}
.nawigacja button.aktywny { background: var(--brand); color: var(--brand-ink); }

button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (hover: hover) { .pasek .ikonowy:hover { background: rgba(255, 255, 255, .18); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
