:root {
  --bg: #faf7f2; --surface: #ffffff; --surface-2: #f3eee6; --text: #2a2522; --muted: #6f665e; --line: #e4dcd0;
  --accent: #b5401f; --accent-text: #ffffff; --good: #2f7a4b; --good-bg: #e6f3ea; --warn: #94650c; --warn-bg: #fbf1da;
  --bad: #b3261e; --bad-bg: #fbe9e7; --shadow: 0 1px 3px rgba(60, 40, 20, .08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1715; --surface: #24201d; --surface-2: #2e2925; --text: #f0ebe4; --muted: #a79d92; --line: #3b3530;
    --accent: #e0714d; --accent-text: #1a1715; --good: #6fc48f; --good-bg: #1f3227; --warn: #e0b45c; --warn-bg: #362c17;
    --bad: #ef8a80; --bad-bg: #3a211e; --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
main { max-width: 760px; margin: 0 auto; padding: 24px 16px 80px; outline: none; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 36px 0 12px; }
h3 { font-size: 17px; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--accent); }
.top nav { display: flex; gap: 16px; font-size: 15px; }
.top nav a { text-decoration: none; }
.top nav a:hover { text-decoration: underline; }
.badge { background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 0 7px; font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.btn { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 10px 16px; background: var(--accent); color: var(--accent-text); cursor: pointer; text-decoration: none; display: inline-block; }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible, .speak:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 20px 0; }
.stat { display: block; text-decoration: none; }
.stat b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.unit { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; }
.unit:hover { border-color: var(--accent); }
.unit .num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.unit.done .num { background: var(--good-bg); color: var(--good); }
.unit .body { min-width: 0; flex: 1; }
.bar { height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--good); }
.speak { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 8px; padding: 2px 9px; cursor: pointer; flex: none; }
.es { font-weight: 600; }
.line { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .text { min-width: 0; flex: 1; }
.tag { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ex textarea { width: 100%; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical; min-height: 46px; margin: 8px 0; }
.result { border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.result.correct { background: var(--good-bg); }
.result.almost { background: var(--warn-bg); }
.result.wrong { background: var(--bad-bg); }
.result b { display: block; }
.flash { text-align: center; padding: 28px 16px; }
.flash .big { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.chat { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); }
.bubble.user { align-self: flex-end; background: var(--surface-2); }
.say { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; }
.say textarea { flex: 1; min-width: 0; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: none; }
.msg.err, .err { color: var(--bad); }
.login main { max-width: 380px; padding-top: 12vh; }
.login form { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.login label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.login input { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); color: var(--text); }
.login .msg { margin: 0; }
@media (max-width: 480px) { h1 { font-size: 26px; } .bubble { max-width: 94%; } }
.track { margin-top: 36px; }
.track-title { font-size: 24px; margin: 0 0 4px; }
.level { margin: 20px 0 10px; color: var(--muted); }
.quote { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.options { display: grid; gap: 6px; margin: 8px 0 12px; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.option:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }
.option input { margin-top: 5px; flex: none; }
.compare { padding: 10px 0; border-bottom: 1px solid var(--line); }
.compare:last-child { border-bottom: 0; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sides p { margin: 2px 0 6px; }
.sides .ar p { font-weight: 600; }
.table-wrap { overflow-x: auto; padding: 8px 12px; }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; }
th, td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
tr:last-child td { border-bottom: 0; }
ul { margin: 0; padding-left: 20px; }
@media (max-width: 480px) { .sides { grid-template-columns: 1fr; } .top nav { gap: 2px 10px; font-size: 14px; } table { font-size: 15px; } }
.brand { flex: none; }
.top nav { flex-wrap: wrap; justify-content: flex-end; }
.top nav a { white-space: nowrap; }
@media (max-width: 480px), (pointer: coarse) {
  .speak { min-height: 40px; padding: 6px 12px; }
  .line { align-items: center; }
  .top nav a { padding: 4px 0; }
}
@media (max-width: 480px) {
  .top { position: static; }
  .say textarea { min-height: 5.2em; }
}

/* modul podrozniczy */
.travel {
  --accent: #1468ad; --accent-text: #ffffff; --sky: #dff1fc; --sky-ink: #0f5a96; --sun: #fff0c9; --sun-ink: #8a5a00; --radius: 20px;
}
@media (prefers-color-scheme: dark) {
  .travel { --accent: #6db9ee; --accent-text: #0d2233; --sky: #17354b; --sky-ink: #9dd4f7; --sun: #3a2f14; --sun-ink: #f4cf7c; }
}
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.travel .btn { border-radius: 999px; padding: 11px 20px; }
.travel h2 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin-top: 40px; }
.travel .card { border-radius: var(--radius); }
.track.travel .track-title { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.trips { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.trip { display: flex; flex-direction: column; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.trip:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(20, 60, 100, .18); }
.trip img { display: block; width: 100%; aspect-ratio: 20 / 9; object-fit: cover; }
.trip-body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 14px; }
.trip-body b { font-size: 17px; line-height: 1.25; }
.trip.done img { opacity: .75; }
.trip .bar { display: block; width: 100%; }
.crumbs { margin-bottom: 10px; }
.hero { position: relative; margin: 0 0 16px; border-radius: var(--radius); overflow: hidden; }
.hero img { display: block; width: 100%; aspect-ratio: 20 / 9; object-fit: cover; }
.hero figcaption { position: absolute; inset: auto 0 0 0; padding: 40px 18px 14px; background: linear-gradient(transparent, rgba(8, 24, 40, .82)); }
.hero h1 { color: #ffffff; margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.hero-thin { display: block; width: 100%; height: 110px; object-fit: cover; border-radius: 16px; margin-bottom: 14px; }
.hook { font-size: 20px; line-height: 1.4; font-weight: 600; }
.chip { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--sky); color: var(--sky-ink); }
.phrases { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.phrase { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.phrase .text { flex: 1; min-width: 0; }
.phrase .es { font-size: 18px; font-weight: 700; }
.phrase .small { margin-top: 4px; line-height: 1.4; }
.play { flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-text); cursor: pointer; }
.play:hover { filter: brightness(1.1); }
.play:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tip { display: flex; gap: 12px; align-items: flex-start; padding: 14px; margin-bottom: 10px; background: var(--sun); border-radius: 16px; }
.tip .chip { background: transparent; color: var(--sun-ink); width: 28px; height: 28px; }
.tip p { margin: 0; }
.travel .line { align-items: center; }
.say-line { display: flex; flex-direction: column; align-items: flex-start; margin-top: 12px; }
.say-line.right { align-items: flex-end; }
.who { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 6px 3px; }
.bubble-line { max-width: 88%; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 10px 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); }
.say-line.right .bubble-line { background: var(--sky); border-radius: 16px 16px 4px 16px; }
.bubble-line .play { width: 36px; height: 36px; }
.bubble-line .ico { width: 18px; height: 18px; }
.bubble-line details { grid-column: 1 / -1; font-size: 15px; }
summary { cursor: pointer; color: var(--muted); font-size: 14px; min-height: 28px; }
.sign { padding: 18px; border-radius: 12px; background: #173a2c; color: #f4f1e3; border: 5px solid #e7dfc4; box-shadow: var(--shadow); }
.sign h3 { font-size: 20px; }
.sign p { white-space: pre-line; }
.sign summary { color: #cfd6bf; }
.travel .ex .tag { color: var(--sky-ink); background: var(--sky); padding: 3px 10px; border-radius: 999px; display: inline-block; margin-bottom: 8px; }
.travel .option { padding: 12px 14px; border-radius: 14px; }
.restyle { background: var(--sun); border-color: transparent; }
@media (max-width: 480px) {
  .trips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .trip-body { padding: 10px 11px 12px; }
  .trip-body b { font-size: 15px; }
  .hero h1 { font-size: 26px; }
  .hero img { aspect-ratio: 16 / 9; }
  .hook { font-size: 18px; }
  .phrases { grid-template-columns: 1fr; }
}

/* slowka i fiszki */
.chip { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.play { flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-text); cursor: pointer; }
.words-cta { display: flex; gap: 14px; align-items: center; text-decoration: none; margin: 16px 0 0; }
.words-cta:hover { border-color: var(--accent); }
.sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.set { display: flex; gap: 12px; align-items: center; padding: 14px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.set:hover { border-color: var(--accent); }
.set-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stack { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: var(--surface-2); margin: 4px 0 6px; }
.stack i { display: block; height: 100%; }
.s-umiem { background: var(--good); }
.s-troche { background: var(--warn); }
.s-nie { background: var(--bad); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 10px; }
.filter { font: inherit; font-size: 14px; min-height: 36px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; }
.filter[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.word { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.word-top { display: flex; gap: 12px; align-items: center; }
.word-top .text { flex: 1; min-width: 0; }
.word-top .es { font-size: 18px; font-weight: 700; }
.word-ex { margin: 10px 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.linklike { font: inherit; font-size: 14px; padding: 4px 0; min-height: 32px; border: 0; background: none; color: var(--accent); text-decoration: underline; cursor: pointer; }
.marks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mark { font: inherit; font-size: 14px; font-weight: 600; min-height: 40px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; }
.mark.m-nie[aria-pressed="true"] { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.mark.m-troche[aria-pressed="true"] { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.mark.m-umiem[aria-pressed="true"] { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.deck-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.flipcard { cursor: pointer; margin-bottom: 14px; }
.flip-inner { min-height: 300px; display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.face { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px 18px; text-align: center; animation: flip-in .22s ease; }
.face[hidden] { display: none; }
.face .big { font-size: 30px; line-height: 1.2; font-weight: 700; overflow-wrap: anywhere; }
.face .ex { margin: 6px 0 0; font-size: 18px; }
.face p { margin: 0; }
.hint { margin-top: 6px; }
@keyframes flip-in { from { opacity: 0; transform: rotateX(30deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .face { animation: none; } }
.grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grade[hidden] { display: none; }
.grade .btn { padding: 12px 6px; display: flex; justify-content: center; align-items: center; gap: 6px; }
.grade-nie { background: var(--bad-bg); color: var(--bad); }
.grade-troche { background: var(--warn-bg); color: var(--warn); }
.grade-umiem { background: var(--good-bg); color: var(--good); }
.key { font-size: 12px; font-weight: 600; opacity: .6; }
@media (hover: none) { .key { display: none; } }
