.scenario-page {
    background: var(--bg);
    overflow-x: hidden;
}

.detail-main {
    /* Sol/sağ boşluk .main-wrapper (senaryolar listesi sayfası) ile birebir
       aynı olsun diye onun değerleriyle eşitlendi — yoksa iki sayfa arasında
       geçişte içerik genişliği kayıyormuş gibi görünüyordu. */
    padding: 20px 32px 30px 68px;
    overflow-x: hidden;
}

.detail-shell {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    min-width: 0;
    overflow-x: hidden;
}

.detail-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    min-width: 0;
    flex-wrap: wrap;
}

.detail-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.detail-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.detail-breadcrumb a:hover {
    text-decoration: underline;
}

.detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-actions .filter-dropdown {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 0 12px;
}

.btn-danger-action {
    background: linear-gradient(180deg, #e85a4c 0%, #c84234 100%) !important;
    border-color: rgba(168, 50, 36, 0.55) !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 8px 16px rgba(200, 66, 52, 0.16);
}

.btn-danger-action:hover {
    background: linear-gradient(180deg, #f06658 0%, #ce4a3d 100%) !important;
    border-color: rgba(168, 50, 36, 0.72) !important;
    transform: translateY(-1px);
}

.detail-exit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    flex-shrink: 0;
}

.detail-exit-btn:hover {
    border-color: rgba(95, 127, 31, 0.35);
    background: #f5f9ec;
    color: var(--text);
}

.run-result-banner {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 13px;
}

.run-result-banner.pass {
    background: var(--green-bg);
    border-color: rgba(34, 197, 94, 0.25);
    color: var(--green);
}

.run-result-banner.fail {
    background: var(--red-bg);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--red);
    white-space: pre-line;
    line-height: 1.5;
}

/* A completed FAIL verdict: the test ran fine, the judge just scored it below
   threshold. Amber (not red) so it reads as a scored result, not a crash.
   Red stays reserved for real run failures ("Test çalıştırılamadı"). */
.run-result-banner.verdict {
    background: rgba(155, 111, 22, 0.12);
    border-color: rgba(155, 111, 22, 0.3);
    color: var(--yellow);
    white-space: pre-line;
    line-height: 1.5;
}

.run-result-banner.info {
    background: var(--accent-bg);
    border-color: rgba(184, 236, 60, 0.35);
    color: var(--accent-light);
}

.run-result-banner.has-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.run-result-message-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.run-result-message {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.run-copy-btn {
    flex-shrink: 0;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
    opacity: 0.85;
}

.run-copy-btn:hover {
    opacity: 1;
}

.run-progress-percent {
    flex-shrink: 0;
    font-weight: 700;
    font-size: 12px;
}

.run-progress-track {
    height: 8px;
    width: 100%;
    border-radius: 999px;
    background: rgba(95, 127, 31, 0.16);
    overflow: hidden;
}

.run-progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7ab52b 0%, #b8ec3c 45%, #8dcf2f 100%);
    background-size: 220% 100%;
    transition: width 0.45s ease;
    animation: run-progress-shift 1.4s linear infinite;
}

.run-progress-caption {
    font-size: 12px;
    color: #5f7f1f;
}

@keyframes run-progress-shift {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -20% 0;
    }
}

.detail-grid {
    display: block;
}

.detail-right {
    display: none;
}

.detail-left,
.detail-right {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    min-width: 0;
}

.detail-left {
    overflow: hidden;
}

.scenario-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.scenario-heading h1 {
    font-size: 26px;
    line-height: 1.2;
    color: var(--text);
    letter-spacing: -0.2px;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.scenario-datetime {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
    margin-left: auto;
}

.summary-block {
    margin-bottom: 14px;
}

.summary-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
}

.summary-text {
    color: var(--text-secondary);
    margin-bottom: 10px;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
}

/* ── Structured description (LLM-mode scenarios) ────────────────────── */
.desc-structured {
    white-space: normal;
}

.desc-mode-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-light);
    background: var(--accent-bg);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 3px 10px;
    margin-bottom: 10px;
}

.desc-section {
    margin-bottom: 10px;
}

