/* ==========================================================================
   SORIMO – wygląd
   Kierunek: seledyn koreańskiej ceramiki (청자) + czerwona pieczęć (도장).
   Układ: jedna kolumna, kciuk na dole; sesja na pełnym ekranie z przyciskami
   przyklejonymi do dołu, żeby w łóżku nic nie trzeba było przewijać.
   ========================================================================== */
:root {
  --bg: #edf2ef;
  --surface: #ffffff;
  --surface-2: #e3ebe7;
  --line: #cfdbd5;
  --ink: #15211d;
  --muted: #586a64;
  --accent: #23735f;      /* seledyn */
  --accent-ink: #ffffff;
  --accent-soft: #d3e9e1;
  --seal: #b8392e;        /* pieczęć – „nie wiem”, pomyłki */
  --seal-soft: #f6dcd8;
  --amber: #a86b0c;
  --amber-soft: #f6e6c8;
  --gold: #8a5a0b;        /* subskrypcja – stonowane złoto */
  --gold-ink: #ffffff;
  --gold-soft: #f8edd6;
  --gold-line: #dcb873;
  --blue: #2c5f9e;
  --blue-soft: #d9e5f4;
  --good: #23735f;
  --good-soft: #d3e9e1;
  --shadow: 0 1px 2px rgba(21, 33, 29, .06), 0 8px 24px -12px rgba(21, 33, 29, .18);

  --f-display: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-kr: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --nav-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1311; --surface: #141d1a; --surface-2: #1b2622; --line: #26332e;
    --ink: #e4ede9; --muted: #92a59e; --accent: #6cc4a8; --accent-ink: #08201a; --accent-soft: #1b3a31;
    --seal: #ec7468; --seal-soft: #3b1f1c; --amber: #e6b04f; --amber-soft: #3a2d14; --gold: #e2b25a; --gold-ink: #2a1c04; --gold-soft: #2c2412; --gold-line: #6b5426; --blue: #86b0ea; --blue-soft: #1c2a3d;
    --good: #6cc4a8; --good-soft: #1b3a31; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1311; --surface: #141d1a; --surface-2: #1b2622; --line: #26332e;
  --ink: #e4ede9; --muted: #92a59e; --accent: #6cc4a8; --accent-ink: #08201a; --accent-soft: #1b3a31;
  --seal: #ec7468; --seal-soft: #3b1f1c; --amber: #e6b04f; --amber-soft: #3a2d14; --gold: #e2b25a; --gold-ink: #2a1c04; --gold-soft: #2c2412; --gold-line: #6b5426; --blue: #86b0ea; --blue-soft: #1c2a3d;
  --good: #6cc4a8; --good-soft: #1b3a31; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 16px; line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  /* miejsce na pasek stanu (Android/iPhone na pełnym ekranie) – inaczej nagłówek i tytuł wchodzą pod pasek */
  padding-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: var(--safe-area-inset-top, env(safe-area-inset-top, 0px)); z-index: 30; background: var(--bg); }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.kr { font-family: var(--f-kr); }
svg { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; stroke-width: 0; flex: none; }
svg:not(.logo-mark) [fill="none"] { stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top ---------- */
.top { position: sticky; top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px)); z-index: 20; background: var(--bg); }
.top-inner {
  max-width: 720px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding-block: 10px; padding-left: max(16px, var(--safe-area-inset-left, env(safe-area-inset-left, 0px))); padding-right: max(16px, var(--safe-area-inset-right, env(safe-area-inset-right, 0px)));
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 40px; height: 40px; display: block; flex: none; }
.brand-name { font-family: var(--f-display); font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.brand-name em { font-style: normal; color: var(--accent); }
.top-actions { display: flex; align-items: center; gap: 6px; }
.streak {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px 5px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted);
}
.streak svg { width: 17px; height: 17px; }
.streak.hot { color: var(--amber); border-color: var(--amber); background: var(--amber-soft); }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- nav (dół na telefonie, góra na komputerze) ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)); padding-left: var(--safe-area-inset-left, env(safe-area-inset-left, 0px)); padding-right: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
}
.nav-tab {
  height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600;
}
.nav-tab.active { color: var(--accent); }
.nav-tab.active svg, .nav-tab.active .nav-glyph { transform: translateY(-1px); }
.nav-glyph { font-size: 20px; line-height: 22px; font-weight: 700; }

.main {
  max-width: 720px; margin: 0 auto;
  padding-left: max(16px, var(--safe-area-inset-left, env(safe-area-inset-left, 0px))); padding-right: max(16px, var(--safe-area-inset-right, env(safe-area-inset-right, 0px)));
  padding-block: 4px calc(var(--nav-h) + 28px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}
@media (min-width: 760px) {
  .nav { position: sticky; top: calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 62px); bottom: auto; max-width: 720px; margin: 0 auto 8px; border: 1px solid var(--line); border-radius: 16px; }
  .nav-tab { height: 52px; flex-direction: row; gap: 8px; font-size: 14.5px; }
  .main { padding-bottom: 48px; }
}

