.jabuka-monitor {
    --sea: #051a2d;
    --sea-mid: #0b314b;
    --land: #eee9d7;
    --coast: #8f947f;
    --muted: #66737c;
    display: grid;
    min-width: 0;
    gap: 1.25rem;
}

.jabuka-monitor h1,
.jabuka-monitor h2,
.jabuka-monitor h3,
.jabuka-monitor h4,
.jabuka-monitor p {
    margin-top: 0;
}

.jabuka-monitor h2 {
    margin-bottom: 0.7rem;
}

.jabuka-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
    align-items: end;
    gap: clamp(1.25rem, 4vw, 4rem);
    padding: clamp(1rem, 2.5vw, 1.8rem);
    color: #f8f5e9;
    background: var(--sea);
    border-left: 7px solid var(--yellow);
}

.jabuka-intro .kicker,
.jabuka-intro .headline {
    color: #fff3a6;
}

.jabuka-intro h1 {
    max-width: 16ch;
    margin-bottom: 0.45rem;
    font-size: clamp(2rem, 5vw, 4.2rem);
    line-height: 0.95;
    letter-spacing: -0.045em;
}

.jabuka-intro .headline {
    margin-bottom: 0;
    font-family: "Courier New", monospace;
    font-weight: 700;
}

.jabuka-intro-copy {
    max-width: 56ch;
    margin-bottom: 0;
    color: #d9e5e7;
}

.jabuka-freshness {
    display: grid;
    color: #ecf4f2;
    background: #0c2638;
    border: 2px solid var(--sea);
}

.jabuka-freshness-summary,
.jabuka-source-details {
    min-width: 0;
    padding: 0.85rem 1rem;
    background: #0c2638;
}

.jabuka-freshness-summary {
    display: grid;
    grid-template-columns: minmax(10rem, 0.55fr) minmax(0, 1.45fr);
    gap: 0.35rem 1.25rem;
    align-items: center;
}

.jabuka-freshness h2,
.jabuka-freshness h3,
.jabuka-freshness h4,
.jabuka-freshness p {
    margin-bottom: 0.35rem;
}

.jabuka-freshness h2,
.jabuka-freshness h3 {
    font-size: 1rem;
    color: #fff;
}

.jabuka-load-status {
    color: #c7d6d9;
    font-family: "Courier New", monospace;
    font-size: 0.82rem;
}

.jabuka-freshness-summary dl {
    display: grid;
    grid-column: 2;
    grid-row: 1 / span 3;
    gap: 0.35rem 1rem;
    margin: 0;
}

.jabuka-freshness-summary dl div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.jabuka-freshness dt,
.jabuka-freshness dd {
    margin: 0;
    font-size: 0.78rem;
}

.jabuka-freshness dd {
    text-align: right;
}

.jabuka-source-details {
    padding-top: 0;
    border-top: 1px solid #29485c;
}

.jabuka-source-details summary {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.2rem 0.55rem;
    color: #000;
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--yellow);
    border-color: #fff #555 #555 #fff;
    border-style: solid;
    border-width: 2px;
    cursor: pointer;
}

.jabuka-source-details summary:hover,
.jabuka-source-details summary:focus-visible {
    color: #fff;
    background: var(--navy);
}

.jabuka-source-details[open] summary {
    margin-bottom: 0.85rem;
}

.jabuka-source-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    gap: 0.55rem 1rem;
}

.jabuka-source-list > h3 {
    grid-column: 1 / -1;
}

.jabuka-source-list article {
    min-width: 0;
    padding-left: 0.7rem;
    border-left: 3px solid #7e98a8;
}

.jabuka-source-list article[data-source="ais_fishing"] {
    border-color: var(--yellow);
}

.jabuka-source-list article[data-source="ais_presence"] {
    border-color: #67c8d5;
}

.jabuka-source-list article[data-source="sar"] {
    border-color: var(--magenta);
}

.jabuka-source-list h4 {
    overflow-wrap: anywhere;
    color: #fff;
    font-size: 0.78rem;
}

.jabuka-source-list strong,
.jabuka-source-list dt,
.jabuka-source-list dd,
.jabuka-source-list code {
    font-size: 0.72rem;
}

.jabuka-source-meta {
    display: grid;
    gap: 0.25rem;
    margin: 0;
}

.jabuka-source-meta > div {
    min-width: 0;
}

