:root,
[data-theme="light"] {
    --color-primary: #1d4ed8;
    --color-primary-hover: #1e40af;
    --color-primary-soft: rgba(29, 78, 216, 0.08);
    --color-success: #059669;
    --color-success-soft: rgba(5, 150, 105, 0.12);
    --color-danger: #dc2626;
    --color-danger-soft: rgba(220, 38, 38, 0.12);
    --color-warning: #d97706;
    --color-warning-soft: rgba(217, 119, 6, 0.14);
    --color-info: #0284c7;
    --color-info-soft: rgba(2, 132, 199, 0.12);
    --color-bg: #eef1f6;
    --color-bg-accent: linear-gradient(160deg, #eef1f6 0%, #e8edf5 45%, #f4f6f9 100%);
    --color-surface: #ffffff;
    --color-surface-alt: #f8fafc;
    --color-surface-hover: #f1f5f9;
    --color-border: #e2e8f0;
    --color-border-strong: #cbd5e1;
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --color-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --color-shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.08);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --header-bg: rgba(255, 255, 255, 0.85);
    --table-stripe: rgba(248, 250, 252, 0.8);
}

[data-theme="dark"] {
    --color-primary: #60a5fa;
    --color-primary-hover: #93c5fd;
    --color-primary-soft: rgba(96, 165, 250, 0.12);
    --color-success: #34d399;
    --color-success-soft: rgba(52, 211, 153, 0.12);
    --color-danger: #f87171;
    --color-danger-soft: rgba(248, 113, 113, 0.14);
    --color-warning: #fbbf24;
    --color-warning-soft: rgba(251, 191, 36, 0.14);
    --color-info: #38bdf8;
    --color-info-soft: rgba(56, 189, 248, 0.12);
    --color-bg: #0b1120;
    --color-bg-accent: linear-gradient(160deg, #0b1120 0%, #0f172a 50%, #111827 100%);
    --color-surface: #151d2e;
    --color-surface-alt: #1a2438;
    --color-surface-hover: #1e293b;
    --color-border: #243044;
    --color-border-strong: #334155;
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --color-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    --color-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
    --header-bg: rgba(21, 29, 46, 0.9);
    --table-stripe: rgba(26, 36, 56, 0.5);
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    background-image: var(--color-bg-accent);
    background-attachment: fixed;
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--color-shadow-sm);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-primary) 0%, #3b82f6 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.35);
}

[data-theme="dark"] .brand-mark {
    box-shadow: 0 4px 16px rgba(96, 165, 250, 0.25);
}

.brand-mark svg {
    width: 22px;
    height: 22px;
}

.brand-text h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.theme-toggle {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-alt);
    gap: 2px;
}

.theme-btn {
    padding: 7px 14px;
    border: none;
    border-radius: calc(var(--radius-md) - 3px);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.theme-btn:hover:not(.active) {
    color: var(--color-text);
    background: var(--color-surface-hover);
}

.theme-btn.active {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--color-shadow-sm);
}

[data-theme="light"] .theme-btn.active {
    color: var(--color-primary);
}

/* ── Main layout ── */

.main-content {
    flex: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
}

/* ── Tabs ── */

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--color-shadow-sm);
    width: fit-content;
}

.tab-btn {
    padding: 9px 18px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: calc(var(--radius-md) - 2px);
    transition: background 0.15s, color 0.15s;
}

.tab-btn:hover:not(:disabled):not(.active) {
    color: var(--color-text);
    background: var(--color-surface-alt);
}

.tab-btn.active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.3);
}

[data-theme="dark"] .tab-btn.active {
    box-shadow: 0 2px 8px rgba(96, 165, 250, 0.25);
}

.tab-btn:disabled,
.tab-btn.tab-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.tab-panel[hidden] {
    display: none;
}

/* ── Toolbar ── */

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-muted);
    padding: 6px 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
}

.live-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-success);
    box-shadow: 0 0 0 3px var(--color-success-soft);
    animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.last-update {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ── Buttons ── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(29, 78, 216, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-hover);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.35);
}

