:root {
    --page-background: #f3f4f6;
    --header-background: #ffffff;
    --panel-background: #ffffff;
    --panel-heading-background: #f3f4f6;
    --section-heading-background: #b9d5f7;
    --border-colour: #4b5563;
    --light-border-colour: #d1d5db;
    --colourbar-border-colour: #374151;
    --text-colour: #111111;
    --error-background: #fee2e2;
    --error-border: #dc2626;
    --plot-validity-background: rgb(255 255 255 / 75%);
}

/* Base */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text-colour);
    background: var(--page-background);
    font-family: Arial, Helvetica, sans-serif;
}

/* Header */

.app-header {
    display: flex;
    align-items: center;
    height: 76px;
    padding: 0 24px;
    background: var(--header-background);
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.app-logo {
    display: block;
    width: 220px;
    height: auto;
}

.app-brand {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
}

.app-title {
    margin: 0 0 0 38px;
    font-size: 36px;
    font-weight: 400;
    line-height: 1;
}

.user-dropdown {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
}

.user-dropdown summary {
    list-style: none;
}

.user-dropdown summary::-webkit-details-marker {
    display: none;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 14px;

    border: 0;
    background: transparent;

    color: #596579;
    font: inherit;
    font-size: 0.95rem;

    cursor: pointer;
}

.user-menu:hover {
    background: #f5f6f8;
}

.user-menu-arrow {
    width: 8px;
    height: 8px;

    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;

    transform: rotate(45deg);
    transform-origin: center;

    margin-top: -3px;

    transition: transform 0.15s ease;
}

.user-dropdown[open] .user-menu-arrow {
    transform: rotate(225deg);
    margin-top: 3px;
}

.user-dropdown__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1000;

    width: 155px;

    padding: 5px 0;

    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 5px;

    box-shadow: 0 4px 12px rgb(0 0 0 / 15%);
}

.user-dropdown__menu form {
    margin: 0;
}

.user-dropdown__logout {
    display: block;
    width: 100%;

    padding: 10px 13px;

    border: 0;
    border-radius: 0;
    background: transparent;

    color: #4b5563;
    font: inherit;
    font-size: 0.85rem;
    text-align: left;

    cursor: pointer;
}

.user-dropdown__logout:hover {
    background: #f3f4f6;
    color: #111827;
}

.user-dropdown__logout:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

.header-spacer {
    height: 46px;
    background: var(--header-background);
    border-bottom: 1px solid var(--light-border-colour);
}

/* Main layout and navigation */

.dashboard-layout {
    display: grid;
    grid-template-columns: 219px minmax(0, 1fr);
    min-height: calc(100vh - 110px);
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;

    height: 100vh;
    padding: 16px 12px;

    background: #ffffff;
    border-right: 1px solid var(--border-colour);
}

.sidebar-links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar-links li {
    margin: 0 0 3px;
}

.sidebar-links a {
    display: block;

    padding: 10px 10px;

    color: var(--text-colour);
    border-left: 3px solid transparent;
    border-radius: 3px;

    font-size: 17px;
    line-height: 1.2;
    text-decoration: none;
}

.sidebar-links a:hover {
    background: #e8f1fc;
    border-left-color: #4f8edc;
    text-decoration: none;
}

.sidebar-links a:focus-visible {
    background: #e8f1fc;
    border-left-color: #4f8edc;
    outline: 2px solid #1d4ed8;
    outline-offset: 1px;
}

.dashboard-content {
    min-width: 0;
    padding: 16px 32px 48px;
}

/* Shared dashboard sections and panels */

.dashboard-section {
    margin: 0 0 32px;
    scroll-margin-top: 20px;
}

.section-heading {
    margin: 0 0 16px;
    padding: 16px;
    background: var(--section-heading-background);
    font-size: 24px;
    font-weight: 400;
    line-height: 1.2;
}

.section-message {
    margin: 0;
    font-size: 20px;
    line-height: 1.4;
}

.section-description {
    margin: 0 8px 30px;
    font-size: 18px;
    line-height: 1.45;
    text-align: left;
}

.panel {
    margin: 0 8px;
    background: transparent;
    border: 1px solid var(--border-colour);
}

.panel-heading {
    padding: 10px;
    border-bottom: 1px solid var(--border-colour);
    font-size: 19px;
    font-weight: 400;
}

.panel-content {
    padding: 8px;
}

.plot-panel-content {
    padding: 8px;
}

.dashboard-plot {
    display: block;
    width: 100%;
    height: auto;
}

.product-error {
    margin: 8px;
    padding: 16px;

    background: var(--error-background);
    border: 1px solid var(--error-border);
    border-left-width: 4px;

    line-height: 1.4;
}

