:root{--primary: #1e7b30;--primary-dark: #17632a;--text: #1a2332;--muted: #566275;--bg: #f4f7f5;--surface: #ffffff;--border: #d5dde6;--danger: #b42318;--danger-bg: #fdecea;--warn: #7a4f00;--warn-bg: #fff4d6;--ok: #17632a;--ok-bg: #e5f4e8;--info-bg: #e8f1fb;--radius: .6rem;font-family:system-ui,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:16px;line-height:1.5;color:var(--text);background:var(--bg)}*{box-sizing:border-box}body{margin:0;min-height:100vh}h1,h2,h3{line-height:1.25;margin:0 0 .75rem}h1{font-size:1.5rem}h2{font-size:1.2rem}h3{font-size:1.05rem}p{margin:0 0 .6rem}.app{min-height:100vh;display:flex;flex-direction:column}.topbar{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.75rem 1.25rem;background:var(--surface);border-bottom:1px solid var(--border)}.brand{display:flex;align-items:center;gap:.75rem}.logo{display:inline-grid;place-items:center;width:2.5rem;height:2.5rem;border-radius:.5rem;background:var(--primary);color:#fff;font-weight:700}.brand-name{margin:0;font-weight:700}.brand-sub{margin:0;font-size:.85rem;color:var(--muted)}.user{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.content{flex:1;width:100%;max-width:60rem;margin:0 auto;padding:1.5rem 1rem}.content.wide{max-width:80rem}.footer{text-align:center;font-size:.85rem;padding:1rem}.muted{color:var(--muted)}.hint{font-size:.85rem;color:var(--muted)}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1.25rem}.login{max-width:26rem;margin:2rem auto}label{display:block;margin:0 0 .3rem;font-weight:600}input,textarea,select{width:100%;padding:.65rem .75rem;border:1px solid var(--border);border-radius:.45rem;margin-bottom:.9rem;font:inherit;color:inherit;background:#fff}textarea{resize:vertical}input:focus-visible,textarea:focus-visible,select:focus-visible,button:focus-visible,summary:focus-visible{outline:3px solid #7cc38a;outline-offset:2px}button{min-height:2.75rem;padding:.55rem 1.1rem;border:1px solid var(--primary);border-radius:.45rem;background:var(--primary);color:#fff;font:inherit;font-weight:600;cursor:pointer;transition:background-color .15s ease}button:hover:not(:disabled){background:var(--primary-dark)}button:disabled{opacity:.55;cursor:not-allowed}button.secondary{background:#fff;color:var(--primary)}button.secondary:hover:not(:disabled){background:var(--ok-bg)}button.danger{background:var(--danger);border-color:var(--danger)}button.danger:hover:not(:disabled){background:#8f1c13}button.link{min-height:auto;padding:.2rem 0;border:0;background:none;color:var(--primary-dark);text-decoration:underline;font-weight:500}button.link:hover:not(:disabled){background:none;color:var(--text)}.row{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap}.error{color:var(--danger);background:var(--danger-bg);padding:.6rem .8rem;border-radius:.45rem}.info{background:var(--info-bg);padding:.6rem .8rem;border-radius:.45rem}.badge{display:inline-block;margin-left:.5rem;padding:.1rem .55rem;border-radius:999px;font-size:.8rem;font-weight:600;background:var(--info-bg);color:var(--text);white-space:nowrap}.badge.ok{background:var(--ok-bg);color:var(--ok)}.badge.warn{background:var(--warn-bg);color:var(--warn)}.badge.danger{background:var(--danger-bg);color:var(--danger)}.chat{display:flex;flex-direction:column;gap:.75rem}.chat-toolbar{display:flex;justify-content:space-between;align-items:center;gap:.75rem;flex-wrap:wrap}.thread{display:flex;flex-direction:column;gap:.75rem;min-height:40vh;max-height:62vh;overflow-y:auto;padding:.25rem}.empty{background:var(--surface);border:1px dashed var(--border);border-radius:var(--radius);padding:1.25rem}.msg{border-radius:var(--radius);padding:.85rem 1rem;max-width:92%;border:1px solid var(--border)}.msg.user{align-self:flex-end;background:var(--ok-bg);border-color:#c4e3cb}.msg.assistant{align-self:flex-start;background:var(--surface)}.msg-head{font-size:.8rem;font-weight:700;color:var(--muted);margin-bottom:.35rem;text-transform:uppercase;letter-spacing:.03em}.md p:last-child{margin-bottom:0}.md ul,.md ol{margin:0 0 .6rem;padding-left:1.4rem}.md code{background:#eef1f4;padding:0 .25rem;border-radius:.25rem}.cite{min-height:auto;padding:0 .35rem;margin:0 .1rem;font-size:.75rem;vertical-align:super;border-radius:.3rem;background:var(--info-bg);color:var(--primary-dark);border:1px solid #b9d3ee}.cite:hover:not(:disabled){background:#d4e6f8}.sources{margin-top:.6rem;border-top:1px solid var(--border);padding-top:.5rem;font-size:.92rem}.sources summary{cursor:pointer;font-weight:600}.sources ol{margin:.4rem 0 0;padding-left:1.4rem}.excerpt{color:var(--muted);font-size:.85rem;margin:.1rem 0 .4rem}.meta{font-size:.75rem;color:var(--muted);margin:.4rem 0 0}.transcript,.audio-ready p{font-style:italic}.transcript span,.audio-ready span{font-style:normal;font-weight:600}.typing{color:var(--muted)}.thumbs{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:.5rem}.thumbs img{width:5.5rem;height:5.5rem;object-fit:cover;border-radius:.4rem;border:1px solid var(--border)}.thumbs figure{position:relative;margin:0}.thumbs .remove{position:absolute;top:-.5rem;right:-.5rem;min-height:1.75rem;width:1.75rem;padding:0;border-radius:999px;background:var(--danger);border-color:var(--danger);line-height:1}.composer{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:.85rem}.composer textarea{margin-bottom:.6rem}.composer-actions{display:flex;justify-content:space-between;gap:.6rem;flex-wrap:wrap}.counter{font-size:.85rem}.audio-state{color:var(--muted)}.audio-state.recording{color:var(--danger);font-weight:600}.audio-ready{background:var(--info-bg);border-radius:.45rem;padding:.6rem .8rem;margin-bottom:.6rem}.panel{margin-bottom:1.25rem}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:.75rem;flex-wrap:wrap;margin-bottom:.75rem}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(14rem,1fr));gap:0 1rem}.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse;font-size:.95rem}th,td{text-align:left;padding:.55rem .5rem;border-bottom:1px solid var(--border);vertical-align:top}th{font-size:.8rem;text-transform:uppercase;letter-spacing:.03em;color:var(--muted)}td .row{gap:.3rem .8rem}.filters{display:flex;gap:.75rem;flex-wrap:wrap;align-items:flex-end}.filters>div{min-width:12rem}.stats{font-size:.85rem;color:var(--muted)}dialog{border:1px solid var(--border);border-radius:var(--radius);padding:1.25rem;width:min(34rem,92vw)}dialog::backdrop{background:#101d3573}@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}@media(max-width:640px){.msg{max-width:100%}.topbar{flex-direction:column;align-items:flex-start}}
