/* ===== Poke Rey - Dark Theme Stylesheet ===== */

:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #111640;
    --bg-panel: #161b4a;
    --bg-input: #1a2050;
    --text-primary: #ffffff;
    --text-secondary: #8892b0;
    --text-muted: #5a6380;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-green: #22c55e;
    --accent-gold: #eab308;
    --accent-red: #ef4444;
    --border-color: #2a3060;
    --border-focus: #3b82f6;
    --border-success: #22c55e;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 20px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.poke-dark {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ===== Login Page ===== */
.poke-login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    background-image: radial-gradient(ellipse at 50% 40%, rgba(59,130,246,0.12) 0%, transparent 60%);
}

.poke-login-container {
    text-align: center;
    padding: 60px 40px;
    width: 100%;
}

.poke-login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
}

.poke-star-icon {
    width: 40px;
    height: 40px;
}

.poke-dots-icon {
    width: 40px;
    height: 40px;
}

.poke-divider {
    color: var(--text-muted);
    font-size: 32px;
    font-weight: 200;
}

.poke-logo-text {
    font-family: Inter;
    font-size: 44.524px;
    font-style: normal;
    font-weight: 800;
    line-height: 85px; /* 190.909% */
    letter-spacing: 12.143px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #FFF 0%, #93C5FD 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.poke-login-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.poke-login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

    .poke-login-subtitle sup {
        font-size: 9px;
    }

.btn-dlrsecured {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

    .btn-dlrsecured:hover {
        background: var(--accent-blue-hover);
    }

    .btn-dlrsecured i {
        font-size: 18px;
    }

.poke-login-footer {
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Header ===== */
.poke-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.poke-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.poke-header-dots {
    width: 24px;
    height: 24px;
}

.poke-header-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 6px;
    color: var(--text-primary);
}

.poke-header-center {
    flex: 1;
    text-align: center;
}

.poke-env-badge {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 6px;
}

    .poke-env-badge.env-staging {
        color: var(--accent-gold);
    }

    .poke-env-badge.env-prod {
        color: var(--accent-red);
    }

.poke-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== Nav Menu ===== */
.poke-nav-menu {
    position: relative;
}

.poke-hamburger {
    padding: 6px 10px;
}

.poke-nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 180px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    overflow: hidden;
}

    .poke-nav-dropdown.open {
        display: block;
    }

.poke-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

    .poke-nav-item:hover {
        background: rgba(255,255,255,0.05);
        color: var(--text-primary);
    }

    .poke-nav-item.poke-nav-active {
        color: var(--accent-blue);
        background: rgba(59,130,246,0.08);
    }

    .poke-nav-item i {
        font-size: 15px;
    }

.poke-user-email {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== Buttons ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

    .btn-primary:hover {
        background: var(--accent-blue-hover);
    }

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s;
}

    .btn-outline:hover {
        border-color: var(--text-secondary);
    }

    .btn-outline.btn-sm {
        padding: 6px 12px;
        font-size: 12px;
    }

.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s;
}

    .btn-text:hover {
        color: var(--text-primary);
    }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}

    .btn-icon:hover {
        color: var(--text-primary);
        background: rgba(255,255,255,0.05);
    }

.inline-form {
    display: inline;
}

.btn-logout {
    gap: 6px;
}

/* ===== Main Content ===== */
.poke-main {
    max-width: 1500px;
    margin: 0 auto;
    padding: 32px 24px;
}

.poke-form-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== Form Fields ===== */
.poke-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .poke-field label {
        font-size: 13px;
        font-weight: 500;
        color: var(--text-secondary);
    }

.poke-filters-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.poke-select, .poke-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-family);
    outline: none;
    transition: border-color 0.2s;
}

    .poke-select:focus, .poke-input:focus {
        border-color: var(--border-focus);
    }

    .poke-select:disabled {
        color: var(--text-muted);
        cursor: not-allowed;
    }

    .poke-select option {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }

