/* Hotspot Monitor. The palette is the alert e-mail's (FireWatch AlertHtml), and the five band
   colours are the SP_Hotspot_01A ladder, so the site and the e-mails look like one product.
   There are no inline styles anywhere: the Content Security Policy is style-src 'self'. */

:root {
    --ink: #1f2421;
    --muted: #5f6b63;
    --line: #e2e7e3;
    --page: #f4f6f4;
    --card: #ffffff;
    --brand: #1b5e20;
    --brand-strong: #154a19;
    --brand-2: #2e7d32;
    --brand-muted: #c8e6c9;
    --brand-soft: #e8f5e9;

    --inside: #ff0000;  --inside-text: #c62828;  --inside-tint: #fdf3f2;
    --km2: #ffff00;     --km2-text: #7a6d00;     --km2-tint: #fffef0;
    --km5: #ffc000;     --km5-text: #866000;     --km5-tint: #fffaf0;
    --km10: #0070c0;    --km10-text: #0059a0;    --km10-tint: #f1f7fc;
    --beyond: #afabab;  --beyond-text: #6b6767;  --beyond-tint: #f7f7f7;

    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 4px 16px rgba(16, 24, 20, .05);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html { font-size: 15px; }

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--page);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--brand-2); }
a:hover { color: var(--brand); }

