/* Praxis Web - Compiled Styles */
/* Auto-generated - edit src/web/css/ instead */


/* ========== variables.css ========== */
/* Praxis Web - CSS Variables
 * All color, spacing, and size tokens
 */

:root {
    /* Brand Colors */
    --primary: #18453B;
    --primary-light: #0B9A6D;
    --primary-dark: #18453B;

    /* Light Theme */
    --background: #f9f9f9;
    --text: #333333;
    --light-text: #666666;
    --user-message-bg: #e8f5e9;
    --assistant-message-bg: #ffffff;
    --border: #d0d0d0;
    --shadow: rgba(0, 0, 0, 0.05);

    /* Unified spacing variables - carefully calibrated */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1.25rem;
    --spacing-xl: 1.5rem;

    /* Unified border radius - consistent curves */
    --radius-small: 6px;
    --radius-medium: 6px;
    --radius-large: 6px;
    --radius-round: 50%;

    /* Icon and element sizes - pixel-perfect */
    --icon-size: 1.5em;
    --icon-font-size: 0.85em;
    --icon-element-size: 0.85em;  /* Size of the "P" element symbol */
    --icon-padding: 0.5em;
    --seed-font-size: 0.2em;

    /* Functional Layout Constraints - Applied Universally to All Tabs */
    --tab-padding: 1.25rem;
    --tab-padding-mobile: 1rem;
    --content-max-width: 100%;
    --overflow-y: auto;
    --overflow-x: hidden;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
    --primary: #18453B;
    --primary-light: #0B9A6D;
    --primary-dark: #0B9A6D;
    --background: #121212;
    --text: #e0e0e0;
    --light-text: #b0b0b0;
    --user-message-bg: #18453B;
    --assistant-message-bg: #1e1e1e;
    --border: #333333;
    --shadow: rgba(0, 0, 0, 0.3);
    --input-bg: #1e1e1e;
    --input-text: #e0e0e0;
}


/* ========== base.css ========== */
/* Praxis Web - Base Styles
 * Global resets and typography
 */

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

