:root { --bg:#f6f4ef; --fg:#1d1c1a; --muted:#6b675f; --card:#fffdf8; --line:#e2ddd2; --acc:#1f5f8b; --acc2:#e6a23c; --ok:#2e7d4f; --warn:#b8562e; }
@media (prefers-color-scheme: dark) { :root { --bg:#161513; --fg:#ebe7df; --muted:#9a948a; --card:#201e1b; --line:#35322d; --acc:#6fb0dd; } }
* { box-sizing:border-box }
body { margin:0; font: 16px/1.5 -apple-system, "Helvetica Neue", Arial, sans-serif; background:var(--bg); color:var(--fg); }
header { display:flex; align-items:center; gap:10px; padding:calc(10px + env(safe-area-inset-top)) 14px 10px; border-bottom:1px solid var(--line); background:var(--card); position:sticky; top:0; z-index:5 }
header h1 { font-size:17px; margin:0; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
header button, .btn { font:inherit; border:1px solid var(--line); background:var(--card); color:var(--fg); border-radius:10px; padding:8px 12px; cursor:pointer }
.btn.primary { background:var(--acc); color:#fff; border-color:var(--acc) }
.btn:disabled { opacity:.5 }
main { padding:16px; max-width:900px; margin:0 auto }
.card { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:14px 16px; margin-bottom:14px }
.muted { color:var(--muted); font-size:14px }
.row { display:flex; gap:10px; flex-wrap:wrap; align-items:center }
.grow { flex:1 } .right { text-align:right }
.mt0 { margin-top:0 } .mt4 { margin-top:4px } .mt8 { margin-top:8px } .mt10 { margin-top:10px } .mb0 { margin-bottom:0 } .mb4 { margin-bottom:4px }
input, select, textarea { font:inherit; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--bg); color:var(--fg); width:100%; min-width:0 }
.hidden { display:none !important }
.pog { margin-bottom:10px }
.pog h3 { margin:8px 0 4px; font-size:15px }
.tema { display:flex; align-items:center; gap:10px; padding:7px 0; border-top:1px solid var(--line) }
.tema .ime { flex:1 } .tema .ime small { display:block; color:var(--muted); font-size:12px }
.dot { width:12px; height:12px; border-radius:50%; background:var(--line); flex:none }
.dot.delo { background:var(--acc2) } .dot.obvladano { background:var(--ok) }
.vr { font-size:12px; color:var(--muted); border:1px solid var(--line); border-radius:6px; padding:0 5px }
.tema select { width:auto; font-size:13px; padding:4px 8px }
.progress { height:8px; background:var(--line); border-radius:4px; overflow:hidden; display:flex }
.progress i { display:block; height:100%; width:0 } .progress .ok { background:var(--ok) } .progress .delo { background:var(--acc2) }
#chat { display:flex; flex-direction:column; min-height:calc(100vh - 140px) }
#msgs { flex:1; display:flex; flex-direction:column; gap:10px; padding-bottom:12px }
.msg { max-width:92%; padding:10px 14px; border-radius:14px; overflow-wrap:anywhere }
.msg.user { align-self:flex-end; background:var(--acc); color:#fff; white-space:pre-wrap }
.msg.bot { align-self:flex-start; background:var(--card); border:1px solid var(--line) }
.msg img { max-width:100%; border-radius:8px; display:block; margin-top:6px }
.msg p { margin:6px 0 } .msg pre { overflow:auto }
.katex-display { overflow-x:auto; overflow-y:hidden }
#composer { position:sticky; bottom:0; background:var(--bg); padding:8px 0 calc(8px + env(safe-area-inset-bottom)); display:flex; gap:8px; align-items:flex-end }
#composer textarea { flex:1; min-height:44px; max-height:140px; resize:none }
#thumbs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:6px } #thumbs img { height:56px; border-radius:6px; border:1px solid var(--line) }
.typing { color:var(--muted); font-style:italic }
.err { color:var(--warn) }
.napaka { padding:8px 0; border-top:1px solid var(--line); font-size:14px } .napaka b { font-weight:600 }
.tag { display:inline-block; font-size:12px; padding:1px 7px; border-radius:6px; background:var(--line); margin-right:6px }
.seja { padding:8px 0; border-top:1px solid var(--line); cursor:pointer } .seja:hover { color:var(--acc) } .seja.static { cursor:default }
.big { font-size:28px; font-weight:600 }