/* Dealer Input */
.poke-dealer-input-wrapper {
    position: relative;
}

    .poke-dealer-input-wrapper.selected .poke-input {
        border-color: var(--border-success);
    }

.poke-dealer-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
}

.poke-dealer-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
}

.poke-dealer-item {
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

    .poke-dealer-item:hover {
        background: rgba(59,130,246,0.15);
    }

.poke-dealer-item-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.poke-dealer-item-cif {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Prompt */
.poke-prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.poke-textarea-wrapper {
    position: relative;
}

.poke-textarea {
    width: 100%;
    padding: 12px 14px;
    padding-bottom: 40px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-family);
    resize: vertical;
    outline: none;
    min-height: 150px;
    transition: border-color 0.2s;
}

    .poke-textarea:focus {
        border-color: var(--border-focus);
    }

    .poke-textarea::placeholder {
        color: var(--text-muted);
    }

.poke-textarea-actions {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
}

.poke-send-row {
    text-align: center;
}

/* Inside the Ask-your-own-question workspace the send row also carries the dealer nudge chip. */
.poke-workspace-section .poke-send-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

/* ===== Response Area ===== */
.poke-response-area {
    margin-top: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.poke-response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.poke-response-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--accent-blue);
}

.poke-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-blue);
    animation: pulse 1.5s infinite;
}

    .poke-status-dot.complete {
        background: var(--accent-green);
        animation: none;
    }

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.poke-response-tabs {
    display: flex;
    gap: 4px;
}

.poke-tab {
    padding: 6px 10px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

    .poke-tab.active {
        background: rgba(59,130,246,0.15);
        border-color: var(--accent-blue);
        color: var(--text-primary);
    }

.poke-tab-content {
    padding: 16px;
}

    .poke-tab-content:not(.active) {
        display: none;
    }

.poke-response-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.poke-raw-section {
    margin-bottom: 16px;
}

    .poke-raw-section h4 {
        font-size: 13px;
        font-weight: 600;
        color: var(--text-secondary);
        margin-bottom: 8px;
    }

.poke-tool-columns {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

    /* Each "Only in" section is an equal-width column; min-width:0 lets wide tables
       shrink/scroll instead of blowing out the flex layout. The Shared section sits
       outside this container and keeps its full-width block layout. */
    .poke-tool-columns > .poke-raw-section {
        flex: 1 1 0;
        min-width: 0;
        overflow-x: auto;
    }

.poke-section-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

/* Spaces the per-row Test/Add buttons so they don't touch; wraps in narrow columns. */
.poke-action-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.poke-checkbox-cell {
    width: 28px;
    text-align: center;
}
/* Inline info icon with a CSS-only hover/focus tooltip. Used to flag operator-facing
   caveats (e.g. the top-5 truncation limitation) without cluttering the layout. */
.poke-info-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    color: #2196f3;
    cursor: help;
    vertical-align: middle;
}

    .poke-info-tip i {
        font-size: 14px;
        line-height: 1;
    }

    .poke-info-tip::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: calc(100% + 8px);
        left: 0;
        width: 280px;
        padding: 10px 12px;
        background: var(--bg-input);
        border: 1px solid rgba(33, 150, 243, 0.4);
        border-radius: var(--radius-sm);
        color: var(--text-primary);
        font-size: 12px;
        font-weight: 400;
        line-height: 1.4;
        text-transform: none;
        letter-spacing: normal;
        white-space: normal;
        text-align: left;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.15s ease;
        z-index: 100;
        pointer-events: none;
    }

    .poke-info-tip:hover::after,
    .poke-info-tip:focus::after {
        opacity: 1;
        visibility: visible;
    }

.poke-code-block {
    background: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 12px;
    color: #e6edf3;
    overflow-x: auto;
    white-space: pre;
    max-height: 400px;
    overflow-y: auto;
}

.poke-response-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.poke-response-feedback {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

.poke-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
}

    .poke-status-badge.success {
        background: rgba(34,197,94,0.15);
        color: var(--accent-green);
        border: 1px solid rgba(34,197,94,0.3);
    }

    .poke-status-badge.error {
        background: rgba(239,68,68,0.15);
        color: var(--accent-red);
        border: 1px solid rgba(239,68,68,0.3);
    }