body, html {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    height: 100%;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Utility Classes */
.hidden {
    display: none;
}

.header-actions {
    display: flex;
    align-items: center;
}

.loading-placeholder {
    padding: 1.25rem;
    color: var(--light-text);
}

.modal-subheading {
    margin-top: 1.25rem;
    margin-bottom: 0.9375rem;
    font-weight: 500;
    color: var(--text);
}

.button-group {
    display: flex;
    gap: 0.625rem;
    margin-top: 1.25rem;
}


/* ========== layout.css ========== */
/* Praxis Web - Layout
 * Main app container and grid layout
 */

.app-container {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    grid-template-columns: minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    max-width: 56.25rem;
    margin: 0 auto;
    padding: 0 1.375rem;
    overflow: hidden;
    box-sizing: border-box;
}

/* Functional Tab Container - Universal Base Class for All Tabs */
.tab-container {
    flex: 1;
    padding: var(--tab-padding);
    overflow-y: var(--overflow-y);
    overflow-x: var(--overflow-x);
    max-width: var(--content-max-width);
    width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

/* Tab Content Layout */
.tab-content {
    display: none;
    height: 100%;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

/* Chat Layout - Special: messages grow naturally, input floats below */
.chat-container {
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    overflow-y: visible;
    overflow-x: hidden;
    padding: var(--spacing-md) 0 0 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.input-container {
    flex: 0 0 auto;
    display: flex;
    padding: 0 0 var(--spacing-xl) 0;
    padding-bottom: calc(var(--spacing-xl) + env(safe-area-inset-bottom));
    background-color: var(--background);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    z-index: 10;
}

.message-input {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    font-size: 1rem;
    resize: none;
    min-height: 2.75rem;
    max-height: 12.5rem;
    overflow-y: hidden;
    transition: border-color 0.2s;
    font-family: inherit;
    background-color: var(--input-bg, var(--background));
    color: var(--input-text, var(--text));
    line-height: 1.5;
    box-sizing: border-box;
}

.message-input:focus {
    outline: none;
    border-color: var(--primary);
}

.input-container.with-messages {
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border);
    margin-top: 0;
}


/* ========== components.css ========== */
/* Praxis Web - All Component Styles
 * Single file with all carefully-crafted visual styles preserved
 */

/* ==================== Header ==================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0 1px 0;
    background-color: var(--background);
    z-index: 10;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    flex: 1;
}

.prism-logo {
    width: 7rem;
    height: 7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    flex-grow: 0;
    position: relative;
    overflow: visible;
}

.prism-logo canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8.75rem;
    height: 8.75rem;
    image-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.logo-separator {
    color: var(--border);
    font-weight: 300;
    margin: 0 0.625rem;
}

.system-prompt-header {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--light-text);
    font-style: italic;
    cursor: text;
    padding: 0.25rem 0.5rem 0.25rem 0;
    border-radius: var(--radius-small);
    transition: background-color 0.2s, max-width 0.2s;
    outline: none;
    flex: 1;
    max-width: 37.5rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

@keyframes prompt-cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.system-prompt-header.default-prompt::before {
    content: '|';
    font-style: normal;
    font-size: 1.125rem;
    font-weight: 300;
    color: var(--border);
    margin-right: 0.375rem;
    vertical-align: middle;
    animation: prompt-cursor-blink 1s step-end infinite;
}

.system-prompt-header:hover {
    background-color: rgba(0, 0, 0, 0.02);
    max-width: 50rem;
}

.system-prompt-header:focus {
    background-color: rgba(0, 0, 0, 0.03);
    box-shadow: 0 0 0 1px var(--border);
    white-space: pre-wrap;
    overflow: visible;
    max-width: 50rem;
    line-clamp: unset;
    -webkit-line-clamp: unset;
    display: block;
}

[data-theme="dark"] .system-prompt-header:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .system-prompt-header:focus {
    background-color: rgba(255, 255, 255, 0.08);
}

.settings-button,
.theme-toggle-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--light-text);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.3125rem;
    padding: 0.625rem 0.5rem;
    border-radius: var(--radius-small);
    transition: background-color 0.2s;
}

.theme-toggle-button {
    margin-right: 0.125rem;
}

.settings-button:hover,
.theme-toggle-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .settings-button:hover,
[data-theme="dark"] .theme-toggle-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ==================== Messages ==================== */
.message {
    margin-bottom: var(--spacing-md);
    max-width: 75%;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-medium);
    box-shadow: 0 1px 0.125rem var(--shadow);
    position: relative;
    animation: fadeIn 0.3s forwards;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message.user {
    align-self: flex-end;
    background-color: var(--user-message-bg);
}

.message.assistant {
    align-self: flex-start;
    background-color: var(--assistant-message-bg);
    border: 1px solid var(--border);
}

.message:last-child {
    margin-bottom: var(--spacing-lg);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.thinking-status {
    font-weight: normal;
    color: var(--light-text);
    font-style: italic;
}

.error-header {
    color: #cc0000;
    font-weight: 600;
}

[data-theme="dark"] .error-header {
    color: #ff6666;
}

.message.user .message-header {
    color: #1a5a1a;
}

.message.assistant .message-header {
    color: #333333;
}

[data-theme="dark"] .message.user .message-header {
    color: #a8d5a8;
}

[data-theme="dark"] .message.assistant .message-header {
    color: #b0b0b0;
}

.message-content {
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message.user .message-content {
    color: #1a1a1a;
}

.message.assistant .message-content {
    color: #333333;
    line-height: 1.7;
}

[data-theme="dark"] .message.user .message-content {
    color: #ffffff;
}

[data-theme="dark"] .message.assistant .message-content {
    color: #e0e0e0;
}

.reroll-button {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    padding: 0.375rem 0.625rem;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--light-text);
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.reroll-button:hover {
    background-color: var(--user-message-bg);
    color: var(--text);
}

.message.assistant:last-of-type:hover .reroll-button {
    opacity: 1;
}

.dots {
    display: inline-flex;
    gap: 0.25rem;
    margin-left: 0.8rem;
}

.dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--radius-round);
    background-color: var(--primary);
    opacity: 0.7;
}

.dot:nth-child(1) { animation: bounce 1.2s infinite 0s; }
.dot:nth-child(2) { animation: bounce 1.2s infinite 0.2s; }
.dot:nth-child(3) { animation: bounce 1.2s infinite 0.4s; }

/* ==================== Tabs ==================== */
.tab-nav {
    display: flex;
    gap: 0.625rem;
    padding: 0.3125rem 1.25rem 0.625rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background-color: var(--background);
    position: relative;
    justify-content: space-between;
    align-items: center;
}

.tab-buttons {
    display: flex;
    gap: 0.625rem;
    min-width: 0;
}

.tab-button {
    padding: 0.625rem 1rem;
    background: var(--surface);
    border: none;
    color: var(--light-text);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-small);
    transition: all 0.2s;
    position: relative;
    white-space: nowrap;
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text);
}

[data-theme="dark"] .tab-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.tab-button.active {
    color: var(--primary-dark);
    background-color: var(--user-message-bg);
}

/* Beautiful glowing tab effect (dark mode) */
[data-theme="dark"] .tab-button.active {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.08);
    text-shadow:
        0 0 0.375rem rgba(255, 255, 255, 0.4),
        0 0 0.75rem rgba(255, 255, 255, 0.2);
    animation: subtleGlow 3s ease-in-out infinite alternate;
}