.jabuka-source-meta dt {
    color: #9fb6bd;
}

.jabuka-source-meta dd {
    min-width: 0;
    margin: 0;
}

.jabuka-source-list code {
    display: block;
    overflow: hidden;
    color: #b9d2d7;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jabuka-source-count {
    color: #fff3a6;
    font-family: "Courier New", monospace;
    font-size: 1rem !important;
    font-weight: 700;
}

.jabuka-monitor.is-stale .jabuka-freshness {
    border-color: var(--magenta);
    box-shadow: 0 0 0 3px var(--yellow);
}

.jabuka-monitor.is-stale [data-snapshot-freshness],
.jabuka-monitor.is-stale [data-source-status] {
    color: #fff;
    background: var(--magenta);
}

.jabuka-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.31fr);
    min-width: 0;
    overflow: hidden;
    color: #edf4f2;
    background: var(--sea);
    border: 3px solid #000;
    box-shadow: 8px 8px 0 var(--shadow);
}

.jabuka-map-column {
    min-width: 0;
    border-right: 1px solid #5a7281;
}

.jabuka-map-toolbar {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
}

.jabuka-map-toolbar h2 {
    margin-bottom: 0;
    color: #fff;
    font-size: 1.15rem;
}

.jabuka-layer-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem 0.85rem;
    max-width: 48rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.jabuka-layer-controls legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.jabuka-layer-controls label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #dce8e7;
    font-size: 0.72rem;
    cursor: pointer;
}

.jabuka-layer-controls input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--yellow);
}

.jabuka-layer-controls label > span {
    width: 0.55rem;
    height: 0.55rem;
    flex: 0 0 auto;
    border: 1px solid #fff;
    border-radius: 50%;
    background: #67c8d5;
}

.jabuka-layer-controls .source-ais_fishing > span {
    background: var(--yellow);
}

.jabuka-layer-controls .source-sar > span {
    border-radius: 0;
    background: var(--magenta);
    transform: rotate(45deg);
}

#jabuka-map {
    position: relative;
    min-height: 560px;
    overflow: hidden;
    color: #dce8e7;
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        var(--sea);
    background-size: 32px 32px;
    border-block: 1px solid #5a7281;
}

#jabuka-map > [data-map-status] {
    position: absolute;
    inset: 0;
    z-index: 500;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 1rem;
    text-align: center;
    background: var(--sea);
}

#jabuka-map.is-ready > [data-map-status] {
    display: none;
}

.leaflet-container {
    font-family: Tahoma, Verdana, Arial, sans-serif;
}

.leaflet-control-zoom a {
    color: #fff;
    background: #102f46;
    border-color: #597081;
}

.leaflet-control-zoom a:hover,
.leaflet-control-zoom a:focus {
    color: #000;
    background: var(--yellow);
}

.leaflet-tooltip.jabuka-zone-label {
    padding: 0.12rem 0.34rem;
    color: #061d4f;
    font-family: "Courier New", monospace;
    font-size: 0.75rem;
    font-weight: 900;
    background: #fffbe9;
    border: 2px solid currentColor;
    border-radius: 0;
    box-shadow: none;
}

.leaflet-tooltip.jabuka-zone-label::before {
    display: none;
}

.jabuka-sar-icon {
    display: grid;
    place-items: center;
    background: transparent;
}

.jabuka-sar-icon span {
    display: block;
    width: 0.75rem;
    height: 0.75rem;
    background: var(--magenta);
    border: 2px solid #fff;
    transform: rotate(45deg);
}

.jabuka-legend {
    padding: 0.65rem 1rem 0.8rem;
}

