/* ================================================================ токени */
:root {
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bg: #f4f5fb;
  --bg-grad:
    radial-gradient(1100px 600px at 0% -10%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 60%),
    radial-gradient(900px 500px at 110% 0%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f2f3f9;
  --surface-3: #e7e9f3;
  --border: #e3e6f0;
  --border-strong: #cdd2e2;
  --text: #11142a;
  --text-2: #4b5170;
  --text-3: #8389a3;
  --accent: #5b5cf0;
  --accent-2: #9d5cf6;
  --accent-text: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --accent-ring: color-mix(in srgb, var(--accent) 35%, transparent);
  --ok: #16a34a;
  --ok-soft: rgba(22, 163, 74, .11);
  --bad: #e11d48;
  --bad-soft: rgba(225, 29, 72, .09);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, .12);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 30px -12px rgba(16, 24, 40, .14);
  --shadow-lg: 0 30px 80px -20px rgba(16, 24, 40, .35);
  --header-bg: rgba(255, 255, 255, .72);
  --radius: 16px;
  --radius-sm: 10px;
  --gutter: 20px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0a0c16;
  --bg-grad:
    radial-gradient(1100px 600px at 0% -10%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 60%),
    radial-gradient(900px 500px at 110% 0%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%);
  --surface: #131628;
  --surface-2: #1a1e33;
  --surface-3: #242944;
  --border: #252a45;
  --border-strong: #363c5e;
  --text: #eceefb;
  --text-2: #a9afcc;
  --text-3: #6f7695;
  --accent: #7d7eff;
  --accent-2: #b37dff;
  --accent-soft: color-mix(in srgb, var(--accent) 15%, transparent);
  --accent-ring: color-mix(in srgb, var(--accent) 45%, transparent);
  --ok: #34d47c;
  --ok-soft: rgba(52, 212, 124, .13);
  --bad: #ff5c80;
  --bad-soft: rgba(255, 92, 128, .12);
  --warn: #f5a623;
  --warn-soft: rgba(245, 166, 35, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .8);
  --header-bg: rgba(10, 12, 22, .72);
  color-scheme: dark;
}

/* стилови боја (дугмићи у менију теме) – свака тема има своју варијанту */
[data-accent="ocean"]  { --accent: #0369a1; --accent-2: #0891b2; }
[data-accent="mint"]   { --accent: #047857; --accent-2: #0d9488; }
[data-accent="sunset"] { --accent: #c2410c; --accent-2: #e11d48; }
[data-accent="rose"]   { --accent: #be185d; --accent-2: #9333ea; }
[data-theme="dark"][data-accent="ocean"]  { --accent: #3b9ee8; --accent-2: #22b8cf; }
[data-theme="dark"][data-accent="mint"]   { --accent: #22a67a; --accent-2: #14b8a6; }
[data-theme="dark"][data-accent="sunset"] { --accent: #f0703a; --accent-2: #f43f5e; }
[data-theme="dark"][data-accent="rose"]   { --accent: #ec4f9a; --accent-2: #c06cf0; }

/* ================================================================ основа */
*, *::before, *::after { box-sizing: border-box; }
/* величина слова: средња = подразумевана; бира се у менију теме (data-size на html) */
html { -webkit-text-size-adjust: 100%; background: var(--bg); font-size: 14.5px; }
html[data-size="small"] { font-size: 13px; }
html[data-size="large"] { font-size: 16px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: .965rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg) var(--bg-grad) fixed;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color .25s, color .25s;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); font-weight: 800; }
h2 { font-size: 1.12rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-ring); }
svg { display: block; }
.icon { width: 1.15em; height: 1.15em; display: inline-flex; flex: none; }
.icon svg { width: 100%; height: 100%; }

.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.sm { gap: 8px; }
.stack.lg { gap: 26px; }
.grow { flex: 1; }
.hidden { display: none !important; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--surface-3); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }

/* ================================================================ распоред */
.header {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--border);
}
/* замућење је на посебном слоју: filter на самом заглављу би „заробио” мени који на телефону стоји fixed на дну */
.header::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--header-bg);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
}
.header-in {
  max-width: 1180px; margin: 0 auto; padding: 6px var(--gutter);
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; color: var(--text); font-size: .98rem; }
.brand:hover { text-decoration: none; }
.logo {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 6px 16px -6px var(--accent);
}
.logo svg { width: 17px; height: 17px; }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.nav a {
  display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 9px;
  color: var(--text-2); font-weight: 600; font-size: .86rem; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 999px; background: var(--surface-2); font-weight: 600; font-size: .9rem; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
}

main.page { max-width: 1180px; margin: 0 auto; padding: 18px var(--gutter) 90px; animation: rise .25s ease; }
main.bare { min-height: 100vh; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { margin-top: 6px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }

.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* мобилна навигација на дну */
@media (max-width: 860px) {
  :root { --gutter: 16px; }
  .nav {
    position: fixed; bottom: 0; left: 0; right: 0; margin: 0; z-index: 50;
    justify-content: space-around; gap: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--header-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
  }
  .nav a { flex-direction: column; gap: 2px; font-size: .68rem; padding: 6px 4px; flex: 1; text-align: center; }
  .nav a .icon { width: 1.35em; height: 1.35em; }
  .user-chip .name { display: none; }
  .um-name { display: none; }
  main.page { padding-top: 20px; }
  .grid.c4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tile .v { font-size: 1.5rem; }
  .card { padding: 13px 14px; }
  .hero { padding: 18px; }
  .q { padding: 13px 14px; }
}

/* ================================================================ компоненте */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
}
.card.flat { box-shadow: none; }
.card.pad-lg { padding: 22px; }
.card.tight { padding: 12px 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  font-weight: 650; font-size: .88rem; line-height: 1.2; white-space: nowrap;
  transition: transform .08s, background .15s, border-color .15s, box-shadow .15s, opacity .15s;
  background: var(--surface-2); color: var(--text);
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .opt:focus-visible, .input:focus-visible, .chip:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-text);
  box-shadow: 0 8px 20px -8px var(--accent);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: #fff; }
.btn.ok { background: var(--ok-soft); color: var(--ok); }
.btn.ok:hover { background: var(--ok); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: .8rem; border-radius: 8px; }
.btn.lg { padding: 10px 18px; font-size: .95rem; border-radius: 12px; }
.btn.block { width: 100%; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--text-2); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .icon { width: 17px; height: 17px; }

.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-weight: 600; font-size: .9rem; }
.field .hint { font-size: .8rem; color: var(--text-3); }
.form-error { color: var(--bad); font-size: .9rem; font-weight: 500; min-height: 1.2em; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: .84rem;
  color: var(--text-2); transition: all .15s; user-select: none;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--accent)); }
