/* ============================================
   工地安全管理系统 v2.0 - 样式表
   ============================================ */
:root {
    --primary: #e67e22;
    --primary-dark: #d35400;
    --danger: #e74c3c;
    --success: #27ae60;
    --info: #3498db;
    --warning: #f39c12;
    --dark: #2c3e50;
    --sidebar-bg: #1a252f;
    --sidebar-w: 240px;
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --text: #333333;
    --text-muted: #95a5a6;
    --border: #e0e0e0;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ===== 登录页 ===== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%);
}
.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-header {
    text-align: center;
    margin-bottom: 32px;
}
.login-header .logo { font-size: 48px; margin-bottom: 8px; }
.login-header h1 { font-size: 22px; color: var(--dark); }
.login-header .desc { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 12px; text-align: center; }
.success-msg { color: var(--success); font-size: 13px; margin-top: 12px; text-align: center; }
.text-center { text-align: center; }
.btn-block { width: 100%; justify-content: center; }

/* ===== App Layout ===== */
#app { display: flex; min-height: 100vh; }
.workspace-shell {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== 侧边栏 ===== */
#sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: #ecf0f1;
    position: fixed;
    left: 0; top: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
}
.sidebar-header {
    padding: 24px 20px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-header .logo { font-size: 36px; margin-bottom: 4px; }
.sidebar-header h2 { font-size: 16px; font-weight: 600; color: #ecf0f1; }
.user-info {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
    color: #bdc3c7;
}
.user-info .user-name { color: var(--primary); font-weight: 600; font-size: 14px; }
.user-info .user-role { font-size: 12px; opacity: 0.7; }
#workspace-signature {
    margin-top: auto;
    padding: 18px 32px 16px;
    border-top: 1px solid #eceff1;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    letter-spacing: 0.2px;
    line-height: 1.7;
    background: transparent;
}
.nav-list { list-style: none; padding: 12px 0; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.nav-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.35) transparent;
}
.nav-list::-webkit-scrollbar {
    width: 6px;
}
.nav-list::-webkit-scrollbar-track {
    background: transparent;
}
.nav-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255,255,255,0.42), rgba(255,255,255,0.24));
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,0.18);
}
.nav-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(255,255,255,0.58), rgba(255,255,255,0.34));
}
.nav-item {
    display: flex; align-items: center; padding: 12px 20px;
    cursor: pointer; transition: all 0.2s; position: relative; gap: 10px;
}
.nav-item:hover { background: rgba(255,255,255,0.06); }
.nav-item.active { background: rgba(230,126,34,0.15); border-right: 3px solid var(--primary); }
.nav-item.active .nav-text { color: var(--primary); font-weight: 600; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-icon { font-size: 18px; opacity: 0.7; width: 24px; text-align: center; }
.nav-text { font-size: 14px; }
.nav-submenu-arrow {
    margin-left: auto;
    color: rgba(255,255,255,0.45);
    font-size: 18px;
    line-height: 1;
}
.nav-badge {
    margin-left: auto; background: var(--danger); color: #fff;
    font-size: 11px; padding: 2px 7px; border-radius: 10px;
    min-width: 20px; text-align: center;
}
.nav-badge:empty { display: none; }
.sidebar-flyout-menu {
    position: fixed;
    width: 260px;
    max-height: calc(100vh - 32px);
    padding: 14px;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.16);
    z-index: 180;
    color: #1f2937;
    backdrop-filter: blur(8px);
}
.sidebar-flyout-head {
    padding: 4px 4px 12px;
}
.sidebar-flyout-head strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.sidebar-flyout-head p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}
.sidebar-flyout-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
}
.sidebar-flyout-item {
    width: 100%;
    appearance: none;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 14px;
    background: #f8fafc;
    text-align: left;
    padding: 12px 14px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.sidebar-flyout-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
    background: #ffffff;
}
.sidebar-flyout-item.active {
    border-color: rgba(230,126,34,0.24);
    background: linear-gradient(135deg, #fff6e9 0%, #fffdf9 100%);
    box-shadow: 0 14px 24px rgba(230,126,34,0.12);
}
.sidebar-flyout-item-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}
.sidebar-flyout-item-desc {
    display: block;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}
.sidebar-footer {
    padding: 14px 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.03) 100%);
}
.sidebar-action-btn {
    justify-content: center;
    border-radius: 11px;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
    backdrop-filter: blur(4px);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.sidebar-action-btn::before {
    font-size: 14px;
    line-height: 1;
}
.sidebar-action-btn:hover {
    transform: translateY(-1px);
}
.sidebar-action-btn:active {
    transform: translateY(0);
}
.sidebar-action-password {
    color: #f4f8ff;
    border-color: rgba(143, 195, 255, 0.35);
    background: linear-gradient(135deg, rgba(52,152,219,0.26) 0%, rgba(52,152,219,0.14) 100%);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}
.sidebar-action-password::before {
    content: '🔐';
}
.sidebar-action-password:hover {
    border-color: rgba(143, 195, 255, 0.58);
    background: linear-gradient(135deg, rgba(52,152,219,0.34) 0%, rgba(52,152,219,0.2) 100%);
    box-shadow: 0 12px 22px rgba(52,152,219,0.2);
}
.sidebar-action-logout {
    color: #fff5f5;
    border-color: rgba(252, 165, 165, 0.34);
    background: linear-gradient(135deg, rgba(231,76,60,0.28) 0%, rgba(231,76,60,0.16) 100%);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}
.sidebar-action-logout::before {
    content: '⎋';
}
.sidebar-action-logout:hover {
    border-color: rgba(252, 165, 165, 0.58);
    background: linear-gradient(135deg, rgba(231,76,60,0.38) 0%, rgba(231,76,60,0.2) 100%);
    box-shadow: 0 12px 22px rgba(231,76,60,0.22);
}

/* ===== 主内容 ===== */
#main-content {
    flex: 1;
    padding: 28px 32px;
    min-height: 0;
}
.page { animation: fadeIn 0.25s ease; }
.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.page-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
}
.page-header h1 { font-size: 22px; font-weight: 700; }

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.stat-card {
    background: var(--card-bg); border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow); text-align: center; border-top: 4px solid var(--border);
}
.stat-card.is-clickable {
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.stat-card.is-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.12);
}
.stat-card.is-clickable:active {
    transform: translateY(0);
}
.stat-card.is-clickable:focus-visible {
    outline: 2px solid rgba(14, 165, 233, 0.75);
    outline-offset: 2px;
}
.stat-card.stat-warning { border-top-color: var(--warning); }
.stat-card.stat-success { border-top-color: var(--success); }
.stat-card.stat-info { border-top-color: var(--info); }
.stat-card.stat-danger { border-top-color: var(--danger); }
.stat-number { font-size: 36px; font-weight: 800; margin-bottom: 4px; }
.stat-warning .stat-number { color: var(--warning); }
.stat-success .stat-number { color: var(--success); }
.stat-info .stat-number { color: var(--info); }
.stat-danger .stat-number { color: var(--danger); }
.stat-label { font-size: 14px; color: var(--text-muted); }