/* Shared plot validity timestamp */

.plot-validity,
.plot-timestamp,
.flash-flood-history-validity {
    position: absolute;
    z-index: 2;
    top: 12px;
    left: 14px;
    margin: 0;
    padding: 4px 7px;
    color: var(--text-colour);
    background: var(--plot-validity-background);
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
}

/* Alert status */

.alert-risk {
    font-weight: 700;
}

.alert-risk-neutral {
    color: var(--text-colour);
}

.alert-risk-green {
    color: #15803d;
}

.alert-risk-amber {
    color: #b45309;
}

.alert-risk-red {
    color: #b91c1c;
}

.alert-additional-message {
    margin: 4px 0 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.alert-status-products {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 28px;
    border: 1px solid var(--border-colour);
    background: var(--panel-background);
}

.alert-status-product {
    min-width: 0;
    margin: 0;
    background: var(--panel-background);
}

.alert-status-product + .alert-status-product {
    border-left: 1px solid var(--border-colour);
}

.alert-status-product:only-child {
    grid-column: 1 / -1;
}

.alert-status-product-heading {
    padding: 10px 9px;
    border-bottom: 1px solid var(--border-colour);
    background: var(--panel-heading-background);
    font-weight: 400;
    line-height: 1.25;
    text-align: left;
}

.alert-status-product-body {
    padding: 8px;
    background: var(--panel-background);
}

.alert-status-product-body img {
    display: block;
    width: 100%;
    height: auto;
}

/* Flash-flood current map and postcode tables */

.flash-flood-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin: 0 8px;
    border: 1px solid var(--border-colour);
}

.flash-flood-column {
    min-width: 0;
}

.flash-flood-column + .flash-flood-column {
    border-left: 1px solid var(--border-colour);
}

.column-heading {
    margin: 0;
    padding: 9px;
    border-bottom: 1px solid var(--border-colour);
    font-size: 18px;
    font-weight: 400;
}

.column-content {
    padding: 8px;
}

.flash-flood-figure {
    position: relative;
    margin: 0;
}

.flash-flood-image {
    display: block;
    width: 100%;
    height: auto;
}

.table-panel {
    border: 1px solid var(--border-colour);
}

.table-panel-spaced {
    margin-top: 28px;
}

.table-title {
    margin: 0;
    padding: 9px;
    border-bottom: 1px solid var(--border-colour);
    font-size: 16px;
    font-weight: 400;
}

.table-scroll {
    max-height: 220px;
    overflow: auto;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.dashboard-table th,
.dashboard-table td {
    padding: 9px 8px;
    border-right: 1px solid var(--border-colour);
    border-bottom: 1px solid var(--border-colour);
    text-align: left;
    vertical-align: middle;
}

.dashboard-table th:last-child,
.dashboard-table td:last-child {
    border-right: 0;
}

.dashboard-table tbody tr:last-child td {
    border-bottom: 0;
}

.dashboard-table th {
    background: var(--panel-background);
    font-size: 12px;
    font-weight: 700;
}

.summary-table thead tr:first-child th[colspan] {
    text-align: center;
}

.summary-table thead tr:last-child th:not(:first-child),
.summary-table tbody td:not(:first-child) {
    text-align: left;
}

.summary-table thead tr:last-child th:first-child,
.summary-table tbody td:first-child {
    text-align: left;
}

.no-events {
    display: inline-block;
    padding: 7px;
    background: #6ee7b7;
    line-height: 1.35;
}

.download-links {
    display: grid;
    gap: 24px;
    margin-top: 24px;
}

.download-links a {
    color: #1e3a8a;
    font-size: 16px;
    font-weight: 700;
    text-decoration: underline;
}

.download-links a:hover {
    color: #1d4ed8;
}

.download-links a:visited {
    color: #1e3a8a;
}

/* Shared vertical plot colourbar */

.plot-colourbar {
    --colourbar-height: 460px;

    position: absolute;
    z-index: 3;
    top: 5%;
    right: 18px;
    width: 160px;
    padding: 0;
    background: transparent;
    border: 0;
    pointer-events: none;
}

.rainfall-static-figure .plot-colourbar {
    right: 36px;
}

.colourbar-title {
    width: 100%;
    margin: 0 0 14px;
    font-size: 15px;
    line-height: 1.3;
    text-align: center;
}

.colourbar-layout {
    display: grid;
    grid-template-columns: 82px 32px;
    gap: 8px;
    align-items: start;
}

.colourbar-categories {
    position: relative;
    height: var(--colourbar-height);
}

.colourbar-category {
    position: absolute;
    top: var(--position);
    right: 0;
    padding-right: 5px;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    text-align: right;
    transform: translateY(-50%);
}

.colourbar-track {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 30px;
    height: var(--colourbar-height);
    overflow: visible;
    border: 0;
}

.colourbar-track::after {
    content: "";
    position: absolute;
    z-index: 2;
    inset: 0;

    border: 1px solid var(--colourbar-border-colour);

    pointer-events: none;
}

.colourbar-segment {
    display: block;
    flex: 0 0 var(--segment-height);
    min-height: 0;

    background-color: var(--segment-colour);
}

.colourbar-boundary {
    position: absolute;
    z-index: 1;
    top: var(--position);
    right: 0;
    left: 0;

    height: 0;
    border-top: 1px solid var(--colourbar-border-colour);

    pointer-events: none;
}

.colourbar-tick {
    position: absolute;
    top: var(--position);
    left: 100%;
    display: flex;
    align-items: center;
    transform: translateY(-50%);
}

.colourbar-tick-bottom {
    top: calc(var(--position) - 1px);
}

.colourbar-tick-top .colourbar-tick-label {
    transform: translateY(0);
}

.colourbar-tick-line {
    display: block;
    width: 7px;
    border-top: 1px solid var(--text-colour);
}

.colourbar-tick-label {
    display: block;
    min-width: 26px;
    margin-left: 4px;
    padding: 1px 2px;
    background: transparent;
    font-size: 13px;
    line-height: 1;
    text-align: left;
}

.colourbar-title,
.colourbar-category,
.colourbar-tick-label {
    text-shadow: none;
}

.plot-colourbar--no-categories .colourbar-title {
    width: auto;
    margin-left: 90px;
    text-align: left;
}

/* Historical flash-flood maps */

.flash-flood-history {
    margin-top: 28px;
    border: 1px solid var(--border-colour);
}

.flash-flood-history > .panel-heading {
    margin: 0;
    padding: 10px 9px;
    border-bottom: 1px solid var(--border-colour);
    background: var(--panel-heading-background);
}

.flash-flood-history-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--border-colour);
}

