@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --ink: #17262d;
  --muted: #7e8c91;
  --line: #e9eeec;
  --paper: #fff;
  --canvas: #f4f7f5;
  --green: #18856c;
  --green-dark: #126b56;
  --green-soft: #e9f5f0;
  --red: #d96855;
  --gold: #d79743;
  --shadow: 0 10px 35px rgb(24 49 42 / 8%);
  font-family: 'DM Sans', sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
.workspace { min-height: 100vh; }

.topbar {
  height: 72px; padding: 0 28px; display: flex; align-items: center;
  justify-content: space-between; background: var(--paper); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--green); color: white; font: 800 12px Manrope, sans-serif; letter-spacing: -.5px; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font: 800 15px Manrope, sans-serif; letter-spacing: -.5px; }
.brand-copy small { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 1.55px; }
.topbar-center { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 12px; }
.live-indicator, .updates-badge { display: inline-flex; align-items: center; gap: 8px; }
.live-indicator i, .updates-badge i { width: 7px; height: 7px; border-radius: 50%; background: #3cac7e; box-shadow: 0 0 0 3px #e7f5ed; }
.topbar-divider { height: 18px; border-left: 1px solid var(--line); }
.clock { font-variant-numeric: tabular-nums; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.button { min-height: 38px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 8px; text-decoration: none; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .16s, border-color .16s, transform .16s; }
.button:active { transform: translateY(1px); }
.button-quiet { border-color: var(--line); background: var(--paper); color: #46585e; }
.button-quiet:hover { border-color: #cbd8d3; background: #f9fbfa; }
.button-primary { background: var(--green); color: white; }
.button-primary:hover { background: var(--green-dark); }
.button-small { min-height: 33px; font-size: 11px; }

.content { min-height: calc(100vh - 72px); padding: 19px; display: grid; grid-template-columns: 246px minmax(360px, 1fr) 350px; gap: 15px; }
.panel, .map-panel { min-height: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); }
.left-panel { display: flex; flex-direction: column; overflow: auto; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 20px 17px 17px; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 1.25px; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
.panel-heading h1, .right-heading h2 { margin: 0; font: 800 17px Manrope, sans-serif; letter-spacing: -.55px; }
.region-tag { padding: 6px 8px; border-radius: 20px; background: var(--green-soft); color: var(--green-dark); font-size: 10px; font-weight: 700; white-space: nowrap; }
.search-box { height: 39px; margin: 0 13px 19px; padding: 0 10px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fafcfb; }
.search-box:focus-within { border-color: #9ccbbc; box-shadow: 0 0 0 3px #e9f5f0; }
.search-box svg { width: 15px; height: 15px; fill: none; stroke: #849397; stroke-width: 1.7; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.search-box input::placeholder { color: #9ba7a8; }
.search-box kbd { color: #98a5a5; font: 10px 'DM Sans', sans-serif; }
.panel-section { padding: 0 13px 18px; }
.section-heading { margin: 0 0 9px; padding: 0 2px 9px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0; font: 700 11px Manrope, sans-serif; }
.section-count, .external-label { color: var(--muted); font-size: 9px; }
.external-label { font-size: 8px; font-weight: 700; letter-spacing: .7px; }
.layer-row { min-height: 56px; position: relative; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #f0f3f1; cursor: pointer; }
.layer-icon { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; font-size: 19px; font-weight: 700; }
.quake-icon { background: #fff2ed; color: var(--red); }
.evidence-icon { background: #edf5f2; color: var(--green); }
.fire-icon { background: #fff5e9; color: #cf8538; }
.flight-icon { background: #edf3f8; color: #547a9c; }
.layer-copy { min-width: 0; display: grid; flex: 1; gap: 3px; }
.layer-copy strong, .source-link strong { font-size: 10px; font-weight: 700; }
.layer-copy small, .source-link small { color: var(--muted); font-size: 9px; }
.layer-count { min-width: 19px; padding: 3px 5px; border-radius: 5px; background: #f3f5f4; color: #67767a; text-align: center; font-size: 9px; font-weight: 700; }
.layer-row input { position: absolute; right: 0; width: 31px; height: 20px; opacity: 0; cursor: pointer; }
.switch { width: 27px; height: 16px; position: relative; flex: 0 0 auto; border-radius: 12px; background: #dce3df; transition: background .18s; }
.switch::after { position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; border-radius: 50%; background: white; content: ''; transition: transform .18s; box-shadow: 0 1px 3px rgb(0 0 0 / 14%); }
.layer-row input:checked + .switch { background: var(--green); }
.layer-row input:checked + .switch::after { transform: translateX(11px); }
.layer-row input:focus-visible + .switch { outline: 3px solid #bfe4d6; outline-offset: 2px; }
.source-section { padding-top: 1px; }
.source-link { min-height: 47px; padding: 6px 2px; display: flex; align-items: center; gap: 9px; text-decoration: none; border-bottom: 1px solid #f0f3f1; transition: background .15s; }
.source-link:hover { background: #f8faf9; }
.source-symbol { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; background: #f1f5f3; color: #60736c; font-size: 13px; }
.ship-symbol { color: #4d80a1; }.satellite-symbol { color: #7869ad; }.fire-symbol { color: #d89042; }
.source-link > span:nth-child(2) { display: grid; flex: 1; gap: 3px; }
.external-arrow { color: #96a4a1; font-size: 12px; }
.left-footer { margin: auto 13px 12px; padding: 10px; display: flex; gap: 8px; border-radius: 8px; background: #f4f8f6; }
.privacy-icon { padding-top: 1px; color: var(--green); font-size: 15px; }
.left-footer p { margin: 0; color: #7a8988; font-size: 9px; line-height: 1.6; }
.left-footer strong { color: #42584f; font-size: 9px; }

.map-panel { min-height: 550px; position: relative; overflow: hidden; background: #e8eeeb; }
#map { position: absolute; inset: 0; background: #e8eeeb; }
.map-topline { position: absolute; z-index: 500; top: 13px; left: 13px; right: 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; pointer-events: none; }
.map-label, .map-refresh { min-height: 34px; display: inline-flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid rgb(229 236 232 / 85%); border-radius: 7px; background: rgb(255 255 255 / 95%); box-shadow: 0 2px 8px rgb(24 49 42 / 7%); font-size: 10px; font-weight: 700; }
.map-label { pointer-events: auto; }
.map-actions { display: flex; gap: 6px; }
.map-style { min-height: 34px; padding: 0 10px; border: 1px solid rgb(229 236 232 / 85%); border-radius: 7px; background: rgb(255 255 255 / 95%); box-shadow: 0 2px 8px rgb(24 49 42 / 7%); color: #536762; font-size: 10px; font-weight: 700; cursor: pointer; pointer-events: auto; }
.map-style:hover { background: #f3f9f6; }
.map-label-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.map-refresh { color: #536762; cursor: pointer; pointer-events: auto; }
.map-refresh:hover { background: #f3f9f6; }
.map-refresh span { color: var(--green); font-size: 16px; }
.map-legend { position: absolute; z-index: 500; right: 13px; bottom: 47px; padding: 9px 11px; display: flex; gap: 13px; border: 1px solid rgb(229 236 232 / 85%); border-radius: 7px; background: rgb(255 255 255 / 96%); box-shadow: 0 2px 8px rgb(24 49 42 / 7%); color: #61706d; font-size: 9px; pointer-events: none; }
.map-legend span { display: flex; align-items: center; gap: 6px; }
.map-legend i { width: 8px; height: 8px; display: inline-block; border-radius: 50%; }
.legend-quake { background: var(--red); }.legend-evidence { background: var(--green); }
.legend-fire { background: #e79745; }.legend-flight { background: #6689aa; }
.map-status { position: absolute; z-index: 500; top: 56px; left: 14px; max-width: calc(100% - 28px); padding: 6px 9px; border: 1px solid rgb(229 236 232 / 85%); border-radius: 6px; background: rgb(255 255 255 / 94%); color: #667775; font-size: 9px; }
.map-status.is-error { color: #a64d3e; }
.coordinate-bar { position: absolute; z-index: 500; right: 0; bottom: 0; left: 0; min-height: 34px; padding: 0 13px; display: flex; align-items: center; gap: 7px; border-top: 1px solid rgb(231 237 234 / 90%); background: rgb(255 255 255 / 96%); color: #8b9995; font-size: 8px; letter-spacing: .6px; }
.coordinate-bar strong { color: #536560; font-size: 9px; letter-spacing: 0; }
.coordinate-separator { height: 14px; margin: 0 3px; border-left: 1px solid #e2e9e5; }
.leaflet-container { font: 11px 'DM Sans', sans-serif; }
.leaflet-control-attribution { font-size: 8px !important; }
.aircraft-marker { display: grid; place-items: center; border-radius: 50%; background: #557d9c; box-shadow: 0 1px 5px rgb(18 42 57 / 30%); color: white; font-size: 13px; }
.aircraft-marker span { display: inline-block; }
.evidence-popup { min-width: 180px; }
.evidence-popup strong { display: block; margin-bottom: 4px; color: var(--ink); }
.evidence-popup p { margin: 0 0 6px; color: #60716c; line-height: 1.45; }
.evidence-popup a { color: var(--green-dark); font-weight: 600; }
.popup-delete { padding: 0; border: 0; background: transparent; color: #b65345; font-size: 10px; cursor: pointer; }
.popup-edit { padding: 0; border: 0; background: transparent; color: var(--green-dark); font-size: 10px; cursor: pointer; }
.popup-actions { display: flex; gap: 10px; }

.right-panel { display: flex; flex-direction: column; overflow: hidden; }
.right-heading { min-height: 68px; padding: 14px 16px 11px; display: flex; align-items: center; justify-content: space-between; }
.right-heading .eyebrow { margin-bottom: 3px; }
.right-heading h2 { font-size: 16px; }
.updates-badge { padding: 6px 8px; border-radius: 20px; background: #edf7f2; color: #318369; font-size: 8px; font-weight: 800; letter-spacing: .45px; }
.updates-badge i { width: 6px; height: 6px; box-shadow: none; }
.tabs { padding: 0 13px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.tab { position: relative; min-height: 38px; padding: 0 2px; border: 0; background: transparent; color: #8a9797; font-size: 10px; font-weight: 600; cursor: pointer; }
.tab::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: transparent; content: ''; }
.tab:hover, .tab.is-active { color: var(--green-dark); }
.tab.is-active::after { background: var(--green); }
.tab:focus-visible, .icon-button:focus-visible, .map-refresh:focus-visible, .button:focus-visible { outline: 3px solid #bfe4d6; outline-offset: 2px; }
.tab-view { min-height: 0; display: none; flex: 1; flex-direction: column; overflow: auto; }
.tab-view.is-visible { display: flex; }
.stream-summary { min-height: 56px; padding: 9px 14px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid #f0f3f1; }
.summary-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #fff2ed; color: var(--red); font-size: 20px; }
.stream-summary > div { display: grid; gap: 3px; }
.stream-summary strong { font-size: 10px; }
.stream-summary small { color: var(--muted); font-size: 9px; }
.stream-list { overflow: auto; }
.event-card, .news-card, .evidence-card { padding: 11px 14px; border-bottom: 1px solid #f0f3f1; }
.event-card { cursor: pointer; transition: background .15s; }
.event-card:hover { background: #fafcfb; }
.event-meta { margin-bottom: 5px; display: flex; align-items: center; gap: 6px; color: #899795; font-size: 9px; }
.event-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.event-title, .news-title, .evidence-title { margin: 0 0 4px; color: #304047; font-size: 10px; font-weight: 700; line-height: 1.5; }
.event-detail, .news-source, .evidence-detail { margin: 0; color: #879391; font-size: 9px; line-height: 1.5; }
.news-card a { text-decoration: none; }
.news-card a:hover .news-title { color: var(--green-dark); }
.view-toolbar { min-height: 49px; padding: 8px 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid #f0f3f1; }
.view-toolbar p { margin: 0; color: #7c8987; font-size: 9px; line-height: 1.5; }
.icon-button { width: 29px; height: 29px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--green); font-size: 17px; cursor: pointer; }
.empty-state { min-height: 120px; padding: 24px 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #91a09b; text-align: center; }
.empty-state p { margin: 9px 0 0; color: #758480; font-size: 10px; }
.empty-state small { max-width: 210px; margin-top: 5px; font-size: 9px; line-height: 1.5; }
.empty-icon { color: #91bca9; font-size: 21px; }
.loader { width: 15px; height: 15px; border: 2px solid #e3eee8; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bulletin-card { padding: 18px 14px; display: flex; align-items: flex-start; gap: 11px; }
.bulletin-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: #f1f4f2; color: #455b53; font: 800 10px Manrope, sans-serif; }
.bulletin-card .eyebrow { margin: 0 0 4px; font-size: 8px; }
.bulletin-card h3 { margin: 0 0 7px; font: 700 12px Manrope, sans-serif; }
.bulletin-card div > p:not(.eyebrow) { margin: 0 0 12px; color: #7c8987; font-size: 9px; line-height: 1.65; }
.text-link { color: var(--green-dark); font-size: 9px; font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.source-note { margin: 0 14px; padding: 10px; display: flex; align-items: flex-start; gap: 7px; border-radius: 7px; background: #f6f8f7; color: #7c8987; }
.source-note > span { color: #769888; font-size: 12px; }
.source-note p { margin: 0; font-size: 9px; line-height: 1.55; }
.feed-settings { padding: 15px 14px; border-bottom: 1px solid #f0f3f1; }
.feed-settings .field-label { margin-bottom: 7px; }
.feed-settings > p { margin: 8px 0 10px; color: #7c8987; font-size: 9px; line-height: 1.55; }
.feed-settings > p a { color: var(--green-dark); text-decoration: none; }
.feed-settings > p a:hover { text-decoration: underline; }
.feed-settings .button { margin-top: 3px; }
.feed-settings .feed-connection { margin-bottom: 0; color: #657772; }
.feed-settings-secondary > strong { display: block; margin-bottom: 7px; font-size: 10px; }
.evidence-actions { padding: 10px 13px; }
.evidence-card { position: relative; padding-right: 46px; }
.evidence-card .evidence-source { display: inline-block; margin-top: 5px; color: var(--green-dark); font-size: 9px; text-decoration: none; }
.evidence-card .evidence-edit, .evidence-card .evidence-remove { position: absolute; top: 10px; padding: 4px; border: 0; background: transparent; font-size: 10px; cursor: pointer; }
.evidence-card .evidence-edit { right: 48px; color: var(--green-dark); }
.evidence-card .evidence-remove { right: 10px; color: #b46053; }
.right-footer { min-height: 34px; padding: 0 12px; display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); color: #94a09d; font-size: 8px; white-space: nowrap; }
.footer-pulse { width: 6px; height: 6px; border-radius: 50%; background: #76ba9a; }
.footer-spacer { flex: 1; }
.toast { position: fixed; z-index: 1300; right: 22px; bottom: 22px; max-width: min(380px, calc(100vw - 32px)); padding: 11px 14px; transform: translateY(14px); border-radius: 8px; background: #20382f; box-shadow: 0 8px 24px rgb(16 34 27 / 18%); color: white; font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
.toast.is-visible { transform: translateY(0); opacity: 1; }

.evidence-dialog { width: min(440px, calc(100vw - 28px)); padding: 0; overflow: visible; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 20px 70px rgb(19 40 32 / 20%); color: var(--ink); }
.evidence-dialog::backdrop { background: rgb(19 35 30 / 45%); backdrop-filter: blur(3px); }
.evidence-dialog form { padding: 21px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-heading h2 { margin: 0; font: 800 18px Manrope, sans-serif; letter-spacing: -.5px; }
.dialog-close { width: 29px; height: 29px; border: 0; border-radius: 6px; background: #f3f6f4; color: #71807b; font-size: 20px; cursor: pointer; }
.dialog-intro { margin: 13px 0 17px; color: #74827e; font-size: 10px; line-height: 1.6; }
.field-label { margin: 0 0 6px; display: block; color: #53625e; font-size: 10px; font-weight: 700; }
.field-label:not(:first-of-type) { margin-top: 13px; }
.field-label span { margin-left: 4px; color: #9aa5a1; font-size: 8px; font-weight: 600; }
.field-input { width: 100%; min-height: 38px; padding: 9px 10px; border: 1px solid #e3eae6; border-radius: 7px; outline: 0; background: #fcfdfc; color: var(--ink); font-size: 11px; }
.field-input:focus { border-color: #9ccbbc; box-shadow: 0 0 0 3px #e9f5f0; }
.field-input::placeholder { color: #a2adaa; }
.field-textarea { min-height: 76px; resize: vertical; }
.coordinates-note { margin: 11px 0 0; color: #87948f; font: 10px 'DM Sans', sans-serif; }
.dialog-actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 8px; }

@media (min-width: 1500px) {
  .content { grid-template-columns: 270px minmax(420px, 1fr) 390px; gap: 18px; padding: 22px; }
}
@media (max-width: 1120px) {
  .content { grid-template-columns: 220px minmax(300px, 1fr); grid-template-rows: minmax(500px, 1fr) 400px; }
  .left-panel { grid-row: 1 / 3; }
  .map-panel { min-height: 500px; }
  .right-panel { grid-column: 2; }
}
@media (max-width: 700px) {
  .topbar { height: 62px; padding: 0 13px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-copy strong { font-size: 13px; }
  .topbar-center { display: none; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .button { min-height: 34px; padding: 0 9px; font-size: 10px; }
  .content { min-height: calc(100vh - 62px); padding: 10px; grid-template-columns: 1fr; grid-template-rows: auto minmax(390px, 55vh) 440px; gap: 10px; }
  .left-panel { grid-row: auto; overflow: visible; }
  .panel-heading { padding: 13px 14px 12px; }
  .search-box { margin-bottom: 12px; }
  .panel-section { padding-bottom: 11px; }
  .source-section { display: none; }
  .left-footer { display: none; }
  .map-panel { min-height: 390px; }
  .right-panel { grid-column: auto; }
  .right-heading { min-height: 59px; }
}
@media (max-width: 390px) {
  .brand-copy small { font-size: 8px; }
  .topbar-actions .button-quiet { font-size: 0; gap: 0; width: 35px; padding: 0; }
  .topbar-actions .button-quiet span { font-size: 18px; }
  .map-legend { gap: 8px; font-size: 8px; }
  .tabs { gap: 10px; padding: 0 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