.chip.on .dot { background: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
/* стручна верификација (сопствена боја, да се не меша са „Објављено”) */
:root { --verified: #0369a1; }
[data-theme="dark"] { --verified: #38bdf8; }
.badge.verified { background: color-mix(in srgb, var(--verified) 15%, transparent); color: var(--verified); display: inline-flex; align-items: center; gap: 4px; }
.badge.verified .icon { width: 1em; height: 1em; }
.btn.verify { background: color-mix(in srgb, var(--verified) 14%, transparent); color: var(--verified); }
.btn.verify:hover { background: var(--verified); color: #fff; }

.tabs { display: inline-flex; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.tabs button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; cursor: pointer;
  font-weight: 650; font-size: .84rem; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center;
}
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs a.tab-link { border: 0; background: transparent; padding: 7px 14px; border-radius: 10px; font-weight: 650; font-size: .84rem; color: var(--text-2); text-decoration: none; }
.tabs a.tab-link.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs .count { font-size: .75rem; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); }

.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .35s ease; }
.stackbar { display: flex; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.stackbar > span { height: 100%; transition: width .35s; }
.stackbar .m { background: var(--ok); }
.stackbar .s { background: var(--accent); opacity: .55; }
.stackbar .w { background: var(--bad); }

.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-3); }
.ring .val { transition: stroke-dashoffset .6s ease; }
.ring .label { position: absolute; font-weight: 800; letter-spacing: -.02em; }

.tile { display: flex; flex-direction: column; gap: 4px; }
.tile .k { font-size: .82rem; color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tile .v { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; }
.tile .s { font-size: .8rem; color: var(--text-3); }

.empty { text-align: center; padding: 44px 20px; color: var(--text-2); }
.empty .big { font-size: 2.4rem; margin-bottom: 8px; }
.empty h3 { margin-bottom: 6px; color: var(--text); }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }

.alert { border-radius: 14px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; background: var(--accent-soft); }
.alert.warn { background: var(--warn-soft); }
.alert.bad { background: var(--bad-soft); }
.alert .icon { color: var(--accent); margin-top: 2px; }

/* ================================================================ модал и обавештења */
.modal-back {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 10, 20, .5); backdrop-filter: blur(4px); animation: fade .15s ease;
}
.modal-back.closing { opacity: 0; transition: opacity .15s; }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg);
  animation: rise .2s ease;
}
.modal.wide { width: min(720px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.modal-body { padding: 8px 20px 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }

#toasts { position: fixed; z-index: 200; left: 50%; bottom: 90px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  padding: 11px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600; font-size: .92rem;
  box-shadow: var(--shadow-lg); animation: rise .2s ease; max-width: 90vw;
}
.toast.bad { background: var(--bad); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

/* ================================================================ пријава */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; position: relative; }
.auth-card { width: min(440px, 100%); padding: 32px; }
.auth-card .brand { justify-content: center; margin-bottom: 18px; font-size: 1.2rem; }
.auth-card h1 { font-size: 1.6rem; text-align: center; margin-bottom: 4px; }
.auth-theme { position: absolute; top: 16px; right: 16px; }
.parent-box { border: 1px dashed var(--border-strong); border-radius: 16px; padding: 16px; background: var(--surface-2); }

/* ================================================================ почетна */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 20px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 24px 60px -24px var(--accent);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 22px; flex-wrap: wrap;
}
.hero::after {
  content: ''; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; border-radius: 50%;
  background: rgba(255, 255, 255, .12); pointer-events: none;
}
.hero .eyebrow { font-weight: 600; opacity: .85; font-size: .9rem; }
.hero h1 { margin: 6px 0 8px; }
.hero p { opacity: .92; max-width: 520px; }
.hero .btn { position: relative; z-index: 1; }
.hero .btn.white { background: #fff; color: #2b2c7a; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .4); }
.hero .btn.glass { background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .3); }
.hero .btn.glass:hover { background: rgba(255, 255, 255, .26); }

