/* AP4 - Internet Observatorium. MIT; see LICENSE.txt. */
:root {
    --obs-blue: #1677ff;
    --obs-ink: #14243b;
    --obs-muted: #728099;
    --obs-border: #e3eaf3;
    --obs-background: #f5f8fc;
}

body {
    color: var(--obs-ink);
    background: var(--obs-background);
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.nicegui-content { padding: 0; gap: 0; }
.obs-sidebar {
    background: #142033;
    color: #c4cede;
    border: 0;
}
.obs-sidebar .q-drawer__content {
    display: flex;
    flex-direction: column;
    padding: 27px 14px 21px;
}
.obs-brand { align-items: center; gap: 12px; padding: 0 8px; }
.obs-brand-icon { font-size: 39px; color: #4095ff; }
.obs-brand-title { font-size: 18px; font-weight: 700; line-height: 1.25; }

.obs-nav-caption {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.4px;
    padding: 0 16px;
    margin-top: 24px;
    margin-bottom: 13px;
    color: #7486a1;
}
.obs-navigation { gap: 5px; width: 100%; }
.obs-nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    border-radius: 7px;
    padding: 12px 15px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: #bdc9db;
    transition: background 150ms, color 150ms;
}
.obs-nav-icon { font-size: 20px; color: #92a4c0; }
.obs-nav-item:hover { background: #223149; color: white; }
.obs-nav-active {
    background: var(--obs-blue);
    color: white;
    box-shadow: 0 5px 16px #0872ff29;
}
.obs-nav-active .obs-nav-icon { color: white; }
.obs-sidebar-bottom {
    margin-top: auto;
    padding: 23px 14px 0;
    gap: 8px;
    color: #7f92ae;
    border-top: 1px solid #2b374b;
}
.obs-api-link {
    text-decoration: none;
    color: #86b8ff;
    font-size: 12px;
    margin-top: 8px;
}

/* Temporary developer tools share the normal page shell and data services. */
.obs-development-page { max-width: 1560px; }
.obs-dev-docs-link { color: var(--obs-blue); font-size: 12px; text-decoration: none; }
.obs-dev-banner {
    width: 100%;
    padding: 14px 17px;
    align-items: center;
    gap: 12px;
    border: 1px solid #f0dcad;
    border-radius: 9px;
    background: #fff9eb;
    color: #8c671e;
}
.obs-dev-copy { font-size: 12px; line-height: 1.7; color: var(--obs-muted); overflow-wrap: anywhere; }
.obs-dev-small-title { font-size: 14px; line-height: 1.5; font-weight: 650; }
.obs-dev-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; width: 100%; }
.obs-dev-stat { border: 1px solid var(--obs-border); box-shadow: none; padding: 17px 20px; gap: 4px; }
.obs-dev-stat-number { font-size: 29px; font-weight: 700; color: var(--obs-ink); }
.obs-dev-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; width: 100%; }
.obs-dev-stage { position: relative; padding: 17px; gap: 7px; border: 1px solid var(--obs-border); box-shadow: none; }
.obs-dev-stage:not(:last-child)::after { content: '→'; position: absolute; right: -15px; top: 38%; color: #a3b5cb; z-index: 1; }
.obs-dev-stage-number { color: var(--obs-blue); font-size: 11px; font-weight: 700; letter-spacing: 1px; }
.obs-dev-tabs { width: 100%; color: var(--obs-muted); border-bottom: 1px solid var(--obs-border); }
.obs-dev-tabs .q-tab { text-transform: none; font-size: 13px; }
.obs-dev-tabs .q-tab--active { color: var(--obs-blue); }
.obs-dev-tab-panels { width: 100%; background: transparent; overflow: hidden; }
.obs-dev-tab-panels .q-tab-panel { padding: 0; }
.obs-dev-source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.obs-dev-source { padding: 20px; gap: 11px; border: 1px solid var(--obs-border); box-shadow: none; min-width: 0; }
.obs-dev-source-planned { background: #f8fafc; }
.obs-dev-state { background: #eaf3ff; color: #286ec4; border-radius: 4px; padding: 3px 7px; font-size: 10px; font-weight: 600; }
.obs-dev-state-planned { background: #edf0f5; color: #718099; }
.obs-dev-interface-name { font-size: 12px; line-height: 1.7; font-weight: 600; overflow-wrap: anywhere; }
.obs-dev-file { font: 11px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; color: #63738c; overflow-wrap: anywhere; max-width: 100%; }
.obs-dev-caption { margin-top: 4px; font-size: 10px; letter-spacing: 1px; color: #8694a9; font-weight: 600; }
.obs-dev-result-line { padding-left: 11px; border-left: 2px solid #bdd6fa; font-size: 12px; line-height: 1.7; }
.obs-dev-table { width: 100%; max-width: 100%; margin: 14px 0; }
.obs-dev-table table { min-width: 820px; }
.obs-dev-table td { white-space: normal; overflow-wrap: anywhere; max-width: 300px; vertical-align: top; font-size: 12px; line-height: 1.6; }
.obs-dev-table .q-table__container { max-width: 100%; }
.obs-dev-transport { padding: 18px; gap: 9px; border: 1px solid var(--obs-border); box-shadow: none; margin-top: 18px; }
.obs-dev-example-select { width: 100%; margin-top: 16px; }
.obs-dev-json-input { width: 100%; margin: 17px 0 12px; }
.obs-dev-json-input textarea { height: 290px; max-height: 450px; font: 12px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }
.obs-dev-preview-actions { gap: 9px; margin-bottom: 19px; }
.obs-dev-preview-result { width: 100%; padding: 20px; gap: 12px; border: 1px solid var(--obs-border); border-radius: 8px; background: white; }
.obs-dev-result-success { color: #168264; font-size: 13px; font-weight: 650; }
.obs-dev-result-error { color: #c83242; font-size: 13px; font-weight: 650; }
.obs-dev-error-detail { font: 12px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; color: #a62b39; overflow-wrap: anywhere; }
.obs-dev-output-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; width: 100%; }
.obs-dev-output { min-width: 0; width: 100%; gap: 9px; }
.obs-dev-code { width: 100%; max-width: 100%; max-height: 410px; overflow: auto; font-size: 11px; }
.obs-dev-code pre { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 800px) {
    .obs-dev-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .obs-dev-stage::after { display: none; }
    .obs-dev-source-grid, .obs-dev-output-grid { grid-template-columns: minmax(0, 1fr); }
    .obs-dev-table::after { content: '↔ Tabelle seitlich scrollen'; padding: 7px 10px; color: var(--obs-muted); font-size: 11px; }
}
@media (max-width: 520px) {
    .obs-dev-summary { grid-template-columns: minmax(0, 1fr); gap: 9px; }
    .obs-dev-flow { grid-template-columns: minmax(0, 1fr); gap: 9px; }
    .obs-dev-stat, .obs-dev-source, .obs-dev-stage { padding: 14px; }
    .obs-dev-preview-result { padding: 12px; }
    .obs-dev-banner { align-items: flex-start; }
}
.obs-header {
    height: 72px;
    padding: 0 30px;
    align-items: center;
    background: white;
    color: var(--obs-ink);
    border-bottom: 1px solid var(--obs-border);
    box-shadow: none;
}
.obs-breadcrumb { color: var(--obs-muted); font-size: 12px; }
.obs-breadcrumb-current { color: var(--obs-ink); font-weight: 600; }
.obs-demo-badge {
    align-items: center;
    gap: 6px;
    color: #906814;
    background: #fff7e6;
    border: 1px solid #f4e5c0;
    border-radius: 5px;
    padding: 6px 9px;
    font-size: 11px;
    font-weight: 600;
}
.obs-refresh-time { color: var(--obs-muted); font-size: 11px; }
.obs-menu-button { display: none; }
.obs-page {
    width: 100%;
    max-width: 1920px;
    margin: auto;
    padding: 32px 30px 22px;
    gap: 23px;
}
.obs-title-row {
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.obs-title-row > .nicegui-column {
    flex: 1;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}
.obs-eyebrow {
    color: var(--obs-blue);
    font-size: 10px;
    letter-spacing: 1.5px;
    font-weight: 700;
    margin-bottom: 5px;
}
.obs-page-title {
    font-size: 29px;
    line-height: 1.3;
    letter-spacing: -0.7px;
    font-weight: 700;
}
.obs-page-subtitle {
    color: var(--obs-muted);
    font-size: 13px;
    margin-top: 5px;
    max-width: 100%;
    width: 100%;
    overflow-wrap: break-word;
}
.obs-auto-badge {
    align-items: center;
    gap: 7px;
    color: #168264;
    font-size: 11px;
    padding: 8px 10px;
    background: #eaf8f2;
    border: 1px solid #d2efdf;
    border-radius: 5px;
}
.obs-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1bab79;
}
.obs-filter-bar {
    align-items: center;
    width: 100%;
    gap: 12px;
    padding: 15px;
    background: white;
    border: 1px solid var(--obs-border);
    border-radius: 9px;
}
.obs-search { flex: 1; min-width: 220px; }
.obs-country-filter { width: 180px; }
.obs-region-filter { width: 160px; }
.obs-severity-filter { width: 185px; }
.obs-filter-bar .q-field__control { border-radius: 6px; }
.obs-filter-bar .q-field__control:before { border-color: #dbe4ef; }
.obs-filter-bar input, .obs-filter-bar .q-field__native { font-size: 12px; }
.obs-reset-button { color: #8192a9; }
.obs-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    gap: 15px;
}
.obs-metric {
    padding: 22px 18px;
    border: 1px solid var(--obs-border);
    border-radius: 9px;
    box-shadow: 0 3px 10px #19365b03;
    min-width: 0;
}
.obs-metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    border-radius: 50%;
}
.obs-metric-title { font-size: 12px; font-weight: 600; }
.obs-metric-number {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -1px;
    margin: 5px 0 3px;
}
.obs-metric-note { font-size: 9px; color: var(--obs-muted); line-height: 1.5; }
.obs-tone-red { background: linear-gradient(110deg, #fff3f4, white); }
.obs-tone-orange { background: linear-gradient(110deg, #fff8ed, white); }
.obs-tone-blue { background: linear-gradient(110deg, #edf5ff, white); }
.obs-tone-purple { background: linear-gradient(110deg, #f5f1ff, white); }
.obs-tone-red .obs-metric-icon { background: #ffe0e3; color: #fa394b; }
.obs-tone-orange .obs-metric-icon { background: #ffebc3; color: #f29d14; }
.obs-tone-blue .obs-metric-icon { background: #d7eaff; color: #1677ff; }
.obs-tone-purple .obs-metric-icon { background: #e8ddff; color: #8b55e7; }
.obs-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    align-items: start;
    gap: 18px;
    width: 100%;
}
.obs-main-column, .obs-detail-column { width: 100%; gap: 17px; min-width: 0; }
.obs-panel {
    width: 100%;
    padding: 0;
    gap: 0;
    border: 1px solid var(--obs-border);
    border-radius: 9px;
    box-shadow: 0 3px 12px #19365b03;
    overflow: hidden;
}
.obs-panel-heading {
    padding: 19px 18px 12px;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
}
.obs-panel-title { font-size: 13px; font-weight: 700; }
.obs-world-map {
    width: 100%;
    height: 420px;
    background: #dcebf4 !important;
    z-index: 0;
}
.obs-world-map-expanded { height: 570px; }
.obs-world-map[data-map-style="streets"] .obs-country-outline { display: none; }
.obs-map-view-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    width: 100%;
    padding: 0 18px 12px;
}
.obs-map-style-buttons { display: flex; gap: 4px; }
.obs-map-style-button {
    padding: 6px 10px;
    border: 1px solid var(--obs-border);
    border-radius: 6px;
    background: white;
    color: var(--obs-muted);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}
.obs-map-style-button[aria-pressed="true"] {
    border-color: var(--obs-blue);
    background: var(--obs-blue);
    color: white;
}
.obs-map-style-button:focus-visible { outline: 2px solid var(--obs-blue); outline-offset: 2px; }
.obs-map-style-message { flex: 1; min-width: 180px; color: var(--obs-muted); font-size: 11px; }
.obs-map-style-message[data-state="error"] { color: #9b5a13; }
.obs-map-reset { color: var(--obs-blue); font-size: 11px; }
.obs-map-icon { background: transparent; border: 0; }
.obs-map-city-controls {
    width: 100%;
    align-items: center;
    gap: 12px;
    padding: 0 18px 14px;
}
.obs-city-select { width: 270px; max-width: 100%; }
.obs-city-status {
    flex: 1;
    min-width: 150px;
    font-size: 11px;
    color: var(--obs-muted);
}
.obs-city-icon { background: transparent; border: 0; }
.obs-city-point {
    display: block;
    width: 10px;
    height: 10px;
    border: 2px solid white;
    border-radius: 50%;
    background: #536780;
    box-shadow: 0 1px 4px #14243b33;
}
.obs-city-icon:focus { outline: 3px solid var(--obs-blue); }
.leaflet-tooltip.obs-city-label {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 1px 4px;
    border: 0;
    border-radius: 3px;
    background: #ffffffc9;
    color: #263d58;
    font-size: 11px;
    font-weight: 600;
    box-shadow: none;
}
.leaflet-tooltip.obs-city-label::before { display: none; }
.obs-dot-city { background: #536780; }
.obs-map-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 2px solid white;
    border-radius: 50%;
    color: white;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 0 0 7px #ffffff55, 0 3px 10px #14243b33;
}
.obs-marker-critical { background: #fa394b; }
.obs-marker-warning { background: #f4a21b; color: #422d07; }
.obs-marker-info { background: #1677ff; }
.obs-map-icon:focus {
    outline: 3px solid var(--obs-blue);
    outline-offset: 9px;
    border-radius: 50%;
}
.obs-map-legend {
    width: 100%;
    align-items: center;
    padding: 13px 18px 8px;
    gap: 17px;
    font-size: 10px;
    color: #536780;
}
.obs-map-note {
    padding: 0 18px 15px;
    color: var(--obs-muted);
    font-size: 10px;
    line-height: 1.7;
}
.obs-map-notice {
    margin: 4px 18px 12px;
    padding: 10px;
    background: #fff7e6;
    color: #906814;
    border-radius: 5px;
    font-size: 12px;
}
.obs-map-chooser {
    margin: 5px 18px 14px;
    padding: 12px;
    width: calc(100% - 36px);
    gap: 5px;
    background: #f5f8fd;
    border: 1px solid var(--obs-border);
    border-radius: 6px;
}
.obs-map-region-title { font-size: 12px; font-weight: 600; }
.obs-map-event { font-size: 11px; text-align: left; max-width: 100%; }
.obs-count-badge {
    color: #1677ff;
    background: #eaf3ff;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 10px;
}
.obs-table-subtitle {
    color: var(--obs-muted);
    font-size: 10px;
    padding: 0 18px 15px;
}
.obs-event-grid { width: 100%; height: 615px; }
.obs-event-grid .ag-root-wrapper {
    border-radius: 0;
    border-width: 1px 0 0;
    border-color: var(--obs-border);
}
.obs-event-grid .ag-header { background: #f5f8fd; }
.obs-event-grid .ag-header-cell { font-size: 11px; }
.obs-event-grid .ag-cell { font-size: 11px; }
.obs-event-grid .ag-row { cursor: pointer; }
.obs-event-grid .ag-row-selected { background: #edf4ff; }
.obs-event-grid .ag-paging-panel { font-size: 10px; }
.obs-cell-critical { color: #e33247; font-weight: 600; }
.obs-cell-warning { color: #be7810; font-weight: 600; }
.obs-cell-info { color: #1677ff; font-weight: 600; }
.obs-table-footer {
    color: var(--obs-muted);
    font-size: 10px;
    padding: 12px 16px;
    align-items: center;
    gap: 7px;
    border-top: 1px solid var(--obs-border);
}
.obs-empty-selection {
    min-height: 225px;
    align-items: center;
    justify-content: center;
    padding: 30px;
    gap: 13px;
    color: #9aacc3;
    font-size: 12px;
}
.obs-empty-title { color: #475872; font-weight: 600; font-size: 13px; }
.obs-event-summary { padding: 9px 18px 18px; gap: 4px; width: 100%; }
.obs-selected-title { font-size: 15px; font-weight: 700; }
.obs-field-label { color: var(--obs-muted); font-size: 10px; margin-top: 10px; }
.obs-field-value { font-size: 12px; overflow-wrap: anywhere; }
.obs-severity-badge { padding: 5px 8px; font-size: 10px; margin-top: 9px; }
.obs-badge-critical { background: #fee7eb; color: #d62a3e; }
.obs-badge-warning { background: #fff1d8; color: #a96b08; }
.obs-badge-info { background: #e7f1ff; color: #1677ff; }
.obs-severity-critical { color: #fa394b; }
.obs-severity-warning { color: #f29d14; }
.obs-severity-info { color: #1677ff; }
.obs-information-note {
    background: #eef5ff;
    color: #41638d;
    border-radius: 5px;
    font-size: 10px;
    line-height: 1.7;
    padding: 11px;
    margin-top: 15px;
}
.obs-dataset-panel { padding-bottom: 16px; }
.obs-severity-row {
    align-items: center;
    gap: 9px;
    padding: 9px 18px;
    width: 100%;
    font-size: 12px;
}
.obs-severity-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.obs-dot { width: 7px; height: 7px; border-radius: 50%; }
.obs-dot-critical { background: #fa394b; }
.obs-dot-warning { background: #f4a21b; }
.obs-dot-info { background: #1677ff; }
.obs-dataset-note {
    font-size: 11px;
    line-height: 1.7;
    color: var(--obs-muted);
    padding: 3px 18px 0;
}
.obs-bottom-note {
    color: var(--obs-muted);
    font-size: 11px;
    gap: 8px;
    align-items: center;
}
.obs-bottom-note > div { min-width: 0; flex: 1; }
.obs-page-footer {
    color: #8b99ad;
    width: 100%;
    font-size: 10px;
    margin-top: 3px;
}
.obs-muted { color: var(--obs-muted); }
.obs-planned-page {
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}
.obs-planned-card {
    align-items: center;
    gap: 20px;
    max-width: 570px;
    padding: 48px 35px;
    border: 1px solid var(--obs-border);
    border-radius: 12px;
    box-shadow: 0 8px 35px #19365b07;
}
.obs-planned-icon { color: var(--obs-blue); }
.obs-phase-badge {
    color: var(--obs-blue);
    background: #eaf3ff;
    padding: 6px 9px;
    font-size: 10px;
}
.obs-planned-copy { text-align: center; font-size: 15px; line-height: 1.7; }
.obs-return-link {
    color: var(--obs-blue);
    text-decoration: none;
    font-size: 13px;
    margin-top: 12px;
}

@media (max-width: 1400px) {
    .obs-page { padding: 26px 22px; gap: 18px; }
    .obs-header { padding: 0 22px; }
    .obs-metric { padding: 18px 12px; }
    .obs-metric .q-gutter-x-md { gap: 10px; }
    .obs-content-grid { grid-template-columns: minmax(0, 1fr) 270px; }
    .obs-metric-note { max-width: 125px; }
}
@media (max-width: 1100px) {
    .obs-menu-button { display: inline-flex; }
    .obs-refresh-time { display: none; }
    .obs-content-grid { grid-template-columns: minmax(0, 1fr) 270px; }
}
@media (max-width: 800px) {
    .obs-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .obs-content-grid { grid-template-columns: minmax(0, 1fr); }
    .obs-detail-column {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
    .obs-search { flex-basis: 100%; }
    .obs-country-filter, .obs-severity-filter, .obs-region-filter {
        flex: 1;
        min-width: 125px;
    }
    .obs-auto-badge { margin-top: 7px; }
    .obs-event-grid { height: 600px; }
}
@media (max-width: 520px) {
    .obs-header { height: 66px; padding: 0 12px; gap: 8px; }
    .obs-breadcrumb { display: none; }
    .obs-demo-badge { font-size: 10px; }
    .obs-page { padding: 24px 13px 18px; gap: 16px; }
    .obs-page-title { font-size: 26px; }
    .obs-page-subtitle { font-size: 12px; line-height: 1.7; }
    .obs-filter-bar { gap: 10px; padding: 12px; }
    .obs-region-filter { flex-basis: 100%; }
    .obs-title-row > .nicegui-column { flex-basis: 100%; }
    .obs-metrics-grid { gap: 10px; }
    .obs-metric { padding: 14px 10px; }
    .obs-metric .q-row { gap: 8px; }
    .obs-metric-icon { width: 32px; height: 32px; }
    .obs-metric-icon .q-icon { font-size: 21px !important; }
    .obs-metric-title { font-size: 11px; }
    .obs-metric-number { font-size: 28px; }
    .obs-metric-note { font-size: 8px; }
    .obs-detail-column { display: flex; }
    .obs-panel-heading { flex-wrap: wrap; }
    .obs-panel-heading .q-checkbox { font-size: 11px; }
    .obs-planned-card { padding: 35px 20px; }
    .obs-world-map { height: 320px; }
    .obs-world-map-expanded { height: 440px; }
    .obs-city-select { width: 100%; }
}

.obs-world-map .leaflet-interactive:focus {
    outline: none;
}

.obs-city-point-selected {
    background: #ff9500;
    border: 2px solid #168cff;
    transform: scale(1.6);
    box-shadow: 0 0 0 4px rgb(22 140 255 / 20%),
                0 0 12px 5px rgb(255 149 0 / 55%);
}

.obs-city-label-selected {
    color: #135eac;
    border: 1px solid #ff9500;
    box-shadow: 0 0 8px rgb(255 149 0 / 35%);
    font-weight: 700;
}

.obs-brand-logo {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
}

/* Personal dashboard layout; other routes retain their fixed layout. */
.obs-pass-through { display: contents; }
.obs-workspace {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
    align-items: start;
    min-height: 160px;
    border-radius: 10px;
}
.obs-workspace .obs-metrics-grid,
.obs-workspace .obs-content-grid,
.obs-workspace .obs-main-column,
.obs-workspace .obs-detail-column { display: contents; }
.obs-workspace .obs-bottom-note { grid-column: 1 / -1; order: 99; }
.obs-widget {
    grid-column: span var(--widget-span, 6);
    min-width: 0;
    border-radius: 10px;
}
.obs-widget[hidden], .obs-widget-library[hidden] { display: none !important; }
.obs-widget > .obs-metric { height: 100%; }
.obs-widget-tools {
    display: none;
    align-items: center;
    gap: 5px;
    padding: 8px;
    background: #edf4ff;
    border: 1px solid #c9ddfb;
    border-radius: 9px 9px 0 0;
    flex-wrap: wrap;
}
.obs-workspace-editing .obs-widget-tools { display: flex; }
.obs-workspace-editing .obs-widget { outline: 1px dashed #a9c9f9; }
.obs-widget-drag {
    flex: 1;
    min-width: 80px;
    background: none;
    border: 0;
    color: #244b82;
    text-align: left;
    font-size: 11px;
    cursor: grab;
    padding: 5px 0;
}
.obs-widget-drag:active { cursor: grabbing; }
.obs-widget-size {
    border: 1px solid #b8cde8;
    border-radius: 5px;
    background: white;
    font-size: 11px;
    max-width: 110px;
    padding: 4px;
}
.obs-editor-toolbar { display: flex; align-items: center; gap: 12px; }
.obs-editor-status { font-size: 11px; color: var(--obs-muted); }
.obs-editor-button {
    background: white;
    border: 1px solid #c8d8ef;
    color: #2563ad;
    padding: 6px 9px;
    border-radius: 6px;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}
.obs-editor-button:hover { background: #e8f1ff; }
.obs-editor-button:disabled { opacity: 0.5; cursor: default; }
.obs-editor-button:focus-visible, .obs-widget-drag:focus-visible {
    outline: 2px solid #1677ff;
    outline-offset: 2px;
}
.obs-widget-library {
    padding: 15px 8px;
    margin: 15px 0;
    border-top: 1px solid #34435a;
}
.obs-widget-library h3 { font-size: 13px; line-height: 1.4; margin: 0 0 8px; }
.obs-widget-library p { font-size: 10px; color: #91a7c7; }
.obs-library-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    padding: 8px 5px;
    font-size: 11px;
    cursor: grab;
    border: 1px dashed #526681;
    border-radius: 6px;
    margin-bottom: 6px;
}
.obs-library-active { border-style: solid; border-color: #2b4565; }
.obs-drop-active { outline: 2px dashed #1677ff; background: #edf5ff; }
.obs-widget-dragging { opacity: 0.45; }
@media (max-width: 900px) {
    .obs-widget { grid-column: span 6; }
    .obs-widget[data-widget="map"],
    .obs-widget[data-widget="events"] { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .obs-widget { grid-column: 1 / -1; }
    .obs-editor-toolbar { flex-wrap: wrap; }
}

.obs-drag-preview {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    padding: 10px 16px;
    background: #1677ff;
    color: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px #14243b30;
    font-size: 13px;
}

/* Connection failures remain visible instead of triggering repeated reloads. */
.obs-connection-status {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    max-width: calc(100vw - 32px);
    padding: 14px 18px;
    border: 1px solid #e5b35c;
    border-radius: 8px;
    background: #fff8e8;
    color: #624710;
    box-shadow: 0 4px 18px #14243b25;
}
.obs-connection-status[hidden] { display: none !important; }
.obs-connection-status button {
    margin-left: 12px;
    padding: 6px 10px;
    cursor: pointer;
    border: 1px solid #624710;
    border-radius: 5px;
    background: white;
    color: inherit;
}
.obs-connection-status details { margin-top: 10px; }
.obs-connection-status summary { cursor: pointer; }
.obs-connection-status pre {
    max-height: 240px;
    max-width: 80vw;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 11px;
    user-select: text;
}