.flash-flood-history-card {
    position: relative;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 4px solid var(--panel-background);
    background: var(--panel-background);
}

.flash-flood-history-card img {
    display: block;
    width: 100%;
    height: auto;
}

.flash-flood-history-open {
    position: relative;
    display: block;

    width: 100%;
    padding: 0;

    color: inherit;
    background: transparent;
    border: 0;

    font: inherit;
    text-align: inherit;

    cursor: zoom-in;
}

.flash-flood-history-open img {
    display: block;
    width: 100%;
    height: auto;
}

.flash-flood-history-open:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: -3px;
}

.flash-flood-history-static {
    position: relative;
    display: block;
    width: 100%;
}

.flash-flood-history-static img {
    display: block;
    width: 100%;
    height: auto;
}

/* Enlarged image modal */

.image-modal {
    width: min(96vw, 78vh, 950px);
    max-width: none;
    padding: 0;

    overflow: visible;
    background: transparent;
    border: 0;
}

.image-modal::backdrop {
    background: rgb(0 0 0 / 72%);
}

.image-modal-content {
    padding: 4px;

    background: #ffffff;
    border: 1px solid var(--border-colour);
}

.image-modal-figure {
    position: relative;

    width: 100%;
    aspect-ratio: 5 / 6;
    margin: 0;

    overflow: hidden;
    background: #ffffff;
}

.image-modal-image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;
}

.image-modal-validity {
    z-index: 3;
}

.image-modal-validity:empty {
    display: none;
}

.image-modal-close {
    position: absolute;
    z-index: 4;
    top: 12px;
    right: 14px;

    width: 32px;
    height: 32px;
    padding: 0;

    color: var(--text-colour);
    background: rgb(255 255 255 / 80%);
    border: 1px solid var(--border-colour);

    font: inherit;
    font-size: 24px;
    line-height: 1;

    cursor: pointer;
}

.image-modal-close:hover {
    background: #ffffff;
}

.image-modal-close:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
}

/* Horizontal colourbar below the historical maps */

.horizontal-colourbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;

    padding: 10px 16px 0;

    border-top: 1px solid var(--border-colour);
    background: var(--page-background);
}

.horizontal-colourbar-title {
    flex: 0 0 105px;

    width: auto;
    margin: 0;

    font-size: 1rem;
    line-height: 1.25;
    text-align: center;
}

.horizontal-colourbar-scale {
    position: relative;

    flex: 0 1 var(--horizontal-colourbar-width);
    width: min(100%, var(--horizontal-colourbar-width));
    margin: 0;

    padding-top: 24px;
    padding-bottom: 28px;
}