/* ===== Modal ===== */
.poke-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.poke-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.poke-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

    .poke-modal-header h3 {
        font-size: 18px;
        font-weight: 600;
    }

    .poke-modal-header .btn-icon {
        font-size: 24px;
    }

.poke-dealer-list {
    overflow-y: auto;
    flex: 1;
    margin-top: 12px;
}

/* ===== Log Filters ===== */
.poke-log-filters {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

    .poke-log-filters .poke-field:last-child {
        grid-column: span 4;
    }

    .poke-log-filters .poke-field label {
        display: block;
        margin-bottom: 6px;
    }

.poke-log-response-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.poke-filter-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-poke-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

    .btn-poke-export:hover:not(:disabled) {
        background: var(--accent-blue-hover);
    }

    .btn-poke-export:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

    .btn-poke-export.btn-poke-export-sm {
        padding: 6px 12px;
        font-size: 12px;
    }

.poke-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    font-family: var(--font-family);
}

    .poke-filter-pill:hover {
        color: var(--text-primary);
        border-color: var(--text-secondary);
    }

    .poke-filter-pill.active {
        background: rgba(59,130,246,0.15);
        color: var(--accent-blue);
        border-color: var(--accent-blue);
    }

/* ===== Log Table ===== */
.poke-log-container {
    overflow-x: auto;
}

.poke-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .poke-log-table th {
        text-align: left;
        padding: 12px 10px;
        border-bottom: 1px solid var(--border-color);
        color: var(--text-secondary);
        font-weight: 500;
        white-space: nowrap;
    }

    .poke-log-table td {
        padding: 12px 10px;
        border-bottom: 1px solid rgba(42,48,96,0.5);
        color: var(--text-primary);
    }

.poke-log-time {
    color: var(--text-muted);
    font-size: 12px;
}

.poke-log-tool-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.poke-log-row-clickable {
    cursor: pointer;
}

.poke-log-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

.poke-log-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 16px !important;
}

.poke-parameter-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: rgba(245, 166, 35, 0.12);
    border: 1px solid rgba(245, 166, 35, 0.4);
    border-radius: var(--radius-sm);
    color: #f5a623;
    font-size: 13px;
    line-height: 1.4;
}

    .poke-parameter-warning i {
        font-size: 16px;
        flex-shrink: 0;
    }

/* Informational variant used when a deterministic temporal auto-correct fires.
   Distinct from .poke-parameter-warning so operators can tell at a glance that
   the mutation was a safe, explainable correction rather than a hallucinated-key strip. */
.poke-parameter-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: rgba(33, 150, 243, 0.10);
    border: 1px solid rgba(33, 150, 243, 0.4);
    border-radius: var(--radius-sm);
    color: #2196f3;
    font-size: 13px;
    line-height: 1.4;
}

    .poke-parameter-info i {
        font-size: 16px;
        flex-shrink: 0;
    }

/* ── Certification (Phase C) ─────────────────────────────────────────────────
   Cert badges/banner mirror the runtime serving gate (medal + would-prod-serve),
   surfaced in the tool picker so testers see a tool's gated state (ReyTest lists
   tools with the policy filter OFF). */