.jabuka-legend h3 {
    margin-bottom: 0.4rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.jabuka-legend ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.jabuka-legend li {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.7rem;
}

.jabuka-legend li > span {
    display: block;
    width: 1.5rem;
    height: 0.55rem;
    border: 2px solid var(--yellow);
    background: rgba(255, 223, 53, 0.18);
}

.jabuka-legend .legend-ais_fishing > span {
    width: 0.5rem;
    height: 0.5rem;
    border-color: #061d4f;
    border-radius: 50%;
    background: var(--yellow);
}

.jabuka-legend .legend-ais_fishing > .legend-fishing-large {
    width: 0.9rem;
    height: 0.9rem;
    margin-left: -0.2rem;
}

.jabuka-legend .legend-ais_presence > span {
    width: 0.55rem;
    height: 0.55rem;
    border-color: #fff;
    border-radius: 50%;
    background: #67c8d5;
}

.jabuka-legend .legend-review_required > span {
    width: 0.75rem;
    height: 0.75rem;
    border-color: #fff;
    border-radius: 50%;
    background: #ff8a00;
}

.jabuka-legend .legend-sar > span {
    width: 0.65rem;
    height: 0.65rem;
    border-color: #fff;
    background: var(--magenta);
    transform: rotate(45deg);
}

.jabuka-legend .legend-zone_b > span {
    border-color: #67c8d5;
    border-style: dashed;
    background: repeating-linear-gradient(135deg, transparent 0 3px, rgba(103, 200, 213, 0.45) 3px 5px);
}

.jabuka-legend .legend-zone_c > span {
    border-color: var(--magenta);
    border-style: dotted;
    background: repeating-linear-gradient(45deg, transparent 0 3px, rgba(209, 15, 130, 0.45) 3px 5px);
}

.jabuka-legend .legend-nearby > span {
    border-color: #fff;
    border-style: double;
    background: repeating-linear-gradient(90deg, transparent 0 4px, rgba(255, 255, 255, 0.32) 4px 6px);
}

.jabuka-inspector {
    min-width: 0;
    padding: 1rem;
    background: #0c2638;
}

.jabuka-inspector h2 {
    color: #fff;
    font-size: 1.2rem;
}

.jabuka-inspector h3 {
    padding-top: 0.8rem;
    color: #fff3a6;
    font-size: 1rem;
    border-top: 1px solid #597081;
}

.jabuka-inspector dl {
    margin: 0;
}

.jabuka-inspector dl div {
    display: grid;
    grid-template-columns: minmax(6rem, 0.38fr) minmax(0, 0.62fr);
    gap: 0.65rem;
    padding: 0.45rem 0;
    border-top: 1px solid #29485c;
}

.jabuka-inspector dt {
    color: #a9bec4;
    font-size: 0.74rem;
}

.jabuka-inspector dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: #fff;
    font-family: "Courier New", monospace;
    font-size: 0.76rem;
}

.jabuka-inspector [data-inspector-empty] {
    color: #b9cacc;
}

.jabuka-observations,
.jabuka-rules,
.jabuka-education > .window-panel,
.jabuka-attribution {
    min-width: 0;
    padding: clamp(1rem, 2.5vw, 1.6rem);
}

.jabuka-observations .section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 1rem;
    align-items: end;
}

.jabuka-observations .section-heading > *:not(.jabuka-observation-count) {
    grid-column: 1;
}

.jabuka-observation-count {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
    margin: 0;
    color: var(--navy);
    font-family: "Courier New", monospace;
    font-weight: 700;
}

.jabuka-vessel-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0 0 0.75rem;
}

.jabuka-vessel-summary span {
    display: inline-block;
    padding: 0.32rem 0.55rem;
    color: #fff;
    font-family: "Courier New", monospace;
    font-size: 0.74rem;
    font-weight: 700;
    background: var(--navy);
    border-left: 4px solid var(--yellow);
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
    border: 2px inset #aaa;
}

.jabuka-observations table {
    width: 100%;
    min-width: 690px;
    border-collapse: collapse;
    background: #faf9f1;
}

.jabuka-observations th,
.jabuka-observations td {
    padding: 0.55rem 0.65rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #aeb5b6;
}

.jabuka-observations th {
    color: #fff;
    font-size: 0.75rem;
    background: var(--navy);
}

.jabuka-observations td {
    font-size: 0.76rem;
}

.jabuka-observations tbody tr:focus-within,
.jabuka-observations tbody tr:hover {
    background: #fff7bd;
}

.jabuka-vessel-row td:first-child {
    max-width: 16rem;
    overflow-wrap: anywhere;
    font-family: "Courier New", monospace;
    font-weight: 700;
}

.jabuka-vessel-details {
    background: #f1efe0;
}

.jabuka-vessel-details ul {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding-left: 1.1rem;
}

.jabuka-vessel-details button {
    margin-top: 0;
}

.jabuka-observations button {
    display: inline-block;
    margin-top: 0.3rem;
    min-height: 2.4rem;
    padding: 0.38rem 0.58rem;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--navy);
    border: 2px outset #aab5c4;
    cursor: pointer;
}

