/* Live status (#348, live.js): what Ari does right now, in the engine's own words, rewritten in place.
   Compact like Claude's own: one line for now, one fold for the rest; marks, never colour alone. */
.live-block{display:flex;flex-direction:column;gap:2px;width:100%;max-width:min(640px,100%);margin:2px 0 4px;font-size:var(--text-caption);line-height:var(--leading-caption);color:var(--text-2)}
.live-block:empty{display:none}
.live-now{display:flex;align-items:center;gap:8px;min-width:0;margin:0;min-height:24px}
.live-now-words{display:flex;align-items:baseline;gap:6px;min-width:0;flex:1 1 auto;overflow:hidden}
.live-now .live-title{color:var(--text);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.live-now .live-state{color:var(--text-2);font-weight:400}
.live-sub{color:var(--text-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.live-sub::before{content:"·";margin-right:6px}
.live-time{flex:none;color:var(--text-3);font-variant-numeric:tabular-nums}
/* #349: the chat's depth, only when Ari chose other than the usual one: the same mark and word as a quest's. */
.live-depth-chip{display:inline-flex;align-items:center;gap:4px;flex:none;color:var(--text-2);font-size:var(--text-micro);line-height:18px}
.live-tool{flex:none;padding:0 6px;border-radius:6px;background:var(--glass-soft);border:1px solid var(--stroke-soft);color:var(--text-2);font-family:var(--mono);font-size:var(--text-micro);line-height:18px}
.live-arg{display:block;max-width:100%;margin:0 0 0 16px;font-family:var(--mono);font-size:var(--text-micro);line-height:var(--leading-micro);color:var(--text-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.live-out{display:block;margin:0 0 0 16px;font-family:var(--mono);font-size:var(--text-micro);line-height:var(--leading-micro);color:var(--text-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Marks: running pulses; done is a small check; failed a small cross; a plan step to do is a ring. */
.live-mark{position:relative;flex:none;display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--violet)}
.live-run{animation:ari-pulse 1.2s ease-in-out infinite;box-shadow:0 0 8px color-mix(in srgb,var(--violet) 60%,transparent)}
.live-ok{width:9px;height:5px;border-radius:0;background:none;border:solid var(--mint);border-width:0 0 2px 2px;transform:translateY(-2px) rotate(-45deg)}
.live-fail{background:none}
.live-fail::before,.live-fail::after{content:"";position:absolute;left:3px;top:-1px;width:2px;height:10px;background:var(--rose);transform:rotate(45deg)}
.live-fail::after{transform:rotate(-45deg)}
.live-todo{background:none;border:1.5px solid var(--text-3)}
/* One fold: a 44px hit area, a compact line on screen. */
.live-fold>summary,.live-done>summary{display:flex;align-items:center;gap:6px;min-height:44px;margin:-8px 0;padding:0 2px;list-style:none;color:var(--text-2);cursor:pointer;width:max-content;max-width:100%}
.live-fold>summary::-webkit-details-marker,.live-done>summary::-webkit-details-marker{display:none}
.live-fold>summary::after,.live-done>summary::after{content:"";width:6px;height:6px;margin-left:2px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:translateY(-2px) rotate(45deg);transition:transform var(--fast) var(--ease)}
.live-fold[open]>summary::after,.live-done[open]>summary::after{transform:translateY(1px) rotate(-135deg)}
.live-count{color:var(--text-3);font-variant-numeric:tabular-nums}
.live-fold-label{color:var(--text-2)}
.live-fold-body,.live-done-body{display:flex;flex-direction:column;gap:6px;margin:8px 0 2px;padding:8px 0 2px 12px;border-left:1.5px solid var(--stroke-soft)}
.live-thought .live-fold-label{display:block;font-size:var(--text-micro);color:var(--text-3)}
.live-thinking{margin:2px 0 0;white-space:pre-wrap;color:var(--text-2);font-style:italic;max-height:9.5em;overflow:auto}
.live-steps,.live-plan,.live-tasks{display:flex;flex-direction:column;gap:4px;margin:0;padding:0;list-style:none}
.live-step,.live-plan>li,.live-task{display:grid;grid-template-columns:12px minmax(0,1fr) auto;align-items:center;column-gap:6px;min-width:0}
.live-step>.live-arg,.live-step>.live-out{grid-column:2/4;margin:0}
.live-step-words{display:flex;align-items:baseline;gap:6px;min-width:0;overflow:hidden}
.live-step .live-title,.live-task .live-title,.live-plan>li>span:last-child{color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.live-step-ok .live-title,.live-plan-done>span:last-child{color:var(--text-2)}
.live-step-fail .live-title{color:var(--rose)}
/* Under a reply: "What I did · N steps", folded, as quiet as "What I recalled". */
.message.assistant>.live-done{margin-top:2px;max-width:min(640px,100%);font-size:13px}
/* The chat's background tasks (#234): a count above the composer, the list with Stop per task. */
.chat-tasks{width:100%;max-width:800px;margin:0 auto;padding:0 20px;flex-shrink:0;font-size:var(--text-caption);line-height:var(--leading-caption);color:var(--text-2)}
.chat-tasks>summary{display:inline-flex;align-items:center;gap:8px;min-height:44px;list-style:none;cursor:pointer}
.chat-tasks>summary::-webkit-details-marker{display:none}
.chat-tasks>summary::after{content:"";width:6px;height:6px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:translateY(-2px) rotate(45deg)}
.chat-tasks[open]>summary::after{transform:translateY(1px) rotate(-135deg)}
.chat-tasks-list{display:flex;flex-direction:column;gap:2px;max-height:180px;overflow:auto;padding:0 0 4px}
.chat-task{display:grid;grid-template-columns:12px minmax(0,1fr) auto 44px;align-items:center;column-gap:8px;min-height:44px}
.chat-task-words{display:flex;flex-direction:column;min-width:0}
.chat-task-title{color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-task .live-sub::before{content:none}
.chat-task-stop{display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border-radius:50%;color:var(--rose);background:transparent;border:0}
.chat-task-stop .stop-square{width:10px;height:10px;border-radius:2px}
.chat-task-stop:disabled{opacity:.5}
/* A quest's row and card: the engine's own words for now, on one line. */
.live-line:empty{display:none}
.live-line .live-mark{margin-right:2px}
.live-line .live-doing{color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.live-line .live-time::before{content:"·";margin:0 6px;color:var(--text-3)}
.live-line .live-time:first-child::before{content:none;margin:0}
/* His language's words (the engine's step) never share a line with the page's words (#581): the mark, tool and time first, the words below. */
.live-line:has(.own-line){flex-wrap:wrap}
.live-line:has(.own-line) .live-time::before,.quest-meta:has(.own-line) .live-time::before{content:none;margin:0}
.quest-meta:has(.own-line) .live-mark{margin-right:6px}
.live-line .own-line,.quest-meta .own-line{display:block;flex:1 0 100%;max-width:100%}
.quest-live>.live-block{margin:0}
/* Home & care › Live steps: three icons, like Look (names in ⓘ, aria-label and title). */
.live-switch{width:auto;flex:none}
.care-live #live-level-label{flex:1}
@media (max-width:719px){
  .chat-tasks{padding:0 16px}
}
@media (prefers-reduced-motion:reduce){.live-run{animation:none!important}}
/* The time sits apart by space alone in a live line and a task row: no middle-dot meta string. */
.live-now .live-time::before,.chat-task .live-time::before,.live-task .live-time::before{content:none;margin:0}
.live-done .live-run{animation:none;box-shadow:none}  /* a folded record does not pulse */
/* A quest's history (#356, story.js): every try kept after it ends, folded per try; the newest open. */
.quest-history{padding:4px 18px 10px;border-radius:var(--r-card);min-width:0;overflow-wrap:anywhere}
.quest-history>summary,.history-try>summary,.history-details>summary,.history-thought>summary,.question-asked-fold>summary{display:flex;align-items:center;gap:8px;min-height:44px;list-style:none;cursor:pointer;min-width:0}
.quest-history>summary::-webkit-details-marker,.history-try>summary::-webkit-details-marker,.history-details>summary::-webkit-details-marker,
.history-thought>summary::-webkit-details-marker,.question-asked-fold>summary::-webkit-details-marker{display:none}
.quest-history>summary::after,.history-try>summary::after,.history-details>summary::after,.history-thought>summary::after,.question-asked-fold>summary::after{content:"";flex:none;width:6px;height:6px;margin-left:auto;border:solid var(--text-3);border-width:0 1.5px 1.5px 0;transform:translateY(-2px) rotate(45deg);transition:transform var(--fast) var(--ease)}
.quest-history[open]>summary::after,.history-try[open]>summary::after,.history-details[open]>summary::after,.history-thought[open]>summary::after,.question-asked-fold[open]>summary::after{transform:translateY(1px) rotate(-135deg)}
.history-title{font-size:15px;font-weight:560;color:var(--cyan);letter-spacing:.01em}
.history-try{border-top:1px solid var(--stroke-soft);min-width:0}
.history-try-name{font-weight:560;color:var(--text)}
.history-try-state{font-size:var(--text-micro);padding:2px 8px}
.history-try-state.ended-failed{color:var(--rose)}
.history-try-state.ended-succeeded{color:var(--mint,var(--text-2))}
.history-try>summary time{color:var(--text-3)}
.history-try-name,.history-try>summary time{white-space:nowrap}
.history-try-state.working-now{color:var(--cyan)}
.history-try>:not(summary){margin:6px 0 6px 2px}
.history-why{display:flex;align-items:center;gap:4px;margin:0;color:var(--text-2)}
.history-steps .live-title{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
.history-steps .live-step-words{overflow:visible}
.history-step-stopped .live-title{color:var(--text-3)}
.history-try>.history-note{margin:2px 0 2px 26px;color:var(--text-2);overflow-wrap:anywhere}
.history-thought>summary{color:var(--text-2)}
.history-thought>summary .live-thinking{flex:1;min-width:0;max-height:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.history-thought[open]>summary .live-thinking{display:none}
.history-thought-text{max-height:none}
.history-question{margin:8px 0}
.history-choices{margin:2px 0 6px}
.history-details>summary{color:var(--text-2);font-size:14px}
.history-details-body{display:flex;flex-direction:column;gap:6px;padding:4px 0 6px 12px;border-left:1.5px solid var(--stroke-soft);min-width:0}
.history-details-body p{margin:0}
.history-facts{display:flex;flex-wrap:wrap;gap:2px 0}
.history-facts span+span::before{content:"·";padding:0 6px;color:var(--text-3)}
.history-subhead{font-size:var(--text-micro);font-weight:560;color:var(--text-3);text-transform:none}
.quest-history-failed{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 18px}
.quest-history-failed .history-title{color:var(--text-2)}
.quest-history-failed button{min-height:44px}
/* Every fold opens on a 44 px target with a visible focus ring; the chevron turns, or under reduced motion
   simply changes. */
.quest-history summary:focus-visible,.question-asked-fold>summary:focus-visible{outline:2px solid var(--cyan);outline-offset:2px;border-radius:8px}
@media (prefers-reduced-motion:reduce){
  .quest-history>summary::after,.history-try>summary::after,.history-details>summary::after,.history-thought>summary::after,.question-asked-fold>summary::after{transition:none}
}
.question-asked-fold .question-text,.question-whole-answer{margin:4px 0;white-space:pre-wrap}