.subject-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 14px; }
.subject-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); }
.subject-card .meta { display: flex; gap: 16px; align-items: center; }
.subject-card.soon { opacity: .6; }

.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.bars .b span { display: block; border-radius: 5px 5px 2px 2px; min-height: 2px; }
.bars .b .all { background: var(--surface-3); }
.bars .b .ok { background: linear-gradient(180deg, var(--accent), var(--accent-2)); position: absolute; bottom: 0; left: 0; right: 0; }
.bars .b:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); font-size: .72rem; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 2;
}

/* ================================================================ вежбање – подешавање */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.mode {
  text-align: left; padding: 10px 13px; border-radius: 13px; border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; transition: all .15s; display: flex; flex-direction: column; gap: 4px;
}
.mode:hover { border-color: var(--accent); }
.mode.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.mode b { font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.mode span { font-size: .78rem; color: var(--text-2); line-height: 1.4; }
.setup-foot {
  position: sticky; bottom: 16px; z-index: 30; margin-top: 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 10px 12px 10px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
@media (max-width: 860px) { .setup-foot { bottom: 84px; } }
.area-tree { display: flex; flex-direction: column; gap: 2px; }
.area-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer; }
.area-row:hover { background: var(--surface-2); }
.area-row.child { padding-left: 34px; }
.area-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.area-row .n { margin-left: auto; font-size: .8rem; color: var(--text-3); }

/* ================================================================ тест */
.qz { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.qz-top { position: sticky; top: 50px; z-index: 20; padding: 8px 12px; display: flex; flex-direction: column; gap: 7px; }
.qz-top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qz-title { font-weight: 750; font-size: .88rem; }
.qz-counter { font-size: .76rem; color: var(--text-2); }
.qz-timer { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 600; font-size: .9rem; }
.qz-nav { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: thin; padding: 4px 4px 6px; margin: -4px -4px -4px; } /* padding: да се оквир тренутног питања (outline) не одсеца */
.qn {
  flex: none; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); font-size: .74rem; font-weight: 700; color: var(--text-2); cursor: pointer;
}
.qn.s-answered, .qn.s-pending { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.qn.s-correct { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.qn.s-near { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.qn.s-partial { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.qn.s-wrong { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.qn.cur { outline: 2px solid var(--accent); outline-offset: 1px; }
.qz-stage { display: flex; flex-direction: column; gap: 10px; }
.qz-foot {
  position: sticky; bottom: 10px; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 7px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
@media (max-width: 860px) {
  .qz-top { top: 58px; }
  .qz-foot { bottom: 82px; }
  .qz-foot .btn { padding: 10px 13px; }
}

/* ================================================================ питање */
.q { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 11px; }
.q.compact { box-shadow: none; padding: 14px; }
.q-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .74rem; color: var(--text-3); font-weight: 600; }
.q-meta .sep { opacity: .5; }
.q-prompt { font-size: 1rem; font-weight: 500; line-height: 1.55; overflow-wrap: anywhere; }
.q-instruction { font-size: .8rem; color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.md p + p { margin-top: .7em; }
.md u { text-decoration-thickness: 2px; text-underline-offset: 3px; }
.md img.q-img { max-width: 100%; border-radius: 12px; margin: 6px 0; background: #fff; }
.opt-text img.q-img { max-width: 160px; margin: 2px 0; }
.q-images { display: flex; flex-wrap: wrap; gap: 12px; }
.q-images figure { margin: 0; flex: 1 1 260px; }
.q-images img { max-width: 100%; border-radius: 12px; border: 1px solid var(--border); background: #fff; }
.q-images figcaption { font-size: .8rem; color: var(--text-3); margin-top: 4px; }
/* pick – клик на слици (поље мреже или пресек линија) */
.pick { position: relative; max-width: 100%; border-radius: 12px; border: 1px solid var(--border); background: #fff; overflow: hidden; user-select: none; -webkit-user-select: none; }
.q-images .pick img { display: block; width: 100%; height: auto; border: 0; border-radius: 0; }
.pick-layer { position: absolute; inset: 0; }
.pick-t { position: absolute; padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; }
.pick-t[disabled] { cursor: default; }
.pick-cell .pick-t:not([disabled]):hover { background: rgba(91, 92, 240, .14); }
.pick-cell .pick-t.on { background: rgba(91, 92, 240, .55); }
.pick-cell .pick-t.ok { background: rgba(22, 163, 74, .55); }
.pick-cell .pick-t.ok.missed { background: transparent; outline: 3px dashed #16a34a; outline-offset: -3px; }
.pick-cell .pick-t.bad { background: rgba(225, 29, 72, .5); }
.pick-point .pick-m { width: 34%; aspect-ratio: 1; max-width: 18px; border-radius: 50%; }
.pick-point .pick-t:not([disabled]):hover .pick-m { background: rgba(91, 92, 240, .35); }
.pick-point .pick-t.on .pick-m { background: #5b5cf0; box-shadow: 0 0 0 3px rgba(91, 92, 240, .3); }
.pick-point .pick-t.ok .pick-m { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .3); }
.pick-point .pick-t.ok.missed .pick-m { background: transparent; border: 3px solid #16a34a; box-shadow: none; }
.pick-point .pick-t.bad .pick-m { background: #e11d48; box-shadow: 0 0 0 3px rgba(225, 29, 72, .3); }

.passage { border: 1px solid var(--border); border-radius: 16px; background: var(--surface-2); overflow: hidden; }
.passage summary { cursor: pointer; padding: 8px 14px; font-size: .9rem; font-weight: 700; display: flex; align-items: center; gap: 8px; list-style: none; }
.passage summary::-webkit-details-marker { display: none; }
.passage summary::after { content: '▾'; margin-left: auto; color: var(--text-3); transition: transform .2s; }
.passage:not([open]) summary::after { transform: rotate(-90deg); }
.passage .md { padding: 0 16px 12px; font-size: .93rem; line-height: 1.6; max-height: 340px; overflow: auto; }

.options { display: flex; flex-direction: column; gap: 6px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  padding: 7px 12px; border-radius: 11px; border: 1.5px solid var(--border); background: var(--surface);
  transition: border-color .12s, background .12s, transform .08s; font-size: .93rem; min-width: 0;
}
.opt:hover:not([disabled]) { border-color: var(--accent); background: var(--accent-soft); }
.opt:active:not([disabled]) { transform: scale(.995); }
.opt[disabled] { cursor: default; }
.opt-letter {
  width: 26px; height: 26px; border-radius: 7px; flex: none; display: grid; place-items: center;
  background: var(--surface-2); font-weight: 800; font-size: .82rem; color: var(--text-2); transition: all .12s;
}
.opt.multi .opt-letter { border-radius: 8px; }
.opt-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.opt-mark { margin-left: auto; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.opt.selected { border-color: var(--accent); background: var(--accent-soft); }
.opt.selected .opt-letter { background: var(--accent); color: #fff; }
.opt.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.is-correct .opt-letter { background: var(--ok); color: #fff; }
.opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.is-wrong .opt-letter { background: var(--bad); color: #fff; }
.opt.is-missed { border-style: dashed; border-color: var(--ok); }

.tf { display: flex; flex-direction: column; gap: 6px; }
.tf-row { display: flex; align-items: center; gap: 12px; padding: 6px 8px 6px 13px; border-radius: 11px; font-size: .93rem; border: 1px solid var(--border); }
.tf-row.r-correct { border-color: var(--ok); background: var(--ok-soft); }
.tf-row.r-wrong { border-color: var(--bad); background: var(--bad-soft); }
.tf-text { flex: 1; }
.tf-num { flex: none; min-width: 2em; margin-right: 4px; padding-right: 10px; border-right: 1px solid var(--border); font-weight: 700; color: var(--text-3); text-align: right; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 11px; padding: 3px; gap: 3px; flex: none; }
.seg button { border: 0; background: transparent; padding: 5px 10px; border-radius: 7px; cursor: pointer; font-weight: 700; font-size: .8rem; color: var(--text-2); }
.seg button.on { background: var(--accent); color: #fff; }
.seg button.sol { box-shadow: inset 0 0 0 2px var(--ok); color: var(--ok); }
.seg button.on.sol { background: var(--ok); color: #fff; }
.seg button.on.bad { background: var(--bad); color: #fff; }
.seg button[disabled] { cursor: default; }

.blank-input {
  display: inline-block; min-width: 140px; width: auto; max-width: 100%; padding: 6px 10px; margin: 2px 4px;
  border: 0; border-bottom: 2px solid var(--accent); border-radius: 8px 8px 2px 2px; background: var(--accent-soft);
  font-size: .95rem; font-weight: 600; vertical-align: baseline;
}
.blank-input:focus { outline: none; background: var(--surface-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.blanks { display: flex; flex-direction: column; gap: 10px; }
.blank-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.blank-row .lbl { font-weight: 700; color: var(--text-2); min-width: 24px; }
.blank-row .lbl.wide { min-width: 12.5em; }
.blank-row .blank-input { flex: 1; min-width: 180px; margin: 0; padding: 7px 10px; }
.ans { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; margin: 2px 3px; border-radius: 8px; font-weight: 650; }
.ans.r-correct { background: var(--ok-soft); color: var(--ok); }
.ans.r-near { background: var(--warn-soft); color: var(--warn); }
.ans.r-partial { background: var(--warn-soft); color: var(--warn); }
.ans.r-wrong { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.ans.r-sol { background: var(--ok-soft); color: var(--ok); }
.ans.r-empty { background: var(--surface-2); color: var(--text-3); font-style: italic; }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .match { grid-template-columns: 1fr; } }
.match-left { display: flex; flex-direction: column; gap: 10px; }
.match-row { display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 12px; border-radius: 11px; font-size: .93rem; border: 1px solid var(--border); }
.match-row.r-correct { border-color: var(--ok); background: var(--ok-soft); }
.match-row.r-wrong { border-color: var(--bad); background: var(--bad-soft); }
.match-row .t { flex: 1; font-weight: 600; }
.match-row select { width: auto; min-width: 88px; padding: 8px 10px; }
.match-right { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.match-right .it { display: flex; gap: 10px; }
.match-right .it b { color: var(--accent); min-width: 22px; }

.order { display: flex; flex-direction: column; gap: 8px; }
.order-item { display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 12px; border-radius: 11px; font-size: .93rem; border: 1.5px solid var(--border); background: var(--surface); transition: transform .15s; }
.order-item .num { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: .85rem; flex: none; }
.order-item .t { flex: 1; }
.order-item.r-correct { border-color: var(--ok); background: var(--ok-soft); }
.order-item.r-wrong { border-color: var(--bad); background: var(--bad-soft); }
.order-item .mv { display: flex; gap: 4px; }
.order-item .mv button { width: 34px; height: 34px; }

.self { display: flex; flex-direction: column; gap: 10px; }
.self .box { border-radius: 14px; padding: 14px 16px; background: var(--surface-2); }
.self .box.model { background: var(--ok-soft); }
.self .box h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin-bottom: 6px; }

.solution-label { font-size: .78rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ok); margin-top: 4px; }

/* жалба */
.appeal { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: 12px; font-size: .88rem; background: var(--surface-2); color: var(--text-2); }
.appeal svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.appeal.pending { background: var(--warn-soft); color: var(--warn); }
.appeal.approved { background: var(--ok-soft); color: var(--ok); }
.appeal.rejected { background: var(--bad-soft); color: var(--bad); }
.nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .7rem; font-weight: 800; margin-left: 4px; }

/* заокружи појам (text поље са choices) */
.ch { display: inline; white-space: normal; }
.ch-sep { color: var(--text-3); margin: 0 2px; }
.ch-w { border: 2px solid var(--border-strong); background: transparent; color: inherit; font: inherit; font-weight: 650; padding: 1px 9px; margin: 2px 0; border-radius: 999px; cursor: pointer; line-height: 1.5; }
.ch-w:not([disabled]):hover { background: var(--accent-soft); }
.ch-w.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.ch-w[disabled] { cursor: default; border-color: transparent; }
.ch-w.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.ch-w.ok.missed { border-style: dashed; background: transparent; }
.ch-w.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }

/* означи речи */
.mw { font-size: 1rem; line-height: 2.6; padding: 4px 2px; }
.mw-w { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent; padding: 0 3px; border-radius: 8px; cursor: pointer; font-size: inherit; line-height: 1.3; vertical-align: top; color: inherit; }
.mw-w.plain { cursor: default; }
.mw-t { padding: 2px 4px; border-radius: 7px; transition: background .12s; }
.mw-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); transition: all .12s; }
.mw-w:not([disabled]):hover .mw-t { background: var(--accent-soft); }
.mw-w.on .mw-t { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.mw-w.on .mw-dot { background: var(--accent); border-color: var(--accent); }
.mw-w.ok .mw-t { background: var(--ok-soft); color: var(--ok); font-weight: 650; }
.mw-w.ok .mw-dot { background: var(--ok); border-color: var(--ok); }
.mw-w.ok.missed .mw-dot { background: transparent; border-style: dashed; }
.mw-w.bad .mw-t { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }
.mw-w.bad .mw-dot { background: var(--bad); border-color: var(--bad); }
.mw-w[disabled] { cursor: default; }
.mw-w.allowed .mw-t { background: var(--surface-2); color: var(--text-2); }
.mw-w.allowed .mw-dot { border-style: dotted; border-color: var(--text-3); }

/* запете (commas) */
.cm-row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cm-n { min-width: 1.4em; }
.cm { flex: 1; line-height: 2.1; }
.cm-w { white-space: nowrap; }
.cm-gap { display: inline-flex; align-items: flex-end; justify-content: center; width: 16px; height: 1.6em; margin: 0 1px; padding: 0; border: 0; border-bottom: 2px dotted var(--border-strong); background: transparent; border-radius: 4px; cursor: pointer; vertical-align: baseline; color: inherit; font: inherit; }
.cm-gap:not([disabled]):hover { background: var(--accent-soft); border-bottom-color: var(--accent); }
.cm-gap[disabled] { cursor: default; border-bottom-color: transparent; }
.cm-c { font-weight: 800; font-size: 1.25em; line-height: 1; }
.cm-gap.on .cm-c { color: var(--accent); }
.cm-gap.on { border-bottom-color: var(--accent); }
.cm-gap.ok .cm-c { color: var(--ok); }
.cm-gap.ok { background: var(--ok-soft); }
.cm-gap.ok.missed { background: transparent; border-bottom: 2px dashed var(--ok); }
.cm-gap.bad { background: var(--bad-soft); }
.cm-gap.bad .cm-c { color: var(--bad); text-decoration: line-through; }

/* повратна информација */
.fb { border-radius: var(--radius); padding: 11px 14px; display: flex; flex-direction: column; gap: 9px; animation: pop .3s ease; border: 1px solid transparent; }
.fb.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.fb.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.fb.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.fb.neutral { background: var(--surface); border-color: var(--border); }
.fb-head { display: flex; align-items: center; gap: 12px; }
.fb-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.fb.ok .fb-icon { background: var(--ok); }
.fb.bad .fb-icon { background: var(--bad); }
.fb.warn .fb-icon { background: var(--warn); }
.fb.neutral .fb-icon { background: var(--accent); }
.fb-title { font-weight: 800; font-size: .98rem; }
.fb-score { margin-left: auto; font-weight: 700; font-size: .9rem; color: var(--text-2); }
.explain { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 12px 15px; display: flex; flex-direction: column; gap: 8px; font-size: .92rem; }
.explain-title { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: .92rem; color: var(--accent); }
.videos { display: flex; flex-direction: column; gap: 6px; }
.video-link { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text); font-weight: 550; font-size: .92rem; }
.video-link:hover { background: var(--surface-3); text-decoration: none; }
.video-link .icon { color: #ef4444; }

/* резултати / ревизија */
.res-item { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
.res-item > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: .92rem; }
.res-item > summary::-webkit-details-marker { display: none; }
.res-item > summary:hover { background: var(--surface-2); }
.res-item[open] > summary { border-bottom: 1px solid var(--border); }
.res-item .body { padding: 16px; display: flex; flex-direction: column; gap: 14px; background: var(--surface-2); }
.res-num { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: .88rem; flex: none; background: var(--surface-3); }
.res-num.correct { background: var(--ok); color: #fff; }
.res-num.near, .res-num.partial { background: var(--warn); color: #fff; }
.res-num.wrong { background: var(--bad); color: #fff; }
.res-num.pending { background: var(--accent); color: #fff; }
.res-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }

.score-hero { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.score-hero > .grow { min-width: 260px; }
.score-hero .big { font-size: 2rem; font-weight: 850; letter-spacing: -.04em; }

table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.t td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tr.child td:first-child { padding-left: 28px; color: var(--text-2); }
.table-wrap { overflow-x: auto; }

/* админ */
.filt { gap: 8px; }
.filt .input { padding: 7px 10px; }
.filt .input.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.admin-q { display: flex; flex-direction: column; gap: 12px; }
.admin-q .bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-q .code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .8rem; color: var(--text-2); }
.err-list { margin: 6px 0 0; padding-left: 18px; color: var(--bad); font-size: .88rem; }

.md ul, .md ol { margin: .45em 0; padding-left: 1.35em; }
.md li + li { margin-top: .3em; }
.md p + ul, .md p + ol, .md ul + p, .md ol + p { margin-top: .6em; }

/* питање уз текст: на широком екрану текст лево, питање десно */
@media (min-width: 1000px) {
  .qz:has(.with-passage) { max-width: 1240px; }
  .q.with-passage { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 22px; row-gap: 11px; align-items: start; }
  .q.with-passage > * { grid-column: 2; }
  .q.with-passage > .passage { grid-column: 1; grid-row: 1 / span 20; position: sticky; top: 160px; }
  .q.with-passage > .passage .md { max-height: calc(100vh - 250px); }
  .q.with-passage > .passage summary { cursor: default; }
  .q.with-passage > .passage summary::after { display: none; }
}

/* самопроцена по мерилима */
.rubric-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; }
.rubric-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ok); flex: none; }
.self .box.model { max-height: none; }

/* ================================================================ формулари: лозинка са оком, провере */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 42px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--text-3); cursor: pointer; display: grid; place-items: center; padding: 0; }
.pw-eye:hover { color: var(--text); background: var(--surface-2); }
.pw-eye svg { width: 18px; height: 18px; }
.field-note { font-size: .8rem; min-height: 1.1em; color: var(--text-3); }
.field-note.ok { color: var(--ok); }
.field-note.bad { color: var(--bad); }

/* ================================================================ породица и преглед детета */
.kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.kid-card { display: flex; flex-direction: column; gap: 12px; }
.kid-card .top { display: flex; gap: 12px; align-items: center; }
.kid-card .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.kid-card .nums b { display: block; font-size: 1.25rem; }
.kid-card .nums span { font-size: .75rem; color: var(--text-3); }
.invite-code { font-family: ui-monospace, Consolas, monospace; font-size: 1.5rem; font-weight: 800; letter-spacing: .12em; padding: 8px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: inline-block; }
.child-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent); margin-bottom: 14px; }
/* у прегледу детета родитељ само гледа – дугмад за вежбање се крију */
.child-ro .btn:not(.keep), .child-ro .icon-btn:not(.keep), .child-ro .self, .child-ro .flag-btn { display: none !important; }

/* ================================================================ профил (горе десно) */
.av { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; background: var(--surface-2); }
.av-init { background: hsl(var(--h, 250) 65% 52%); color: #fff; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.user-menu { position: relative; }
.um-btn { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; }
.um-btn:hover, .um-btn[aria-expanded="true"] { border-color: var(--accent); }
.um-btn > .icon { width: 14px; height: 14px; color: var(--text-3); }
.um-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 270px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg);
  padding: 10px; display: grid; gap: 8px; animation: rise .15s ease;
}
.um-head { display: flex; gap: 12px; align-items: center; padding: 4px 4px 10px; border-bottom: 1px solid var(--border); }
.um-who { display: grid; gap: 2px; min-width: 0; }
.um-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-who .badge { justify-self: start; margin-top: 2px; }
.um-links { display: grid; gap: 2px; }
.um-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); font: inherit; font-weight: 600; font-size: .9rem; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; }
.um-item:hover { background: var(--surface-2); text-decoration: none; }
.um-item .icon { width: 17px; height: 17px; color: var(--text-2); }
.um-sec { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 10px 4px; }
.um-logout { color: var(--bad); }
.um-logout .icon { color: var(--bad); }
.avatar-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-pick button { padding: 0; border: 2px solid transparent; border-radius: 50%; background: none; cursor: pointer; line-height: 0; }
.avatar-pick button.on, .avatar-pick button:hover { border-color: var(--accent); }
.profile-top { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* ================================================================ мени теме */
.theme-menu { position: relative; }
.theme-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 236px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg);
  padding: 12px; display: grid; gap: 10px; animation: rise .15s ease;
}
.theme-panel .lbl { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.theme-panel .seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.theme-panel .seg button {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font: inherit; font-weight: 600; cursor: pointer;
}
.theme-panel .seg.three { grid-template-columns: 1fr 1fr 1fr; }
.theme-panel .seg.three button { padding: 8px 4px; }
.theme-panel .seg button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border-strong); background: linear-gradient(135deg, var(--a), var(--b)); padding: 0;
}
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.swatch:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }

/* ================================================================ симулација питања (админ) */
.modal.sim { width: min(1100px, 100%); max-height: calc(100vh - 24px); }
.sim-note { font-size: 13px; }

/* ================================================================ табела са кружићима (matching layout: grid) */
.mgrid-wrap { overflow-x: auto; }
.mgrid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .93rem; }
.mgrid th, .mgrid td { border-bottom: 1px solid var(--border); padding: 9px 10px; text-align: center; vertical-align: middle; }
.mgrid thead th { font-weight: 700; color: var(--text-2); font-size: .85rem; }
.mgrid tbody th { text-align: left; font-weight: 600; }
.mgrid .md p { margin: 0; }
.mgrid tr.r-correct th { color: var(--ok); }
.mgrid tr.r-wrong th { color: var(--bad); }
.mgrid .dot {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface);
  cursor: pointer; padding: 0; transition: transform .1s, background .15s;
}
.mgrid .dot:hover:not([disabled]) { border-color: var(--accent); transform: scale(1.08); }
.mgrid .dot.on { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface); }
.mgrid .dot.sol { border-color: var(--ok); }
.mgrid .dot.on.sol { background: var(--ok); border-color: var(--ok); }
.mgrid .dot.on.bad { background: var(--bad); border-color: var(--bad); }
.mgrid .dot[disabled] { cursor: default; }

/* ================================================================ телефон и таблет */
/* слике питања се смањују по ширини екрана (и када имају задату ширину) */
.q-images figure { min-width: 0; max-width: 100%; }
.q-images img { height: auto; }

/* табела са кружићима: на уском екрану стаје у ширину – ужи размаци, мањи текст, ломљење речи */
@media (max-width: 600px) {
  .mgrid { table-layout: fixed; font-size: .84rem; }
  .mgrid th, .mgrid td { padding: 8px 3px; }
  .mgrid thead th { font-size: .72rem; line-height: 1.25; overflow-wrap: anywhere; hyphens: auto; }
  .mgrid thead th:first-child, .mgrid tbody th { width: 38%; overflow-wrap: anywhere; hyphens: auto; padding-left: 4px; }
  .mgrid .dot { width: 24px; height: 24px; }
  .ch-w { padding: 1px 7px; }
}

/* телефон положено (мало висине): мени само са иконама, заглавље теста се не лепи за врх */
@media (max-width: 860px) and (max-height: 520px) and (orientation: landscape) {
  .header { position: relative; }
  .nav a { padding: 4px; font-size: 0; gap: 0; }
  .nav a .icon { width: 20px; height: 20px; }
  .qz-top { position: static; }
  .qz-foot { bottom: 52px; }
  .setup-foot { bottom: 54px; }
  main.page { padding-bottom: 64px; }
}

/* разломак {{a|b}}: бројилац изнад имениоца, разломачка црта */
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; font-size: .86em; line-height: 1.15; margin: 0 .12em; text-align: center; }
.frac .fn { border-bottom: 1.5px solid currentColor; padding: 0 .2em; }
.frac .fd { padding: 0 .2em; }
