:root {
    --bg: #f4f6f2;
    --surface: #ffffff;
    --surface-muted: #f7f8f5;
    --text: #1d2520;
    --text-muted: #647067;
    --line: #dde3dc;
    --green: #1f8f61;
    --blue: #2563eb;
    --amber: #d97706;
    --red: #dc2626;
    --shadow: 0 14px 40px rgba(29, 37, 32, 0.08);
    --rail-width: clamp(220px, 13.5vw, 280px);
    --feed-width: clamp(330px, 20vw, 430px);
    --list-width: clamp(280px, 18vw, 360px);
    --panel-gap: clamp(12px, 1.1vw, 18px);
    --topbar-height: clamp(64px, 7dvh, 80px);
    --content-pad: clamp(12px, 1.2vw, 24px);
    --dashboard-height: calc(100dvh - var(--topbar-height) - var(--content-pad) - var(--content-pad));
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

.hidden {
    display: none !important;
}

.material-symbols-rounded {
    font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
    line-height: 1;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--rail-width) minmax(0, 1fr);
    min-height: 100dvh;
}

.side-rail {
    position: sticky;
    top: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 1.5vw, 28px);
    padding: clamp(20px, 1.5vw, 28px) clamp(16px, 1.1vw, 20px);
    overflow-y: auto;
    background: #fbfcf8;
    border-right: 1px solid var(--line);
}

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

.brand-mark {
    width: clamp(42px, 2.6vw, 48px);
    height: clamp(42px, 2.6vw, 48px);
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #1d2520;
    color: #ffffff;
}

.brand-mark span {
    font-size: 25px;
}

.brand-block h1,
.brand-block p,
.top-bar h2,
.top-bar p,
.panel-toolbar h3,
.panel-toolbar p,
.feed-panel h3,
.map-headline h3,
.map-headline p,
.cctv-focus-header h3,
.cctv-focus-header p {
    margin: 0;
}

.brand-block h1 {
    font-size: clamp(18px, 1.08vw, 21px);
    font-weight: 800;
    letter-spacing: 0;
}

.brand-block p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.module-nav {
    display: grid;
    gap: 8px;
}

.nav-item {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 clamp(12px, 0.85vw, 16px);
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-weight: 750;
    text-align: left;
}

.nav-item:hover {
    background: #eef3ec;
    color: var(--text);
}

.nav-item.active {
    background: #e4f4e8;
    border-color: #b8dec0;
    color: #125c38;
}

.nav-item span:last-child {
    min-width: 0;
}

.sync-dot,
.live-badge span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 0 5px rgba(31, 143, 97, 0.14);
    flex: 0 0 auto;
}

.workspace {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.top-bar {
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: clamp(14px, 1.4vw, 18px) clamp(18px, 2vw, 28px);
    border-bottom: 1px solid var(--line);
    background: rgba(244, 246, 242, 0.9);
    backdrop-filter: blur(12px);
}

.eyebrow {
    color: var(--green);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.top-bar h2 {
    margin-top: 4px;
    font-size: clamp(21px, 2vw, 25px);
    letter-spacing: 0;
}

.top-actions,
.toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.toolbar-actions {
    flex: 1 1 520px;
}

.weather-toolbar-actions {
    flex: 1 1 680px;
}

.date-chip,
.meta-chip,
.sync-pill,
.live-badge,
.count-badge,
.cctv-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.icon-btn,
.tool-btn,
.segmented-control button {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
}

.icon-btn {
    width: 38px;
    display: inline-grid;
    place-items: center;
}

.icon-btn.compact {
    width: 34px;
    min-height: 34px;
}

.icon-btn:hover,
.tool-btn:hover {
    border-color: #b6c2b8;
    background: #f7faf6;
}

.tool-btn.active {
    border-color: #d18b16;
    background: #fff7e8;
    color: #7a4a00;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    font-weight: 780;
    white-space: nowrap;
}

.tool-btn.primary {
    border-color: var(--green);
    background: var(--green);
    color: #ffffff;
}

.tool-btn.primary:hover {
    border-color: #19794f;
    background: #19794f;
}

.tab-content {
    display: none;
    min-height: calc(100dvh - var(--topbar-height));
    padding: var(--content-pad);
}

.tab-content.active {
    display: block;
}

.outage-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--feed-width);
    gap: var(--panel-gap);
    height: var(--dashboard-height);
    min-height: min(560px, var(--dashboard-height));
}

