.conversation-logs-app {
    --logs-list-width: 390px;
}

.logs-main-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    padding: 16px 18px;
    gap: 0;
}

.conversation-logs-app .identity-card {
    margin-top: auto;
}

.logs-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 6px 0 16px;
}

.logs-page-head h1 {
    margin: 6px 0 0;
    font-size: 28px;
    line-height: 1.05;
    font-weight: 650;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.logs-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logs-search {
    position: relative;
    width: min(340px, 32vw);
}

.logs-search svg {
    position: absolute;
    top: 50%;
    left: 13px;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 1.8;
    transform: translateY(-50%);
    pointer-events: none;
}

.logs-search input {
    min-height: 44px;
    padding-left: 40px;
}

.logs-select-filter {
    position: relative;
    flex: 0 0 auto;
}

.logs-project-filter {
    width: 176px;
}

.logs-status-filter {
    width: 160px;
}

.logs-filter-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    border: 0;
    padding: 0 12px;
    border-radius: 12px;
    color: var(--text);
    background: var(--surface-raised);
    box-shadow: var(--shadow-border);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 160ms ease,
        color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.logs-filter-trigger:hover {
    box-shadow: var(--shadow-border-hover);
}

.logs-filter-trigger:active {
    transform: scale(0.96);
}

.logs-filter-trigger:focus-visible,
.logs-filter-popover button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

.logs-filter-chevron {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    color: var(--text-muted);
    font-size: 0;
    line-height: 0;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 160ms ease;
}

.logs-filter-trigger[aria-expanded="true"] .logs-filter-chevron {
    transform: translateY(2px) rotate(225deg);
}

.logs-filter-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 31;
    width: 190px;
    padding: 6px;
    border: 0;
    border-radius: 14px;
    background: var(--surface-floating);
    box-shadow: var(--shadow-border), 0 20px 44px rgba(0, 0, 0, 0.36);
}

.logs-status-filter .logs-filter-popover {
    right: 0;
    left: auto;
}

.logs-filter-popover[hidden],
.logs-hidden-control {
    display: none;
}

.logs-filter-popover button {
    width: 100%;
    min-height: 40px;
    border: 0;
    border-radius: 9px;
    padding: 0 10px;
    color: var(--text);
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition:
        background 160ms ease,
        color 160ms ease,
        transform 160ms ease;
}

.logs-filter-popover button:hover,
.logs-filter-popover button.is-active {
    background: rgba(255, 255, 255, 0.12);
}

.logs-filter-popover button:active {
    transform: scale(0.96);
}

.logs-refresh {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 12px;
    color: var(--text-soft);
    background: var(--surface-input);
    box-shadow: var(--shadow-border);
}

.logs-refresh svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.logs-refresh.is-loading svg {
    animation: logs-spin 700ms linear infinite;
}

@keyframes logs-spin {
    to { transform: rotate(360deg); }
}

.logs-workspace {
    display: grid;
    grid-template-columns: var(--logs-list-width) minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-border), var(--shadow-soft);
}

.run-list-panel {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    padding: 14px;
    background: rgba(18, 18, 20, 0.82);
    box-shadow: 1px 0 0 var(--line);
}

.run-list {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 6px;
    overflow: auto;
    padding: 1px 4px 1px 1px;
}

.run-card {
    display: grid;
    gap: 6px;
    width: 100%;
    min-height: 88px;
    padding: 10px 12px;
    border: 0;
    border-radius: 14px;
    color: var(--text);
    background: transparent;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 0 0 1px transparent;
    transition-property: background, box-shadow, transform;
    transition-duration: var(--duration-ui);
    transition-timing-function: var(--ease-out);
}

.run-card:hover {
    background: rgba(255, 255, 255, 0.04);
}

.run-card.is-active {
    background: var(--surface-floating);
    box-shadow: var(--shadow-border-hover), 0 10px 26px rgba(0, 0, 0, 0.15);
}

.run-card:active {
    transform: scale(0.96);
}

