/* webitest AI – vzhled (podle design systému webitest.eu), 2026-10-28 */
@font-face { font-family: "Inter"; src: url(inter.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(jbm-regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --bg: #fafbfc; --side: #f3f5f8; --surface: #fff; --surface-2: #f6f7fa; --surface-3: #eef1f5;
  --line: #e5e8ee; --line-2: #d6dbe4; --text: #0b1220; --text-2: #454e66; --text-3: #6b7489;
  --brand: #0f766e; --brand-hover: #115e59; --brand-soft: #e7f6f4; --brand-line: #b7e6df; --brand-ink: #0b4f4a;
  --user: #e7f6f4; --code-bg: #0f172a; --code-text: #e2e8f0;
  --err: #dc2626; --err-soft: #fdeeee; --ok: #15803d; --warn: #b45309;
  --grad: linear-gradient(120deg, #0f766e 0%, #0d9488 42%, #6366f1 100%);
  --grad-text: linear-gradient(100deg, #0f766e 0%, #0ea5a4 42%, #6366f1 100%);
  --sh-2: 0 1px 2px rgba(15,23,42,.04), 0 4px 14px -4px rgba(15,23,42,.08);
  --sh-3: 0 2px 6px rgba(15,23,42,.04), 0 18px 40px -14px rgba(15,23,42,.18);
  --ring: 0 0 0 4px rgba(20,184,166,.22);
  --r: 12px; --r-lg: 22px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1018; --side: #0f1520; --surface: #131a26; --surface-2: #182131; --surface-3: #1f2a3c;
  --line: #222d3f; --line-2: #2d3a50; --text: #e8edf5; --text-2: #b3bdcf; --text-3: #8592a8;
  --brand: #2dd4bf; --brand-hover: #5eead4; --brand-soft: #0f2a2a; --brand-line: #1c4b48; --brand-ink: #99f6e4;
  --user: #12302e; --code-bg: #070b12; --err-soft: #2a1416;
  --sh-2: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px -4px rgba(0,0,0,.4);
  --sh-3: 0 2px 6px rgba(0,0,0,.3), 0 18px 40px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 15px/1.6 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--brand); }
.app { display: flex; height: 100dvh; }

/* postranní panel */
.side { width: 272px; flex: none; display: flex; flex-direction: column; background: var(--side); border-right: 1px solid var(--line); padding: 14px 12px; gap: 6px; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.brand b { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.btn-new { display: flex; align-items: center; gap: 8px; width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r); padding: 10px 14px; font-weight: 600; box-shadow: var(--sh-2); transition: border-color .15s, transform .15s; }
.btn-new:hover { border-color: var(--brand-line); }
.btn-new:active { transform: scale(.98); }
.btn-new .plus { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--grad); color: #fff; font-size: 16px; line-height: 1; }
.side-label { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 14px 8px 4px; }
.chats { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.chat-item { display: flex; align-items: center; gap: 6px; border-radius: 10px; padding: 0 4px 0 10px; color: var(--text-2); }
.chat-item:hover { background: var(--surface-3); }
.chat-item.on { background: var(--surface); color: var(--text); box-shadow: var(--sh-2); }
.chat-item button.t { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 8px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.chat-item button.x { opacity: 0; border: 0; background: none; color: var(--text-3); border-radius: 7px; width: 28px; height: 28px; flex: none; }
.chat-item:hover button.x, .chat-item.on button.x { opacity: 1; }
.chat-item button.x:hover { background: var(--err-soft); color: var(--err); }
.chats .none { color: var(--text-3); font-size: 13px; padding: 6px 10px; }
.side-foot { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 1px; }
.side-link { display: flex; align-items: center; gap: 10px; border: 0; background: none; text-decoration: none; color: var(--text-2); padding: 8px 10px; border-radius: 10px; font-size: 14px; text-align: left; }
.side-link:hover { background: var(--surface-3); color: var(--text); }
.side-link span:first-child { width: 18px; text-align: center; }

/* hlavní část */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.top { height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); }
.top-title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.pill.ok i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.pill.sleep i { background: #94a3b8; }
.pill.busy i { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.2); animation: pulse 1.2s infinite; }
.pill.err i { background: var(--err); }
@keyframes pulse { 50% { opacity: .35; } }
.icon-btn { border: 0; background: none; width: 38px; height: 38px; border-radius: 10px; font-size: 18px; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-3); }
.only-mobile { display: none; }

.scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; position: relative; }
.thread { max-width: 780px; margin: 0 auto; padding: 26px 20px 30px; display: flex; flex-direction: column; gap: 26px; }
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 6px; }
.empty[hidden] { display: none; }
.empty img { filter: drop-shadow(0 10px 24px rgba(15,118,110,.35)); margin-bottom: 8px; }
.empty h1 { margin: 0; font-size: clamp(26px, 4vw, 34px); letter-spacing: -.02em; font-weight: 750; }
.empty .lead { margin: 0 0 18px; color: var(--text-2); max-width: 460px; }
.chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 620px; }
.chip { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 14px; box-shadow: var(--sh-2); color: var(--text-2); font-size: 14px; line-height: 1.4; transition: border-color .15s, transform .15s; }
.chip b { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }
.chip:hover { border-color: var(--brand-line); transform: translateY(-1px); }

/* zprávy */
.msg { display: flex; gap: 14px; animation: in .25s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }
.msg.user { justify-content: flex-end; }
.msg.user .body { background: var(--user); border: 1px solid var(--brand-line); border-radius: 18px 18px 6px 18px; padding: 10px 16px; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.ai .ava { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; margin-top: 2px; }
.msg.ai .ava img { width: 20px; height: 20px; }
.msg.ai .col { flex: 1; min-width: 0; }
.msg.ai .body { overflow-wrap: anywhere; }
.body > :first-child { margin-top: 0; }
.body > :last-child { margin-bottom: 0; }
.body p, .body ul, .body ol, .body pre, .body blockquote, .body table { margin: 0 0 12px; }
.body ul, .body ol { padding-left: 22px; }
.body li { margin: 3px 0; }
.body h1, .body h2, .body h3, .body h4 { margin: 18px 0 8px; line-height: 1.3; letter-spacing: -.01em; }
.body h1 { font-size: 22px; } .body h2 { font-size: 19px; } .body h3 { font-size: 17px; } .body h4 { font-size: 15px; }
.body blockquote { border-left: 3px solid var(--brand-line); padding: 2px 0 2px 14px; color: var(--text-2); }
.body hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.body code { font-family: var(--mono); font-size: .88em; background: var(--surface-3); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
.body .code { margin: 0 0 12px; border-radius: 12px; overflow: hidden; background: var(--code-bg); border: 1px solid var(--line); }
.body .code-head { display: flex; justify-content: space-between; align-items: center; padding: 5px 8px 5px 14px; font: 12px var(--font); color: #94a3b8; background: rgba(255,255,255,.04); }
.body .code-head button { border: 0; background: none; color: #cbd5e1; font-size: 12px; border-radius: 6px; padding: 3px 8px; }
.body .code-head button:hover { background: rgba(255,255,255,.08); }
.body pre { margin: 0; padding: 12px 14px; overflow-x: auto; color: var(--code-text); font: 13px/1.55 var(--mono); }
.body pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.body table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 14px; }
.body th, .body td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.body th { background: var(--surface-2); }
.cursor::after { content: ""; display: inline-block; width: 8px; height: 1.05em; vertical-align: -2px; margin-left: 2px; border-radius: 2px; background: var(--brand); animation: pulse 1s infinite; }
.wait { display: inline-flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 14px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: dot 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.acts { display: flex; align-items: center; gap: 2px; margin-top: 6px; min-height: 28px; color: var(--text-3); font-size: 12px; }
.acts button { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--text-3); border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.acts button:hover { background: var(--surface-3); color: var(--text); }
.acts .meta { margin-left: 6px; }
.msg-err { color: var(--err); background: var(--err-soft); border-radius: 10px; padding: 8px 12px; font-size: 14px; }

/* psaní */
.composer-wrap { flex: none; padding: 6px 20px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--bg) 30%); }
.composer { max-width: 780px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 8px 8px 8px 18px; box-shadow: var(--sh-3); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--brand-line); box-shadow: var(--sh-3), var(--ring); }
.composer textarea { flex: 1; border: 0; outline: 0; resize: none; background: none; color: var(--text); font: 16px/1.5 var(--font); padding: 7px 0; max-height: 220px; min-height: 38px; }
.composer textarea::placeholder { color: var(--text-3); }
.send, .stop { flex: none; width: 40px; height: 40px; border: 0; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: 0 8px 20px -8px rgba(15,118,110,.6); transition: transform .15s, opacity .15s; }
.send:disabled { opacity: .35; box-shadow: none; cursor: default; }
.send:not(:disabled):hover, .stop:hover { transform: scale(1.05); }
.stop { background: var(--text); color: var(--bg); box-shadow: none; }
.stop[hidden], .send[hidden] { display: none; }
.note { max-width: 780px; margin: 7px auto 0; text-align: center; font-size: 12px; color: var(--text-3); }
.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 999px; font-size: 14px; box-shadow: var(--sh-3); z-index: 50; }
.scrim { display: none; }

@media (max-width: 860px) {
  .only-mobile { display: inline-grid; place-items: center; }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 30; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .25s cubic-bezier(.2,.8,.2,1); box-shadow: var(--sh-3); }
  .app.open .side { transform: none; }
  .app.open .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(2,6,23,.4); }
  .top { padding: 0 8px 0 6px; }
  .thread { padding: 18px 14px 24px; gap: 22px; }
  .msg { gap: 10px; }
  .msg.ai .ava { display: none; }
  .composer-wrap { padding: 4px 10px calc(8px + env(safe-area-inset-bottom)); }
  .chips { grid-template-columns: 1fr; max-width: 420px; }
  .chip:nth-child(n+3) { display: none; }
  .chat-item button.x { opacity: 1; }
}