.skip-link { position: absolute; left: -9999px; }
:focus-visible { outline: 3px solid #1565c0; outline-offset: 2px; }
.appbar :focus-visible { outline-color: #fff; }
/* Bootstrap takes the outline off its buttons and fields for a ring of its own, which our button colours left
   empty: the outline stays on them too. */
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible, .form-check-input:focus-visible { outline: 3px solid #1565c0; outline-offset: 2px; }
/* A date field's calendar button sits inside it, where the field itself no longer counts as focused. */
input[type="date"]:focus-within { outline: 3px solid #1565c0; outline-offset: 2px; }
/* Bootstrap's pink code text fell to 4:1 on the tinted notes; this keeps 6.5:1 on them. */
code { color: #a01a58; }
.skip-link:focus { left: 1rem; top: .5rem; z-index: 2000; background: #fff; padding: .5rem 1rem; border-radius: 6px; }

.muted { color: var(--muted); }
.small { font-size: .82rem; }

/* App bar ------------------------------------------------------------------------------------ */

.appbar {
    background: var(--brand);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1100;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .12);
}

.appbar-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: .55rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; min-width: 0; }
.brand:hover { color: #fff; }
.brand-mark { width: 26px; height: 26px; fill: var(--km5); flex: none; }
.brand-name { font-weight: 650; letter-spacing: .01em; white-space: nowrap; }
.brand-project {
    color: var(--brand-muted);
    font-size: .9rem;
    border-left: 1px solid rgba(255, 255, 255, .3);
    padding-left: .6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appbar-nav { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.appbar-link { color: #fff; text-decoration: none; padding: .35rem .7rem; border-radius: 6px; font-size: .92rem; }
.appbar-link:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.appbar-user {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .28);
    color: #fff;
    border-radius: 999px;
    padding: .28rem .8rem;
    font-size: .86rem;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
}
.appbar-user:hover, .appbar-user:focus { background: rgba(255, 255, 255, .18); }

/* A phone's menu: its button stays in the bar, and every page and the account open under the bar,
   pushing the page down. A wider screen has room for them all in the bar, so it never shows. */
.appbar-menu-button { display: none; }
.appbar-menu-inner { max-width: 1600px; margin: 0 auto; padding: .25rem .75rem .75rem; display: flex; flex-direction: column; gap: .15rem; }
.appbar-menu-link {
    display: block;
    width: 100%;
    /* A thumb's reach: 44 px, which the padding alone misses by half a pixel at the site's 15 px text. */
    min-height: 44px;
    padding: .7rem .75rem;
    border: 0;
    border-radius: 8px;
    background: none;
    color: #fff;
    font-size: 1rem;
    text-align: left;
    text-decoration: none;
}
.appbar-menu-link:hover, .appbar-menu-link:focus-visible { background: rgba(255, 255, 255, .12); color: #fff; }
.appbar-menu-link.is-current { background: rgba(255, 255, 255, .16); font-weight: 600; }
.appbar-menu-account { margin-top: .35rem; padding-top: .35rem; border-top: 1px solid rgba(255, 255, 255, .2); }
.appbar-menu-user { display: block; padding: .45rem .75rem .2rem; color: var(--brand-muted); font-size: .85rem; overflow-wrap: anywhere; }
@media (min-width: 641px) {
    .appbar-menu { display: none !important; }
}

/* Page ----------------------------------------------------------------------------------------- */

.page { width: 100%; max-width: 1200px; margin: 1.25rem auto 1.5rem; padding: 0 1.25rem; flex: 1; }
.page-wide { max-width: 1600px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.page-title { font-size: 1.35rem; font-weight: 650; margin: 0 0 .5rem; }
.site-foot { text-align: center; color: var(--muted); font-size: .8rem; padding: .75rem 1.25rem 1.5rem; }

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}
.panel.narrow { max-width: 640px; margin-left: auto; margin-right: auto; }
.panel-head { display: flex; align-items: baseline; gap: .75rem; margin-bottom: .6rem; flex-wrap: wrap; }
.panel-head h2 { font-size: 1rem; font-weight: 650; margin: 0; }

.btn-brand { background: var(--brand); border: 1px solid var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.btn-outline-brand { border: 1px solid var(--brand); color: var(--brand); background: #fff; }
.btn-outline-brand:hover, .btn-outline-brand:focus { background: var(--brand-soft); color: var(--brand); }

/* The administrators' pages (_AdminNav): the same row of buttons on each, the page open marked, and the
   page's own action after them. The row wraps under the title where it cannot fit beside it. */
.page-head-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; }
.admin-nav { display: flex; flex-wrap: wrap; gap: .5rem; }
.admin-nav .btn.is-current { background: var(--brand-muted); color: var(--brand-strong); font-weight: 600; }

/* Filters ---------------------------------------------------------------------------------------- */

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem 1rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .85rem 1rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}
.field { display: flex; flex-direction: column; gap: .2rem; min-width: 8.5rem; margin: 0; }
.field-wide { min-width: 16rem; flex: 1 1 16rem; max-width: 26rem; }
.field-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.field-check { display: flex; align-items: center; gap: .45rem; font-size: .9rem; padding-bottom: .35rem; margin: 0; }
.field-check .form-check-input { margin: 0; }
.quick-ranges { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .8rem; font-size: .85rem; }
.quick-ranges a { text-decoration: none; }
.quick-ranges a:hover { text-decoration: underline; }

/* Summary tiles ----------------------------------------------------------------------------------- */

.summary { display: grid; grid-template-columns: 1.5fr repeat(5, 1fr); gap: .75rem; margin-bottom: .75rem; }
.tile {
    background: var(--card);
    border: 1px solid var(--line);
    border-top: 4px solid var(--line);
    border-radius: var(--radius);
    padding: .75rem .95rem;
    box-shadow: var(--shadow);
}
.tile-value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-label { color: var(--muted); font-size: .85rem; margin-top: .15rem; }
.tile-sub { color: var(--muted); font-size: .78rem; margin-top: .35rem; }
.tile-total { border-top-color: var(--brand); }
.tile-inside { border-top-color: var(--inside); }
.tile-inside .tile-value { color: var(--inside-text); }
.tile-km2 { border-top-color: var(--km2); }
.tile-km2 .tile-value { color: var(--km2-text); }
.tile-km5 { border-top-color: var(--km5); }
.tile-km5 .tile-value { color: var(--km5-text); }
.tile-km10 { border-top-color: var(--km10); }
.tile-km10 .tile-value { color: var(--km10-text); }
.tile-beyond { border-top-color: var(--beyond); }
.tile-beyond .tile-value { color: var(--beyond-text); }

.gate-note { font-size: .9rem; color: var(--muted); margin: 0 0 1rem; }

/* How current the data is (issue #3): a quiet line while the pipeline runs on time, a banner when it
   is late or stopped. The words say what is wrong; the colour only repeats it. */
.freshness { display: flex; align-items: baseline; gap: .5rem; margin: 0 0 .75rem; font-size: .84rem; color: var(--muted); }
.freshness::before { content: ""; flex: none; width: .6rem; height: .6rem; border-radius: 50%; background: var(--brand-2); }
.freshness-late, .freshness-stale { padding: .6rem .85rem; border-radius: var(--radius); font-size: .92rem; }
.freshness-late { background: #fff8e1; border: 1px solid #f0c36d; color: #5f4500; }
.freshness-late::before { background: var(--km5); }
.freshness-stale { background: var(--inside-tint); border: 1px solid #f3c7c3; color: var(--inside-text); }
.freshness-stale::before { background: var(--inside); }
.badge-alert {
    display: inline-block;
    background: var(--inside-tint);
    color: var(--inside-text);
    border: 1px solid #f3c7c3;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 650;
    padding: .06rem .5rem;
    margin: 0 .35rem;
    vertical-align: middle;
    letter-spacing: .02em;
}

/* Map and side panels ------------------------------------------------------------------------------ */

.layout { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(300px, 1fr); gap: 1rem; align-items: start; }

/* Side by side, the side column ends where the map panel does. Size containment keeps the column
   from setting the row's height, so the map alone sets it and the column stretches to match; the
   company table scrolls inside its panel under a header that stays put, and the daily chart keeps
   its full size at the bottom. Stacked (1100 px and narrower) everything keeps its own height. */
@media (min-width: 1101px) {
    .layout { align-items: stretch; margin-bottom: 1rem; }
    .layout > .panel, .side > .panel { margin-bottom: 0; }
    .layout > .side { contain: size; display: flex; flex-direction: column; gap: 1rem; }
    .company-panel { flex: 1 1 auto; min-height: 14rem; display: flex; flex-direction: column; }
    .company-panel > .table-responsive { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
    .company-panel thead th { position: sticky; top: 0; z-index: 1; background: var(--card); box-shadow: inset 0 -1px 0 var(--line); }
    .chart-panel { flex: none; }
    .playback-new-panel { flex: 1 1 auto; min-height: 10rem; display: flex; flex-direction: column; }
    .playback-new { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
}
.map { height: 560px; border-radius: 8px; border: 1px solid var(--line); background: #dfe6e1; z-index: 0; scroll-margin-top: 4.5rem; }
.map-status { font-size: .85rem; color: var(--muted); min-height: 1.25rem; margin-top: .35rem; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .82rem; margin-top: .25rem; align-items: center; }
.legend-item { display: inline-flex; align-items: center; gap: .35rem; }
.legend-note { color: var(--muted); }
.swatch { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .35); display: inline-block; }
.swatch-inside { background: var(--inside); }
.swatch-km2 { background: var(--km2); }
.swatch-km5 { background: var(--km5); }
.swatch-km10 { background: var(--km10); }
.swatch-beyond { background: var(--beyond); }

/* A scrolling table holds what it positions: a visually hidden header or label (position: absolute)
   then scrolls with the table instead of widening the page on a phone. */
.table-responsive { position: relative; }
.table-compact { font-size: .88rem; margin: 0; }
.table-compact th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.text-inside { color: var(--inside-text); font-weight: 650; }
.text-km2 { color: var(--km2-text); font-weight: 650; }

.daily-chart { width: 100%; height: auto; display: block; }
.daily-chart .axis { stroke: #b9c2bc; stroke-width: 1; }
.daily-chart .grid { stroke: #e7ece8; stroke-width: 1; stroke-dasharray: 3 3; }
.daily-chart .tick { font-size: 9px; fill: var(--muted); font-family: var(--font); }
.daily-chart .bar { stroke: rgba(31, 36, 33, .22); stroke-width: .4; }
.daily-chart .bar-empty { fill: #d7ddd9; }
.daily-chart .bar-nodata { fill: none; stroke: #b9c2bc; stroke-width: 1; stroke-dasharray: 3 2; }
.daily-chart .tick-year { font-weight: 600; }
.monthly-chart { margin-bottom: .75rem; }
.trends-note { font-size: .88rem; margin: 0 0 1rem; }
.trends-table tr.is-nodata > * { color: var(--muted); }
/* Row headings (a month, a company) read as text, not as the small capitals of the column headings. */
.trends-table tbody th, .trends-matrix tbody th { text-transform: none; letter-spacing: normal; font-size: .88rem; font-weight: 600; color: var(--ink); }
.panel-head .panel-link { margin-left: auto; font-size: .85rem; }

/* Hotspot list --------------------------------------------------------------------------------------- */

.hotspots { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .7rem; }
.hotspot {
    border: 1px solid var(--line);
    border-left: 5px solid var(--beyond);
    border-radius: 8px;
    padding: .65rem .8rem .55rem;
    background: var(--beyond-tint);
}
.hotspot.band-inside { border-left-color: var(--inside); background: var(--inside-tint); }
.hotspot.band-km2 { border-left-color: var(--km2); background: var(--km2-tint); }
.hotspot.band-km5 { border-left-color: var(--km5); background: var(--km5-tint); }
.hotspot.band-km10 { border-left-color: var(--km10); background: var(--km10-tint); }
.hotspot-top { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
.hotspot-status { font-weight: 700; font-size: .8rem; letter-spacing: .02em; color: var(--beyond-text); white-space: nowrap; flex: none; }
.band-inside .hotspot-status, .band-inside.popup .popup-status { color: var(--inside-text); }
.band-km2 .hotspot-status, .band-km2.popup .popup-status { color: var(--km2-text); }
.band-km5 .hotspot-status, .band-km5.popup .popup-status { color: var(--km5-text); }
.band-km10 .hotspot-status, .band-km10.popup .popup-status { color: var(--km10-text); }
.hotspot-meta { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; text-align: right; }
.nowrap { white-space: nowrap; }
.hotspot-headline { font-weight: 650; margin-top: .2rem; }
.hotspot-detail { font-size: .84rem; color: var(--muted); margin-top: .1rem; }
/* The list's downloads: CSV, and GeoJSON and KML for GIS (issue #17). They wrap on a phone. */
.export-links { display: inline-flex; flex-wrap: wrap; gap: .4rem; }
/* What the hotspot's spot did before (issue #15): pink for burning again and purple for a heat source that never
   stops, as the map's Repeat burns layer draws them. Neither is a distance band's colour. */
.hotspot-spot { display: flex; flex-direction: column; margin-top: .3rem; padding: .2rem .5rem; border-left: 3px solid #d81b60; background: #fdeef3; font-size: .84rem; }
.hotspot-spot.is-persistent { border-left-color: #6a1b9a; background: #f6eefa; }
.popup-spot { margin: .35rem 0 .1rem; padding: .2rem .45rem; border-left: 3px solid #d81b60; background: #fdeef3; font-size: .8rem; }
.popup-spot.is-persistent { border-left-color: #6a1b9a; background: #f6eefa; }
.popup-spot div + div { margin-top: .1rem; }
.link-button { background: none; border: 0; padding: 0; color: var(--brand-2); font-size: .82rem; margin-top: .3rem; cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.empty { color: var(--muted); padding: 1rem 0; margin: 0; }
.list-more { margin: .75rem 0 0; }

/* Full screen maps (map-fullscreen.js): the button under the zoom buttons, as big as they are, and,
   where a map cannot have the browser's own full screen (an iPhone), the map filling the window. */
.map-fullscreen-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
}
.map-fullscreen-button:hover, .map-fullscreen-button:focus-visible { background: #f4f4f4; }
.map-fullscreen-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.map-filled {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2000 !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    border-radius: 0 !important;
}
body.map-filled-open { overflow: hidden; }

/* Hotspot playback (issue #27, playback.js): a taller map, and the player over its foot, inside the map, so
   it stays in full screen; the daily chart's line on the day on show. */
.playback-map { height: 620px; }
.playback-intro { margin: 0 0 .6rem; }
.playback-bar {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 26px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: .45rem .6rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 1px 4px rgba(16, 24, 20, .3);
    font-size: .85rem;
    cursor: default;
}
.playback-bar[hidden] { display: none; }
.playback-caption { display: flex; flex-wrap: wrap; gap: .1rem .6rem; align-items: baseline; min-height: 1.3rem; }
.playback-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; }
.playback-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #c9d1cb;
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
}
.playback-button:hover { background: var(--brand-soft); }
.playback-button svg { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.playback-play { width: 40px; height: 40px; border-color: var(--brand); background: var(--brand); color: #fff; }
.playback-play:hover { background: var(--brand-strong); }
.playback-slider { flex: 1 1 160px; min-width: 120px; accent-color: var(--brand); }
.playback-position { color: var(--muted); white-space: nowrap; }
.playback-option { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); }
.playback-option .form-select { width: auto; }
.leaflet-container.playback-pointer { cursor: pointer; }
.playback-new { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.playback-new-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .45rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.playback-new-item .swatch { flex: none; width: 10px; height: 10px; align-self: center; }
.playback-new-item .link-button { margin: 0; font-size: .85rem; text-align: left; }
.playback-new-status { color: var(--muted); font-size: .78rem; }
.playback-new-more { margin: .4rem 0 0; }
.daily-chart .chart-cursor { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 2; }
.playback-chart .daily-chart g[data-day] { cursor: pointer; }
.playback-chart .daily-chart g.is-current .bar { stroke: var(--ink); stroke-width: 1; }

/* The fire log's monthly response report for auditors (issue #29). */
/* E-mail settings and the weekly summary's preview (issue #28). The preview shows the e-mail in a frame,
   exactly as sent; mail-preview.js grows the frame to the e-mail, and without it the frame keeps this height. */
.mail-heading { font-size: 1.05rem; font-weight: 650; margin: 1rem 0 .4rem; }
.mail-form { display: grid; gap: .6rem; }
.mail-form .btn { justify-self: start; margin-top: .2rem; }
.mail-project { padding: .6rem .75rem; border: 1px solid var(--line); border-radius: var(--radius); }
.mail-project .field-check { font-weight: 600; padding-bottom: .2rem; }
.mail-as-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .75rem; }
.mail-as-form > div { flex: 1 1 14rem; }
.mail-preview { max-width: 780px; margin-left: auto; margin-right: auto; }
.mail-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .2rem .9rem; margin: 0 0 .5rem; font-size: .9rem; }
.mail-facts dt { color: var(--muted); font-weight: 600; }
.mail-facts dd { margin: 0; overflow-wrap: anywhere; }
.mail-send { margin: 0 0 .75rem; }
.mail-frame { display: block; width: 100%; height: 1600px; border: 1px solid var(--line); border-radius: var(--radius); background: #f4f6f4; }

.fl-report { margin: 0 0 1rem; }
.fl-report > summary { cursor: pointer; color: var(--brand-2); font-weight: 600; width: fit-content; }
.fl-report-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .75rem; margin-top: .5rem; padding: .75rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.fl-report-note { flex-basis: 100%; margin: 0; font-size: .85rem; }

/* Map popups and labels ---------------------------------------------------------------------------- */

.popup-status { font-weight: 700; font-size: .78rem; letter-spacing: .02em; color: var(--beyond-text); }
.popup-headline { font-weight: 650; margin: .15rem 0 .4rem; font-size: .95rem; }
.popup .badge-alert { margin: 0 0 .45rem; }
.popup-facts { display: grid; grid-template-columns: auto 1fr; gap: .15rem .6rem; margin: 0; font-size: .82rem; }
.popup-facts dt { color: var(--muted); font-weight: 500; }
.popup-facts dd { margin: 0; }
.leaflet-tooltip.company-label {
    background: rgba(27, 94, 32, .88);
    color: #fff;
    border: 0;
    box-shadow: none;
    font-weight: 650;
    font-size: .74rem;
    padding: .08rem .4rem;
}
.leaflet-tooltip.company-label::before { display: none; }
.leaflet-tooltip.blok-label {
    background: rgba(255, 255, 255, .82);
    color: #3d4640;
    border: 0;
    box-shadow: none;
    font-size: .68rem;
    font-weight: 600;
    padding: 0 .25rem;
}
.leaflet-tooltip.blok-label::before { display: none; }
.fl-marker { background: none; border: 0; }
.fl-marker svg { display: block; }

/* Sign-in ------------------------------------------------------------------------------------------ */

.auth-body { background: radial-gradient(circle at 20% 10%, #2e7d32 0%, #1b5e20 45%, #0f3d14 100%); }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); padding: 1.75rem; }
.auth-brand { display: flex; gap: .8rem; align-items: center; margin-bottom: 1.25rem; }
.auth-mark { width: 42px; height: 42px; fill: var(--km5); background: var(--brand); border-radius: 10px; padding: 7px; flex: none; }
.auth-title { font-weight: 700; font-size: 1.2rem; }
.auth-sub { color: var(--muted); font-size: .85rem; }
.auth-form { display: grid; gap: .35rem; }
.auth-form .form-label { margin: .35rem 0 0; font-size: .88rem; font-weight: 600; }
.auth-form .btn { margin-top: .9rem; }
.auth-remember { display: flex; align-items: center; gap: .45rem; font-size: .88rem; margin-top: .5rem; }
.auth-remember .form-check-input { margin: 0; }
.form-errors {
    background: var(--inside-tint);
    border: 1px solid #f3c7c3;
    border-radius: 8px;
    color: var(--inside-text);
    font-size: .88rem;
    padding: .5rem .75rem;
    margin-bottom: .5rem;
}
.form-errors ul { margin: 0; padding-left: 1.1rem; }
.auth-foot { color: var(--muted); font-size: .8rem; margin: 1rem 0 0; }
.auth-heading { font-size: 1.1rem; font-weight: 700; margin: 0 0 .4rem; }
.auth-text { font-size: .9rem; margin: 0 0 .6rem; }
.auth-body .site-foot { color: rgba(255, 255, 255, .75); }

/* Admin -------------------------------------------------------------------------------------------- */

.stack-form { display: grid; gap: .4rem; max-width: 520px; }
.stack-form .btn { justify-self: start; margin-top: .6rem; }
.stack-form .form-label { margin: .3rem 0 0; font-size: .88rem; font-weight: 600; }
.stack-fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem .8rem; margin: .6rem 0; }
.stack-fieldset legend { font-size: .92rem; font-weight: 650; float: none; width: auto; padding: 0 .3rem; margin: 0; }
.grant-picker { display: grid; gap: .35rem; }
.level-form { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin: 0; }
.level-form .form-select { width: auto; min-width: 7.5rem; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.subhead { font-size: .95rem; font-weight: 650; margin: 1rem 0 .25rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; font-size: .9rem; }
.facts dt { color: var(--muted); font-weight: 500; }
.facts dd { margin: 0; }
.button-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.pill { display: inline-block; border: 1px solid var(--line); background: #f7f9f7; border-radius: 999px; padding: .1rem .55rem; font-size: .78rem; margin: .1rem .2rem .1rem 0; }
.pill-admin { background: var(--brand-soft); border-color: #b9dcbb; color: var(--brand); font-weight: 600; }
.pill-ok { background: #edf7ee; border-color: #cfe8d1; color: #1e6b25; }
.pill-stale { background: var(--inside-tint); border-color: #f3c7c3; color: var(--inside-text); }
.pill-warn { background: var(--km5-tint); border-color: #f1d9a8; color: var(--km5-text); }

/* Boundary check (issue #2): problems listed, then one project's rings on a map and a table. */
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { padding: .45rem 0; border-top: 1px solid var(--line); font-size: .9rem; }
.check-list li:first-child { border-top: 0; }
.check-picker { min-width: 16rem; max-width: 100%; }
.check-table td { vertical-align: top; }
.check-table tr.is-shown td { background: var(--km2-tint); }

/* Audit log (issue #9): the filters wrap into as many columns as fit. */
.audit-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .6rem 1rem; align-items: end; }
.audit-filters .form-label { margin-bottom: .15rem; color: var(--muted); }
.audit-filter-buttons { display: flex; gap: .4rem; }
.status-code { font-size: 3rem; font-weight: 800; color: var(--brand-2); margin: 0; line-height: 1; }

/* Language switch and shared bits ------------------------------------------------------------------- */

.appbar-link.is-current { background: rgba(255, 255, 255, .16); font-weight: 600; }
.lang-switch { display: inline-flex; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; overflow: hidden; margin: 0 .25rem; }
.lang-option { background: transparent; border: 0; color: #fff; font-size: .78rem; font-weight: 650; padding: .28rem .6rem; min-height: 32px; cursor: pointer; }
.lang-option[aria-pressed="true"] { background: #fff; color: var(--brand); }
.lang-option:focus-visible { outline: 3px solid var(--km5); outline-offset: -3px; }
.anon-bar { position: absolute; top: .75rem; right: .75rem; z-index: 10; }
.anon-bar .lang-switch { background: rgba(0, 0, 0, .15); }
.strong { font-weight: 650; }
.text-warn { color: var(--km5-text); font-weight: 650; }
.chip { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line); border-radius: 999px; padding: .08rem .55rem; font-size: .78rem; font-weight: 650; white-space: nowrap; }
.chip-inside { background: var(--inside-tint); border-color: #f3c7c3; color: var(--inside-text); }
.chip-km2 { background: var(--km2-tint); border-color: #e6dc8a; color: var(--km2-text); }
.chip-fire { background: var(--inside-tint); border-color: #f3c7c3; color: var(--inside-text); }
.chip-nofire { background: var(--brand-soft); border-color: #b9dcbb; color: var(--brand); }
.chip-neutral { background: #f1f3f1; color: #3d4640; }
.dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .35); display: inline-block; }
.dot-inside { background: var(--inside); }
.dot-km2 { background: var(--km2); }
.seg { display: inline-flex; flex: none; border: 1px solid #c9d3cc; border-radius: 8px; overflow: hidden; background: #fff; }
.seg-option { padding: .4rem .95rem; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; }
.seg-option + .seg-option { border-left: 1px solid #c9d3cc; }
.seg-option.is-on { background: var(--brand); color: #fff; }

/* Fire log (the list) ----------------------------------------------------------------------------- */

.fl-head { align-items: flex-end; }
.fl-lede { margin: 0; font-size: .9rem; }
.fl-rule { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .8rem; }
.fl-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; margin-bottom: .9rem; }
.fl-summary .tile-value { color: var(--ink); }
.fl-summary .tile-inside .tile-value { color: var(--inside-text); }
.fl-summary .tile-km2 .tile-value { color: var(--km2-text); }
.tile-progress { border-top-color: #3d4640; }
.tile-verified { border-top-color: var(--brand); }
.tile-verified .tile-value { color: var(--brand); }
.fl-tabs { display: flex; flex-wrap: wrap; gap: .15rem; border-bottom: 1px solid var(--line); margin-bottom: .9rem; }
.fl-tab { padding: .5rem .8rem; color: #3d4640; text-decoration: none; font-weight: 650; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.fl-tab.is-on { color: var(--brand); border-bottom-color: var(--brand); }
.fl-count { display: inline-block; min-width: 1.5rem; text-align: center; border-radius: 999px; background: #e9eee9; font-size: .75rem; padding: .05rem .45rem; margin-left: .2rem; }
.fl-tab.is-on .fl-count { background: var(--brand); color: #fff; }
.fl-list { list-style: none; margin: 0; padding: 0; }
.fl-row { display: grid; grid-template-columns: 26px 84px minmax(0, 1.7fr) minmax(0, 1.3fr) minmax(0, 1.5fr) minmax(0, 1.3fr) 84px; gap: .75rem; align-items: center; padding: .7rem .4rem; border-bottom: 1px solid #eef1ee; }
.fl-row-head { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-top: 0; }
.fl-row.is-overdue { background: #fffafa; }
.fl-row > span { min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.fl-flag { align-items: center; }
.icon-overdue { width: 20px; height: 20px; fill: none; stroke: var(--inside-text); stroke-width: 2.2; stroke-linecap: round; }
.fl-code a { font-weight: 700; color: var(--brand); }
.fl-line { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.fl-sub { font-size: .8rem; color: var(--muted); }
.fl-status { font-size: .78rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.fl-open { align-items: flex-end; }
.fl-map { height: 560px; }

/* Fire page ------------------------------------------------------------------------------------------ */

.fp-back { margin: 0 0 .5rem; }
.fp-back a { color: var(--brand); font-weight: 600; text-decoration: none; }
.fp-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.fp-title-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.fp-title-row .page-title { margin: 0; }
.fp-where { margin: .4rem 0 0; }
.fp-sub { margin: .2rem 0 0; font-size: .86rem; color: var(--muted); }
.fp-progress { margin: .6rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; text-transform: none; }
.fp-progress strong { text-transform: uppercase; letter-spacing: .03em; font-size: .85rem; }
.fp-progress.is-overdue strong { color: var(--inside-text); }
.fp-target { margin: .25rem 0 0; font-size: .86rem; color: var(--muted); }
.fp-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.fp-actions form { margin: 0; }
.fp-go { min-height: 48px; }
.fp-coordinate { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.fp-coordinate summary { font-weight: 650; cursor: pointer; }
.fp-inline-form { display: grid; gap: .35rem; margin-top: .6rem; max-width: 520px; }
.fp-inline-form .btn { justify-self: start; }
.fp-map { height: 380px; border-radius: 8px; border: 1px solid var(--line); background: #e3eae4; }
.fp-map-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .5rem; }
.fp-map-tools .btn[aria-pressed="true"] { background: var(--brand); color: #fff; }
/* The satellite area and the rough estimate under the map (SatelliteArea): the figure first, then what it is. */
.fp-area { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.fp-area p { margin: 0 0 .45rem; }
.fp-distance { font-weight: 650; margin: .5rem 0 0; min-height: 1.4em; }
.fp-coords-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.fp-coords { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-right: auto; }
.fp-findings, .fp-photos, .fp-choices { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.fp-findings legend, .fp-photos legend, .fp-choices legend { float: none; font-size: .9rem; margin-bottom: .4rem; }
.fp-photos legend, .fp-choices legend { font-weight: 650; color: var(--ink); }
.fp-group { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: .6rem 0 .35rem; color: #3d4640; }
.fp-group-fire { color: var(--inside-text); }
.fp-group-nofire { color: var(--brand); }
.fp-card { display: flex; align-items: center; gap: .7rem; border: 1px solid #c9d3cc; border-radius: 10px; padding: .6rem .8rem; margin-bottom: .5rem; min-height: 54px; cursor: pointer; background: #fff; }
.fp-card:has(input:checked) { border: 2px solid var(--brand); background: var(--brand-soft); }
.fp-card input { width: 22px; height: 22px; flex: none; accent-color: var(--brand); }
.fp-card-text { display: flex; flex-direction: column; }
.fp-card-title { font-weight: 650; }
.fp-card-help { font-size: .8rem; color: var(--muted); }
.fp-photo-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.fp-photo-buttons .btn { min-height: 44px; display: inline-flex; align-items: center; }
.fp-photo-list { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .45rem; }
.fp-photo-list li { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line); border-radius: 8px; padding: .35rem; font-size: .84rem; }
.fp-photo-list img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; flex: none; background: #dfe7e0; }
.fp-mark { margin: 0 0 1rem; }
.fp-mark .btn { min-height: 48px; }
.fp-more { margin-bottom: 1rem; }
.fp-more summary { font-weight: 650; cursor: pointer; margin-bottom: .6rem; }
.fp-more .form-label { margin: .6rem 0 .2rem; font-size: .88rem; font-weight: 600; }
.choice { display: inline-flex; align-items: center; gap: .35rem; margin: 0 .9rem .4rem 0; font-size: .92rem; min-height: 32px; }
.fp-save-bar { display: flex; flex-direction: column; gap: .35rem; }
.fp-save-bar .btn { min-height: 48px; }
.fp-report-card { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; margin-bottom: .6rem; }
.fp-report-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.fp-report-who { margin: .35rem 0 0; font-weight: 600; font-size: .9rem; }
.fp-notes { margin: .35rem 0 0; font-size: .9rem; white-space: pre-line; }
.fp-report-photos { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
.fp-report-photos li { display: flex; flex-direction: column; gap: .15rem; }
.fp-report-photos img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: #dfe7e0; }
.fp-dets, .fp-history { list-style: none; margin: 0; padding: 0; }
.fp-dets li, .fp-history li { padding: .4rem 0; border-bottom: 1px solid #eef1ee; font-size: .88rem; display: flex; flex-direction: column; }
.fp-history li { display: block; }
.fp-det-when, .fp-when { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .8rem; }
.fp-satellite summary { font-weight: 650; cursor: pointer; }
.fp-satellite .facts { margin-top: .6rem; }
.fp-map-you { display: block; width: 16px; height: 16px; border-radius: 50%; background: #0070c0; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); }

/* Responsive and print ------------------------------------------------------------------------------ */

@media (max-width: 1100px) {
    .summary { grid-template-columns: repeat(3, 1fr); }
    .fl-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .layout, .fp-grid { grid-template-columns: 1fr; }
    /* minmax(0, ...) as on a wide screen: a bare 1fr cannot shrink below its widest content. */
    .admin-grid { grid-template-columns: minmax(0, 1fr); }
    .fl-row { grid-template-columns: 26px 84px minmax(0, 1.6fr) minmax(0, 1.4fr) minmax(0, 1.2fr); }
    .fl-row > .fl-finding, .fl-row > .fl-open { display: none; }
}

@media (max-width: 640px) {
    .summary { grid-template-columns: repeat(2, 1fr); }
    .map { height: 420px; }
    .playback-map { height: 540px; }
    .playback-bar { left: 6px; right: 6px; }
    .playback-option > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    /* The bar keeps the fire log, the language and the menu button; the other pages and the account are in the menu. */
    .brand-project, .appbar-link-home, .appbar-link-trends, .appbar-link-playback, .appbar-link-admin, .appbar-account { display: none; }
    .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .appbar-menu-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 40px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, .28);
        border-radius: 8px;
        background: rgba(255, 255, 255, .1);
        color: #fff;
    }
    .appbar-menu-button[aria-expanded="true"] { background: rgba(255, 255, 255, .22); }
    .appbar-menu-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
    .appbar-inner { padding: .5rem .75rem; gap: .5rem; }
    .page { padding: 0 .75rem; }
    /* Under the title, the administrators' row and a page's own action start at the left, as the title does. */
    .page-head-actions { justify-content: flex-start; }
    .field, .field-wide { min-width: calc(50% - .5rem); }

    /* The fire log becomes a column of cards: what needs doing, then where, then when. */
    .fl-summary { display: flex; overflow-x: auto; gap: .5rem; padding-bottom: .25rem; }
    .fl-summary .tile { min-width: 42vw; }
    .fl-row-head { display: none; }
    .fl-row { display: flex; flex-direction: column; align-items: stretch; gap: .3rem; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .6rem; padding: .7rem .8rem; }
    .fl-row > .fl-finding, .fl-row > .fl-open { display: flex; }
    .fl-flag:empty { display: none; }
    .fl-progress { order: -1; }
    .fl-open .btn { width: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .fl-map { height: 70vh; }

    /* The fire page puts the save button where a thumb reaches it. */
    .fp-map { height: 300px; }
    .fp-save-bar { position: sticky; bottom: 0; background: #fff; padding: .6rem 0 .8rem; border-top: 1px solid var(--line); z-index: 5; }
    .fp-save-bar .btn { width: 100%; }
    .fp-coords { flex-basis: 100%; }

    /* The preview's facts stack, and the e-mail, narrower, grows taller. */
    .mail-facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .mail-facts dd { margin-bottom: .35rem; }
    .mail-frame { height: 2100px; }
}

@media print {
    .appbar, .filters, .link-button, .site-foot, .lang-switch, .fp-actions, .fp-coordinate, .fp-report, .fp-map-tools { display: none; }
    .panel, .tile { box-shadow: none; }
    /* On paper the whole company table prints; a scrolling box would cut it off. */
    .layout > .side { contain: none; }
    .company-panel > .table-responsive { overflow: visible; }
}