.run-card-top,
.run-card-bottom,
.detail-title-row,
.detail-stat-row,
.action-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.run-id,
.run-time,
.run-card-bottom,
.detail-stat,
.action-metric {
    color: var(--text-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.run-card-identifiers {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 6px;
}

.project-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 7px;
    border-radius: 8px;
    color: var(--text-soft);
    background: var(--accent-soft);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.run-query {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.45;
    text-wrap: pretty;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.run-user {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 8px;
    color: var(--text-soft);
    background: var(--bg-muted);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-badge[data-status="success"] { color: var(--success); background: var(--success-soft); }
.status-badge[data-status="error"] { color: var(--danger); background: var(--danger-soft); }
.status-badge[data-status="running"] { color: var(--warning); background: var(--warning-soft); }
.status-badge[data-status="approval_required"] { color: var(--warning); background: var(--warning-soft); }
.status-badge[data-status="cancelled"] { color: var(--text-muted); background: var(--bg-muted); }

.logs-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px 4px 0;
}

.pagination-button {
    display: grid;
    place-items: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border: 0;
    min-height: 40px;
    border-radius: 10px;
    color: var(--text-muted);
    background: transparent;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.pagination-button {
    cursor: pointer;
    box-shadow: 0 0 0 1px transparent;
    transition-property: color, background, box-shadow, transform;
    transition-duration: var(--duration-ui);
    transition-timing-function: var(--ease-out);
}

.pagination-button:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.045);
}

.pagination-button.is-active {
    color: var(--text);
    background: var(--surface-floating);
    box-shadow: var(--shadow-border-hover);
}

.pagination-button:active {
    transform: scale(0.96);
}

.pagination-ellipsis {
    min-width: 24px;
    color: var(--text-muted);
    text-align: center;
    user-select: none;
}

.run-detail {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: 24px;
}

.detail-placeholder {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.detail-placeholder-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 16px;
    border-radius: 18px;
    background: var(--surface-input);
    box-shadow: var(--shadow-border);
    font-size: 28px;
}

.detail-placeholder h2 {
    margin: 0;
    color: var(--text-soft);
    font-size: 18px;
}

.detail-placeholder p {
    max-width: 420px;
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.55;
    text-wrap: pretty;
}

.detail-content {
    display: grid;
    gap: 18px;
    max-width: 1180px;
    margin: 0 auto;
}

.detail-header {
    display: grid;
    gap: 14px;
    padding: 4px 2px 10px;
}

.detail-header h2 {
    margin: 0;
    font-size: 24px;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.detail-actions {
    display: flex;
    gap: 8px;
}

.detail-copy-button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: var(--text-soft);
    background: var(--surface-input);
    box-shadow: var(--shadow-border);
    transition-property: color, background, box-shadow, transform;
    transition-duration: var(--duration-ui);
    transition-timing-function: var(--ease-out);
}

.detail-copy-button:hover {
    color: var(--text);
    background: var(--surface-floating);
    box-shadow: var(--shadow-border-hover);
}

.detail-copy-button:active {
    transform: scale(0.96);
}

.detail-copy-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.detail-stat-row {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.detail-stat {
    padding: 6px 9px;
    border-radius: 8px;
    background: var(--surface-input);
    box-shadow: var(--shadow-border);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}

.section-heading h3 {
    margin: 4px 0 0;
    font-size: 17px;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.section-heading > p {
    max-width: 360px;
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.45;
    text-align: right;
    text-wrap: pretty;
}

.outcome-section,
.performance-section {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    background: var(--surface-input);
    box-shadow: var(--shadow-border);
}

.outcome-grid {
    display: grid;
    grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
    gap: 10px;
}

.outcome-card {
    display: grid;
    align-content: start;
    gap: 9px;
    min-width: 0;
    padding: 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.026);
    box-shadow: var(--shadow-border);
}

.outcome-card.is-answer {
    background: rgba(143, 184, 160, 0.045);
}

.outcome-card.is-cancelled {
    background: var(--bg-muted);
}

.outcome-card.is-cancelled .outcome-answer {
    color: var(--text-soft);
}

.outcome-card.is-error {
    grid-column: 1 / -1;
    color: var(--danger);
    background: var(--danger-soft);
    box-shadow: 0 0 0 1px rgba(201, 146, 142, 0.2);
}

.outcome-card.is-error p {
    color: var(--danger);
}

.outcome-label {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.outcome-card p,
.outcome-answer {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.58;
    text-wrap: pretty;
    white-space: pre-wrap;
}

.outcome-answer {
    color: var(--text);
}

.performance-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

.performance-grid.has-post-response {
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
}

.performance-phase {
    display: grid;
    align-content: start;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.026);
    box-shadow: var(--shadow-border);
}

.performance-phase[data-phase="post-response"] {
    background: var(--warning-soft);
    box-shadow: 0 0 0 1px rgba(210, 180, 123, 0.16);
}

.performance-phase-head,
.performance-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.performance-phase-head strong {
    font-size: 12px;
    font-weight: 650;
}

.performance-phase-head span {
    color: var(--text-muted);
    font-size: 10px;
}

.performance-list {
    display: grid;
    gap: 10px;
}

.performance-row {
    display: grid;
    gap: 5px;
}

.performance-row-head {
    color: var(--text-muted);
    font-size: 11px;
}

.performance-row-head span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.performance-row-head strong {
    flex: 0 0 auto;
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.performance-track {
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
}

.performance-track span {
    display: block;
    width: var(--performance-width);
    height: 100%;
    border-radius: inherit;
    background: var(--text-muted);
}

.performance-phase[data-phase="post-response"] .performance-track span {
    background: var(--warning);
}

.log-section {
    overflow: hidden;
    border-radius: 16px;
    background: var(--surface-input);
    box-shadow: var(--shadow-border);
}

.log-section > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 13px 16px;
    color: var(--text-soft);
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    font-weight: 620;
    transition-property: background, color;
    transition-duration: var(--duration-ui);
}

.log-section > summary small {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 450;
}

.log-section > summary::-webkit-details-marker { display: none; }
.log-section > summary:hover { color: var(--text); background: rgba(255, 255, 255, 0.035); }
.log-section > summary::after { content: "⌄"; color: var(--text-muted); transition: transform var(--duration-ui) var(--ease-out); }
.log-section[open] > summary::after { transform: rotate(180deg); }

.section-body {
    display: grid;
    gap: 12px;
    padding: 0 16px 16px;
}

.technical-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 0;
    overflow: hidden;
    border-radius: 12px;
    background: var(--line);
    box-shadow: var(--shadow-border);
}

.technical-item {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 11px 12px;
    background: var(--surface-input);
}

.technical-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.technical-item dt {
    color: var(--text-muted);
    font-size: 10px;
}

.technical-item dd {
    min-width: 0;
    margin: 0;
}

.technical-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: calc(100% + 16px);
    min-height: 40px;
    margin: -8px;
    padding: 8px;
    border: 0;
    border-radius: 8px;
    color: var(--text-soft);
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition-property: color, background, transform;
    transition-duration: var(--duration-ui);
    transition-timing-function: var(--ease-out);
}

.technical-copy:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.technical-copy:active {
    transform: scale(0.96);
}

.technical-copy span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.technical-copy svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
    opacity: 0.55;
}