.map-stage,
.feed-panel,
.page-panel,
.cctv-focus-panel,
.cctv-list-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.map-stage {
    position: relative;
    overflow: hidden;
    min-height: clamp(420px, var(--dashboard-height), 660px);
    background: #e5ebe4;
}

.outage-grid .map-stage {
    min-height: 0;
}

.weather-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.map-stage iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    opacity: 1;
    transition: opacity 0.22s ease;
}

.outage-map-frame-buffer {
    z-index: 1;
    opacity: 0;
    pointer-events: none;
}

.outage-map-frame-active {
    z-index: 1;
    opacity: 1;
}

.outage-map-frame-retiring {
    opacity: 0;
    pointer-events: none;
}

.map-headline {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    left: auto;
    width: min(clamp(360px, 30vw, 500px), calc(100% - 24px));
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 9px;
    min-height: 46px;
    padding: 8px 9px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: rgba(24, 35, 30, 0.96);
    color: #ffffff;
    backdrop-filter: blur(12px);
    box-shadow: 0 14px 30px rgba(25, 31, 34, 0.24);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.map-stage.weather-warning-open .map-headline {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
}

.headline-title-group {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.headline-copy {
    min-width: 0;
}

.headline-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: rgba(255, 218, 142, 0.2);
    color: #ffd27a;
    border: 1px solid rgba(255, 218, 142, 0.34);
}

.headline-icon span {
    font-size: 20px;
}

.map-headline h3 {
    color: #ffffff;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-headline p {
    color: rgba(248, 250, 246, 0.92);
    font-size: 12px;
    font-weight: 800;
}

.headline-timestamp {
    justify-self: start;
    max-width: 100%;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.14);
    text-align: left;
    white-space: nowrap;
}

.map-headline-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 7px;
}

.map-headline .icon-btn.compact {
    width: 30px;
    height: 30px;
    min-height: 30px;
    flex: 0 0 30px;
    border-color: rgba(255, 255, 255, 0.26);
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.map-headline .icon-btn.compact span {
    font-size: 19px;
}

.map-headline .icon-btn.compact:hover {
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.2);
}

.map-headline .sync-pill {
    min-height: 28px;
    gap: 6px;
    padding: 0 9px;
    border-color: rgba(187, 247, 208, 0.34);
    background: rgba(236, 253, 245, 0.16);
    color: #f0fdf4;
    font-size: 11px;
}

.map-headline .sync-dot {
    width: 7px;
    height: 7px;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.2);
}

.map-headline .sync-pill.error {
    border-color: rgba(252, 165, 165, 0.42);
    background: rgba(127, 29, 29, 0.36);
    color: #fee2e2;
}

.weather-warning-control {
    position: absolute;
    z-index: 3;
    left: 16px;
    bottom: 16px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 13px;
    border: 1px solid rgba(214, 145, 34, 0.36);
    border-radius: 8px;
    background: rgba(255, 251, 235, 0.94);
    color: #8a4c08;
    font-size: 13px;
    font-weight: 850;
    box-shadow: 0 10px 24px rgba(29, 37, 32, 0.16);
    backdrop-filter: blur(8px);
}

.weather-warning-control span:first-child {
    font-size: 20px;
}

.weather-warning-control:hover,
.weather-warning-control.active {
    border-color: rgba(217, 119, 6, 0.64);
    background: #fff7df;
    color: #713f12;
}

