/* Font se učitava LOKALNO (bez Google servera — DSGVO). Fajl: fonts/PlusJakartaSans.ttf (vidi fonts/README.txt).
   Ako fajla nema, koristi se sistemski font. */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: local("Plus Jakarta Sans"), url("../fonts/PlusJakartaSans.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}
/* ========== Boje i osnovne vrijednosti ========== */
:root {
  --bg: #D4EBDB;
  --surface: #FFFFFF;
  --surface-2: #E8F4EC;
  --ink: #13241A;
  --ink-2: #4B6155;
  --line: #BCD9C5;
  --accent: #0E6B45;
  --accent-ink: #FFFFFF;
  --accent-soft: #D3EEDD;
  --pop: #F2694B;
  --pop-soft: #FDE7E1;
  --ok: #17803D;
  --ok-soft: #E1F3E6;
  --bad: #C62828;
  --bad-soft: #FBE4E4;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(10, 50, 25, .06), 0 4px 16px rgba(10, 50, 25, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1F15;
    --surface: #14291D;
    --surface-2: #1C3627;
    --ink: #EAF3EC;
    --ink-2: #9DB5A6;
    --line: #264532;
    --accent: #4CC98A;
    --accent-ink: #06170E;
    --accent-soft: #16392A;
    --pop: #FF8A6E;
    --pop-soft: #3A2019;
    --ok: #4ACF77;
    --ok-soft: #173422;
    --bad: #FF6B6B;
    --bad-soft: #3B1C1C;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 32px; padding-bottom: 64px; outline: none; }

/* ========== Zaglavlje ========== */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.logo-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 13px; letter-spacing: .02em; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.nav { display: flex; gap: 4px; }
.lang-switch { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang-btn { border: 0; background: none; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 800; color: var(--ink-2); letter-spacing: .03em; }
.lang-btn:hover { color: var(--ink); }
.lang-btn.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.nav a { text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 15px; color: var(--ink-2); }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a.active { color: var(--ink); background: var(--surface-2); }
.nav a.nav-cta { background: var(--accent); color: var(--accent-ink); }
.nav a.nav-cta:hover { filter: brightness(1.08); }
.footer { border-top: 1px solid var(--line); color: var(--ink-2); font-size: 13px; padding: 20px 0; }

/* ========== Tipografija ========== */
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 800; }
h2 { font-size: 26px; font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
.muted { color: var(--ink-2); }
.eyebrow { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 10px; }
.section { margin-top: 48px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }

/* ========== Dugmad i oznake ========== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 13px 22px; font-weight: 700; font-size: 16px; text-decoration: none; transition: transform .08s, filter .15s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-pop { background: var(--pop); color: #fff; }
.btn-pop:hover { filter: brightness(1.05); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-ghost:hover { background: var(--line); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.tag-level { background: var(--accent); color: var(--accent-ink); }

/* ========== Početna ========== */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; padding: 24px 0 8px; }
.hero p.lead { font-size: 18px; color: var(--ink-2); max-width: 520px; margin: 0 0 28px; }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: var(--shadow); }
.hero-q { font-size: 20px; font-weight: 700; margin: 8px 0 16px; }
.hero-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hero-opts span { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font-weight: 600; font-size: 15px; }
.hero-opts span.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.choice { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.choice:hover { transform: translateY(-2px); border-color: var(--accent); }
.choice .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; margin-bottom: 14px; background: var(--accent-soft); }
.choice.alt .ic { background: var(--pop-soft); }
.choice p { margin: 0; color: var(--ink-2); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat .num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.stat .lbl { color: var(--ink-2); font-size: 14px; }

/* ========== Lekcije ========== */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 14px; }
.chip:hover { border-color: var(--ink-2); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-ic { font-size: 24px; }
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--ink-2); font-size: 15px; }
.card-foot { margin-top: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; flex: 1; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.done-badge { color: var(--ok); font-weight: 700; font-size: 13px; }

/* ========== Stranica lekcije ========== */
.back { display: inline-flex; gap: 6px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; margin-bottom: 16px; }
.back:hover { color: var(--ink); }
.lesson { max-width: 760px; }
.lesson-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-top: 16px; }
.lesson-block p { margin: 0 0 14px; }
.ex { display: grid; gap: 8px; }
.ex-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); font-size: 15px; }
.ex-row b { font-weight: 700; }
.ex-row.single { grid-template-columns: 1fr; }
.ex-row span { color: var(--ink-2); }
.tip { margin-top: 16px; background: var(--pop-soft); border-radius: var(--radius); padding: 16px 20px; font-weight: 500; }
.tip b { color: var(--pop); }
.lesson-cta { margin-top: 28px; background: var(--accent); color: var(--accent-ink); border-radius: 20px; padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lesson-cta h3 { margin: 0 0 4px; }
.lesson-cta p { margin: 0; opacity: .85; }
.lesson-cta .btn { background: var(--accent-ink); color: var(--accent); }

/* ========== Podešavanje kviza ========== */
.setup { max-width: 820px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-top: 16px; }
.step-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-weight: 700; }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 13px; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.topic-opt { text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.topic-opt:hover { border-color: var(--ink-2); }
.topic-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.topic-opt .t { font-weight: 700; font-size: 15px; display: block; }
.topic-opt .s { font-size: 13px; color: var(--ink-2); }
.topic-opt .box { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font-size: 13px; color: var(--accent-ink); }
.topic-opt.on .box { background: var(--accent); border-color: var(--accent); }
.setup-foot { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ========== Kviz ========== */
.quiz { max-width: 720px; margin: 0 auto; }
.quiz-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.quiz-head .bar { height: 10px; }
.quiz-count { font-weight: 700; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.quit { background: none; border: 0; color: var(--ink-2); font-size: 22px; line-height: 1; padding: 4px; }
.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
.q-meta { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.q-type { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.q-prompt { font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 22px; line-height: 1.35; }
.opts { display: grid; gap: 10px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opt { text-align: left; border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 14px 16px; font-weight: 600; font-size: 17px; display: flex; gap: 12px; align-items: center; transition: border-color .12s, background .12s; }
.opt:hover:not([disabled]) { border-color: var(--ink-2); }
.opt .key { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-size: 13px; color: var(--ink-2); flex: none; }
.opt[disabled] { cursor: default; }
.opt.correct { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.opt.dim { opacity: .5; }

.fill-row { display: flex; gap: 10px; }
.fill-input { flex: 1; min-width: 0; border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; font: inherit; font-size: 18px; font-weight: 600; background: var(--surface); color: var(--ink); }
.fill-input:focus { outline: none; border-color: var(--accent); }
.fill-input.correct { border-color: var(--ok); background: var(--ok-soft); }
.fill-input.wrong { border-color: var(--bad); background: var(--bad-soft); }

.order-line { min-height: 60px; border: 2px dashed var(--line); border-radius: 14px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.order-line.correct { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.order-line.wrong { border-style: solid; border-color: var(--bad); background: var(--bad-soft); }
.order-line .ph { color: var(--ink-2); font-size: 14px; padding-left: 6px; }
.order-bank { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; min-height: 44px; }
.word { border: 1.5px solid var(--line); border-bottom-width: 3px; background: var(--surface); border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 16px; }
.word:hover:not([disabled]) { border-color: var(--ink-2); }
.word.used { visibility: hidden; }

.feedback { margin-top: 18px; border-radius: 16px; padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.feedback.ok { background: var(--ok-soft); }
.feedback.bad { background: var(--bad-soft); }
.feedback .fb-title { font-weight: 800; font-size: 17px; margin-bottom: 2px; }
.feedback.ok .fb-title { color: var(--ok); }
.feedback.bad .fb-title { color: var(--bad); }
.feedback .fb-text { font-size: 15px; }
.feedback .fb-body { flex: 1; min-width: 220px; }

/* ========== Rezultat ========== */
.result { max-width: 760px; margin: 0 auto; }
.score-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px; display: flex; gap: 28px; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow); }
.ring { --p: 0; width: 132px; height: 132px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); display: grid; place-items: center; flex: none; }
.ring > div { width: 104px; height: 104px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 28px; font-weight: 800; }
.score-text { flex: 1; min-width: 220px; }
.score-text h2 { margin-bottom: 6px; }
.review { margin-top: 28px; }
.review-item { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--bad); border-radius: 12px; padding: 16px 18px; margin-top: 10px; }
.review-item .rq { font-weight: 700; margin-bottom: 6px; }
.review-item .ra { font-size: 15px; }
.review-item .ra .your { color: var(--bad); font-weight: 600; }
.review-item .ra .right { color: var(--ok); font-weight: 700; }
.review-item .rx { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.review-item a { font-size: 14px; font-weight: 700; color: var(--accent); }
.perfect { background: var(--ok-soft); color: var(--ok); border-radius: 12px; padding: 16px; font-weight: 700; margin-top: 20px; }

.empty { text-align: center; padding: 60px 16px; color: var(--ink-2); }

/* ========== Mobilni ========== */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-card { display: none; }
  .choice-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; }
  .stat .num { font-size: 22px; }
  .stat .lbl { font-size: 12px; }
  .ex-row { grid-template-columns: 1fr; gap: 2px; }
  .q-card { padding: 20px; }
  .q-prompt { font-size: 20px; }
  .opts.two { grid-template-columns: 1fr; }
  .logo-text { display: none; }
  .nav a { padding: 7px 9px; font-size: 14px; }
  .nav a[data-nav="home"] { display: none; }
  .topbar-right { gap: 8px; }
  .lang-btn { padding: 5px 7px; }
}

/* Praznina u pitanju */
.blank { display: inline-block; min-width: 72px; border-bottom: 3px solid var(--accent); margin: 0 4px; transform: translateY(-4px); }

/* Nivoi (početna i lista lekcija) */
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.level-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.level-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.level-card h3 { margin: 0; }
.level-card p { margin: 0; color: var(--ink-2); font-size: 14px; flex: 1; }
.level-top { display: flex; justify-content: space-between; align-items: center; }
.level-badge { display: inline-grid; place-items: center; min-width: 44px; height: 32px; padding: 0 10px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 15px; }
.level-group { margin-bottom: 36px; }
.level-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.level-head h2 { margin: 0 0 2px; font-size: 22px; }
.level-head p { margin: 0; font-size: 14px; }
.topic-group { grid-column: 1 / -1; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin-top: 8px; }

/* Dugme za izgovor */
.say { border: 0; background: var(--surface); border-radius: 8px; width: 28px; height: 28px; margin-right: 8px; font-size: 14px; vertical-align: middle; box-shadow: var(--shadow); }
.say:hover { background: var(--accent-soft); }
.ex-row b { display: flex; align-items: center; }

/* ========== AI chat ========== */
.chat-root { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.chat-fab { display: flex; align-items: center; gap: 8px; border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 12px 18px 12px 14px; font-weight: 700; font-size: 15px; box-shadow: 0 6px 24px rgba(10, 50, 25, .25); }
.chat-fab:hover { filter: brightness(1.08); }
.chat-fab-ic { font-size: 20px; line-height: 1; }
.chat-root.open .chat-fab-label { display: none; }
.chat-root.open .chat-fab { padding: 12px 14px; }
.chat-panel { order: -1; width: 370px; height: min(560px, calc(100vh - 110px)); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 12px 40px rgba(10, 50, 25, .22); display: flex; flex-direction: column; overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--accent); color: var(--accent-ink); }
.chat-avatar { width: 36px; height: 36px; border-radius: 12px; background: color-mix(in srgb, var(--accent-ink) 20%, transparent); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.chat-head-text { flex: 1; min-width: 0; }
.chat-title { font-weight: 800; }
.chat-sub { font-size: 13px; opacity: .85; }
.chat-x { border: 0; background: none; color: inherit; font-size: 18px; padding: 4px 6px; opacity: .85; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.msg .bubble { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.45; word-wrap: break-word; }
.msg.assistant .bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.user .bubble { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.msg.sys .bubble { background: var(--pop-soft); border-color: transparent; font-size: 14px; }
.msg .bubble p { margin: 0 0 6px; }
.msg .bubble p:last-child { margin-bottom: 0; }
.msg .bubble ul { margin: 4px 0 6px; padding-left: 20px; }
.msg .bubble code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: 14px; }
.msg.typing .bubble { display: flex; gap: 4px; padding: 14px; }
.msg.typing .bubble span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-2); animation: chatDot 1s infinite ease-in-out; }
.msg.typing .bubble span:nth-child(2) { animation-delay: .15s; }
.msg.typing .bubble span:nth-child(3) { animation-delay: .3s; }
@keyframes chatDot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px; background: var(--bg); }
.chat-suggest:not(:empty) { padding-bottom: 10px; }
.chat-chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; text-align: left; }
.chat-chip:hover { border-color: var(--accent); color: var(--accent); }
.chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 15px; background: var(--surface); color: var(--ink); max-height: 120px; }
.chat-form textarea:focus { outline: none; border-color: var(--accent); }
.chat-send { border: 0; background: var(--accent); color: var(--accent-ink); width: 42px; height: 42px; border-radius: 12px; font-size: 17px; flex: none; }
.chat-notice { font-size: 11px; color: var(--ink-2); padding: 0 14px 10px; line-height: 1.35; }
@media (max-width: 760px) {
  .chat-root { right: 12px; bottom: 12px; }
  .chat-fab-label { display: none; }
  .chat-fab { padding: 14px; }
  .chat-panel { position: fixed; left: 8px; right: 8px; bottom: 76px; width: auto; height: calc(100vh - 150px); }
}

/* ========== Test nivoa ========== */
.test-card { border: 2px dashed var(--accent); background: var(--accent-soft); }
.test-card h3 { color: var(--accent); }
.test-badge { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.test-badge.ok { color: var(--ok); }
.test-tag { background: var(--pop-soft); color: var(--pop); }
.test-intro { max-width: 760px; }
.test-hero { display: flex; gap: 20px; align-items: center; }
.test-hero h1 { margin-bottom: 6px; }
.test-hero p { margin: 0; }
.level-badge.big { min-width: 76px; height: 76px; font-size: 26px; border-radius: 20px; }
.ring.pass { background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring.fail { background: conic-gradient(var(--pop) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring.pass > div { font-size: 44px; }
.topic-results { display: grid; gap: 8px; }
.topic-result { display: grid; grid-template-columns: minmax(160px, 1.2fr) 1fr 48px 150px; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.topic-result .tr-name { font-weight: 700; }
.topic-result .tr-score { font-weight: 700; text-align: right; }
.topic-result.weak { border-left: 4px solid var(--bad); }
.topic-result.weak .bar > i { background: var(--pop); }
.topic-result.good { border-left: 4px solid var(--ok); }
.topic-result a { font-size: 13px; font-weight: 700; color: var(--accent); text-align: right; }

/* ========== Priče ========== */
.choice-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.choice.story-choice .ic { background: #E6E1F7; }
.story-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.story { max-width: 780px; position: relative; }
.player { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 16px 0; position: sticky; top: 72px; z-index: 5; box-shadow: var(--shadow); }
.player .btn { padding: 10px 16px; font-size: 15px; }
.speed { display: flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.speed select { font: inherit; border: 1.5px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--surface); color: var(--ink); }
.player-hint { font-size: 13px; flex-basis: 100%; }
.story-text { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; font-size: 19px; line-height: 1.75; }
.story-text p { margin: 0 0 16px; }
.story-text p:last-child { margin: 0; }
.sent { cursor: pointer; border-radius: 6px; transition: background .15s; padding: 1px 0; }
.sent:hover { background: var(--surface-2); }
.sent.on { background: #FFE9A8; color: #13241A; }
.gw { font: inherit; color: inherit; background: none; border: 0; padding: 0; border-bottom: 2px dotted var(--accent); cursor: help; }
.gl-pop { position: absolute; z-index: 20; width: 250px; background: var(--ink); color: var(--bg); border-radius: 12px; padding: 12px 14px; font-size: 15px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.gl-pop .say { background: var(--surface); }
.story-questions { margin-top: 36px; }
.story-questions h2 { margin-bottom: 4px; }
.sq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-top: 14px; }
.sq-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.sq-num { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 14px; font-weight: 800; flex: none; }
.sq-head > div { flex: 1; }
.sq-q { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sq-tr { font-size: 14px; color: var(--ink-2); }
.sq-state { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; }
.sq-state.correct { background: var(--ok); }
.sq-state.partial { background: #D99A00; }
.sq-state.wrong { background: var(--bad); }
.sq-input { width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 17px; background: var(--surface); color: var(--ink); resize: vertical; margin-bottom: 10px; }
.sq-input:focus { outline: none; border-color: var(--accent); }
.rec-btn.recording { background: var(--bad); color: #fff; }
.sq-live { margin-top: 12px; font-size: 15px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sq-live .live-text { color: var(--ink); font-weight: 600; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: recPulse 1s infinite; }
@keyframes recPulse { 50% { opacity: .3; } }
.warn { background: var(--pop-soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-top: 8px; width: 100%; }
.fb { margin-top: 14px; border-radius: 14px; padding: 14px 16px; background: var(--surface-2); font-size: 15px; }
.fb.correct { background: var(--ok-soft); }
.fb.partial { background: #FFF3D6; }
.fb.wrong { background: var(--bad-soft); }
.fb-verdict { font-weight: 800; font-size: 18px; margin-bottom: 6px; }
.fb.correct .fb-verdict { color: var(--ok); }
.fb.partial .fb-verdict { color: #9A6B00; }
.fb.wrong .fb-verdict { color: var(--bad); }
.fb-msg { margin: 4px 0 8px; }
.heard { margin-bottom: 6px; }
.myrec { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; font-weight: 600; }
.myrec audio { height: 36px; max-width: 100%; }
.corr { background: var(--surface); border-radius: 10px; padding: 12px 14px; margin-top: 8px; }
.corr-lbl { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin-bottom: 4px; }
.diff { font-size: 17px; line-height: 1.7; }
.diff del { color: var(--bad); text-decoration: line-through; background: var(--bad-soft); border-radius: 4px; padding: 0 3px; }
.diff ins { color: var(--ok); text-decoration: none; background: var(--ok-soft); border-radius: 4px; padding: 0 3px; font-weight: 700; }
.issues { margin: 4px 0 0; padding-left: 18px; }
.issues li { margin-bottom: 6px; }
.issues .from { color: var(--bad); text-decoration: line-through; }
.issues .to { color: var(--ok); font-weight: 700; }
.issues .why { font-size: 13px; color: var(--ink-2); }
.noerr { font-weight: 700; color: var(--ok); margin-top: 6px; }
.model { margin-top: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pron { margin: 6px 0; }
.small { font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.story-score { margin-top: 16px; }
@media (max-width: 760px) {
  .topic-result { grid-template-columns: 1fr 60px; }
  .topic-result .bar { grid-column: 1 / -1; order: 3; }
  .topic-result a { grid-column: 1 / -1; order: 4; text-align: left; }
  .story-text { padding: 18px; font-size: 17px; }
  .player { top: 64px; }
  .test-hero { flex-direction: column; align-items: flex-start; }
  .nav a { padding: 7px 7px; font-size: 13px; }
}
.sq-live[hidden] { display: none; }

/* ========== Riječi ========== */
.words-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 18px 0 12px; }
.dl-btn { padding: 10px 16px; font-size: 15px; }
.words-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.w-search { flex: 1; min-width: 200px; border: 2px solid var(--line); border-radius: 12px; padding: 11px 14px; font: inherit; background: var(--surface); color: var(--ink); }
.w-search:focus { outline: none; border-color: var(--accent); }
.w-pos { border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; background: var(--surface); color: var(--ink); }
.w-count { font-size: 14px; }
.words-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.w-row { display: grid; grid-template-columns: minmax(150px, 1.1fr) 110px minmax(150px, 1.2fr) 2fr; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); align-items: center; font-size: 15px; }
.w-row:last-child { border-bottom: 0; }
.w-head { background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.w-word, .w-ex { display: flex; align-items: center; gap: 4px; }
.w-type { color: var(--ink-2); font-size: 13px; }
.w-ex span { color: var(--ink-2); }
.w-row:nth-child(odd):not(.w-head) { background: var(--surface-2); }
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 8px; gap: 6px; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .logo-text { display: inline; font-size: 16px; }
  .nav a[data-nav="home"] { display: none; }
  .w-row { grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .w-head { display: none; }
  .w-type { text-align: right; }
  .w-ex { grid-column: 1 / -1; font-size: 14px; }
  .player { top: 100px; }
}

/* ========== Telefon: veća dugmad, manje zauzetog ekrana ========== */
.topbar { transition: transform .25s ease; }
.topbar.hide { transform: translateY(-100%); }
@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 16px; }
  main.wrap { padding-top: 20px; padding-bottom: 40px; }
  h1 { font-size: 30px; }
  /* dodir: minimum ~40px */
  .lang-btn { padding: 9px 11px; font-size: 13px; }
  .nav a { padding: 10px 9px; }
  .say { width: 36px; height: 36px; font-size: 16px; }
  .quit { width: 44px; height: 44px; font-size: 24px; }
  .back { padding: 8px 0; }
  .gw { padding: 4px 0; }
  .chip { padding: 9px 14px; }
  .btn { min-height: 46px; }
  .speed select, .w-pos, .w-search, .fill-input, .sq-input, textarea, input, select { font-size: 16px; }
  /* plejer priče nije "zalijepljen" na telefonu — ne zaklanja pitanja */
  .player { position: static; box-shadow: none; }
  .player .btn { flex: 1; }
  .player #stopBtn { flex: 0 0 46px; }
  .speed { flex: 1 1 100%; }
  .player-hint { font-size: 12px; }
  /* kviz */
  .q-card { padding: 18px; border-radius: 18px; }
  .opt { padding: 14px; font-size: 16px; }
  .feedback { flex-direction: column; align-items: stretch; }
  .feedback .btn { width: 100%; }
  .fill-row { flex-direction: column; }
  .fill-row .btn { width: 100%; }
  .order-bank .word, .order-line .word { padding: 10px 14px; }
  .btn-row .btn { flex: 1 1 auto; }
  /* rezultat */
  .score-card { padding: 20px; gap: 16px; justify-content: center; text-align: center; }
  .score-card .btn-row { justify-content: center; }
  /* priče */
  .sq { padding: 16px; }
  .sq-q { font-size: 17px; }
  .diff { font-size: 16px; }
  .gl-pop { width: min(250px, calc(100vw - 48px)); }
  /* test nivoa */
  .level-badge.big { min-width: 60px; height: 60px; font-size: 22px; }
  /* sigurna zona (iPhone) */
  .footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
@media (hover: none) {
  .sent:hover { background: none; }
  .sent.on { background: #FFE9A8; }
  a.card:hover, .choice:hover, .level-card:hover { transform: none; }
}
@media (max-width: 760px) {
  .topbar-right { display: contents; }
  .logo { order: 1; }
  .lang-switch { order: 2; margin-left: auto; }
  .nav { order: 3; width: 100%; justify-content: space-between; gap: 2px; }
  .nav a { flex: 1; text-align: center; padding: 10px 4px; font-size: 14px; }
  .lang-btn { padding: 8px 10px; }
}
/* Podešavanje kviza: dugme "Počni" uvijek vidljivo na dnu ekrana (telefon) */
@media (max-width: 760px) {
  .setup-foot { position: sticky; bottom: 0; z-index: 6; background: var(--surface); border: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); margin: 16px -16px 0; box-shadow: 0 -6px 20px rgba(10, 50, 25, .12); }
  .setup-foot .btn { flex: 1 1 100%; }
  .topic-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .topic-opt { padding: 10px; gap: 8px; align-items: flex-start; }
  .topic-opt .t { font-size: 14px; }
  .topic-opt .s { font-size: 12px; }
  .topic-group { margin-top: 4px; }
}
@media (max-width: 360px) {
  .topic-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr 1fr; }
  .stat .num { font-size: 20px; }
  h1 { font-size: 27px; }
}
@media (max-width: 360px) {
  .logo-text { font-size: 15px; }
  .lang-btn { padding: 8px 8px; }
  .topbar-inner { column-gap: 4px; }
}
@media (max-width: 340px) {
  .logo-text { display: none; }
}
.seo-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; }
.seo-links a { color: var(--ink-2); font-size: 13px; }

/* ========== Podijeli rezultat ========== */
.share-box { margin-top: 20px; display: grid; grid-template-columns: 1fr 240px; gap: 20px; align-items: center; background: var(--surface); border: 2px solid var(--pop); border-radius: 24px; padding: 22px; box-shadow: var(--shadow); }
.share-box h3 { margin: 0 0 6px; }
.share-box p { margin: 0 0 14px; }
.share-img { width: 100%; border-radius: 16px; box-shadow: var(--shadow); }
.share-main { width: 100%; font-size: 17px; }
.share-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; border-radius: 12px; transition: box-shadow .2s; }
.share-links.pulse { box-shadow: 0 0 0 4px var(--pop-soft); }
.share-link { text-decoration: none; font-weight: 700; font-size: 14px; padding: 9px 14px; border-radius: 999px; background: var(--surface-2); border: 1.5px solid var(--line); }
.share-link:hover { border-color: var(--accent); color: var(--accent); }
.share-tools .btn { padding: 10px 14px; font-size: 14px; }
@media (max-width: 760px) {
  .share-box { grid-template-columns: 1fr; text-align: left; }
  .share-img { max-width: 260px; justify-self: center; order: -1; }
}
/* kratak natpis dugmeta na stranicama za Google (telefon) */
.seo-page .nav-cta .short { display: none; }
@media (max-width: 760px) { .seo-page .nav-cta .long { display: none; } .seo-page .nav-cta .short { display: inline; } }

/* ========== Traka za pristanak (Google Analytics) ========== */
.consent-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 100; max-width: 640px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(10, 50, 25, .2); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.consent-bar p { margin: 0; flex: 1 1 280px; font-size: 14px; }
.consent-btns { display: flex; gap: 8px; }
.consent-btns .btn { padding: 9px 16px; font-size: 14px; min-height: 0; }

/* ---------- Lista riječi na email ---------- */
.wl-box { margin: 26px 0 8px; scroll-margin-top: 90px; }
.wl-form { background: var(--surface); border: 1px solid rgba(14,107,69,.18); border-radius: 18px; padding: 20px 22px; box-shadow: 0 6px 20px rgba(14,107,69,.08); }
.wl-head h3 { margin: 0 0 4px; font-size: 20px; }
.wl-head p { margin: 0 0 14px; }
.wl-fields { display: flex; gap: 10px; flex-wrap: wrap; }
.wl-fields[hidden], .wl-news[hidden], .wl-msg[hidden] { display: none; }
.wl-email { flex: 1 1 240px; }
.wl-email input, .wl-level select { width: 100%; height: 48px; box-sizing: border-box; font: inherit; font-size: 16px; padding: 11px 14px; border-radius: 12px; border: 1.5px solid rgba(14,107,69,.3); background: var(--surface); color: var(--ink); }
.wl-email input:focus, .wl-level select:focus { outline: none; border-color: #0E6B45; box-shadow: 0 0 0 3px rgba(14,107,69,.18); }
.wl-level { flex: 0 0 auto; min-width: 150px; }
.wl-send { flex: 0 0 auto; }
.wl-send:disabled { opacity: .65; cursor: wait; }
.wl-news { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 14px; cursor: pointer; }
.wl-news input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: #0E6B45; flex: 0 0 auto; }
.wl-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.wl-msg { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.wl-msg.ok { background: #E3F4E9; color: #0A4D32; }
.wl-msg.err { background: #FDECEC; color: #8A1F1F; }
.wl-privacy { margin-top: 10px; }
.linkish { background: none; border: 0; padding: 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-color-scheme: dark) {
  .wl-email input, .wl-level select { border-color: var(--line); }
  .wl-msg.ok { background: var(--ok-soft); color: var(--ink); }
  .wl-msg.err { background: var(--bad-soft); color: var(--ink); }
}
@media (max-width: 560px) {
  .wl-form { padding: 16px; }
  .wl-level, .wl-send { flex: 1 1 100%; }
}

/* Oba dugmeta za pristanak jednako vidljiva (zahtjev njemačkih nadzornih tijela) */
.btn-consent { background: var(--accent); color: var(--accent-ink, #fff); border: 0; font-weight: 700; }
.consent-bar a { color: var(--accent); font-weight: 600; }
/* Pravni linkovi u dnu */
.legal-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; }
.legal-links a, .legal-links button { color: var(--ink-2); text-decoration: underline; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.legal-links a:hover, .legal-links button:hover { color: var(--accent); }
.voice-note { margin: 4px 0 12px; }
/* Pravne stranice */
.legal-doc { max-width: 780px; }
.legal-doc h2 { font-size: 20px; margin: 28px 0 8px; }
.legal-doc h3 { font-size: 16px; margin: 18px 0 6px; }
.legal-doc p, .legal-doc li { line-height: 1.6; }
.legal-doc table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 16px; }
.legal-doc th, .legal-doc td { text-align: left; border-bottom: 1px solid var(--line); padding: 8px 6px; vertical-align: top; }
.legal-doc .legal-note { background: var(--surface-2); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.legal-doc .todo { background: #FDECEC; color: #8A1F1F; border-radius: 6px; padding: 0 4px; font-weight: 700; }
@media (max-width: 700px) {
  .legal-doc table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .legal-doc th, .legal-doc td { min-width: 110px; }
}
.legal-doc { overflow-wrap: anywhere; }
.seo-footer .legal-links a { text-decoration: underline; }
