/* MRR tabla — design tokens. Cool neutral ground with a slight green bias (the bot is Moss),
   one accent, four semantic colours for who holds the ball. IBM Plex Sans / Mono. */
:root {
  --ground: #f2f4f3; --surface: #ffffff; --surface-2: #e9edeb; --line: #d7ddda; --line-2: #c3ccc7;
  --ink: #15201c; --ink-2: #47554f; --muted: #75837d;
  --accent: #2f6b4f; --accent-ink: #ffffff; --accent-soft: #e2efe7;
  --moss: #4a6b8a; --moss-soft: #e4ecf4;            /* bot's move: calm blue */
  --person: #b9791b; --person-soft: #fbf0dc;        /* a person's move: amber */
  --clock: #7a7a86; --clock-soft: #ececf0;          /* time or dependency: grey-violet */
  --danger: #b23a3a; --danger-soft: #f8e3e3;
  --done: #3a7d5c; --done-soft: #e2efe7;
  --radius: 8px; --shadow: 0 1px 2px rgba(21,32,28,.06), 0 8px 24px -12px rgba(21,32,28,.18);
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ground: #121917; --surface: #1a2320; --surface-2: #222d29; --line: #2b3733; --line-2: #3a4843;
  --ink: #e8ecea; --ink-2: #b9c4bf; --muted: #8b998f;
  --accent: #7fbf9e; --accent-ink: #0f1a15; --accent-soft: #1f3a2e;
  --moss: #8fb3d4; --moss-soft: #1d2b39; --person: #e0a648; --person-soft: #3a2d14;
  --clock: #a2a2b3; --clock-soft: #26262f; --danger: #e07b7b; --danger-soft: #3a1f1f; --done: #7fbf9e; --done-soft: #1f3a2e;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6); color-scheme: dark;
}}
:root[data-theme="dark"] {
  --ground: #121917; --surface: #1a2320; --surface-2: #222d29; --line: #2b3733; --line-2: #3a4843;
  --ink: #e8ecea; --ink-2: #b9c4bf; --muted: #8b998f;
  --accent: #7fbf9e; --accent-ink: #0f1a15; --accent-soft: #1f3a2e;
  --moss: #8fb3d4; --moss-soft: #1d2b39; --person: #e0a648; --person-soft: #3a2d14;
  --clock: #a2a2b3; --clock-soft: #26262f; --danger: #e07b7b; --danger-soft: #3a1f1f; --done: #7fbf9e; --done-soft: #1f3a2e;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--ground); color: var(--ink); font: 14px/1.45 var(--font); display: flex; flex-direction: column; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.quiet { color: var(--muted); font-size: 12px; }
.quiet:hover { color: var(--ink); }
.grow { flex: 1; }

/* top bar */
.top { display: flex; align-items: center; gap: 24px; padding: 0 20px; height: 52px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: .01em; }
.brand .logo { width: 26px; height: 26px; flex: none; display: block; }
.brand .proj { color: var(--muted); font-weight: 400; font-family: var(--mono); font-size: 12px; padding-left: 10px; border-left: 1px solid var(--line); }
.views { display: flex; gap: 4px; }
.views a { padding: 6px 10px; border-radius: 6px; color: var(--ink-2); font-weight: 500; }
.views a:hover { background: var(--surface-2); color: var(--ink); }
.views a.on { background: var(--accent-soft); color: var(--accent); }
.menu { position: relative; }
.menu-btn { white-space: nowrap; font: inherit; padding: 6px 10px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); font-weight: 500; cursor: pointer; }
.menu-btn:hover, .menu.open .menu-btn { background: var(--surface-2); color: var(--ink); }
.menu-btn.on { background: var(--accent-soft); color: var(--accent); }
.menu-btn .caret { font-size: 10px; margin-left: 2px; opacity: .7; }
.menu-list { display: none; position: absolute; left: 0; top: 100%; margin-top: 4px; min-width: 150px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 6; }
.menu-list a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.menu-list a:hover { background: var(--surface-2); color: var(--ink); }
.menu-list a.on { background: var(--accent-soft); color: var(--accent); }
.menu.open .menu-list { display: block; }
@media (hover: hover) and (pointer: fine) { .menu:hover .menu-list, .menu:focus-within .menu-list { display: block; } }
.inline-mail { display: flex; gap: 6px; align-items: center; }
.inline-mail input { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); min-width: 0; width: 190px; }
.inline-mail .btn { border: 0; cursor: pointer; font: inherit; font-size: 13px; padding: 5px 10px; white-space: nowrap; }
.pill { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--person); color: #fff; font-size: 11px; font-weight: 600; text-align: center; line-height: 18px; vertical-align: 1px; }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.avatar.sm { width: 20px; height: 20px; font-size: 9px; }

/* filters */
.filters { display: flex; align-items: center; gap: 12px; padding: 10px 20px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 2px; }
.seg a { padding: 4px 10px; border-radius: 5px; color: var(--ink-2); font-size: 13px; }
.seg a.on { background: var(--ink); color: var(--surface); }
.filters select, .filters input { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px; height: 32px; }
.filters input[type=search] { width: 260px; margin-left: auto; }