.snapshot-banner {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.snapshot-banner[hidden] {
    display: none;
}

.snapshot-banner-btn {
    display: inline;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    color: var(--accent-light);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.snapshot-banner-btn:hover {
    color: var(--accent);
}

.desc-section:last-child {
    margin-bottom: 0;
}

/* Divider lines between Persona / Hedef / Kriterler. */
.desc-section + .desc-section {
    border-top: 1px solid var(--border-light, var(--border));
    padding-top: 10px;
}

.desc-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.desc-value {
    color: var(--text-secondary);
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    margin: 0;
}

.desc-criteria {
    margin: 0;
    padding-left: 18px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.desc-criteria li {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.summary-meta {
    color: var(--text-secondary);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.metric-card {
    background: #f8faf5;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 10px;
}

.metric-title {
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 8px;
}

.metric-value {
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.detail-agents-section {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8faf5;
}

.detail-agents-section.sc2-card {
    margin: 0;
}

.detail-agents-section[hidden] {
    display: none;
}

.detail-agents-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.detail-agent-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(95, 127, 31, 0.25);
    background: var(--accent-bg);
    color: var(--accent-light);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.notes-header h3,
.history-title,
.detail-right h2 {
    color: var(--text);
    font-size: 18px;
}

.btn-note {
    border: 1px solid var(--accent);
    background: var(--accent-bg);
    color: var(--accent-light);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 11px;
    cursor: pointer;
}

/* ── Inline note composer (replaces the browser prompt) ─────────────── */
.note-composer {
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.note-composer.hidden {
    display: none;
}

.note-composer-input {
    width: 100%;
    resize: vertical;
    min-height: 64px;
    font-family: inherit;
}

.note-composer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.note-composer-actions .form-error {
    margin: 0 auto 0 0;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.note-item {
    position: relative;
    border: 1px solid var(--border);
    background: #edf6dc;
    border-radius: 10px;
    padding: 10px 34px 10px 12px;
}

.note-meta {
    font-size: 11px;
    font-weight: 600;
    color: #7d8876;
    margin-bottom: 4px;
}

.note-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #9aa492;
    font-size: 16px;
    line-height: 1;
    border-radius: 6px;
    cursor: pointer;
}

.note-delete:hover {
    background: rgba(192, 73, 59, 0.12);
    color: #c0493b;
}

.note-composer-author {
    max-width: 240px;
}

.note-item p {
    color: #53663b;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    margin: 0;
}

.history-title {
    margin-bottom: 8px;
}

.history-table-wrap {
    margin-bottom: 0;
    background: var(--bg-card);
    /* Fixed height for a full 10-row page: short last pages leave empty card
       space instead of pulling the pager up, so the pager never jumps. */
    min-height: 440px;
}

.history-pager {
    margin-top: 10px;
    margin-bottom: 0;
}

.history-pager:empty {
    display: none;
}

/* Compact layout: 6 columns must fit the left panel without a horizontal
   scrollbar. Fixed layout + percentage widths keep the columns from being
   stretched by long values (agent names, conversation ids) — those clip to an
   ellipsis instead, with the full value in the cell tooltip. */
.history-table-wrap table {
    table-layout: fixed;
    width: 100%;
    /* Below this the card scrolls rather than crushing the columns. */
    min-width: 560px;
}

/* Every column except the agent name has a known worst case, so it gets just
   that many pixels: date + driver tag, "DURDURULDU", "1dk 42sn", "%100". The
   agent column is the only elastic one and absorbs all the leftover width. */
.history-table-wrap col.col-date { width: 186px; }
.history-table-wrap col.col-agent { width: auto; }
.history-table-wrap col.col-duration { width: 78px; }
.history-table-wrap col.col-success { width: 68px; }
.history-table-wrap col.col-status { width: 108px; }

.history-table-wrap thead th {
    background: #f1f4ee;
    border-bottom: 1px solid var(--border);
    padding: 8px 6px;
    font-size: 11px;
    /* Headers wrap onto a second line so the columns themselves can stay
       narrow; only the values truncate. */
    white-space: normal;
    line-height: 1.25;
}

.history-table-wrap tbody td {
    padding: 8px 6px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
}

/* Values longer than their column end in "…"; the <td> carries the full text
   as a tooltip. */
.history-table-wrap .cell-clip,
.sc2-runs-table .cell-clip {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Date + driver tag on one line: the date truncates, the tag never shrinks. */
.history-date-cell {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.history-date-cell .cell-clip {
    min-width: 0;
}

.history-date-cell .driver-tag {
    flex: 0 0 auto;
    margin-left: 0;
}

.history-table-wrap .badge {
    padding: 3px 8px;
    font-size: 10px;
}

.history-table-wrap th.sortable {
    cursor: pointer;
    user-select: none;
}

.history-table-wrap th.sortable::after {
    content: "⇅";
    margin-left: 5px;
    font-size: 10px;
    opacity: 0.35;
}

.history-table-wrap th.sortable.sort-asc::after {
    content: "▲";
    opacity: 0.8;
}

.history-table-wrap th.sortable.sort-desc::after {
    content: "▼";
    opacity: 0.8;
}

.history-table-wrap tbody td {
    border-bottom: 1px solid var(--border);
}

/* The run whose transcript is open on the right. Without it the table gives no
   clue which row the transcript belongs to — and after sorting/paging the rows
   move, so "the top one" is not a safe assumption. Deliberately stronger than
   :hover (a near-identical grey) so the two states never read the same, plus a
   left accent bar for the case where the pointer is resting on another row. */
.history-table-wrap tbody tr.history-row-selected {
    background: var(--accent-bg);
}

.history-table-wrap tbody tr.history-row-selected:hover {
    background: rgba(184, 236, 60, 0.3);
}

/* inset shadow, not a border: a real border would shift the cell's contents. */
.history-table-wrap tbody tr.history-row-selected td:first-child {
    box-shadow: inset 3px 0 0 var(--accent-light);
}

.detail-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
    color: var(--text-secondary);
}

.detail-right h2 {
    margin-bottom: 0;
}

.convo-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.convo-top-row h2 {
    margin: 0;
    line-height: 1;
}

.convo-filter-btn {
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}

.convo-filter-btn:hover {
    border-color: rgba(184, 236, 60, 0.55);
}

/* Selected run's conversation id chip in the transcript panel header. */
.conv-id-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    border: 1px solid var(--border);
    background: #f8faf5;
    border-radius: 5px;
    padding: 4px 6px 4px 10px;
}

.conv-id-chip.hidden {
    display: none;
}

.conv-id-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 0;
}

.conv-id-replay-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.conv-id-replay-link:hover {
    border-color: rgba(184, 236, 60, 0.55);
    color: var(--text);
}

.conv-id-replay-link.hidden {
    display: none;
}

.conv-id-chip code {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conv-id-chip button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-secondary);
    border-radius: 4px;
    padding: 5px;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.conv-id-chip button:hover {
    border-color: rgba(184, 236, 60, 0.55);
    color: var(--text);
}

.convo-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Accent-filled rather than a white circle with a grey outline: as an unlabelled
   icon in the header row that read as decoration and went unnoticed, so it carries
   the same weight as the app's primary buttons. */
.convo-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #2d3918;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
}

.convo-expand-btn:hover {
    background: #c9f55a;
    border-color: #c9f55a;
    transform: translateY(-1px);
}

/* Expanded: the panel is already the accent-lit thing on screen, so the button
   steps back to an outline — and reads as the way out rather than a second "grow". */
.detail-right.transcript-fullscreen .convo-expand-btn {
    background: #ffffff;
    border-color: var(--border);
    color: var(--text-secondary);
}

.detail-right.transcript-fullscreen .convo-expand-btn:hover {
    border-color: rgba(184, 236, 60, 0.55);
    color: var(--text);
}

.convo-expand-btn .icon-collapse {
    display: none;
}

/* ── Transcript popup mode ──────────────────────────────────────────── */
body.transcript-fullscreen-open {
    overflow: hidden;
}

.transcript-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 890;
    background: rgba(38, 46, 24, 0.45);
}

.transcript-popup-backdrop.hidden {
    display: none;
}

.detail-right.transcript-fullscreen {
    position: fixed;
    top: 3vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(1100px, 94vw);
    height: 94vh;
    z-index: 900;
    padding: 20px 24px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(20, 28, 8, 0.3);
}

.detail-right.transcript-fullscreen .conv-list-wrap {
    flex: 1;
    min-height: 0;
}

.detail-right.transcript-fullscreen .conv-list {
    max-height: none;
    height: 100%;
}

.detail-right.transcript-fullscreen .convo-expand-btn .icon-expand {
    display: none;
}

.detail-right.transcript-fullscreen .convo-expand-btn .icon-collapse {
    display: block;
}

.convo-filter-btn.active {
    border-color: rgba(184, 236, 60, 0.5);
    background: var(--accent-bg);
    color: var(--accent-light);
}

.detail-search {
    min-width: 0;
}

/* ── Run-level score summary (aggregate critic breakdown) ───────────── */
.run-score-summary {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card, #fff);
    padding: 14px;
    margin-bottom: 12px;
}
.run-score-summary[hidden] { display: none; }

/* ── Findings this run is evidence for ──────────────────────────────────
   Outlined in the warning tone rather than the card border: this is not one
   more fact about the run, it is a record someone filed against the agent.  */
.run-issues-panel {
    border: 1px solid var(--red, #d65158);
    border-left-width: 3px;
    border-radius: 10px;
    background: var(--bg-card, #fff);
    padding: 10px 12px;
    margin-bottom: 12px;
}
.run-issues-panel[hidden] { display: none; }

.run-issues-label {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.run-issue-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: background .15s;
}
.run-issue-row:hover { background: var(--bg-hover); }

.run-issue-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #7d8876;
}
.run-issue-dot.sev-high { background: #d65158; }
.run-issue-dot.sev-medium { background: #9b6f16; }

.run-issue-title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.run-issue-status {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm, 5px);
    border: 1px solid rgba(137, 150, 132, 0.3);
    color: #5d6659;
    background: rgba(137, 150, 132, 0.12);
    white-space: nowrap;
}
/* İncelemede gri (henüz kimse bakmadı), Açık kırmızı (doğrulanmış kusur),
   Çözüldü yeşil (kapanmış) — issues.js'teki STATUS_COLORS/STATUS_BG ile aynı
   palet (bkz. .badge-pass/.badge-fail/.badge-ready). */
.run-issue-status.st-review {
    color: #5d6659;
    background: rgba(137, 150, 132, 0.12);
    border-color: rgba(137, 150, 132, 0.3);
}
.run-issue-status.st-open {
    color: var(--red, #d65158);
    background: var(--red-bg, rgba(225, 89, 100, 0.13));
    border-color: rgba(239, 68, 68, 0.25);
}
.run-issue-status.st-resolved {
    color: var(--green, #618f17);
    background: var(--green-bg, rgba(184, 236, 60, 0.24));
    border-color: rgba(34, 197, 94, 0.25);
}

/* Kriter rozeti durum rozetiyle aynı ölçüde, farklı renkte: şeritte yan yana
   durabilirler, ayırt eden şey renk olmalı. */
.run-issue-criterion {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
    color: #3a5a1e;
    background: rgba(139, 181, 50, .18);
}

.run-issue-go {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-muted);
}
.run-issue-row:hover .run-issue-go { color: var(--accent-light, inherit); }

.rss-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.rss-overall {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #f6f8fd;
}
.rss-overall-val { font-size: 26px; font-weight: 800; line-height: 1; }
.rss-overall-label { font-size: 11px; color: #7d8876; margin-top: 4px; }
.rss-overall.rss-good .rss-overall-val { color: #5f8f1f; }
.rss-overall.rss-mid .rss-overall-val { color: #b07d18; }
.rss-overall.rss-bad .rss-overall-val { color: #c0493b; }
.rss-title { margin: 0; font-size: 14px; font-weight: 700; color: #4d5945; }
.rss-sub { margin: 3px 0 0; font-size: 12px; color: #7d8876; }

.rss-critics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 16px;
}
.rss-critic { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rss-critic-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
}
.rss-critic-name { color: #4d5945; overflow-wrap: anywhere; }
.rss-critic-name .rss-weight { color: #9aa492; font-size: 10px; }
.rss-critic-val { font-weight: 700; color: #4d5945; white-space: nowrap; }
.rss-critic.rss-primary .rss-critic-name { font-weight: 700; }
.rss-bar { height: 7px; border-radius: 999px; background: #e3e8d8; overflow: hidden; }
.rss-bar > span { display: block; height: 100%; border-radius: 999px; background: #8fb43a; }
.rss-bar.good > span { background: #6fae2f; }
.rss-bar.mid > span { background: #d9a93a; }
.rss-bar.bad > span { background: #d46a5c; }

.rss-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.rss-chips-label { width: 100%; margin: 0; font-size: 11px; font-weight: 600; color: #7d8876; }
.rss-chip {
    font-size: 11px;
    line-height: 1;
    border-radius: 999px;
    padding: 6px 10px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.rss-chip.penalty { color: #a23b2c; background: #fbe7e3; border-color: #f0c4bc; }
.rss-chip.adj { color: #9a6a12; background: #fbf0d8; border-color: #ecd3a0; }

@media (max-width: 900px) {
    .rss-critics-grid { grid-template-columns: 1fr; }
}

.conv-list-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

/* Soft fade-out at the bottom of the scrollable transcript so content
   doesn't cut off abruptly; hidden once the user reaches the end. */
.conv-list-wrap::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--bg-card));
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.conv-list-wrap.at-end::after {
    opacity: 0;
}

.conv-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 72vh;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    color: var(--text-secondary);
}

.conv-list * {
    visibility: visible !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

.transcript-step {
    background: #f9fbf7;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    min-width: 0;
    overflow: hidden;
    color: var(--text-secondary);
}

.utterance-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.utterance-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-bg);
    color: var(--accent-light) !important;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}

.utterance-content {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 9px 10px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.utterance-text {
    color: var(--text-secondary) !important;
    font-size: 14px;
    margin: 0;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    opacity: 1 !important;
}

.step-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 6px;
    align-items: center;
}

.step-head-right {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.step-col-title {
    color: var(--text-secondary) !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    opacity: 1 !important;
}

.step-score {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-light) !important;
    border: 1px solid rgba(184, 236, 60, 0.4);
    background: var(--accent-bg);
    border-radius: 999px;
    padding: 4px 12px;
    opacity: 1 !important;
}

.step-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
}

.step-box {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    min-height: 56px;
    min-width: 0;
    overflow: hidden;
}

.step-box.expected {
    background: #f6f8fd;
}

.step-box.actual {
    background: #edf6de;
}

.step-box p {
    color: var(--text-secondary) !important;
    margin: 0;
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    opacity: 1 !important;
}

.step-reason {
    margin-top: 8px;
    color: var(--text-muted) !important;
    font-size: 12px;
    line-height: 1.35;
    opacity: 1 !important;
}

.state-text {
    color: var(--text-muted);
}

.start-test-modal {
    width: min(680px, 95vw);
}

.start-test-desc {
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.45;
}

.start-test-custom-agent {
    display: none;
}

.start-test-voice-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.92em;
    cursor: pointer;
}

.start-test-voice-row.hidden {
    display: none;
}

.start-test-voice-row input {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.edit-scenario-modal {
    width: min(980px, 96vw);
}

.edit-basic-fields-card,
.edit-section-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8faf5;
    padding: 14px;
    margin-bottom: 12px;
}

.edit-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.edit-field-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.edit-text-field {
    width: 100%;
}

.edit-description-field {
    min-height: 92px;
}

.edit-textarea-lg {
    min-height: 136px;
    width: 100%;
}

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

.edit-randomize-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-randomize-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.edit-randomize-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #5f7f1f;
    cursor: pointer;
    flex-shrink: 0;
}

.edit-randomize-input {
    display: none;
    min-height: 38px;
    padding: 8px 10px;
}

.tt-tools {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.tt-tools-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 1fr);
    gap: 10px;
    align-items: center;
}

.tt-pick-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.tt-pick-label {
    margin: 0;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.tt-pick-label-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tt-tool-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tt-pick {
    min-width: 220px;
    flex: 1 1 240px;
    height: 38px;
    padding: 6px 10px;
}

.tt-import {
    height: 38px;
}

.tt-msg {
    font-size: 11px;
    color: var(--text-muted);
    min-height: 14px;
}

.tt-save-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    align-self: center;
}

.tt-save {
    height: 38px;
    padding: 0 14px;
    min-width: 170px;
}

.tt-save.btn-primary {
    background: linear-gradient(180deg, #4a82ff 0%, #2f6df6 100%);
    border: 1px solid rgba(47, 109, 246, 0.35);
    box-shadow: 0 8px 18px rgba(47, 109, 246, 0.18);
}

.tt-save.btn-primary:hover {
    filter: brightness(1.03);
}

.edit-greeting-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    padding: 6px 10px;
    color: var(--text-secondary);
    margin-top: -4px;
}

.edit-greeting-toolbar span {
    font-size: 18px;
    line-height: 1;
}

.edit-dialogues-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 2px;
}

.edit-dialogue-row {
    display: grid;
    grid-template-columns: 28px 20px 1fr;
    gap: 8px;
    cursor: default;
}

.edit-dialogue-row.dragging {
    opacity: 0.35;
    outline: 2px dashed #c8dca6;
    border-radius: 8px;
}

.edit-dialogue-row.drag-over {
    border-top: 2px solid #5f7f1f;
}

.edit-dialogue-drag-handle {
    font-size: 18px;
    color: #c0c8b8;
    align-self: start;
    padding-top: 4px;
    cursor: grab;
    user-select: none;
    text-align: center;
    transition: color 0.15s;
}

.edit-dialogue-drag-handle:hover {
    color: #5f7f1f;
}

.edit-dialogue-index {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 600;
    align-self: start;
    padding-top: 2px;
}


.edit-dialogue-pair {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-dialogue-field {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 8px;
}

.edit-dialogue-prefix {
    align-self: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.scenario-modal-footer-split {
    justify-content: space-between;
    align-items: center;
}

.edit-modal-right-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-danger-link {
    border: 0;
    background: transparent;
    color: var(--red);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.btn-danger-link:hover {
    text-decoration: underline;
}


@media (max-width: 900px) {
    .detail-main {
        padding: 10px;
    }

    .detail-top-row {
        flex-direction: column;
        align-items: stretch;
    }

    .detail-actions {
        width: 100%;
    }

    .detail-actions .filter-dropdown,
    .detail-actions .btn-primary {
        width: 100%;
    }

    .convo-top-row {
        flex-direction: column;
        align-items: stretch;
    }

    .convo-filter-btn {
        width: 100%;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .step-grid {
        grid-template-columns: 1fr;
    }

    .step-head {
        grid-template-columns: 1fr;
    }

    .scenario-modal-footer-split {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .edit-modal-right-actions {
        width: 100%;
    }

    .edit-modal-right-actions .filter-dropdown,
    .edit-modal-right-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .edit-randomize-grid {
        grid-template-columns: 1fr;
    }

    .tt-save-row {
        justify-content: stretch;
    }

    .tt-save {
        width: 100%;
    }

    .tt-tools-row {
        grid-template-columns: 1fr;
    }
}

/* ── AI Analiz Özeti Paneli ─────────────────────────────────────────────── */
.ai-summary-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid #5f7f1f;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

/* Transkript replay koşuları: orijinal kayıt vs. bu koşu karşılaştırması —
   normal (tek konuşma) analizinden farklı olduğunu renkle de belli eder.
   Arka plan, transkript kutucuklarındaki ajan balonuyla (.msg-agent .user-bubble,
   #f3f7ec) AYNI yeşil tonu kullanır, ki panel ile transkript görsel olarak
   bir bütün gibi hissettirsin. */
.ai-summary-panel.ai-summary-panel-replay {
    border-left-color: #2f9e44;
    background: #f3f7ec;
}

/* Zayıf alan/sapma kutucukları panelin kendi zemininden ayrışsın diye biraz
   daha koyu bir yeşil kullanır — aksi halde ikisi neredeyse aynı tona gelip
   kutunun sınırları belirsizleşiyordu. */
.ai-summary-panel-replay .ai-summary-list li {
    background: #dcebd2;
}

.ai-summary-panel-replay .ai-summary-list li.ai-summary-clamp:hover {
    background: #cfe3c2;
}

.ai-summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

/* ── Collapsible summary panels (AI özet + çalıştırma özeti) ────────── */
.ai-summary-panel > summary,
.rss-collapse > summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.ai-summary-panel > summary::-webkit-details-marker,
.rss-collapse > summary::-webkit-details-marker {
    display: none;
}

.collapse-caret {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted, #7d8876);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.rss-collapse .collapse-caret {
    margin-left: auto;
}

details[open] > summary .collapse-caret {
    transform: rotate(180deg);
}

/* The AI summary behaves as a dropdown only inside the popup; in the normal
   panel it is a static, always-open block. */
.detail-right:not(.transcript-fullscreen) .ai-summary-panel > summary {
    cursor: default;
}

.detail-right:not(.transcript-fullscreen) .ai-summary-panel .collapse-caret {
    display: none;
}

/* Popup: the toggle must read as a real button, not a bare glyph. */
.detail-right.transcript-fullscreen .ai-summary-panel .collapse-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #ffffff;
    color: var(--text-secondary);
    font-size: 13px;
    margin-left: 8px;
    transition: var(--transition);
}

.detail-right.transcript-fullscreen .ai-summary-panel > summary:hover .collapse-caret {
    border-color: rgba(184, 236, 60, 0.55);
    background: var(--accent-bg, rgba(184, 236, 60, 0.2));
    color: var(--text);
}

/* Popup: a very long analysis scrolls inside its own box instead of pushing
   the conversation off screen; the header row stays pinned while scrolling. */
.detail-right.transcript-fullscreen .ai-summary-panel[open] {
    max-height: 42vh;
    overflow-y: auto;
}

.detail-right.transcript-fullscreen .ai-summary-panel[open] > summary {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-card);
}

/* No trailing gap under the header while collapsed. */
.ai-summary-panel:not([open]) > .ai-summary-header,
.rss-collapse:not([open]) > .rss-header {
    margin-bottom: 0;
}

.ai-summary-icon {
    color: #5f7f1f;
    font-size: 14px;
}

.ai-summary-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.ai-summary-badge {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: capitalize;
}

.ai-summary-passrate {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.ai-summary-source {
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

/* "Transkript Testi Analizi" rozeti — kartın normal senaryo analizinden değil,
   bir Transkript Replay koşusundan geldiğini tek bakışta belli eder. */
.ai-summary-replay-badge {
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: #2f9e44;
    border: 1px solid #2f9e44;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.ai-summary-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 12px;
}

/* minmax(0, 1fr), düz `1fr` DEĞİL: grid parçalarının varsayılan alt sınırı
   min-width:auto'dur, yani içerik (ör. bulgu rozetindeki white-space:nowrap
   başlık) parçayı payına sığmayacak kadar genişletebilir. Olan tam olarak buydu:
   sağ kolon panelin dışına taşıyor, sol kolon tek kelimelik bir şeride
   sıkışıyordu. Sıfır alt sınır, taşma yerine kırpma/elips demek. */
.ai-summary-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 12px;
    min-width: 0;
}

.ai-summary-col {
    min-width: 0;
}

/* ── Özet gövdesi: kendi içinde kayar, boyu sürüklenebilir ───────────────────
   Panel, asıl okunacak şeyin (transkriptin) yerini almamalı — özellikle tam
   ekran transkript görünümünde, orada tek iş konuşmayı okumak. Bu yüzden gövde
   sabit bir yükseklikte başlar ve içinde kayar; yükseklik #aiSummaryResize
   sürüklenerek değiştirilir ve görünüm başına ayrı hatırlanır (bkz.
   scenario.js → bindAiSummaryResize). */
.ai-summary-body {
    max-height: var(--ai-summary-h, 260px);
    overflow-y: auto;
    overscroll-behavior: contain;
    min-width: 0;
}

/* Tam ekranda daha kısa başlar: pencerenin tamamı transkripte ayrılmış olmalı. */
.detail-right.transcript-fullscreen .ai-summary-body {
    max-height: var(--ai-summary-h, 132px);
}

.ai-summary-resize {
    height: 11px;
    margin: 2px -6px -4px;
    border-radius: 0 0 8px 8px;
    cursor: ns-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

/* Tutamağın kendisi: iki ince çizgi. Sürüklenebilirliği göstermeye yeter,
   panelin görsel ağırlığını artırmaz. */
.ai-summary-resize::after {
    content: "";
    width: 34px;
    height: 3px;
    border-radius: 2px;
    background: var(--border);
    transition: background .15s;
}

.ai-summary-resize:hover::after,
.ai-summary-resize:focus-visible::after,
.ai-summary-resize.is-dragging::after {
    background: var(--accent, #98d317);
}

.ai-summary-resize:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* Sürükleme boyunca imleç her yerde ns-resize kalsın ve metin seçilmesin. */
body.ai-summary-resizing {
    cursor: ns-resize;
    user-select: none;
}

/* display:grid above beats the UA [hidden] rule on equal specificity (author
   styles win over UA styles regardless of order) — restate it explicitly so
   toggling the `hidden` attribute from JS actually hides the columns when
   there's no real analysis to show (error/pending/not-applicable states). */
.ai-summary-columns[hidden] {
    display: none;
}

.ai-summary-col-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.ai-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-summary-list li {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 3px 8px;
    background: var(--bg);
    border-radius: 6px;
}

/* Weak-areas/violation items can run long (a criterion's own text, a quoted
   evidence line); clamp to a couple of lines and let the user expand on click
   instead of the backend hard-truncating the text with "…". Applies to the <li>
   itself (weak_areas) or the nested evidence <div> (violations). */
.ai-summary-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
}

.ai-summary-list li.ai-summary-clamp:hover {
    background: var(--bg-hover, rgba(0, 0, 0, 0.06));
}

.ai-summary-clamp.expanded {
    -webkit-line-clamp: unset;
    overflow: visible;
}

.ai-summary-expand-hint {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
}

.ai-summary-evidence {
    margin-top: 3px;
    font-size: 11px;
    font-style: italic;
    color: var(--text-muted);
}

/* A finding line the backend matched to an already-filed Bulgu. The <li> stops
   being the clamp element in this case (the chip must not be clipped by it), so
   the evidence marker moves onto the inner clamp — otherwise the ● would land on
   a line of its own above the text. */
.ai-summary-list li.ai-summary-linked {
    font-size: 12px;
    color: var(--text-secondary);
}

.ai-summary-list li.ai-summary-linked > .ai-summary-clamp:hover {
    background: var(--bg-hover, rgba(0, 0, 0, 0.06));
}

.ai-finding-issue {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    margin-top: 4px;
    padding: 2px 8px 2px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-alt, rgba(0, 0, 0, .03));
    text-decoration: none;
    color: var(--text-secondary);
    transition: background .15s, border-color .15s;
}

.ai-finding-issue:hover {
    background: var(--bg-hover, rgba(0, 0, 0, .06));
    border-color: var(--accent-light, var(--border));
}

.ai-finding-issue-label {
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #c96442;
}

.ai-finding-issue-title {
    min-width: 0;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-finding-issue-go {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted);
}

.ai-finding-issue:hover .ai-finding-issue-go {
    color: var(--accent-light, inherit);
}

/* Bir regresyon (düzeltilmiş bir bulgunun geri gelmesi) bu sayfadaki en kötü
   haberdir; nötr çipin içinde kaybolmaması için kendi rengini alır. */
.ai-finding-issue.is-regression {
    border-color: #b3261e;
    background: rgba(179, 38, 30, .08);
}

.ai-finding-issue.is-regression .ai-finding-issue-label {
    color: #b3261e;
}

/* Bu koşuda açılmış, henüz kimsenin onaylamadığı kayıt: bir öneri, kabul edilmiş
   bir bulgu değil — kesik çerçeve bunu söylüyor. */
.ai-finding-issue.is-new {
    border-style: dashed;
}

.ai-finding-issue.is-new .ai-finding-issue-label {
    color: #9b6f16;
}

/* ── Bulgu kartları ──────────────────────────────────────────────────────────
   Kart yalnızca bulgunun kendi cümlesini taşır: kanıt alıntısı artık kartta
   gösterilmiyor, çünkü alıntıyı okumak "bu nerede oldu?" sorusunu cevaplamıyor —
   kartın kendisi tıklanınca transkript o satıra gidiyor. Kolon dar olduğu için
   metin iki satıra kırpılır ve ÜSTÜNE GELİNCE tamamı açılır: okumak için tıklama
   gerekmez, tıklama tek bir şey demektir (beni oraya götür). */
.ai-summary-list li.ai-summary-finding {
    position: relative;
    padding: 5px 8px;
    /* Aksiyon düğmelerine yer aç — yoksa metnin üstüne binerler. */
    padding-right: 46px;
    transition: background .15s;
}

.ai-summary-finding-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.ai-summary-finding:hover .ai-summary-finding-text {
    -webkit-line-clamp: unset;
    overflow: visible;
}

.ai-summary-finding.is-anchored {
    cursor: pointer;
}

.ai-summary-finding.is-anchored:hover {
    background: var(--red-bg, rgba(192, 57, 43, 0.08));
}

/* Geçersiz sayılan bulgu SİLİNMEZ: skorlayıcının neyi yanlış gördüğü de kaydın
   parçası. Kart yerinde kalır, soluk ve üstü çizili. */
.ai-summary-list li.ai-summary-finding.is-cancelled {
    opacity: 0.5;
    cursor: default;
}

.ai-summary-finding.is-cancelled .ai-summary-finding-text {
    text-decoration: line-through;
}

.af-marks {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 3px;
}

.af-mark {
    font-size: 9px;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 6px;
}

.af-mark-human {
    color: #5f7f1f;
    border-color: rgba(95, 127, 31, .4);
}

.af-mark-edited {
    color: #b8860b;
    border-color: rgba(184, 134, 11, .4);
    cursor: help;
}

/* Aksiyonlar yalnızca karta gelinince görünür: iki küçük düğme her kartta sürekli
   dursaydı dar kolonda bulgunun kendisinden çok yer kaplarlardı. */
.af-actions {
    position: absolute;
    top: 3px;
    right: 4px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity .15s;
}

.ai-summary-finding:hover .af-actions,
.af-actions:focus-within {
    opacity: 1;
}

.af-btn {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.af-btn:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.af-cancel:hover {
    color: #c0392b;
    border-color: #c0392b;
}

/* ── Düzeltme / ekleme formu ─────────────────────────────────────────────── */
.af-editor,
.af-add-form {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.af-input {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text);
    background: var(--bg-input, var(--bg-card));
    border: 1px solid var(--accent, var(--border));
    border-radius: 6px;
    padding: 5px 7px;
    resize: vertical;
}

.af-editor-actions {
    display: flex;
    gap: 5px;
}

.af-save,
.af-discard {
    font: inherit;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
}

.af-save {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: var(--accent-light);
    font-weight: 600;
}

.af-save[disabled] {
    opacity: .45;
    cursor: not-allowed;
}

.ai-summary-list li.af-add-row {
    background: transparent;
    padding: 0;
}

.af-add {
    font: inherit;
    font-size: 11px;
    color: var(--text-muted);
    background: none;
    border: 1px dashed var(--border);
    border-radius: 6px;
    padding: 3px 8px;
    width: 100%;
    cursor: pointer;
}

.af-add:hover {
    color: var(--text-secondary);
    border-color: var(--text-muted);
}

.af-add-line {
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
}

.af-add-line.is-set {
    color: #5f7f1f;
    font-style: normal;
    font-weight: 600;
}

.ai-summary-empty {
    color: var(--text-muted);
}

/* Satır seçme modu: transkript tıklanabilir olduğunu göstersin. */
.ai-summary-panel.af-picking {
    outline: 2px dashed var(--accent);
    outline-offset: 3px;
}

/* Zaman çizelgesinde ihlal olan turlar. Yalnızca `background-color` değişir —
   `background` kısayolu, oynatma ilerlemesini çizen background-image gradyanını
   da silerdi. Kırmızı halka ayrı bir katman olduğu için tur çalarken de durur:
   "şu an burası çalıyor" ile "burada ihlal var" birbirini ezmez.
   (Bu blok run_audio.css'teki .tl-seg kurallarını geçersiz kılar; iki dosya eşit
   özgüllükte olduğu için sırayı scenario.html'deki yükleme sırası belirliyor.) */
.tl-seg.tl-seg--violation::before {
    background-color: rgba(192, 57, 43, 0.45);
    box-shadow: inset 0 0 0 1.5px rgba(192, 57, 43, 0.85);
}

.tl-seg.tl-seg--violation:hover::before {
    background-color: rgba(192, 57, 43, 0.62);
}

.tl-seg.tl-seg--violation.tl-seg--active::before {
    background-color: rgba(152, 211, 23, 1);
}

.tl-tip-violation {
    display: block;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.tl-tip-violation-head {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #ff9b90;
}

/* ── İhlal ipucu (transkript rozetleri) ──────────────────────────────────────
   <body>'ye asılı TEK bir kutu; içeriği hover anında rozetten kopyalanır ve
   ekran koordinatlarıyla konumlanır (scenario.js → showViolationTip). Rozetin
   içinde çizilseydi, konuşma listesinin kaydırma kutusu onu kenarlarda
   kırpardı — kırptı da. z-index, tam ekran transkript katmanının (900) ve
   modalların (2000) üstünde. */
#violationTip {
    position: fixed;
    z-index: 3000;
    display: none;
    width: max-content;
    max-width: min(320px, 88vw);
    padding: 7px 10px;
    border-radius: 8px;
    background: #2f3a28;
    color: #f4f7ef;
    font-size: 11.5px;
    line-height: 1.45;
    text-align: left;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
    /* İmleç kutunun üstüne gelip mouseout tetiklemesin: kutu tıklanabilir
       değil, yalnızca okunur. */
    pointer-events: none;
}

#violationTip.is-open {
    display: block;
}

#violationTip .vio-tip-head {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #ff9b90;
    margin-bottom: 3px;
}

#violationTip .vio-tip-line {
    display: block;
    padding-left: 11px;
    text-indent: -11px;
}

#violationTip .vio-tip-line::before {
    content: "•";
    color: #ff9b90;
    margin-right: 5px;
}

#violationTip .vio-tip-line + .vio-tip-line {
    margin-top: 4px;
}

/* Transkript ipucundaki (.vio-tip-line) ile aynı gerekçe: kurallar sarıyor,
   madde imi olmadan iki kural tek kural gibi okunuyor. */
.tl-tip-violation-line {
    display: block;
    color: #ffd9d4;
    padding-left: 11px;
    text-indent: -11px;
}

.tl-tip-violation-line::before {
    content: "•";
    color: #ff9b90;
    margin-right: 5px;
}

.tl-tip-violation-line + .tl-tip-violation-line {
    margin-top: 4px;
}

.ai-summary-coaching {
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.ai-summary-coaching-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.55;
    font-style: italic;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SENARYO DETAY — KART DÜZENİ (sc2-*)
   Sayfa tek sütun ve kart yığınıdır: kimlik + göstergeler, senaryo bilgileri,
   notlar, son çalıştırmalar. Transkript burada gösterilmez — bir çalıştırmaya
   tıklamak test-result.html'e (o koşunun sonuç sayfası) gider.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Eski iki sütunlu görünümün DOM'u yerinde ama görünmez; gerekçe scenario.html'de. */
.sc2-legacy {
    display: none !important;
}

/* .detail-shell'in tek büyük panel görünümü (arka plan + çerçeve + köşe) burada
   tamamen sıfırlanır: kartların kendi yüzeyi var, dıştaki kutu boş bir çerçeve
   olarak görünüyordu. */
.sc2-shell {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.sc2-backrow {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 24px;
}

.sc2-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
}

.sc2-back:hover {
    color: var(--text);
}

.sc2-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 22px 26px;
    box-shadow: 0 1px 2px rgba(24, 32, 16, 0.04);
}

.sc2-hero-flat {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.sc2-card-head {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 4px;
}

.sc2-subsection-head {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--border-light);
}

.sc2-card-head-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.sc2-card-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.sc2-card-head p {
    margin: 3px 0 0;
    font-size: 12.5px;
    color: var(--text-muted);
}

.sc2-updated-at {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.sc2-updated-at[hidden] {
    display: none;
}

/* ── Üst kart ─────────────────────────────────────────────────────────────── */

.sc2-hero-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.sc2-hero-main {
    min-width: 0;
}

.sc2-hero-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sc2-code {
    display: inline-block;
    padding: 3px 9px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-hover);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.sc2-code[hidden] {
    display: none;
}

.sc2-hero-main h1 {
    margin: 0;
    font-size: 27px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

.sc2-hero-desc {
    margin: 8px 0 0;
    font-size: 13.5px;
    color: var(--text-secondary);
    max-width: 78ch;
}

.sc2-hero-desc-label {
    font-weight: 700;
    color: var(--text);
    margin-right: 2px;
}

.sc2-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sc2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}

.sc2-btn:hover:not(:disabled) {
    background: var(--bg-hover);
}

.sc2-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.sc2-btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #24310c;
}

.sc2-btn-accent:hover:not(:disabled) {
    background: #a9dd2f;
    border-color: #a9dd2f;
}

.sc2-btn-danger {
    background: #c0392b;
    border-color: #a5301f;
    color: #fff;
}

.sc2-btn-danger:hover:not(:disabled) {
    background: #a5301f;
}

.sc2-hero .run-result-banner {
    margin: 16px 0 0;
}

/* ── Gösterge kartları ────────────────────────────────────────────────────── */

.sc2-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.sc2-stat-card {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 14px 16px 16px;
    background: var(--bg-card);
    /* Alt açıklamalar farklı uzunlukta; kartlar yine de aynı boyda dursun ve
       açıklama satırı hep dibe otursun. */
    display: flex;
    flex-direction: column;
    min-height: 132px;
}

.sc2-stat-card .sc2-stat-sub {
    margin-top: auto;
    padding-top: 8px;
}

.sc2-stat-card-link {
    text-decoration: none;
    color: inherit;
}

.sc2-stat-card-link:hover {
    background: var(--bg-hover);
}

.sc2-stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sc2-stat-label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted);
}

.sc2-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.sc2-stat-icon-good {
    background: var(--green-bg);
    color: var(--green);
}

.sc2-stat-icon-warn {
    background: rgba(155, 111, 22, 0.14);
    color: var(--yellow);
}

.sc2-stat-value {
    margin-top: 12px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
    /* Dört kart yan yana: rakamlar aynı genişlikte olmazsa sayılar satır
       içinde oynuyor gibi görünüyor. */
    font-variant-numeric: tabular-nums;
}

/* Tarih + saat tek satıra sığsın diye. */
.sc2-stat-value-sm {
    font-size: 19px;
}

.sc2-stat-sub {
    margin-top: 8px;
    font-size: 11.5px;
    color: var(--text-muted);
}

/* Son koşunun sonucu: PASS yeşil, FAIL kırmızı. Alt satırdaki diğer açıklama
   metinleriyle karışmasın diye kalın ve harf aralığı açık. */
.sc2-status-pass,
.sc2-status-fail {
    font-weight: 700;
    letter-spacing: 0.04em;
}

.sc2-status-pass {
    color: var(--green);
}

.sc2-status-fail {
    color: var(--red);
}

/* ── Senaryo bilgileri kartı — başlık ve alt başlıklar büyütüldü ─────────── */

.sc2-card-scenario-info .sc2-card-head h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.sc2-card-scenario-info .sc2-card-head p {
    margin-top: 5px;
    font-size: 13.5px;
}

.sc2-card-scenario-info .sc2-info-row {
    padding: 20px 0;
}

.sc2-card-scenario-info .sc2-info-label {
    font-size: 14.5px;
}

.sc2-card-scenario-info .sc2-info-value {
    margin-top: 10px;
    font-size: 14.5px;
    line-height: 1.7;
}

/* ── Senaryo bilgileri satırları ──────────────────────────────────────────── */

.sc2-info-rows {
    display: flex;
    flex-direction: column;
}

.sc2-info-row {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}

.sc2-info-row:last-child {
    border-bottom: none;
    padding-bottom: 4px;
}

.sc2-info-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.sc2-info-tag {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-hover);
    border-radius: 4px;
    padding: 2px 6px;
}

.sc2-info-value {
    margin-top: 8px;
    font-size: 13.5px;
    line-height: 1.65;
    /* Etiket ile değer arasındaki fark ağırlıkta, renkte değil: uzun persona
       metinleri soluk gri-yeşille okunması zor bir blok oluyordu. */
    color: var(--text);
    white-space: pre-wrap;
    max-width: 92ch;
}

/* Kriterler numarasız ama belirgin: her madde ayrı bir kural olduğu için
   işaretleri vurgu renginde. */
.sc2-info-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.sc2-info-list li {
    position: relative;
    padding-left: 18px;
}

.sc2-info-list li::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-light);
}

/* Ortak başlangıç prompt'u senaryonun kendi alanı değil — ayrı bir yüzeyde. */
.sc2-prompt-box {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-hover);
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Statik senaryonun diyalogları ────────────────────────────────────────── */

.sc2-dialogues {
    list-style: none;
    counter-reset: sc2-turn;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sc2-dialogue {
    counter-increment: sc2-turn;
    position: relative;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-hover);
    padding: 12px 14px 12px 44px;
}

/* Adım numarası metnin soluna, akışı bölmeden. */
.sc2-dialogue::before {
    content: counter(sc2-turn);
    position: absolute;
    left: 12px;
    top: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sc2-dialogue-kind {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.sc2-dialogue-line {
    display: flex;
    gap: 10px;
    align-items: baseline;
}

.sc2-dialogue-line + .sc2-dialogue-line {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--border-light);
}

.sc2-dialogue-role {
    flex: 0 0 auto;
    min-width: 152px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
}

.sc2-dialogue-role-agent {
    color: var(--accent-light);
}

.sc2-dialogue-text {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    min-width: 0;
}

@media (max-width: 720px) {
    .sc2-dialogue-line {
        flex-direction: column;
        gap: 2px;
    }
}

.sc2-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.sc2-chip {
    padding: 5px 11px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: var(--bg-hover);
    font-size: 12.5px;
    color: var(--text-secondary);
}

/* Veri kaynakları: solda alan adı, sağda değerin nereden geldiği. */
.sc2-source-list {
    margin-top: 10px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0 14px;
}

.sc2-source-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.sc2-source-row:last-child {
    border-bottom: none;
}

.sc2-source-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.sc2-source-origin {
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: right;
}

.sc2-source-origin-manual {
    color: var(--text-secondary);
}

/* ── İki sütunlu düzen: solda senaryo bilgileri + notlar, sağda son
   çalıştırmalar. Son çalıştırmalar tablosu böylece sayfanın altına
   düşmek yerine sürekli görünür kalır. ─────────────────────────────────── */

.sc2-two-col {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    align-items: start;
    gap: 20px;
}

.sc2-col-left,
.sc2-col-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

@media (max-width: 1100px) {
    .sc2-two-col {
        grid-template-columns: 1fr;
    }
}

/* ── Son çalıştırmalar tablosu ────────────────────────────────────────────── */

/* Sayfalama varsa (çok test), kart yüksekliği JS ile sol sütunun boyuna
   kilitlenir (bkz. scenario.js → syncHistoryCardHeight). Satır yükseklikleri
   sayfadan sayfaya çok değiştiği için ("kaç satır sığar" tahmini her sayfada
   tutmuyordu), bunun yerine kartın kendisi sabit boyda tutulur ve nadiren bir
   sayfa taşarsa içeride dikey kaydırma çıkar — böylece alt kenar HER sayfada
   birebir aynı yerde kalır, taşma/kısalma olmaz. */
.sc2-card-runs {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sc2-runs-wrap {
    overflow-x: auto;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.sc2-runs-table {
    width: 100%;
    border-collapse: collapse;
}

.sc2-runs-table th {
    text-align: left;
    padding: 14px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.sc2-runs-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.sc2-runs-table th.sortable::after {
    content: "⇅";
    margin-left: 5px;
    font-size: 10px;
    opacity: 0.35;
}

.sc2-runs-table th.sortable.sort-asc::after {
    content: "▲";
    opacity: 0.8;
}

.sc2-runs-table th.sortable.sort-desc::after {
    content: "▼";
    opacity: 0.8;
}

.sc2-runs-table td {
    padding: 16px 12px;
    font-size: 13.5px;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.sc2-runs-table tr:last-child td {
    border-bottom: none;
}

.sc2-runs-table .history-row {
    cursor: pointer;
    transition: background var(--transition);
}

.sc2-runs-table .history-row:hover td {
    background: var(--bg-hover);
}

.sc2-runs-table .history-date-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Ajan adları tek satırda: ilk ajan + "+N" rozeti. Alt alta dizmek satır
   yüksekliğini ajan sayısına bağlı yapıyordu (bkz. .sc2-runs-table yorumu);
   tam liste title'da durur. */
.sc2-agent-chips {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

.sc2-agent-chips .sc2-agent-chip {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.sc2-agent-chip-more {
    flex: 0 0 auto;
    color: var(--text-muted);
}

.sc2-card-runs .sc2-runs-table th {
    padding: 12px 8px;
    font-size: 11px;
}

.sc2-card-runs .sc2-runs-table td {
    padding: 12px 8px;
    font-size: 12.5px;
}

/* Sütun genişlikleri sabitlendi (table-layout: fixed) — tarih/süre/başarı/durum
   hücreleri artık satır kırmıyor, ajan hücresi de tek satırda kalıyor (bkz.
   .sc2-agent-chips). Satır yüksekliği artık her satırda sabit, bu da hem
   satır sayısı tahminini hem de üst sınır (max-height) hesabını isabetli
   kılıyor. */
.sc2-card-runs .sc2-runs-table {
    table-layout: fixed;
}

.sc2-card-runs .sc2-runs-table th:nth-child(1),
.sc2-card-runs .sc2-runs-table td:nth-child(1) {
    width: 27%;
}

.sc2-card-runs .sc2-runs-table th:nth-child(2),
.sc2-card-runs .sc2-runs-table td:nth-child(2) {
    width: 25%;
}

.sc2-card-runs .sc2-runs-table th:nth-child(3),
.sc2-card-runs .sc2-runs-table td:nth-child(3) {
    width: 15%;
}

.sc2-card-runs .sc2-runs-table th:nth-child(4),
.sc2-card-runs .sc2-runs-table td:nth-child(4) {
    width: 14%;
}

.sc2-card-runs .sc2-runs-table th:nth-child(5),
.sc2-card-runs .sc2-runs-table td:nth-child(5) {
    width: 19%;
}

.sc2-card-runs .sc2-runs-table td:nth-child(1),
.sc2-card-runs .sc2-runs-table td:nth-child(2),
.sc2-card-runs .sc2-runs-table td:nth-child(3),
.sc2-card-runs .sc2-runs-table td:nth-child(4) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc2-card-runs .sc2-runs-table td:nth-child(5) {
    overflow: hidden;
}

.sc2-card-runs .sc2-runs-table .history-date-cell {
    flex-wrap: nowrap;
}

.sc2-card-runs .sc2-agent-chip {
    max-width: none;
    white-space: normal;
    word-break: break-word;
}

.sc2-agent-chip {
    display: inline-block;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 5px 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-hover);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

.sc2-runs-table tbody tr.history-row-selected td {
    background: var(--accent-bg);
}

.sc2-runs-table tbody tr.history-row-selected:hover td {
    background: rgba(184, 236, 60, 0.3);
}

.sc2-runs-table tbody tr.history-row-selected td:first-child {
    box-shadow: inset 3px 0 0 var(--accent-light);
}

.history-status-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
}

.history-status-cell .badge {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 8px;
    padding-right: 8px;
}

.history-open-result-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    flex: none;
}

.history-open-result-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

/* Durum rozetindeki nokta. */
.sc2-runs-table .badge::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border-radius: 50%;
    background: currentColor;
    vertical-align: middle;
}

@media (max-width: 1080px) {
    .sc2-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .sc2-card {
        padding: 18px 16px;
    }

    .sc2-hero-row {
        flex-direction: column;
    }

    .sc2-stat-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
