/* AI Duo – finálny návrh: bočný panel + konverzácia, svetlý/tmavý režim */
:root {
  --bg: #F5F5F3; --side: #EEEEEA; --surface: #FFFFFF; --surface2: #F7F7F5; --line: #E0E0DA;
  --ink: #17181C; --muted: #5C5F68; --accent: #2F55D4; --accent-ink: #FFFFFF; --accent-soft: #E7ECFC;
  --claude: #AD4E17; --claude-soft: #FBECE2; --codex: #08765A; --codex-soft: #DFF3EC;
  --ok: #1A7744; --ok-soft: #E1F2E8; --bad: #B42318; --bad-soft: #FCE8E6; --warn: #8A5300; --warn-soft: #FAEFD9;
  --code: #F2F2EE; --shadow: 0 12px 40px rgba(20, 20, 30, .18);
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111216; --side: #16181D; --surface: #1C1E24; --surface2: #21242B; --line: #2F323A;
  --ink: #ECECE9; --muted: #A3A6AE; --accent: #8FA6FF; --accent-ink: #0D142E; --accent-soft: #222A47;
  --claude: #F2A779; --claude-soft: #3A2617; --codex: #5BD5AD; --codex-soft: #14322A;
  --ok: #6FD69A; --ok-soft: #163224; --bad: #FF8B80; --bad-soft: #3B1A18; --warn: #F0C36B; --warn-soft: #382C12;
  --code: #15171B; --shadow: 0 12px 40px rgba(0, 0, 0, .5); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111216; --side: #16181D; --surface: #1C1E24; --surface2: #21242B; --line: #2F323A;
    --ink: #ECECE9; --muted: #A3A6AE; --accent: #8FA6FF; --accent-ink: #0D142E; --accent-soft: #222A47;
    --claude: #F2A779; --claude-soft: #3A2617; --codex: #5BD5AD; --codex-soft: #14322A;
    --ok: #6FD69A; --ok-soft: #163224; --bad: #FF8B80; --bad-soft: #3B1A18; --warn: #F0C36B; --warn-soft: #382C12;
    --code: #15171B; --shadow: 0 12px 40px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .87em; background: var(--code); padding: 1px 6px; border-radius: 5px; }
.muted { color: var(--muted); } .sm { font-size: 13px; } .grow { flex: 1; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mt { margin-top: 14px; }

/* ---------- tlačidlá a polia ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn:focus-visible, .link:focus-visible, .chip:focus-visible, .task:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.big { min-height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.danger { color: var(--bad); font-weight: 600; }
.btn.danger-fill { background: var(--bad); border-color: var(--bad); color: var(--accent-ink); font-weight: 700; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface2); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 38px; padding: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { border: 0; background: transparent; color: var(--accent); font-weight: 600; cursor: pointer; padding: 4px 0; font-size: 14px; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input.in, select.in, textarea.in { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface2); color: var(--ink); font-size: 15px; }
input.in:focus, select.in:focus, textarea.in:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea.in { resize: vertical; min-height: 64px; }
textarea.mono { font-family: var(--mono); font-size: 13px; }
label.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: 14px; color: var(--ink); }
label.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.p-accent { background: var(--accent-soft); color: var(--accent); } .p-ok { background: var(--ok-soft); color: var(--ok); }
.p-bad { background: var(--bad-soft); color: var(--bad); } .p-warn { background: var(--warn-soft); color: var(--warn); }
.p-muted { background: var(--surface2); color: var(--muted); border: 1px solid var(--line); }
.sev { text-transform: uppercase; letter-spacing: .04em; font-size: 11px; font-weight: 700; }

/* ---------- rozloženie ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 288px; flex: 0 0 288px; background: var(--side); border-right: 1px solid var(--line); padding: 18px 14px;
  display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.dots { display: flex; } .dots span { width: 24px; height: 24px; border-radius: 50%; display: block; }
.dots span:first-child { background: var(--claude); }
.dots span:last-child { background: var(--codex); margin-left: -9px; border: 2px solid var(--side); }
.side-head { display: flex; align-items: center; justify-content: space-between; }
.side-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 8px 4px; }
.tasks { display: flex; flex-direction: column; gap: 3px; }
.task { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; border-radius: 10px; text-decoration: none;
  color: var(--ink); border: 1px solid transparent; }
.task:hover { background: var(--surface2); }
.task.active { background: var(--surface); border-color: var(--line); }
.task-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta { font-size: 12px; color: var(--muted); }
.usage-box { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.usage-box strong { color: var(--ink); font-size: 17px; }
.empty-side { font-size: 13px; color: var(--muted); padding: 4px 8px; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 28px; border-bottom: 1px solid var(--line);
  background: var(--surface); position: sticky; top: 0; z-index: 4; }
.topbar h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.topbar .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 13px; color: var(--muted); }
.menu-btn { display: none; }
.who-claude { color: var(--claude); font-weight: 600; } .who-codex { color: var(--codex); font-weight: 600; }

.conv { width: 100%; max-width: 880px; margin: 0 auto; padding: 26px 24px 64px; display: flex; flex-direction: column; gap: 20px; }
.msg { display: flex; gap: 12px; align-items: flex-start; scroll-margin-top: 96px; }
.avatar { flex: 0 0 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; }
.av-claude { background: var(--claude-soft); color: var(--claude); } .av-codex { background: var(--codex-soft); color: var(--codex); }
.bubble { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px;
  padding: 14px 20px 10px; display: flex; flex-direction: column; gap: 10px; }
.bubble.last { border-radius: 4px 16px 0 0; }
.msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; }
.msg-head .usage { margin-left: auto; color: var(--muted); cursor: help; }
.msg-foot { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; border-top: 1px solid var(--line); padding-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { font-family: var(--mono); font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--surface2); border: 1px solid var(--line); }
.note-err { color: var(--bad); font-size: 13px; } .note-ok { color: var(--muted); font-size: 13px; }
.you { display: flex; justify-content: flex-end; }
.you > div { max-width: 80%; background: var(--accent-soft); border-radius: 16px 16px 4px 16px; padding: 12px 18px; }
.you .lbl { font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.you .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.findings { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.finding { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; padding: 10px 14px; border-top: 1px solid var(--line); }
.finding:first-child { border-top: 0; }
.finding .loc { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.finding .txt { flex: 1 1 280px; }
.finding .sug { flex-basis: 100%; font-size: 13px; color: var(--muted); }
.finding input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.live { background: var(--code); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font: 12.5px/1.55 var(--mono);
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow-y: auto; margin: 0; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--warn); border-right-color: transparent;
  border-radius: 50%; animation: s .8s linear infinite; vertical-align: -1px; }
@keyframes s { to { transform: rotate(360deg); } }

/* panel „Čo ďalej?“ */
.next { margin: -20px 0 0 48px; background: var(--surface2); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 16px 16px;
  padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.next.alone { margin: 0 0 0 48px; border-top: 1px solid var(--line); border-radius: 16px; }
.next h2 { margin: 0; font-size: 16px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: 14px; cursor: pointer; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.seg button.fin { color: var(--bad); }
.seg button.fin.on { background: var(--bad); border-color: var(--bad); color: var(--accent-ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); font-size: 14px; cursor: pointer; }
.chip.on-claude { background: var(--claude-soft); border-color: transparent; color: var(--claude); font-weight: 700; }
.chip.on-codex { background: var(--codex-soft); border-color: transparent; color: var(--codex); font-weight: 700; }
.chip input.model { border: 0; background: transparent; width: 150px; padding: 0; font-size: 14px; color: var(--ink); }
.chip input.model:focus { outline: none; }
.adv { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }

/* úvod a sprievodca */
.center { width: 100%; max-width: 760px; margin: 0 auto; padding: 40px 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px 32px; display: flex; flex-direction: column; gap: 22px; }
.card h1 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.warn-box { background: var(--bad-soft); color: var(--bad); border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.warn-box pre { margin: 6px 0 0; white-space: pre-wrap; font: 12px var(--mono); }
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stepper li { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.stepper .bar { height: 4px; border-radius: 99px; background: var(--line); }
.stepper .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--surface2); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; margin-right: 6px; }
.stepper li.done .bar, .stepper li.cur .bar { background: var(--accent); }
.stepper li.done .dot, .stepper li.cur .dot { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.stepper li.cur { color: var(--ink); }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.opt { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface); cursor: pointer; }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.opt strong { font-size: 15px; } .opt span { font-size: 13px; color: var(--muted); }
.qtitle { font-weight: 600; margin-bottom: 8px; }
.wiz-foot { display: flex; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }

/* prihlásenie */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login form { width: 100%; max-width: 380px; }
.err { color: var(--bad); font-size: 14px; }

/* Markdown */
.md { line-height: 1.6; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md h2 { font-size: 18px; margin: 18px 0 6px; } .md h3 { font-size: 16px; margin: 16px 0 6px; }
.md h4, .md h5, .md h6, .md h7 { font-size: 15px; margin: 14px 0 4px; }
.md p { margin: 8px 0; } .md ul, .md ol { margin: 8px 0; padding-left: 22px; } .md li { margin: 2px 0; }
.md pre { background: var(--code); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto;
  font: 13px/1.55 var(--mono); white-space: pre; margin: 10px 0; }
.md blockquote { border-left: 3px solid var(--line); margin: 8px 0; padding: 2px 12px; color: var(--muted); }
.md table { border-collapse: collapse; margin: 10px 0; font-size: 14px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.md th { background: var(--surface2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.md details { margin: 8px 0; } .md summary { cursor: pointer; color: var(--muted); }

/* okná a hlásenia */
.modal { position: fixed; inset: 0; background: rgba(10, 10, 15, .5); display: flex; align-items: center; justify-content: center; z-index: 30; padding: 16px; }
.modal-box { background: var(--surface); width: min(1000px, 100%); max-height: 90vh; border-radius: 16px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 20px; overflow: auto; flex: 1; }
.modal-body pre.raw { background: var(--code); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: 12.5px/1.5 var(--mono);
  white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.files { display: grid; grid-template-columns: 260px 1fr; gap: 14px; min-height: 60vh; }
.files ul { list-style: none; margin: 0; padding: 0; overflow: auto; font: 12.5px var(--mono); border-right: 1px solid var(--line); }
.files li button { all: unset; display: block; width: 100%; box-sizing: border-box; padding: 4px 8px; border-radius: 6px; cursor: pointer; word-break: break-all; }
.files li button:hover, .files li button.sel { background: var(--surface2); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg);
  padding: 10px 18px; border-radius: 10px; z-index: 40; max-width: 90vw; font-size: 14px; }

/* ---------- mobil ---------- */
@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .shell.drawer .side { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 15; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 12px; gap: 8px; position: static; }
  .topbar h1 { font-size: 16px; }
  .topbar .actions { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .conv { padding: 14px 10px 40px; gap: 14px; }
  .msg .avatar { display: none; }
  .bubble { padding: 12px 14px 8px; border-radius: 14px; }
  .bubble.last { border-radius: 14px 14px 0 0; }
  .next, .next.alone { margin-left: 0; padding: 14px; }
  .next .btn.big { width: 100%; }
  .you > div { max-width: 92%; }
  .card { padding: 20px 18px; }
  .files { grid-template-columns: 1fr; }
  .files ul { border-right: 0; border-bottom: 1px solid var(--line); max-height: 30vh; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } .spin { animation: none; } }