.jabuka-observations button:hover {
    color: #000;
    background: var(--yellow);
}

.jabuka-observations button:focus-visible,
.jabuka-layer-controls input:focus-visible,
#jabuka-map:focus-visible,
.jabuka-inspector h2:focus-visible {
    outline: 3px solid var(--magenta);
    outline-offset: 3px;
}

.jabuka-more-button {
    margin: 0.75rem 0 1.1rem;
}

.jabuka-sar-list {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 2px solid var(--navy);
}

.jabuka-sar-list h3 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.jabuka-sar-list p {
    max-width: 72ch;
    font-size: 0.85rem;
}

.jabuka-noscript {
    margin: 0.8rem 0 0;
    padding: 0.65rem;
    color: #fff;
    background: var(--magenta);
}

.jabuka-zone-rules {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

.jabuka-zone-rules li {
    padding: 1rem;
    border-top: 4px solid var(--navy);
    border-right: 1px solid #929a9b;
}

.jabuka-zone-rules li:last-child {
    border-right: 0;
}

.jabuka-zone-rules li[data-zone="B"] {
    border-top-style: dashed;
    border-top-color: var(--teal);
}

.jabuka-zone-rules li[data-zone="C"] {
    border-top-style: dotted;
    border-top-color: var(--magenta);
}

.jabuka-zone-rules h3 {
    margin-bottom: 0.45rem;
    font-family: "Courier New", monospace;
}

.jabuka-zone-rules p {
    margin-bottom: 0;
    font-size: 0.85rem;
}

.jabuka-education {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
    gap: 1.25rem;
    min-width: 0;
}

.jabuka-disclaimer {
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    color: #fff;
    background: var(--navy);
    border-left: 5px solid var(--yellow);
}

.jabuka-disclaimer h3 {
    margin-bottom: 0.3rem;
    color: #fff3a6;
}

.jabuka-disclaimer p {
    margin-bottom: 0;
}

.jabuka-attribution ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1.25rem;
    margin-bottom: 0;
}

@media (max-width: 840px) {
    .jabuka-intro,
    .jabuka-freshness,
    .jabuka-workspace,
    .jabuka-education {
        grid-template-columns: 1fr;
    }

    .jabuka-source-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .jabuka-map-column {
        border-right: 0;
        border-bottom: 1px solid #5a7281;
    }

    #jabuka-map {
        min-height: 500px;
    }

    .jabuka-inspector {
        min-height: 13rem;
    }
}

@media (max-width: 520px) {
    .jabuka-intro {
        gap: 1rem;
    }

    .jabuka-freshness-summary {
        grid-template-columns: 1fr;
    }

    .jabuka-freshness-summary dl {
        grid-column: auto;
        grid-row: auto;
    }

    .jabuka-source-list,
    .jabuka-zone-rules {
        grid-template-columns: 1fr;
    }

    .jabuka-source-list article {
        display: block;
    }

    .jabuka-map-toolbar {
        display: grid;
    }

    .jabuka-layer-controls {
        display: grid;
        justify-content: stretch;
    }

    #jabuka-map {
        min-height: 420px;
    }

    .jabuka-legend ul {
        display: grid;
    }

    .jabuka-observations .section-heading {
        display: block;
    }

    .jabuka-observation-count {
        margin-bottom: 0.7rem;
    }

    .jabuka-zone-rules li,
    .jabuka-zone-rules li:last-child {
        border-right: 0;
    }

    .jabuka-vessel-summary {
        display: grid;
    }

    .jabuka-vessel-table-wrap table,
    .jabuka-vessel-table-wrap thead,
    .jabuka-vessel-table-wrap tbody,
    .jabuka-vessel-table-wrap tr,
    .jabuka-vessel-table-wrap th,
    .jabuka-vessel-table-wrap td {
        display: block;
        min-width: 0;
    }

    .jabuka-vessel-table-wrap thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .jabuka-vessel-row {
        border-bottom: 2px solid #aeb5b6;
    }

    .jabuka-vessel-row td {
        border-bottom: 0;
    }

    .jabuka-vessel-details td {
        border-bottom: 2px solid #aeb5b6;
    }

    .jabuka-attribution ul {
        display: grid;
        padding-left: 1.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jabuka-monitor *,
    .jabuka-monitor *::before,
    .jabuka-monitor *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