.view { display: flex; flex-direction: column; gap: 14px; }
/* treść zakładek renderowana do jednego pojemnika – odstępy muszą być i tutaj */
#letters-content, #guides-content, #path-content { display: flex; flex-direction: column; gap: 14px; }
#guides-content .guide-stage { margin-top: 8px; margin-bottom: -4px; }
.view-title { font-family: var(--f-display); font-weight: 800; font-size: 30px; letter-spacing: -.02em; margin: 6px 0 0; text-wrap: balance; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.lead { margin: 0; color: var(--muted); max-width: 62ch; }
.h3 { font-family: var(--f-display); font-weight: 600; font-size: 18px; margin: 0; }
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.hint.center { text-align: center; }

/* ---------- buttons ---------- */
.btn-primary, .btn-secondary, .btn-start {
  border-radius: var(--r-md); border: 1px solid transparent; font-weight: 600; min-height: 50px; padding: 12px 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); width: 100%; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); }
.danger.btn-secondary { color: var(--seal); }
.danger.btn-primary { background: var(--seal); color: #fff; }
.btn-link { align-self: flex-start; background: none; border: 0; color: var(--accent); font-weight: 600; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
/* przyciski obok siebie, a gdy napis by się złamał – jeden pod drugim (nigdy „gruby” przycisk w dwóch linijkach) */
.foot-row { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }
.foot-row > * { flex: 1 1 0; min-width: max-content; }
.foot-row.wrap { flex-wrap: wrap; }
.foot-row.wrap > * { flex: 1 1 180px; }
.file-btn input { display: none; }

/* ---------- today ---------- */
.hero {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 22px 20px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::after {
  content: "오늘"; position: absolute; right: -4px; top: -14px; font-family: var(--f-kr); font-weight: 700; font-size: 92px; opacity: .7;
  color: var(--accent-soft); line-height: 1; pointer-events: none; z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero-date { color: var(--muted); font-size: 14px; text-transform: lowercase; }
.hero-title { font-family: var(--f-display); font-weight: 800; font-size: 32px; letter-spacing: -.02em; line-height: 1.05; margin: 0; text-wrap: balance; }
.hero-sub { margin: 0; color: var(--muted); font-size: 14.5px; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions > * { flex: 1 1 200px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.pill b { font-weight: 700; }
.p-letters { background: var(--accent-soft); }
.p-reviews { background: var(--blue-soft); }
.p-new { background: var(--amber-soft); }
.btn-start {
  background: var(--accent); color: var(--accent-ink); min-height: 64px; font-size: 20px; font-family: var(--f-display); font-weight: 800;
  justify-content: space-between; padding: 14px 22px; border-radius: 18px;
}
.btn-start small { font-family: var(--f-body); font-weight: 500; font-size: 14px; opacity: .85; }
.btn-start:hover { filter: brightness(1.06); }

.progress-panel { gap: 16px; }
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.meter-top b { font-variant-numeric: tabular-nums; }
.meter-note { font-size: 13.5px; color: var(--muted); }
.bar { position: relative; height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--accent-soft); }
.bar i:first-child { background: var(--accent); opacity: .45; }
.bar i:only-child { opacity: 1; }
.bar i.solid { background: var(--accent); opacity: 1; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.wd i { width: 100%; max-width: 38px; height: 30px; border-radius: 9px; background: var(--surface-2); border: 1px dashed var(--line); }
.wd.on i { background: var(--accent); border-color: var(--accent); }
.wd.today span { color: var(--ink); font-weight: 700; }
.tip { margin: 0; font-size: 14.5px; }

/* ---------- segmented ---------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 14px; }
.seg-btn { border: 0; background: none; padding: 10px; border-radius: 10px; font-weight: 600; color: var(--muted); }
.seg-btn.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- letters ---------- */
.groups { display: flex; flex-direction: column; gap: 10px; }
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.group.locked { opacity: .55; }
.group-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.group-title { font-weight: 600; }
.group-hint { font-size: 13.5px; color: var(--muted); }
.group-count { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.tile { width: 46px; height: 46px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-size: 22px; font-weight: 500; display: grid; place-items: center; }
.tile.t-ok { background: var(--accent-soft); border-color: var(--accent); }
.tile.t-mid { background: var(--blue-soft); border-color: transparent; }
.tile.t-weak { background: var(--seal-soft); border-color: var(--seal); }
.tile.t-new { border-style: dashed; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line); }
.legend i.t-ok { background: var(--accent-soft); border-color: var(--accent); }
.legend i.t-mid { background: var(--blue-soft); border-color: transparent; }
.legend i.t-weak { background: var(--seal-soft); border-color: var(--seal); }
.legend i.t-new { border-style: dashed; }

.chart { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.chart-cell { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.cc-char { grid-row: 1 / 3; font-size: 34px; font-weight: 500; line-height: 1; }
.cc-sound { font-weight: 700; color: var(--accent); }
.cc-ex { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- path ---------- */
.path { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.stage { display: grid; grid-template-columns: 40px 1fr; gap: 12px; position: relative; padding-bottom: 26px; }
.stage::before { content: ""; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: var(--line); }
.stage:last-child::before { display: none; }
.node { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-family: var(--f-display); background: var(--surface); border: 2px solid var(--line); color: var(--muted); }
.s-current .node { border-color: var(--accent); color: var(--accent); }
.s-done .node { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stage-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.stage-head { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); width: 100%; }
.s-current .stage-head { border-color: var(--accent); }
.s-locked .stage-head { opacity: .6; }
.stage-code { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stage-title { font-family: var(--f-display); font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.stage-sub { font-size: 14px; color: var(--muted); }
.stage-meter { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.stage-meter .bar { flex: 1; height: 8px; }
.stage-nums { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stage-detail { display: flex; flex-direction: column; gap: 12px; padding: 14px 14px 16px; margin-top: 2px; border-radius: var(--r-lg); background: var(--surface-2); }
.stage-detail p { margin: 0; color: var(--muted); font-size: 14.5px; }
.mini-h { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.card-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.cl-row { display: grid; grid-template-columns: 10px auto 1fr; gap: 12px; align-items: center; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; min-width: 0; }
.cl-row:last-child { border-bottom: 0; }
.cl-row .kr { font-size: 17px; white-space: nowrap; }
.cl-pl { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-2); border: 1.5px dashed var(--muted); }
.dot.d-learn { background: var(--amber); border: 0; }
.dot.d-known { background: var(--blue); border: 0; }
.dot.d-solid { background: var(--accent); border: 0; }

/* ---------- guides ---------- */
.guide-stage { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: 6px; }
.guide { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0 16px; }
.guide summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 0; cursor: pointer; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after { content: "+"; flex: none; margin-left: auto; font-size: 22px; color: var(--muted); line-height: 1; }
.guide[open] summary::after { content: "–"; }
.guide[open] { padding-bottom: 16px; }
.guide-badge { flex: none; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.guide-title { font-weight: 600; flex: 1 1 0; min-width: 0; }
.guide-new { font-size: 11.5px; font-weight: 700; color: var(--amber); text-transform: uppercase; letter-spacing: .06em; }
.lesson-title { font-family: var(--f-display); font-weight: 800; font-size: 26px; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
.lesson-summary { margin: 0 0 8px; font-weight: 600; color: var(--accent); }
.lesson-body { white-space: pre-line; margin: 0 0 10px; font-size: 15.5px; max-width: 64ch; }
.ex-list { display: flex; flex-direction: column; gap: 8px; }
.ex-row { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); }
.ex-row .kr { font-size: 18px; font-weight: 500; }
.ex-row small { color: var(--muted); font-size: 13px; }
.ex-row s { color: var(--seal); }

/* ---------- settings ---------- */
.form form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.field input, .field select { min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 16px; }
.switch { display: flex; align-items: center; gap: 12px; font-size: 15px; min-height: 40px; }
.switch input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.custom-list { display: flex; flex-direction: column; gap: 6px; }
.custom-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface-2); border-radius: 12px; min-width: 0; }
.custom-row small { display: block; color: var(--muted); }
.sync { margin: 0; font-size: 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.sync[data-status="synced"] { background: var(--accent-soft); }
.sync[data-status="error"], .sync[data-status="full"] { background: var(--seal-soft); }
.warn { background: var(--amber-soft); border: 1px solid var(--amber); border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; }
.confirm { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: var(--seal-soft); }
.confirm p { margin: 0; }

/* ---------- chips / notes (wspólne) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: 14px; }
.chip .kr { font-size: 16px; }
.note { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); font-size: 15px; }
.note.mnemonic { background: var(--amber-soft); }
.note.symbol { background: var(--blue-soft); font-size: 14.5px; }
.seg.seg-3 { grid-template-columns: repeat(3, 1fr); }
.seg-3 .seg-btn { padding: 10px 4px; font-size: 14.5px; }
.tr-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.tr-row { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "sym kr" "desc desc"; gap: 4px 14px; align-items: baseline; text-align: left; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); min-width: 0; }
.tr-row:last-child { border-bottom: 0; }
.tr-sym { grid-area: sym; font-weight: 700; color: var(--accent); font-size: 17px; white-space: nowrap; }
.tr-kr { grid-area: kr; font-size: 21px; letter-spacing: .08em; white-space: nowrap; }
.tr-desc { grid-area: desc; font-size: 14px; color: var(--muted); min-width: 0; }
.eyebrow { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* ---------- session ---------- */
body.in-session { overflow: hidden; }
body.in-session .nav, body.in-session .top, body.in-session .main { visibility: hidden; }
.session {
  position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column;
  padding-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
}
.session-top {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: 620px; margin: 0 auto;
  padding-block: 8px; padding-left: max(12px, var(--safe-area-inset-left, env(safe-area-inset-left, 0px))); padding-right: max(16px, var(--safe-area-inset-right, env(safe-area-inset-right, 0px)));
}
.session-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.session-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .3s ease; }
.session-count { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.session-body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; width: 100%; max-width: 620px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: stretch; gap: 14px;
  padding-block: 12px 20px; padding-left: max(16px, var(--safe-area-inset-left, env(safe-area-inset-left, 0px))); padding-right: max(16px, var(--safe-area-inset-right, env(safe-area-inset-right, 0px)));
}
.session-foot {
  width: 100%; max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px;
  padding-top: 10px; padding-bottom: max(14px, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  padding-left: max(16px, var(--safe-area-inset-left, env(safe-area-inset-left, 0px))); padding-right: max(16px, var(--safe-area-inset-right, env(safe-area-inset-right, 0px)));
  border-top: 1px solid var(--line); background: var(--bg);
}
.prompt-label { font-size: 15px; color: var(--muted); text-align: center; }
.card-kr { font-size: clamp(34px, 9vw, 52px); font-weight: 500; text-align: center; line-height: 1.25; text-wrap: balance; word-break: keep-all; }
.card-pl { font-size: 21px; text-align: center; font-weight: 600; text-wrap: balance; }
.card-pl.big { font-family: var(--f-display); font-weight: 800; font-size: clamp(26px, 7vw, 36px); line-height: 1.15; }
.pron { text-align: center; color: var(--accent); font-weight: 600; font-size: 17px; }
#answer { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px dashed var(--line); }
.audio-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.btn-audio { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14.5px; }
.btn-audio svg { width: 19px; height: 19px; color: var(--accent); }
.btn-audio.ghost { color: var(--muted); }
.listen-big { align-self: center; width: 116px; height: 116px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--shadow); }
.listen-big svg { width: 52px; height: 52px; }
.listen-big:active { transform: scale(.97); }
.more { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 0 14px; }
.more summary { padding: 12px 0; font-weight: 600; font-size: 15px; cursor: pointer; color: var(--muted); }
.more[open] { padding-bottom: 14px; }
/* <details> nie przyjmuje „gap” w każdej przeglądarce – odstępy na elementach w środku */
.more[open] > :not(summary) { margin-top: 10px; }
.more[open] > summary + * { margin-top: 2px; }
.blocks { display: flex; flex-wrap: wrap; gap: 8px; }
.block { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; max-width: 100%; }
.block .kr { font-size: 18px; font-weight: 500; }
.block span:last-child { font-size: 13px; color: var(--muted); }

.letter-hero { font-size: 120px; line-height: 1.1; text-align: center; font-weight: 500; margin-top: 8px; }
.letter-hero.small { font-size: 84px; margin-top: 0; }
.letter-sound { text-align: center; font-size: 18px; color: var(--muted); }
.letter-sound strong { color: var(--accent); font-size: 26px; }
.example-chip { display: flex; justify-content: center; align-items: baseline; gap: 10px; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); cursor: pointer; width: 100%; }
.example-chip .kr { font-size: 22px; font-weight: 500; }
.example-chip span:last-child { color: var(--muted); }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt { position: relative; min-height: 62px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); font-size: 21px; font-weight: 600; padding: 8px 12px; }
.opt.opt-kr { font-size: 32px; font-weight: 500; }
.opt .key { position: absolute; left: 10px; top: 6px; font-family: var(--f-body); font-size: 11px; color: var(--muted); font-weight: 600; }
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt.is-right { background: var(--good-soft); border-color: var(--good); }
.opt.is-wrong { background: var(--seal-soft); border-color: var(--seal); }
.opt:disabled { cursor: default; }
.feedback { min-height: 1em; display: flex; flex-direction: column; gap: 10px; }
.fb { text-align: center; font-weight: 600; font-size: 17px; padding: 10px; border-radius: var(--r-md); }
.fb.ok { color: var(--good); background: var(--good-soft); }
.fb.bad { color: var(--seal); background: var(--seal-soft); }
.fb .kr { font-size: 20px; }

.rates { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rate { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 62px; border-radius: var(--r-md); border: 1.5px solid transparent; padding: 6px 4px; font-weight: 700; }
.rate .rt { font-size: 15px; }
.rate .ri { font-size: 12px; font-weight: 500; opacity: .85; }
.rate-again { background: var(--seal-soft); color: var(--seal); }
.rate-hard { background: var(--amber-soft); color: var(--amber); }
.rate-good { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.rate-easy { background: var(--blue-soft); color: var(--blue); }

.summary-title { font-family: var(--f-kr); font-weight: 700; font-size: 34px; margin: 0; line-height: 1.2; }
.summary-title span { display: block; font-family: var(--f-display); font-weight: 800; font-size: 24px; color: var(--accent); }
.sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.sum { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.sum b { font-family: var(--f-display); font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sum span { font-size: 13.5px; color: var(--muted); }
.sum-block { display: flex; flex-direction: column; gap: 8px; }
.sum-block h3 { margin: 0; font-size: 15px; }

/* ---------- sheet + toast ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5, 10, 8, .45); }
.sheet-panel {
  position: relative; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--bg);
  border-radius: 24px 24px 0 0; display: flex; flex-direction: column; gap: 12px;
  padding-block: 22px max(20px, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); padding-left: max(18px, var(--safe-area-inset-left, env(safe-area-inset-left, 0px))); padding-right: max(18px, var(--safe-area-inset-right, env(safe-area-inset-right, 0px)));
}
.sheet-close { position: absolute; right: 10px; top: 10px; }
#sheet-body { display: flex; flex-direction: column; gap: 18px; }
.sheet-head { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.sheet-head .letter-sound { margin-top: -6px; }
.sheet-notes { display: flex; flex-direction: column; gap: 10px; }
.sheet-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: -10px; }
@media (min-width: 760px) { .sheet { align-items: center; } .sheet-panel { border-radius: 24px; } }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14.5px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 380px) {
  .rate .rt { font-size: 13.5px; }
  .letter-hero { font-size: 96px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- sprawdziany, dialogi, metoda ---------- */
.opts.opts-col { grid-template-columns: 1fr; }
.opt.opt-text { font-size: 16.5px; font-weight: 600; text-align: left; padding: 12px 14px 12px 34px; min-height: 54px; }
.opt.opt-text .key { top: 50%; transform: translateY(-50%); left: 12px; }
.blank { display: inline-block; min-width: 2.2em; border-bottom: 3px solid var(--accent); color: var(--accent); margin: 0 2px; }
.card-kr.small { font-size: clamp(24px, 6vw, 32px); }
.answer-box { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.fb-sub { display: block; font-weight: 500; font-size: 14px; margin-top: 2px; }
.build-line { min-height: 64px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 12px; border-radius: var(--r-md); border: 1.5px dashed var(--line); background: var(--surface); }
.build-line.is-right { border: 1.5px solid var(--good); background: var(--good-soft); }
.build-line.is-wrong { border: 1.5px solid var(--seal); background: var(--seal-soft); }
.build-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tok { min-height: 48px; padding: 8px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-size: 20px; font-weight: 500; }
.tok:disabled { opacity: .3; }
.tok.placed { border-color: var(--accent); background: var(--accent-soft); }
.tok.placed:disabled { opacity: 1; }
.score { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.score b { font-family: var(--f-display); font-size: 56px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.score span { color: var(--muted); font-size: 14px; }
.score.pass { border-color: var(--good); background: var(--good-soft); }
.score.pass b { color: var(--good); }

.chat { display: flex; flex-direction: column; gap: 10px; }
.bubble { position: relative; max-width: 88%; padding: 10px 46px 10px 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.bubble.b-a { align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.b-b { align-self: flex-end; border-bottom-right-radius: 6px; background: var(--accent-soft); border-color: transparent; }
.bubble.playing { outline: 2.5px solid var(--accent); }
.b-name { font-size: 12px; font-weight: 700; color: var(--muted); font-family: var(--f-kr); }
.b-kr { font-size: 19px; font-weight: 500; line-height: 1.35; }
.b-pl { display: none; font-size: 14.5px; color: var(--muted); }
.b-pl small { display: block; font-size: 13px; margin-top: 4px; color: var(--amber); }
.bubble.show-pl .b-pl, .chat.show-all .b-pl { display: block; }
.b-play { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--bg); color: var(--accent); display: grid; place-items: center; }
.b-play svg { width: 18px; height: 18px; }
.center-link { align-self: center; }

.stage-actions { display: flex; flex-direction: column; gap: 8px; }
.extras { display: flex; flex-direction: column; gap: 10px; }
.act-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; border-radius: var(--r-md); border: 1.5px solid var(--accent); background: var(--surface); width: 100%; }
.act-btn.wide { border-radius: var(--r-lg); padding: 14px 16px; background: var(--accent-soft); }
.act-btn:disabled { border-color: var(--line); border-style: dashed; opacity: .7; cursor: default; }
.act-btn.passed { border-color: var(--good); background: var(--good-soft); }
.act-t { font-weight: 700; }
.act-s { font-size: 13.5px; color: var(--muted); }
.method { margin-bottom: 4px; }
.method-list { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.method-list li { display: flex; flex-direction: column; gap: 3px; }
.method-list span { font-size: 15px; }
.method-list small { color: var(--accent); font-size: 13.5px; }
.sources { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.sources a { color: var(--accent); }

.guide[open] > :not(summary) { margin-top: 0; }
.guide[open] > :not(summary) + :not(summary) { margin-top: 10px; }
.method[open] .method-list { margin-top: 4px; }

/* ---------- ekran powitalny ---------- */
.welcome { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px; border-radius: var(--r-md); background: var(--accent-soft); }
.welcome-kr { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--accent); }
.welcome-kr span { font-family: var(--f-body); font-size: 16px; font-weight: 600; color: var(--muted); }
.welcome p { margin: 0; font-size: 15px; max-width: 56ch; }

/* ---------- czytanki i zadania z tekstem ---------- */
.reading { display: flex; flex-direction: column; gap: 8px; }
.rd-line { position: relative; padding: 10px 46px 10px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.rd-line.playing { outline: 2.5px solid var(--accent); }
.rd-kr { font-size: 19px; line-height: 1.45; }
.rd-line.show-pl .b-pl, .reading.show-all .b-pl { display: block; }
.gloss { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.gloss-row { display: flex; gap: 10px; align-items: baseline; text-align: left; padding: 8px 12px; border-radius: var(--r-sm, 10px); border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; }
.gloss-row .kr { font-size: 17px; min-width: 5.5em; }
.gloss-row span:last-child { color: var(--muted); font-size: 14.5px; }
.gloss-row.is-new { border-color: var(--amber); }
.passage { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.passage p { margin: 0; font-size: 18px; line-height: 1.5; }
.passage.small p { font-size: 16px; }
.prompt-q { font-weight: 600; font-size: 17px; }
.passage-pl { font-size: 15px; line-height: 1.5; color: var(--muted); }

/* ---------- „Powiedz o sobie” ---------- */
.hint-chips { display: flex; flex-direction: column; gap: 6px; }
.hint-chip { display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.hint-chip .kr { font-size: 17px; }
.hint-chip small { color: var(--muted); font-size: 13.5px; }
.sp-text { flex: none; min-height: 112px; width: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: 18px; line-height: 1.5; resize: vertical; font-family: inherit; }
.sp-text:focus { outline: none; border-color: var(--accent); }
#sp-model { display: flex; flex-direction: column; gap: 10px; }
.sp-model-row { display: flex; flex-direction: column; gap: 4px; }
.sp-model-row + .sp-model-row { padding-top: 10px; border-top: 1px solid var(--line); }
.sp-model-row .kr { font-size: 18px; line-height: 1.5; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.4; }
.check-row input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--accent); }

/* ---------- test końcowy ---------- */
.act-btn.final-card { margin-top: 16px; border-width: 2px; }
.opt.is-chosen { border-color: var(--accent); background: var(--accent-soft); }
.fin-review { margin-top: 8px; }
.fin-review > summary { font-family: var(--f-kr, inherit); }
.fin-ans { display: flex; flex-direction: column; gap: 4px; font-size: 16px; }
.fin-bad { color: var(--seal); }
.fin-good { color: var(--good); font-weight: 600; }

/* ---------- swobodne ćwiczenie ---------- */
.rates.rates-2 { grid-template-columns: 1fr 1fr; }
.rates.rates-2 .rate { min-height: 56px; }
.practice-btn { width: 100%; margin-top: 10px; }

/* ćwiczenie „Zadaj pytanie” */
.ask-answer { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 8px 0 4px; }
.ask-focus { background: var(--accent-soft); color: var(--ink); font-weight: 700; border-bottom: 3px solid var(--accent); border-radius: 4px; padding: 0 3px; }

/* 받침 – litery na dole sylaby */
.tile.fin { font-size: 0.8rem; letter-spacing: 0; padding: 0 6px; min-width: 0; width: auto; }
.letter-hero.fin { font-size: 2.2rem; letter-spacing: 0.08em; }
.cc-char.fin { font-size: 0.95rem; white-space: normal; line-height: 1.2; }
.syl-points { margin: 0 0 12px; padding-left: 18px; color: var(--ink); line-height: 1.5; }
.syl-points li { margin-bottom: 4px; }
.syl-parts { display: grid; grid-template-columns: 1fr; gap: 8px; }
.syl-part { display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 12px; color: var(--ink); font: inherit; cursor: pointer; }
.syl-part .sp-kr { grid-row: 1 / 3; font-size: 2rem; text-align: center; }
.syl-part .sp-eq { font-weight: 600; }
.syl-part .sp-note { color: var(--muted); font-size: 0.85rem; }
.chart-cell.fin { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.chart-cell.fin .cc-char { width: auto; }
.letter-hero.small.fin { font-size: 1.5rem; padding-right: 36px; }

/* Ściągi → Tabele */
.seg-4 { grid-template-columns: repeat(4, 1fr); }
.seg-4 .seg-btn { padding: 10px 2px; font-size: 13.5px; }
.pt-list, .conj-list { display: flex; flex-direction: column; gap: 6px; }
.pt-row { display: grid; grid-template-columns: 96px 1fr; column-gap: 10px; row-gap: 2px; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 10px; color: var(--ink); font: inherit; cursor: pointer; }
.pt-p { grid-row: 1 / 3; font-weight: 700; font-size: 1.05rem; color: var(--accent); align-self: center; }
.pt-use { font-weight: 600; font-size: 0.92rem; }
.pt-ex { color: var(--muted); font-size: 0.88rem; }
.conj-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 10px; color: var(--ink); font: inherit; cursor: pointer; }
.conj-row.none { opacity: 0.45; cursor: default; }
.cj-label { display: flex; flex-direction: column; font-size: 0.88rem; }
.cj-label small { color: var(--muted); font-size: 0.78rem; }
.cj-form { font-size: 1.15rem; font-weight: 600; white-space: nowrap; }
.guide.conj summary .kr { font-weight: 700; }

/* pisanie na klawiaturze */
.type-box { margin: 14px 0 6px; }
.type-in { width: 100%; font-size: 1.5rem; padding: 12px 14px; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--surface); color: var(--ink); text-align: center; }
.type-in:focus { outline: none; border-color: var(--accent); }
.type-hint { margin-top: 6px; font-size: 0.88rem; color: var(--seal); text-align: center; }
.type-correct { font-size: 1.6rem; text-align: center; margin: 8px 0; letter-spacing: 0.02em; }
.type-miss { background: var(--seal-soft); color: var(--seal); border-radius: 3px; padding: 0; }
.type-result { margin-bottom: 8px; }
.type-pl { font-weight: 600; color: var(--ink); }
.rate.suggest { outline: 3px solid var(--accent); outline-offset: 2px; }
.sum-big { font-size: 2.6rem; font-weight: 700; text-align: center; margin: 12px 0; }
.kbd { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.kbd-row { display: flex; gap: 3px; justify-content: center; }
.kbd-row.r1 { padding: 0 4%; } .kbd-row.r2 { padding: 0 12%; }
.kbd-key { flex: 1 1 0; max-width: 34px; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 4px 0 2px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); font-size: 1rem; line-height: 1.1; }
.kbd-key.vow { background: var(--accent-soft); }
.kbd-key small { font-size: 0.6rem; color: var(--muted); }
.kbd-steps { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }

/* nagraj się i porównaj */
.rec-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0; }
.rec-btn { display: inline-flex; align-items: center; gap: 8px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--seal); display: inline-block; }
.rec-row.is-rec .rec-btn { border-color: var(--seal); color: var(--seal); }
.rec-row.is-rec .rec-dot { animation: recpulse 1s infinite; }
@keyframes recpulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .rec-row.is-rec .rec-dot { animation: none; } }

/* konto */
.acc-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.acc-form input[type="email"], .acc-form input[type="password"], #acc-del-word { width: 100%; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.btn-google svg { width: 20px; height: 20px; }
.acc-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.85rem; margin: 12px 0 8px; }
.acc-or::before, .acc-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.acc-tabs { margin-top: 4px; }
.acc-msg { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg); font-size: 0.92rem; }
.acc-msg.ok { background: var(--good-soft); color: var(--ink); }
.acc-msg.bad { background: var(--seal-soft); color: var(--seal); }
.acc-who { margin: 0; }
/* panel konta: stały odstęp między wszystkimi blokami (tekst, przyciski, potwierdzenia, komunikaty) */
#account-box { display: flex; flex-direction: column; gap: 12px; }
#account-box > * { margin: 0; }
#account-box > .acc-note + .acc-actions { margin-top: 4px; }
/* potwierdzenie (np. usunięcie konta) nigdy nie przykleja się do przycisków nad nim */
.foot-row + .confirm, .confirm + .acc-msg, .foot-row + .acc-msg { margin-top: 14px; }
#account-box a { color: var(--accent); }

/* ---------- powitanie (pierwsze uruchomienie) – .onboard, nie .welcome (to karta 소리 na ekranie Dziś) ---------- */
.onboard {
  position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto; display: flex;
  padding: calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 24px) max(20px, var(--safe-area-inset-right, env(safe-area-inset-right, 0px))) calc(var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)) + 24px) max(20px, var(--safe-area-inset-left, env(safe-area-inset-left, 0px)));
}
body.in-welcome { overflow: hidden; }
.welcome-inner { position: relative; width: 100%; max-width: 440px; margin: auto; display: flex; flex-direction: column; gap: 18px; }
.welcome-mark { position: absolute; right: -10px; top: -24px; font-weight: 700; font-size: 120px; line-height: 1; color: var(--accent-soft); opacity: .8; pointer-events: none; z-index: 0; }
.welcome-inner > * { position: relative; z-index: 1; }
.welcome-brand { display: flex; align-items: center; gap: 12px; font-family: var(--f-display); font-weight: 800; font-size: 30px; }
.welcome-brand img { border-radius: 14px; }
.welcome-brand b { color: var(--accent); font-weight: 800; }
.welcome-title { font-family: var(--f-display); font-weight: 800; font-size: 36px; line-height: 1.05; letter-spacing: -.02em; margin: 14px 0 0; text-wrap: balance; }
.welcome-sub { margin: 0; color: var(--muted); font-size: 16.5px; }
.welcome-points { list-style: none; margin: 4px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.welcome-points li { position: relative; padding-left: 30px; }
.welcome-points li::before { content: ""; position: absolute; left: 2px; top: .35em; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-soft); box-shadow: inset 0 0 0 5px var(--accent); }
.welcome-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.welcome-actions > * { width: 100%; }

/* ---------- prośba o konto po sesji ---------- */
.acc-prompt { display: flex; flex-direction: column; gap: 14px; text-align: center; align-items: center; padding-top: 6px; }
.acc-prompt p { margin: 0; color: var(--muted); max-width: 42ch; }
.acc-prompt-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.acc-prompt-icon svg { width: 28px; height: 28px; }
.acc-prompt-title { font-family: var(--f-display); font-weight: 800; font-size: 24px; margin: 0; }
.acc-prompt-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 4px; }
.acc-prompt-actions > * { width: 100%; }
.testout-hint { margin: 2px 0 0; font-size: 13.5px; }

/* pierwsze uruchomienie: treść ukryta do chwili pokazania ekranu powitalnego (bez mignięcia) */
html.pre-welcome .top, html.pre-welcome .main, html.pre-welcome .nav { visibility: hidden; }
.app-version { margin-top: 18px; font-size: 12.5px; }

/* ---------- Ustawienia: lista kategorii i podstrony ---------- */
.set-menu { display: flex; flex-direction: column; gap: 14px; }
.set-group { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.set-menu > .set-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.set-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; min-height: 64px; background: none; border: 0; text-align: left; color: var(--ink); }
.set-group .set-row + .set-row { border-top: 1px solid var(--line); }
.set-row:active { background: var(--accent-soft); }
.set-ico { width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.set-ico svg { width: 21px; height: 21px; }
.set-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.set-txt b { font-weight: 600; font-size: 16px; }
.set-txt small { color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.set-row .chev { width: 18px; height: 18px; color: var(--muted); flex: none; }
.set-back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; background: none; border: 0; color: var(--accent); font-weight: 600; padding: 6px 4px 0 0; margin-bottom: -6px; }
.set-back svg { width: 20px; height: 20px; }
.set-link { color: var(--accent); font-weight: 600; text-decoration: none; padding: 4px 0; }
.milestone { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-md); background: var(--amber-soft); }
.milestone b { font-family: var(--f-display); font-weight: 800; font-size: 34px; line-height: 1; color: var(--amber); }
.milestone span { font-weight: 600; }
input[type="time"] { font: inherit; color: var(--ink); background: var(--surface-2, var(--bg)); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; min-height: 48px; }

/* ---------- subskrypcja / paywall ---------- */
.paywall { display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; padding-top: 6px; }
.paywall .pay-lead, .paywall .pay-note { margin: 0; color: var(--muted); max-width: 42ch; }
.pay-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; width: 100%; max-width: 380px; }
.pay-features li { display: flex; gap: 10px; align-items: flex-start; }
.pay-features svg { width: 20px; height: 20px; flex: none; stroke: var(--accent); stroke-width: 2.4; margin-top: 1px; }
.pay-plans { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.pay-plan { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; text-align: left; padding: 14px 16px; border-radius: var(--r-md);
  border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.pay-plan.on { border-color: var(--accent); background: var(--accent-soft); }
.pay-plan-name { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pay-badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.pay-plan-price { font-family: var(--f-display); font-weight: 800; font-size: 18px; white-space: nowrap; }
.pay-plan-price small { font-family: var(--f-body); font-weight: 500; font-size: 13px; color: var(--muted); }
.pay-plan-sub { grid-column: 1 / -1; font-size: 13.5px; color: var(--muted); }
.pay-fine { margin: 0; font-size: 12.5px; color: var(--muted); max-width: 46ch; }
.pay-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; font-size: 13.5px; }
.pay-links a { color: var(--muted); }
.paywall .warn { margin: 0; width: 100%; }
.pay-open { margin-top: 8px; align-self: flex-start; }
.sub-content { display: flex; flex-direction: column; gap: 14px; }
.sub-status { margin: 0; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.sub-status b { font-family: var(--f-display); font-size: 18px; }
.sub-status span { color: var(--muted); font-size: 14px; }
.sub-status.ok { background: var(--accent-soft); border-color: transparent; }
.sub-content .hint { margin: 0; }
a.btn-primary, a.btn-secondary { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; text-align: center; box-sizing: border-box; }

/* subskrypcja w złocie: zieleń zostaje dla nauki, złoto tylko dla pełnego kursu */
.btn-gold { background: var(--gold); color: var(--gold-ink); border-color: transparent; width: 100%; }
.btn-gold:hover { filter: brightness(1.06); }
.pay-open { width: auto; }
.act-btn.pay-card { border-color: var(--gold); background: var(--gold-soft); }
.act-btn.pay-card .act-t { color: var(--gold); }
.pay-banner { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid var(--gold-line); background: var(--gold-soft); color: var(--ink); font: inherit; cursor: pointer; }
.pay-banner svg { width: 22px; height: 22px; flex: none; stroke: var(--gold); stroke-width: 1.8; }
.pay-banner span { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pay-banner b { font-size: 15px; }
.pay-banner small { color: var(--muted); font-size: 13.5px; }
.pay-banner .chev { width: 18px; height: 18px; stroke: var(--muted); }
.paywall .acc-prompt-icon { background: var(--gold-soft); color: var(--gold); }
.pay-plan.on { border-color: var(--gold); background: var(--gold-soft); }
.pay-badge { background: var(--gold); color: var(--gold-ink); }
.pay-features svg { stroke: var(--gold); }
.sub-status.ok { background: var(--gold-soft); }

/* karta członkowska pełnego kursu – złoto w obu motywach */
.prem-card { position: relative; overflow: hidden; isolation: isolate; width: 100%; text-align: left; border-radius: 20px; padding: 18px 18px 16px;
  color: #3a2803; background: linear-gradient(135deg, #f8e7b0 0%, #e9c46f 38%, #d1a043 66%, #f2d68f 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .55) inset, 0 10px 28px -12px rgba(160, 110, 20, .55); display: flex; flex-direction: column; gap: 4px; }
.prem-card::after { content: ""; position: absolute; inset: -40% -10%; z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .45) 48%, transparent 58%); transform: translateX(-60%);
  animation: prem-shine 5.5s ease-in-out 1s infinite; }
@keyframes prem-shine { 0%, 70% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }
@media (prefers-reduced-motion: reduce) { .prem-card::after { animation: none; display: none; } }
.prem-glyph { position: absolute; right: -6px; bottom: -22px; z-index: -1; font-size: 92px; font-weight: 700; line-height: 1; color: rgba(110, 72, 6, .13); letter-spacing: -.04em; }
.prem-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.prem-brand { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(58, 40, 3, .75); }
.prem-crown { width: 26px; height: 26px; fill: #fff6d8; stroke: #8a5a0b; stroke-width: 1.4; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(90, 60, 5, .35)); }
.prem-title { font-family: var(--f-display); font-weight: 800; font-size: 24px; line-height: 1.15; }
.prem-meta { font-size: 14px; font-weight: 600; color: rgba(58, 40, 3, .85); }
.prem-perks { margin-top: 8px; padding-top: 10px; border-top: 1px solid rgba(110, 72, 6, .22); font-size: 13.5px; color: rgba(58, 40, 3, .8); }
.prem-welcome { padding-top: 34px; }
.prem-welcome .prem-card { margin-bottom: 4px; }
.set-row.is-premium .set-ico { background: var(--gold-soft); color: var(--gold); }
.set-row.is-premium small { color: var(--gold); font-weight: 600; }