[data-theme="dark"] .btn-primary {
    color: #0f172a;
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--color-border-strong);
    background: var(--color-surface-alt);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn.is-loading .btn-icon {
    animation: spin 0.8s linear infinite;
}

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

/* ── Cards & sections ── */

.dashboard {
    display: grid;
    gap: 20px;
}

.card.section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--color-shadow);
    overflow: hidden;
}

.section-header {
    padding: 20px 24px 0;
}

.section h2 {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--color-text);
}

.section-desc {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.section .table-wrap,
.section .pagination,
.section .config-panel {
    padding: 16px 24px 24px;
}

.section .pagination {
    padding-top: 0;
    margin-top: 0;
}

/* ── Tables ── */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    background: var(--color-surface-alt);
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table th {
    padding: 11px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.data-table th.col-num,
.data-table td.col-num {
    text-align: right;
}

.alerts-table {
    table-layout: fixed;
}

.alerts-table .col-date {
    width: 38%;
    text-align: left;
    white-space: nowrap;
}

.alerts-table .col-change {
    width: 18%;
    white-space: nowrap;
}

.alerts-table .col-from,
.alerts-table .col-to {
    width: 22%;
    white-space: nowrap;
}

.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: background 0.12s;
}

.data-table tbody tr:nth-child(even) {
    background: var(--table-stripe);
}

.data-table td.col-message {
    white-space: normal;
    min-width: 220px;
}

.col-num,
.num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
}

.data-table .col-symbol {
    font-weight: 600;
}

.col-symbol .symbol-link {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.12s;
}

.col-symbol .symbol-link:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.stock-row {
    cursor: default;
}

.stock-row:hover {
    background: var(--color-surface-hover) !important;
}

.stock-row.selected {
    background: var(--color-primary-soft) !important;
    box-shadow: inset 3px 0 0 var(--color-primary);
}

/* ── Status columns ── */

.col-status {
    cursor: pointer;
}

.col-last-alert {
    white-space: nowrap;
}

.col-last-alert .alert-dot {
    margin-right: 10px;
}

.col-last-alert .last-alert-date {
    font-size: 0.8125rem;
    color: var(--color-text);
    vertical-align: middle;
    font-weight: 500;
}

.col-last-alert .last-alert-date.muted {
    color: var(--color-text-muted);
}

.col-status:hover .alert-dot {
    transform: scale(1.12);
}

.col-live {
    text-align: left;
}

.col-live .live-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 4px 8px 4px 4px;
    border-radius: var(--radius-sm);
    transition: background 0.12s;
}

.col-live .live-link:hover {
    background: var(--color-surface-alt);
}

.col-live .live-change {
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.col-live .live-link:hover .alert-dot {
    transform: scale(1.12);
}

/* ── Alert dots ── */

.alert-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    vertical-align: middle;
    transition: transform 0.12s;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--color-surface);
}

.alert-dot.alert-red,
.alert-dot.severity-high {
    background: var(--color-danger);
}

.alert-dot.alert-yellow,
.alert-dot.severity-medium {
    background: var(--color-warning);
}

.alert-dot.alert-green {
    background: var(--color-success);
}

.alert-dot.alert-blue,
.alert-dot.severity-low {
    background: var(--color-info);
}

.col-live .alert-dot.severity-medium,
.col-live .alert-dot.severity-high {
    animation: alert-severity-blink 1.1s ease-in-out infinite;
}

@keyframes alert-severity-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

.alert-dot.alert-none {
    background: var(--color-border-strong);
}

/* ── Change colors ── */

.change-up {
    color: var(--color-success);
    font-weight: 600;
}

.change-down {
    color: var(--color-danger);
    font-weight: 600;
}

.change-severity-high {
    color: var(--color-danger);
    font-weight: 600;
}

.change-severity-medium {
    color: var(--color-warning);
    font-weight: 600;
}

.change-severity-low {
    color: var(--color-info);
    font-weight: 600;
}

/* ── Pills & badges ── */

.severity-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.severity-high {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.severity-medium {
    background: var(--color-warning-soft);
    color: var(--color-warning);
}

.severity-low {
    background: var(--color-info-soft);
    color: var(--color-info);
}

.type-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--color-surface-alt);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.type-pill.type-sharp-up {
    background: var(--color-success-soft);
    color: var(--color-success);
    border-color: transparent;
}

