.work-progress { margin: 0 0 14px; min-width: 0; }
.browser-preview { margin: 12px 0; width: min(100%,360px); overflow: hidden; border: 1px solid var(--border); border-radius: 16px; animation: workCommentIn .35s var(--ease); }
.browser-preview img { display: block; width: 100%; height: auto; max-height: 240px; object-fit: cover; object-position: top; }
.browser-preview figcaption { padding: 8px 12px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-progress[hidden], .work-progress [hidden] { display: none !important; }
.work-progress-comments { display: grid; gap: 12px; }
.work-progress-phase { color: var(--muted); font-size: 13px; }
.message-body .work-progress-phase { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.message-body .work-progress-phase summary { font-weight: 400; list-style: none; }
.work-progress-phase summary::-webkit-details-marker { display: none; }
.work-progress-phase[open] > summary .work-progress-chevron { transform: rotate(180deg); }
.work-progress-phase > div { padding: 8px 12px; line-height: 1.7; animation: workCommentIn .3s var(--ease); }
.work-progress-commentary { font: inherit; line-height: inherit; animation: workCommentIn .3s var(--ease); }
.work-progress-commentary :first-child { margin-top: 0; }
.work-progress-commentary :last-child { margin-bottom: 0; }
.work-progress-live > .status-line { margin: 12px 0 0; }
.work-progress-faster { display:block; margin:10px 0 0; padding:6px 12px; border:1px solid var(--line); border-radius:999px; background:transparent; color:var(--muted); font:inherit; font-size:12px; cursor:pointer; }
.work-progress-faster:disabled { cursor:default; opacity:.65; }
.work-progress-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 3px 0; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; text-align: left; cursor: pointer; transition: color .18s ease; }
.work-progress-toggle:active { color: var(--text); }
.work-progress-toggle:focus-visible { outline: 2px solid var(--muted); outline-offset: 4px; border-radius: 6px; }
.work-progress-chevron { display: flex; width: 16px; height: 16px; transition: transform .3s var(--ease); }
.work-progress-chevron svg { width: 16px; height: 16px; }
.work-progress.is-expanded .work-progress-chevron { transform: rotate(180deg); }
.work-progress-panel { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .34s var(--ease), opacity .24s ease; }
.work-progress.is-expanded .work-progress-panel { grid-template-rows: 1fr; opacity: 1; }
.work-progress-history { min-height: 0; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.65; }
.work-progress-entry { padding: 4px 0 4px 14px; margin-left: 3px; border-left: 1px solid color-mix(in srgb, var(--muted) 28%, transparent); }
.work-progress-entry.is-commentary { padding-block: 10px; font-size: 14px; }
.work-progress-entry.is-commentary * { color: inherit; }
.work-progress-entry.is-commentary :first-child { margin-top: 0; }
.work-progress-entry.is-commentary :last-child { margin-bottom: 0; }
/* действия агента на компьютере: строка «что делает и с чем», раскрывается в дифф или вывод команды */
.work-progress { --work-add: #3fb950; --work-del: #f85149; }
html[data-theme="light"] .work-progress { --work-add: #1a7f37; --work-del: #cf222e; }
.work-actions { display: grid; gap: 2px; margin: 10px 0 0; }
.work-actions-more { justify-self: start; margin: 0 0 2px; padding: 2px 0; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.work-action { min-width: 0; color: var(--muted); font-size: 13px; animation: workCommentIn .28s var(--ease); }
.work-action-head { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 30px; padding: 3px 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; }
button.work-action-head { cursor: pointer; }
button.work-action-head:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; border-radius: 6px; }
.work-action-state { position: relative; flex: none; width: 14px; height: 14px; border-radius: 50%; }
.work-action.is-running .work-action-state { border: 1.5px solid color-mix(in srgb, var(--muted) 35%, transparent); border-top-color: var(--text); animation: spin .8s linear infinite; }
.work-action.is-done .work-action-state { background: color-mix(in srgb, var(--work-add) 18%, transparent); }
.work-action.is-done .work-action-state::after { content: ''; position: absolute; left: 4.5px; top: 2.5px; width: 3px; height: 6px; border: solid var(--work-add); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.work-action:is(.is-error,.is-denied) .work-action-state { background: color-mix(in srgb, var(--work-del) 18%, transparent); }
.work-action:is(.is-error,.is-denied) .work-action-state::before, .work-action:is(.is-error,.is-denied) .work-action-state::after { content: ''; position: absolute; left: 6.25px; top: 3.5px; width: 1.5px; height: 7px; background: var(--work-del); transform: rotate(45deg); }
.work-action:is(.is-error,.is-denied) .work-action-state::after { transform: rotate(-45deg); }
.work-action-title { flex: none; color: var(--text); }
.work-action.is-done .work-action-title { color: inherit; }
.work-action-target { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12px/1.4 "SFMono-Regular", ui-monospace, Menlo, monospace; }
.work-action-stat { display: inline-flex; flex: none; gap: 5px; font-variant-numeric: tabular-nums; font-size: 12px; }
.work-action-stat .is-add { color: var(--work-add); }
.work-action-stat .is-del { color: var(--work-del); }
.work-action-note { flex: none; color: var(--work-del); font-size: 12px; }
.work-action-chevron { flex: none; width: 14px; height: 14px; transition: transform .25s var(--ease); }
.work-action-head[aria-expanded="true"] .work-action-chevron { transform: rotate(180deg); }
.work-action-detail { margin: 2px 0 8px 22px; min-width: 0; }
.work-action-error { margin: 0 0 6px; color: var(--work-del); white-space: pre-wrap; overflow-wrap: anywhere; }
.work-action-files { margin: 0 0 6px; padding: 0; list-style: none; }
.work-action-files li { display: flex; justify-content: space-between; gap: 10px; font: 12px/1.6 "SFMono-Regular", ui-monospace, Menlo, monospace; }
.work-action-files li > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-action-preview { max-height: 280px; margin: 0; padding: 10px 12px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--panel) 80%, transparent); color: var(--text); font: 12px/1.5 "SFMono-Regular", ui-monospace, Menlo, monospace; white-space: pre; overscroll-behavior: contain; }
.work-action-preview.is-text, .work-action-preview.is-output { white-space: pre-wrap; overflow-wrap: anywhere; }
.work-action-preview span { display: block; }
.work-action-preview .is-add { background: color-mix(in srgb, var(--work-add) 14%, transparent); color: var(--work-add); }
.work-action-preview .is-del { background: color-mix(in srgb, var(--work-del) 14%, transparent); color: var(--work-del); }
.work-action-preview .is-hunk { color: var(--muted); }
.work-progress-entry.work-action { padding-block: 0; }
.work-progress-phase.is-actions > div { padding: 2px 0 6px 12px; }
/* план хода: тот же список шагов, что в приложении, обновляется на месте */
.work-plan { margin: 12px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; animation: workCommentIn .3s var(--ease); }
.work-plan-title { margin: 0 0 6px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.work-plan ol { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; line-height: 1.45; }
.work-plan li { position: relative; padding-left: 22px; color: var(--muted); }
.work-plan li::before { content: ''; position: absolute; left: 1px; top: .32em; width: 11px; height: 11px; border: 1.5px solid color-mix(in srgb, var(--muted) 55%, transparent); border-radius: 50%; }
.work-plan li.is-in_progress { color: var(--text); }
.work-plan li.is-in_progress::before { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 2.5px, transparent 3px); }
.work-plan li.is-completed { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.work-plan li.is-completed::before { border-color: transparent; background: color-mix(in srgb, var(--work-add) 22%, transparent); }
.work-plan li.is-completed::after { content: ''; position: absolute; left: 5.5px; top: calc(.32em + 2.5px); width: 3px; height: 6px; border: solid var(--work-add); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.work-progress-entry.work-plan { margin: 6px 0 6px 3px; }
@keyframes workCommentIn { from { opacity: 0; filter: blur(3px); transform: translateY(5px); } to { opacity: 1; filter: blur(0); transform: translateY(0); } }
@media (hover: hover) and (pointer: fine) { .work-progress-toggle:hover, .work-actions-more:hover, button.work-action-head:hover { color: var(--text); } }
@media (prefers-reduced-motion: reduce) { .work-progress *, .work-progress { animation: none !important; transition: none !important; } }