[data-theme="dark"] .tab-button.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    border-radius: var(--radius-small);
    z-index: -1;
    opacity: 0.5;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -11px;
    left: 0;
    right: 0;
    height: 0.125rem;
    background-color: var(--primary);
}

[data-theme="dark"] .tab-button.active::after {
    background: linear-gradient(90deg,
        transparent,
        #FFFFFF 10%,
        #FFFFFF 90%,
        transparent
    );
    box-shadow:
        0 0 0.375rem rgba(255, 255, 255, 0.5),
        0 -1px 0.25rem rgba(255, 255, 255, 0.3);
}

.terminal-status {
    position: absolute;
    right: 1.25rem;
    top: calc(50% - 0.15625rem);
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    z-index: 20;
    background: transparent;
    pointer-events: none;
}

.status-indicator {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: var(--radius-round);
    background-color: #666;
    transition: background-color 0.3s;
    pointer-events: auto;
}

.status-indicator.connected {
    background-color: #18453B;
    box-shadow: 0 0 0.25rem rgba(24, 69, 59, 0.4);
}

/* ==================== Modal ==================== */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    padding: 1.25rem;
    overflow-y: auto;
}

.settings-modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--background);
    padding: 1.875rem;
    border-radius: var(--radius-small);
    width: 90%;
    max-width: 31.25rem;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    color: var(--text);
    margin: auto;
    position: relative;
}

[data-theme="dark"] .modal-content {
    box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}

.close-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--light-text);
}

.close-button:hover {
    color: var(--text);
}

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

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

.form-group label input[type="checkbox"] {
    width: auto;
    margin: 0;
    margin-right: 0.625rem;
    cursor: pointer;
    vertical-align: middle;
}

.form-group input:not([type="checkbox"]) {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    font-size: 0.875rem;
    background-color: var(--input-bg, var(--assistant-message-bg));
    color: var(--input-text, #333333);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.save-button, .reset-button {
    color: white;
    border: none;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-small);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.save-button {
    background-color: var(--primary);
}

.save-button:hover {
    background-color: var(--primary-dark);
}

.reset-button {
    background-color: #d32f2f;
}

.reset-button:hover {
    background-color: #b71c1c;
}

.save-confirmation {
    display: none;
    margin-top: 0.9375rem;
    padding: 0.75rem;
    background-color: var(--primary-light);
    color: white;
    border-radius: var(--radius-small);
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    animation: fadeIn 0.3s ease-in;
}

.save-confirmation.show {
    display: block;
}

/* ==================== Terminal ==================== */
.terminal-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background-color: var(--background);
    color: #d4d4d4;
    font-family: 'Cascadia Code', 'Fira Code', 'Monaco', 'Courier New', monospace;
    font-size: 0.625rem;
    line-height: 1.0;
    padding: 0.625rem;
    white-space: pre;
    position: relative;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
}

[data-theme="dark"] .terminal-container {
    background-color: var(--background);
}

.terminal-line {
    min-height: 1.4em;
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: transparent;
    color: var(--text);
    padding: 0.125rem 0.3125rem;
}

.dashboard-wrapper {
    max-width: 100%;
    width: 100%;
    position: relative;
    background-color: #0d0d0d !important;
    overflow-x: auto;
    overflow-y: hidden;
}

.dashboard-frame {
    background-color: #0d0d0d !important;
    color: #d4d4d4 !important;
    padding: 0.5rem;
    border-radius: var(--radius-small);
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.2);
    display: inline-block;
    font-family: 'Courier New', Courier, 'Lucida Console', monospace;
    font-size: 0.625rem;
    line-height: 1.2;
    letter-spacing: 0;
    font-variant-ligatures: none;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: auto;
    text-rendering: optimizeSpeed;
    font-feature-settings: "liga" 0, "calt" 0;
}