/* ===== 通用卡片 ===== */
.card {
    background: var(--card-bg); border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow); margin-bottom: 16px;
}
.card h3 { font-size: 16px; margin-bottom: 16px; }
.desc { color: var(--text-muted); margin-bottom: 20px; font-size: 14px; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.input {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: 6px; font-size: 14px; outline: none; transition: border 0.2s;
}
.input:focus { border-color: var(--primary); }
textarea.input { resize: vertical; min-height: 80px; }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border: 1px solid var(--border); border-radius: 6px;
    background: #fff; color: var(--text); font-size: 14px;
    cursor: pointer; transition: all 0.2s;
}
.btn:hover { background: #f8f9fa; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #219a52; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 15px; margin-top: 12px; }
.btn-group { display: flex; gap: 8px; margin-top: 12px; }

/* ===== 上传区域 ===== */
.upload-zone {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 48px 24px; text-align: center; cursor: pointer;
    transition: all 0.3s; margin-bottom: 16px;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: rgba(230,126,34,0.04); }
.upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-zone p { color: var(--text-muted); font-size: 14px; }
.upload-zone .link { color: var(--primary); text-decoration: underline; cursor: pointer; }

.preview-container { margin-bottom: 16px; text-align: center; }
.preview-container img { max-width: 100%; max-height: 300px; border-radius: var(--radius); border: 1px solid var(--border); }

/* ===== 结果框 ===== */
.result-box {
    margin-top: 20px; padding: 20px; border-radius: var(--radius);
    background: #f8f9fa; border-left: 4px solid var(--primary);
}
.result-box.success { border-left-color: var(--success); background: #f0faf4; }
.result-box.danger { border-left-color: var(--danger); background: #fef5f5; }
.result-box h4 { font-size: 15px; margin-bottom: 12px; }

/* ===== 风险卡片 ===== */
.risk-card {
    background: var(--card-bg); border-radius: var(--radius); padding: 18px 20px;
    box-shadow: var(--shadow); margin-bottom: 12px;
    display: flex; align-items: center; gap: 16px;
    cursor: pointer; transition: all 0.2s; border-left: 4px solid var(--border);
}
.risk-card:hover { transform: translateX(4px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.risk-card.severity-critical { border-left-color: #8e44ad; }
.risk-card.severity-high { border-left-color: var(--danger); }
.risk-card.severity-medium { border-left-color: var(--warning); }
.risk-card.severity-low { border-left-color: var(--info); }
.risk-card-thumb {
    width: 64px; height: 64px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: #eee;
}
.risk-card-info { flex: 1; min-width: 0; }
.risk-card-info h4 { font-size: 15px; margin-bottom: 4px; }
.risk-card-info p {
    font-size: 13px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.risk-card-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.severity-tag {
    display: inline-block; padding: 2px 10px; border-radius: 12px;
    font-size: 12px; font-weight: 600; color: #fff;
}
.severity-tag.critical { background: #8e44ad; }
.severity-tag.high { background: var(--danger); }
.severity-tag.medium { background: var(--warning); }
.severity-tag.low { background: var(--info); }

/* ===== BIM 定位徽标（D1）===== */
.loc-badge {
    margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.loc-conf-chip {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600; font-family: Consolas, monospace;
    border: 1px solid transparent;
}
.loc-conf-chip.high { background: #e8f9ef; color: #1d8a3f; border-color: #b6e8c7; }
.loc-conf-chip.mid  { background: #fff7d9; color: #8a6d00; border-color: #f0dd94; }
.loc-conf-chip.low  { background: #fdecec; color: #b83232; border-color: #f3b9b9; }
.loc-label {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-family: Consolas, monospace;
    background: #eef4ff; color: #2848a8; border: 1px solid #c8d6f5;
    max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn.btn-bim {
    background: linear-gradient(135deg, #4a90e2, #2848a8); color: #fff;
    border: none; padding: 4px 10px; border-radius: 4px; font-size: 11px;
    cursor: pointer; font-weight: 600;
}
.btn.btn-bim:hover { filter: brightness(1.1); }
.btn.btn-xs { padding: 2px 8px; font-size: 11px; border-radius: 4px; }
.status-tag { font-size: 12px; padding: 2px 8px; border-radius: 4px; background: #eee; }
.status-tag.open { background: #ffeaa7; color: #856404; }
.status-tag.appealed { background: #dfe6e9; color: #636e72; }
.status-tag.pending_rectification { background: #fdcb6e; color: #6c5c00; }
.closed-method { font-size: 12px; padding: 2px 8px; border-radius: 4px; }
.closed-method.dual_review { background: #d5f5e3; color: #1e8449; }
.closed-method.appeal_approved { background: #d6eaf8; color: #2471a3; }
.closed-method.ai_verified { background: #d5f5e3; color: #1e8449; }
.closed-method.admin_override { background: #d6eaf8; color: #2471a3; }

/* ===== 报告 ===== */
.report-box {
    margin-top: 20px; padding: 28px; background: #fff;
    border: 1px solid var(--border); border-radius: var(--radius);
    line-height: 1.8; font-size: 14px;
}
.report-box h1 { font-size: 20px; margin: 16px 0 8px; border-bottom: 2px solid var(--primary); padding-bottom: 6px; }
.report-box h2 { font-size: 17px; margin: 14px 0 6px; color: var(--dark); }
.report-box h3 { font-size: 15px; margin: 12px 0 4px; }
.report-box ul, .report-box ol { padding-left: 24px; margin: 8px 0; }
.report-box li { margin-bottom: 4px; }
.report-box strong { color: var(--primary-dark); }

/* ===== 聊天 ===== */
.chat-container {
    background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow);
    display: flex; flex-direction: column; height: calc(100vh - 140px);
}
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; }
.chat-msg { display: flex; margin-bottom: 16px; }
.chat-msg.user { justify-content: flex-end; }
.chat-bubble {
    max-width: 70%; padding: 12px 16px; border-radius: 12px;
    font-size: 14px; line-height: 1.7; white-space: pre-wrap;
}
.chat-msg.bot .chat-bubble { background: #f0f2f5; border-bottom-left-radius: 4px; }
.chat-msg.user .chat-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-input-bar { display: flex; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--border); }
.chat-input-bar .input { flex: 1; }

/* ===== 模态框 ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.45);
    display: flex; justify-content: center; align-items: center; z-index: 1000;
}
.modal {
    background: #fff; border-radius: 12px; width: 90%; max-width: 640px;
    max-height: 85vh; display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 17px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); padding: 4px 8px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-body .detail-row { display: flex; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.modal-body .detail-label { font-weight: 600; min-width: 80px; color: var(--text-muted); }
.modal-body img { max-width: 100%; border-radius: var(--radius); margin: 12px 0; }

.inspection-photo-preview {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8f9fa;
    padding: 10px;
    margin: 12px 0;
    text-align: center;
}
.inspection-photo-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.inspection-photo-preview-frame {
    position: relative;
    display: inline-block;
    max-width: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    cursor: zoom-in;
}
.inspection-photo-preview-frame .inspection-marker-layer {
    display: none;
}
.inspection-photo-preview-frame.show-markers .inspection-marker-layer {
    display: block;
}
.inspection-photo-preview-frame.is-anchor-marking { cursor:crosshair; outline:3px solid rgba(217,72,15,.32); }
.detect-anchor-hit-layer { position:absolute; inset:0; z-index:4; width:100%; height:100%; padding:0; border:0; background:rgba(217,72,15,.06); cursor:crosshair; color:#fff; }
.detect-anchor-hit-layer span { position:absolute; left:50%; top:12px; transform:translateX(-50%); padding:5px 9px; border-radius:999px; background:rgba(15,23,42,.78); font-size:12px; white-space:nowrap; pointer-events:none; }
.inspection-photo-preview img {
    display: block;
    max-width: 100%;
    max-height: 420px;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: zoom-in;
    background: #fff;
    border: 0;
    border-radius: 0;
    margin: 0;
}
.pending-risk-card-body {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.pending-risk-image-button,
.pending-risk-image-placeholder {
    flex: 0 0 240px;
    width: 240px;
    height: 180px;
    border-radius: 6px;
}
.pending-risk-image-button {
    border: 1px solid var(--border);
    padding: 0;
    background: #fff;
    overflow: hidden;
    cursor: zoom-in;
    line-height: 0;
}
.pending-risk-image-button img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    border-radius: 0;
    margin: 0;
}
.pending-risk-image-button:hover,
.pending-risk-image-button:focus-visible {
    outline: 3px solid rgba(217, 72, 15, 0.26);
    outline-offset: 2px;
}
.pending-risk-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border);
    color: var(--text-muted);
    background: #f8f9fa;
}
.pending-risk-index {
    margin-right: 8px;
    vertical-align: middle;
}
.inspection-risk-card {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin: 8px 0;
}
.inspection-stream-panel {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: linear-gradient(180deg, #fffaf2 0%, #ffffff 100%);
    padding: 12px;
    margin: 12px 0;
}
.inspection-stream-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.inspection-stream-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.inspection-stream-model {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: var(--text-muted);
    font-size: 12px;
}
.inspection-stream-prompt {
    background: #fff3d9;
    color: #8a5a00;
}
.inspection-stream-toggle {
    white-space: nowrap;
}
.inspection-stream-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.inspection-stream-message {
    border-radius: 12px;
    padding: 12px 14px;
    line-height: 1.7;
}
.inspection-stream-message-reasoning {
    background: #fff3d9;
    border: 1px solid #f1d18a;
}
.inspection-stream-message-answer {
    background: #ffffff;
    border: 1px solid var(--border);
}
.inspection-stream-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}
.inspection-stream-body {
    word-break: break-word;
}
.inspection-stream-placeholder,
.inspection-stream-finish {
    color: var(--text-muted);
    font-size: 13px;
}
.inspection-stream-finish {
    margin-top: 10px;
}
.inspection-risk-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 8px;
}
.inspection-risk-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 999px;
    background: #d9480f;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    box-shadow:
        0 10px 24px rgba(15, 23, 42, 0.2),
        0 0 0 4px rgba(255, 255, 255, 0.92);
}
.inspection-marker-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.inspection-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #d9480f;
    color: #fff;
    font-weight: 800;
    font-size: 11px;
    box-shadow:
        0 8px 18px rgba(15, 23, 42, 0.18),
        0 0 0 2px rgba(255, 255, 255, 0.9);
}
.inspection-image-canvas {
    position: relative;
    display: inline-block;
    transform-origin: center center;
    transition: transform 0.12s ease;
    will-change: transform;
    backface-visibility: hidden;
}
.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(15, 23, 42, 0.86);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    touch-action: none;
    overscroll-behavior: contain;
}
.image-viewer-panel {
    width: min(96vw, 1400px);
    height: min(92vh, 920px);
    background: #111827;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0,0,0,0.42);
}
.image-viewer-floating-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}
.image-viewer-floating-close:hover {
    background: rgba(15, 23, 42, 0.9);
}
.image-viewer-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.image-viewer-modes,
.image-viewer-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.image-viewer-drawer-toggle {
    display: none;
    border: none;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    border-radius: 10px;
    min-height: 34px;
    padding: 0 12px;
    cursor: pointer;
}
.image-viewer-tools-primary,
.image-viewer-tools-advanced {
    width: 100%;
}
.image-viewer-tools-advanced {
    display: flex;
}
.image-viewer-scale {
    min-width: 52px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.image-viewer-stage {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    cursor: grab;
    user-select: none;
    touch-action: none;
    overscroll-behavior: contain;
}
.image-viewer-stage.dragging {
    cursor: grabbing;
}
.image-viewer-stage.dragging .inspection-image-canvas,
.image-viewer-stage.dragging img {
    transition: none !important;
}
.image-viewer-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 0.12s ease;
    will-change: transform;
    backface-visibility: hidden;
    border-radius: 4px;
    margin: 0;
}

/* ===== 正式巡检测评流程 ===== */
.eval-formal-flow-layout {
    align-items: flex-start;
}

/* ===== 正式巡检测评向导 ===== */
.eval-wizard-shell {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 16px;
}
.eval-wizard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px 0;
}
.eval-wizard-steps-nav {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 16px 28px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: thin;
}
.eval-wizard-step-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    white-space: nowrap;
    border-radius: 8px;
    transition: background 0.15s;
}
.eval-wizard-step-btn:hover:not(:disabled) {
    background: rgba(0,0,0,0.04);
}
.eval-wizard-step-btn.is-active {
    color: var(--primary);
    font-weight: 600;
}
.eval-wizard-step-btn.is-done {
    color: var(--success);
}
.eval-wizard-step-btn.is-future {
    opacity: 0.38;
    cursor: not-allowed;
}
.eval-wizard-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.is-active .eval-wizard-step-num {
    background: var(--primary);
    color: #fff;
}
.is-done .eval-wizard-step-num {
    background: var(--success);
    color: #fff;
}
.eval-wizard-step-label {
    font-size: 13px;
}
.eval-wizard-step-sep {
    color: #d1d5db;
    font-size: 18px;
    margin: 0 2px;
    user-select: none;
}
.eval-wizard-content {
    padding: 24px 28px 20px;
    min-height: 360px;
}
.eval-wizard-step {
    display: flex;
    flex-direction: column;
    min-height: 360px;
}
.eval-wizard-step-section {
    margin-bottom: 24px;
}
.eval-wizard-section-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--dark);
}
.eval-wizard-select {
    max-width: 440px;
}
.eval-wizard-hint {
    margin-top: 6px;
    font-size: 13px;
}
.eval-wizard-model-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.eval-wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    margin-top: auto;
    border-top: 1px solid var(--border);
}
.eval-wizard-current-sample {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.eval-wizard-sample-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
}
.eval-wizard-sample-item {
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    text-align: left;
    background: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.eval-wizard-sample-thumb {
    width: 100%;
    height: 140px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
    padding: 0;
}
.eval-wizard-sample-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.eval-wizard-sample-thumb-empty {
    color: var(--text-muted);
    font-size: 13px;
}
.eval-wizard-sample-item:hover {
    border-color: var(--primary);
    background: #fffaf5;
}
.eval-wizard-sample-item.is-selected {
    border-color: var(--primary);
    background: linear-gradient(180deg, #fff6ec 0%, #fffdf9 100%);
    box-shadow: 0 4px 14px rgba(230,126,34,0.14);
}
.eval-wizard-prompt-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 640px;
}
.eval-wizard-prompt-item {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
}
.eval-wizard-prompt-item.is-selected {
    border-color: var(--prompt-color, var(--primary));
    background: #fafafa;
}
.eval-wizard-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    max-width: 520px;
}
.eval-wizard-config-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.eval-wizard-config-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    background: #f8fafc;
}
.eval-wizard-config-item .detail-label {
    display: block;
    margin-bottom: 4px;
}
.eval-wizard-run-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
@media (max-width: 640px) {
    .eval-wizard-header { padding: 14px 16px 0; }
    .eval-wizard-steps-nav { padding: 10px 12px; }
    .eval-wizard-step-label { display: none; }
    .eval-wizard-content { padding: 16px; }
    .eval-wizard-sample-grid { grid-template-columns: 1fr; max-height: none; }
    .eval-wizard-config-summary { grid-template-columns: 1fr 1fr; }
}
.eval-formal-flow-layout .eval-lab-side {
    position: sticky;
    top: 20px;
}
.eval-formal-sample-queue {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 68vh;
    overflow: auto;
    padding-right: 4px;
}
.eval-formal-sample-queue-item {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff 0%, #fbfbfb 100%);
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.eval-formal-sample-queue-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}
.eval-formal-sample-queue-item.is-active {
    border-color: rgba(230, 126, 34, 0.36);
    box-shadow: 0 12px 24px rgba(230, 126, 34, 0.12);
    background: linear-gradient(180deg, #fff8ef 0%, #fffdf9 100%);
}
.eval-formal-sample-queue-item strong {
    font-size: 14px;
    color: var(--dark);
}
.eval-formal-sample-queue-item span,
.eval-formal-sample-queue-item small {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}
.eval-formal-focus-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    margin-bottom: 16px;
    border-radius: 14px;
    border: 1px solid rgba(230, 126, 34, 0.18);
    background: linear-gradient(180deg, #fffaf2 0%, #ffffff 100%);
}
.eval-formal-step-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fff;
}
.eval-formal-step-card .detail-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
}
.eval-formal-prompt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.eval-formal-preview-snippet {
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    color: #4b5563;
    font-size: 12px;
    line-height: 1.6;
    max-height: 240px;
    overflow: auto;
}

.eval-results-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.eval-results-hero,
.eval-summary-hero,
.eval-history-head {
    border: 1px solid rgba(230, 126, 34, 0.14);
    border-radius: 18px;
    padding: 18px 20px;
    background: linear-gradient(180deg, #fffaf2 0%, #ffffff 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}
.eval-results-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) auto;
    gap: 18px;
    align-items: center;
}
.eval-results-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(230, 126, 34, 0.12);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    width: fit-content;
}
.eval-results-hero h3,
.eval-summary-hero h3,
.eval-history-head h3 {
    margin: 8px 0 6px;
    font-size: 22px;
}
.eval-results-hero p,
.eval-summary-hero p,
.eval-history-head p {
    margin: 0;
}
.eval-results-hero-metrics,
.eval-summary-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.eval-hero-metric {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}
.eval-hero-metric strong {
    display: block;
    margin-top: 4px;
    font-size: 15px;
    color: var(--dark);
    word-break: break-word;
}
.eval-hero-metric small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    line-height: 1.4;
}
.eval-results-hero-actions {
    flex-direction: column;
    align-items: stretch;
    min-width: 160px;
}
.eval-results-hero-actions .btn {
    width: 100%;
}
.eval-results-toolbar-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.eval-results-toolbar-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}
.eval-results-toolbar-card h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--dark);
}
.eval-sample-switcher,
.eval-prompt-preview-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.eval-sample-switcher .btn,
.eval-prompt-preview-switcher .btn {
    border-radius: 999px;
}
.eval-results-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 18px;
    align-items: start;
}
.eval-results-stage-column,
.eval-results-card-column {
    min-width: 0;
}
.eval-stage-card,
.eval-output-card,
.eval-sample-info-card,
.eval-live-output-card,
.eval-ab-compare-card,
.eval-summary-grid .result-box,
.eval-history-card {
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}
.eval-stage-card,
.eval-output-card,
.eval-sample-info-card,
.eval-live-output-card {
    padding: 16px;
}
.eval-stage-card {
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfd 100%);
}
.eval-stage-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}
.eval-stage-toolbar strong,
.eval-output-title h4,
.eval-history-title-row strong {
    font-size: 16px;
}
.eval-stage-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.eval-stage-frame {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: #f8fafc;
}
.eval-stage-image {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    background: #f8fafc;
}
.eval-stage-marker-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.eval-stage-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    border-radius: 999px;
    border: 2px solid var(--marker-color, var(--primary));
    background: rgba(255,255,255,0.95);
    color: var(--marker-color, var(--primary));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(15,23,42,0.18);
}
.eval-stage-status {
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    color: var(--text-muted);
    line-height: 1.5;
}
.eval-stage-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.eval-output-card {
    border-left: 4px solid var(--prompt-color, var(--primary));
    margin-bottom: 14px;
}
.eval-output-head,
.eval-live-output-head,
.eval-history-top,
.eval-ab-compare-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}
.eval-output-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.eval-output-prefix,
.eval-legend-chip {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    background: var(--legend-color, var(--prompt-color, var(--primary)));
    flex-shrink: 0;
}
.eval-output-badges,
.eval-history-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.eval-risk-list {
    display: grid;
    gap: 10px;
    margin: 14px 0;
}
.eval-risk-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.16);
}
.eval-risk-marker {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    background: var(--risk-color, var(--primary));
}
.eval-output-grid,
.eval-live-output-grid,
.eval-info-grid,
.eval-config-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}
.eval-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}
.eval-summary-grid .result-box,
.eval-history-card {
    margin-top: 0;
    background: #fff;
}
.eval-config-summary-list,
.eval-history-list {
    display: grid;
    gap: 12px;
}
.eval-config-summary-item {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    padding: 12px 14px;
    background: #f8fafc;
}
.eval-config-summary-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.eval-config-summary-grid {
    color: var(--text-muted);
    font-size: 13px;
}
.eval-history-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.eval-history-card {
    padding: 16px 18px;
}
.eval-history-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.eval-history-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.eval-history-metrics .badge {
    border-radius: 999px;
    padding: 6px 10px;
}
.eval-ab-compare-card {
    padding: 16px 18px;
    margin-top: 2px;
}
.eval-ab-compare-card summary {
    cursor: pointer;
}
.eval-live-output-card summary,
.eval-thinking-details summary {
    cursor: pointer;
    font-weight: 600;
}

@media (max-width: 1024px) {
    .eval-results-hero,
    .eval-results-layout,
    .eval-results-toolbar-grid,
    .eval-summary-grid {
        grid-template-columns: 1fr;
    }
    .eval-results-hero-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .eval-results-hero-actions .btn {
        width: auto;
    }
    .eval-results-hero-metrics,
    .eval-summary-kpis {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .eval-formal-flow-layout {
        grid-template-columns: 1fr;
    }
    .eval-formal-flow-layout .eval-lab-side {
        position: static;
        top: auto;
    }
}

@media (max-width: 640px) {
    .image-viewer { padding: 8px; }
    .image-viewer-panel {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        position: relative;
    }
    .image-viewer-floating-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 25px;
    }
    .image-viewer-toolbar {
        position: absolute;
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 4;
        align-items: stretch;
        gap: 8px;
        padding: 8px;
        border: 1px solid rgba(148, 163, 184, 0.38);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(8px);
        box-shadow: 0 14px 36px rgba(15, 23, 42, 0.24);
    }
    .image-viewer-drawer-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    .image-viewer-tools-primary,
    .image-viewer-tools-advanced {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }
    .eval-formal-focus-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .eval-formal-flow-layout .eval-lab-side {
        position: static;
    }
    .eval-formal-sample-queue {
        max-height: none;
    }
    .image-viewer-tools-primary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .image-viewer-toolbar:not(.expanded) .image-viewer-tools-advanced {
        display: none;
    }
    .image-viewer-toolbar.expanded .image-viewer-tools-advanced {
        display: grid;
    }
    .image-viewer-toolbar .btn {
        width: 100%;
        min-height: 36px;
        padding: 0 8px;
        font-size: 12px;
        line-height: 1.2;
    }
    .image-viewer-scale {
        min-width: 0;
        height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        background: #f1f5f9;
        color: #334155;
        font-weight: 700;
    }
    .image-viewer-stage {
        padding: 12px;
        padding-bottom: calc(164px + env(safe-area-inset-bottom));
    }
    .pending-risk-card-body { flex-direction: column; }
    .pending-risk-image-button,
    .pending-risk-image-placeholder {
        flex-basis: auto;
        width: 100%;
        height: 220px;
    }
}

/* ===== 通知面板 ===== */
.notification-panel {
    position: fixed; top: 0; right: 0; width: 360px; height: 100vh;
    background: #fff; box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    z-index: 500; display: flex; flex-direction: column;
}
.notification-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px; border-bottom: 1px solid var(--border);
}
.notification-header h3 { font-size: 16px; }
#notification-list { flex: 1; overflow-y: auto; padding: 12px; }
.notif-item {
    padding: 14px; border-radius: 10px; margin-bottom: 10px; cursor: default;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
    border: 1px solid var(--border); border-left: 4px solid var(--info); background: #fff;
}
.notif-item:hover { background: #fafbfd; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08); transform: translateY(-1px); }
.notif-item.unread { border-left-color: var(--primary); border-color: rgba(59, 130, 246, 0.28); }
.notif-item.type-warning { border-left-color: var(--warning); }
.notif-item.type-danger { border-left-color: var(--danger); }
.notif-item.type-success { border-left-color: var(--success); }
.notif-item h4 { font-size: 14px; margin-bottom: 6px; }
.notif-title {
    font-size: 15px;
    line-height: 1.4;
    color: #0f172a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif-item p { font-size: 13px; color: var(--text-muted); }
.notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.notif-head-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.notif-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.12);
}
.notif-time { font-size: 11px; margin-top: 0; color: #94a3b8; white-space: nowrap; }
.notif-type-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
}
.notif-type-info {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.25);
}
.notif-type-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.3);
}
.notif-type-danger {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.3);
}
.notif-type-success {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.28);
}
.notif-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.notif-action-btn {
    min-width: 92px;
    justify-content: center;
    border-radius: 999px;
    font-weight: 600;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.notif-action-btn span:first-child {
    width: 14px;
    text-align: center;
    font-size: 12px;
}
.notif-action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}
.notif-action-btn:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.45);
    outline-offset: 1px;
}
.notif-action-jump {
    border-color: rgba(230, 126, 34, 0.35);
    background: rgba(230, 126, 34, 0.1);
    color: var(--primary-dark);
}
.notif-action-jump:hover { background: rgba(230, 126, 34, 0.16); box-shadow: 0 4px 10px rgba(230, 126, 34, 0.2); }
.notif-action-jump:disabled {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}
.notif-action-read { border-color: var(--border); background: #fff; }
.notif-action-read:hover:not(:disabled) { box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08); }
.notif-action-read:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