.horizontal-colourbar-categories {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
}

.horizontal-colourbar-category {
    position: absolute;
    left: var(--position);
    font-size: 0.8rem;
    line-height: 1;
    white-space: nowrap;
    transform: translateX(-50%);
}

.horizontal-colourbar-track {
    position: relative;
    display: flex;

    width: 100%;
    height: 22px;

    overflow: visible;
    border: 0;
    box-sizing: border-box;
}

.horizontal-colourbar-track::after {
    content: "";
    position: absolute;
    z-index: 2;
    inset: 0;

    border: 1px solid var(--colourbar-border-colour);

    pointer-events: none;
}

.horizontal-colourbar-segment {
    display: block;
    flex: 0 0 var(--segment-width);
    min-width: 0;

    background-color: var(--segment-colour);
}

.horizontal-colourbar-boundary {
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    left: var(--position);

    width: 0;
    border-left: 1px solid var(--colourbar-border-colour);

    pointer-events: none;
}

.horizontal-colourbar-tick {
    position: absolute;
    bottom: -6px;
    left: var(--position);

    width: 0;
    height: 6px;

    border-left: 1px solid var(--colourbar-border-colour);
}

.horizontal-colourbar-tick-label {
    position: absolute;
    top: 8px;
    left: var(--position);

    font-size: 0.8rem;
    line-height: 1;

    transform: translateX(-50%);
}

.horizontal-colourbar-labels {
    position: relative;
    width: 100%;
}

/* National warnings */

.national-warnings {
    margin-bottom: 2rem;
}

.warning-summary {
    margin: 0 0 2rem;
}

.warning-summary:last-child {
    margin-bottom: 0;
}

.warning-summary__title {
    margin: 0 0 0.55rem;
    font-size: 1.1rem;
    font-weight: 400;
}

.warning-summary__table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.warning-summary__table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.warning-summary__table th,
.warning-summary__table td {
    width: 33.333%;
    border: 1px solid #333;
    text-align: center;
    vertical-align: middle;
}

.warning-summary__table th {
    padding: 0.55rem;
    background-color: #f1f2f4;
    color: #111;
    font-size: 1rem;
    font-weight: 400;
}

.warning-summary__value {
    padding: 0.4rem 0.5rem;
    font-weight: 700;
}

.warning-summary__value--severe,
.warning-summary__value--warning {
    background-color: #ffc5c7;
    color: #9c1118;
}

.warning-summary__value--alert {
    background-color: #ffc126;
    color: #875600;
}

.warning-summary__note {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
}

.warning-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    white-space: nowrap;
    font-weight: 700;
}

.warning-count__direction {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 1.25rem;

    font-family: "DejaVu Sans", Arial, Helvetica, sans-serif;
    font-weight: 900;
    line-height: 0.9;
}

.warning-count__direction--increase,
.warning-count__direction--decrease {
    font-size: 1.4rem;
    transform: scaleX(1.1);
}

.warning-count__direction--unchanged {
    min-width: 1.6rem;
    font-size: 1.2rem;
    letter-spacing: -0.08rem;
}

.warning-count__current {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.warning-count__change {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
}

/* Regional warnings map and postcode tables */

.regional-warnings__panel {
    width: auto;
    max-width: none;
    overflow: hidden;
}

.regional-warnings {
    margin: 0;
}

.regional-warnings__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
}

.regional-warnings__column {
    min-width: 0;
}

.regional-warnings__column + .regional-warnings__column {
    border-left: 1px solid var(--border-colour);
}

.regional-warnings__map-wrapper {
    overflow-x: auto;
}

.regional-warnings__postcode-content {
    padding: 16px 8px 8px;
}

.postcode-warnings {
    display: grid;
    gap: 14px;
}

.postcode-warning-table {
    border: 1px solid var(--border-colour);
}

.postcode-warning-table__title {
    margin: 0;
    padding: 9px;

    border-bottom: 1px solid var(--border-colour);

    font-size: 16px;
    font-weight: 400;
    line-height: 1.25;
}

.postcode-warning-table__table {
    width: 100%;

    border-collapse: collapse;
    table-layout: fixed;

    font-size: 14px;
}

.postcode-warning-table__table th,
.postcode-warning-table__table td {
    padding: 9px 8px;

    border-right: 1px solid var(--border-colour);
    border-bottom: 1px solid var(--border-colour);

    text-align: left;
    vertical-align: middle;
}

.postcode-warning-table__table th {
    background: var(--panel-background);

    font-size: 12px;
    font-weight: 700;
}