.dashboard-line {
    white-space: pre;
    margin: 0;
    padding: 0;
    background-color: transparent !important;
    color: inherit !important;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    letter-spacing: inherit;
}

/* ==================== Live Dashboard ==================== */
.live-dashboard {
    font-family: 'Cascadia Code', 'Fira Code', 'Courier New', monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    background-color: #0d0d0d;
    color: #d4d4d4;
    padding: 1rem;
    border-radius: var(--radius-small);
    width: 100%;
    box-sizing: border-box;
    min-height: 400px;
}

.ld-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.ld-header-left {
    color: #888;
}

.ld-hash {
    color: #ccc;
    font-weight: bold;
}

.ld-label {
    color: #555;
}

.ld-sep {
    color: #333;
}

.ld-header-metrics {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.ld-metric {
    color: #888;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.ld-val {
    color: #0B9A6D;
    font-weight: bold;
}

.ld-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    min-height: 180px;
    align-items: start;
}

.ld-panel {
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    padding: 0.5rem;
    background: #111;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.ld-panel-title {
    font-size: 0.6875rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
    border-bottom: 1px solid #222;
    padding-bottom: 0.25rem;
    flex-shrink: 0;
}

.ld-panel-status {
    overflow: hidden;
}

.ld-status-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
    max-height: 250px;
    font-size: 0.625rem;
    color: #aaa;
    line-height: 1.4;
    scrollbar-width: none;
}

.ld-status-text::-webkit-scrollbar {
    display: none;
}

.ld-panel-chart {
    display: flex;
    flex-direction: column;
}

.ld-sparkline-canvas {
    width: 100%;
    flex: 1;
    min-height: 120px;
}

.ld-info-panel {
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    padding: 0.5rem;
    background: #111;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.ld-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.125rem 1rem;
}

.ld-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    padding: 0.125rem 0;
}

.ld-info-key {
    color: #666;
    text-transform: uppercase;
}

.ld-info-val {
    color: #ccc;
    font-weight: bold;
}

