:root {
    color-scheme: light;
}

:root[data-studio-theme="dark"] {
    color-scheme: dark;
}

html[data-studio-theme="dark"] {
    background: linear-gradient(180deg, #07111f 0%, #0c1d30 55%, #172338 100%);
}

html[data-studio-theme="dark"] .iss-body,
html[data-studio-theme="dark"] .search-app-body {
    color: #e8f1f8;
    background: linear-gradient(180deg, #07111f 0%, #0c1d30 55%, #172338 100%);
}

html[data-studio-theme="dark"] .iss-card,
html[data-studio-theme="dark"] .iss-installations-page .card,
html[data-studio-theme="dark"] .iss-status-card,
html[data-studio-theme="dark"] .search-app-body .search-card,
html[data-studio-theme="dark"] .search-app-body .results-main-pane,
html[data-studio-theme="dark"] .search-app-body .document-viewer-panel,
html[data-studio-theme="dark"] .search-app-body .status-card {
    color: #e8f1f8;
    background: #102238;
    border-color: #294766;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .32);
}

html[data-studio-theme="dark"] .iss-status-card-header,
html[data-studio-theme="dark"] .search-app-body .status-card-header {
    border-color: #294766;
}

html[data-studio-theme="dark"] .text-muted,
html[data-studio-theme="dark"] .search-app-footer,
html[data-studio-theme="dark"] .result-meta,
html[data-studio-theme="dark"] .status-details {
    color: #a8bbcd !important;
}

html[data-studio-theme="dark"] .form-control,
html[data-studio-theme="dark"] .form-select,
html[data-studio-theme="dark"] .search-input,
html[data-studio-theme="dark"] textarea,
html[data-studio-theme="dark"] input,
html[data-studio-theme="dark"] select {
    color: #edf6ff;
    background-color: #081624;
    border-color: #456887;
}

html[data-studio-theme="dark"] .form-control::placeholder,
html[data-studio-theme="dark"] .search-input::placeholder,
html[data-studio-theme="dark"] textarea::placeholder,
html[data-studio-theme="dark"] input::placeholder {
    color: #8198ad;
}

html[data-studio-theme="dark"] .atc-chat-history--primary,
html[data-studio-theme="dark"] .atc-composer,
html[data-studio-theme="dark"] .atc-message.incoming,
html[data-studio-theme="dark"] .search-completions,
html[data-studio-theme="dark"] .mindmap-source-panel {
    color: #e8f1f8;
    background: #081624;
    border-color: #294766;
}

html[data-studio-theme="dark"] .atc-chat-history-header--primary {
    background: linear-gradient(135deg, rgba(85, 183, 255, 0.14) 0%, rgba(45, 106, 159, 0.08) 100%);
    border-bottom-color: #294766;
}

html[data-studio-theme="dark"] .atc-history-label--primary,
html[data-studio-theme="dark"] .atc-history-label,
html[data-studio-theme="dark"] .atc-label--primary,
html[data-studio-theme="dark"] .atc-label {
    color: #e8f1f8;
}

html[data-studio-theme="dark"] .atc-history-label--primary i,
html[data-studio-theme="dark"] .atc-label--primary i {
    color: #55b7ff;
}

html[data-studio-theme="dark"] .atc-message-placeholder {
    color: #8198ad;
}

html[data-studio-theme="dark"] .atc-message.outgoing {
    background: #2d6a9f;
    color: #edf6ff;
}

html[data-studio-theme="dark"] .atc-message-header {
    color: inherit;
}

html[data-studio-theme="dark"] .atc-textarea--primary,
html[data-studio-theme="dark"] .atc-textarea {
    color: #edf6ff;
    background-color: #07111f;
    border-color: #456887;
}

html[data-studio-theme="dark"] .atc-textarea--primary:focus,
html[data-studio-theme="dark"] .atc-textarea:focus {
    border-color: #55b7ff;
    box-shadow: 0 0 0 4px rgba(85, 183, 255, 0.18);
}

html[data-studio-theme="dark"] .atc-send-button--primary,
html[data-studio-theme="dark"] .atc-send-button {
    background: linear-gradient(135deg, #357abd 0%, #2d6a9f 100%);
    color: #edf6ff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

html[data-studio-theme="dark"] .atc-send-button--primary:hover:not(:disabled),
html[data-studio-theme="dark"] .atc-send-button:hover:not(:disabled) {
    box-shadow: 0 6px 22px rgba(85, 183, 255, 0.28);
}

html[data-studio-theme="dark"] .atc-simulate-link,
html[data-studio-theme="dark"] .atc-simulate-locate {
    color: #55b7ff;
}

html[data-studio-theme="dark"] .atc-simulate-link:hover,
html[data-studio-theme="dark"] .atc-simulate-locate:hover {
    color: #8fd0ff;
}

html[data-studio-theme="dark"] .atc-message-play-button {
    color: #55b7ff;
    border-color: #456887;
    background: #081624;
}

html[data-studio-theme="dark"] .atc-message-play-button:hover,
html[data-studio-theme="dark"] .atc-message-play-button:focus-visible {
    background: #102238;
    border-color: #55b7ff;
}

html[data-studio-theme="dark"] .atc-activity-indicator,
html[data-studio-theme="dark"] .atc-loading-indicator {
    color: #a8bbcd;
}

html[data-studio-theme="dark"] .iss-sim-locate-overlay {
    background: rgba(7, 17, 31, 0.72);
}

html[data-studio-theme="dark"] .iss-sim-locate-modal {
    color: #e8f1f8;
    background: #102238;
    border-color: #294766;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

html[data-studio-theme="dark"] .iss-sim-locate-modal-header {
    background: #081624;
    border-bottom-color: #294766;
}

html[data-studio-theme="dark"] .iss-sim-locate-title {
    color: #edf6ff;
}

html[data-studio-theme="dark"] .iss-sim-locate-close {
    color: #a8bbcd;
}

html[data-studio-theme="dark"] .iss-sim-locate-close:hover {
    color: #edf6ff;
}

html[data-studio-theme="dark"] .iss-sim-locate-meta,
html[data-studio-theme="dark"] .iss-sim-locate-section-label,
html[data-studio-theme="dark"] .iss-sim-locate-insight-summary {
    color: #a8bbcd;
}

html[data-studio-theme="dark"] .iss-sim-locate-insight {
    background: #081624;
    border-color: #294766;
}

html[data-studio-theme="dark"] .iss-sim-locate-table {
    color: #e8f1f8;
}

html[data-studio-theme="dark"] .iss-sim-locate-table thead th {
    color: #a8bbcd;
    border-color: #294766;
}

html[data-studio-theme="dark"] .iss-sim-locate-table td {
    border-color: #294766;
}

html[data-studio-theme="dark"] .iss-sim-locate-value {
    color: #edf6ff;
}

html[data-studio-theme="dark"] .iss-qr-enrollment-panel {
    background: #081624;
    border: 1px solid #294766;
}

html[data-studio-theme="dark"] .dropdown-divider {
    border-color: #3c5268;
}

@media (prefers-reduced-motion: reduce) {
    html[data-studio-theme] *,
    html[data-studio-theme] *::before,
    html[data-studio-theme] *::after {
        scroll-behavior: auto !important;
    }
}

.iss-page-eyebrow {
    color: #2d6a9f;
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.iss-page-title {
    margin: 5px 0 2px;
    font-size: clamp(1.6rem, 2.5vw, 2.1rem);
    font-weight: 750;
    line-height: 1.15;
}

.iss-page-description {
    max-width: 760px;
    margin-top: 5px;
    color: #6c757d;
    font-size: .9rem;
    line-height: 1.45;
}

html[data-studio-theme="dark"] .iss-page-eyebrow {
    color: #55b7ff;
}

html[data-studio-theme="dark"] .iss-page-description {
    color: #9eb1c5;
}

html[data-studio-theme="dark"] {
    --iss-msg-inline-bg: linear-gradient(135deg, #0a1628 0%, #102238 100%);
    --iss-msg-inline-text: #e8f1f8;
    --iss-msg-inline-text-muted: #a8bbcd;
    --iss-msg-inline-border: #294766;
    --iss-msg-surface: #102238;
    --iss-msg-surface-muted: #081624;
    --iss-msg-text: #e8f1f8;
    --iss-msg-text-secondary: #a8bbcd;
    --iss-msg-border: #294766;
    --iss-msg-overlay: rgba(4, 12, 22, 0.72);
    --iss-msg-accent: #55b7ff;
    --iss-msg-accent-text: #edf6ff;
    --iss-msg-handle: rgba(255, 255, 255, 0.25);
    --iss-msg-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    --iss-msg-slide-shadow: 0 -8px 30px rgba(0, 0, 0, 0.35);
    --iss-panel-bg: #102238;
}

html[data-studio-theme="dark"] .iss-message-dialog .btn-close,
html[data-studio-theme="dark"] .iss-message-slideup .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.78;
}

html[data-studio-theme="dark"] .iss-message-dismiss {
    background: linear-gradient(135deg, #357abd 0%, #2d6a9f 100%);
}

html[data-studio-theme="dark"] .cifp-briefing-card {
    background: rgba(16, 34, 56, 0.92);
    border-color: #294766;
}

html[data-studio-theme="dark"] .cifp-briefing-card-toggle {
    color: #e8f1f8;
}

html[data-studio-theme="dark"] .cifp-briefing-card-toggle:hover {
    background: rgba(148, 163, 184, 0.08);
}

html[data-studio-theme="dark"] .cifp-briefing-card-summary-line,
html[data-studio-theme="dark"] .cifp-briefing-identifier-body {
    color: #a8bbcd;
}

html[data-studio-theme="dark"] .cifp-briefing-card-body {
    border-top-color: #294766;
}

@media (max-width: 640px) {
    .iss-page-header {
        flex-direction: column;
        align-items: stretch !important;
    }

    .iss-page-back {
        align-self: flex-start;
    }
}