/* ===== 表格 ===== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px;
}
.data-table th { background: #f8f9fa; font-weight: 600; font-size: 13px; color: var(--text-muted); }
.data-table tr:hover { background: #fafbfc; }

/* 巡检历史独立布局：弹窗正文是唯一滚动区域，长结果不撑宽表格。 */
.schedule-history-open .modal {
    width: 95vw;
    max-width: 1400px;
    max-height: 90vh;
    max-height: 90dvh;
}
.schedule-history-open .modal-header { flex-shrink: 0; gap: 16px; }
.schedule-history-open .modal-header h2 { min-width: 0; overflow-wrap: anywhere; }
.schedule-history-open .modal-close { flex-shrink: 0; }
.schedule-history-open .modal-body { min-width: 0; min-height: 0; padding-top: 0; }
#schedule-history-body { min-width: 0; padding-top: 16px; }
.schedule-history-table { table-layout: fixed; }
.schedule-history-table .schedule-history-time-col { width: 120px; }
.schedule-history-table .schedule-history-type-col { width: 100px; }
.schedule-history-table .schedule-history-status-col { width: 84px; }
.schedule-history-table .schedule-history-preset-col { width: 84px; }
.schedule-history-table .schedule-history-actions-col { width: 112px; }
.schedule-history-table th,
.schedule-history-table td { padding: 12px; vertical-align: top; }
.schedule-history-table th { position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.schedule-history-time { display: flex; flex-direction: column; gap: 4px; }
.schedule-history-time > span,
.schedule-history-type > span,
.schedule-history-table .badge,
.schedule-history-actions .btn { white-space: nowrap; }
.schedule-history-table .badge { margin-left: 0; }
.schedule-history-preset,
.schedule-history-summary { overflow-wrap: anywhere; word-break: normal; }
.schedule-history-summary { line-height: 1.6; }
.schedule-history-cell-label { display: none; }

@media (max-width: 960px) {
    .schedule-history-open .modal { width: calc(100% - 24px); }
    .schedule-history-open .modal-header { padding: 16px; }
    .schedule-history-open .modal-body { padding: 0 16px 16px; }
    .schedule-history-table,
    .schedule-history-table tbody { display: block; width: 100%; }
    .schedule-history-table colgroup { display: none; }
    /* 保留表头供辅助技术读取，卡片内同时提供可见字段标签。 */
    .schedule-history-table thead {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip-path: inset(50%); white-space: nowrap;
    }
    .schedule-history-table tbody tr {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 12px;
        padding: 14px;
        margin-bottom: 14px;
        border: 1px solid var(--border);
        border-radius: 10px;
    }
    .schedule-history-table tbody tr:last-child { margin-bottom: 0; }
    .schedule-history-table td {
        display: flex; flex-direction: column; align-items: flex-start;
        min-width: 0; padding: 0; border-bottom: 0; gap: 6px;
    }
    .schedule-history-cell-label { display: block; color: var(--text-muted); font-size: 12px; }
    .schedule-history-created,
    .schedule-history-updated { grid-column: span 3; }
    .schedule-history-type,
    .schedule-history-status,
    .schedule-history-preset { grid-column: span 2; }
    .schedule-history-time { flex-direction: row; flex-wrap: wrap; gap: 4px 8px; }
    .schedule-history-table .schedule-history-summary {
        grid-column: 1 / -1; align-items: stretch; border-top: 1px solid var(--border); padding-top: 12px;
    }
    .schedule-history-table .schedule-history-actions {
        grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between;
    }
}

/* ===== 多图预览 ===== */
.multi-preview { display: flex; flex-wrap: wrap; gap: 12px; }
.preview-item { width: 140px; text-align: center; }
.preview-item img { width: 140px; height: 100px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.preview-item p { font-size: 12px; margin-top: 4px; color: var(--text-muted); word-break: break-all; }

/* ===== 进度条 ===== */
.progress-bar-container { background: var(--card-bg); border-radius: var(--radius); padding: 16px; border: 1px solid var(--border); }
.progress-info { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.progress-bar { height: 8px; background: #eee; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.3s ease; }

/* ===== 编辑区域 ===== */
.edit-area-header h3 { font-size: 17px; margin-bottom: 6px; }
.edit-area-actions { display: flex; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.annotated-risk-preview {
    padding: 0 16px 12px;
    text-align: center;
    background: var(--bg);
}
.annotated-risk-preview img {
    max-width: 100%;
    max-height: 260px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.detect-edit-photo-preview {
    margin: 0 16px 12px;
}
.inspection-photo-preview-frame.detect-edit-preview img {
    max-height: 260px;
}
.annotated-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}
.edit-risk-card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 12px; overflow: hidden; transition: box-shadow 0.2s;
}
.edit-risk-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.edit-risk-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px; background: #f8f9fa; border-bottom: 1px solid var(--border);
}
.edit-risk-header-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.edit-risk-source { font-size: 12px; color: var(--text-muted); }
.edit-risk-body { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.edit-risk-row { display: flex; flex-direction: column; gap: 4px; }
.edit-risk-row.full-width { grid-column: 1 / -1; }
.edit-risk-row label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.edit-risk-row .input { font-size: 13px; padding: 8px 10px; }

/* ===== Loading ===== */
.loading-overlay {
    position: fixed; inset: 0; background: rgba(255,255,255,0.85);
    display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 2000;
}
.spinner {
    width: 48px; height: 48px; border: 4px solid #eee; border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-text { font-size: 15px; color: var(--text-muted); }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }
.text-muted { color: var(--text-muted); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    #sidebar { width: 64px; }
    .sidebar-header h2, .nav-text, .nav-badge, .user-info, .nav-submenu-arrow { display: none; }
    .sidebar-header { padding: 16px 8px; }
    .nav-item { justify-content: center; padding: 14px 8px; }
    .sidebar-footer { padding: 10px 8px 12px; gap: 6px; }
    .sidebar-action-btn { padding: 8px 0; font-size: 0; }
    .sidebar-action-btn::before { font-size: 16px; }
    .workspace-shell { margin-left: 64px; }
    #main-content { margin-left: 0; padding: 16px; }
    #workspace-signature {
        padding: 12px 16px calc(74px + env(safe-area-inset-bottom));
        text-align: center;
        font-size: 11px;
    }
    .sidebar-flyout-menu { width: min(240px, calc(100vw - 92px)); }
    .stats-grid { grid-template-columns: 1fr; }
    .risk-card { flex-wrap: wrap; }
    .edit-risk-body { grid-template-columns: 1fr; }
    .notification-panel { width: 100%; }
    .notif-head { align-items: flex-start; }
    .notif-actions { width: 100%; }
    .notif-action-btn { flex: 1; min-width: 0; }
}

/* ===== AI 安全管理员新增样式 ===== */
.card-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card-body { padding: 16px; }
.card-body h3 { margin: 0 0 8px; font-size: 16px; }
.card-actions { margin-top: 12px; display: flex; gap: 8px; }
.badge { display: inline-block; padding: 2px 8px; font-size: 12px; border-radius: 10px; background: #eef; color: #445; margin-left: 6px; }
.badge-success { background: #d1f5d3; color: #1b5e20; }
.badge-warning { background: #ffe9c2; color: #8a4b00; }
.badge-danger  { background: #fdd; color: #8b0000; }
.badge-info    { background: #e0f0ff; color: #0a3e78; }
.badge-muted   { background: #eee; color: #666; }
.text-muted { color: #666; font-size: 13px; margin: 4px 0; }
.filters { margin: 12px 0; }
.schedule-formal-model-card { margin-bottom: 16px; border-left: 4px solid var(--info); }
.schedule-formal-model-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.schedule-formal-model-title { font-size: 16px; font-weight: 700; }
.schedule-formal-model-summary { display: grid; gap: 4px; }
.schedule-formal-model-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}
.schedule-formal-model-actions .input { flex: 1; min-width: 220px; }
.schedule-formal-model-empty { margin-top: 12px; }

@media (max-width: 768px) {
    .schedule-formal-model-header,
    .schedule-formal-model-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ===== 备案号悬挂 + 审查模式横幅（入口已关闭，横幅逻辑保留以兜底历史会话） ===== */
.login-filing-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
    z-index: 50;
}
.icp-filing-link {
    color: inherit;
    text-decoration: none;
}
.icp-filing-link:hover {
    text-decoration: underline;
}
.login-filing-footer .icp-filing-link {
    color: rgba(255, 255, 255, 0.78);
}
#workspace-signature .icp-filing-link {
    color: #6b7280;
}
#audit-mode-banner {
    padding: 10px 24px;
    background: linear-gradient(90deg, #1d4ed8 0%, #1e40af 100%);
    color: #fff;
    font-size: 13px;
    text-align: center;
    letter-spacing: 0.3px;
}

@keyframes evalAgentProgress {
    from { background-position: 200% 0; }
    to { background-position: 0 0; }
}

/* 正式 D-V3-F 生产审计 */
.plugmem-production-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; }
.plugmem-production-head h3 { margin:0 0 4px; }
.plugmem-production-mode,.plugmem-production-flags { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.plugmem-production-flags span { padding:8px 12px; border-radius:10px; background:#f5f7fb; color:#526178; }
.plugmem-production-metrics { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:10px; margin:14px 0; }
.plugmem-production-metrics article { padding:13px; border:1px solid #dfe6f1; border-radius:12px; background:#fff; text-align:center; }
.plugmem-production-metrics strong { display:block; font-size:22px; color:#21334d; }
.plugmem-production-metrics span { color:#6a7890; font-size:12px; }
.plugmem-production-runs { display:grid; gap:9px; }
.plugmem-production-run { width:100%; border:1px solid #dfe6f1; border-radius:12px; padding:12px 14px; background:#fff; text-align:left; cursor:pointer; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:5px 16px; }
.plugmem-production-run:hover { border-color:#8b5cf6; box-shadow:0 5px 16px rgba(83,56,146,.08); }
.plugmem-production-run > span,.plugmem-production-memories header,.plugmem-production-packets header { display:flex; gap:9px; align-items:center; justify-content:space-between; }
.plugmem-production-run small,.plugmem-production-memories small { color:#65748a; }
.plugmem-production-run em { grid-column:2; grid-row:1 / span 2; align-self:center; font-size:11px; color:#8c98aa; font-style:normal; }
.plugmem-production-memories,.plugmem-production-packets { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.plugmem-production-memories article,.plugmem-production-packets article { border:1px solid #dfe6f1; border-radius:12px; padding:13px; background:#fbfcff; }
.plugmem-production-memories p,.plugmem-production-packets p { margin:9px 0; color:#42526a; }
.plugmem-production-manifest { display:flex; flex-wrap:wrap; gap:8px; }
.plugmem-production-manifest span { display:flex; gap:6px; align-items:center; padding:7px 10px; border-radius:999px; font-size:12px; }
.plugmem-production-manifest .is-included { color:#087f5b; background:#e6fcf5; }
.plugmem-production-manifest .is-excluded { color:#c92a2a; background:#fff5f5; }
.plugmem-run-detail > section { margin:16px 0; padding:14px; border:1px solid #e3e8f1; border-radius:14px; background:#fff; }
.plugmem-audit-flow { display:flex; gap:8px; align-items:stretch; overflow-x:auto; padding-bottom:5px; }
.plugmem-audit-flow > span { min-width:180px; display:grid; grid-template-columns:28px 1fr; gap:3px 8px; padding:10px; border-radius:11px; background:#f4f1ff; }
.plugmem-audit-flow > span b { grid-row:1 / span 2; display:grid; place-items:center; width:28px; height:28px; border-radius:50%; background:#7c3aed; color:#fff; }
.plugmem-audit-flow > span small { color:#68768d; line-height:1.45; }
.plugmem-audit-flow > em { align-self:center; color:#8b5cf6; font-style:normal; }
.plugmem-audit-facts,.plugmem-audit-candidates,.plugmem-audit-final { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:12px; }
.plugmem-audit-channels { display:grid; grid-template-columns:repeat(5,minmax(150px,1fr)); gap:8px; overflow-x:auto; margin-top:12px; }
.plugmem-audit-channels article { display:flex; flex-direction:column; gap:5px; padding:10px; border-radius:10px; background:#f4f7fb; }
.plugmem-audit-channels header { display:flex; justify-content:space-between; gap:8px; }
.plugmem-audit-channels small { padding:5px 7px; border-radius:7px; background:#fff; color:#5c6b81; }
.plugmem-audit-facts article,.plugmem-audit-candidates article,.plugmem-audit-final article { padding:12px; border:1px solid #dfe6f1; border-radius:12px; background:#fbfcff; }
.plugmem-audit-facts article { border-left:4px solid #22c55e; }
.plugmem-audit-facts article.is-negative { border-left-color:#ef4444; }
.plugmem-audit-facts article.is-uncertain { border-left-color:#f59e0b; }
.plugmem-audit-final article.is-user-confirmed { border-color:#86efac; border-left:4px solid #22c55e; background:#f0fdf4; }
.plugmem-audit-facts header,.plugmem-audit-candidates header,.plugmem-audit-final header { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.plugmem-audit-facts p,.plugmem-audit-candidates p,.plugmem-audit-final p { margin:8px 0; line-height:1.55; }
.plugmem-audit-facts small,.plugmem-audit-candidates small,.plugmem-audit-final small { color:#68768d; }
.plugmem-audit-candidates article.is-selected { border-color:#8b5cf6; box-shadow:inset 3px 0 #8b5cf6; }
.plugmem-audit-candidates article.is-excluded { opacity:.78; }
.plugmem-audit-score-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 10px; margin:10px 0; }
.plugmem-audit-score-grid label { display:grid; grid-template-columns:62px minmax(0,1fr); align-items:center; gap:6px; font-size:12px; color:#596980; }
.plugmem-audit-score { position:relative; display:block; height:20px; border-radius:999px; overflow:hidden; background:#edf1f7; }
.plugmem-audit-score i { position:absolute; inset:0 auto 0 0; background:linear-gradient(90deg,#a78bfa,#7c3aed); }
.plugmem-audit-score b { position:relative; z-index:1; display:block; padding:2px 7px; text-align:right; color:#24324a; }
.plugmem-audit-route { display:grid; gap:4px; padding:8px; border-radius:9px; background:#f4f1ff; color:#6044a0; font-size:12px; }
.plugmem-audit-memory { display:grid; gap:4px; margin-top:8px; padding:9px; border-radius:9px; background:#f4f1ff; }
.plugmem-audit-memory span,.plugmem-audit-memory small { color:#53627a; }
.plugmem-run-detail details { margin:10px 0; border:1px solid #e0e6ef; border-radius:10px; overflow:hidden; }
.plugmem-run-detail summary { cursor:pointer; padding:11px 13px; background:#f7f9fc; font-weight:600; }
.plugmem-run-detail pre { max-height:430px; margin:0; padding:13px; overflow:auto; white-space:pre-wrap; word-break:break-word; background:#182033; color:#eef2ff; }
.plugmem-run-detail section { margin:18px 0; }
.plugmem-run-detail details { margin:10px 0; border:1px solid #dfe6f1; border-radius:10px; padding:10px 12px; }
.plugmem-run-detail pre { white-space:pre-wrap; overflow:auto; max-height:360px; background:#111827; color:#e5e7eb; border-radius:8px; padding:12px; }
.plugmem-run-page { width:100%; min-width:0; }
.plugmem-run-page-header code { display:inline-block; margin-top:7px; color:#64748b; word-break:break-all; }
.plugmem-run-title-row,.plugmem-run-page-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.plugmem-run-page-actions { justify-content:flex-end; }
.plugmem-schema-badge { align-self:flex-start; padding:5px 9px; border-radius:999px; background:#ede9fe; color:#6d28d9; font-size:12px; font-weight:700; }
.plugmem-schema-badge.is-history { background:#f1f5f9; color:#64748b; }
.plugmem-audit-notice { margin:10px 0; padding:11px 13px; border:1px solid #fde68a; border-radius:10px; background:#fffbeb; color:#92400e; }
.plugmem-audit-notice.is-warning { border-color:#fdba74; background:#fff7ed; color:#9a3412; }
.plugmem-memory-stage-flow { display:flex; align-items:stretch; gap:8px; margin:14px 0; overflow-x:auto; padding-bottom:5px; }
.plugmem-memory-stage-flow > article { display:flex; gap:10px; min-width:180px; padding:11px; border:1px solid #ddd6fe; border-radius:12px; background:#faf8ff; }
.plugmem-memory-stage-flow > article > span { display:grid; place-items:center; flex:0 0 28px; height:28px; border-radius:50%; background:#7c3aed; color:#fff; font-weight:700; }
.plugmem-memory-stage-flow > article div { display:grid; grid-template-columns:1fr auto; gap:2px 8px; width:100%; }
.plugmem-memory-stage-flow > article b { color:#6d28d9; font-size:18px; }
.plugmem-memory-stage-flow > article small { grid-column:1 / -1; color:#64748b; }
.plugmem-memory-stage-flow > em { align-self:center; color:#8b5cf6; font-style:normal; }
.plugmem-pipeline-panel { padding:12px; }
.plugmem-pipeline-stats { display:flex; flex-wrap:wrap; gap:8px; }
.plugmem-pipeline-stats span { padding:7px 10px; border-radius:999px; background:#f1f5f9; color:#475569; }
.plugmem-pipeline-stats b { margin-left:4px; color:#111827; }
.plugmem-governance-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:10px; }
.plugmem-governance-list article { padding:10px; border:1px solid #dbe4ef; border-left:4px solid #22c55e; border-radius:10px; background:#fbfdff; }
.plugmem-governance-list article.is-excluded { border-left-color:#94a3b8; opacity:.75; }
.plugmem-governance-list header { display:flex; justify-content:space-between; gap:8px; }
.plugmem-governance-list p { margin:6px 0; }
.plugmem-governance-list small { color:#64748b; }
.plugmem-memory-content { display:grid; gap:5px; margin:8px 0; padding:8px 10px; border-radius:8px; background:#f8fafc; border:1px solid #e2e8f0; }
.plugmem-memory-content p { margin:0; color:#334155; line-height:1.55; white-space:pre-wrap; word-break:break-word; }
.plugmem-memory-content p b { color:#6d28d9; }
.plugmem-memory-content.is-empty { color:#94a3b8; font-size:12px; }
.plugmem-memory-outcome-list { display:grid; gap:8px; margin:8px 0; }
.plugmem-memory-outcome-list > div { padding:8px; border-radius:8px; background:#fff; border:1px solid #e2e8f0; }
.plugmem-memory-outcome-list .plugmem-memory-content { margin-bottom:0; }
.plugmem-memory-filter { display:flex; flex-wrap:wrap; gap:12px; margin:10px 0; }
.plugmem-memory-filter label { display:flex; align-items:center; gap:7px; color:#475569; }
.plugmem-memory-filter select { min-width:120px; padding:6px 28px 6px 8px; border:1px solid #cbd5e1; border-radius:8px; background:#fff; }
.plugmem-score-calculation,.plugmem-prior-breakdown { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.plugmem-score-calculation span,.plugmem-prior-breakdown span { padding:5px 7px; border-radius:7px; background:#f1f5f9; color:#475569; font-size:12px; }
.plugmem-pipeline-outcomes { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.plugmem-pipeline-outcomes article { padding:12px; border:1px solid #dbe4ef; border-radius:11px; background:#fbfdff; }
.plugmem-pipeline-outcomes article.is-passed { border-left:4px solid #22c55e; }
.plugmem-pipeline-outcomes article.is-blocked { border-left:4px solid #ef4444; background:#fff7f7; }
.plugmem-pipeline-outcomes p { margin:7px 0; word-break:break-word; }
.plugmem-prompt-viewer { padding:16px !important; background:#f8fafc !important; }
.plugmem-prompt-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:12px; }
.plugmem-prompt-card { min-width:0; overflow:hidden; border:1px solid #dbe3ef; border-radius:12px; background:#fff; }
.plugmem-prompt-card header { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 14px; border-bottom:1px solid #dbe3ef; background:#f8fafc; }
.plugmem-prompt-card header > div { display:grid; gap:3px; }
.plugmem-prompt-card header small { color:#64748b; }
.plugmem-prompt-card pre { min-height:320px; max-height:620px; margin:0; border-radius:0; padding:16px; line-height:1.6; white-space:pre-wrap; overflow:auto; }
@media (max-width:900px) { .plugmem-production-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); } .plugmem-production-memories,.plugmem-production-packets,.plugmem-audit-facts,.plugmem-audit-candidates,.plugmem-audit-final,.plugmem-governance-list,.plugmem-pipeline-outcomes { grid-template-columns:1fr; } }
@media (max-width:1100px) { .plugmem-prompt-grid { grid-template-columns:1fr; } }
@media (max-width:560px) { .plugmem-production-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } .plugmem-production-run { grid-template-columns:1fr; } .plugmem-production-run em { grid-column:auto; grid-row:auto; word-break:break-all; } .plugmem-audit-score-grid { grid-template-columns:1fr; } .plugmem-run-page-actions { width:100%; justify-content:flex-start; } .plugmem-prompt-card header { align-items:flex-start; } }

.agent-lab-timeline {
    max-height: 480px;
    overflow: auto;
    margin-top: 10px;
    scroll-behavior: smooth;
}

.agent-lab-event-row {
    display: grid;
    grid-template-columns: 36px 190px minmax(0, 1fr);
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid #edf2f7;
}

.agent-lab-event-row.is-new {
    animation: agentLabEventEnter .28s ease-out;
}

@keyframes agentLabEventEnter {
    from { opacity: 0; transform: translateY(5px); background: #e7f5ff; }
    to { opacity: 1; transform: translateY(0); background: transparent; }
}

.agent-lab-image-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.agent-lab-result-image {
    display: block;
    width: 100%;
    height: min(42vw, 460px);
    min-height: 260px;
    object-fit: contain;
    border-radius: 8px;
    background: #0f172a;
    cursor: zoom-in;
}

.agent-lab-risk-row {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    transition: border-color .2s ease, background .2s ease, opacity .2s ease;
}

.agent-lab-risk-row.is-deleted {
    border-color: #ffa8a8;
    background: #fff5f5;
}

.agent-lab-risk-row.is-deleted .eval-toolbar-row {
    opacity: .55;
}

.agent-risk-reason-field {
    margin: 9px 0;
}

.agent-lab-home-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.agent-lab-home-card {
    display: grid;
    min-height: 178px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 20px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    text-align: left;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.agent-lab-home-card:hover,
.agent-lab-home-card:focus-visible {
    border-color: #93c5fd;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .09);
    outline: none;
    transform: translateY(-2px);
}

.agent-lab-home-card.is-experiment { background: linear-gradient(145deg, #f5f9ff, #fff 58%); }
.agent-lab-home-card.is-session { background: linear-gradient(145deg, #f6f5ff, #fff 58%); }
.agent-lab-home-card.is-memory { background: linear-gradient(145deg, #f2fbf7, #fff 58%); }
.agent-lab-home-card.is-rag { background: linear-gradient(145deg, #fff8ed, #fff 58%); }

.agent-lab-home-index {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #eaf2ff;
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
}

.agent-lab-home-card.is-session .agent-lab-home-index { background: #ede9fe; color: #6d28d9; }
.agent-lab-home-card.is-memory .agent-lab-home-index { background: #dcfce7; color: #047857; }
.agent-lab-home-card.is-rag .agent-lab-home-index { background: #ffedd5; color: #c2410c; }

.agent-lab-home-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 10px;
}

.agent-lab-home-copy strong {
    font-size: 18px;
    line-height: 1.3;
}

.agent-lab-home-copy small {
    color: #64748b;
    font-size: 13px;
    line-height: 1.65;
}

.agent-lab-home-arrow {
    color: #94a3b8;
    font-size: 24px;
    line-height: 38px;
    transition: color .16s ease, transform .16s ease;
}

.agent-lab-home-card:hover .agent-lab-home-arrow,
.agent-lab-home-card:focus-visible .agent-lab-home-arrow {
    color: #2563eb;
    transform: translateX(3px);
}

.agent-lab-view-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.agent-lab-view-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.agent-lab-back-button {
    color: #475569;
}

.agent-lab-memory-rule {
    padding: 11px 0;
    border-bottom: 1px solid #edf2f7;
}

.agent-lab-memory-rule:last-child {
    border-bottom: 0;
}

.agent-lab-rule-text {
    margin: 9px 0;
    padding: 9px 11px;
    border-left: 3px solid #339af0;
    border-radius: 0 6px 6px 0;
    background: #f4f9ff;
    line-height: 1.55;
}

.agent-lab-memory-meta,
.agent-lab-memory-effect {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 6px 0;
    color: #64748b;
    font-size: 12px;
}

.agent-lab-memory-effect span {
    padding: 3px 7px;
    border-radius: 999px;
    background: #f1f5f9;
}

.agent-lab-memory-details {
    margin-top: 12px;
    padding: 13px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #fbfdff;
}

.agent-lab-memory-details h4 {
    margin: 6px 0 9px;
}

.agent-lab-memory-details section + section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.agent-lab-memory-compare {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 8px;
}

.agent-lab-memory-snapshot {
    padding: 9px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #fff;
}

.agent-lab-memory-snapshot.is-empty {
    border-style: dashed;
    color: #64748b;
}

.agent-lab-memory-snapshot p {
    margin: 6px 0;
}

.agent-lab-memory-case {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid #e2e8f0;
}

.agent-lab-memory-thumb {
    width: 150px;
    height: 120px;
    object-fit: cover;
    border-radius: 7px;
    background: #0f172a;
}

.agent-lab-memory-activity {
    display: grid;
    grid-template-columns: 180px minmax(160px, 1fr) 90px 110px;
    gap: 8px;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid #edf2f7;
    font-size: 12px;
}

.agent-lab-experiment-shell {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 46%);
}

.agent-lab-experiment-title h3,
.agent-lab-experiment-results h3 {
    margin: 0;
}

.agent-lab-hypothesis {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    margin: 12px 0;
    padding: 11px 13px;
    border-left: 4px solid #2563eb;
    border-radius: 0 8px 8px 0;
    background: #eff6ff;
    color: #1e3a8a;
    line-height: 1.55;
}

.agent-lab-experiment-config,
.agent-lab-experiment-history,
.agent-lab-experiment-results {
    margin-top: 12px;
    padding: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.agent-lab-experiment-config .eval-toolbar-field {
    min-width: 190px;
    flex: 1;
}

.agent-lab-experiment-profile-row,
.agent-lab-experiment-actions,
.agent-lab-history-list,
.agent-lab-repetition-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-top: 10px;
}

.agent-lab-freeze-chip {
    margin-left: auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 12px;
    font-weight: 700;
}

.agent-lab-experiment-design-grid,
.agent-lab-experiment-result-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.agent-lab-experiment-design-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.agent-lab-experiment-variant-choice {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.agent-lab-experiment-variant-choice.is-selected {
    border-color: #60a5fa;
    background: #eff6ff;
    box-shadow: 0 0 0 1px #bfdbfe;
}

.agent-lab-experiment-variant-choice > input {
    margin-top: 3px;
}

.agent-lab-experiment-variant-choice > span {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
}

.agent-lab-experiment-variant-choice b {
    color: #1e293b;
    font-size: 14px;
}

.agent-lab-experiment-variant-choice small {
    color: #64748b;
    line-height: 1.45;
}

.agent-lab-experiment-variant-choice em {
    color: #2563eb;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.agent-lab-experiment-design-grid span {
    color: #64748b;
    font-size: 12px;
}

.agent-lab-experiment-image-row {
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin-top: 12px;
    padding: 10px;
    border-radius: 9px;
    background: #f8fafc;
}

.agent-lab-experiment-image-row img {
    width: 148px;
    height: 104px;
    object-fit: cover;
    border-radius: 7px;
    background: #0f172a;
}

.agent-lab-experiment-variant {
    min-width: 0;
    padding: 13px;
    border: 1px solid #dbe3ef;
    border-top: 4px solid #64748b;
    border-radius: 10px;
    background: #fff;
}

.agent-lab-experiment-variant.is-deanchored { border-top-color: #2563eb; }
.agent-lab-experiment-variant.is-memory-only { border-top-color: #059669; }
.agent-lab-experiment-variant.is-retrieval-agent { border-top-color: #7c3aed; }
.agent-lab-experiment-variant.is-reconciled-agent { border-top-color: #ea580c; }
.agent-lab-experiment-variant.is-legacy { border-top-style: dashed; background: #f8fafc; }

.agent-lab-add-variant {
    display: flex;
    min-height: 210px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    border: 2px dashed #cbd5e1;
    border-top-width: 2px;
    background: #f8fafc;
}

.agent-lab-add-variant-plus {
    width: 54px;
    height: 54px;
    margin-bottom: 10px;
    border: 1px solid #93c5fd;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    cursor: pointer;
    font: 300 36px/1 sans-serif;
}

.agent-lab-add-variant-plus:hover { background: #dbeafe; transform: translateY(-1px); }

.agent-lab-add-variant-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin-top: 8px;
}

.agent-lab-add-variant-menu[hidden] { display: none; }

.agent-lab-observation-json {
    max-height: 520px;
    margin: 0;
    padding: 12px;
    overflow: auto;
    border-radius: 7px;
    background: #0f172a;
    color: #dbeafe;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: 11px/1.55 Consolas, "SFMono-Regular", monospace;
}

@media (max-width: 1400px) and (min-width: 901px) {
    .agent-lab-experiment-design-grid,
    .agent-lab-experiment-result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.agent-lab-variant-head,
.agent-lab-variant-head > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.agent-lab-variant-letter {
    display: inline-flex;
    width: 27px;
    height: 27px;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #0f172a;
    color: #fff;
    font-weight: 800;
}

.agent-lab-variant-description {
    min-height: 38px;
    margin: 9px 0;
}

.agent-lab-metric-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 8px;
}

.agent-lab-metric-strip span {
    min-width: 0;
    padding: 6px 3px;
    border-radius: 6px;
    background: #f1f5f9;
    text-align: center;
}

.agent-lab-metric-strip strong,
.agent-lab-metric-strip small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-lab-metric-strip small {
    margin-top: 2px;
    color: #64748b;
    font-size: 10px;
}

.agent-lab-variant-risks {
    max-height: 520px;
    overflow: auto;
    margin: 4px 0 10px;
}

.agent-lab-variant-reasoning {
    margin: 8px 0;
    font-size: 12px;
}

.agent-lab-variant-reasoning summary { cursor: pointer; font-weight: 700; }
.agent-lab-variant-reasoning pre {
    max-height: 260px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font: inherit;
}

.agent-lab-variant-error {
    padding: 7px;
    border-radius: 6px;
    background: #fff1f2;
    color: #be123c;
    font-size: 12px;
}

.agent-lab-io-notice {
    display: flex;
    gap: 10px;
    margin: 12px 0;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e3a5f;
    font-size: 12px;
}

.agent-lab-io-notice strong { flex: 0 0 auto; }

.agent-lab-io-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.agent-lab-io-stage {
    min-width: 0;
    padding: 14px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #fbfdff;
}

.agent-lab-io-overview {
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fafc, #eff6ff);
}

.agent-lab-io-flow {
    display: grid;
    grid-template-columns: minmax(100px, 1fr) auto minmax(100px, 1fr) auto minmax(100px, 1fr) auto minmax(100px, 1fr) auto minmax(100px, 1fr);
    align-items: center;
    gap: 8px;
}

.agent-lab-io-flow > span {
    display: flex;
    min-height: 62px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbe3ee;
    border-top: 3px solid #64748b;
    border-radius: 9px;
    background: #fff;
    text-align: center;
}

.agent-lab-io-flow > span.is-input { border-top-color: #2563eb; }
.agent-lab-io-flow > span.is-tool { border-top-color: #0f766e; }
.agent-lab-io-flow > span.is-model { border-top-color: #7c3aed; }
.agent-lab-io-flow > span.is-parse { border-top-color: #d97706; }
.agent-lab-io-flow > span.is-output { border-top-color: #16a34a; }
.agent-lab-io-flow b { font-size: 14px; color: #172033; }
.agent-lab-io-flow small { margin-top: 3px; color: #64748b; }
.agent-lab-io-flow > i { color: #94a3b8; font-style: normal; font-weight: 800; }

.agent-lab-io-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.agent-lab-io-metrics > span {
    display: flex;
    min-width: 0;
    padding: 9px 10px;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.agent-lab-io-metrics b { overflow-wrap: anywhere; color: #1e293b; font-size: 16px; }
.agent-lab-io-metrics small { margin-top: 2px; color: #64748b; }
.agent-lab-io-metrics .is-success b { color: #15803d; }
.agent-lab-io-metrics .is-warning b { color: #b45309; }
.agent-lab-io-metrics .is-primary b { color: #1d4ed8; }

.agent-lab-io-stage-head,
.agent-lab-io-stage-head > div,
.agent-lab-io-request-head,
.agent-lab-io-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.agent-lab-io-stage-head > div { justify-content: flex-start; }
.agent-lab-io-stage-head h4 { margin: 0; color: #172033; }
.agent-lab-io-stage-head small { display: block; margin-top: 3px; color: #64748b; }

.agent-lab-io-stage-index {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e0e7ff;
    color: #4338ca;
    font-weight: 800;
}

.agent-lab-io-section-title { margin-bottom: 8px; }
.agent-lab-io-section-title strong { color: #1e293b; }
.agent-lab-io-section-title small { color: #64748b; text-align: right; }

.agent-lab-io-session-input {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.agent-lab-io-image-card {
    grid-row: span 2;
    overflow: hidden;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #fff;
}

.agent-lab-io-image-card img { display: block; width: 100%; height: 150px; object-fit: cover; }
.agent-lab-io-image-card > span { display: block; padding: 8px; color: #475569; font-size: 12px; font-weight: 700; }
.agent-lab-io-image-empty { display: grid; height: 150px; place-items: center; color: #94a3b8; }

.agent-lab-io-input-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.agent-lab-io-input-facts section {
    min-width: 0;
    padding: 9px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.agent-lab-io-input-facts small { display: block; margin-bottom: 3px; color: #64748b; }
.agent-lab-io-input-facts strong,
.agent-lab-io-input-facts code { overflow-wrap: anywhere; color: #1e293b; }
.agent-lab-io-wide { grid-column: 1 / -1; padding: 10px; border: 1px solid #e2e8f0; border-radius: 9px; background: #fff; }

.agent-lab-io-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.agent-lab-io-tags > span {
    max-width: 100%;
    padding: 4px 7px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    overflow-wrap: anywhere;
    font-size: 11px;
}

.agent-lab-io-empty { margin: 8px 0; color: #94a3b8; font-size: 12px; }

.agent-lab-io-tool-list { display: grid; gap: 9px; margin-top: 12px; }
.agent-lab-io-tool-card { overflow: hidden; border: 1px solid #dbe3ee; border-radius: 10px; background: #fff; }
.agent-lab-io-tool-card > header { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 10px; background: #f8fafc; }
.agent-lab-io-tool-card > header > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #ccfbf1; color: #0f766e; font-weight: 800; }
.agent-lab-io-tool-card header strong,
.agent-lab-io-tool-card header code { display: block; }
.agent-lab-io-tool-card header code { margin-top: 2px; color: #64748b; font-size: 10px; }
.agent-lab-io-tool-card header em { color: #b45309; font-size: 11px; font-style: normal; font-weight: 700; }
.agent-lab-io-tool-card header em.is-done { color: #15803d; }

.agent-lab-io-tool-flow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, .8fr) auto minmax(0, 1fr); align-items: center; gap: 9px; padding: 11px; }
.agent-lab-io-tool-flow section { min-width: 0; padding: 9px; border: 1px solid #e2e8f0; border-radius: 8px; }
.agent-lab-io-tool-flow small { display: block; margin-bottom: 6px; color: #64748b; }
.agent-lab-io-tool-flow > i { color: #0f766e; font-style: normal; font-weight: 800; }
.agent-lab-io-tool-result-visual { margin: 0 11px 11px; padding: 10px; border: 1px solid #ccfbf1; border-radius: 8px; background: #f0fdfa; }
.agent-lab-io-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.agent-lab-io-result-grid section { min-width: 0; padding: 8px; border: 1px solid #dbe3ee; border-radius: 7px; background: #fff; }
.agent-lab-io-result-grid small { display: block; margin-bottom: 5px; color: #64748b; }
.agent-lab-io-result-grid p { margin: 0; overflow-wrap: anywhere; color: #334155; white-space: pre-wrap; }
.agent-lab-io-standard-results,
.agent-lab-io-memory-results { display: grid; gap: 6px; }
.agent-lab-io-standard-results article,
.agent-lab-io-memory-results article { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 7px; border: 1px solid #dbe3ee; border-radius: 7px; background: #fff; }
.agent-lab-io-standard-results article > span,
.agent-lab-io-memory-results article > span { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: #ccfbf1; color: #0f766e; font-size: 10px; font-weight: 800; }
.agent-lab-io-standard-results article strong,
.agent-lab-io-standard-results article small,
.agent-lab-io-memory-results article strong,
.agent-lab-io-memory-results article small { display: block; }
.agent-lab-io-standard-results article small,
.agent-lab-io-memory-results article small { margin-top: 2px; color: #64748b; }
.agent-lab-io-standard-results article > b,
.agent-lab-io-memory-results article > b { color: #0f766e; font-variant-numeric: tabular-nums; }
.agent-lab-io-standard-results article > em,
.agent-lab-io-memory-results article > em { padding: 3px 6px; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: 10px; font-style: normal; }
.agent-lab-io-standard-results article > em.is-supported { background: #dcfce7; color: #15803d; }
.agent-lab-io-standard-results article > em.is-contradicted { background: #fee2e2; color: #b91c1c; }
.agent-lab-io-standard-results article > em.is-unknown { background: #fef3c7; color: #92400e; }
.agent-lab-io-tool-details { border-top: 1px solid #e2e8f0; }
.agent-lab-io-tool-details > summary { padding: 8px 11px; cursor: pointer; color: #475569; font-size: 11px; font-weight: 700; }
.agent-lab-io-tool-details > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 10px 10px; }
.agent-lab-io-tool-details section { min-width: 0; }
.agent-lab-io-tool-details strong { display: block; margin-bottom: 5px; font-size: 11px; }
.agent-lab-io-tool-details pre,
.agent-lab-io-reasoning pre { max-height: 330px; margin: 0; padding: 10px; overflow: auto; border-radius: 7px; background: #0f172a; color: #dbeafe; white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.5 Consolas, monospace; }

.agent-lab-io-request,
.agent-lab-io-response { margin-top: 12px; padding: 11px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.agent-lab-io-request-head { padding-bottom: 9px; border-bottom: 1px solid #e2e8f0; }
.agent-lab-io-request-head span { color: #0f766e; font-size: 11px; font-weight: 700; }
.agent-lab-io-request-summary { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 10px; margin: 10px 0; }
.agent-lab-io-mini-image { overflow: hidden; border: 1px solid #e2e8f0; border-radius: 8px; }
.agent-lab-io-mini-image img { display: block; width: 100%; height: 92px; object-fit: cover; }
.agent-lab-io-mini-image > span { display: grid; height: 92px; place-items: center; color: #94a3b8; }
.agent-lab-io-mini-image small { display: block; padding: 6px; color: #64748b; text-align: center; }

.agent-lab-io-prompt-blocks { display: grid; gap: 6px; }
.agent-lab-io-prompt-blocks details { overflow: hidden; border: 1px solid #e2e8f0; border-radius: 8px; }
.agent-lab-io-prompt-blocks summary { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 8px; cursor: pointer; background: #f8fafc; }
.agent-lab-io-prompt-blocks summary > span { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; background: #ede9fe; color: #6d28d9; font-size: 10px; font-weight: 800; }
.agent-lab-io-prompt-blocks summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.agent-lab-io-prompt-blocks summary small { color: #64748b; }
.agent-lab-io-prompt-blocks pre { max-height: 280px; margin: 0; padding: 10px; overflow: auto; border-top: 1px solid #e2e8f0; background: #f8fafc; color: #334155; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.55 inherit; }

.agent-lab-io-observation { display: grid; gap: 10px; }
.agent-lab-io-scene-summary,
.agent-lab-io-assessment { padding: 10px; border-left: 4px solid #2563eb; border-radius: 7px; background: #eff6ff; }
.agent-lab-io-scene-summary small,
.agent-lab-io-assessment small { color: #1d4ed8; font-weight: 700; }
.agent-lab-io-scene-summary p,
.agent-lab-io-assessment p { margin: 5px 0 0; color: #1e3a5f; line-height: 1.65; }
.agent-lab-io-observation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.agent-lab-io-observation-grid > section { min-width: 0; padding: 9px; border: 1px solid #e2e8f0; border-radius: 8px; }
.agent-lab-io-observation-grid > section:last-child:nth-child(odd) { grid-column: 1 / -1; }

.agent-lab-io-uncertain { padding: 10px; border: 1px solid #fde68a; border-radius: 9px; background: #fffbeb; }
.agent-lab-io-uncertain > div:last-child { display: grid; gap: 7px; }
.agent-lab-io-uncertain article { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; padding: 8px; border: 1px solid #fde68a; border-radius: 7px; background: #fff; }
.agent-lab-io-uncertain article > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #fef3c7; color: #92400e; font-weight: 800; }
.agent-lab-io-uncertain article small { display: block; margin-top: 5px; color: #92400e; }
.agent-lab-io-query-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.agent-lab-io-query-groups > div { padding: 9px; border: 1px solid #bfdbfe; border-radius: 8px; background: #eff6ff; }
.agent-lab-io-query-groups strong { display: block; margin-bottom: 7px; color: #1e40af; }

.agent-lab-io-risk-output { margin-top: 10px; }
.agent-lab-io-decision-trace { margin-top: 12px; }
.agent-lab-io-decision-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 9px; }
.agent-lab-io-decision-columns > section { min-width: 0; padding: 10px; border: 1px solid #e2e8f0; border-radius: 9px; }
.agent-lab-io-decision-columns > section.is-accepted { border-color: #bbf7d0; background: #f0fdf4; }
.agent-lab-io-decision-columns > section.is-excluded { background: #f8fafc; }
.agent-lab-io-decision-columns article { margin-top: 7px; padding: 8px; border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; }
.agent-lab-io-decision-columns article header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.agent-lab-io-decision-columns article p { margin: 6px 0 0; color: #475569; line-height: 1.55; }
.agent-lab-io-reconciliation { margin-top: 10px; padding: 10px; border: 1px solid #ddd6fe; border-radius: 9px; background: #f5f3ff; }
.agent-lab-io-assessment { margin-top: 10px; border-left-color: #16a34a; background: #f0fdf4; }
.agent-lab-io-assessment small { color: #15803d; }
.agent-lab-io-assessment p { color: #14532d; }
.agent-lab-io-reasoning { margin-top: 10px; overflow: hidden; border: 1px solid #dbe3ee; border-radius: 8px; }
.agent-lab-io-reasoning summary { display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px; cursor: pointer; background: #f8fafc; font-size: 12px; font-weight: 700; }
.agent-lab-io-reasoning summary span { color: #64748b; font-weight: 400; }

.agent-lab-full-packet-audit {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #c4b5fd;
    border-radius: 10px;
    background: #faf5ff;
}

.agent-lab-full-packet-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.agent-lab-full-packet-flow > span {
    display: flex;
    min-height: 62px;
    padding: 9px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    background: #fff;
    text-align: center;
}

.agent-lab-full-packet-flow b { color: #5b21b6; }
.agent-lab-full-packet-flow small { margin-top: 3px; color: #6b7280; }
.agent-lab-full-packet-flow i { color: #7c3aed; font-style: normal; font-weight: 800; }

.agent-lab-full-manifest {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 7px;
    margin-top: 10px;
}

.agent-lab-full-manifest > span {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.agent-lab-full-manifest > span.is-included { border-color: #86efac; color: #166534; }
.agent-lab-full-manifest > span.is-excluded { border-color: #fecaca; color: #991b1b; }
.agent-lab-full-manifest b { font-size: 16px; }

.agent-lab-full-field-diff {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.agent-lab-full-field-diff > section {
    padding: 9px;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    background: #fff;
}

.agent-lab-full-field-diff strong { display: block; margin-bottom: 7px; color: #4c1d95; }

.agent-lab-full-packets { display: grid; gap: 8px; margin-top: 10px; }
.agent-lab-full-packets > article { padding: 10px; border: 1px solid #ddd6fe; border-radius: 8px; background: #fff; }
.agent-lab-full-packets header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.agent-lab-full-packets header strong { color: #4c1d95; }
.agent-lab-full-packets header > span { color: #6d28d9; font-size: 11px; }
.agent-lab-full-packets p { display: grid; grid-template-columns: 75px minmax(0, 1fr); gap: 7px; margin: 7px 0 0; color: #475569; }
.agent-lab-full-packets p b { color: #334155; }
.agent-lab-full-packets article > div { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.agent-lab-full-packets article > div > span { padding: 5px 7px; border-radius: 7px; background: #f5f3ff; }
.agent-lab-full-packets article > div strong,
.agent-lab-full-packets article > div small { display: block; }
.agent-lab-full-packets article > div small { margin-top: 2px; color: #7c3aed; }

.agent-lab-io-block {
    margin-top: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #fff;
}

.agent-lab-io-block summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.agent-lab-io-block pre,
.agent-lab-io-event-ledger pre {
    max-height: 440px;
    margin: 0;
    padding: 11px;
    overflow: auto;
    border-top: 1px solid #e2e8f0;
    background: #0f172a;
    color: #dbeafe;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: 11px/1.55 Consolas, "SFMono-Regular", monospace;
}

.agent-lab-io-event-ledger {
    margin-top: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
}

.agent-lab-io-event-ledger summary {
    padding: 10px 12px;
    cursor: pointer;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
}

.agent-lab-rag-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agent-lab-rag-shell > .eval-section-head h3,
.agent-lab-rag-section h4,
.agent-lab-rag-section h5 {
    margin: 0;
}

.agent-lab-rag-shell > .eval-section-head p,
.agent-lab-rag-section .eval-section-head p {
    margin: 5px 0 0;
}

.agent-lab-rag-picker {
    display: flex;
    align-items: end;
    gap: 10px;
    padding: 14px;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    background: #fffaf3;
}

.agent-lab-rag-picker label {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.agent-lab-rag-case-summary {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.agent-lab-rag-case-summary img {
    width: 180px;
    height: 118px;
    border-radius: 8px;
    background: #f1f5f9;
    object-fit: cover;
}

.agent-lab-rag-case-summary p {
    margin: 7px 0 0;
    color: #64748b;
    font-size: 12px;
}

.agent-lab-rag-metrics {
    display: flex;
    gap: 8px;
}

.agent-lab-rag-metrics span {
    min-width: 82px;
    padding: 9px 10px;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    text-align: center;
    font-size: 11px;
}

.agent-lab-rag-metrics b {
    display: block;
    color: #0f172a;
    font-size: 18px;
}

.agent-lab-rag-section {
    padding: 14px;
}

.agent-lab-rag-query-grid,
.agent-lab-rag-deltas,
.agent-lab-rag-compare-grid {
    display: grid;
    gap: 10px;
}

.agent-lab-rag-query-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 10px;
}

.agent-lab-rag-query-grid section {
    min-width: 0;
    padding: 10px;
    border-radius: 8px;
    background: #f8fafc;
}

.agent-lab-rag-query-grid section > strong {
    color: #334155;
    font-size: 12px;
}

.agent-lab-rag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}

.agent-lab-rag-chips span {
    max-width: 100%;
    padding: 4px 7px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    overflow-wrap: anywhere;
    font-size: 11px;
}

.agent-lab-rag-chips em {
    color: #94a3b8;
    font-size: 11px;
    font-style: normal;
}

.agent-lab-rag-deltas {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.agent-lab-rag-delta {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 12px;
}

.agent-lab-rag-delta span { color: #64748b; overflow-wrap: anywhere; }
.agent-lab-rag-delta.is-gained { border-color: #bbf7d0; background: #f0fdf4; }
.agent-lab-rag-delta.is-gained strong { color: #047857; }
.agent-lab-rag-delta.is-lost { border-color: #fecaca; background: #fff7f7; }
.agent-lab-rag-delta.is-lost strong { color: #b91c1c; }

.agent-lab-rag-compare-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-top: 12px;
}

.agent-lab-rag-compare-grid > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #fbfdff;
}

.agent-lab-rag-ranking {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 9px;
}

.agent-lab-rag-ranking article {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: start;
    padding: 9px;
    border: 1px solid #e8edf4;
    border-radius: 7px;
    background: #fff;
}

.agent-lab-rag-ranking article > div:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.agent-lab-rag-ranking small {
    color: #64748b;
    overflow-wrap: anywhere;
    font-size: 11px;
    line-height: 1.45;
}

.agent-lab-rag-rank {
    display: inline-flex;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 11px;
    font-weight: 800;
}

.agent-lab-rag-score {
    display: flex;
    max-width: 185px;
    flex-direction: column;
    gap: 3px;
    text-align: right;
}

.agent-lab-rag-score b { color: #0f766e; font-variant-numeric: tabular-nums; }

.agent-lab-rag-dropped {
    margin-top: 12px;
    color: #475569;
    font-size: 12px;
}

.agent-lab-rag-dropped summary { cursor: pointer; font-weight: 700; }
.agent-lab-rag-dropped > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
    padding: 10px;
    border-radius: 7px;
    background: #f8fafc;
}

.agent-lab-rag-full-audit {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #f8fbff, #fff 220px);
}

.agent-lab-rag-observation-audit,
.agent-lab-rag-audit-details > details {
    margin-top: 12px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.agent-lab-rag-observation-audit summary,
.agent-lab-rag-audit-details summary {
    padding: 11px 12px;
    cursor: pointer;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    font-weight: 750;
}

.agent-lab-rag-source-line {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 10px 12px 0;
}

.agent-lab-rag-source-line span {
    padding: 4px 7px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
}

.agent-lab-rag-observation-audit pre {
    max-height: 360px;
    margin: 10px 12px 12px;
    padding: 11px;
    overflow: auto;
    border-radius: 7px;
    background: #0f172a;
    color: #dbeafe;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: 11px/1.55 Consolas, "SFMono-Regular", monospace;
}

.agent-lab-rag-query-audit {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
}

.agent-lab-rag-query-audit article {
    min-width: 0;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #fbfdff;
}

.agent-lab-rag-query-audit article:first-child {
    grid-column: 1 / -1;
}

.agent-lab-rag-query-audit p {
    margin: 6px 0 0;
    color: #475569;
    overflow-wrap: anywhere;
    font-size: 11px;
    line-height: 1.5;
}

.agent-lab-rag-query-audit small {
    display: block;
    margin-top: 7px;
    color: #0369a1;
    font-size: 10px;
    line-height: 1.5;
}

.agent-lab-rag-audit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.agent-lab-rag-audit-grid > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid #dbe3ef;
    border-radius: 9px;
    background: rgba(255, 255, 255, .88);
}

.agent-lab-rag-audit-flow {
    margin-top: 9px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.agent-lab-rag-audit-title {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #334155;
    font-size: 12px;
}

.agent-lab-rag-audit-title span {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
}

.agent-lab-rag-audit-steps {
    display: grid;
    grid-template-columns: minmax(58px, 1fr) auto minmax(58px, 1fr) auto minmax(72px, 1fr) auto minmax(58px, 1fr);
    gap: 5px;
    align-items: center;
    margin-top: 9px;
}

.agent-lab-rag-audit-steps > div {
    padding: 7px 5px;
    border-radius: 7px;
    background: #fff;
    text-align: center;
}

.agent-lab-rag-audit-steps > div.is-final { background: #ecfdf5; }
.agent-lab-rag-audit-steps b { display: block; color: #0f172a; font-size: 16px; }
.agent-lab-rag-audit-steps small { color: #64748b; font-size: 9px; }
.agent-lab-rag-audit-steps i { color: #94a3b8; font-size: 11px; font-style: normal; }
.agent-lab-rag-audit-flow > p { margin: 7px 0 0; color: #64748b; font-size: 10px; }

.agent-lab-rag-audit-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.agent-lab-rag-audit-table {
    display: flex;
    max-height: 560px;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    overflow: auto;
}

.agent-lab-rag-audit-table > article {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 120px;
    gap: 8px;
    align-items: start;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-left-width: 3px;
    border-radius: 7px;
    background: #fff;
}

.agent-lab-rag-audit-table > article.is-selected { border-left-color: #22c55e; }
.agent-lab-rag-audit-table > article.is-excluded { border-left-color: #f87171; opacity: .78; }

.agent-lab-rag-audit-table article > div:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.agent-lab-rag-audit-table small {
    color: #64748b;
    overflow-wrap: anywhere;
    font-size: 10px;
    line-height: 1.45;
}

.agent-lab-rag-audit-decision {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: right;
}

.agent-lab-rag-audit-decision b { color: #0f766e; font-variant-numeric: tabular-nums; }
.agent-lab-rag-audit-decision span { color: #334155; font-size: 11px; font-weight: 750; }

.agent-lab-rag-method-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 12px;
    margin: 14px 0;
}

.agent-lab-rag-method-overview.is-focus-mode { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.agent-lab-rag-focus-toolbar { grid-column: 1 / -1; order: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #c4b5fd; border-radius: 9px; background: #faf5ff; }
.agent-lab-rag-focus-toolbar > div { min-width: 0; }
.agent-lab-rag-focus-toolbar strong,
.agent-lab-rag-focus-toolbar small { display: block; }
.agent-lab-rag-focus-toolbar strong { color: #5b21b6; }
.agent-lab-rag-focus-toolbar small { margin-top: 2px; color: #64748b; }
.agent-lab-rag-method-overview.is-focus-mode .agent-lab-rag-method-card.is-focused { grid-column: 1 / -1; order: 1; }
.agent-lab-rag-method-overview.is-focus-mode .agent-lab-rag-method-card.is-focus-collapsed { order: 2; }
.agent-lab-rag-method-card.is-focus-collapsed > .agent-lab-rag-method-body { display: none; }
.agent-lab-rag-method-card.is-focus-collapsed > summary small { display: none; }

.agent-lab-rag-method-card {
    min-width: 0;
    border: 1px solid #cbd5e1;
    border-top: 4px solid #64748b;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.agent-lab-rag-method-card.is-v2 { border-top-color: #0f766e; }
.agent-lab-rag-method-card.is-v3 { border-top-color: #7c3aed; }

.agent-lab-rag-method-card > summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 13px;
    cursor: pointer;
    list-style: none;
}

.agent-lab-rag-method-card > summary::-webkit-details-marker { display: none; }
.agent-lab-rag-method-card > summary > span:nth-child(2) { min-width: 0; }
.agent-lab-rag-method-card > summary strong,
.agent-lab-rag-method-card > summary small { display: block; }
.agent-lab-rag-method-card > summary small { margin-top: 4px; color: #64748b; line-height: 1.45; }
.agent-lab-rag-method-focus-btn { padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #475569; cursor: pointer; font: inherit; font-size: 11px; font-weight: 750; white-space: nowrap; }
.agent-lab-rag-method-focus-btn:hover { border-color: #8b5cf6; background: #f5f3ff; color: #6d28d9; }
.agent-lab-rag-method-card.is-focused .agent-lab-rag-method-focus-btn { border-color: #c4b5fd; color: #6d28d9; }

.agent-lab-rag-method-index {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 9px;
    background: #e2e8f0;
    color: #334155;
    font-weight: 850;
}

.is-v2 .agent-lab-rag-method-index { background: #ccfbf1; color: #115e59; }
.is-v3 .agent-lab-rag-method-index { background: #ede9fe; color: #6d28d9; }
.agent-lab-rag-method-count { color: #64748b; font-size: 11px; white-space: nowrap; }
.agent-lab-rag-method-count b { color: #0f172a; }
.agent-lab-rag-method-body { padding: 0 12px 12px; border-top: 1px solid #e2e8f0; }

.agent-lab-rag-step-list { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.agent-lab-rag-step { border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; }
.agent-lab-rag-step > summary { display: grid; grid-template-columns: 26px minmax(90px, auto) minmax(0, 1fr); align-items: center; gap: 8px; padding: 9px; cursor: pointer; }
.agent-lab-rag-step > summary > span { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: #e2e8f0; font-size: 11px; font-weight: 800; }
.agent-lab-rag-step > summary small { color: #64748b; overflow-wrap: anywhere; }
.agent-lab-rag-step-content { padding: 10px; border-top: 1px solid #e2e8f0; background: #fff; }

.agent-lab-rag-formula,
.agent-lab-rag-thresholds { display: flex; flex-direction: column; gap: 5px; margin-bottom: 9px; }
.agent-lab-rag-formula code,
.agent-lab-rag-thresholds span { padding: 7px 9px; border-radius: 6px; background: #f1f5f9; color: #334155; overflow-wrap: anywhere; }
.agent-lab-rag-funnel { display: flex; align-items: center; gap: 9px; margin: 8px 0; }
.agent-lab-rag-funnel span { padding: 5px 10px; border-radius: 999px; background: #dbeafe; color: #1d4ed8; font-weight: 800; }
.agent-lab-rag-funnel i { color: #94a3b8; font-style: normal; }

.agent-lab-rag-transform-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow: auto; }
.agent-lab-rag-transform-list article { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 7px; padding: 7px; border: 1px solid #dbeafe; border-radius: 6px; }
.agent-lab-rag-transform-list article.is-skipped { opacity: .65; border-style: dashed; }
.agent-lab-rag-transform-list p { margin: 0; overflow-wrap: anywhere; }
.agent-lab-rag-transform-list small { grid-column: 2 / -1; color: #b45309; }

.agent-lab-rag-readable-data { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.agent-lab-rag-readable-data > details { overflow: hidden; border: 1px solid #dbe4f0; border-radius: 9px; background: #f8fafc; }
.agent-lab-rag-readable-data > details[open] { background: #fff; box-shadow: 0 3px 12px rgba(15, 23, 42, .05); }
.agent-lab-rag-readable-data > details > summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; color: #334155; }
.agent-lab-rag-readable-data > details > summary::marker { color: #64748b; }
.agent-lab-rag-readable-data > details > summary small { margin-left: auto; color: #64748b; font-weight: 500; }
.agent-lab-rag-readable-data > details > div { padding: 12px; border-top: 1px solid #e2e8f0; }

.agent-lab-audit-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.agent-lab-audit-fields > div { min-width: 0; padding: 9px 10px; border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; }
.agent-lab-audit-fields dt { margin-bottom: 5px; color: #64748b; font-size: 11px; font-weight: 750; }
.agent-lab-audit-fields dd { min-width: 0; margin: 0; color: #1e293b; overflow-wrap: anywhere; }
.agent-lab-audit-fields dd > .agent-lab-audit-fields { grid-template-columns: 1fr; }
.agent-lab-audit-number { color: #0f766e; font-variant-numeric: tabular-nums; }
.agent-lab-rag-readable-data .is-empty { color: #94a3b8; font-style: italic; }

.agent-lab-audit-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.agent-lab-audit-chips > span { max-width: 100%; padding: 4px 7px; border: 1px solid #bfdbfe; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 11px; overflow-wrap: anywhere; }
.agent-lab-audit-object-list { display: flex; flex-direction: column; gap: 7px; }
.agent-lab-audit-object-list > details { overflow: hidden; border: 1px solid #dbe4f0; border-radius: 7px; background: #f8fafc; }
.agent-lab-audit-object-list > details > summary { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; }
.agent-lab-audit-object-list > details > summary strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-lab-audit-object-list > details > summary small { margin-left: auto; flex: 0 0 auto; color: #94a3b8; }
.agent-lab-audit-object-list > details > div { padding: 9px; border-top: 1px solid #e2e8f0; background: #fff; }
.agent-lab-rag-candidate-ids { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 9px; padding: 9px 10px; border: 1px dashed #cbd5e1; border-radius: 8px; }
.agent-lab-rag-candidate-ids > strong { padding-top: 3px; color: #475569; font-size: 12px; }

.agent-lab-fact-view { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.agent-lab-fact-metrics { display: grid; grid-template-columns: repeat(6, minmax(74px, 1fr)); gap: 7px; }
.agent-lab-fact-metrics span { display: flex; min-width: 0; flex-direction: column; padding: 9px; border: 1px solid #dbeafe; border-radius: 8px; background: #f8fafc; text-align: center; }
.agent-lab-fact-metrics b { color: #1d4ed8; font-size: 18px; font-variant-numeric: tabular-nums; }
.agent-lab-fact-metrics small { color: #64748b; }
.agent-lab-fact-derivations { display: flex; flex-direction: column; gap: 10px; }
.agent-lab-fact-derivation { overflow: hidden; border: 1px solid #bfdbfe; border-radius: 10px; background: #fff; }
.agent-lab-fact-derivation.is-discarded { border-style: dashed; opacity: .72; }
.agent-lab-fact-derivation > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #eff6ff; }
.agent-lab-fact-derivation > header > div { display: flex; align-items: baseline; gap: 7px; }
.agent-lab-fact-derivation > header span:not(.badge) { color: #64748b; font-size: 11px; }
.agent-lab-fact-source-title { min-width: 0; flex-wrap: wrap; }
.agent-lab-fact-source-title code { max-width: 100%; padding: 3px 6px; border: 1px solid #bfdbfe; border-radius: 5px; background: #fff; color: #1d4ed8; font-size: 11px; overflow-wrap: anywhere; }
.agent-lab-fact-input-flow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 8px; padding: 11px 12px; }
.agent-lab-fact-input-flow > div { min-width: 0; padding: 8px 9px; border: 1px solid #e2e8f0; border-radius: 7px; background: #f8fafc; }
.agent-lab-fact-input-flow > div.is-changed { border-color: #fcd34d; background: #fffbeb; }
.agent-lab-fact-input-flow small { color: #64748b; }
.agent-lab-fact-input-flow p { margin: 3px 0 0; overflow-wrap: anywhere; }
.agent-lab-fact-input-flow > i { align-self: center; color: #3b82f6; font-style: normal; font-weight: 850; }
.agent-lab-fact-processing { padding: 0 12px 11px; }
.agent-lab-fact-processing-overview { padding: 11px 12px; border: 1px solid #bfdbfe; border-radius: 9px; background: #eff6ff; }
.agent-lab-fact-processing > strong { display: block; margin-bottom: 6px; color: #475569; font-size: 11px; }
.agent-lab-fact-processing > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.agent-lab-fact-processing span { position: relative; display: grid; grid-template-columns: 23px minmax(0, 1fr); align-items: center; gap: 5px; min-width: 0; padding: 7px; border: 1px solid #dbeafe; border-radius: 7px; background: #f8fafc; }
.agent-lab-fact-processing span:not(:last-child)::after { content: '→'; position: absolute; right: -7px; z-index: 1; color: #3b82f6; font-weight: 850; }
.agent-lab-fact-processing b { display: grid; grid-row: 1 / 3; width: 23px; height: 23px; place-items: center; border-radius: 50%; background: #dbeafe; color: #1d4ed8; font-size: 10px; }
.agent-lab-fact-processing em { min-width: 0; color: #334155; font-style: normal; font-weight: 750; }
.agent-lab-fact-processing small { min-width: 0; color: #64748b; overflow-wrap: anywhere; }
.agent-lab-fact-fragment-list { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px; }
.agent-lab-fact-fragment { padding: 9px; border: 1px solid #e2e8f0; border-radius: 8px; }
.agent-lab-fact-fragment-path { display: grid; grid-template-columns: minmax(0, 1fr) auto 38px; align-items: center; gap: 8px; }
.agent-lab-fact-fragment-path > span { display: flex; min-width: 0; flex-direction: column; padding: 7px 9px; border-radius: 7px; background: #f8fafc; overflow-wrap: anywhere; }
.agent-lab-fact-fragment-path small { margin-bottom: 2px; color: #64748b; }
.agent-lab-fact-fragment-path i { color: #3b82f6; font-style: normal; }
.agent-lab-fact-fragment-path strong { display: grid; width: 38px; height: 30px; place-items: center; border-radius: 7px; background: #2563eb; color: #fff; }
.agent-lab-fact-classification { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.agent-lab-fact-classification > span { display: flex; min-width: 0; flex-direction: column; padding: 7px 9px; border-radius: 7px; }
.agent-lab-fact-classification small { margin-top: 2px; overflow-wrap: anywhere; }
.agent-lab-fact-classification .is-positive { background: #ecfdf5; color: #166534; }
.agent-lab-fact-classification .is-negative { background: #fef2f2; color: #b91c1c; }
.agent-lab-fact-classification .is-observed { background: #eff6ff; color: #1d4ed8; }
.agent-lab-fact-classification .is-uncertain { background: #fffbeb; color: #92400e; }
.agent-lab-fact-discard-reason { margin: 0 12px 12px; padding: 8px; border-radius: 7px; background: #f1f5f9; color: #64748b; }
.agent-lab-fact-final-list { overflow: hidden; border: 1px solid #bfdbfe; border-radius: 10px; background: #fff; }
.agent-lab-fact-final-list > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #eff6ff; }
.agent-lab-fact-final-list > div:first-child small { color: #64748b; }
.agent-lab-fact-final-list > div:last-child { display: flex; flex-direction: column; }
.agent-lab-fact-final-list article { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; align-items: center; gap: 9px; padding: 9px 12px; }
.agent-lab-fact-final-list article + article { border-top: 1px solid #e2e8f0; }
.agent-lab-fact-final-list article > strong { display: grid; width: 38px; height: 30px; place-items: center; border-radius: 7px; background: #2563eb; color: #fff; }
.agent-lab-fact-final-list article p { margin: 0 0 3px; color: #1e293b; overflow-wrap: anywhere; }
.agent-lab-fact-final-list article code { color: #64748b; font-size: 10px; overflow-wrap: anywhere; }
.agent-lab-fact-final-list article > span { padding: 4px 7px; border-radius: 999px; font-size: 10px; white-space: nowrap; }
.agent-lab-fact-final-list article > span.is-positive { background: #ecfdf5; color: #166534; }
.agent-lab-fact-final-list article > span.is-negative { background: #fef2f2; color: #b91c1c; }
.agent-lab-fact-final-list article > span.is-observed { background: #eff6ff; color: #1d4ed8; }
.agent-lab-fact-final-list article > span.is-uncertain { background: #fffbeb; color: #92400e; }

.agent-lab-route-view { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.agent-lab-route-view-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.agent-lab-route-view-head span { color: #64748b; font-size: 11px; }
.agent-lab-route-card-list { display: flex; flex-direction: column; gap: 10px; }
.agent-lab-route-card { overflow: hidden; border: 1px solid #ddd6fe; border-radius: 10px; background: linear-gradient(180deg, #faf5ff 0, #fff 76px); }
.agent-lab-route-card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; }
.agent-lab-route-card > header > div { display: flex; min-width: 0; align-items: center; gap: 8px; }
.agent-lab-route-card > header strong { overflow-wrap: anywhere; }
.agent-lab-route-fact-id { display: grid; flex: 0 0 auto; min-width: 30px; height: 25px; padding: 0 6px; place-items: center; border-radius: 6px; background: #7c3aed; color: #fff; font-size: 11px; font-weight: 850; }
.agent-lab-route-source { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0 12px 10px; color: #64748b; font-size: 11px; }
.agent-lab-route-source code { color: #6d28d9; font-size: 10px; }
.agent-lab-route-path-list { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-top: 1px solid #ede9fe; border-bottom: 1px solid #ede9fe; background: #fff; }
.agent-lab-route-path { display: grid; grid-template-columns: minmax(120px, 1fr) auto minmax(110px, .8fr) auto minmax(110px, .8fr); align-items: center; gap: 7px; }
.agent-lab-route-path > span { display: flex; min-width: 0; min-height: 54px; flex-direction: column; justify-content: center; padding: 8px 10px; border: 1px solid #dbe4f0; border-radius: 8px; overflow-wrap: anywhere; }
.agent-lab-route-path > span small { margin-bottom: 3px; color: #64748b; font-size: 10px; }
.agent-lab-route-path > span.is-fact { border-color: #bfdbfe; background: #eff6ff; color: #1e3a8a; }
.agent-lab-route-path > span.is-concept { border-color: #c4b5fd; background: #f5f3ff; color: #5b21b6; }
.agent-lab-route-path > span.is-risk { border-color: #fecaca; background: #fff1f2; color: #9f1239; font-weight: 750; }
.agent-lab-route-path > i { color: #8b5cf6; font-style: normal; font-weight: 850; }
.agent-lab-route-path-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
.agent-lab-route-path-meta span { padding: 4px 7px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 10px; }
.agent-lab-route-explanation { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.agent-lab-route-explanation section { min-width: 0; padding: 10px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; }
.agent-lab-route-explanation h6 { margin: 0 0 8px; color: #334155; font-size: 12px; }
.agent-lab-route-explanation dl { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.agent-lab-route-explanation dl > div { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 7px; }
.agent-lab-route-explanation dt { color: #64748b; font-size: 10px; }
.agent-lab-route-explanation dd { min-width: 0; margin: 0; color: #334155; font-size: 11px; overflow-wrap: anywhere; }
.agent-lab-route-explanation dd code { padding: 2px 4px; border-radius: 4px; background: #e2e8f0; color: #334155; white-space: normal; overflow-wrap: anywhere; }
.agent-lab-route-explanation dd .badge { margin-left: 5px; }
.agent-lab-route-card > footer { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; padding: 10px 12px; }
.agent-lab-route-card > footer > div { display: flex; flex-direction: column; }
.agent-lab-route-card > footer small { color: #64748b; }
.agent-lab-route-card > footer p { margin: 0; color: #334155; overflow-wrap: anywhere; }
.agent-lab-route-note { margin: 0; padding: 8px 10px; border-left: 3px solid #8b5cf6; background: #faf5ff; color: #5b21b6; font-size: 11px; }
.agent-lab-route-empty { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; padding: 16px; border: 1px dashed #cbd5e1; border-radius: 9px; color: #64748b; text-align: center; }

.agent-lab-query-channel-view { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.agent-lab-query-channel-overview { display: grid; grid-template-columns: repeat(5, minmax(80px, 1fr)); gap: 7px; }
.agent-lab-query-channel-overview > span { display: flex; flex-direction: column; padding: 9px; border: 1px solid #e2e8f0; border-top-width: 3px; border-radius: 8px; background: #fff; text-align: center; }
.agent-lab-query-channel-overview b { color: #334155; font-size: 18px; }
.agent-lab-query-channel-overview small { color: #64748b; }
.agent-lab-query-channel-overview .is-direct { border-top-color: #2563eb; }
.agent-lab-query-channel-overview .is-evidence { border-top-color: #059669; }
.agent-lab-query-channel-overview .is-negative { border-top-color: #dc2626; }
.agent-lab-query-channel-overview .is-uncertain { border-top-color: #d97706; }
.agent-lab-query-channel-overview .is-expanded { border-top-color: #7c3aed; }
.agent-lab-query-channel-list { display: flex; flex-direction: column; gap: 10px; }
.agent-lab-query-channel { overflow: hidden; border: 1px solid #dbe4f0; border-radius: 10px; background: #fff; }
.agent-lab-query-channel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 11px 12px; border-left: 4px solid #2563eb; background: #f8fafc; }
.agent-lab-query-channel.is-evidence > header { border-left-color: #059669; }
.agent-lab-query-channel.is-negative > header { border-left-color: #dc2626; }
.agent-lab-query-channel.is-uncertain > header { border-left-color: #d97706; }
.agent-lab-query-channel.is-expanded > header { border-left-color: #7c3aed; }
.agent-lab-query-channel > header p { margin: 3px 0 0; color: #64748b; font-size: 11px; }
.agent-lab-query-channel > header > span { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: 10px; }
.agent-lab-query-channel-rule { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; padding: 8px 12px; border-top: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; background: #f8fafc; font-size: 11px; }
.agent-lab-query-channel-rule b { color: #475569; }
.agent-lab-query-channel-rule span { color: #64748b; overflow-wrap: anywhere; }
.agent-lab-query-origin-list { display: flex; flex-direction: column; }
.agent-lab-query-origin-list > article { display: grid; grid-template-columns: 34px minmax(140px, 1fr) auto minmax(130px, .8fr) auto minmax(140px, 1fr); align-items: center; gap: 8px; padding: 10px 12px; }
.agent-lab-query-origin-list > article + article { border-top: 1px solid #e2e8f0; }
.agent-lab-query-origin-list > article > i { color: #64748b; font-style: normal; font-weight: 850; }
.agent-lab-query-origin-index { display: grid; width: 32px; height: 28px; place-items: center; border-radius: 6px; background: #e2e8f0; color: #475569; font-size: 10px; font-weight: 850; }
.agent-lab-query-origin-list > article > div small { display: block; margin-bottom: 3px; color: #64748b; font-size: 10px; }
.agent-lab-query-source,
.agent-lab-query-generation,
.agent-lab-query-output { min-width: 0; }
.agent-lab-query-source p,
.agent-lab-query-generation p { margin: 3px 0; color: #475569; font-size: 11px; overflow-wrap: anywhere; }
.agent-lab-query-source code { color: #64748b; font-size: 10px; overflow-wrap: anywhere; }
.agent-lab-query-generation strong { color: #0f766e; overflow-wrap: anywhere; }
.agent-lab-query-output { padding: 8px 9px; border: 1px solid #c4b5fd; border-radius: 7px; background: #f5f3ff; }
.agent-lab-query-output strong { color: #5b21b6; overflow-wrap: anywhere; }
.agent-lab-query-channel-empty { margin: 0; padding: 12px; color: #94a3b8; font-style: italic; }

.agent-lab-v3-visual { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.agent-lab-index-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.agent-lab-index-legend > span { display: flex; flex-direction: column; padding: 9px; border: 1px solid #e2e8f0; border-top-width: 3px; border-radius: 8px; background: #fff; }
.agent-lab-index-legend b { color: #334155; }
.agent-lab-index-legend small { margin-top: 3px; color: #64748b; overflow-wrap: anywhere; }
.agent-lab-index-legend .is-positive { border-top-color: #2563eb; }
.agent-lab-index-legend .is-evidence { border-top-color: #059669; }
.agent-lab-index-legend .is-negative { border-top-color: #dc2626; }
.agent-lab-index-document-list { display: flex; flex-direction: column; gap: 8px; }
.agent-lab-index-document-list > article { overflow: hidden; border: 1px solid #dbe4f0; border-radius: 9px; }
.agent-lab-index-document-list > article > header { display: flex; justify-content: space-between; gap: 8px; padding: 9px 11px; background: #f8fafc; }
.agent-lab-index-document-list > article > header small { color: #64748b; }
.agent-lab-index-document-list > article > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.agent-lab-index-document-list section { min-width: 0; padding: 10px; border-top: 1px solid #e2e8f0; }
.agent-lab-index-document-list section + section { border-left: 1px solid #e2e8f0; }
.agent-lab-index-document-list section b { font-size: 11px; }
.agent-lab-index-document-list section p { margin: 5px 0 0; color: #475569; overflow-wrap: anywhere; }
.agent-lab-index-document-list section.is-positive b { color: #1d4ed8; }
.agent-lab-index-document-list section.is-evidence b { color: #047857; }
.agent-lab-index-document-list section.is-negative b { color: #b91c1c; }

.agent-lab-score-formula { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; padding: 9px 11px; border-radius: 8px; background: #f5f3ff; }
.agent-lab-score-formula code { color: #5b21b6; overflow-wrap: anywhere; }
.agent-lab-score-card-list,
.agent-lab-memory-score-list { display: flex; flex-direction: column; gap: 8px; }
.agent-lab-score-card-list > article,
.agent-lab-memory-score-list > article { padding: 10px; border: 1px solid #dbe4f0; border-radius: 9px; background: #fff; }
.agent-lab-score-card-list article > header,
.agent-lab-memory-score-list article > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.agent-lab-score-card-list header > div,
.agent-lab-memory-score-list header > div { display: flex; align-items: center; gap: 7px; }
.agent-lab-score-card-list header > div:first-child > span { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: #e2e8f0; font-size: 10px; }
.agent-lab-score-card-list header > div:last-child > b,
.agent-lab-memory-score-list header > div:last-child > b { color: #5b21b6; font-size: 17px; }
.agent-lab-memory-score-list header > div:first-child { align-items: flex-start; flex-direction: column; gap: 2px; }
.agent-lab-memory-score-list header > div:first-child span { color: #64748b; font-size: 11px; }
.agent-lab-score-component-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 6px; margin-top: 9px; }
.agent-lab-score-component-grid > span { display: flex; min-width: 0; flex-direction: column; padding: 7px; border-radius: 7px; background: #f8fafc; }
.agent-lab-score-component-grid small { color: #64748b; }
.agent-lab-score-component-grid b { margin: 2px 0; color: #334155; font-size: 10px; }
.agent-lab-score-component-grid em { font-style: normal; font-weight: 800; }
.agent-lab-score-component-grid .is-positive em { color: #047857; }
.agent-lab-score-component-grid .is-negative { background: #fef2f2; }
.agent-lab-score-component-grid .is-negative em { color: #b91c1c; }
.agent-lab-score-evidence { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.agent-lab-score-evidence span { padding: 4px 7px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 10px; overflow-wrap: anywhere; }

.agent-lab-guard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 8px; }
.agent-lab-guard-grid article { overflow: hidden; border: 1px solid #dbe4f0; border-top: 3px solid #10b981; border-radius: 9px; }
.agent-lab-guard-grid article.is-penalized { border-top-color: #f59e0b; }
.agent-lab-guard-grid article.is-blocked { border-top-color: #ef4444; }
.agent-lab-guard-grid header { display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px; background: #f8fafc; }
.agent-lab-guard-grid header span { color: #64748b; font-size: 10px; }
.agent-lab-guard-grid article > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 9px; }
.agent-lab-guard-grid p { display: flex; flex-direction: column; margin: 0; padding: 7px; border-radius: 6px; background: #f8fafc; }
.agent-lab-guard-grid p b { color: #64748b; font-size: 10px; }
.agent-lab-guard-grid footer { padding: 7px 10px; border-top: 1px solid #e2e8f0; color: #475569; font-size: 10px; }

.agent-lab-state-thresholds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.agent-lab-state-thresholds span { display: flex; flex-direction: column; padding: 8px; border-radius: 7px; background: #f8fafc; color: #64748b; }
.agent-lab-state-thresholds b { color: #334155; }
.agent-lab-state-list { display: flex; flex-direction: column; gap: 7px; }
.agent-lab-state-list article { overflow: hidden; border: 1px solid #dbe4f0; border-left: 4px solid #f59e0b; border-radius: 8px; }
.agent-lab-state-list article.is-supported { border-left-color: #10b981; }
.agent-lab-state-list article.is-contradicted { border-left-color: #ef4444; }
.agent-lab-state-list header { display: flex; justify-content: space-between; padding: 9px 10px; background: #f8fafc; }
.agent-lab-state-list header span { font-weight: 750; }
.agent-lab-state-list article > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 9px; }
.agent-lab-state-list article > div span { display: flex; flex-direction: column; padding: 7px; border-radius: 6px; background: #f8fafc; }
.agent-lab-state-list article > div small { margin-top: 3px; color: #64748b; overflow-wrap: anywhere; }
.agent-lab-state-list footer { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 9px 9px; }
.agent-lab-state-list footer span { padding: 4px 7px; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 10px; }

.agent-lab-rescue-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.agent-lab-rescue-metrics span { padding: 9px; border-radius: 7px; background: #f8fafc; text-align: center; }
.agent-lab-rescue-metrics b { display: block; color: #5b21b6; font-size: 18px; }
.agent-lab-rescue-section,
.agent-lab-rescue-details { overflow: hidden; border: 1px solid #dbe4f0; border-radius: 8px; }
.agent-lab-rescue-section h6,
.agent-lab-rescue-details > summary { margin: 0; padding: 9px 10px; background: #f8fafc; color: #334155; font-size: 11px; font-weight: 750; }
.agent-lab-rescue-section.is-rescued { border-color: #fcd34d; }
.agent-lab-rescue-section.is-rescued h6 { background: #fffbeb; color: #92400e; }
.agent-lab-rescue-section article,
.agent-lab-rescue-details article { display: grid; grid-template-columns: minmax(130px, 1fr) auto minmax(160px, 1fr) auto; align-items: center; gap: 8px; padding: 8px 10px; }
.agent-lab-rescue-section article + article,
.agent-lab-rescue-details article + article { border-top: 1px solid #e2e8f0; }
.agent-lab-rescue-section article > div,
.agent-lab-rescue-details article > div { display: flex; flex-direction: column; }
.agent-lab-rescue-section article small,
.agent-lab-rescue-details article small { color: #64748b; }
.agent-lab-rescue-section article p,
.agent-lab-rescue-details article p { margin: 0; color: #475569; }

.agent-lab-packet-list { display: flex; flex-direction: column; gap: 9px; }
.agent-lab-packet-list > article { overflow: hidden; border: 1px solid #c4b5fd; border-radius: 10px; }
.agent-lab-packet-list > article > header { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; background: #f5f3ff; }
.agent-lab-packet-list > article > header > div { display: flex; gap: 8px; }
.agent-lab-packet-list > article > header span { color: #6d28d9; font-weight: 750; }
.agent-lab-packet-list > article > header small { color: #64748b; }
.agent-lab-packet-evidence { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 10px; }
.agent-lab-packet-evidence section { padding: 8px; border-radius: 7px; background: #f8fafc; }
.agent-lab-packet-evidence section b { color: #64748b; font-size: 10px; }
.agent-lab-packet-evidence section p { margin: 4px 0 0; overflow-wrap: anywhere; }
.agent-lab-packet-memories { display: flex; flex-direction: column; gap: 6px; padding: 0 10px 10px; }
.agent-lab-packet-memories > span { padding: 8px; border: 1px solid #e2e8f0; border-radius: 7px; }
.agent-lab-packet-memories > span strong,
.agent-lab-packet-memories > span small { display: block; }
.agent-lab-packet-memories > span small { margin-top: 2px; color: #64748b; }
.agent-lab-packet-memories > span p { margin: 4px 0 0; }
.agent-lab-packet-list > article > details { border-top: 1px solid #e2e8f0; }
.agent-lab-packet-list > article > details > summary { padding: 8px 10px; cursor: pointer; color: #5b21b6; font-weight: 750; }
.agent-lab-packet-list .agent-lab-audit-object-list { padding: 0 10px 10px; }
.agent-lab-packet-list .agent-lab-audit-object-list > div { display: flex; justify-content: space-between; gap: 8px; padding: 7px; border-radius: 6px; background: #f8fafc; }
.agent-lab-packet-list .agent-lab-audit-object-list small { color: #64748b; }

.agent-lab-rag-step-json { margin-top: 9px; }
.agent-lab-rag-step-json > summary { cursor: pointer; color: #475569; font-weight: 700; }
.agent-lab-rag-step-json pre { max-height: 360px; overflow: auto; padding: 10px; border-radius: 7px; background: #0f172a; color: #dbeafe; white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.5 Consolas, monospace; }

.agent-lab-rag-audit-table article.is-clickable,
.agent-lab-rag-ranking article.is-clickable { cursor: pointer; }
.agent-lab-rag-audit-table article.is-clickable:hover,
.agent-lab-rag-ranking article.is-clickable:hover { border-color: #60a5fa; box-shadow: 0 4px 14px rgba(15, 23, 42, .08); }

.agent-lab-rag-trace-backdrop { position: fixed; inset: 0; z-index: 1200; display: flex; justify-content: flex-end; background: rgba(15, 23, 42, .42); }
.agent-lab-rag-trace-drawer { width: min(620px, 94vw); height: 100%; padding: 18px; overflow: auto; background: #fff; box-shadow: -12px 0 30px rgba(15, 23, 42, .2); }
.agent-lab-rag-trace-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #e2e8f0; }
.agent-lab-rag-trace-head h3 { margin: 4px 0 0; }
.agent-lab-rag-trace-result { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 10px; margin: 14px 0; padding: 11px; border-radius: 8px; background: #f8fafc; }
.agent-lab-rag-trace-result > b { font-size: 18px; }
.agent-lab-rag-trace-drawer section { margin-top: 16px; }

.agent-lab-rag-score-components { display: flex; flex-direction: column; gap: 8px; }
.agent-lab-rag-score-components article > div:first-child { display: flex; justify-content: space-between; gap: 8px; }
.agent-lab-rag-score-components article > div:last-child { height: 7px; margin-top: 4px; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.agent-lab-rag-score-components article i { display: block; height: 100%; border-radius: inherit; }
.agent-lab-rag-score-components .is-positive i { background: #10b981; }
.agent-lab-rag-score-components .is-negative i { background: #ef4444; }

.agent-lab-rag-trace-timeline { display: flex; flex-direction: column; gap: 0; }
.agent-lab-rag-trace-timeline article { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 9px; padding-bottom: 14px; }
.agent-lab-rag-trace-timeline article:not(:last-child)::after { content: ''; position: absolute; left: 14px; top: 28px; bottom: 0; width: 2px; background: #cbd5e1; }
.agent-lab-rag-trace-timeline article > span { display: grid; z-index: 1; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #dcfce7; color: #166534; font-weight: 850; }
.agent-lab-rag-trace-timeline article.is-failed > span { background: #fee2e2; color: #b91c1c; }
.agent-lab-rag-trace-timeline article.is-rescued > span { background: #fef3c7; color: #92400e; }
.agent-lab-rag-trace-timeline p { margin: 3px 0; color: #475569; }
.agent-lab-rag-trace-timeline pre { max-height: 210px; overflow: auto; white-space: pre-wrap; font-size: 11px; }

.agent-lab-plugmem-section {
    border-color: #c4b5fd;
    background: linear-gradient(180deg, #faf5ff 0%, #ffffff 56%);
}

.agent-lab-plugmem-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.agent-lab-plugmem-grid > article {
    min-width: 0;
    padding: 11px;
    border: 1px solid #e9d5ff;
    border-radius: 9px;
    background: rgba(255, 255, 255, .82);
}

.agent-lab-rag-chips span.is-uncertain {
    border-color: #fcd34d;
    background: #fffbeb;
    color: #92400e;
}

.agent-lab-rag-chips span.is-negative {
    border-color: #fecaca;
    background: #fff1f2;
    color: #b91c1c;
}

.agent-lab-plugmem-routes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.agent-lab-plugmem-routes span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    padding: 6px 8px;
    border-radius: 7px;
    background: #f5f3ff;
}

.agent-lab-plugmem-routes b { color: #6d28d9; font-size: 12px; }
.agent-lab-plugmem-routes small { color: #64748b; overflow-wrap: anywhere; }

.agent-lab-plugmem-packets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.agent-lab-plugmem-packets > article {
    min-width: 0;
    padding: 11px;
    border: 1px solid #ddd6fe;
    border-left: 4px solid #8b5cf6;
    border-radius: 9px;
    background: #fff;
}

.agent-lab-plugmem-packets > article > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.agent-lab-plugmem-packets p {
    margin: 7px 0 0;
    color: #475569;
    overflow-wrap: anywhere;
    font-size: 11px;
    line-height: 1.55;
}

@media (max-width: 900px) {
    .agent-lab-home-grid {
        grid-template-columns: 1fr;
    }

    .agent-lab-home-card {
        min-height: 138px;
    }

    .agent-lab-view-nav,
    .agent-lab-view-tabs {
        align-items: stretch;
        flex-direction: column;
    }

    .agent-lab-view-tabs .btn,
    .agent-lab-back-button {
        width: 100%;
    }

    .agent-lab-rag-picker,
    .agent-lab-rag-metrics {
        align-items: stretch;
        flex-direction: column;
    }

    .agent-lab-rag-case-summary,
    .agent-lab-rag-query-grid,
    .agent-lab-rag-deltas,
    .agent-lab-rag-compare-grid,
    .agent-lab-rag-audit-grid,
    .agent-lab-rag-audit-details,
    .agent-lab-rag-query-audit,
    .agent-lab-rag-method-overview,
    .agent-lab-plugmem-grid {
        grid-template-columns: 1fr;
    }

    .agent-lab-rag-query-audit article:first-child { grid-column: auto; }
    .agent-lab-rag-method-overview.is-focus-mode { grid-template-columns: 1fr; }
    .agent-lab-rag-focus-toolbar { align-items: flex-start; flex-direction: column; }
    .agent-lab-rag-method-card > summary { grid-template-columns: auto minmax(0, 1fr) auto; }
    .agent-lab-rag-method-count { grid-column: 2; }
    .agent-lab-rag-method-focus-btn { grid-column: 3; grid-row: 1 / span 2; }
    .agent-lab-rag-step > summary { grid-template-columns: 26px minmax(0, 1fr); }
    .agent-lab-rag-step > summary small { grid-column: 2; }
    .agent-lab-rag-transform-list article { grid-template-columns: 1fr; }
    .agent-lab-rag-transform-list article small { grid-column: auto; }
    .agent-lab-audit-fields { grid-template-columns: 1fr; }
    .agent-lab-rag-candidate-ids { grid-template-columns: 1fr; }
    .agent-lab-audit-object-list > details > summary strong { white-space: normal; }
    .agent-lab-route-view-head { align-items: flex-start; flex-direction: column; }
    .agent-lab-fact-metrics { grid-template-columns: repeat(3, minmax(74px, 1fr)); }
    .agent-lab-fact-input-flow { grid-template-columns: 1fr; }
    .agent-lab-fact-input-flow > i { transform: rotate(90deg); justify-self: center; }
    .agent-lab-fact-processing > div { grid-template-columns: 1fr; }
    .agent-lab-fact-processing span:not(:last-child)::after { right: auto; bottom: -9px; left: 50%; transform: rotate(90deg); }
    .agent-lab-fact-classification { grid-template-columns: 1fr; }
    .agent-lab-fact-final-list > div:first-child { align-items: flex-start; flex-direction: column; }
    .agent-lab-fact-final-list article { grid-template-columns: 42px minmax(0, 1fr); }
    .agent-lab-fact-final-list article > span { grid-column: auto; justify-self: start; }
    .agent-lab-route-path { grid-template-columns: 1fr; }
    .agent-lab-route-path > i { transform: rotate(90deg); text-align: center; }
    .agent-lab-route-path-meta { grid-column: auto; }
    .agent-lab-route-explanation { grid-column: auto; grid-template-columns: 1fr; }
    .agent-lab-route-explanation dl > div { grid-template-columns: 1fr; gap: 2px; }
    .agent-lab-route-card > footer { grid-template-columns: 1fr; }
    .agent-lab-query-channel-overview { grid-template-columns: repeat(2, minmax(80px, 1fr)); }
    .agent-lab-query-origin-list > article { grid-template-columns: 34px minmax(0, 1fr); }
    .agent-lab-query-origin-list > article > i { grid-column: 2; transform: rotate(90deg); justify-self: center; }
    .agent-lab-query-origin-list > article > div:not(.agent-lab-query-origin-index) { grid-column: 2; }
    .agent-lab-index-legend,
    .agent-lab-index-document-list > article > div,
    .agent-lab-state-thresholds,
    .agent-lab-rescue-metrics { grid-template-columns: 1fr; }
    .agent-lab-index-document-list section + section { border-left: 0; }
    .agent-lab-score-formula { grid-template-columns: 1fr; }
    .agent-lab-score-card-list article > header,
    .agent-lab-memory-score-list article > header,
    .agent-lab-packet-list > article > header { align-items: flex-start; flex-direction: column; }
    .agent-lab-guard-grid article > div,
    .agent-lab-state-list article > div,
    .agent-lab-packet-evidence { grid-template-columns: 1fr; }
    .agent-lab-rescue-section article,
    .agent-lab-rescue-details article { grid-template-columns: 1fr; }
    .agent-lab-packet-list .agent-lab-audit-object-list > div { align-items: flex-start; flex-direction: column; }

    .agent-lab-rag-case-summary img {
        width: 100%;
        height: 210px;
    }

    .agent-lab-rag-ranking article {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .agent-lab-rag-score {
        grid-column: 2;
        max-width: none;
        text-align: left;
    }

    .agent-lab-rag-audit-steps {
        grid-template-columns: 1fr;
    }

    .agent-lab-rag-audit-steps i { text-align: center; transform: rotate(90deg); }

    .agent-lab-rag-audit-table > article {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .agent-lab-rag-audit-decision {
        grid-column: 2;
        text-align: left;
    }

    .agent-lab-image-grid {
        grid-template-columns: 1fr;
    }

    .agent-lab-result-image {
        height: auto;
        min-height: 0;
        max-height: 460px;
    }

    .agent-lab-memory-compare,
    .agent-lab-memory-case,
    .agent-lab-memory-activity {
        grid-template-columns: 1fr;
    }

    .agent-lab-memory-thumb {
        width: 100%;
        height: 190px;
    }

    .agent-lab-experiment-design-grid,
    .agent-lab-experiment-result-grid {
        grid-template-columns: 1fr;
    }

    .agent-lab-hypothesis,
    .agent-lab-experiment-image-row {
        grid-template-columns: 1fr;
    }

    .agent-lab-experiment-image-row img {
        width: 100%;
        height: 210px;
        object-fit: contain;
    }

    .agent-lab-freeze-chip { margin-left: 0; }

    .agent-lab-io-grid { grid-template-columns: 1fr; }

    .agent-lab-io-notice { flex-direction: column; gap: 3px; }

    .agent-lab-io-flow {
        grid-template-columns: 1fr;
    }

    .agent-lab-io-flow > i {
        transform: rotate(90deg);
        text-align: center;
    }

    .agent-lab-io-session-input,
    .agent-lab-io-request-summary,
    .agent-lab-io-observation-grid,
    .agent-lab-io-query-groups,
    .agent-lab-io-decision-columns,
    .agent-lab-io-result-grid,
    .agent-lab-io-tool-details > div {
        grid-template-columns: 1fr;
    }

    .agent-lab-io-image-card { grid-row: auto; }

    .agent-lab-io-tool-flow {
        grid-template-columns: 1fr;
    }

    .agent-lab-io-tool-flow > i {
        transform: rotate(90deg);
        text-align: center;
    }

    .agent-lab-io-standard-results article,
    .agent-lab-io-memory-results article {
        grid-template-columns: 25px minmax(0, 1fr);
    }

    .agent-lab-full-packet-flow,
    .agent-lab-full-field-diff {
        grid-template-columns: 1fr;
    }

    .agent-lab-full-packet-flow i {
        transform: rotate(90deg);
        text-align: center;
    }
}