.ld-log-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.ld-log-toggle {
    background: none;
    border: 1px solid #333;
    border-radius: 3px;
    color: #888;
    font-family: inherit;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ld-log-toggle:hover {
    color: #ccc;
    border-color: #555;
}

.ld-log-count {
    font-size: 0.625rem;
    color: #444;
}

.ld-log-panel {
    display: none;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    background: #0a0a0a;
    margin-bottom: 0.75rem;
}

.ld-log-panel.open {
    display: block;
}

.ld-log-content {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.375rem 0.5rem;
}

.ld-log-line {
    font-size: 0.6875rem;
    line-height: 1.4;
    color: #777;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ld-footer {
    border-top: 1px solid #333;
    padding-top: 0.5rem;
    font-size: 0.6875rem;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.ld-footer-sep {
    color: #333;
}

.ld-footer-item {
    white-space: nowrap;
}

.ld-url {
    color: #0B9A6D;
}

/* ==================== Spec Tab ==================== */
.spec-section {
    margin-bottom: 1.875rem;
    max-width: 100%;
    overflow-wrap: break-word;
}

.spec-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.spec-metadata {
    font-size: 0.875rem;
    color: var(--light-text);
    margin-bottom: 0.5rem;
    font-family: 'Inter', sans-serif;
}

.spec-hash {
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
}

.spec-hash-rest {
    color: var(--text);
}

.spec-code {
    background-color: #f5f5f5;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    padding: 1rem;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.8125rem;
    color: #333;
    white-space: pre;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

[data-theme="dark"] .spec-code {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

.spec-code-step {
    margin-bottom: 1rem;
}

.spec-steps {
    margin-bottom: 1rem;
}

.spec-peer-button {
    float: right;
    margin-bottom: 1rem;
    position: relative;
}

.spec-link {
    color: #0B9A6D;
    font-weight: 600;
    text-decoration: none;
}

.spec-link:hover {
    text-decoration: underline;
}

.spec-link-primary {
    color: #0B9A6D;
    font-weight: 600;
    text-decoration: none;
}

.spec-value-highlight {
    color: #0B9A6D;
    font-weight: 600;
}

/* ==================== Iframe Tab ==================== */
.iframe-container {
    padding: 0 !important;
    overflow: hidden !important;
}

.iframe-content {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ==================== Agents Tab ==================== */
.agents-section {
    margin-bottom: 1.875rem;
    max-width: 100%;
}

.agents-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.agents-table {
    width: 100%;
    max-width: 100%;
    background-color: var(--assistant-message-bg);
    border-radius: var(--radius-small);
    overflow: hidden;
    box-shadow: 0 0.125rem 0.625rem var(--shadow);
}

.agents-list {
    padding: 0;
}

.agent-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.agent-row:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .agent-row:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

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

.agent-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.agent-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

.agent-url {
    font-size: 0.8125rem;
    color: var(--light-text);
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    word-break: break-all;
}

.agent-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-medium);
    font-size: 0.8125rem;
    font-weight: 500;
}

.agent-status.online {
    background-color: rgba(11, 154, 109, 0.1);
    color: var(--primary-light);
}

.agent-status.archived {
    background-color: rgba(0, 39, 76, 0.1);
    color: #00274c;
}

.agent-status.offline {
    background-color: rgba(102, 102, 102, 0.1);
    color: var(--light-text);
}

.agent-status.ambiguous {
    background-color: rgba(255, 203, 5, 0.15);
    color: #FFCB05;
}

[data-theme="dark"] .agent-status.online {
    background-color: rgba(11, 154, 109, 0.2);
}

[data-theme="dark"] .agent-status.archived {
    background-color: rgba(0, 39, 76, 0.3);
    color: #5b8fc9;
}

[data-theme="dark"] .agent-status.offline {
    background-color: rgba(176, 176, 176, 0.1);
}

[data-theme="dark"] .agent-status.ambiguous {
    background-color: rgba(255, 203, 5, 0.2);
}

.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--radius-round);
}

.status-dot.online {
    background-color: var(--primary-light);
    animation: pulse 2s infinite;
}

.status-dot.archived {
    background-color: #00274c;
}

.status-dot.offline {
    background-color: var(--light-text);
}

.status-dot.ambiguous {
    background-color: #FFCB05;
    animation: pulse-harsh 1.5s infinite linear;
}

.agents-empty {
    padding: 2.5rem 1.25rem;
    text-align: center;
    color: var(--light-text);
}

/* ==================== Tab Headers (Generic & Reusable) ==================== */

/* Remove top padding from containers that have headers */
.tab-container:has(.tab-header) {
    padding-top: 0 !important;
}

.tab-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--background);
    padding: 0.75rem 0 0.75rem 0;
    margin-bottom: 1.5rem;
    max-width: 100%;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .tab-header {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tab-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
    word-wrap: break-word;
}

.tab-header-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.tab-header-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.tab-header-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.tab-header-button:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.tab-header-button svg {
    width: 16px;
    height: 16px;
}

.tab-header-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--light-text);
    margin-top: 0.5rem;
}

/* ==================== Research Tab ==================== */
/* Note: Research now uses generic .tab-header instead */

.training-badge {
    background: var(--primary-light);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.chart-card {
    background: var(--assistant-message-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    padding: 1.25rem;
    box-shadow: 0 0.125rem 0.25rem var(--shadow);
    transition: box-shadow 0.2s;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.chart-card:hover {
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.08);
}

[data-theme="dark"] .chart-card {
    background: #1e1e1e;
}

.chart-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.chart-subtitle {
    font-size: 0.875rem;
    color: var(--light-text);
    margin-bottom: 1rem;
}

.empty-state, .error-message {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state h3, .error-message h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.empty-state p, .error-message p {
    color: var(--light-text);
}

.retry-button {
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.retry-button:hover {
    background: var(--primary-light);
}

.run-selector-wrapper {
    position: relative;
}

.run-selector-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--background);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.run-selector-button:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: white;
}

[data-theme="dark"] .run-selector-button {
    border-color: #333;
}

.run-selector-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--assistant-message-bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.15);
    min-width: 18.75rem;
    max-width: 25rem;
    z-index: 1000;
}

[data-theme="dark"] .run-selector-dropdown {
    background: #1e1e1e;
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.5);
}

.run-selector-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.run-selector-list {
    max-height: 25rem;
    overflow-y: auto;
    padding: 0.5rem;
}

.run-selector-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background 0.15s;
}

.run-selector-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .run-selector-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.run-selector-item input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.run-color-indicator {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.run-label {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text);
    font-family: 'Monaco', 'Courier New', monospace;
}