.postcode-warning-table__table th:last-child,
.postcode-warning-table__table td:last-child {
    border-right: 0;
}

.postcode-warning-table__table tbody tr:last-child td {
    border-bottom: 0;
}

.postcode-warning-table__table th:nth-child(1),
.postcode-warning-table__table td:nth-child(1) {
    width: 34%;
}

.postcode-warning-table__table th:nth-child(2),
.postcode-warning-table__table td:nth-child(2) {
    width: 34%;
}

.postcode-warning-table__table th:nth-child(3),
.postcode-warning-table__table td:nth-child(3) {
    width: 32%;
}

.postcode-warning-table__scroll {
    max-height: 460px;
    overflow: auto;
}

.postcode-warning-table__scroll thead th {
    position: sticky;
    z-index: 1;
    top: 0;
    background: var(--panel-background);
}

.postcode-warnings__information {
    padding: 0 8px 8px;
}

.postcode-warnings__note,
.postcode-warnings__download,
.postcode-warnings__footnote {
    margin: 0;
    line-height: 1.45;
}

.postcode-warnings__download {
    margin-top: 4px;
}

.postcode-warnings__download a {
    color: #1e3a8a;
    font-size: 16px;
    font-weight: 700;
    text-decoration: underline;
}

.postcode-warnings__download a:hover {
    color: #1d4ed8;
}

.postcode-warnings__footnote {
    margin-top: 16px;
    font-size: 13px;
}

.regional-warning-map {
    position: relative;

    width: 100%;
    aspect-ratio: 3 / 4;
    margin: 0;

    overflow: hidden;
    container-type: inline-size;

    background: #ffffff;
}

.regional-warning-map__image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

/* Regional marker groups */

.regional-warning-map__region {
    position: absolute;
    z-index: 2;

    top: var(--region-top);
    right: var(--region-right);

    width: min(30.333%, 182px);
}

.regional-warning-map__region-name {
    margin: 0 0 3px;

    color: #000000;

    font-size: clamp(
        0.8rem,
        2.7cqw,
        1.25rem
    );
    font-weight: 700;
    line-height: 1.1;
}

.regional-warning-map__region-name--left {
    text-align: left;
}

.regional-warning-map__region-name--right {
    text-align: right;
}

.regional-warning-map__circles {
    display: flex;
    align-items: center;
}

/* Warning circles */

.regional-warning-circle {
    display: inline-flex;
    flex: 0 0 min(33.333%, 60px);
    align-items: center;
    justify-content: center;

    width: min(33.333%, 60px);
    aspect-ratio: 1;

    color: #000000;
    background: #ff0000;
    border: clamp(3px, 1cqw, 6px) solid #ff0000;
    border-radius: 50%;

    font-size: clamp(
        0.7rem,
        2.7cqw,
        1rem
    );
    font-weight: 700;
    line-height: 1;
}

.regional-warning-circle--severe {
    background: #ff0000;
    border-color: #000000;
}

.regional-warning-circle--warning {
    background: #ff0000;
    border-color: #ff0000;
}

.regional-warning-circle--alert {
    background: #ff8000;
    border-color: #ff8000;
}

/* Total warning counts */

.regional-warning-map__totals {
    position: absolute;
    z-index: 2;

    top: 5%;
    right: 5%;

    width: min(37%, 220px);
}

.regional-warning-map__totals-title {
    margin: 0 0 4px;

    color: #000000;

    font-size: clamp(
        0.85rem,
        3cqw,
        1.25rem
    );
    font-weight: 700;
    line-height: 1.1;
}

.regional-warning-map__total-row {
    display: flex;
    align-items: center;
    gap: clamp(5px, 1.5cqw, 14px);

    margin-bottom: 2px;
}

.regional-warning-map__total-row
.regional-warning-circle {
    flex: 0 0 min(28%, 60px);
    width: min(28%, 60px);
}

.regional-warning-map__total-label {
    color: #000000;

    font-size: clamp(
        0.65rem,
        2.4cqw,
        1rem
    );
    font-weight: 700;
    line-height: 1.15;
}

/* Rainfall section */

.rainfall-product-group {
    width: auto;
    max-width: none;
    overflow: hidden;
}

.rainfall-animation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
}

.rainfall-product-column {
    min-width: 0;
}

.rainfall-product-column
+ .rainfall-product-column {
    border-left: 1px solid var(--border-colour);
}

.rainfall-product-group--spaced {
    margin-top: 28px;
}

.rainfall-pair-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
}

.rainfall-static-figure {
    position: relative;
    margin: 0;
}

.rainfall-static-image {
    display: block;
    width: 100%;
    height: auto;
}