/* board */
main.board { flex: 1; padding: 4px 20px 24px; overflow-x: auto; }
.lanes { display: flex; gap: 12px; align-items: flex-start; }
.lane { background: var(--surface-2); border-radius: 10px; padding: 8px; min-height: 120px; flex: 1 1 250px; min-width: 250px; max-width: 340px; }
.lane.empty { flex: 0 0 120px; min-width: 120px; opacity: .75; }
.lane.empty .hint { display: none; }
.lane-head { display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 8px; padding: 4px 6px 10px; }
.lane-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.count { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.lane-head .hint { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: -6px; }
.cards { display: flex; flex-direction: column; gap: 8px; }
.nothing { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 0; margin: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: var(--radius); padding: 10px 12px 10px 11px; cursor: pointer; transition: box-shadow .12s, transform .12s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.card.ball-moss { border-left-color: var(--moss); }
.card.ball-requester, .card.ball-assignee { border-left-color: var(--person); }
.card.ball-clock { border-left-color: var(--clock); }
.card.done { border-left-color: var(--done); opacity: .85; }
.card h3 { font-size: 13.5px; font-weight: 500; line-height: 1.35; margin: 6px 0 8px; }
.card-head, .card-foot { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.id { font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: .01em; }
.board { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); }
.board-vodstvo { background: var(--danger-soft); color: var(--danger); }
.board-tehnika { background: var(--clock-soft); color: var(--clock); }
.flag { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--danger-soft); color: var(--danger); }
.owes { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--person); }
.owes.moss { color: var(--moss); }
.owes.clock { color: var(--clock); }
.card-foot .meta { margin-left: auto; display: flex; gap: 8px; white-space: nowrap; }
.cost { font-family: var(--mono); }