.technical-code {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 11px;
}

.log-pre {
    margin: 0;
    padding: 14px;
    overflow: auto;
    border-radius: 12px;
    color: #d7d7da;
    background: #0d0d0f;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055);
    font: 12px/1.58 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    tab-size: 2;
}

.action-card {
    display: grid;
    gap: 10px;
    padding: 13px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    box-shadow: inset 0 0 0 1px var(--line);
}

.action-card.is-error {
    background: var(--danger-soft);
    box-shadow: inset 0 0 0 1px rgba(201, 146, 142, 0.22);
}

.action-card h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 650;
}

.action-card-status {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 6px;
}

.action-kind {
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.action-kind em {
    display: inline-flex;
    margin-left: 7px;
    padding: 3px 5px;
    border-radius: 5px;
    color: var(--warning);
    background: var(--warning-soft);
    font-size: 8px;
    font-style: normal;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

.action-card details {
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.12);
}

.action-card details summary {
    min-height: 40px;
    padding: 11px 12px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
}

.action-card details .log-pre {
    margin: 0 10px 10px;
}

.timeline-section {
    display: grid;
    gap: 12px;
    padding: 4px 2px;
}

.timeline-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    padding: 0 2px 6px;
}

.timeline-heading h3 {
    margin: 4px 0 0;
    font-size: 17px;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.timeline-heading > span {
    color: var(--text-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.execution-timeline {
    position: relative;
    display: grid;
    gap: 12px;
}

.execution-timeline::before {
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 17px;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
    content: "";
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 12px;
}

.timeline-marker {
    z-index: 1;
    display: flex;
    justify-content: center;
    padding-top: 13px;
}

.timeline-marker span {
    position: relative;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    color: var(--text-muted);
    background: #19191c;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.11), 0 6px 14px rgba(0, 0, 0, 0.18);
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.timeline-marker svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.timeline-item[data-type="model_call"] .timeline-marker span,
.timeline-item[data-type="route_decision"] .timeline-marker span,
.timeline-item[data-type="route_handler_selected"] .timeline-marker span {
    color: var(--accent-strong);
    background: var(--surface-floating);
}

.timeline-item[data-type="tool_result"] .timeline-marker span,
.timeline-item[data-type="validation_result"] .timeline-marker span,
.timeline-item[data-type="permission_decision"] .timeline-marker span {
    color: var(--warning);
    background: #252118;
}

.timeline-item[data-type="assistant_response"] .timeline-marker span,
.timeline-item[data-type="run_finished"] .timeline-marker span {
    color: var(--success);
    background: #19221d;
}

.timeline-item[data-status="cancelled"] .timeline-marker span {
    color: var(--text-muted);
    background: var(--bg-muted);
    box-shadow: 0 0 0 1px var(--line-strong), 0 6px 14px rgba(0, 0, 0, 0.18);
}

.timeline-item[data-phase="post-response"] .timeline-marker span {
    color: var(--warning);
    box-shadow: 0 0 0 1px rgba(210, 180, 123, 0.25), 0 6px 14px rgba(0, 0, 0, 0.18);
}

.timeline-card {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.028);
    box-shadow: var(--shadow-border);
}

.timeline-item[data-type="user_request"] .timeline-card,
.timeline-item[data-type="assistant_response"] .timeline-card {
    background: rgba(255, 255, 255, 0.045);
}

.timeline-item[data-status="error"] .timeline-card {
    background: rgba(255, 255, 255, 0.028);
    box-shadow:
        0 0 0 1px rgba(201, 146, 142, 0.28),
        0 8px 20px rgba(0, 0, 0, 0.12);
}

.timeline-item[data-status="error"] .timeline-marker span {
    color: var(--danger);
    background: #251a1b;
    box-shadow: 0 0 0 1px rgba(201, 146, 142, 0.28), 0 6px 14px rgba(0, 0, 0, 0.18);
}

.timeline-card h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 650;
    text-wrap: pretty;
}

.timeline-event-body {
    display: grid;
    gap: 9px;
    min-width: 0;
}

.timeline-event-body:empty {
    display: none;
}

.timeline-card details {
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.timeline-card details summary {
    min-height: 40px;
    padding: 11px 2px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
}

.timeline-card details > .log-pre,
.timeline-card details > .agent-attempt-list {
    margin: 0 0 4px;
}

.timeline-card > .timeline-event-body > .log-pre {
    background: rgba(8, 8, 10, 0.72);
}

.event-summary {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
    text-wrap: pretty;
}

.timeline-message {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.55;
    text-wrap: pretty;
    white-space: pre-wrap;
}

.agent-attempt-list {
    display: grid;
    gap: 10px;
}

.agent-attempt {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
}

.agent-attempt.has-error {
    background: rgba(201, 146, 142, 0.055);
    box-shadow: inset 0 0 0 1px rgba(201, 146, 142, 0.17);
}

.agent-attempt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.agent-attempt-head strong {
    color: var(--text-soft);
    font-size: 12px;
}

.attempt-label {
    margin: 2px 0 -2px;
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.event-error-overview {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.event-error-message {
    display: grid;
    gap: 9px;
    min-width: 0;
}

.event-error-message > p {
    display: -webkit-box;
    max-width: 88ch;
    margin: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.55;
    text-wrap: pretty;
}

.event-error-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.event-error-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 4px 7px;
    border-radius: 7px;
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.035);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07);
    font: 10px/1.2 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.event-error-meta small {
    color: var(--text-muted);
    font: inherit;
}

.event-error-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 11px;
    border: 0;
    border-radius: 10px;
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.035);
    box-shadow: var(--shadow-border);
    font: inherit;
    font-size: 11px;
    cursor: pointer;
    transition-property: color, background, box-shadow, transform;
    transition-duration: var(--duration-ui);
    transition-timing-function: var(--ease-out);
}

.event-error-copy:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow-border-hover);
}