.type-pill.type-sharp-down {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border-color: transparent;
}

.type-pill.type-pattern {
    background: var(--color-warning-soft);
    color: var(--color-warning);
    border-color: transparent;
}

/* ── Pagination ── */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.pagination-left,
.pagination-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination label {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
}

.pagination select {
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
}

.page-info {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ── Config panel ── */

.config-panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.config-item {
    background: var(--color-surface-alt);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.config-label {
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.config-value {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.875rem;
    background: var(--color-surface);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    word-break: break-word;
}

/* ── States ── */

.loading {
    text-align: center;
    padding: 32px 20px;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.error {
    background: var(--color-danger-soft);
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.success {
    background: var(--color-success-soft);
    border: 1px solid var(--color-success);
    color: var(--color-success);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
}

/* ── Footer ── */

.site-footer {
    margin-top: auto;
    padding: 20px 24px;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    text-align: center;
}

.site-footer p {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ── Legacy / unused but kept for compatibility ── */

.stocks-grid,
.stock-card,
.alerts-container,
.alert-item,
.alert-header,
.alert-symbol,
.alert-type,
.alert-severity,
.alert-message,
.alert-details,
.alert-detail,
.alert-timestamp {
    /* retained from earlier UI; not used in current layout */
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }

    .header-actions {
        align-self: stretch;
    }

    .theme-toggle {
        width: 100%;
        justify-content: stretch;
    }

    .theme-btn {
        flex: 1;
    }

    .main-content {
        padding: 16px;
    }

    .tabs {
        width: 100%;
        overflow-x: auto;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        justify-content: space-between;
    }

    .section-header,
    .section .table-wrap,
    .section .pagination,
    .section .config-panel {
        padding-left: 16px;
        padding-right: 16px;
    }

    .config-panel {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-right {
        justify-content: space-between;
    }
}

/* ── Login ── */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-shell {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--color-shadow-lg);
    padding: 36px 32px;
}

.login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.login-brand .brand-mark {
    margin: 0 auto 16px;
}

.login-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.login-brand p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-form label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.login-form input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface-alt);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.9375rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
    background: var(--color-surface);
}

.login-error {
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--color-danger-soft);
    color: var(--color-danger);
    font-size: 0.8125rem;
    font-weight: 500;
}

.login-submit {
    margin-top: 8px;
    width: 100%;
    padding: 12px 16px;
}

/* ── Container logs drawer ── */

.logs-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.logs-toggle {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: var(--color-shadow);
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.logs-toggle:hover,
.logs-toggle[aria-expanded="true"] {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.logs-drawer {
    display: none;
    width: min(560px, calc(100vw - 32px));
    height: min(360px, 50vh);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--color-shadow-lg);
    flex-direction: column;
    overflow: hidden;
    transition: width 0.15s ease, height 0.15s ease;
}

.logs-drawer.is-open {
    display: flex;
}

.logs-drawer.logs-drawer--expanded {
    position: fixed;
    top: 24px;
    right: 24px;
    bottom: 72px;
    left: 24px;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    z-index: 201;
}

.logs-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-alt);
}

.logs-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.logs-tab {
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.logs-tab:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
}

.logs-tab.active {
    background: var(--color-primary);
    color: #fff;
}

.logs-drawer-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.logs-status {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    font-weight: 500;
    white-space: nowrap;
    margin-right: 4px;
}

.logs-icon-btn {
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.logs-icon-btn:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
}

.logs-close {
    font-size: 1.25rem;
}

.logs-output {
    flex: 1;
    margin: 0;
    padding: 12px;
    overflow: auto;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.6875rem;
    line-height: 1.45;
    color: var(--color-text);
    background: var(--color-bg);
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 768px) {
    .logs-panel {
        right: 12px;
        bottom: 12px;
    }

    .logs-drawer {
        width: calc(100vw - 24px);
        height: 45vh;
    }

    .logs-drawer.logs-drawer--expanded {
        top: 12px;
        right: 12px;
        bottom: 64px;
        left: 12px;
    }
}
