/* Mavesi kontrollivaade v2. Kuju: Lineari tume teema (docs/uuringud/14-prototuup/stiil-viide-linear.webp).
   Fondid samad mis Allika rakenduses (app/src/tokens.css). */
@font-face { font-family: "Inter Variable"; font-weight: 100 900; font-display: swap; src: url(fondid/inter-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Inter Variable"; font-weight: 100 900; font-display: swap; src: url(fondid/inter-latin-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ink: #141516;
  --font: "Inter Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --bg: #08090A;          /* akna taust */
  --frame: #0F1011;       /* külgriba */
  --surface: #141516;     /* põhipaneel */
  --raised: #1A1B1D;      /* kaardid, ujuv paneel */
  --hover: rgba(255, 255, 255, .045);
  --active: rgba(255, 255, 255, .075);
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .12);
  --text: #E3E4E6; --soft: #C4C6CA; --muted: #8A8F98; --faint: #5C6069;
  /* värv ainult olekutel */
  --green: #4CB782; --amber: #F2C94C; --orange: #F2994A; --purple: #A08BEF; --red: #EB5757; --blue: #5E6AD2;
  --t: 120ms ease;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 13.5px/20px var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 1.5px solid var(--blue); outline-offset: 1px; border-radius: 5px; }
::selection { background: rgba(94, 106, 210, .45); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
kbd { font: 500 10.5px/1 var(--font); color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 4px; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 17px; }
.mono { font-variant-numeric: tabular-nums; }
code { font: 12px/1 var(--mono); background: var(--raised); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; }

/* ikoonid */
.ic { width: 14px; height: 14px; flex: none; display: inline-block; vertical-align: -2px; }
.ic-btn { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 999px; color: var(--muted); border: 1px solid var(--line-2); transition: background var(--t), color var(--t); }
.ic-btn:hover { background: var(--hover); color: var(--text); }
.ic-btn.flat { border-color: transparent; border-radius: 6px; width: 24px; height: 24px; }

/* nupud ja sildid */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--soft); font-weight: 500; font-size: 12.5px; white-space: nowrap; transition: background var(--t), color var(--t); }
.btn:hover { background: var(--hover); color: var(--text); }
.btn-pri { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-pri:hover { background: #6C78E0; color: #fff; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.plain { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 6px; border-radius: 5px; color: var(--muted); font-size: 12px; transition: background var(--t), color var(--t); }
.plain:hover { background: var(--hover); color: var(--text); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 11.5px; font-weight: 500; color: var(--soft); white-space: nowrap; }
.chip.off { opacity: .35; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.d-fakt { background: var(--green); } .d-mall { background: var(--faint); } .d-hinnang { background: var(--amber); }
.d-ebakindel { background: var(--orange); } .d-erineb { background: var(--purple); } .d-viga { background: var(--red); }

/* raam: külgriba + paneel */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); height: 100vh; padding: 8px 8px 8px 0; background: var(--frame); }
.side { display: flex; flex-direction: column; gap: 2px; padding: 10px 10px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; font-weight: 600; font-size: 14px; color: var(--text); text-decoration: none; margin-bottom: 10px; }
.brand .logo { width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(135deg, #F67748, #C2501E); display: inline-grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; }
.brand .dom { color: var(--muted); font-weight: 500; }
.brand small { color: var(--muted); font-weight: 500; font-size: 12px; }
.nav-a { display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 8px; border-radius: 6px; color: var(--soft); text-decoration: none; font-weight: 500; transition: background var(--t); }
.nav-a:hover { background: var(--hover); }
.nav-a.on { background: var(--active); color: var(--text); }
.nav-a .ic { color: var(--muted); }
.nav-a .n { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.side .grp { margin: 18px 8px 4px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.side .foot { margin-top: auto; padding: 8px; font-size: 11.5px; color: var(--faint); line-height: 16px; }

.main { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; position: relative; }
.bar { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.bar .crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }
.bar .crumb .id { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar .crumb b { font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .sp { flex: 1; }
.bar .meta { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px; }
.timer::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-right: 2px; }
.timer.idle::before { background: var(--faint); }

/* töö */
.work { display: grid; grid-template-columns: minmax(0, 1fr) 320px; flex: 1; min-height: 0; }
.docwrap { overflow-y: auto; padding: 40px 56px 140px; }
.doc { max-width: 680px; margin: 0 auto; }
.doc h1 { font: 600 22px/30px var(--font); color: var(--text); letter-spacing: -.01em; }
.doc .lead { margin: 8px 0 6px; color: var(--soft); font-size: 14px; line-height: 22px; }
.doc .legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 26px; }
.doc .legend .chip { cursor: pointer; }
.doc h2 { font: 600 12px/16px var(--font); color: var(--muted); margin: 34px 0 10px; letter-spacing: .02em; }
.doc h3 { font: 500 13.5px/20px var(--font); color: var(--soft); margin: 20px 0 6px; }

.s { position: relative; display: block; margin: 0 -12px 2px; padding: 6px 12px 6px 12px; border-radius: 6px; border-left: 2px solid transparent; font-size: 14.5px; line-height: 24px; color: var(--text); cursor: pointer; transition: background var(--t); }
.s:hover { background: var(--hover); }
.s.fakt { border-left-color: rgba(76, 183, 130, .45); }
.s.mall { color: var(--muted); }
.s.hinnang { border-left-color: rgba(242, 201, 76, .7); }
.s.sel { background: var(--active); box-shadow: inset 0 0 0 1px var(--line-2); }
.s.dim { opacity: .25; }
.s .id { position: absolute; left: -40px; top: 9px; font: 500 10.5px/1 var(--font); color: var(--faint); font-variant-numeric: tabular-nums; }
.s .st { position: absolute; right: -26px; top: 10px; }
.s .marks { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: 1px; }
.s .flag { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 11px; font-weight: 500; color: var(--muted); }
.s del { color: var(--faint); text-decoration-color: var(--red); }
.s ins { text-decoration: none; color: var(--text); background: rgba(76, 183, 130, .16); border-radius: 3px; }
.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 2px var(--blue); } 100% { box-shadow: 0 0 0 0 transparent; } }

.toolbar { display: flex; gap: 2px; margin-top: 8px; padding: 3px; background: var(--raised); border: 1px solid var(--line-2); border-radius: 8px; width: max-content; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toolbar button { color: var(--soft); height: 26px; padding: 0 8px; border-radius: 5px; font-size: 12px; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.toolbar button:hover { background: var(--hover); color: var(--text); }

.gate { margin: 8px -12px; padding: 14px 16px; border: 1px dashed rgba(242, 201, 76, .45); border-radius: 8px; background: rgba(242, 201, 76, .04); }
.gate p { margin-bottom: 10px; }
.gate .row { display: flex; gap: 8px; }

/* tegevuste voog */
.activity { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); }
.activity h2 { font: 600 15px/22px var(--font); color: var(--text); margin: 0 0 14px; letter-spacing: 0; }
.act { position: relative; display: flex; gap: 10px; padding: 0 0 14px 0; font-size: 12.5px; line-height: 18px; color: var(--muted); }
.act::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.act:last-child::before { display: none; }
.act .ico { width: 15px; height: 15px; flex: none; display: grid; place-items: center; margin-top: 1px; }
.act b { color: var(--soft); font-weight: 500; }
.act .card { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); color: var(--soft); }
.act .card del { color: var(--faint); }
.act .card ins { text-decoration: none; color: var(--text); }
.act .when { color: var(--faint); }

/* parem veerg (nagu Lineari omaduste veerg) */
.props { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; gap: 2px; padding: 8px 10px; }
.tab { height: 26px; padding: 0 9px; border-radius: 6px; font-weight: 500; font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--text); background: var(--hover); }
.tab.on { color: var(--text); background: var(--active); }
.tab .n { font-size: 11px; color: var(--muted); }
.pane { flex: 1; overflow-y: auto; padding: 4px 14px 20px; }
.pane.under-chat { padding-bottom: 500px; }
.lbl { font-size: 12px; color: var(--muted); margin: 14px 0 6px; }

.q { display: block; width: 100%; padding: 8px 10px; border-radius: 6px; margin-bottom: 2px; transition: background var(--t); }
.q:hover { background: var(--hover); }
.q.on { background: var(--active); }
.q.done { opacity: .5; }
.q .h { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.q p { font-size: 12.5px; line-height: 18px; color: var(--soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.progress { height: 3px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 2px 0 10px; }
.progress i { display: block; height: 100%; background: var(--green); transition: width .3s; }

.src .kind { font-size: 11.5px; color: var(--muted); }
.src h3 { font: 500 13.5px/19px var(--font); color: var(--text); margin: 4px 0 10px; }
.src blockquote { margin: 0 0 12px; padding: 10px 12px; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; line-height: 19px; color: var(--soft); }
.src dl { display: grid; grid-template-columns: 70px 1fr; gap: 4px 10px; font-size: 12px; margin: 0 0 12px; }
.src dt { color: var(--muted); }
.src dd { margin: 0; word-break: break-word; color: var(--soft); }
.src a { color: var(--soft); text-decoration-color: var(--faint); }
.check { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 12px; line-height: 17px; color: var(--soft); margin-bottom: 8px; }
.check .dot { margin-top: 5px; }
.note { font-size: 11px; color: var(--faint); border-top: 1px solid var(--line); padding-top: 8px; }

.cite { display: inline-flex; align-items: center; height: 17px; padding: 0 5px; margin: 0 1px; border-radius: 4px; background: var(--active); border: 1px solid var(--line-2); color: var(--soft); font: 500 10.5px/1 var(--mono); cursor: pointer; vertical-align: 1px; }
.cite:hover { color: var(--text); border-color: var(--muted); }

.rule { padding: 10px 2px; border-bottom: 1px solid var(--line); }
.rule.new .h b::after { content: "uus"; margin-left: 6px; font-size: 10.5px; color: var(--blue); font-weight: 600; }
.rule.off { opacity: .45; }
.rule .h { display: flex; gap: 6px; align-items: center; margin-bottom: 3px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.rule .h b { color: var(--soft); font: 500 11px/1 var(--mono); }
.rule p { font-size: 12.5px; line-height: 18px; color: var(--text); }
.rule .o { font-size: 11.5px; line-height: 16px; color: var(--muted); margin-top: 4px; }
.rule .acts { display: flex; gap: 2px; margin-top: 4px; margin-left: -6px; }
.rule textarea { width: 100%; min-height: 60px; background: var(--raised); border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 8px; font-size: 12.5px; }
.sect { font-size: 11.5px; font-weight: 500; color: var(--muted); margin: 16px 0 2px; }

/* ujuv vestluspaneel (nagu Lineari agendipaneel) */
.chat { position: absolute; right: 14px; bottom: 14px; width: 400px; height: 470px; display: flex; flex-direction: column; background: var(--raised); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 16px 48px rgba(0,0,0,.55); z-index: 10; }
.chat.big { width: min(720px, calc(100% - 28px)); height: calc(100% - 72px); }
.chat.min { height: auto; width: auto; }
.chat .hd { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 8px 0 14px; flex: none; }
.chat .hd .name { font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.chat .hd .model { font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; }
.chat .hd .sp { flex: 1; }
.chat .body { flex: 1; overflow-y: auto; padding: 4px 14px 12px; }
.msg { margin-bottom: 14px; font-size: 13px; line-height: 19.5px; }
.msg .who { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.msg.me { display: flex; flex-direction: column; align-items: flex-end; }
.msg.me .bubble { background: var(--active); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; max-width: 88%; white-space: pre-wrap; font-weight: 500; }
.msg.ai .bubble { white-space: pre-wrap; color: var(--text); }
.msg ul { margin: 2px 0 8px; padding-left: 16px; color: var(--soft); }
.msg li { margin: 2px 0; }
.msg h4 { font-size: 12px; font-weight: 600; color: var(--soft); margin: 10px 0 2px; }
.hit { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; font-size: 12px; line-height: 17px; white-space: normal; background: var(--surface); color: var(--soft); }
.reply { margin: 0 10px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); padding: 8px 8px 6px 10px; flex: none; }
.reply input { width: 100%; background: transparent; border: 0; outline: none; height: 26px; color: var(--text); }
.reply input::placeholder { color: var(--faint); }
.reply .row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--faint); }
.reply .row .sp { flex: 1; }
.send { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--active); border: 1px solid var(--line-2); color: var(--text); }

/* dialoog */
.veil { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: grid; place-items: center; z-index: 20; }
.dlg { width: min(620px, 94vw); max-height: 92vh; overflow-y: auto; background: var(--raised); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 24px 64px rgba(0,0,0,.6); padding: 20px 22px; }
.dlg h2 { font: 600 16px/22px var(--font); color: var(--text); margin-bottom: 2px; }
.dlg label.f { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin: 14px 0 6px; }
.dlg textarea, .dlg input[type=text], .dlg select { width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 9px; font-size: 13px; line-height: 19px; color: var(--text); }
.dlg textarea:focus, .dlg input:focus, .dlg select:focus { outline: none; border-color: var(--blue); }
.dlg textarea { min-height: 80px; resize: vertical; }
.choice { display: flex; gap: 6px; flex-wrap: wrap; }
.choice button { flex: 1; min-width: 120px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 7px; font-size: 12px; line-height: 16px; color: var(--muted); }
.choice button b { display: block; font-size: 13px; color: var(--text); font-weight: 500; }
.choice button.on { border-color: var(--blue); background: rgba(94, 106, 210, .12); }
.dlg .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dlg .err { color: var(--red); font-size: 12px; margin-top: 8px; }
.before { padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px; line-height: 18px; color: var(--muted); }

/* kokkuvõte, lehed */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.kpi { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.kpi b { display: block; font: 600 20px/26px var(--font); color: var(--text); font-variant-numeric: tabular-nums; }
.kpi span { font-size: 11.5px; color: var(--muted); }
table.t { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 6px 0 12px; }
table.t th, table.t td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
table.t th { font-weight: 500; color: var(--muted); font-size: 11.5px; }
table.t td { color: var(--soft); }
.page { overflow-y: auto; padding: 36px 40px; flex: 1; }
.page .inner { max-width: 900px; margin: 0 auto; }
.page h1 { font: 600 20px/28px var(--font); color: var(--text); margin-bottom: 4px; }
.list { margin-top: 20px; border-top: 1px solid var(--line); }
.list a, .list .hd { display: grid; grid-template-columns: 22px 64px 1fr 140px 90px 110px; gap: 10px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--line); text-decoration: none; }
.list a:hover { background: var(--hover); }
.list .hd { font-size: 11.5px; color: var(--muted); padding: 6px 8px; }
.list b { color: var(--text); font-weight: 500; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--raised); border: 1px solid var(--line-2); color: var(--text); padding: 10px 14px; border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.5); font-size: 12.5px; z-index: 30; max-width: 560px; }

/* v0.6: värvid, leht „Allikas”, lohistatav vestlus */
.cite.c-a { color: #8DB8F0; border-color: rgba(95,160,232,.35); background: rgba(95,160,232,.10); }
.cite.c-s { color: #EBC970; border-color: rgba(227,179,65,.35); background: rgba(227,179,65,.10); }
.cite.c-r { color: #C9A9E8; border-color: rgba(180,140,219,.35); background: rgba(180,140,219,.10); }
.rule .h b { color: #C9A9E8; }
.u { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 500; border: 1px solid var(--line-2); }
.u-koik { color: #8DB8F0; background: rgba(95,160,232,.10); border-color: rgba(95,160,232,.30); }
.u-tooliik { color: #EFA06A; background: rgba(229,133,63,.10); border-color: rgba(229,133,63,.30); }
.u-too { color: var(--soft); }
.sect { display: flex; align-items: center; gap: 7px; color: var(--soft); }
.sect .dot, .msg h4 .dot, .grp-h .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; display: inline-block; }
.msg h4 { display: flex; align-items: center; gap: 7px; }
.h-ebakindel { color: #F2B27A; } .h-ebakindel .dot { background: var(--orange); }
.h-erineb { color: #C2B2F5; } .h-erineb .dot { background: var(--purple); }
.h-ei { color: #F09A9A; } .h-ei .dot { background: var(--red); }
.h-kata { color: var(--muted); } .h-kata .dot { background: var(--faint); }
.who.ai-who { color: #6FCABF; font-weight: 500; }
.who.otsing-who { color: #8DB8F0; font-weight: 500; }
.chat .hd { cursor: grab; user-select: none; }
.chat.drag { opacity: .92; box-shadow: 0 22px 60px rgba(0,0,0,.7); }
.chat.drag .hd { cursor: grabbing; }
.subtabs { display: flex; gap: 4px; margin: 16px 0 6px; border-bottom: 1px solid var(--line); }
.subtab { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtab:hover { color: var(--text); }
.subtab.on { color: var(--text); border-bottom-color: var(--text); }
.subtab .n, .grp-h .n { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.grp-h { display: flex; align-items: center; gap: 8px; margin: 22px 0 6px; font-size: 13px; }
.grp-h b { font-weight: 600; }
.t.kb td { vertical-align: top; padding-top: 7px; padding-bottom: 7px; }
.t.kb a { color: var(--text); text-decoration: none; }
.t.kb a:hover { text-decoration: underline; }
.t.kb a.chip { text-decoration: none; margin: 1px 0; }
.chip.kasut { color: #6FCABF; border-color: rgba(69,184,172,.35); }
.l-register { background: #5FA0E8; } .l-oigusakt { background: #B48CDB; } .l-planeering { background: #52BE8A; }
.l-uuring { background: #E5853F; } .l-kov { background: #45B8AC; } .l-juhend { background: #E3B341; }
.empty { padding: 6px 2px 2px; }
.inner.wide { max-width: 980px; }

/* hele teema: Slite'i-laadne soe beež */
.nav-a.teema { width: 100%; margin-top: auto; color: var(--muted); font-weight: 500; }
.nav-a.teema + .foot { margin-top: 0; }
[data-theme="hele"] {
  --ink: #FFFFFF;
  --bg: #F1ECE3; --frame: #F6F2EA; --surface: #FDFBF7; --raised: #FFFFFF;
  --hover: rgba(70, 50, 20, .05); --active: rgba(70, 50, 20, .085);
  --line: rgba(70, 50, 20, .09); --line-2: rgba(70, 50, 20, .16);
  --text: #2E2A25; --soft: #4B453D; --muted: #7C7468; --faint: #A69E91;
  --green: #3E9C6C; --amber: #D4A21C; --orange: #E07B39; --purple: #8B6FD9; --red: #D64545; --blue: #5E6AD2;
  color-scheme: light;
}
[data-theme="hele"] * { scrollbar-color: rgba(70,50,20,.18) transparent; }
[data-theme="hele"] .btn-pri { background: #F07A4A; border-color: #F07A4A; }
[data-theme="hele"] .btn-pri:hover { background: #E2683A; }
[data-theme="hele"] .main { box-shadow: 0 1px 2px rgba(70,50,20,.06); }
[data-theme="hele"] .chat, [data-theme="hele"] .dlg { box-shadow: 0 14px 40px rgba(70,50,20,.18); }
[data-theme="hele"] .chat.drag { box-shadow: 0 22px 60px rgba(70,50,20,.28); }
[data-theme="hele"] .veil { background: rgba(60,45,25,.28); }
[data-theme="hele"] .cite.c-a, [data-theme="hele"] .u-koik, [data-theme="hele"] .who.otsing-who { color: #2F6FB8; }
[data-theme="hele"] .cite.c-s { color: #8F6700; }
[data-theme="hele"] .cite.c-r, [data-theme="hele"] .rule .h b { color: #7A4FB0; }
[data-theme="hele"] .u-tooliik, [data-theme="hele"] .h-ebakindel { color: #B5561B; }
[data-theme="hele"] .h-erineb { color: #6E52C4; }
[data-theme="hele"] .h-ei { color: #C03A3A; }
[data-theme="hele"] .who.ai-who, [data-theme="hele"] .chip.kasut { color: #23877C; }
.otsus-rida { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 14px 0; }

/* sisselogimine ja agendi ühendamine (serveriversioon) */
.login-body { display: grid; place-items: center; min-height: 100vh; background: var(--frame); }
.login { width: min(360px, 92vw); padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.08); }
.login h1 { font: 600 20px/28px var(--font); margin: 6px 0 2px; }
.login form { display: grid; gap: 6px; margin-top: 18px; }
.login input, .connect input { height: 34px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--raised); }
.login .btn { height: 34px; justify-content: center; margin-top: 6px; }
.viga { color: var(--red); font-size: 12.5px; min-height: 18px; }
.connect { display: grid; gap: 18px; }
.connect .step { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--raised); }
.connect .step h3 { font: 600 14px/20px var(--font); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.connect .step ol { margin: 6px 0 0; padding-left: 18px; color: var(--soft); }
.connect .step li { margin: 3px 0; }
.connect .url { display: flex; gap: 6px; margin-top: 8px; }
.connect .url input { flex: 1; font: 12px var(--mono); }
.connect pre { font: 12px/18px var(--mono); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 10px; overflow-x: auto; margin: 8px 0 0; }
.connect .num { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11.5px; background: var(--hover); color: var(--soft); }
.msg .thinking { color: var(--muted); font-style: italic; }