.event-error-copy:active {
    transform: scale(0.96);
}

.event-error-copy:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

.event-error-copy svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.timeline-card details.event-error {
    background: transparent;
    box-shadow: none;
}

.event-error > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.event-error > summary::-webkit-details-marker {
    display: none;
}

.event-error > summary small {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 450;
}

.event-error > summary small::before {
    content: "Показать";
}

.event-error[open] > summary small::before {
    content: "Скрыть";
}

.event-error > summary::after {
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    content: "";
    transform: translateY(-2px) rotate(45deg);
    transition-property: transform;
    transition-duration: var(--duration-ui);
    transition-timing-function: var(--ease-out);
}

.event-error[open] > summary::after {
    transform: translateY(2px) rotate(225deg);
}

.event-error-tracebar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.event-error .log-pre {
    max-height: 360px;
    border-radius: 10px;
}

.error-section {
    background: var(--danger-soft);
    box-shadow: 0 0 0 1px rgba(201, 146, 142, 0.22);
}

.logs-empty,
.logs-error {
    padding: 24px 16px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.55;
    text-align: center;
}

.logs-error { color: var(--danger); }

@media (max-width: 1100px) {
    .conversation-logs-app { --logs-list-width: 330px; }
    .logs-page-head { align-items: stretch; flex-direction: column; }
    .logs-head-actions { width: 100%; }
    .logs-search { width: 100%; flex: 1; }
    .performance-grid.has-post-response { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
    body { overflow: auto; }
    .conversation-logs-app { display: block; height: auto; min-height: 100dvh; }
    .conversation-logs-app .sidebar { position: static; min-height: auto; }
    .logs-main-shell { min-height: 760px; padding: 16px; }
    .logs-workspace { grid-template-columns: 1fr; overflow: visible; }
    .run-list-panel { max-height: 420px; box-shadow: 0 1px 0 var(--line); }
    .run-detail { min-height: 520px; }
}

@media (max-width: 560px) {
    .logs-head-actions { display: grid; grid-template-columns: 1fr 1fr 44px; }
    .logs-search { grid-column: 1 / -1; }
    .logs-select-filter { width: 100%; min-width: 0; }
    .logs-filter-popover { width: min(240px, calc(100vw - 32px)); }
    .run-detail { padding: 16px; }
    .detail-title-row { align-items: flex-start; flex-direction: column; }
    .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
    .section-heading > p { max-width: none; text-align: left; }
    .outcome-section,
    .performance-section { padding: 14px; border-radius: 16px; }
    .outcome-grid,
    .technical-grid { grid-template-columns: minmax(0, 1fr); }
    .timeline-section { padding: 4px 0; }
    .timeline-item { grid-template-columns: 30px minmax(0, 1fr); gap: 8px; }
    .execution-timeline::before { left: 14px; }
    .timeline-marker span { width: 26px; height: 26px; }
    .log-section > summary small { display: none; }
    .event-error-overview { flex-direction: column; gap: 12px; }
    .event-error-copy { width: 100%; }
    .action-card-head,
    .agent-attempt-head { align-items: flex-start; flex-direction: column; }
    .action-card-status { align-items: flex-start; }
}