/* Rainfall animation */

.rainfall-animation {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #71c9e8;
}

.rainfall-animation__map {
    width: 100%;
    height: clamp(600px, 55vw, 900px);
}

/* Rainfall animation controls */

.rainfall-animation__controls {
    position: absolute;
    z-index: 5;
    top: 12px;
    left: 12px;

    display: flex;
    align-items: center;
    gap: 6px;

    max-width: calc(100% - 24px);
    padding: 8px 10px;

    background: rgb(255 255 255 / 78%);
    border-radius: 4px;
}

.rainfall-animation__control-icon {
    width: 16px;
    height: 16px;
    display: block;
    fill: currentColor;
}

.rainfall-animation__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 42px;
    height: 30px;
    padding: 0 8px;

    color: #ffffff;
    background: #377ee6;
    border: 1px solid #17498d;

    font: inherit;
    font-size: 15px;
    line-height: 1;

    cursor: pointer;
}

.rainfall-animation__button:hover:not(:disabled) {
    background: #2563c8;
}

.rainfall-animation__button:focus-visible {
    outline: 3px solid #111111;
    outline-offset: 2px;
}

.rainfall-animation__button:disabled {
    opacity: 0.5;
    cursor: default;
}

.rainfall-animation__validity {
    min-width: 220px;
    margin-left: 8px;

    font-size: 16px;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

.rainfall-animation__pause-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;

    width: 16px;
    height: 16px;
}

.rainfall-animation__pause-icon span {
    display: block;

    width: 4px;
    height: 14px;

    background: currentColor;
    border-radius: 1px;
}

/* Client-side animation errors */

.rainfall-animation__status {
    display: none;
}

.rainfall-animation--error
.rainfall-animation__map,
.rainfall-animation--error
.rainfall-animation__controls {
    display: none;
}

.rainfall-animation--error
.rainfall-animation__status {
    display: block;
    margin: 8px;
    padding: 16px;

    background: var(--error-background);
    border: 1px solid var(--error-border);
    border-left-width: 4px;

    line-height: 1.4;
}

.rainfall-animation__zoom-hint {
    position: absolute;
    z-index: 5;
    bottom: 32px;
    left: 12px;

    display: flex;
    align-items: center;
    gap: 6px;

    padding: 7px 10px;

    background: rgb(255 255 255 / 78%);
    border-radius: 4px;

    font-size: 15px;
    line-height: 1.2;

    pointer-events: none;
}

.rainfall-animation__zoom-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Rainfall-rate colourbar */

.rainfall-rate-colourbar {
    position: absolute;
    z-index: 5;
    top: 84px;
    right: 36px;

    color: #111111;

    font-size: 13px;
    line-height: 1;
}

.rainfall-rate-colourbar__title {
    margin-bottom: 8px;

    font-size: 15px;
    line-height: 1.2;
    text-align: left;
}

.rainfall-rate-colourbar__scale {
    display: flex;
    flex-direction: column;
}

.rainfall-rate-colourbar__row {
    display: flex;
    align-items: center;

    height: 24px;
}

.rainfall-rate-colourbar__swatch {
    display: block;
    flex: 0 0 30px;

    width: 30px;
    height: 24px;

    background-color: var(--rainfall-colour);

    border-right: 1px solid #000000;
    border-bottom: 1px solid #000000;
    border-left: 1px solid #000000;
}

.rainfall-rate-colourbar__row:first-child
.rainfall-rate-colourbar__swatch {
    border-top: 1px solid #000000;
}

.rainfall-rate-colourbar__label {
    min-width: 30px;
    margin-left: 6px;

    text-align: left;
    white-space: nowrap;
}

/* Responsive adjustments */

@media (max-width: 1100px) {
    .flash-flood-grid {
        grid-template-columns: 1fr;
    }

    .flash-flood-column + .flash-flood-column {
        border-top: 1px solid var(--border-colour);
        border-left: 0;
    }

    .flash-flood-history-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .app-header {
        height: auto;
        min-height: 64px;
        flex-wrap: wrap;
        gap: 12px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .app-logo {
        width: 150px;
    }

    .app-title {
        margin-left: 10px;
        font-size: 26px;
    }

    .header-spacer {
        height: 20px;
    }

    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--border-colour);
    }

    .sidebar-links {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 18px;
    }

    .dashboard-content {
        padding: 16px;
    }

    .alert-status-products {
        grid-template-columns: 1fr;
    }

    .alert-status-product + .alert-status-product {
        border-top: 1px solid var(--border-colour);
        border-left: 0;
    }
}