.run-steps {
    font-size: 0.75rem;
    color: var(--light-text);
    font-weight: 500;
}

.chart-wrapper {
    position: relative;
    height: 25rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* ==================== Copy Fallback Modal ==================== */
.copy-fallback-content {
    background-color: var(--background);
    padding: 1.5rem;
    border-radius: var(--radius-small);
    max-width: 500px;
    width: 100%;
    box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    color: var(--text);
}

.copy-fallback-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2em;
    color: var(--text);
}

.copy-fallback-input {
    width: 100%;
    padding: 0.75rem;
    margin: 1rem 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background-color: var(--background-secondary);
    color: var(--text);
    font-family: monospace;
    font-size: 0.9em;
    box-sizing: border-box;
}

.copy-fallback-input:focus {
    outline: 2px solid #0B9A6D;
    outline-offset: 2px;
}

.copy-fallback-close {
    width: 100%;
    padding: 0.75rem;
    background: #0B9A6D;
    color: white;
    border: none;
    border-radius: var(--radius-small);
    font-size: 1em;
    cursor: pointer;
    font-weight: 500;
}

.copy-fallback-close:hover {
    background: #0a8660;
}

.copy-fallback-close:active {
    transform: translateY(1px);
}

/* ==================== Dynamics Controls ==================== */
.dynamics-controls {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.dynamics-controls::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.layer-toggle-btn {
    padding: 0.375rem 0.75rem;
    margin-right: 0.5rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--light-text);
    cursor: pointer;
    transition: all 0.2s;
}

.layer-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}

.layer-toggle-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

[data-theme="dark"] .layer-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: #333;
}

[data-theme="dark"] .layer-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ==================== Hybrid Mode (Split Reality) ==================== */
.hybrid-overlay {
    /* Full viewport overlay */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    z-index: 998 !important;

    /* Non-interactive overlay */
    pointer-events: none !important;

    /* No transitions - we're updating 60fps */
    transition: none !important;

    /* Force identical rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;

    /* Prevent subpixel shifts */
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

/* Hybrid overlay inherits light theme - no custom colors needed */
/* The data-theme="light" attribute triggers all existing :root light theme rules */

/* Full-width backgrounds without changing content layout */
body.hybrid-active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--background);
    z-index: -1;
}


.hybrid-overlay[data-theme="light"] .message.user {
    background-color: #e8f5e9 !important;
}

.hybrid-overlay[data-theme="light"] .message.assistant {
    background-color: #ffffff !important;
}

/* Header and prism stay on top in hybrid mode */
body.hybrid-active .header {
    position: relative;
    z-index: 10001 !important;
    background-color: transparent !important;
}

body.hybrid-active .logo {
    background-color: transparent !important;
}

body.hybrid-active .prism-logo {
    position: relative;
    z-index: 10002 !important;
}


/* Essential hybrid overlay rules - let data-theme="light" handle colors */

/* Remove dark mode glow effects */
.hybrid-overlay[data-theme="light"] .tab-button.active::before,
.hybrid-overlay[data-theme="light"] .tab-button.active::after {
    display: none !important;
}

/* Solid backgrounds to prevent transparency */
.hybrid-overlay .app-container,
.hybrid-overlay .tab-content,
.hybrid-overlay .tab-nav {
    background-color: var(--background) !important;
}

