/* Расширение симулятора: только ветвление и подробности по запросу. */
.stage { transition: margin-right .24s cubic-bezier(.2, .75, .25, 1); }
.layout.has-inspector .stage { margin-right: min(415px, 100vw); }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border: 1px solid #dce3df; border-radius: 9px; background: #ecf1ee; }
.mode-switch button { min-height: 35px; padding: 6px 4px; border: 0; border-radius: 6px; background: transparent; color: #63736e; font-size: 12px; }
.mode-switch button[aria-current="page"] { background: #fff; color: #1d5b43; box-shadow: 0 1px 3px #1e40301a; font-weight: 600; }
.mode-note { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.inspector-content .trace-status { display: inline-flex; align-items: center; padding: 1px 5px; border: 1px solid #dae4de; border-radius: 4px; color: #50725f; font-size: 10px; }
.inspector-content .trace-status[data-status="failed"], .inspector-content .trace-status[data-status="unknown"] { border-color: #e7c8c2; color: #a34b41; }
.inspector-content .trace-operation { margin: 0; padding: 8px 0; border-top: 1px solid #edf0ee; }
.inspector-content .trace-operation > summary { display: flex; align-items: center; gap: 7px; color: var(--ink); list-style: none; }
.inspector-content .trace-operation > summary::-webkit-details-marker { display: none; }
.inspector-content .trace-operation > summary .trace-status { margin-left: auto; }
.inspector-content .trace-operation > div { padding: 5px 0 5px 26px; }
.inspector-content .trace-raw { margin-top: 10px; }
.inspector-content .trace-empty { color: var(--muted); }
.inspector-content .trace-surface { margin-top: 8px; padding: 8px 10px; border-left: 2px solid #99b7a2; background: #f5f8f5; }
.inspector-content .trace-surface strong { color: #456b55; font-size: 10px; }
.inspector-content .trace-surface pre { background: transparent; border: 0; padding: 0; }
.message.inspectable { cursor: pointer; border: 0; text-align: left; color: var(--ink); font: inherit; }
.message.inspectable:hover, .message.inspectable.selected { outline: 1px solid #52aa82; outline-offset: 1px; }
.sidebar.collapsed .mode-switch { display: none; }
.composer-placeholder { flex: 1; padding: 11px 8px; color: #88949a; font-size: 14px; }
.composer .send-button:disabled { opacity: .55; cursor: default; }
#messages { gap: 7px; }
.message { border: 0; text-align: left; }
button.message { cursor: pointer; }
button.message:hover, button.message.selected { outline: 1px solid #52aa82; outline-offset: 1px; }
.message-meta { pointer-events: none; }
.message-photo-placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 124px; margin: 0 0 6px; padding: 17px 12px; border-radius: 5px; background: #d8e4dc; color: #416254; text-align: center; font-size: 12px; }
.message-photo-placeholder .icon { width: 22px; height: 22px; }
.message-branch { align-self: flex-end; display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin: -4px 1px 9px 0; color: #667781; font-size: 11px; }
.message-branch button { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #53676e; cursor: pointer; }
.message-branch .icon { width: 15px; height: 15px; }
.message-branch button:hover, .message-branch button:focus-visible { background: #ffffffb7; }
.message-branch output { min-width: 34px; text-align: center; }
.inspector { position: fixed; z-index: 40; inset: 0 0 0 auto; width: min(415px, 100vw); height: 100dvh; display: flex; flex-direction: column; border-left: 1px solid #dce1e2; background: #fff; box-shadow: -12px 0 32px #26363912; visibility: hidden; pointer-events: none; transform: translateX(100%); transition: transform .24s cubic-bezier(.2, .75, .25, 1), visibility .24s; }
.inspector.open { visibility: visible; pointer-events: auto; transform: translateX(0); }
.inspector-header { height: 64px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 1px solid var(--line); font-size: 14px; }
.inspector-header button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); }
.inspector-header button .icon { width: 18px; height: 18px; }
.inspector-content { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px 28px; font-size: 12px; line-height: 1.5; scrollbar-width: thin; }
.inspector-footer { height: 54px; flex: none; display: flex; align-items: center; justify-content: center; gap: 11px; border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 11px; }
.inspector-footer button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #53676e; }
.inspector-footer button .icon { width: 18px; height: 18px; }
.inspector-footer button:hover, .inspector-footer button:focus-visible { background: #f0f5f2; }
.inspector-footer output { min-width: 50px; text-align: center; }
.inspector-content h2 { margin: 0 0 16px; font-size: 17px; font-weight: 600; }
.inspector-content h3 { margin: 22px 0 7px; padding-bottom: 5px; border-bottom: 1px solid var(--line); color: #32594d; font-size: 11px; font-weight: 700; }
.inspector-content p { margin: 7px 0; }
.inspector-content dl { margin: 0; }
.inspector-content dl div { display: grid; grid-template-columns: 112px 1fr; gap: 10px; padding: 5px 0; border-bottom: 1px solid #f0f2f2; }
.inspector-content dt { color: var(--muted); }
.inspector-content dd { margin: 0; overflow-wrap: anywhere; }
.inspector-content code { font: 11px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; }
.inspector-content details { margin-top: 9px; }
.inspector-content summary { cursor: pointer; color: #126c51; }
.inspector-content pre { max-height: 320px; overflow: auto; margin: 7px 0; padding: 10px; background: #f5f7f7; border: 1px solid var(--line); border-radius: 5px; font: 10px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.inspector-content ol { margin: 4px 0 0; padding-left: 20px; }
.inspector-content li { margin: 0 0 6px; }
.inspector-content .muted { color: var(--muted); }
.inspector-content a { color: #126c51; }
.trace-flow { margin: 16px 0 4px; border-top: 1px solid var(--line); }
.trace-stage { border-bottom: 1px solid var(--line); }
.trace-stage-toggle { width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 14px 0; border: 0; background: #fff; color: var(--ink); text-align: left; }
.trace-stage-toggle:hover { background: #fafcfb; }
.trace-number { flex: none; display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid #cbdad1; border-radius: 50%; background: #fbfdfb; color: #4b715c; font: 600 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.trace-stage-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.trace-stage-heading { display: block; padding-top: 3px; }
.trace-stage-copy strong { font-size: 13px; line-height: 1.3; font-weight: 600; }
.trace-llm-badge { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 19px; margin: 2px 0 0 auto; padding: 2px 6px; border: 1px solid #82ae93; border-radius: 4px; background: transparent; color: #2d7451; font: 600 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .03em; }
.trace-stage-summary { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--muted); font-size: 12px; line-height: 1.4; }
.trace-caret { width: 16px; height: 16px; margin: 3px 0 0 2px; color: #8b999e; transition: transform .16s; }
.trace-stage.expanded .trace-caret { transform: rotate(180deg); }
.trace-stage-body { padding: 0 0 17px 33px; }
.trace-stage-body[hidden] { display: none; }
.trace-stage-body > p:first-child { margin-top: 0; }
.trace-line { display: grid; grid-template-columns: 89px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-top: 1px solid #f0f2f2; }
.trace-label { color: #74848a; }
.trace-value { min-width: 0; overflow-wrap: anywhere; }
.trace-note { margin: 9px 0 0 !important; color: var(--muted); font-size: 11px; line-height: 1.45; }
.trace-plan-list { margin: 7px 0 0 !important; padding-left: 19px !important; }
.trace-plan-list li { padding-left: 2px; }
.trace-action { margin: 0 !important; border-top: 1px solid #edf0ee; }
.trace-action:first-child { border-top: 0; }
.trace-action summary { display: flex; align-items: center; gap: 8px; min-height: 40px; color: var(--ink); list-style: none; }
.trace-action summary::-webkit-details-marker { display: none; }
.trace-action-caret { width: 15px; height: 15px; margin-left: 2px; color: #8b999e; transition: transform .16s; }
.trace-action[open] .trace-action-caret { transform: rotate(180deg); }
.trace-action-position { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid #d8dfdc; border-radius: 50%; color: #687a73; font: 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.trace-action-title { flex: 1; min-width: 0; font-weight: 600; }
.trace-action-body { padding: 0 0 13px 26px; }
.trace-model { margin: 8px 0 7px; padding: 8px 10px; border-left: 2px solid #96b9a4; background: #f5f8f5; }
.trace-model-heading { display: block; margin-bottom: 5px; color: #456b55; font-size: 10px; font-weight: 700; }
.trace-model .trace-line { grid-template-columns: 55px minmax(0, 1fr); border-color: #e7ede7; }
.trace-action-read .trace-action-position { border-color: #d8e1e7; color: #637984; }
.trace-action-search .trace-action-position { border-color: #c7ddcc; color: #2d7850; }
.trace-action-flow .trace-action-position { border-color: #dfd8c6; color: #846e45; }
.trace-search-path { display: flex; flex-wrap: wrap; gap: 5px; padding: 9px 0; border-top: 1px solid #f0f2f2; }
.trace-search-path span { padding: 3px 6px; border: 1px solid #dbe8dd; border-radius: 3px; color: #476955; font-size: 10px; }
.trace-search-arrow { width: 13px; height: 13px; align-self: center; color: #8d9d91; }
.trace-possibilities { margin: 10px 0 0 !important; }
.trace-possibilities summary { display: flex; align-items: center; gap: 6px; color: #5a6e67; font-size: 11px; list-style: none; }
.trace-possibilities summary::-webkit-details-marker { display: none; }
.trace-possibilities-caret { width: 14px; height: 14px; color: #7d9388; transition: transform .16s; }
.trace-possibilities[open] .trace-possibilities-caret { transform: rotate(180deg); }
.trace-possibilities ul { margin: 5px 0 0; padding-left: 18px; color: #5a6e67; }
.trace-changes { padding: 7px 0; border-top: 1px solid #f0f2f2; }
.trace-change { display: grid; grid-template-columns: 1fr auto auto auto; align-items: baseline; gap: 6px; margin: 3px 0; }
.trace-change-label { color: #74848a; }
.trace-change-before { color: #7a8789; text-decoration: line-through; overflow-wrap: anywhere; text-align: right; }
.trace-change-arrow { width: 13px; height: 13px; color: #8b999e; }
.trace-change-after { color: #1b674a; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 1050px) {
  .layout.has-inspector .stage { margin-right: 360px; }
  .inspector { width: 360px; }
}
@media (max-width: 720px) {
  .layout.has-inspector .stage { margin-right: 0; }
  .inspector { width: 100%; }
  .inspector-header { padding-top: env(safe-area-inset-top); height: calc(64px + env(safe-area-inset-top)); }
}
@media (prefers-reduced-motion: reduce) {
  .inspector, .stage, .trace-caret, .trace-action-caret, .trace-possibilities-caret { transition: none; }
}
