/* OpenVibe.Actor — theme-token driven (openvibe-shared presets). Every page works without JavaScript. */
:root { color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg-primary, #0a0f1c); color: var(--text-primary, #e6edf7); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent-light, #60a5fa); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--accent, #3b82f6); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--bg-card, #131c2e); padding: 8px 12px; z-index: 10; }
.account-bar { max-width: 1080px; margin: 0 auto; padding: 6px 16px 0; text-align: right; font-size: 14px; color: var(--text-secondary, #96a7c2); }
.page { max-width: 1080px; margin: 0 auto; padding: 16px 16px 64px; min-height: 60vh; }
h1 { font-size: 1.8rem; line-height: 1.2; margin: 1rem 0 .6rem; overflow-wrap: anywhere; }
h2 { font-size: 1.3rem; margin: 1.8rem 0 .5rem; }
h3 { font-size: 1.08rem; margin: 1.2rem 0 .4rem; }
.muted { color: var(--text-muted, #7386a3); }
.small { font-size: .85rem; }
.crumbs { font-size: .9rem; color: var(--text-muted, #7386a3); margin: 8px 0; overflow-wrap: anywhere; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
code { overflow-wrap: anywhere; }
pre { background: var(--bg-secondary, #0f1729); border: 1px solid var(--border, #1f2d47); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: pre; }
pre code { overflow-wrap: normal; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; vertical-align: top; padding: 7px 9px; border-bottom: 1px solid var(--border, #1f2d47); }
th { color: var(--text-secondary, #96a7c2); font-weight: 600; }
.badge { display: inline-block; font-size: .75rem; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border-light, #2c3d5c); white-space: nowrap; line-height: 1.6; }
.badge.ok { border-color: var(--success, #22c55e); color: var(--success, #22c55e); }
.badge.info { border-color: var(--info, #38bdf8); color: var(--info, #38bdf8); }
.badge.warn { border-color: var(--warning, #f59e0b); color: var(--warning, #f59e0b); }
.badge.bad { border-color: var(--error, #ef4444); color: var(--error, #ef4444); }
.notice { border-left: 3px solid var(--info, #38bdf8); padding: 8px 12px; margin: 12px 0; background: var(--bg-card, #131c2e); border-radius: 0 8px 8px 0; }
.notice.ok { border-left-color: var(--success, #22c55e); }
.notice.warn { border-left-color: var(--warning, #f59e0b); }
.notice.bad { border-left-color: var(--error, #ef4444); }
button { font: inherit; cursor: pointer; }
form.inline { display: inline; }
.prose { max-width: 820px; overflow-wrap: anywhere; }
.prose table { margin: .6rem 0; }

/* The home page's showcase sections (openvibe-shared/showcase.css) sit inside .page, which has its own gutter. */
.page .sc-hero, .page .sc-sec, .page .sc-cta { padding-left: 0; padding-right: 0; }
.page .sc-ic .ov-icon { --ovi-size: 28px !important; }
button.sc-btn { background: transparent; }
button.sc-btn.sc-primary { border: 0; }

/* ── The router card (the hero's aside): one sample decision ── */
.router-card { margin: 0; padding: 16px; border-radius: 16px; border: 1px solid var(--border, #1f2d47); background: linear-gradient(180deg, var(--bg-secondary, #101828), var(--bg-primary, #0a0f1c)); }
.router-card figcaption { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.router-card figcaption b { font-size: 15px; line-height: 1.4; }
.router-card ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.router-card li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border, #1f2d47); }
.router-card li.pick { border-color: var(--accent, #3b82f6); background: color-mix(in srgb, var(--accent, #3b82f6) 10%, transparent); }
.router-card li.pick .rc-name::after { content: " · picked"; color: var(--accent-light, #60a5fa); font-weight: 700; font-size: 12px; }
.rc-name { font-weight: 700; font-size: 14px; }
.rc-cost { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-secondary, #96a7c2); }
.rc-why { grid-column: 1 / -1; font-size: 12.5px; color: var(--text-muted, #7386a3); }
.rc-foot { margin: 10px 0 0; font-size: 12.5px; color: var(--text-muted, #7386a3); }

/* ── The task box ── */
.task-box { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 16px; border: 1px solid var(--border-light, #2c3d5c); background: var(--bg-secondary, #101828); max-width: 860px; }
.task-box-lead { margin: 0; font-size: 1.05rem; }
.task-label { font-weight: 700; }
.task-box textarea { width: 100%; min-height: 110px; resize: vertical; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-light, #2c3d5c); background: var(--bg-primary, #0a0f1c); color: var(--text-primary, #e6edf7); font: inherit; line-height: 1.5; }
.task-box textarea:focus { border-color: var(--accent, #3b82f6); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #3b82f6) 25%, transparent); }
.modes { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.modes legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.mode { position: relative; display: block; cursor: pointer; }
.mode input { position: absolute; opacity: 0; inset: 0; }
.mode span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border, #1f2d47); background: var(--bg-primary, #0a0f1c); transition: border-color .15s, background .15s; }
.mode b { font-size: 14px; }
.mode small { font-size: 12.5px; line-height: 1.4; color: var(--text-muted, #7386a3); }
.mode input:checked + span { border-color: var(--accent, #3b82f6); background: color-mix(in srgb, var(--accent, #3b82f6) 12%, transparent); }
.mode input:focus-visible + span { outline: 3px solid var(--accent, #3b82f6); outline-offset: 2px; }
.task-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.examples { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.examples li { padding: 8px 12px; border-radius: 10px; background: var(--bg-primary, #0a0f1c); border: 1px solid var(--border, #1f2d47); color: var(--text-secondary, #96a7c2); font-size: .94rem; }

/* ── The agents ── */
.agent-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.agent-card { padding: 16px; border-radius: 16px; border: 1px solid var(--border, #1f2d47); background: var(--bg-secondary, #101828); }
.agent-card.off { opacity: .78; }
.agent-card header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.agent-card p { margin: .5rem 0 0; font-size: 14px; line-height: 1.5; }

/* ── One task: the status line and the task, the outcome, how it went, why ── */
.task-head { margin-top: .4rem; }
.task-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 .4rem; color: var(--text-muted, #7386a3); font-size: .88rem; }
.task-text { font-size: 1.55rem; line-height: 1.3; font-weight: 700; margin: .2rem 0 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: .8rem; border: 1px solid var(--border-light, #2c3d5c); color: var(--text-secondary, #96a7c2); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-succeeded { color: var(--success, #22c55e); border-color: color-mix(in srgb, var(--success, #22c55e) 45%, transparent); }
.pill-failed { color: var(--error, #ef4444); border-color: color-mix(in srgb, var(--error, #ef4444) 45%, transparent); }
.pill-running, .pill-verifying, .pill-queued { color: var(--accent-light, #60a5fa); border-color: color-mix(in srgb, var(--accent, #3b82f6) 45%, transparent); }
.chip { padding: 2px 9px; border-radius: 999px; background: var(--bg-card, #131c2e); border: 1px solid var(--border, #1f2d47); font-size: .8rem; color: var(--text-secondary, #96a7c2); }
.outcome { margin: 0 0 1.6rem; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--border-light, #2c3d5c); background: var(--bg-secondary, #101828); }
.outcome > h2 { margin: 0 0 .4rem; font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.outcome > p { margin: .3rem 0; color: var(--text-secondary, #96a7c2); }
.outcome-ok { border-color: color-mix(in srgb, var(--success, #22c55e) 35%, var(--border-light, #2c3d5c)); }
.outcome-bad { border-color: color-mix(in srgb, var(--error, #ef4444) 40%, var(--border-light, #2c3d5c)); background: color-mix(in srgb, var(--error, #ef4444) 5%, var(--bg-secondary, #101828)); }
.outcome-live { border-color: color-mix(in srgb, var(--accent, #3b82f6) 40%, var(--border-light, #2c3d5c)); }
.outcome-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.outcome .sc-btn { padding: 9px 16px; font-size: 14px; }
.answer .prose { font-size: 1.02rem; line-height: 1.65; }
.answer .prose > :first-child { margin-top: 0; }
.sources h3 { font-size: .8rem; letter-spacing: .5px; text-transform: uppercase; color: var(--text-muted, #7386a3); margin: 1rem 0 .3rem; }
.sources ul { margin: 0; padding-left: 18px; font-size: .9rem; overflow-wrap: anywhere; }
.answer-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 1rem 0 0; padding-top: 12px; border-top: 1px solid var(--border, #1f2d47); font-size: .85rem; color: var(--text-muted, #7386a3); }
.answer-foot span:nth-child(2) { color: var(--success, #22c55e); }
.how > h2 { font-size: 1.05rem; color: var(--text-secondary, #96a7c2); }
.attempts { display: grid; gap: 12px; }
.attempt { border: 1px solid var(--border, #1f2d47); border-radius: 14px; padding: 12px 14px; background: var(--bg-card, #131c2e); }
.attempt-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.attempt-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--accent-light, #60a5fa); border: 1px solid var(--border-light, #2c3d5c); }
.tl { list-style: none; margin: 10px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--border, #1f2d47); display: grid; gap: 6px; }
.tl:empty { display: none; }
.tl-item { display: grid; grid-template-columns: 52px 1fr; gap: 10px; font-size: .9rem; position: relative; animation: step-in .25s ease-out; }
.tl-item::before { content: ""; position: absolute; left: -18px; top: .55em; width: 10px; height: 10px; border-radius: 50%; background: var(--bg-card, #131c2e); border: 2px solid var(--border-light, #2c3d5c); }
.tl-k { font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--text-muted, #7386a3); padding-top: 2px; }
.tl-v { overflow-wrap: anywhere; white-space: pre-wrap; }
.tl-ok::before { border-color: var(--success, #22c55e); background: var(--success, #22c55e); }
.tl-ok .tl-k { color: var(--success, #22c55e); }
.tl-err::before { border-color: var(--warning, #f59e0b); }
.tl-err .tl-k { color: var(--warning, #f59e0b); }
.refused { margin: 10px 0 0; }
.refused summary { cursor: pointer; font-size: .88rem; color: var(--text-muted, #7386a3); }
.refused .prose { margin-top: 8px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--border-light, #2c3d5c); font-size: .92rem; opacity: .85; }
.dot-pulse { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent, #3b82f6); animation: pulse 1.2s ease-in-out infinite; }
.live-note { display: flex; align-items: center; gap: 8px; }
.api-hint { margin-top: 1.4rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@keyframes pulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
@keyframes step-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.why { margin-top: 1.4rem; border: 1px solid var(--border, #1f2d47); border-radius: 12px; padding: 10px 14px; }
.why summary { cursor: pointer; font-weight: 700; }

@media (max-width: 640px) {
  .tl-item { grid-template-columns: 1fr; gap: 2px; }
  .task-text { font-size: 1.25rem; }
  .outcome { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { .tl-item, .dot-pulse { animation: none; } .mode span { transition: none; } }