.weather-warning-panel {
    position: absolute;
    z-index: 4;
    top: 16px;
    left: 16px;
    bottom: 64px;
    width: min(clamp(390px, 30vw, 520px), calc(100% - 32px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(207, 213, 202, 0.96);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(29, 37, 32, 0.2);
}

.weather-warning-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #1f2a24;
    color: #ffffff;
}

.weather-warning-panel-header div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.weather-warning-panel-header strong {
    font-size: 14px;
    font-weight: 850;
}

.weather-warning-panel-header span:not(.material-symbols-rounded) {
    color: rgba(255, 255, 255, 0.66);
    font-size: 11px;
    font-weight: 700;
}

.weather-warning-close {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.weather-warning-close:hover {
    background: rgba(255, 255, 255, 0.16);
}

.weather-warning-close span {
    font-size: 20px;
}

.weather-warning-panel-body {
    flex: 1 1 auto;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    background: #eef2ec;
}

.weather-warning-message {
    min-height: 36px;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 8px 12px;
    border-bottom: 1px solid #dde3dc;
    background: #fff8e8;
    color: #6b4b15;
    font-size: 12px;
    font-weight: 800;
}

.weather-warning-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    place-self: center;
    background: #f8faf7;
}

.weather-warning-panel .weather-warning-frame {
    position: static;
    inset: auto;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 260px;
    border: 0;
    opacity: 1;
    transition: none;
    background: #e9eee8;
}

.weather-warning-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 12px 12px;
    color: var(--green);
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
}

.weather-warning-link span:first-child {
    font-size: 18px;
}

.sync-pill.error {
    color: var(--red);
    border-color: #fecaca;
    background: #fff5f5;
}

.sync-dot.error {
    background: var(--red);
    box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.12);
}

.feed-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.feed-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: clamp(14px, 1.1vw, 18px);
    border-bottom: 1px solid var(--line);
}

.feed-panel-header h3 {
    margin-top: 4px;
    font-size: 20px;
}

.feed-panel-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.feed-action-btn {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid #c8d4cc;
    border-radius: 8px;
    background: #f7faf6;
    color: #243228;
    font-size: 12px;
    font-weight: 820;
}

.feed-action-btn span:first-child {
    color: var(--green);
    font-size: 18px;
}

.feed-action-btn:hover {
    border-color: #9fbea8;
    background: #eef7f0;
}

.live-badge {
    color: var(--green);
}

.feed-section {
    padding: 16px 18px 4px;
    min-height: 0;
}

.feed-panel-scroll {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 14px;
    scrollbar-gutter: stable;
}

.feed-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.feed-title .danger {
    color: var(--red);
}

.feed-title .info {
    color: var(--blue);
}

.feed-title .warning {
    color: var(--amber);
}

.feed-title .rain {
    color: #0284c7;
}

.feed-title .notice {
    color: #4f46e5;
}

.count-badge {
    min-width: 28px;
    justify-content: center;
    min-height: 24px;
    padding: 0 8px;
}

.count-badge.danger {
    color: var(--red);
    border-color: #fecaca;
    background: #fff5f5;
}

.count-badge.info {
    color: var(--blue);
    border-color: #bfdbfe;
    background: #eff6ff;
}

.count-badge.warning {
    color: var(--amber);
    border-color: #fed7aa;
    background: #fff7ed;
}

.count-badge.rain {
    color: #0284c7;
    border-color: #bae6fd;
    background: #f0f9ff;
}

.count-badge.notice {
    color: #4f46e5;
    border-color: #c7d2fe;
    background: #eef2ff;
}

.feed-list {
    display: grid;
    gap: 8px;
    overflow: visible;
    padding-right: 2px;
}

.outage-feed-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.outage-feed-card.type-real {
    border-left: 4px solid var(--red);
}

.outage-feed-card.type-plan {
    border-left: 4px solid var(--blue);
}

.outage-feed-card.type-fire {
    border-left: 4px solid var(--amber);
}

.outage-feed-card.type-rain {
    border-left: 4px solid #0284c7;
}

.outage-feed-card.type-notice {
    border-left: 4px solid #4f46e5;
}

.feed-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.feed-office {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 13px;
    font-weight: 850;
}

.feed-office span:last-child,
.feed-desc {
    overflow-wrap: anywhere;
}

.feed-type {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
}

.feed-desc {
    color: #35423a;
    font-size: 13px;
    line-height: 1.45;
}

.fire-weather-summary {
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(217, 119, 6, 0.2);
    border-radius: 8px;
    background: #fff8ed;
}

