:root {
  --bg: #f7f7f5; --panel: #ffffff; --text: #1f2328; --muted: #6a737d; --line: #e3e3df;
  --accent: #1a73e8; --accent-soft: #e8f0fe; --ok: #137333; --err: #c5221f; --warn: #b06000;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a; --panel: #1e2125; --text: #e6e6e6; --muted: #9aa0a6; --line: #33373c;
    --accent: #8ab4f8; --accent-soft: #233046; --ok: #81c995; --err: #f28b82; --warn: #fdd663;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
header { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--panel); }
h1 { font-size: 20px; margin: 0; } h1 small { font-size: 12px; color: var(--muted); font-weight: 400; }
h2 { font-size: 16px; margin: 20px 0 8px; } h3 { font-size: 14px; margin: 22px 0 8px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.model { font-size: 13px; color: var(--muted); min-width: 220px; text-align: right; }
.model .ok { color: var(--ok); } .model .err { color: var(--err); }
.progress { height: 4px; background: var(--line); border-radius: 2px; margin-top: 4px; overflow: hidden; }
#model-bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
main { display: grid; grid-template-columns: 300px 1fr; gap: 24px; padding: 24px; max-width: 1200px; margin: 0 auto; }
@media (max-width: 760px) { main { grid-template-columns: 1fr; padding: 16px; } }
aside, section { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; min-width: 0; }
.drop { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; padding: 22px 12px;
  border: 2px dashed var(--line); border-radius: 10px; cursor: pointer; }
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop input { display: none; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.msg { font-size: 13px; margin: 10px 0; min-height: 1em; } .msg.ok { color: var(--ok); } .msg.err { color: var(--err); } .msg.warn { color: var(--warn); }
.banner { margin: 16px 24px 0; padding: 10px 14px; border: 1px solid var(--err); border-radius: 8px; }
.docs { list-style: none; padding: 0; margin: 0; }
.docs button { width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 8px;
  padding: 8px 10px; color: inherit; cursor: pointer; display: flex; flex-direction: column; font: inherit; }
.docs button:hover { background: var(--accent-soft); } .docs button.active { border-color: var(--accent); }
.docs .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs .muted { font-size: 12px; } .docs .empty { padding: 8px 0; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.doc-head h2 { margin: 0; word-break: break-word; }
.summary { margin: 0; padding-left: 22px; } .summary li { margin-bottom: 6px; }
form { display: flex; gap: 8px; }
input[type=text] { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit; }
button { padding: 10px 18px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: inherit; cursor: pointer; }
@media (prefers-color-scheme: dark) { button { color: #0b1a2e; } }
button:disabled { opacity: .6; cursor: wait; }
button.ghost { background: none; border: 1px solid var(--line); color: var(--muted); padding: 6px 12px; }
#answers { margin-top: 16px; }
.hit { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; }
.hit.best { border-color: var(--accent); background: var(--accent-soft); }
.hit p { margin: 4px 0 0; }
.hit-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
code { font-size: 13px; }