@media (max-width: 700px) {
    .image-modal {
        width: 98vw;
        max-height: 98vh;
    }

    .image-modal-content {
        padding: 2px;
    }

    .image-modal-image {
        max-height: 94vh;
    }

    .image-modal-close {
        top: 8px;
        right: 8px;
    }

    .plot-colourbar {
        position: static;
        width: 180px;
        margin: 16px auto 0;
    }

    .horizontal-colourbar {
        flex-direction: column;
        gap: 10px;
    }

    .horizontal-colourbar-title {
        flex-basis: auto;
        width: 100%;
    }

    .horizontal-colourbar-scale {
        width: 100%;
    }

    .warning-summary__value {
        padding: 0.25rem 0.3rem;
    }

    .warning-count__direction--increase,
    .warning-count__direction--decrease {
        font-size: 1.9rem;
    }

    .warning-count__direction--unchanged {
        font-size: 1.5rem;
    }

    .warning-count__current {
        font-size: 1.25rem;
    }

    .warning-count__change {
        font-size: 0.95rem;
    }

    .regional-warnings__grid {
        grid-template-columns: 1fr;
    }

    .regional-warnings__column + .regional-warnings__column {
        border-top: 1px solid var(--border-colour);
        border-left: 0;
    }

    .regional-warning-map {
        min-width: 520px;
    }

    .rainfall-animation-grid {
        grid-template-columns: 1fr;
    }

    .rainfall-product-column
    + .rainfall-product-column {
        border-top: 1px solid var(--border-colour);
        border-left: 0;
    }

    .rainfall-animation__map {
        height: 520px;
    }

    .rainfall-animation__controls {
        top: 12px;
        left: 12px;

        flex-wrap: wrap;

        max-width: calc(100% - 24px);
        padding: 10px;
    }

    .rainfall-animation__button {
        min-width: 42px;
        height: 30px;
    }

    .rainfall-animation__validity {
        flex-basis: 100%;
        min-width: 0;
        margin: 4px 0 0;
    }

    .rainfall-animation__zoom-hint {
        bottom: 28px;
        left: 8px;

        padding: 6px 8px;
        font-size: 14px;
    }

    .rainfall-rate-colourbar {
        top: 82px;
        right: 30px;

        font-size: 12px;
    }

    .rainfall-rate-colourbar__title {
        margin-bottom: 6px;
        font-size: 13px;
    }

    .rainfall-rate-colourbar__row {
        height: 20px;
    }

    .rainfall-rate-colourbar__swatch {
        flex-basis: 30px;

        width: 30px;
        height: 20px;
    }

    .rainfall-rate-colourbar__label {
        min-width: 27px;
        margin-left: 5px;
    }
}

.colourbar-segment--transparent {
    background:
        repeating-linear-gradient(
            135deg,
            #ffffff 0,
            #ffffff 5px,
            #d1d5db 5px,
            #d1d5db 6px
        );
}

.horizontal-colourbar-segment--transparent {
    background:
        repeating-linear-gradient(
            135deg,
            #ffffff 0,
            #ffffff 5px,
            #d1d5db 5px,
            #d1d5db 6px
        );
}

.rainfall-return-period-intro {
    margin: 28px 8px;
}

.rainfall-return-period-intro h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.rainfall-return-period-intro p {
    margin: 0;
    font-size: 16px;
    line-height: 1.45;
}

/* Upstream rainfall postcode tables */

.upstream-postcode-tables {
    margin: 28px 8px 0;
}

.upstream-postcode-tables__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.upstream-postcode-tables__grid > .table-panel {
    min-width: 0;
    margin: 0;
}

.upstream-postcode-tables__note {
    margin: 16px 0 0;
    font-size: 14px;
    line-height: 1.4;
}

.upstream-postcode-tables .table-scroll {
    max-height: 460px;
    overflow: auto;
}

.upstream-postcode-tables .dashboard-table thead th {
    position: sticky;
    z-index: 1;
    top: 0;
    background: var(--panel-background);
}

@media (max-width: 700px) {
    .upstream-postcode-tables__grid {
        grid-template-columns: 1fr;
    }

    .upstream-postcode-tables__grid > .table-panel + .table-panel {
        border-top: 1px solid var(--border-colour);
        border-left: 0;
    }
}

/* River-level overlay maps */

.river-level-maps {
    margin-top: 28px;
    overflow: hidden;
}

.static-overlay-map {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #71c9e8;
}

.static-overlay-map__map {
    width: 100%;
    height: clamp(600px, 55vw, 900px);
}

/* River-level categorical legends */