/* Force pixel-perfect positioning on cloned elements */
.hybrid-overlay .message,
.hybrid-overlay .tab-content,
.hybrid-overlay .terminal-line {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Chart canvases in hybrid overlay - invert to approximate light theme */
.hybrid-overlay canvas:not(#prism-canvas) {
    display: block !important;
    /* Invert dark theme chart colors to make them readable on light background */
    filter: invert(1);
}

/* Header spacer - invisible but maintains layout */
.hybrid-overlay .header-spacer-hybrid {
    background: transparent !important;
}

/* Hide any loading placeholders or empty states that create white boxes */
.hybrid-overlay .loading-placeholder {
    display: none !important;
}

/* Remove backgrounds from spacer elements */
.hybrid-overlay .header-spacer-hybrid {
    background: transparent !important;
    background-color: transparent !important;
}

/* Use consistent background throughout overlay */
.hybrid-overlay {
    background: var(--background) !important;
}

.hybrid-overlay .app-container {
    background: var(--background) !important;
}

/* Explicitly define light theme variables on hybrid overlay */
.hybrid-overlay[data-theme="light"] {
    --background: #f9f9f9;
    --text: #333333;
    --light-text: #666666;
    --user-message-bg: #e8f5e9;
    --assistant-message-bg: #ffffff;
    --border: #d0d0d0;
    --input-bg: #ffffff;
    --surface: #ffffff;
}

/* Apply background using the variable */
.hybrid-overlay[data-theme="light"] {
    background-color: var(--background) !important;
}

/* Remove all opacity/transparency from hybrid overlay and children */
.hybrid-overlay,
.hybrid-overlay *:not(#prism-canvas) {
    opacity: 1 !important;
}

/* Remove dark mode specific styling that might cause issues */
.hybrid-overlay[data-theme="light"] .tab-button.active::before,
.hybrid-overlay[data-theme="light"] .tab-button.active::after {
    display: none !important;
}
/* Comprehensive light theme fixes for hybrid overlay */

/* Input fields - white background, dark text */
.hybrid-overlay[data-theme="light"] #message-input,
.hybrid-overlay[data-theme="light"] input,
.hybrid-overlay[data-theme="light"] textarea {
    background-color: #ffffff !important;
    color: #333333 !important;
    border: 1px solid #d0d0d0 !important;
}

/* Tab buttons - light theme colors */
.hybrid-overlay[data-theme="light"] .tab-button {
    background: #ffffff !important;
    color: #666666 !important;
    border: 1px solid transparent !important;
}

.hybrid-overlay[data-theme="light"] .tab-button.active {
    background-color: #e8f5e9 !important;
    color: #18453B !important;
    font-weight: 500 !important;
}

/* All text should be dark in light theme */
.hybrid-overlay[data-theme="light"] {
    color: #333333 !important;
}

.hybrid-overlay[data-theme="light"] .message-content {
    color: #333333 !important;
}

.hybrid-overlay[data-theme="light"] .message-header {
    color: #666666 !important;
}

.hybrid-overlay[data-theme="light"] .terminal-line {
    color: #333333 !important;
}

/* Chart backgrounds */
.hybrid-overlay[data-theme="light"] .chart-card {
    background-color: #ffffff !important;
    border: 1px solid #d0d0d0 !important;
}

.hybrid-overlay[data-theme="light"] .chart-wrapper {
    background-color: transparent !important;
}

/* All backgrounds should use light theme color */
.hybrid-overlay[data-theme="light"] .tab-content,
.hybrid-overlay[data-theme="light"] .chat-container,
.hybrid-overlay[data-theme="light"] .terminal-container {
    background-color: #f9f9f9 !important;
}

/* Buttons */
.hybrid-overlay[data-theme="light"] button {
    background-color: transparent !important;
    color: var(--light-text) !important;
}

.hybrid-overlay[data-theme="light"] .spec-peer-button,
.hybrid-overlay[data-theme="light"] button[type="submit"] {
    background-color: #0B9A6D !important;
    color: #ffffff !important;
}

/* Fix header text colors in light zone - use darker colors for visibility */
.hybrid-overlay[data-theme="light"] .system-prompt-header {
    color: #666666 !important;
}

.hybrid-overlay[data-theme="light"] .settings-button,
.hybrid-overlay[data-theme="light"] .theme-toggle-button {
    color: #666666 !important;
}

/* Chart text and labels - use proper light theme colors */
.hybrid-overlay[data-theme="light"] .chart-title {
    color: var(--text) !important;
}

.hybrid-overlay[data-theme="light"] .empty-state h3,
.hybrid-overlay[data-theme="light"] .error-message h3 {
    color: var(--text) !important;
}

.hybrid-overlay[data-theme="light"] .empty-state p,
.hybrid-overlay[data-theme="light"] .error-message p {
    color: var(--light-text) !important;
}


/* ========== themes.css ========== */
/* Praxis Web - Theme System
 * Theme-specific overrides beyond variables
 * Most theming is handled via CSS variables in variables.css
 */

/* This file is intentionally minimal - most theming happens through CSS variables */
/* Add theme-specific overrides here only when CSS variables aren't sufficient */


/* ========== animations.css ========== */
/* Praxis Web - Animations
 * All keyframe animations
 */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(10px); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes pulse-harsh {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

/* Subtle glow animation for dark mode tabs */
@keyframes subtleGlow {
    0% {
        text-shadow:
            0 0 6px rgba(255, 255, 255, 0.4),
            0 0 12px rgba(255, 255, 255, 0.2);
    }
    100% {
        text-shadow:
            0 0 8px rgba(255, 255, 255, 0.5),
            0 0 14px rgba(255, 255, 255, 0.3);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}


/* ========== responsive.css ========== */
/* ==================== Mobile Responsive ==================== */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .app-container {
        padding: 0 var(--tab-padding-mobile);
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Tab containers use full parent width, no horizontal padding */
    .tab-container {
        padding: var(--tab-padding-mobile) 0;
        width: 100%;
        max-width: 100%;
    }

    /* Code blocks: horizontal scroll, no line breaks (blueprints depend on format) */
    .spec-code,
    pre,
    code {
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: pre;
        word-wrap: normal;
        overflow-wrap: normal;
        box-sizing: border-box;
        -webkit-overflow-scrolling: touch;
    }

    /* Non-code content: wrap normally */
    .agent-url,
    .chart-card,
    .chart-wrapper,
    .agents-table,
    .message {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
        box-sizing: border-box;
    }

    .header {
        padding: 0.625rem 0;
    }
    
    .logo {
        font-size: 1.125rem;
        gap: 0.5rem;
    }
    
    .logo-text,
    .logo-separator {
        display: none;
    }
    
    .tab-nav {
        padding: 0.3125rem 0.625rem 0.625rem 0.625rem;
        position: relative;
        overflow: hidden;
    }

    /* Fade indicators - extend to edges, tabs flow under status indicator */
    .tab-nav::before,
    .tab-nav::after {
        content: '';
        position: absolute;
        top: 0.3125rem;
        bottom: 0.625rem;
        width: 2rem;
        pointer-events: none;
        z-index: 10;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .tab-nav::before {
        left: 0;
        background: linear-gradient(to right, var(--background), transparent);
    }

    .tab-nav::after {
        right: 0;
        background: linear-gradient(to left, var(--background), transparent);
    }

    .tab-nav.has-scroll-left::before {
        opacity: 0.9;
    }

    .tab-nav.has-scroll-right::after {
        opacity: 0.9;
    }

    .tab-buttons {
        display: flex;
        gap: 0.375rem;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-padding-left: 0;
    }

    .tab-buttons::-webkit-scrollbar {
        display: none;
    }
    
    .tab-button {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
        flex: 0 0 auto;  /* Prevent buttons from shrinking */
        white-space: nowrap;  /* Keep text on one line */
    }
    
    .logo-icon {
        width: var(--icon-size);
        height: var(--icon-size);
    }
    
    .system-prompt-header {
        font-size: 0.6875rem;
        max-width: none;
        flex: 1;
        line-clamp: 2;
        -webkit-line-clamp: 2;
        line-height: 1.3;
        margin-right: 0.625rem;
    }
    
    .system-prompt-header:focus {
        max-width: none;
        line-clamp: unset;
        -webkit-line-clamp: unset;
        font-size: 0.75rem;
    }

    .message {
        max-width: 85%;
    }
    
    .terminal-container {
        font-size: 0.5rem;
        padding: 0.3125rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dashboard-frame {
        padding: 0.25rem;
        font-size: 0.5rem;
        font-family: monospace, 'Courier', 'Courier New';
        max-width: 100%;
    }

    .dashboard-line {
        font-size: inherit;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .live-dashboard {
        font-size: 0.6875rem;
        padding: 0.5rem;
    }

    .ld-body {
        grid-template-columns: 1fr;
    }

    .ld-info-grid {
        grid-template-columns: 1fr;
    }

    .ld-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ld-footer {
        font-size: 0.625rem;
    }

    .chart-card {
        padding: 1rem;
        width: 100%;
    }

    .chart-wrapper {
        height: 18.75rem;
        width: 100%;
    }

    .tab-header-title-row {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .tab-header-controls {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Ultra-compact mode for very small screens */
@media (max-width: 360px) {
    .tab-buttons {
        gap: 0.25rem;
        max-width: calc(100% - 6.25rem);
    }
    
    .tab-button {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
        letter-spacing: -0.3px;
    }
    
    .terminal-status {
        right: 0.5rem;
        padding: 0;
    }

    .status-indicator {
        width: 0.625rem;
        height: 0.625rem;
    }
}

/* Iframe-friendly adjustments */
@media (max-height: 600px) {
    .modal-content {
        max-height: 85vh;
        padding: 1.25rem;
    }

    .form-group {
        margin-bottom: 0.9375rem;
    }
}