/* status chips */
.status { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.s-open, .s-planning, .s-ready, .s-in-progress, .s-changes-requested { background: var(--moss-soft); color: var(--moss); }
.s-needs-info, .s-waits-info, .s-notify, .s-review { background: var(--person-soft); color: var(--person); }
.s-waiting, .s-blocked { background: var(--clock-soft); color: var(--clock); }
.s-done { background: var(--done-soft); color: var(--done); }

/* list */
main.listing, main.mine, main.costs, main.posta, main.page { padding: 4px 20px 32px; max-width: 1280px; width: 100%; margin: 0 auto; }
.week { margin-bottom: 24px; }
.week h2, .group h2 { font-size: 15px; margin: 12px 0 8px; display: flex; align-items: baseline; gap: 8px; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 500; background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[hx-get] { cursor: pointer; }
tbody tr[hx-get]:hover { background: var(--accent-soft); }
tr.done td { color: var(--muted); }
td.title { max-width: 520px; }
td.id { white-space: nowrap; }
table.mini { width: auto; min-width: 320px; }
table.mini td { padding: 5px 10px; }

/* mine */
.lead { color: var(--ink-2); margin: 0 0 10px; max-width: 60ch; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.group { margin-bottom: 28px; }
.group.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* costs */
.kpis { display: flex; gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; min-width: 150px; }
.kpi dt, .facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kpi dd { margin: 2px 0 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar::before { content: ""; display: block; width: 100%; height: var(--h); background: var(--accent); border-radius: 3px 3px 0 0; opacity: .85; }
.bar span { font-size: 10px; color: var(--muted); font-family: var(--mono); }

/* detail panel */
.scrim { position: fixed; inset: 0; background: rgba(21,32,28,.35); z-index: 8; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: -12px 0 40px -20px rgba(0,0,0,.4); z-index: 9; overflow-y: auto; }
.panel-inner, main.page .detail { padding: 20px 24px 40px; }
main.page .detail { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; max-width: 860px; }
.detail-head .row { display: flex; align-items: center; gap: 8px; }
.detail-head h1 { font-size: 20px; margin: 10px 0 14px; line-height: 1.3; }
.close { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.close:hover { background: var(--surface-2); color: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; margin-bottom: 14px; }
.facts dd { margin: 2px 0 0; display: flex; align-items: center; gap: 6px; }
.facts dd.editable .edit { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 3px; line-height: 1; }
.facts dd.editable .edit:hover { color: var(--accent); }
.facts .inline-edit { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.facts .inline-edit[hidden], .facts .val[hidden], .facts .edit[hidden] { display: none; }  /* display:flex would beat the hidden attribute */
.facts .inline-edit select { font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); max-width: 100%; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); padding: 7px 14px; border-radius: 7px; font-weight: 500; }
/* every button looks clickable, wherever it sits (Kopiraj naslov, Odklopi had the arrow) */
button.btn { border: 0; font: inherit; font-weight: 500; cursor: pointer; }
button:not(:disabled), summary { cursor: pointer; }
button:disabled { cursor: not-allowed; }
.btn:hover { filter: brightness(1.08); }
.note { color: var(--ink-2); font-size: 13px; margin: 10px 0 0; }
.sec { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.sec h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); display: inline; }
details.sec summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.sec summary::before { content: "▸"; color: var(--muted); font-size: 11px; transition: transform .12s; }
details.sec[open] summary::before { transform: rotate(90deg); }
details.sec summary::-webkit-details-marker { display: none; }
.summary { color: var(--ink-2); margin: 8px 0 0; }
.prose { max-width: 72ch; margin-top: 8px; color: var(--ink); font-size: 13.5px; }
.prose h3, .prose h4 { font-size: 13.5px; margin: 14px 0 6px; }
.prose p { margin: 6px 0; }
.prose pre { background: var(--surface-2); padding: 10px 12px; border-radius: 6px; overflow-x: auto; font: 12px/1.5 var(--mono); }
.prose code { font: 12.5px var(--mono); background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.prose pre code { background: transparent; padding: 0; }
.prose table { width: auto; font-size: 12.5px; margin: 8px 0; }
.prose li.chk { list-style: none; margin-left: -18px; padding-left: 20px; position: relative; }
.prose li.chk::before { content: ""; position: absolute; left: 0; top: 5px; width: 11px; height: 11px; border: 1.5px solid var(--line-2); border-radius: 3px; }
.prose li.chk.done::before { background: var(--done); border-color: var(--done); }
.prose li.chk.done { color: var(--muted); }
.timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 90px 70px 1fr; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.timeline time { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.k-friction { color: var(--danger); }

/* login */
main.login { flex: 1; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px; max-width: 420px; box-shadow: var(--shadow); }
.brand.big { font-size: 22px; margin-bottom: 12px; gap: 12px; }
.brand.big .logo { width: 56px; height: 56px; }
/* the three-head mark has its own round ground; the dark one sits on the dark surface */
.logo.on-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo.on-light { display: none; } :root:not([data-theme="light"]) .logo.on-dark { display: block; } }
:root[data-theme="dark"] .logo.on-light { display: none; } :root[data-theme="dark"] .logo.on-dark { display: block; }
.error { color: var(--danger); }

/* phone */
@media (max-width: 720px) {
  .top { gap: 12px; padding: 0 16px; }
  .brand .proj, .who .quiet { display: none; }
  .filters { padding: 8px 16px; }
  .filters input[type=search] { width: 100%; margin-left: 0; }
  main.board { padding: 4px 16px 24px; overflow-x: visible; }
  .lanes { flex-direction: column; }
  .lane, .lane.empty { max-width: none; min-width: 0; flex: none; }
  .lane.empty { display: none; }
  .seg { overflow-x: auto; max-width: 100%; }
  .seg a { white-space: nowrap; }
  main.listing, main.mine, main.costs, main.posta, main.page { padding: 4px 16px 24px; }
  .group.two { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
  .panel-inner { padding: 16px; }
  .timeline li { grid-template-columns: 80px 1fr; }
  .timeline .k { display: none; }
}
@media (prefers-reduced-motion: reduce) { .card, details.sec summary::before { transition: none; } }

/* phase 2: actions, priority, login form */
.prio { font-family: var(--mono); font-size: 10.5px; padding: 1px 5px; border-radius: 4px; background: var(--clock-soft); color: var(--clock); font-weight: 500; }
.prio.p1 { background: var(--danger-soft); color: var(--danger); }
.prio.p2 { background: var(--person-soft); color: var(--person); }
.actions .action-list { display: grid; gap: 10px; margin-top: 8px; }
.act { background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; }
.act.inline { grid-template-columns: 1fr auto; align-items: center; }
.act-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.act-head span { color: var(--muted); font-size: 12px; }
.act input, .act select, .act textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; min-width: 0; }
.act .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.act .btn { justify-self: start; border: 0; cursor: pointer; font: inherit; }
.btn.alt { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2) !important; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.flash { margin: 6px 0; padding: 8px 10px; border-radius: 6px; font-size: 13px; }
.flash.ok { background: var(--done-soft); color: var(--done); }
.flash.ok a { color: inherit; text-decoration: underline; font-weight: 600; }
.flash.err { background: var(--danger-soft); color: var(--danger); }
.login-card form.stack { display: grid; gap: 8px; margin-top: 12px; }
.login-card label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.login-card input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
.login-card .btn { border: 0; cursor: pointer; font: inherit; text-align: center; }
.login-card .or { text-align: center; color: var(--muted); margin: 10px 0; font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 12; display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--surface); padding: 10px 12px 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 13px; }
.toast .btn { padding: 5px 12px; border: 0; cursor: pointer; font: inherit; }

/* phase 3: new task, conversation */
.btn.new { margin-left: 8px; padding: 6px 12px; font-size: 13px; }
.form-page { max-width: 720px; }
.form-page h1 { font-size: 20px; margin-bottom: 6px; }
form.stack.wide { display: grid; gap: 6px; margin-top: 14px; }
form.stack.wide label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 8px; }
form.stack.wide input, form.stack.wide textarea, form.stack.wide select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
form.stack.wide textarea { resize: vertical; line-height: 1.5; }
.row-btn { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.act .row-btn { margin-top: 2px; }
.pick { cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 6px 3px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); max-width: 100%; }
.chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 16px; line-height: 1; padding: 0 2px; }
.chip button:hover { color: var(--ink); }
form.drop { outline: 2px dashed var(--accent); outline-offset: 2px; }
form.stack.wide label.pick { text-transform: none; letter-spacing: 0; font-size: inherit; color: var(--ink); margin-top: 0; }
form.stack.wide .chips { margin-top: 4px; }
.row-btn .btn { border: 0; cursor: pointer; font: inherit; }
.row-btn label.check { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.convo { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.convo li { background: var(--surface-2); border-radius: var(--radius); padding: 8px 12px; min-width: 0; overflow-wrap: anywhere; }
.convo-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.convo-head time { color: var(--muted); font-family: var(--mono); font-size: 11.5px; margin-left: auto; }
.convo-text { white-space: pre-wrap; margin-top: 6px; font-size: 13.5px; max-width: 72ch; min-width: 0; overflow-wrap: anywhere; }
/* long paths, URLs, code and tables stay inside the phone's width: text wraps, blocks scroll on their own */
.convo-text pre, .prose pre { max-width: 100%; overflow-x: auto; white-space: pre; }
.convo-text table, .prose table { display: block; max-width: 100%; overflow-x: auto; }
.convo-text code, .prose code { overflow-wrap: anywhere; }
.convo-text th, .convo-text td, .prose th, .prose td { overflow-wrap: normal; word-break: normal; }
.convo-text img, .prose img { max-width: 100%; height: auto; }
@media (max-width: 720px) { .btn.new { padding: 6px 9px; } }
form.stack.wide .checks label { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 13px; margin-top: 0; }
.toast[hidden] { display: none; }  /* display:flex above would otherwise beat the hidden attribute */

/* instruction, running state, conversation kinds */
.instruct textarea { width: 100%; }
.running { background: var(--moss-soft); border-radius: var(--radius); padding: 10px 12px; border-top: 0; }
.running h2 { color: var(--moss); }
.spinner { display: inline-block; width: 10px; height: 10px; border: 2px solid var(--moss); border-right-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; vertical-align: middle; margin-left: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.convo li.k-reply { background: var(--accent-soft); }
.convo li.k-system { background: transparent; border: 1px dashed var(--line); }
.convo li.k-instruction { background: var(--surface-2); }
.convo .src { font-size: 11px; color: var(--muted); padding: 1px 6px; border-radius: 8px; background: var(--surface); }
.convo .files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.convo .file { font-size: 12.5px; color: var(--accent); }
main.page #panel-inner .detail { margin-top: 8px; }

/* task chat, tabs, proposal card */
.tabs { display: inline-flex; background: var(--surface-2); border-radius: 8px; padding: 3px; gap: 2px; margin: 6px 0 8px; }
.tabs [role=tab] { border: 0; background: transparent; font: inherit; font-weight: 500; color: var(--ink-2); padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.tabs [role=tab].on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.convo.chat li.k-question { background: var(--surface-2); }
.convo.chat li.k-answer { background: var(--accent-soft); }
.convo.chat li.thinking { color: var(--moss); border: 0; background: transparent; padding-left: 4px; }
.convo.chat.small li { padding: 6px 10px; font-size: 12.5px; }
.proposal { margin: 10px 0; border: 1.5px solid var(--accent); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
.proposal-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.proposal .row-btn { margin-top: 8px; }
.proposal.mini { border-width: 1px; padding: 6px 8px; margin: 6px 0 0; font-size: 12.5px; white-space: pre-wrap; }
.inline-form { display: inline; }
.as-link { border: 0; background: transparent; cursor: pointer; font: inherit; }
.old-chats { margin-top: 10px; }
.old-chats summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.old-chat { margin: 8px 0; font-size: 12.5px; color: var(--ink-2); }

/* Vprašanja page */
.questions .convo.chat { margin: 12px 0; }
.task-proposal { display: grid; gap: 4px; }
.task-proposal label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 6px; }
.task-proposal input, .task-proposal select, .task-proposal textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }

/* area colours, running state, progress */
:root { --a-prodaja: #2f5d8a; --a-prodaja-soft: #e3ecf6; --a-marketing: #7a4b9a; --a-marketing-soft: #efe6f6;
        --a-logistika: #1f7a75; --a-logistika-soft: #dff1ef; --a-tehnika: #5f6b73; --a-tehnika-soft: #e8ecee; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --a-prodaja: #8fb3d4; --a-prodaja-soft: #1d2b39; --a-marketing: #c7a1e6; --a-marketing-soft: #2e2238;
  --a-logistika: #7fd0c9; --a-logistika-soft: #16302e; --a-tehnika: #b0bcc4; --a-tehnika-soft: #263036; }}
:root[data-theme="dark"] { --a-prodaja: #8fb3d4; --a-prodaja-soft: #1d2b39; --a-marketing: #c7a1e6; --a-marketing-soft: #2e2238;
  --a-logistika: #7fd0c9; --a-logistika-soft: #16302e; --a-tehnika: #b0bcc4; --a-tehnika-soft: #263036; }
.board-prodaja { background: var(--a-prodaja-soft); color: var(--a-prodaja); }
.board-marketing { background: var(--a-marketing-soft); color: var(--a-marketing); }
.board-logistika { background: var(--a-logistika-soft); color: var(--a-logistika); }
.board-tehnika { background: var(--a-tehnika-soft); color: var(--a-tehnika); }
.card .board { font-weight: 500; }
.dots { display: inline-block; width: 1.6em; text-align: left; }
.dots::after { content: "·"; animation: dots 1.2s steps(3, end) infinite; letter-spacing: 1px; }
@keyframes dots { 33% { content: "··"; } 66% { content: "···"; } }
@media (prefers-reduced-motion: reduce) { .dots::after { content: "···"; animation: none; } }
.progress { margin: 6px 0 8px; font-size: 12.5px; color: var(--ink-2); font-family: var(--mono); display: grid; gap: 2px; min-width: 0; max-width: 100%; }
.progress details { min-width: 0; max-width: 100%; }
.progress .step.cur > summary { color: var(--ink); }
.progress .verb { color: var(--moss); }
.progress .n { color: var(--muted); }
.progress details > summary { cursor: pointer; list-style: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.progress details > summary::-webkit-details-marker { display: none; }
.progress details > summary::before { content: "▸ "; color: var(--muted); }
.progress details[open] > summary::before { content: "▾ "; }
.progress details.more > summary { color: var(--muted); font-family: var(--font); font-size: 12px; }
.progress details.more > details { margin-left: 14px; }
.progress .step ol { margin: 2px 0 4px; padding-left: 18px; list-style: none; }
.progress .step li { margin: 1px 0; }
.progress details.item > summary::before { content: "· "; }
.progress details.item[open] > summary { display: none; }
.progress details.item pre { margin: 0 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 12px; color: var(--ink); }
details.sec > summary .count { margin-left: 4px; }

/* sticky running block, queued list, message markers, technical fold */
/* sticky both ways: pinned to the top while it is above the viewport, to the bottom while below it */
.panel .running { position: sticky; top: 0; bottom: 0; z-index: 3; box-shadow: 0 0 16px -8px rgba(0,0,0,.5); }
main.page .running { position: sticky; top: 56px; bottom: 0; z-index: 3; }
/* the actions of a task awaiting confirmation: pinned to the top of the panel while the result scrolls under them */
.confirm-bar { position: sticky; top: 0; z-index: 4; margin: 14px -24px 0; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 8px 16px -10px rgba(0,0,0,.35); }
.confirm-bar .act { background: var(--done-soft); }
.confirm-bar .btn { white-space: nowrap; }
main.page .confirm-bar { top: 56px; }
@media (max-width: 720px) { .confirm-bar { margin: 12px -16px 0; padding: 8px 16px; } }
.running { margin: 10px 0; }
.queued { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.queued li { padding: 4px 0; border-top: 1px dashed var(--line); }
.queued .tag { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: var(--person-soft); color: var(--person); margin-right: 4px; }
.convo li.pending { border-left: 3px solid var(--person); }
.convo li.needs { border-left: 3px solid var(--danger); background: var(--danger-soft); }
.mark { font-size: 11px; padding: 1px 7px; border-radius: 8px; font-weight: 600; }
.mark.wait { background: var(--person-soft); color: var(--person); }
.mark.ask { background: var(--danger); color: #fff; }
details.tech { margin-top: 6px; }
details.tech summary { cursor: pointer; font-size: 12px; color: var(--muted); }
details.tech .prose { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }

.act.now { border: 1.5px solid var(--danger); background: var(--surface); }
.act.now .btn { background: var(--danger); color: #fff; }

details.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.fold > summary::before { content: "▸"; color: var(--muted); font-size: 11px; }
details.fold[open] > summary::before { content: "▾"; }
details.fold > summary::-webkit-details-marker { display: none; }

/* bot status in the header */
.botstatus { margin-left: auto; display: flex; align-items: center; }
.who { margin-left: 12px; }
.bot { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 8px; border-radius: 14px; font-size: 12.5px; background: var(--surface-2); color: var(--ink-2); max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-name { font-weight: 600; }
.bot-spent { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.bot-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
/* Milo's face tells the state; the dot on his chin keeps the colour code */
.bot-face { position: relative; width: 22px; height: 22px; flex: none; margin: -2px 0; }
.bot-face img { width: 22px; height: 22px; display: block; }
.bot-face .bot-dot { position: absolute; right: -2px; bottom: -1px; width: 8px; height: 8px; box-shadow: 0 0 0 1.5px var(--surface-2); }
.bot-busy .bot-face .bot-dot { box-shadow: 0 0 0 1.5px var(--moss-soft); }
.bot-stop .bot-face .bot-dot, .bot-down .bot-face .bot-dot { box-shadow: 0 0 0 1.5px var(--danger-soft); }
.bot-off .bot-face .bot-dot { box-shadow: 0 0 0 1.5px var(--clock-soft); }
.bot-busy { background: var(--moss-soft); color: var(--moss); }
.bot-busy .bot-dot { background: var(--moss); animation: pulse 1.4s ease-in-out infinite; }
.bot-idle .bot-dot { background: var(--done); }
.bot-stop { background: var(--danger-soft); color: var(--danger); }
.bot-stop .bot-dot { background: var(--danger); }
.bot-off { background: var(--clock-soft); color: var(--clock); }
.bot-down { background: var(--danger-soft); color: var(--danger); }
.bot-down .bot-dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .bot-busy .bot-dot { animation: none; } }
@media (max-width: 720px) { .bot { max-width: 58vw; font-size: 12px; } }

.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.cmp { border-radius: var(--radius); padding: 8px 12px; background: var(--surface-2); }
.cmp dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cmp dd { margin: 2px 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cmp small { color: var(--muted); font-size: 11.5px; }
.cmp.moss { background: var(--moss-soft); } .cmp.moss dd { color: var(--moss); }
.cmp.human dd { color: var(--ink-2); }
.cmp.ratio { background: var(--accent-soft); } .cmp.ratio dd { color: var(--accent); }

/* phone header: brand, bot status and avatar in the first row; views and the new-task button in the second */
.brk { display: none; }
@media (max-width: 720px) {
  .top { flex-wrap: wrap; height: auto; padding: 6px 12px; gap: 6px 10px; row-gap: 4px; }
  .brand { order: 0; white-space: nowrap; font-size: 14px; }
  .brand .proj { display: none; }
  .botstatus { order: 1; margin-left: auto; }
  .who { order: 2; margin-left: 0; }
  .brk { display: block; order: 3; flex-basis: 100%; height: 0; }
  .views { order: 4; flex: 1 1 0; min-width: 0; overflow-x: auto; gap: 0; -webkit-overflow-scrolling: touch; }  /* basis 0: the new-task button stays on this row, the views scroll */
  .views a { padding: 6px 8px; white-space: nowrap; font-size: 13px; }
  .menu-btn { padding: 6px 8px; font-size: 13px; }
  .menu-list { position: fixed; left: auto; top: auto; }  /* the views row scrolls, so the list leaves it (placed by the script) */
  .btn.new { order: 5; margin-left: auto; padding: 5px 10px; font-size: 13px; white-space: nowrap; }
  .botstatus { margin-left: auto; }
  .who .quiet { display: none; }
  /* the views row scrolls: a fade on its right edge says there is more */
  .views { mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent); padding-right: 14px; }
}
@media (max-width: 480px) {
  /* a narrow phone: the new-task button is just "+", so every view fits beside it */
  .new-label { display: none; }
  .btn.new { padding: 4px 11px; font-size: 17px; line-height: 1.2; }
  .views a, .menu-btn { padding: 6px 7px; }
}

.bot-dot.live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--moss); animation: pulse 1.4s ease-in-out infinite; vertical-align: middle; margin-left: 2px; }
.queued li.held { opacity: .55; }

.detail-head .share { font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; cursor: pointer; margin-right: 10px; }
.detail-head .share:hover { color: var(--ink); border-color: var(--line-2); }
.detail-head .share.ok { color: var(--done); border-color: var(--done); }

/* Claude out of reach: a line under the top bar for everyone */
.upstream { display: flex; gap: 10px; align-items: flex-start; padding: 9px 20px; font-size: 13px; border-bottom: 1px solid var(--line); }
.upstream p { margin: 0; max-width: 110ch; }
.upstream a { text-decoration: underline; margin-left: 6px; }
.upstream-incident { color: inherit; opacity: .85; margin-left: 6px; }
.upstream-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 5px; }
.upstream-down { background: var(--danger-soft); color: var(--danger); }
.upstream-down .upstream-dot { background: var(--danger); }
.upstream-degraded { background: var(--person-soft); color: var(--ink); }
.upstream-degraded .upstream-dot { background: var(--person); }

/* Admin → Pošta */
.mail-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; max-width: 900px; }
.mail-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 6px; }
.mail-item.done { opacity: .7; }
.mail-head { display: flex; gap: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.mail-when { font-family: var(--mono); }
.mail-subject { font-weight: 500; font-size: 13.5px; overflow-wrap: anywhere; }
.mail-refs { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; font-size: 12.5px; }
.mail-refs .ref { font-family: var(--mono); color: var(--accent); text-decoration: underline; }
.mail-snippet { margin: 0; font-size: 12.5px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.mail-item .row-btn { display: flex; gap: 8px; flex-wrap: wrap; }
.mail-item .row-btn form { margin: 0; }
.mail-item .btn { border: 0; cursor: pointer; font: inherit; font-size: 13px; }
.warn-text { color: var(--danger); }
.run-status { margin-left: auto; color: var(--done); }
.run-failed .run-status, .run-partial .run-status { color: var(--danger); }

/* Pošta (admins) */
.admin-star { color: var(--person); font-size: .8em; margin-left: 3px; vertical-align: 1px; }
.posta-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.posta-tabs { margin: 10px 0 4px; }
.posta h3.sub { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 18px 0 8px; }
.action-badge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--moss-soft); color: var(--moss); white-space: nowrap; }
.proposal-servis .action-badge { background: var(--person-soft); color: var(--ink); }
.proposal-ponudba .action-badge { background: var(--accent-soft); color: var(--accent); }
.mail-web { margin-left: auto; font-size: 12px; color: var(--accent); text-decoration: underline; white-space: nowrap; }
.mail-original summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.proposal-form { display: grid; gap: 8px; margin-top: 4px; }
.proposal-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.proposal-form label.check { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; }
.proposal-form select, .proposal-form input, .proposal-form textarea { font: inherit; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 8px; min-width: 0; }
.proposal-form textarea { resize: vertical; }
.proposal-form fieldset.cust { border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.proposal-form legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
.mail-list.compact .mail-item { padding: 8px 12px; gap: 3px; }

/* header items never wrap inside themselves; the project name and the bot text give way first */
.brand, .views a, .btn.new, .menu-btn { white-space: nowrap; }
.botstatus { min-width: 0; flex: 0 1 auto; }
@media (max-width: 1180px) and (min-width: 721px) {
  .top { gap: 14px; }
  .brand .proj { display: none; }
  .views a { padding: 6px 8px; }
  .bot { max-width: 26vw; }
  .who .quiet { display: none; }
}

/* brand: the full name gives way before anything else in a tight top bar; Milo's head stays */
@media (max-width: 1180px) and (min-width: 721px) { .brand .brand-name { display: none; } }
@media (max-width: 480px) { .top .brand .brand-name { display: none; } }
/* a character where there is nothing to show */
.empty-lik { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--muted); }
.empty-lik img { width: 64px; height: auto; flex: none; }
.login-card .lik { display: block; width: 96px; height: auto; margin: 0 auto 12px; }

/* task detail, simple first (Nejc, 2026-09-30): title, the request, what Milo is doing, the talk; the rest folds */
.sec.desc { padding-top: 4px; border-top: 0; }
.sec.desc .prose { font-size: 15px; }
.avatar.bot-av { background: var(--moss-soft); padding: 1px; object-fit: contain; }
.asks { background: var(--person-soft); border: 1px solid color-mix(in srgb, var(--person) 35%, transparent); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; }
.asks-head { display: flex; align-items: center; gap: 10px; }
.asks-head h2 { font-size: 15px; color: var(--person); text-transform: none; letter-spacing: 0; }
.asks .btn { justify-self: start; }
.sec.running { border-top: 0; background: var(--moss-soft); border-radius: var(--radius); padding: 14px 16px; }
.run-head { display: flex; align-items: center; gap: 12px; }
.run-face { width: 40px; height: 40px; flex: none; }
.run-head h2 { font-size: 15px; color: var(--moss); text-transform: none; letter-spacing: 0; margin: 0; }
.run-head .note { margin: 2px 0 0; }
/* three dots that light up in turn; not `.dots`, which is the older text ellipsis above */
.typing-dots { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; vertical-align: middle; height: 1em; }
.typing-dots i { display: block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .3; animation: dot 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .2s; } .typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) { .running .run-face { animation: bob 2.4s ease-in-out infinite; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .typing-dots i { animation: none; opacity: .7; } }
.run-tech { margin-top: 10px; }
.sec.more > summary h2 { color: var(--muted); }
.sec.more .facts { margin: 8px 0 12px; }
.sec.sub { margin: 0; padding: 8px 0; border-top: 1px solid var(--line); }
.sec.sub > summary h3, .sec.sub h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 0; display: inline; }
.edit.bell { display: inline-grid; place-items: center; vertical-align: middle; }
.edit.bell svg { display: block; }
/* Milo's antenna sits above his head, so the head alone is centred on the text line, not the whole drawing */
.brand .logo { transform: translateY(-3px); }
.bot-face img { transform: translateY(-2px); }
.avatar.bot-av { object-position: 50% 80%; }
/* prices as the board would bill them */
.card .price { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.price-fact small { color: var(--muted); font-family: var(--mono); font-size: 11.5px; margin-left: 4px; }
.bill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 12px; }
.bill { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); min-width: 0; }
.bill.current { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.bill h3 { font-size: 15px; margin-bottom: 8px; }
.bill-lines { width: 100%; }
.bill-lines tr.sum td { font-weight: 600; border-top: 1px solid var(--line); padding-top: 6px; }
.bill details { margin-top: 10px; }
.bill details summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
/* Vprašanja as a chat (Rok, 2026-10-01): the page is exactly the screen, the stream scrolls, the box stays at the bottom */
body:has(main.chatpage) { height: 100dvh; min-height: 0; overflow: hidden; }
main.chatpage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-stream { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 8px; }
.chat-col { max-width: 820px; margin: 0 auto; width: 100%; }
.msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.msg { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.msg .bubble { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.msg.msg-mine { justify-content: flex-end; }
.msg.msg-mine .bubble { background: var(--surface-2); border-radius: 16px 16px 4px 16px; padding: 9px 14px; max-width: min(78%, 640px); }
.msg.msg-bot .bubble { padding: 2px 0; flex: 1; }
.msg.msg-bot .convo-text { max-width: 72ch; }
.msg.msg-sys .bubble { color: var(--muted); font-size: 12.5px; border: 1px dashed var(--line); border-radius: 10px; padding: 6px 10px; }
.msg-face { width: 28px; height: 28px; flex: none; margin-top: 2px; border-radius: 50%; background: var(--moss-soft); padding: 2px; }
.msg-who { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.msg .convo-text { margin-top: 0; font-size: 14.5px; line-height: 1.55; }
.msg.msg-bot .convo-text { white-space: normal; }
.msg .convo-text > :first-child { margin-top: 0; } .msg .convo-text > :last-child { margin-bottom: 0; }
.msg .convo-text p { margin: 0 0 10px; }
.msg time { display: block; margin-top: 4px; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.msg.msg-mine time { text-align: right; }
.msg.typing .bubble { color: var(--moss); font-size: 14px; padding-top: 5px; }
@media (prefers-reduced-motion: no-preference) { .msg.typing .msg-face { animation: bob 2.4s ease-in-out infinite; } }
.chat-divider { display: flex; align-items: center; gap: 10px; margin: 22px 0 14px; color: var(--muted); font-size: 12px; }
.chat-divider::before, .chat-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.chat-divider:first-child { margin-top: 4px; }
.chat-empty { text-align: center; padding: 8vh 12px 24px; display: grid; justify-items: center; gap: 10px; color: var(--ink-2); }
.chat-empty h1 { font-size: 22px; color: var(--ink); }
.chat-empty p { max-width: 52ch; font-size: 14.5px; }
.chat-stream .proposal { margin-top: 16px; }
.chat-stream .flash { margin-top: 12px; }
.chat-compose { flex: none; border-top: 1px solid var(--line); background: var(--ground); padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
.compose-box { display: flex; align-items: flex-end; gap: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px 6px 6px 14px; }
.compose-box:focus-within { border-color: var(--accent); }
.compose-box textarea { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--ink); font: 15px/1.45 var(--font); padding: 7px 0; max-height: 33vh; }
.compose-box .send { flex: none; width: 36px; height: 36px; padding: 0; border-radius: 10px; font-size: 18px; display: grid; place-items: center; }
.compose-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
.compose-tools .pick { cursor: pointer; }
.compose-tools .hint { font-size: 11.5px; }
@media (pointer: coarse) { .compose-tools .hint { display: none; } }
@media (max-width: 720px) { .chat-stream { padding: 12px 12px 6px; } .chat-compose { padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); } .msg.msg-mine .bubble { max-width: 88%; } }

/* Dodaj svojega agenta: an outside AI in the Vprašanja chat */
.agent-face { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--clock-soft); color: var(--clock); font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .02em; }
.msg.msg-agent .agent-face { margin-top: 2px; }
.msg.msg-agent .bubble { border: 1px solid var(--line-2); border-radius: 4px 16px 16px 16px; padding: 8px 13px; max-width: min(78%, 640px); background: var(--surface); }
.agent-tag { font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 4px; }
.agent-card .agent-what { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); max-width: 66ch; }
.agent-prompt textarea { width: 100%; font: 12px/1.5 var(--mono); padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--ink); resize: vertical; margin-top: 6px; }
.agent-bar { flex: none; border-top: 1px solid var(--line); background: var(--clock-soft); color: var(--ink-2); font-size: 13px; padding: 6px 16px; }
.agent-bar .chat-col { display: flex; align-items: center; gap: 10px; }
.agent-bar .agent-face { width: 22px; height: 22px; background: var(--surface); font-size: 10px; }
.agent-bar .grow { flex: 1; }
.btn.small { padding: 3px 10px; font-size: 12.5px; }
@media (max-width: 720px) { .msg.msg-agent .bubble { max-width: 88%; } .agent-bar { padding: 6px 10px; } }
.msg-face.rudi { background: var(--accent-soft); }
details.agent-card { padding: 8px 12px; border-width: 1px; border-color: var(--line-2); }
details.agent-card[open] { border-width: 1.5px; border-color: var(--accent); padding: 10px 12px; }
details.agent-card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; margin: 0; }
details.agent-card > summary::-webkit-details-marker { display: none; }
details.agent-card > summary::before { content: "▸"; font-size: 10px; transition: transform .12s; }
details.agent-card[open] > summary::before { transform: rotate(90deg); }
details.agent-card[open] > summary { margin-bottom: 4px; }
.agent-step { font-size: 13px; font-weight: 600; color: var(--ink); margin: 12px 0 2px; }
.agent-how { margin: 0 0 6px; font-size: 13px; color: var(--ink-2); max-width: 70ch; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font: 12px var(--mono); padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--ink); }
.agent-guides { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 20px; margin: 10px 0 4px; }
.agent-guides h4 { margin: 0 0 4px; font-size: 13px; color: var(--ink); }
.agent-steps { margin: 0; padding-left: 20px; font-size: 13px; color: var(--ink-2); display: grid; gap: 3px; }
.agent-steps a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.agent-steps a::after { content: " ↗"; font-size: 11px; text-decoration: none; }
.agent-prompt .tabs { margin: 10px 0 8px; }
.agent-prompt .agent-steps { margin-top: 10px; }
.agent-prompt [data-agent-pane="cli"] .btn { margin-top: 6px; }
.agent-prompt [hidden] { display: none !important; }
.agent-branch { list-style: none; margin: 6px 0 2px; padding: 0; display: grid; gap: 6px; }
.agent-branch li { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.agent-branch .branch { flex: none; font: 600 10.5px/1 var(--mono); letter-spacing: .06em; padding: 3px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); }
.avatar.bot-av.rudi { background: var(--accent-soft); }
/* PREVERI: what to look at after a change — the link on its own line, green, what to check under it */
.verify { margin: 10px 0 2px; border: 1px solid var(--line); border-left: 3px solid var(--done); border-radius: 8px; padding: 8px 12px 10px; background: var(--surface); }
.verify-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--done); margin-bottom: 4px; }
.verify ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.verify li { padding-left: 2px; }
.verify li::marker { color: var(--muted); font-size: 12px; }
.verify-link { display: block; color: var(--done); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.verify-link:hover { text-decoration: underline; }
.verify-link::after { content: " ↗"; font-weight: 400; }
.verify-note { display: block; color: var(--ink-2); font-size: 13.5px; line-height: 1.45; }
