/* Owner-bound adapter console; JSON is rendered as text, never executable HTML. */
.studio-adapters { padding: 1rem; margin-bottom: 1.5rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); }
.studio-adapters label, .studio-adapters textarea, .studio-adapters select { display: block; width: 100%; }
.studio-adapters input[type="checkbox"] { width: auto; }
.studio-adapters .adapter-field, .studio-adapters details { margin: 1rem 0; }
.studio-adapters button { margin: .4rem .4rem .4rem 0; }
.studio-adapters pre, .studio-adapter-dialog pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 30rem; overflow: auto; }
.studio-adapters textarea { box-sizing: border-box; resize: vertical; }
.studio-adapters .adapter-profile-help,
.studio-adapters .adapter-profile-result { margin: 1rem 0; padding: 1rem; border-left: 3px solid var(--brand-primary); background: var(--bg-surface-hover); }
.studio-adapters .adapter-profile-result dl { display: grid; grid-template-columns: minmax(8rem, auto) minmax(0, 1fr); gap: .35rem 1rem; }
.studio-adapters .adapter-profile-result dt { font-weight: 600; }
.studio-adapters .adapter-profile-result dd { margin: 0; overflow-wrap: anywhere; }
.studio-adapters .adapter-profile-result li { overflow-wrap: anywhere; }
.studio-adapters .adapter-artifacts { margin: 1rem 0; }
.studio-adapters .adapter-artifact-card {
    max-width: 44rem;
    margin: .75rem 0;
    padding: 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
}
.studio-adapters .adapter-artifact-card h4 { margin-top: 0; overflow-wrap: anywhere; }
.studio-adapters .adapter-artifact-card dl {
    display: grid;
    grid-template-columns: minmax(7rem, auto) minmax(0, 1fr);
    gap: .3rem .75rem;
}
.studio-adapters .adapter-artifact-card dt { font-weight: 600; }
.studio-adapters .adapter-artifact-card dd { margin: 0; overflow-wrap: anywhere; }
.studio-adapter-dialog { width: min(42rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; overscroll-behavior: contain; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 1.5rem; background: var(--bg-surface); color: var(--text-main); }
.studio-adapter-dialog::backdrop { background: rgb(15 23 42 / 80%); }
.studio-adapter-dialog button { margin: .5rem; }
.studio-adapters :focus-visible, .studio-adapter-dialog :focus-visible { outline: var(--ui-focus-outline-width) solid var(--brand-primary); outline-offset: var(--ui-focus-outline-width); }
.main-content, .content-body, .panel, .panel-body { min-width: 0; }
#studio-request-status {
    padding: .75rem;
    margin-bottom: .75rem;
    border: 1px solid currentColor;
    border-radius: .5rem;
    overflow-wrap: anywhere;
}
#studio-refresh { margin-bottom: .75rem; }
:focus-visible { outline: var(--ui-focus-outline-width) solid var(--brand-primary); outline-offset: var(--ui-focus-outline-width); }
#main-content-anchor:focus { display: block; }
@media (max-width: 480px) {
    .content-header, .content-body { padding: 12px; }
    .main-content input, .main-content select, .main-content textarea { max-width: 100%; font-size: 16px; }
    .main-content pre { max-width: 100%; overflow: auto; }
    .main-content .flex { flex-wrap: wrap; }
    .main-content button, .sidebar .nav-item { min-height: 44px; }
    .main-content .btn { white-space: normal; overflow-wrap: anywhere; }
    .main-content { overflow-wrap: anywhere; }
    .main-content table { display: block; max-width: 100%; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.studio-language {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.studio-language .form-control {
    width: auto;
    min-width: 7rem;
    padding: 0.35rem 0.5rem;
}
:root {
    /* Color Palette - Global AI Technical Dark Mode */
    --bg-base: #0f172a; /* slate-900 */
    --bg-surface: #1e293b; /* slate-800 */
    --bg-surface-hover: #334155; /* slate-700 */
    --border-subtle: #334155; /* slate-700 */
    --border-strong: #475569; /* slate-600 */

    --text-main: var(--ui-text-color, #f8fafc);
    --text-muted: var(--ui-muted-color, #94a3b8);
    --text-inverted: #0f172a;

    --brand-primary: #f59e0b; /* amber-500 */
    --brand-primary-hover: #d97706; /* amber-600 */

    --status-candidate: #f59e0b; /* Amber */
    --status-candidate-bg: rgba(245, 158, 11, 0.15);
    --status-candidate-border: rgba(245, 158, 11, 0.3);

    --status-accepted: #10b981; /* Emerald */
    --status-accepted-bg: rgba(16, 185, 129, 0.15);
    --status-accepted-border: rgba(16, 185, 129, 0.3);

    --status-error: #ef4444; /* Red */
    --status-error-bg: rgba(239, 68, 68, 0.15);
    --status-error-border: rgba(239, 68, 68, 0.3);

    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);

    --ui-control-min-height: 44px;
    --ui-focus-outline-width: 3px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    font-size: var(--ui-base-font-size, 14px);
    -webkit-font-smoothing: antialiased;
    min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--brand-primary);
    color: var(--text-inverted);
    padding: 0.5rem 1rem;
    z-index: 1000;
    transition: top 0.2s;
    font-weight: 500;
    text-decoration: none;
    border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus {
    top: 0;
    outline: var(--ui-focus-outline-width, 3px) solid var(--status-candidate);
}

/* Typography */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.025em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
p { color: var(--text-muted); font-size: 0.875rem; }

/* Layouts */
.layout-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.auth-card {
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-subtle);
    width: 100%;
    max-width: 400px;
}

.auth-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-header h1 {
    margin-bottom: 0.25rem;
}

.layout-main {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Ensure focus states on layout wrappers are hidden */
.main-content:focus {
    outline: none;
}

.sidebar {
    width: 260px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    min-height: var(--ui-control-min-height, 44px);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.nav-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-main);
}

.nav-item.active {
    background-color: var(--bg-surface-hover);
    color: var(--brand-primary);
    border-right: 3px solid var(--brand-primary);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-base);
}

.content-header {
    padding: 1.25rem 2rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-body {
    flex: 1;
    min-width: 0;
    padding: 2rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background-color: var(--bg-surface);
    color: var(--text-main);
    min-height: var(--ui-control-min-height, 44px);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 var(--ui-focus-outline-width, 3px) rgba(245, 158, 11, 0.2);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-control.font-mono {
    font-family: var(--font-mono);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
    font-family: var(--font-sans);
    min-height: var(--ui-control-min-height, 44px);
}

.btn-primary {
    background-color: var(--brand-primary);
    color: var(--text-inverted);
}

.btn-primary:hover {
    background-color: var(--brand-primary-hover);
}

.btn-secondary {
    background-color: var(--bg-surface);
    border-color: var(--border-strong);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--bg-surface-hover);
}

.btn-success {
    background-color: var(--status-accepted);
    color: var(--text-inverted);
}

.btn-warning {
    background-color: var(--status-candidate);
    color: var(--text-inverted);
}

.btn-danger {
    background-color: var(--status-error);
    color: var(--text-inverted);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Cards & Panels */
.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.panel-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.panel-body {
    padding: 1.5rem;
}

/* Data Tables / Lists */
.data-list {
    display: flex;
    flex-direction: column;
}

.data-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    background: var(--bg-surface);
    transition: background-color 0.15s;
}

.data-item:last-child {
    border-bottom: none;
}

.data-item:hover {
    background: var(--bg-surface-hover);
}

.data-item-content {
    flex: 1;
    min-width: 0;
}

.data-item-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-gray { background: var(--bg-surface-hover); color: var(--text-muted); border: 1px solid var(--border-strong); }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-amber { background: var(--status-candidate-bg); color: var(--status-candidate); border: 1px solid var(--status-candidate-border); }
.badge-green { background: var(--status-accepted-bg); color: var(--status-accepted); border: 1px solid var(--status-accepted-border); }
.badge-red { background: var(--status-error-bg); color: var(--status-error); border: 1px solid var(--status-error-border); }

/* Job Result Display */
.result-box {
    margin-top: 1.5rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.result-header {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid;
}

.result-content {
    padding: 1rem;
    background: var(--bg-surface);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 500px;
    overflow-y: auto;
}

.batch-prompt-box {
    max-height: 100px;
    overflow-y: auto;
}

.result-error {
    border-color: var(--status-error-border);
}
.result-error .result-header {
    background: var(--status-error-bg);
    color: var(--status-error);
    border-bottom-color: var(--status-error-border);
}

.result-candidate {
    border-color: var(--status-candidate-border);
}
.result-candidate .result-header {
    background: var(--status-candidate-bg);
    color: var(--status-candidate);
    border-bottom-color: var(--status-candidate-border);
}

.result-accepted {
    border-color: var(--status-accepted-border);
}
.result-accepted .result-header {
    background: var(--status-accepted-bg);
    color: var(--status-accepted);
    border-bottom-color: var(--status-accepted-border);
}

/* Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.m-0 { margin: 0; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.border-bottom { border-bottom: 1px solid var(--border-subtle); }
.text-right { text-align: right; }
.hidden { display: none !important; }
.w-100 { width: 100%; }

.border { border: 1px solid var(--border-subtle); }
.rounded { border-radius: var(--radius-sm); }
.text-sm { font-size: 0.875rem; }
.text-brand { color: var(--brand-primary); }

.job-file-item {
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
}

.job-row,
.job-file-item {
    touch-action: manipulation;
}

.nav-item:focus-visible,
.job-row:focus-visible,
.job-file-item:focus-visible,
.btn:focus-visible,
.phone-nav-toggle:focus-visible {
    outline: var(--ui-focus-outline-width, 3px) solid var(--brand-primary);
    outline-offset: 2px;
}

.job-file-item:hover {
    background: var(--bg-surface-hover);
}

.job-file-viewer {
    border-top: 1px solid var(--border-subtle);
    white-space: pre-wrap;
    overflow: auto;
    overflow-wrap: anywhere;
    padding: 1rem;
}

.status-pre {
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 100%;
    max-height: 60vh;
    overflow: auto;
    background: var(--bg-surface);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.status-error-box {
    background: var(--status-error-bg);
    border: 1px solid var(--status-error-border);
    color: var(--status-error);
}

.stt-options-box {
    background: var(--bg-surface-hover);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-strong);
}

.bg-surface {
    background: var(--bg-surface);
}

.input-sm {
    width: 200px;
    padding: 0.25rem;
    font-size: 0.75rem;
}

.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.text-pre { white-space: pre; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.text-xs { font-size: 0.75rem; }
.phone-nav-toggle,
.phone-nav-scrim {
    display: none;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.workflow-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
    padding: 0;
    list-style: none;
}
.workflow-steps li {
    padding: 0.55rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
}
.workflow-steps li[data-state="unsupported"] {
    border-style: dashed;
    color: var(--status-warning);
}

@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        min-height: 100%;
        overflow-x: hidden;
    }
    body.phone-nav-open {
        overflow: hidden;
    }
    .layout-main {
        position: relative;
        display: block;
        height: var(--phone-viewport-height, 100dvh);
        min-height: 100dvh;
        overflow: hidden;
    }
    .sidebar {
        position: fixed;
        z-index: 80;
        inset: 0 auto 0 0;
        width: min(86vw, 320px);
        height: var(--phone-viewport-height, 100dvh);
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        border-right: 1px solid var(--border-subtle);
        box-shadow: var(--shadow-md);
        transform: translateX(-105%);
        visibility: hidden;
        transition: transform 180ms ease, visibility 0s linear 180ms;
        overflow: hidden;
    }
    body.phone-nav-open .sidebar {
        transform: translateX(0);
        visibility: visible;
        transition-delay: 0s;
    }
    .sidebar-header {
        padding: 1rem;
    }
    .sidebar-nav {
        display: block;
        overflow: auto;
        padding: 0.5rem 0;
        overscroll-behavior: contain;
    }
    .nav-item {
        border-right: none;
        border-left: 3px solid transparent;
        min-height: 48px;
        padding: 0.75rem 1rem;
        white-space: normal;
    }
    .nav-item.active {
        border-right: none;
        border-left-color: var(--brand-primary);
    }
    .nav-item:hover {
        background: transparent;
        color: var(--text-muted);
    }
    .nav-item.active:hover {
        background: var(--bg-surface-hover);
        color: var(--brand-primary);
    }
    .phone-nav-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid var(--border-strong);
        border-radius: var(--radius-md);
        background: var(--bg-surface);
        color: var(--text-main);
        font: inherit;
        font-size: 1.25rem;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        touch-action: manipulation;
    }
    .phone-nav-scrim {
        position: fixed;
        z-index: 70;
        inset: 0;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(15, 23, 42, 0.64);
        cursor: pointer;
        touch-action: none;
    }
    body.phone-nav-open .phone-nav-scrim {
        display: block;
    }
    .main-content {
        width: 100%;
        height: var(--phone-viewport-height, 100dvh);
    }
    .content-header {
        min-height: calc(60px + env(safe-area-inset-top));
        padding: calc(0.5rem + env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) 0.5rem max(0.75rem, env(safe-area-inset-left));
        justify-content: flex-start;
        gap: 0.75rem;
    }
    .content-header h3 {
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .content-body {
        padding: 0.75rem max(0.75rem, env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
        -webkit-overflow-scrolling: touch;
        overflow-x: hidden;
        overflow-y: auto;
        min-height: 0;
    }
    .layout-auth {
        min-height: var(--phone-viewport-height, 100dvh);
        align-items: flex-start;
        overflow-y: auto;
        padding: calc(1rem + env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    }
    .auth-card {
        margin: auto 0;
        padding: 1.25rem;
    }
    .form-control {
        min-height: 44px;
        font-size: 16px;
    }
    textarea.form-control {
        min-height: 120px;
    }
    .btn {
        min-height: 44px;
        padding: 0.7rem 0.9rem;
        touch-action: manipulation;
    }
    .btn-sm {
        min-height: 44px;
        padding: 0.6rem 0.75rem;
        font-size: 0.8125rem;
    }
    .panel,
    .result-box,
    .data-item-content,
    .grid-2 > *,
    .flex > * {
        min-width: 0;
    }
    .panel-header,
    .panel-body,
    .data-item {
        padding: 0.875rem;
    }
    .panel-header.flex,
    .data-item.flex,
    form.flex {
        flex-wrap: wrap;
    }
    .data-item {
        align-items: flex-start;
        gap: 0.5rem;
    }
    .data-item-meta {
        flex-wrap: wrap;
        gap: 0.25rem 0.75rem;
        overflow-wrap: anywhere;
    }
    .data-item-title {
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .input-sm {
        width: 100%;
        flex: 1 1 12rem;
    }
    .result-content,
    .job-file-viewer,
    .status-pre,
    .overflow-x-auto,
    .overflow-y-auto {
        max-width: 100%;
        max-height: min(55dvh, 30rem);
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .text-pre {
        min-width: 0;
        white-space: pre;
    }
    pre,
    code,
    .font-mono,
    .whitespace-pre-wrap {
        overflow-wrap: anywhere;
    }
    #toast-container {
        right: max(0.75rem, env(safe-area-inset-right));
        bottom: calc(0.75rem + env(safe-area-inset-bottom));
        left: max(0.75rem, env(safe-area-inset-left));
    }
    .toast {
        width: 100%;
        min-width: 0;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .workflow-steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    .sidebar {
        transition: none;
    }
}

/* Toasts */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 50;
}

.toast {
    background: var(--bg-surface);
    border-left: 4px solid var(--border-strong);
    box-shadow: var(--shadow-md);
    padding: 1rem;
    border-radius: var(--radius-sm);
    min-width: 250px;
    animation: slideIn 0.3s ease-out;
}

.toast.error {
    border-color: var(--status-error);
}

.toast.success {
    border-color: var(--status-accepted);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Setup Overlay */
.setup-overlay {
    background: var(--status-error-bg);
    border: 1px solid var(--status-error-border);
    color: var(--status-error);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

/* Benchmark evidence surface */
.benchmark-toolbar { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin-bottom:1rem; }
.benchmark-columns { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); gap:1rem; align-items:start; }
.benchmark-panel { margin-bottom:1rem; }
.benchmark-panel .panel-header p { margin-top:.25rem; }
.benchmark-profile-grid { display:grid; grid-template-columns:minmax(240px,.72fr) minmax(0,1.28fr); gap:1.25rem; }
.benchmark-form .form-label { margin-bottom:.85rem; }
.benchmark-capabilities { display:grid; gap:.5rem; margin-bottom:1rem; }
.benchmark-capability { display:grid; grid-template-columns:1fr 1.2fr .8fr; gap:.5rem; padding:.65rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); font-size:.75rem; }
.benchmark-profile-list article,.benchmark-run { display:flex; justify-content:space-between; align-items:center; gap:.75rem; padding:.8rem; border-top:1px solid var(--border-subtle); }
.benchmark-profile-list article:first-child { border-top:0; }
.benchmark-profile-list article p,.benchmark-profile-list article .text-xs { color:var(--text-muted); }
.benchmark-profile-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem; margin-bottom:1rem; }
.benchmark-profile-choices label { display:flex; align-items:flex-start; gap:.5rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); padding:.7rem; }
.benchmark-profile-choices small,.benchmark-table small { display:block; color:var(--text-muted); overflow-wrap:anywhere; }
.benchmark-plan-grid { display:grid; grid-template-columns:2fr 1fr; gap:1rem; }
.benchmark-bounds { border:1px solid var(--border-subtle); border-radius:var(--radius-md); padding:1rem; display:grid; grid-template-columns:repeat(4,1fr); gap:.75rem; margin-bottom:1rem; }
.benchmark-bounds legend { padding:0 .35rem; font-weight:600; font-size:.8rem; }
.benchmark-consents { display:grid; gap:.6rem; margin-bottom:1rem; font-size:.875rem; }
.benchmark-consents label { display:flex; align-items:flex-start; gap:.5rem; }
.benchmark-preview { margin-top:1rem; padding:1rem; border:1px solid rgba(59, 130, 246, 0.3); border-radius:var(--radius-md); background:rgba(59, 130, 246, 0.1); }
.benchmark-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:.5rem; margin:1rem 0; }
.benchmark-stats span { padding:.7rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); color:var(--text-muted); font-size:.75rem; }
.benchmark-stats strong { display:block; margin-top:.2rem; color:var(--text-main); font-size:1rem; }
.benchmark-messages { margin-top:.75rem; padding:.75rem; background:var(--status-candidate-bg); border:1px solid var(--status-candidate-border); border-radius:var(--radius-md); font-size:.8rem; }
.benchmark-messages.danger,.benchmark-unknown { background:var(--status-error-bg); border-color:var(--status-error-border); }
.benchmark-messages ul,.benchmark-unknown ul { padding-left:1.2rem; margin-top:.35rem; }
.benchmark-run { cursor:pointer; }
.benchmark-run:hover,.benchmark-run.selected { background:var(--bg-surface-hover); }
.benchmark-run-list .benchmark-run:first-child { border-top:0; }
.benchmark-table { width:100%; border-collapse:collapse; font-size:.75rem; }
.benchmark-table th,.benchmark-table td { padding:.65rem; border-bottom:1px solid var(--border-subtle); text-align:left; vertical-align:top; }
.benchmark-table th { color:var(--text-muted); white-space:nowrap; }
.benchmark-error,.benchmark-error-banner { color:var(--status-error); overflow-wrap:anywhere; }
.benchmark-error-banner { margin-bottom:1rem; padding:.8rem; border:1px solid var(--status-error-border); background:var(--status-error-bg); border-radius:var(--radius-md); }
#analytics-panel { box-sizing:border-box; width:100%; min-width:0; max-width:100%; padding:1rem; font-size:1rem; line-height:1.5; overflow-wrap:anywhere; }
#analytics-panel * { box-sizing:border-box; min-width:0; }
#analytics-panel label { display:block; margin:.75rem 0; }
#analytics-panel input, #analytics-panel select, #analytics-panel textarea { display:block; width:100%; max-width:100%; padding:.5rem; font:inherit; }
#analytics-panel textarea { font-family:monospace; resize:vertical; }
#analytics-panel button { max-width:100%; margin:.25rem; padding:.5rem .75rem; white-space:normal; overflow-wrap:anywhere; font:inherit; }
#analytics-panel pre { max-width:100%; white-space:pre-wrap; overflow-wrap:anywhere; overflow:auto; font-size:.875rem; }
#analytics-panel summary { cursor:pointer; font-weight:600; }
#analytics-results, #analytics-results details { width:100%; min-width:0; max-width:100%; }
#analytics-panel .analytics-table-scroll { width:100%; max-width:100%; overflow:auto; }
#analytics-panel table { border-collapse:collapse; }
#analytics-panel th, #analytics-panel td { padding:.5rem; text-align:left; border:1px solid var(--border-subtle); }
#analytics-panel svg { display:block; width:100%; max-width:100%; height:auto; }
.benchmark-scope { margin:.75rem 0; padding:.75rem; border-left:3px solid var(--brand-primary); background:var(--bg-surface-hover); }
.benchmark-subheading { margin:1.1rem 0 .5rem; }
.benchmark-cli-note { margin-bottom:1rem; padding:.8rem 1rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--bg-surface); }
.benchmark-cli-note p { margin-top:.2rem; }
@media(max-width:1100px) {
    .benchmark-columns,.benchmark-profile-grid { grid-template-columns:1fr; }
}
@media(max-width:768px) {
    .benchmark-toolbar,.benchmark-run { align-items:stretch; flex-direction:column; }
    .benchmark-profile-choices,.benchmark-plan-grid,.benchmark-bounds,.benchmark-stats { grid-template-columns:1fr; }
    .benchmark-capability { grid-template-columns:1fr; }
}