.fire-weather-title {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #92400e;
    font-size: 12px;
    font-weight: 850;
}

.fire-weather-title .material-symbols-rounded {
    font-size: 16px;
}

.fire-weather-risk,
.fire-weather-normal {
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
}

.fire-weather-risk {
    color: #991b1b;
    background: #fee2e2;
}

.fire-weather-normal {
    color: #166534;
    background: #dcfce7;
}

.fire-weather-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    color: #5f4b32;
    font-size: 11px;
    font-weight: 700;
}

.fire-weather-grid span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.fire-weather-grid strong {
    color: #2f2f2f;
    font-weight: 900;
}

.rain-weather-summary {
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(2, 132, 199, 0.22);
    border-radius: 8px;
    background: #f0f9ff;
}

.rain-weather-title {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #075985;
    font-size: 12px;
    font-weight: 850;
}

.rain-weather-title .material-symbols-rounded {
    font-size: 16px;
}

.rain-weather-risk,
.rain-weather-normal {
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
}

.rain-weather-risk {
    color: #075985;
    background: #bae6fd;
}

.rain-weather-normal {
    color: #166534;
    background: #dcfce7;
}

.rain-weather-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    color: #315166;
    font-size: 11px;
    font-weight: 700;
}

.rain-weather-grid span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.rain-weather-grid strong {
    color: #1d2520;
    font-weight: 900;
}

.outage-feed-card.type-notice .feed-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 650;
}

.feed-link {
    width: fit-content;
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

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

.page-panel {
    height: var(--dashboard-height);
    min-height: 420px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-toolbar {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: clamp(14px, 1.1vw, 16px) clamp(14px, 1.2vw, 18px);
    border-bottom: 1px solid var(--line);
}

.panel-toolbar > div:first-child {
    flex: 0 0 auto;
    min-width: 150px;
}

.panel-toolbar h3 {
    margin-top: 4px;
    font-size: 21px;
}

.segmented-control {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(82px, 1fr));
    gap: 4px;
    padding: 4px;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef2ec;
}

.weather-control-stack {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.source-control {
    grid-template-columns: repeat(2, minmax(76px, 1fr));
}

.layer-control {
    grid-template-columns: repeat(3, minmax(78px, 1fr));
}

.segmented-control button {
    border-color: transparent;
    min-height: 32px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 800;
}

.segmented-control button.active {
    background: #ffffff;
    color: var(--green);
    box-shadow: 0 3px 10px rgba(29, 37, 32, 0.08);
}

.switch-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 750;
}

.switch-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-track {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #d7ded6;
    transition: background 0.2s ease;
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 2px 5px rgba(29, 37, 32, 0.18);
    transition: transform 0.2s ease;
}

.switch-row input:checked + .switch-track {
    background: var(--green);
}

.switch-row input:checked + .switch-track::after {
    transform: translateX(18px);
}

.weather-frame-shell {
    flex: 1 1 auto;
    display: flex;
    position: relative;
    overflow: hidden;
    min-height: 0;
    height: auto;
    background: #e9eee8;
}

.weather-frame-shell .weather-frame {
    position: absolute;
    inset: 0;
    min-height: 0;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition: opacity 180ms ease;
}

.weather-frame-shell .weather-frame.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.weather-frame-preload {
    position: fixed;
    left: -12000px;
    top: 0;
    width: 900px;
    height: 680px;
    border: 0;
    opacity: 0.01;
    pointer-events: none;
}

.weather-frame-shell.is-loading .weather-frame.is-active {
    opacity: 0.68;
}

.weather-loading {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--green);
    font-size: 14px;
    font-weight: 850;
    background: rgba(245, 248, 244, 0.66);
    pointer-events: none;
}

.weather-loading-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(42, 122, 76, 0.2);
    border-top-color: var(--green);
    border-radius: 999px;
    animation: weather-spin 800ms linear infinite;
}

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

.select-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 750;
}

.select-field select {
    min-width: 150px;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    padding: 0 34px 0 12px;
}