.map-category-legend {
    position: absolute;
    z-index: 5;
    top: 36px;
    right: 18px;

    min-width: 220px;

    color: var(--text-colour);
    pointer-events: none;
}

.map-category-legend__title {
    margin-bottom: 8px;

    font-size: 15px;
    line-height: 1.2;
}

.map-category-legend__scale {
    display: flex;
    flex-direction: column;
}

.map-category-legend__row {
    display: flex;
    align-items: center;

    height: 24px;
}

.map-category-legend__swatch {
    display: block;
    flex: 0 0 30px;

    width: 30px;
    height: 24px;

    background: var(--legend-colour);

    border-right: 1px solid #000000;
    border-bottom: 1px solid #000000;
    border-left: 1px solid #000000;
}

.map-category-legend__row:first-child
.map-category-legend__swatch {
    border-top: 1px solid #000000;
}

.map-category-legend__label {
    margin-left: 6px;

    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
}

/* River-level postcode tables */

.river-level-postcode-tables {
    margin: 28px 8px 0;
}

.river-level-postcode-tables__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: start;
}

.river-level-postcode-tables__grid > .table-panel {
    min-width: 0;
    margin: 0;
}

.river-level-postcode-tables .table-scroll {
    max-height: 460px;
    overflow: auto;
}

.river-level-postcode-tables .dashboard-table thead th {
    position: sticky;
    z-index: 1;
    top: 0;
    background: var(--panel-background);
}

.river-level-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.river-level-table th,
.river-level-table td {
    border-right: 1px solid var(--border-colour);
    border-bottom: 1px solid var(--border-colour);
}

.river-level-table th:last-child,
.river-level-table td:last-child {
    border-right: 0;
}

@media (max-width: 700px) {
    .river-level-postcode-tables__grid {
        grid-template-columns: 1fr;
    }
}

/* Authentication pages */

.auth-body {
    margin: 0;
    min-height: 100vh;
    background: #f4f5f7;
    color: #111827;
    font-family: Arial, Helvetica, sans-serif;
}

.auth-page {
    width: 100%;
    min-height: 100vh;
}

.auth-hero {
    width: 100%;
    height: 230px;
    overflow: hidden;
    background: #d7e1e8;
}

.auth-hero__image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 45%;
}

.auth-title-banner {
    width: 100%;
    box-sizing: border-box;
    padding: 18px 20px;
    background: #737b8a;
    text-align: center;
}

.auth-title-banner h1 {
    margin: 0;
    color: #fff;
    font-size: 3rem;
    font-weight: 400;
    line-height: 1.2;
}

.auth-introduction {
    max-width: 1500px;
    margin: 0 auto;
    padding: 32px 40px 10px;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-introduction p {
    margin: 0 0 12px;
}

.auth-introduction a {
    color: inherit;
}

.auth-login-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 20px 50px;
}

.auth-logo {
    display: block;
    max-width: 110px;
    max-height: 45px;
    margin: 0 0 18px;
    object-fit: contain;
}

.auth-panel {
    width: 360px;
    max-width: 100%;
    box-sizing: border-box;
    padding: 18px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgb(0 0 0 / 12%);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field label,
.auth-password-fields label {
    font-size: 0.85rem;
    font-weight: 400;
}

.auth-field input,
.auth-password-fields input {
    width: 100%;
    box-sizing: border-box;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid #aeb7c4;
    border-radius: 3px;
    font: inherit;
}

.auth-field input:focus,
.auth-password-fields input:focus {
    border-color: #7898d4;
    outline: 2px solid rgb(66 114 200 / 20%);
}

.auth-form__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 4px;
}

.auth-forgotten-link {
    color: #4b5563;
    font-size: 0.8rem;
}

.auth-button {
    min-width: 72px;
    padding: 9px 15px;
    border: 0;
    border-radius: 4px;
    background: #1f2937;
    color: #fff;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
}

.auth-button:hover {
    background: #111827;
}

.auth-button:focus-visible {
    outline: 3px solid rgb(37 99 235 / 30%);
    outline-offset: 2px;
}

.auth-description,
.auth-secondary-link {
    line-height: 1.5;
}

.auth-password-fields p {
    margin: 0 0 14px;
}

.auth-password-fields ul {
    padding-left: 20px;
}

.auth-password-fields .errorlist {
    color: #b91c1c;
}

@media (max-width: 700px) {
    .auth-hero {
        height: 150px;
    }

    .auth-title-banner h1 {
        font-size: 2rem;
    }

    .auth-introduction {
        padding: 24px 20px 8px;
        font-size: 0.9rem;
    }

    .auth-panel {
        width: 100%;
    }

    .auth-form__actions {
        justify-content: space-between;
    }
}