.poke-cert-chip {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.poke-cert-chip-serve { background: rgba(34,197,94,0.15); color: #22c55e; }
.poke-cert-chip-withheld { background: rgba(239,68,68,0.15); color: #ef4444; }

.poke-cert-banner {
    margin-top: 10px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
}

.poke-cert-banner-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.poke-cert-serve { font-weight: 600; }
.poke-cert-serve-yes { color: #22c55e; }
.poke-cert-serve-no { color: #ef4444; }

.poke-cert-status { font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.poke-cert-status::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.poke-status-active { color: #22c55e; }
.poke-status-active::before { background: #22c55e; }
.poke-status-blocked { color: #ef4444; }
.poke-status-blocked::before { background: #ef4444; }

.poke-cert-verdict-gold { background: rgba(245,166,35,0.16); color: #f5a623; }
.poke-cert-verdict-silver { background: rgba(148,163,184,0.18); color: #cbd5e1; }
.poke-cert-verdict-bronze { background: rgba(180,120,80,0.18); color: #d08b5b; }

.poke-cert-warn { margin-top: 6px; color: #ef4444; font-size: 12px; }
.poke-cert-note { margin-top: 6px; color: #2196f3; font-size: 12px; }
.poke-cert-action { background: rgba(245,166,35,0.12); color: #f5a623; font-size: 12px; }

.poke-cert-hash-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 12px; }
.poke-cert-hash-table th { text-align: left; padding: 3px 8px 3px 0; color: var(--text-muted); font-weight: 500; }
.poke-cert-hash-table td { padding: 3px 8px 3px 0; }
.poke-cert-hash-label { color: var(--text-muted); font-weight: 500; }
.poke-cert-hash-val { font-family: monospace; color: var(--text); }

.poke-cert-drift-section { margin-top: 8px; }
.poke-cert-drift-title { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.poke-cert-drift-list { margin: 4px 0 0; padding-left: 18px; font-size: 12px; color: var(--text); }
.poke-cert-drift-list li { margin-bottom: 2px; }

.poke-result-status { font-size: 15px; font-weight: 600; padding: 8px 0; }
.poke-result-ok { color: #22c55e; }
.poke-result-err { color: #ef4444; }
.poke-result-chip { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; margin-bottom: 8px; }
.poke-result-warn { background: rgba(245,166,35,0.12); color: #f5a623; }
.poke-result-error { padding: 8px 12px; margin-bottom: 8px; border-radius: 4px; background: rgba(239,68,68,0.08); color: #ef4444; font-size: 13px; }
.poke-result-section { margin-top: 12px; }
.poke-result-section-label { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.poke-result-section-hint { font-weight: 400; font-size: 11px; color: var(--text-muted); margin-left: 8px; }

.poke-cert-block { margin-bottom: 14px; }
.poke-cert-block:last-child { margin-bottom: 0; }
.poke-cert-h { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.poke-cert-muted { color: var(--text-muted); font-weight: 400; font-size: 12px; }
.poke-cert-list { margin: 0; padding-left: 20px; }
.poke-cert-list li { margin: 3px 0; }
.poke-cert-call { font-size: 12px; word-break: break-all; }

/* Context row: Server → Dealer → Tool, the three prerequisites of any test, in order. */
.poke-context-row { grid-template-columns: 1fr 1.2fr 1.2fr; }
.poke-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-right: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    font-size: 11px;
    font-weight: 700;
}
@media (max-width: 900px) {
    .poke-context-row { grid-template-columns: 1fr; }
}

/* Testing workspace sections inside the tool card (Test questions / Ask your own question):
   always visible, header + content — unlike the collapsible reference sections below them. */
.poke-workspace-section {
    margin-top: 14px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
}
.poke-workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 600;
    font-size: 14px;
}
.poke-workspace-blurb { margin: 6px 0 10px; font-size: 12px; line-height: 1.45; }

/* Test questions: one expandable row per certified question. Summary = status + question + Run;
   body (auto-opened when a run finishes) = "Certified question" card + "Run result" card. */
.poke-qsi-list { display: flex; flex-direction: column; gap: 8px; }
.poke-qsi-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
}
.poke-qsi-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    list-style: none;
}
.poke-qsi-row::-webkit-details-marker { display: none; }
.poke-qsi-q { flex: 1; font-size: 13px; line-height: 1.4; }
/* Role / category chips on a question row (cert exemplar metadata), matching the cert-chip look. */
.poke-qsi-chip {
    flex-shrink: 0;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.poke-qsi-role { background: rgba(88,166,255,0.12); color: #58a6ff; }
.poke-qsi-category { background: rgba(163,113,247,0.12); color: #a371f7; }
/* TEST-ONLY badge: Pool=false exemplars live on the cert for replay only (never fed to QSI search). */
.poke-qsi-testonly {
    flex-shrink: 0;
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px dashed rgba(210,153,34,0.5);
    color: var(--warning, #d29922);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.poke-qsi-status {
    flex-shrink: 0;
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.poke-qsi-status-ok { border-color: rgba(63,185,80,0.5); color: var(--success, #3fb950); }
.poke-qsi-status-warn { border-color: rgba(210,153,34,0.5); color: var(--warning, #d29922); }
.poke-qsi-status-err { border-color: rgba(248,81,73,0.5); color: var(--danger, #f85149); }
.poke-qsi-btns { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.poke-qsi-replay { white-space: nowrap; }
.poke-qsi-body { padding: 0 12px 10px; border-top: 1px solid rgba(255,255,255,0.06); }
.poke-qsi-body > :first-child { margin-top: 8px; }
.poke-qsi-result { margin-top: 6px; font-size: 13px; }
.poke-qsi-result-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 600; }
.poke-qsi-sub { margin: 8px 0 3px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.poke-qsi-pre { margin: 0; max-height: 260px; overflow: auto; white-space: pre-wrap; }
.poke-qsi-raw { margin-top: 8px; }
.poke-qsi-raw summary { cursor: pointer; font-size: 12px; color: var(--text-muted); }
.poke-qsi-called { display: flex; flex-wrap: wrap; gap: 6px; }
.poke-qsi-called .poke-cert-chip { margin-left: 0; }

/* QSI exemplar row extras: cert hint, expected outcome, and known-good args. */
.poke-qsi-hint { margin-top: 8px; font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.poke-qsi-expected { margin-top: 6px; font-size: 12px; line-height: 1.4; }
.poke-qsi-sub-label { font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-size: 11px; }
.poke-qsi-known-args { margin-top: 6px; }
.poke-qsi-known-args summary { cursor: pointer; font-size: 12px; color: var(--text-muted); }

/* Expanded QSI row = two cards. Card 1 "Certified question" is the static teaching info
   (visually quiet — reference material); card 2 "Run result" is the live output of the last
   run (accent left border) and is replaced in place on re-run. */
.poke-qsi-card {
    margin-top: 8px;
    padding: 8px 12px 10px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
}
.poke-qsi-card-question { background: rgba(255,255,255,0.015); }
.poke-qsi-card-result {
    background: rgba(88,166,255,0.045);
    border-left: 3px solid rgba(88,166,255,0.55);
}
.poke-qsi-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.poke-qsi-card-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}
/* Envelope chips ride the result card's header strip — cancel their block spacing there. */
.poke-qsi-result-head .poke-data-chips { margin: 0; }
/* Sections inside the run-result card (Data open by default; Args / Parity notes collapsed
   diagnostics): the <summary> is the section's small muted header. */
.poke-qsi-details { margin-top: 10px; }
.poke-qsi-details > summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* QSI run-all battery toolbar + tally. */
.poke-qsi-toolbar { display: flex; align-items: center; gap: 12px; }
.poke-qsi-run-summary { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* Dealer-gating flash: a guarded run click points the tester at the dealer picker. */
.poke-flash { animation: poke-flash-anim 0.4s ease-in-out 3; border-radius: var(--radius-sm); }
@keyframes poke-flash-anim {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 0 3px rgba(210,153,34,0.55); }
}

/* Structured MCP envelope view: row/warning chips, warning banners, and the data grid. */
.poke-data-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; }
.poke-data-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}
.poke-data-chip-ok { border-color: rgba(63,185,80,0.5); color: var(--success, #3fb950); }
.poke-data-chip-warn { border-color: rgba(210,153,34,0.5); color: var(--warning, #d29922); }
.poke-data-warning {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 4px 0;
    padding: 6px 10px;
    border: 1px solid rgba(210,153,34,0.4);
    border-radius: var(--radius-sm);
    background: rgba(210,153,34,0.08);
    font-size: 12px;
    line-height: 1.4;
}
.poke-data-grid-wrap { max-height: 320px; overflow: auto; margin-top: 6px; border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-sm); }
.poke-data-grid { width: 100%; border-collapse: collapse; font-size: 12px; }
.poke-data-grid th, .poke-data-grid td {
    padding: 4px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.poke-data-grid th {
    position: sticky;
    top: 0;
    background: var(--bg-elevated, #1c2128);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 11px;
}
.poke-data-grid-note { margin-top: 4px; font-size: 11px; }
.poke-col-secondary { display: none; }
.poke-col-secondary.poke-col-show { display: table-cell; }
.poke-toggle-cols { margin-top: 4px; font-size: 12px; cursor: pointer; }

/* Args comparison: exemplar's known-good args vs the args Fusion built for this replay. */
.poke-qsi-arg-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.poke-qsi-arg-table th, .poke-qsi-arg-table td {
    padding: 4px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    vertical-align: top;
    word-break: break-word;
}
.poke-qsi-arg-table th { font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-size: 11px; }
.poke-qsi-arg-mark { width: 18px; font-weight: 700; }
.poke-qsi-arg-match .poke-qsi-arg-mark { color: var(--success, #3fb950); }
.poke-qsi-arg-diff .poke-qsi-arg-mark { color: var(--warning, #d29922); }
.poke-qsi-arg-missing .poke-qsi-arg-mark { color: var(--danger, #f85149); }
.poke-qsi-arg-extra .poke-qsi-arg-mark { color: var(--warning, #d29922); }
.poke-qsi-arg-note { margin-top: 4px; font-size: 11px; }

.poke-log-footer {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 16px;
}

.btn-poke-again {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

    .btn-poke-again:hover:not(:disabled) {
        background: var(--accent-blue-hover);
    }

    .btn-poke-again:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

/* ===== Prompt Report Filters ===== */
.poke-report-filters {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 16px;
    margin-bottom: 24px;
    align-items: end;
}

    .poke-report-filters .poke-field label {
        display: block;
        margin-bottom: 6px;
    }

.poke-field-btn {
    display: flex;
    align-items: flex-end;
}

.poke-report-btn-group {
    display: flex;
    gap: 8px;
}

.btn-poke-search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    height: 42px;
    transition: background 0.15s;
}

    .btn-poke-search:hover:not(:disabled) {
        background: var(--accent-blue-hover);
    }

    .btn-poke-search:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

/* ===== Log Detail Page ===== */
.poke-detail-info-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.poke-detail-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.poke-detail-value {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.poke-detail-prompt {
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
    white-space: pre-wrap;
    min-height: 60px;
}

.btn-icon.feedback-disabled,
.btn-icon:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== Error Page ===== */
.poke-error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 16px;
    text-align: center;
}

    .poke-error-container code {
        background: var(--bg-input);
        padding: 4px 8px;
        border-radius: var(--radius-sm);
        font-size: 12px;
    }

/* ===== Prism.js overrides — keep our code block chrome, let Prism handle token colors ===== */
/* Prism's pre[class*="language-"] selector has specificity (0,1,1); we need (0,2,1) to win */
pre.poke-code-block[class*="language-"] {
    background: #0d1117;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin: 0;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 12px;
    text-shadow: none;
}

    pre.poke-code-block[class*="language-"] > code {
        background: none;
        font-family: inherit;
        font-size: inherit;
        text-shadow: none;
        padding: 0;
    }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .poke-filters-row {
        grid-template-columns: 1fr;
    }

    .poke-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .poke-header-center {
        order: 3;
        flex-basis: 100%;
    }

    .poke-login-title {
        font-size: 36px;
    }
}

/* ===== Tool Card ===== */
.poke-tool-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin: 12px 0 20px;
}

.poke-tool-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.poke-tool-card-titleblock {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.poke-tool-card-title {
    color: var(--accent-blue);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    word-break: break-word;
}

.poke-tool-card-name {
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-all;
}

.poke-tool-card-annotations {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.poke-annotation-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 500;
    text-transform: lowercase;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.poke-annotation-badge.poke-annotation-on {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.5);
    color: #93c5fd;
}

.poke-annotation-badge.poke-annotation-off {
    opacity: 0.6;
}

.poke-tool-card-section {
    margin-bottom: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

    .poke-tool-card-section[open] > .poke-tool-card-section-header {
        border-bottom: 1px solid var(--border-color);
    }

.poke-tool-card-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    list-style: none;
}

    .poke-tool-card-section-header::-webkit-details-marker {
        display: none;
    }

    .poke-tool-card-section-header::before {
        content: '\25B8'; /* right-pointing triangle */
        display: inline-block;
        font-size: 10px;
        color: var(--text-muted);
        transition: transform 0.15s ease;
    }

.poke-tool-card-section[open] > .poke-tool-card-section-header::before {
    transform: rotate(90deg);
}

.poke-tool-card-section-header:hover {
    color: var(--text-primary);
}

.poke-tool-card-section-body {
    padding: 10px 12px 12px;
}

.poke-tool-card-description {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
}

.poke-tool-card-description-body {
    margin: 0;
    white-space: pre-wrap;
}

.poke-tool-card-description-subsection {
    margin-top: 10px;
}

    .poke-tool-card-description-subsection:first-child {
        margin-top: 0;
    }

.poke-tool-card-description-subheader {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.poke-description-override {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.poke-override-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
}

    .poke-override-toggle input {
        cursor: pointer;
    }

.poke-override-editor {
    margin-top: 10px;
}

.poke-override-hint {
    margin: 0 0 6px;
    font-size: 11px;
    color: var(--text-secondary);
}

.poke-param-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

    /* Fixed column shares: Name | Data Type | Required | Enum Values | Description */
    .poke-param-table th:nth-child(1),
    .poke-param-table td:nth-child(1) { width: 22%; }

    .poke-param-table th:nth-child(2),
    .poke-param-table td:nth-child(2) { width: 12%; }

    .poke-param-table th:nth-child(3),
    .poke-param-table td:nth-child(3) { width: 8%; }

    .poke-param-table th:nth-child(4),
    .poke-param-table td:nth-child(4) { width: 16%; }

    .poke-param-table th:nth-child(5),
    .poke-param-table td:nth-child(5) { width: 42%; }

    .poke-param-table th,
    .poke-param-table td {
        text-align: left;
        padding: 8px 10px;
        border-bottom: 1px solid var(--border-color);
        vertical-align: top;
        overflow-wrap: break-word;
    }

    .poke-param-table thead th {
        background: rgba(255, 255, 255, 0.03);
        color: var(--text-secondary);
        font-weight: 600;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .poke-param-table tbody tr:last-child td {
        border-bottom: none;
    }

    .poke-param-table tbody tr:hover td {
        background: rgba(255, 255, 255, 0.02);
    }

.poke-param-name {
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    color: var(--accent-blue);
    word-break: break-all;
}

/* Nested object/array members sit one level in, with a muted tone and a guide line. */
.poke-param-nested {
    color: var(--text-secondary);
    border-left: 2px solid var(--border-color);
}

.poke-required-yes {
    color: #f87171;
    font-weight: 600;
}

.poke-required-no {
    color: var(--text-muted);
}

.poke-enum-cell {
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    color: var(--text-secondary);
    word-break: break-word;
}


/* Args-fidelity verdict chip on the run-result header (structural divergence = the contrast-question signal). */
.poke-args-chip { margin-left: 6px; }
.poke-args-diverged { background: rgba(245, 158, 11, 0.14); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.4); }
.poke-args-soft { background: rgba(148, 163, 184, 0.12); color: var(--text-muted); border: 1px solid rgba(148, 163, 184, 0.3); }
.poke-args-match { background: rgba(34, 197, 94, 0.12); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.35); }