.cctv-layout {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--list-width);
    gap: var(--panel-gap);
    padding: var(--panel-gap);
    min-height: 0;
}

.cctv-focus-panel,
.cctv-list-panel {
    box-shadow: none;
    min-width: 0;
    min-height: 0;
}

.cctv-focus-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cctv-focus-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
}

.cctv-focus-header h3 {
    margin-top: 4px;
    font-size: 20px;
    overflow-wrap: anywhere;
}

.cctv-chip {
    color: var(--green);
    border-color: #b8dec0;
    background: #f0faf2;
}

.cctv-video-shell {
    flex: 1;
    min-height: 0;
    display: grid;
    place-items: center;
    background: #121612;
}

.cctv-video {
    width: 100%;
    height: 100%;
    max-height: none;
    background: #000000;
    object-fit: contain;
}

.cctv-card-footer {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
}

.cctv-status {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 750;
}

.cctv-status.ok {
    color: var(--green);
}

.cctv-status.error {
    color: var(--red);
}

.cctv-card-footer a {
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.cctv-list-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cctv-list-panel h4 {
    margin: 0;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
}

.cctv-stream-list {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    gap: 8px;
    padding: 12px;
    overflow: auto;
    max-height: none;
}

.cctv-stream-item {
    width: 100%;
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    text-align: left;
}

.cctv-stream-item:hover {
    border-color: #b8dec0;
    background: #f5faf4;
}

.cctv-stream-item.active {
    border-color: var(--green);
    background: #eff9f1;
}

.cctv-stream-item .name {
    color: var(--text);
    font-size: 14px;
    font-weight: 850;
}

.cctv-stream-item .meta {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.empty-state {
    padding: 18px;
    border: 1px dashed #cbd6cb;
    border-radius: 8px;
    color: var(--text-muted);
    background: #fbfcf8;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}

#toast-root {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 5000;
    display: grid;
    gap: 8px;
    pointer-events: none;
}

.toast {
    min-width: 220px;
    max-width: min(360px, calc(100vw - 40px));
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    box-shadow: 0 16px 40px rgba(29, 37, 32, 0.18);
    font-size: 13px;
    font-weight: 760;
}

.toast.success {
    border-color: #b8dec0;
}

.toast.error {
    border-color: #fecaca;
}

.toast.info {
    border-color: #bfdbfe;
}

body.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 6000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(21, 28, 24, 0.46);
    backdrop-filter: blur(6px);
}

.feedback-fab {
    position: fixed;
    left: 22px;
    bottom: 22px;
    z-index: 5000;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid rgba(31, 143, 97, 0.42);
    border-radius: 8px;
    background: #ffffff;
    color: var(--green);
    box-shadow: 0 18px 42px rgba(29, 37, 32, 0.18);
    font-weight: 850;
}

.feedback-fab:hover {
    background: #eef8f1;
}

.report-modal {
    width: min(820px, calc(100vw - 32px));
    max-height: min(720px, calc(100dvh - 48px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(203, 214, 205, 0.86);
    border-radius: 8px;
    background: #fbfcf8;
    box-shadow: 0 28px 90px rgba(10, 18, 13, 0.34);
}

.feedback-modal {
    width: min(520px, calc(100vw - 32px));
    max-height: min(720px, calc(100dvh - 48px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(203, 214, 205, 0.86);
    border-radius: 8px;
    background: #fbfcf8;
    box-shadow: 0 28px 90px rgba(10, 18, 13, 0.34);
}

.report-modal-header {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.report-modal-header h3 {
    margin: 4px 0 0;
    font-size: 21px;
}

.report-modal-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    background: #f3f6f1;
}

.feedback-form {
    display: grid;
    gap: 14px;
    padding: 18px 20px 20px;
    overflow: auto;
}

.feedback-field {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-size: 13px;
    font-weight: 780;
}

.feedback-field input,
.feedback-field select,
.feedback-field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    outline: none;
}

.feedback-field input,
.feedback-field select {
    min-height: 42px;
    padding: 0 12px;
}

.feedback-field textarea {
    min-height: 154px;
    resize: vertical;
    padding: 12px;
    line-height: 1.48;
}

.feedback-field input:focus,
.feedback-field select:focus,
.feedback-field textarea:focus {
    border-color: rgba(31, 143, 97, 0.62);
    box-shadow: 0 0 0 3px rgba(31, 143, 97, 0.12);
}

.feedback-privacy-note {
    margin: -2px 0 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.feedback-privacy-note a {
    color: var(--green);
    font-weight: 780;
}

.feedback-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.feedback-status {
    min-height: 20px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 740;
}

.feedback-status.error {
    color: var(--red);
}

.feedback-actions {
    display: flex;
    justify-content: flex-end;
}

.privacy-page {
    background: #f7f8f5;
}

.privacy-document {
    width: min(760px, calc(100% - 32px));
    margin: 0 auto;
    padding: 52px 0 72px;
}

.privacy-document h1 {
    margin: 6px 0 30px;
    font-size: 34px;
    line-height: 1.16;
    letter-spacing: 0;
}

.privacy-document section {
    padding: 24px 0;
    border-top: 1px solid var(--line);
}

.privacy-document h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

.privacy-document p {
    margin: 0;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
}

.citizen-report-list {
    display: grid;
    gap: 10px;
    padding: 16px 20px 20px;
    overflow: auto;
}

.citizen-report-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: 8px;
    background: #ffffff;
}

.citizen-report-card.fire {
    border-left-color: var(--amber);
}

.citizen-report-head,
.citizen-report-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.citizen-report-title {
    min-width: 0;
    font-size: 14px;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.citizen-report-category {
    flex: 0 0 auto;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    background: #eef7f0;
    color: var(--green);
    font-size: 11px;
    font-weight: 850;
}

.citizen-report-category.fire {
    background: #fff7ed;
    color: var(--amber);
}

.citizen-report-content {
    color: #344039;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.citizen-report-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.citizen-report-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.citizen-report-meta .material-symbols-rounded {
    font-size: 16px;
}

@media (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 84px minmax(0, 1fr);
    }

    .brand-block {
        justify-content: center;
    }

    .brand-block div:last-child,
    .nav-item span:last-child {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 0;
    }

    .outage-grid,
    .cctv-layout {
        grid-template-columns: 1fr;
    }

    .outage-grid {
        height: auto;
        min-height: 0;
    }

    .outage-grid .map-stage {
        min-height: clamp(420px, 60dvh, 620px);
    }

    .page-panel {
        height: auto;
        min-height: calc(100dvh - var(--topbar-height) - var(--content-pad) - var(--content-pad));
    }

    .weather-frame-shell {
        min-height: clamp(420px, 58dvh, 640px);
    }

    .cctv-video-shell {
        min-height: clamp(360px, 52dvh, 520px);
    }

    .feed-panel {
        height: auto;
    }

    .feed-panel-scroll {
        overflow: visible;
        padding-bottom: 0;
    }

    .feed-list,
    .cctv-stream-list {
        max-height: none;
    }
}

@media (min-width: 1181px) and (max-width: 1360px) {
    :root {
        --rail-width: 220px;
        --feed-width: 330px;
        --content-pad: 14px;
        --panel-gap: 12px;
    }

    .brand-block {
        gap: 10px;
    }

    .brand-mark {
        width: 42px;
        height: 42px;
    }

    .brand-block h1 {
        font-size: 18px;
    }

    .brand-block p {
        font-size: 12px;
    }

    .map-headline {
        width: min(420px, calc(100% - 20px));
    }

    .feed-panel-header {
        gap: 10px;
    }

    .weather-toolbar-actions {
        justify-content: flex-start;
    }

    .weather-control-stack {
        justify-content: flex-start;
    }
}

@media (min-width: 1800px) {
    :root {
        --feed-width: clamp(380px, 18vw, 430px);
        --list-width: clamp(320px, 16vw, 380px);
    }
}

@media (min-width: 1181px) and (max-height: 820px) {
    .side-rail {
        gap: 18px;
        padding: 20px 16px;
    }

    .nav-item {
        min-height: 44px;
    }

    .feed-panel-header {
        padding: 14px;
    }

    .feed-section {
        padding: 12px 14px 2px;
    }

    .panel-toolbar {
        min-height: 62px;
        padding: 12px 14px;
    }
}

@media (min-width: 1181px) and (max-height: 700px) {
    .brand-mark {
        width: 40px;
        height: 40px;
    }

    .brand-block h1 {
        font-size: 17px;
    }

    .brand-block p {
        font-size: 12px;
    }

    .map-headline {
        top: 10px;
        right: 10px;
        width: min(430px, calc(100% - 20px));
    }
}

@media (max-width: 760px) {
    .app-shell {
        display: block;
    }

    .side-rail {
        position: static;
        height: auto;
        padding: 14px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .brand-block {
        justify-content: flex-start;
    }

    .brand-block div:last-child,
    .nav-item span:last-child {
        display: block;
    }

    .module-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        overflow-x: auto;
    }

    .nav-item {
        justify-content: center;
        min-height: 44px;
        padding: 0 8px;
    }

    .nav-item span:last-child {
        min-width: 0;
        overflow-wrap: anywhere;
        font-size: 12px;
        line-height: 1.2;
        text-align: center;
    }

    .top-bar,
    .panel-toolbar,
    .cctv-focus-header,
    .cctv-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-actions,
    .toolbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .feed-panel-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .tab-content {
        min-height: auto;
        padding: 12px;
    }

    .map-stage {
        min-height: clamp(420px, 68dvh, 640px);
    }

    .page-panel {
        height: auto;
        min-height: auto;
    }

    .map-headline {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        min-height: 44px;
        grid-template-columns: auto minmax(92px, 1fr) auto;
        align-items: center;
        column-gap: 10px;
        row-gap: 0;
        padding: 7px 8px;
    }

    .map-headline h3 {
        font-size: 16px;
    }

    .map-headline p {
        font-size: 11px;
    }

    .headline-title-group {
        grid-column: 1;
        min-width: 0;
    }

    .headline-timestamp {
        grid-column: 2;
        justify-self: start;
        min-height: 28px;
        padding: 0 8px;
    }

    .map-headline-actions {
        grid-column: 3;
        grid-row: 1;
        margin-left: 0;
    }

    .map-headline-actions .sync-pill {
        display: none;
    }

    .weather-warning-control {
        left: 10px;
        bottom: 10px;
        min-height: 36px;
        padding: 0 11px;
        font-size: 12px;
    }

    .weather-warning-panel {
        top: 10px;
        left: 10px;
        right: 10px;
        bottom: 56px;
        width: auto;
    }

    .weather-warning-panel .weather-warning-frame {
        min-height: 240px;
    }

    .map-headline .headline-icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .headline-icon span {
        font-size: 22px;
    }

    .modal-backdrop {
        padding: 12px;
    }

    .feedback-fab {
        left: 14px;
        bottom: 14px;
        min-height: 42px;
        padding: 0 12px;
    }

    .report-modal {
        width: calc(100vw - 24px);
        max-height: calc(100dvh - 24px);
    }

    .feedback-modal {
        width: calc(100vw - 24px);
        max-height: calc(100dvh - 24px);
    }

    .report-modal-header,
    .report-modal-summary,
    .citizen-report-list,
    .feedback-form {
        padding-left: 14px;
        padding-right: 14px;
    }

    .citizen-report-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .weather-frame-shell,
    .cctv-video-shell {
        min-height: 0;
        height: clamp(360px, 58dvh, 520px);
    }

    .cctv-layout {
        padding: 12px;
    }

    .select-field,
    .select-field select,
    .tool-btn,
    .weather-control-stack,
    .segmented-control {
        width: 100%;
    }

    .weather-control-stack {
        align-items: stretch;
        flex-direction: column;
    }

    .segmented-control {
        grid-template-columns: repeat(2, 1fr);
    }

    .feedback-actions .tool-btn {
        width: auto;
        min-width: 104px;
    }

    .layer-control {
        grid-template-columns: repeat(3, 1fr);
    }

    .fire-weather-grid,
    .rain-weather-grid {
        grid-template-columns: 1fr;
    }
}
