/* =============================================================================
   ANDA · Géoportail public (public/publique.php)
   Charte andapub (navy, bleu, cyan, vert, or), plein écran cartographique.
   Disposition du publisher : body[data-side=start|end] (menu à gauche ou à
   droite), body[data-rail=full|compact|hidden], apparence body[data-theme].
   Aucune police distante : pile système. Aucun style en ligne (CSP).
   ========================================================================== */

:root {
    color-scheme: light;
    --navy: #103e49;
    --blue: #005784;
    --cyan: #43bbd1;
    --green: #00a492;
    --green-dark: #00796c;
    --gold: #d7b77e;
    --ink: #1b333a;
    --muted: #63777c;
    --line: #dfe8ea;
    --paper: #f5f8f7;
    --white: #fff;
    --danger: #b3412e;

    --header-bg: var(--white);
    --header-ink: var(--navy);
    --rail-bg: var(--navy);
    --rail-ink: #d5e6ea;
    --rail-active: var(--green);
    --accent: var(--green);
    --accent-ink: var(--white);

    --header-h: 64px;
    --footer-h: 30px;
    --rail-w: 232px;
    --rail-w-compact: 64px;
    --panel-w: 360px;
    --radius: 10px;
    --shadow: 0 10px 30px rgb(16 62 73 / 16%);
    --shadow-sm: 0 2px 8px rgb(16 62 73 / 14%);
    font-family: "Roboto", system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
}

/* Apparences proposées par le publisher (valeurs historiques « apparance »). */
body[data-theme="navy"] {
    --header-bg: var(--navy);
    --header-ink: var(--white);
    --rail-bg: #0b2f38;
}

body[data-theme="lightgrey"] {
    --rail-bg: #eef2f3;
    --rail-ink: #33494f;
    --rail-active: var(--blue);
    --accent: var(--blue);
}

body[data-theme="darkgrey"] {
    --header-bg: #2c3437;
    --header-ink: #f1f4f5;
    --rail-bg: #3a4447;
    --rail-ink: #dfe6e8;
}

body[data-theme="blackandwhite"] {
    --header-bg: #fff;
    --header-ink: #111;
    --rail-bg: #111;
    --rail-ink: #eee;
    --rail-active: #fff;
    --accent: #111;
}

body[data-theme="greenandorange"] {
    --header-bg: var(--green-dark);
    --header-ink: var(--white);
    --rail-bg: #0d5d55;
    --rail-active: #f08a24;
    --accent: #e0731c;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body.portal {
    display: grid;
    margin: 0;
    overflow: hidden;
    grid-template-rows: var(--header-h) minmax(0, 1fr) var(--footer-h);
    color: var(--ink);
    background: var(--paper);
    font-size: 15px;
    line-height: 1.5;
}

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

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.ico {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ico--lg {
    width: 34px;
    height: 34px;
}

.ico--chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.18s ease;
}

[dir="rtl"] .ico--chevron {
    transform: scaleX(-1);
}

.skip-link {
    position: absolute;
    z-index: 100;
    top: 8px;
    inset-inline-start: 8px;
    padding: 8px 12px;
    transform: translateY(-160%);
    border-radius: 6px;
    color: var(--white);
    background: var(--navy);
}

.skip-link:focus {
    transform: none;
}

/* ---- En-tête ---------------------------------------------------------------- */

.portal-header {
    position: relative;
    z-index: 20;
    display: flex;
    min-width: 0;
    padding: 0 14px;
    align-items: center;
    gap: 14px;
    color: var(--header-ink);
    background: var(--header-bg);
    box-shadow: 0 4px 20px rgb(16 62 73 / 9%);
}

.brand {
    display: flex;
    flex: 0 0 auto;
    padding: 4px 6px;
    border-radius: 8px;
    background: var(--white);
}

.brand img {
    display: block;
    width: auto;
    height: 42px;
}

.portal-header__title {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    padding-inline-start: 14px;
    border-inline-start: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}

.portal-header__kicker {
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

body[data-theme="navy"] .portal-header__kicker,
body[data-theme="darkgrey"] .portal-header__kicker,
body[data-theme="greenandorange"] .portal-header__kicker {
    color: var(--gold);
}

.portal-header h1 {
    overflow: hidden;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toolbar {
    display: flex;
    flex: 0 0 auto;
    padding: 4px;
    align-items: center;
    gap: 2px;
    border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
    border-radius: 12px;
}

.tool,
.icon-btn {
    display: inline-grid;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: inherit;
    background: transparent;
    cursor: pointer;
    place-items: center;
}

.tool:hover,
.icon-btn:hover {
    background: color-mix(in srgb, currentColor 10%, transparent);
}

.tool[aria-pressed="true"],
.tool[aria-expanded="true"] {
    color: var(--accent-ink);
    background: var(--accent);
}

.icon-btn--sm {
    width: 30px;
    height: 30px;
}

.icon-btn--sm .ico {
    width: 17px;
    height: 17px;
}

.tool-menu,
.lang-picker {
    position: relative;
}

.tool-menu__list,
.lang-picker__menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    display: grid;
    min-width: 220px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: var(--white);
    box-shadow: var(--shadow);
}

.tool-menu__list button,
.lang-picker__menu a {
    display: flex;
    padding: 9px 10px;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 7px;
    color: var(--ink);
    background: transparent;
    font-size: 0.9rem;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
}

.tool-menu__list button:hover,
.lang-picker__menu a:hover {
    background: #eef6f6;
}

.lang-picker__menu a[aria-current="page"] {
    color: var(--green-dark);
    background: #e8f6f3;
    font-weight: 700;
}

.lang-code {
    display: inline-grid;
    width: 30px;
    height: 24px;
    border-radius: 6px;
    color: var(--white);
    background: var(--navy);
    font-size: 0.72rem;
    font-weight: 700;
    place-items: center;
}

.lang-picker__toggle {
    display: inline-flex;
    height: 40px;
    padding: 0 12px;
    align-items: center;
    gap: 7px;
    border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
    border-radius: 999px;
    color: inherit;
    background: transparent;
    font-weight: 700;
    cursor: pointer;
}

.lang-picker__toggle .ico {
    width: 18px;
    height: 18px;
}

/* ---- Corps : menu vertical, panneau, carte ---------------------------------- */

.portal-body {
    position: relative;
    display: flex;
    min-height: 0;
}

body[data-side="end"] .portal-body {
    flex-direction: row-reverse;
}

.rail {
    z-index: 12;
    display: flex;
    width: var(--rail-w);
    flex: 0 0 auto;
    flex-direction: column;
    padding: 10px 8px;
    color: var(--rail-ink);
    background: var(--rail-bg);
}

body[data-rail="compact"] .rail {
    width: var(--rail-w-compact);
}

body[data-rail="compact"] .rail__label {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    white-space: nowrap;
}

.rail[data-collapsed] {
    display: none;
}

.rail ul {
    display: grid;
    margin: 0;
    padding: 0;
    gap: 4px;
    list-style: none;
}

.rail__item,
.rail__foot {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 46px;
    padding: 9px 12px;
    align-items: center;
    gap: 12px;
    border: 0;
    border-radius: 9px;
    color: inherit;
    background: transparent;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.25;
    text-align: start;
    cursor: pointer;
}

body[data-rail="compact"] .rail__item,
body[data-rail="compact"] .rail__foot {
    justify-content: center;
    padding: 9px 0;
}

.rail__item:hover,
.rail__foot:hover {
    background: color-mix(in srgb, currentColor 12%, transparent);
}

.rail__item[aria-expanded="true"] {
    color: var(--white);
    background: color-mix(in srgb, var(--rail-active) 85%, transparent);
}

body[data-theme="lightgrey"] .rail__item[aria-expanded="true"],
body[data-theme="blackandwhite"] .rail__item[aria-expanded="true"] {
    color: var(--white);
}

body[data-theme="blackandwhite"] .rail__item[aria-expanded="true"] {
    color: #111;
}

.rail__foot {
    margin-top: auto;
    opacity: 0.8;
    font-size: 0.8rem;
}

.panel-host {
    position: relative;
    z-index: 11;
    display: flex;
    width: var(--panel-w);
    flex: 0 0 auto;
    flex-direction: column;
    /* Visible: the resize handle straddles the edge of the panel (each panel clips itself). */
    overflow: visible;
    border-inline-end: 1px solid var(--line);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

body[data-side="end"] .panel-host {
    border-inline-end: 0;
    border-inline-start: 1px solid var(--line);
}

/* Width of the panel chosen by the visitor (drag or arrow keys; double-click: default). */
.panel-resizer {
    position: absolute;
    z-index: 2;
    top: 0;
    bottom: 0;
    inset-inline-end: -5px;
    width: 10px;
    cursor: col-resize;
    touch-action: none;
}

body[data-side="end"] .panel-resizer {
    inset-inline-start: -5px;
    inset-inline-end: auto;
}

.panel-resizer::after {
    position: absolute;
    top: 50%;
    left: 3px;
    width: 4px;
    height: 44px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--muted) 45%, transparent);
    content: "";
    transform: translateY(-50%);
    transition: background 0.15s ease;
}

.panel-resizer:hover::after,
.panel-resizer:focus-visible::after,
.panel-resizer.is-dragging::after {
    background: var(--accent);
}

.panel-resizer:focus-visible {
    outline: none;
}

body.is-resizing-panel {
    cursor: col-resize;
    user-select: none;
}

.panel {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    overflow: hidden;
}

.panel__head {
    display: flex;
    padding: 16px 16px 14px 20px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--line);
}

.panel__head h2 {
    margin: 0;
    color: var(--navy);
    font-size: 1.02rem;
    line-height: 1.35;
}

.panel__head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.panel__head .icon-btn {
    margin-top: -4px;
    color: var(--muted);
}

.panel__body {
    overflow: auto;
    flex: 1 1 auto;
    padding: 16px 20px 22px;
}

.block + .block {
    margin-top: 20px;
}

fieldset.block {
    margin-inline: 0;
    padding: 0;
    border: 0;
}

.block__title {
    margin: 0 0 10px;
    padding: 0;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* « Cartes et données » : accordéons (un seul ouvert, comme l'ancienne version). */
.maps {
    display: grid;
    align-content: start;
    gap: 10px;
}

.acc {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--white);
}

.acc__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 700;
    list-style: none;
    cursor: pointer;
}

.acc__head::-webkit-details-marker {
    display: none;
}

.acc__head > span:not(.count) {
    flex: 1 1 auto;
}

.acc__head .ico--chevron {
    color: var(--muted);
}

.acc[open] > .acc__head .ico--chevron {
    transform: rotate(90deg);
}

.acc__head:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: -3px;
    border-radius: 10px;
}

.acc[open] > .acc__head {
    border-bottom: 1px solid var(--line);
}

.acc__body {
    padding: 12px;
}

/* Outils d'une couche vecteur (ancien layers_process.php) : zoom, table attributaire, transparence. */
/* Nom d'une couche (ancien dd-handle), puis sa légende, puis ses boutons. */
.layer-name {
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 600;
}

/* Légende d'une couche : sous son nom, alignée sur lui (plus de case à cocher). */
.tree__node--layer > .legend-graphic-box,
.tree__node--layer > .legend-list {
    padding-inline-start: 4px;
}

/* Visibilité (ancien bouton œil) : œil ouvert = affichée, œil barré gris = masquée. */
.layer-eye .ico--eyeoff,
.layer-eye[aria-pressed="false"] .ico--eye {
    display: none;
}

.layer-eye[aria-pressed="false"] .ico--eyeoff {
    display: block;
}

.layer-eye[aria-pressed="true"] {
    color: var(--accent);
}

.layer-eye[aria-pressed="false"] {
    color: var(--muted);
}

.layer-tools {
    display: flex;
    flex-wrap: wrap;
    margin: 2px 0 6px;
    padding-inline-start: 0;
    align-items: center;
    gap: 4px;
}

.layer-opacity {
    position: relative;
}

.layer-opacity > summary {
    list-style: none;
    cursor: pointer;
}

.layer-opacity > summary::-webkit-details-marker {
    display: none;
}

.layer-opacity[open] > summary {
    color: var(--accent);
}

.layer-opacity > .opacity {
    position: absolute;
    z-index: 3;
    top: 50%;
    inset-inline-start: calc(100% + 6px);
    width: 140px;
    margin: 0;
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transform: translateY(-50%);
}

/* Transparence d'une couche, d'un fond ou d'un service (0 à 1). */
.opacity {
    display: block;
    width: 100%;
    max-width: 180px;
    margin: 4px 0 2px;
    accent-color: var(--accent);
}

/* Fonds de carte : vignette de l'ancien catalogue, sinon dessinée en CSS. */
.basemaps {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.basemap {
    display: grid;
    gap: 4px;
}

.basemap__toggle {
    display: grid;
    gap: 5px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.basemap__thumb {
    display: block;
    width: 100%;
    height: 64px;
    object-fit: cover;
    border: 2px solid var(--line);
    border-radius: 9px;
    background: #dfe8ea;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.basemap__thumb--osm {
    background:
        linear-gradient(115deg, transparent 46%, #f7d68a 46%, #f7d68a 52%, transparent 52%),
        linear-gradient(25deg, transparent 60%, #fff 60%, #fff 64%, transparent 64%),
        linear-gradient(160deg, #aad3df 0 34%, #f2efe9 34%);
}

.basemap__thumb--esri_imagery {
    background:
        radial-gradient(circle at 70% 30%, #8a7b52 0 18%, transparent 19%),
        radial-gradient(circle at 30% 75%, #5d6b3d 0 22%, transparent 23%),
        linear-gradient(150deg, #1d3d52 0 38%, #6f6a4a 38% 70%, #b39f74 70%);
}

.basemap__thumb--esri_ocean {
    background:
        linear-gradient(105deg, transparent 62%, #e9e4d8 62%),
        repeating-linear-gradient(170deg, #a9cde0 0 8px, #b9d8e8 8px 16px);
}

.basemap__thumb--carto_light {
    background:
        linear-gradient(120deg, transparent 47%, #fff 47%, #fff 51%, transparent 51%),
        linear-gradient(35deg, transparent 58%, #fff 58%, #fff 61%, transparent 61%),
        linear-gradient(165deg, #d4dadc 0 36%, #f2f2f0 36%);
}

.basemap__thumb--none {
    background:
        repeating-conic-gradient(#eef2f3 0 25%, #fff 0 50%) 0 0 / 14px 14px;
}

.basemap__name {
    color: var(--ink);
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    overflow-wrap: anywhere;
}

.basemap__toggle[aria-pressed="true"] .basemap__thumb {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.basemap__toggle[aria-pressed="true"] .basemap__name {
    color: var(--green-dark);
    font-weight: 700;
}

.basemap__toggle:focus-visible .basemap__thumb {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* Arborescence des couches + légende. */
.layer-tree {
    display: grid;
    gap: 8px;
}

.layer-group {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
}

.layer-group summary {
    display: flex;
    padding: 10px 12px;
    align-items: center;
    gap: 8px;
    color: var(--navy);
    font-size: 0.9rem;
    font-weight: 700;
    list-style: none;
    cursor: pointer;
}

.layer-group summary::-webkit-details-marker {
    display: none;
}

.layer-group[open] > summary .ico--chevron {
    transform: rotate(90deg);
}

.count {
    display: inline-grid;
    min-width: 22px;
    height: 20px;
    margin-inline-start: auto;
    padding: 0 6px;
    border-radius: 999px;
    color: var(--blue);
    background: #e6f1f6;
    font-size: 0.72rem;
    font-weight: 700;
    place-items: center;
}

.layer-group > ul {
    display: grid;
    margin: 0;
    padding: 0 12px 12px;
    gap: 10px;
    list-style: none;
}

.layer-item__row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.check {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    gap: 9px;
    cursor: pointer;
}

.check input {
    position: absolute;
    opacity: 0;
}

.check__box {
    display: inline-grid;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    border: 2px solid #b8c9cd;
    border-radius: 6px;
    color: transparent;
    background: var(--white);
    place-items: center;
}

.check__box .ico {
    width: 14px;
    height: 14px;
    stroke-width: 3;
}

.check input:checked + .check__box {
    border-color: var(--accent);
    color: var(--white);
    background: var(--accent);
}

.check input:focus-visible + .check__box {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.check__label {
    font-size: 0.88rem;
    font-weight: 500;
}

.legend-list {
    display: grid;
    margin: 6px 0 0;
    padding: 0;
    padding-inline-start: 29px;
    gap: 4px;
    list-style: none;
}

.legend-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.8rem;
}

.swatch {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

/* Formulaires des panneaux. */
.form {
    display: grid;
    align-content: start;
    gap: 14px;
}

.field {
    display: grid;
    min-width: 0;
    margin: 0;
    padding: 0;
    gap: 6px;
    border: 0;
}

.field label,
.field legend {
    display: flex;
    padding: 0;
    align-items: center;
    gap: 8px;
    color: var(--navy);
    font-size: 0.84rem;
    font-weight: 700;
}

.field input[type="text"],
.field select {
    width: 100%;
    min-height: 42px;
    padding: 8px 11px;
    border: 1px solid #c9d7da;
    border-radius: 8px;
    color: var(--ink);
    background: var(--white);
}

.field input:focus-visible,
.field select:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent);
    outline-offset: 0;
    border-color: var(--accent);
}

.field-row {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field--color input {
    width: 100%;
    height: 42px;
    padding: 3px;
    border: 1px solid #c9d7da;
    border-radius: 8px;
    background: var(--white);
}

.segmented {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.segmented legend {
    width: 100%;
    margin-bottom: 6px;
}

.segmented label {
    position: relative;
    display: grid;
    flex: 1 1 0;
    min-width: 0;
    cursor: pointer;
}

.segmented input {
    position: absolute;
    opacity: 0;
}

.segmented span {
    display: block;
    padding: 8px 10px;
    border: 1px solid #c9d7da;
    border-radius: 8px;
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 500;
    text-align: center;
}

.segmented input:checked + span {
    border-color: var(--accent);
    color: var(--green-dark);
    background: #e8f6f3;
    font-weight: 700;
}

.segmented input:focus-visible + span {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.route-steps {
    display: grid;
    gap: 10px;
}

.step-dot {
    display: inline-grid;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: var(--white);
    background: var(--green);
    font-size: 0.72rem;
    place-items: center;
}

.step-dot--b {
    background: var(--danger);
}

.note {
    display: flex;
    margin: 0;
    padding: 10px 12px;
    align-items: flex-start;
    gap: 9px;
    border-radius: 8px;
    color: var(--navy);
    background: #eef6f9;
    font-size: 0.8rem;
}

.note--error {
    color: var(--danger);
    background: #fbecea;
}

.note .ico {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    color: var(--blue);
}

.form__status {
    margin: 0;
    padding: 9px 12px;
    border-inline-start: 4px solid var(--green);
    border-radius: 8px;
    color: #0b5c52;
    background: #ecf8f5;
    font-size: 0.84rem;
}

.form__status--error,
.form__status[data-tone="error"] {
    border-color: var(--danger);
    color: #842c26;
    background: #fff3f1;
}

.form__actions {
    /* Actions of a panel: one row of equal buttons across the whole width. */
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: 8px;
}

.form__actions > .btn {
    width: 100%;
    min-width: 0;
    text-align: center;
}

.btn {
    display: inline-flex;
    min-height: 40px;
    padding: 8px 16px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

.btn .ico {
    width: 18px;
    height: 18px;
}

.btn--primary {
    color: var(--accent-ink);
    background: var(--accent);
}

.btn--primary:hover {
    filter: brightness(0.93);
}

.btn--primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: none;
}

.btn--ghost {
    border-color: #c9d7da;
    color: var(--navy);
    background: var(--white);
}

.btn--ghost:hover,
.btn--ghost[aria-pressed="true"] {
    border-color: var(--accent);
    color: var(--green-dark);
    background: #e8f6f3;
}

.btn--sm {
    min-height: 32px;
    padding: 5px 11px;
    font-size: 0.8rem;
}

.btn--block {
    width: 100%;
}

.tool-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool-tile {
    display: grid;
    min-height: 68px;
    padding: 8px 4px;
    justify-items: center;
    align-content: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--navy);
    background: var(--white);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
}

.tool-tile:hover {
    border-color: #b8c9cd;
    background: var(--paper);
}

.tool-tile[aria-pressed="true"] {
    border-color: var(--accent);
    color: var(--green-dark);
    background: #e8f6f3;
    box-shadow: inset 0 0 0 1px var(--accent);
}

.coords-out {
    display: grid;
    margin: 0;
    gap: 8px;
}

.coords-out div {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.coords-out dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.coords-out dd {
    margin: 2px 0 0;
    color: var(--navy);
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.86rem;
    font-weight: 600;
}

.dropzone {
    position: relative;
    display: grid;
    padding: 26px 16px;
    justify-items: center;
    gap: 4px;
    border: 2px dashed #b8c9cd;
    border-radius: var(--radius);
    color: var(--blue);
    background: var(--paper);
    text-align: center;
    cursor: pointer;
}

.dropzone:hover,
.dropzone[data-over] {
    border-color: var(--accent);
    background: #ecf8f5;
}

.dropzone input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.dropzone:focus-within {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.dropzone__title {
    color: var(--navy);
    font-weight: 700;
}

.dropzone__sub {
    color: var(--muted);
    font-size: 0.82rem;
}

/* ---- Carte et éléments superposés ------------------------------------------ */

.map-area {
    position: relative;
    min-width: 0;
    flex: 1 1 auto;
}

.map {
    position: absolute;
    inset: 0;
    background: #cfe3ea;
}

.map:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: -3px;
}

.noscript {
    position: absolute;
    top: 40%;
    inset-inline: 24px;
    margin: 0;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--white);
    text-align: center;
}

/* Contrôles OpenLayers aux couleurs de la charte. */
.map .ol-control {
    padding: 0;
    border-radius: 10px;
    background: transparent;
}

.map .ol-control button {
    display: grid;
    width: 38px;
    height: 38px;
    margin: 0;
    border-radius: 0;
    color: var(--navy);
    background: var(--white);
    font-size: 1.25rem;
    font-weight: 500;
    place-items: center;
}

.map .ol-control button:hover,
.map .ol-control button:focus-visible {
    color: var(--green-dark);
    background: #eef6f6;
    outline: none;
}

.map .ol-control button:focus-visible {
    box-shadow: inset 0 0 0 3px var(--gold);
}

.map .ol-zoom,
.map .ctl-stack {
    top: 14px;
    right: 14px;
    left: auto;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.map .ol-zoom .ol-zoom-in {
    border-bottom: 1px solid var(--line);
}

.map .ctl-stack {
    top: 104px;
}

.map .ctl-stack button + button {
    border-top: 1px solid var(--line);
}

.map .ctl-stack svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.map .ol-zoomslider {
    top: 200px;
    right: 23px;
    left: auto;
    width: 20px;
    height: 130px;
    border-radius: 10px;
    background: rgb(255 255 255 / 85%);
    box-shadow: var(--shadow-sm);
}

.map .ol-zoomslider button {
    width: 20px;
    height: 12px;
    border-radius: 6px;
    background: var(--navy);
}

.map .ol-scale-line {
    right: auto;
    bottom: 14px;
    left: 50%;
    padding: 4px 6px;
    transform: translateX(-50%);
    border-radius: 6px;
    background: rgb(16 62 73 / 78%);
}

.map .ol-scale-line-inner {
    border-color: var(--white);
    color: var(--white);
    font-size: 0.72rem;
}

.map .ol-mouse-position {
    top: auto;
    right: auto;
    bottom: 50px;
    left: 50%;
    padding: 3px 9px;
    transform: translateX(-50%);
    border-radius: 6px;
    color: var(--navy);
    background: rgb(255 255 255 / 88%);
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.74rem;
    white-space: nowrap;
    direction: ltr;
}

.map .ol-mouse-position:empty {
    display: none;
}

.map .ol-attribution {
    right: 14px;
    bottom: 14px;
    max-width: calc(100% - 330px);
    border-radius: 8px;
    background: rgb(255 255 255 / 85%);
    box-shadow: var(--shadow-sm);
}

.map .ol-attribution button {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
}

.map .ol-attribution ul {
    color: var(--ink);
    font-size: 0.72rem;
    text-shadow: none;
}

.map .ol-attribution.ol-uncollapsible {
    border-radius: 8px 0 0;
}

[dir="rtl"] .map .ol-zoom,
[dir="rtl"] .map .ctl-stack {
    right: auto;
    left: 14px;
}

[dir="rtl"] .map .ol-zoomslider {
    right: auto;
    left: 23px;
}

[dir="rtl"] .map .ol-attribution {
    right: auto;
    left: 14px;
}

/* ---- Outils de navigation / outils : emplacement choisi dans Publier ------------------
   En-tête : groupes dans la barre d'outils, à droite de l'en-tête (après le titre).
   Carte : colonne verticale au début (map-left) ou à la fin (map-right) de la carte ;
   gauche / droite suivent le sens de lecture (inversés en arabe, comme le menu). */
.tool-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.toolbar .tool-group + .tool-group {
    margin-inline-start: 4px;
    padding-inline-start: 6px;
    border-inline-start: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}

.map-dock {
    position: absolute;
    z-index: 5;
    top: 14px;
    display: grid;
    justify-items: center;
    gap: 10px;
}

.map-dock--start {
    inset-inline-start: 14px;
}

.map-dock--end {
    inset-inline-end: 14px;
}

.map-dock .tool-group {
    display: grid;
    border-radius: 10px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    gap: 0;
}

.map-dock .tool {
    width: 38px;
    height: 38px;
    border-radius: 0;
    color: var(--navy);
    background: var(--white);
}

.map-dock .tool-group > :first-child,
.map-dock .tool-group > :first-child .tool {
    border-start-start-radius: 10px;
    border-start-end-radius: 10px;
}

.map-dock .tool-group > :last-child,
.map-dock .tool-group > :last-child .tool {
    border-end-start-radius: 10px;
    border-end-end-radius: 10px;
}

.map-dock .tool-group > * + * {
    border-top: 1px solid var(--line);
}

.map-dock .tool:hover,
.map-dock .tool:focus-visible {
    color: var(--green-dark);
    background: #eef6f6;
}

.map-dock .tool[aria-pressed="true"],
.map-dock .tool[aria-expanded="true"] {
    color: var(--accent-ink);
    background: var(--accent);
}

.map-dock .tool[hidden] {
    display: none;
}

/* Menu des mesures ouvert à côté de la colonne. */
.map-dock .tool-menu__list {
    top: 0;
}

.map-dock--start .tool-menu__list {
    inset-inline-start: calc(100% + 8px);
    inset-inline-end: auto;
}

.map-dock--end .tool-menu__list {
    inset-inline-end: calc(100% + 8px);
}

/* Curseur de zoom sous les outils de navigation de la carte. */
.map-dock .ol-zoomslider {
    position: relative;
    inset: auto;
    width: 20px;
    height: 130px;
    border-radius: 10px;
    background: rgb(255 255 255 / 85%);
    box-shadow: var(--shadow-sm);
}

.map-dock .ol-zoomslider button {
    position: absolute;
    display: block;
    width: 20px;
    height: 12px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: var(--navy);
}

/* Écran peu haut : le cartouche de légende (en bas, côté début) recouvrirait le curseur. */
@media (max-height: 780px) {
    .map-dock--start .ol-zoomslider {
        display: none;
    }
}

/* Navigation dans l'en-tête : le curseur reste sur la carte, en haut. */
body[data-nav="header"] .map .ol-zoomslider {
    top: 14px;
}

.map .ol-dragzoom {
    border: 2px dashed rgb(0 0 0 / 55%);
    background: rgb(255 255 255 / 20%);
}

/* Écrans tactiles : tous les gestes posés sur la carte (glisser, pincer) sont pour OpenLayers.
   ol.css (OpenLayers 10) laisse « pan-x pan-y » au navigateur : sur un téléphone, il reprenait le
   geste en cours de glissement pour faire défiler la page (pointercancel) et la carte se figeait.
   La page du géoportail ne défile pas (plein écran) : rien n'est perdu. */
.map .ol-viewport {
    touch-action: none;
}

/* Bulles posées sur la carte (infobulle, fiche d'objet, mesures) : OpenLayers les place par
   « transform » à partir de leur position par défaut, qui est le bord GAUCHE de la carte — mais
   le bord DROIT dans une page en arabe (dir="rtl") : la bulle s'affichait loin du point cliqué
   (décalage = largeur de la carte − largeur de la bulle). Ancrée à gauche dans toutes les langues ;
   le contenu de la bulle reste écrit de droite à gauche. */
.map .ol-overlay-container {
    top: 0;
    left: 0;
}

/* Zoom par rectangle actif (ancienne version : curseur loupe). */
.map.is-zoomrect,
.map.is-zoomrect .ol-viewport {
    cursor: zoom-in;
}

/* Capture d'écran : la carte clignote (ancien flash()). */
.map--flash {
    animation: map-flash 0.4s ease;
}

@keyframes map-flash {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.35; }
}

/* « Ma position » : « Vous êtes ici. » au-dessus du point. */
.here-tip {
    padding: 4px 9px;
    border-radius: 6px;
    color: var(--white);
    background: #b3412e;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.legend-card {
    position: absolute;
    z-index: 5;
    bottom: 14px;
    inset-inline-start: 14px;
    width: 270px;
    max-height: calc(100% - 28px);
    overflow: hidden;
    border-radius: var(--radius);
    background: rgb(255 255 255 / 96%);
    box-shadow: var(--shadow);
}

.legend-card__head {
    display: flex;
    width: 100%;
    padding: 10px 14px;
    align-items: center;
    gap: 9px;
    border: 0;
    color: var(--navy);
    background: transparent;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
}

.legend-card__head .ico--chevron {
    margin-inline-start: auto;
    transform: rotate(-90deg);
}

.legend-card__head[aria-expanded="false"] .ico--chevron {
    transform: rotate(90deg);
}

.legend-card__body {
    display: grid;
    max-height: 300px;
    overflow: auto;
    padding: 0 14px 12px;
    gap: 10px;
    border-top: 1px solid var(--line);
}

.legend-card__layer p {
    margin: 10px 0 0;
    color: var(--navy);
    font-size: 0.8rem;
    font-weight: 700;
}

.legend-card .legend-list {
    padding-inline-start: 0;
}

.legend-card__empty {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.map-hint {
    position: absolute;
    z-index: 6;
    top: 14px;
    left: 50%;
    max-width: calc(100% - 140px);
    padding: 8px 14px;
    transform: translateX(-50%);
    border-radius: 999px;
    color: var(--white);
    background: rgb(16 62 73 / 90%);
    box-shadow: var(--shadow-sm);
    font-size: 0.84rem;
    text-align: center;
}

/* Jeton de carte expiré (PortalToken) : bandeau avec « Recharger la page ». */
.map-expired {
    position: absolute;
    z-index: 12;
    top: 14px;
    left: 50%;
    display: flex;
    max-width: calc(100% - 32px);
    padding: 10px 12px 10px 16px;
    align-items: center;
    gap: 12px;
    transform: translateX(-50%);
    border-radius: var(--radius);
    color: var(--white);
    background: rgb(179 65 46 / 96%);
    box-shadow: var(--shadow);
    font-size: 0.86rem;
}

.map-expired .btn {
    flex: 0 0 auto;
    border-color: var(--white);
    color: var(--danger);
    background: var(--white);
}

@media print {
    .map-expired {
        display: none !important;
    }
}

.map-hint[data-tone="error"] {
    background: rgb(179 65 46 / 94%);
}

.results {
    position: absolute;
    z-index: 7;
    right: 14px;
    bottom: 14px;
    left: 300px;
    display: flex;
    max-height: 42%;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
}

[dir="rtl"] .results {
    right: 300px;
    left: 14px;
}

.results__head {
    display: flex;
    padding: 6px 10px 6px 6px;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--line);
}

.results__toggle {
    display: flex;
    padding: 6px 8px;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 7px;
    color: var(--navy);
    background: transparent;
    font-weight: 700;
    cursor: pointer;
}

.results__toggle .count {
    margin-inline-start: 0;
}

.results__toggle[aria-expanded="false"] .ico--chevron {
    transform: rotate(-90deg);
}

.results__toggle[aria-expanded="true"] .ico--chevron {
    transform: rotate(90deg);
}

.results__head .btn {
    margin-inline-start: auto;
}

.results__body {
    overflow: auto;
}

.results__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.results__table th {
    position: sticky;
    top: 0;
    padding: 8px 12px;
    color: var(--muted);
    background: var(--paper);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-align: start;
    text-transform: uppercase;
    white-space: nowrap;
}

.results__table td {
    padding: 8px 12px;
    border-top: 1px solid #edf2f2;
    white-space: nowrap;
}

.results__table tbody tr {
    cursor: pointer;
}

.results__table tbody tr:hover,
.results__table tbody tr:focus-visible,
.results__table tbody tr[aria-selected="true"] {
    background: #ecf8f5;
}

.results__table td:first-child {
    color: var(--navy);
    font-weight: 700;
}

.results__table .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-inline-end: 6px;
    vertical-align: -1px;
}

/* Info-bulle (Overlay OpenLayers). */
.popup {
    width: 290px;
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
    font-size: 0.84rem;
}

.popup::after {
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 16px;
    height: 16px;
    transform: translateX(-50%) rotate(45deg);
    background: var(--white);
    content: "";
}

.popup__head {
    display: flex;
    padding: 10px 8px 8px 14px;
    align-items: flex-start;
    gap: 8px;
    border-radius: var(--radius) var(--radius) 0 0;
    border-top: 4px solid var(--accent);
}

.popup__head h2 {
    flex: 1 1 auto;
    margin: 2px 0 0;
    color: var(--navy);
    font-size: 0.95rem;
    line-height: 1.3;
}

.popup__head .icon-btn {
    color: var(--muted);
}

.popup__body {
    display: grid;
    margin: 0;
    padding: 0 14px 8px;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
}

.popup__body dt {
    color: var(--muted);
    font-size: 0.78rem;
}

.popup__body dd {
    margin: 0;
    color: var(--ink);
    font-weight: 600;
}

.popup__foot {
    position: relative;
    z-index: 1;
    display: flex;
    padding: 8px 14px 12px;
    justify-content: flex-end;
    border-top: 1px solid #edf2f2;
}

.measure-tip {
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--white);
    background: rgb(16 62 73 / 88%);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.measure-tip--done {
    background: var(--accent);
}

/* ---- Impression de la carte (ancien module PrintMap) ------------------------------ */

.print-form textarea {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #c9d7da;
    border-radius: 8px;
    color: var(--ink);
    background: var(--white);
    font: inherit;
    resize: vertical;
}

.print-form input[type="number"] {
    width: 100px;
    min-height: 42px;
    padding: 8px 11px;
    border: 1px solid #c9d7da;
    border-radius: 8px;
    color: var(--ink);
    background: var(--white);
}

.print-sub {
    display: grid;
    gap: 12px;
    margin-top: -4px;
    padding-inline-start: 12px;
    border-inline-start: 2px solid var(--line);
}

.field__hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.76rem;
}

.print-preview {
    display: grid;
    margin: 0;
    gap: 6px;
}

.print-preview figcaption {
    color: var(--navy);
    font-size: 0.84rem;
    font-weight: 700;
}

.print-preview canvas {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f3f6f6;
    box-shadow: var(--shadow-sm);
}

.print-sheet {
    display: none;
}

/* ---- Fenêtre « Limitation de responsabilité » -------------------------------- */

.dialog {
    width: min(560px, calc(100% - 32px));
    padding: 0;
    border: 0;
    border-radius: 14px;
    color: var(--ink);
    box-shadow: 0 24px 60px rgb(16 62 73 / 30%);
}

.dialog::backdrop {
    background: rgb(16 62 73 / 55%);
}

.dialog form {
    margin: 0;
}

.dialog__head {
    display: flex;
    padding: 20px 24px 6px;
    align-items: center;
    gap: 12px;
}

.dialog__icon {
    display: grid;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--blue);
    background: #e6f1f6;
    place-items: center;
}

.dialog__head h2 {
    margin: 0;
    color: var(--navy);
    font-size: 1.15rem;
}

.dialog__body {
    padding: 4px 24px 6px;
    color: #33494f;
    font-size: 0.92rem;
}

.dialog__body p {
    margin: 10px 0 0;
}

.dialog__foot {
    display: flex;
    padding: 16px 24px 20px;
    justify-content: flex-end;
}

/* ---- Pied de page ------------------------------------------------------------ */

.portal-footer {
    z-index: 20;
    display: flex;
    min-width: 0;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #d5e6ea;
    background: var(--navy);
    font-size: 0.74rem;
}

.portal-footer span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-btn {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    color: var(--gold);
    background: transparent;
    font-size: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* ---- Écrans moyens et petits --------------------------------------------------- */

@media (max-width: 1100px) {
    :root {
        --rail-w: 228px;
        --panel-w: 330px;
    }

    .results {
        left: 14px;
        bottom: 60px;
    }

    [dir="rtl"] .results {
        right: 14px;
    }
}

@media (max-width: 860px) {
    body[data-rail="full"] .rail {
        width: var(--rail-w-compact);
    }

    body[data-rail="full"] .rail__label {
        position: absolute;
        overflow: hidden;
        width: 1px;
        height: 1px;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    body[data-rail] .rail__item,
    body[data-rail] .rail__foot {
        justify-content: center;
        padding: 9px 0;
    }

    .panel-host {
        position: absolute;
        z-index: 15;
        top: 0;
        bottom: 0;
        inset-inline-start: var(--rail-w-compact);
        width: min(var(--panel-w), calc(100% - var(--rail-w-compact)));
        box-shadow: var(--shadow);
    }

    body[data-side="end"] .panel-host {
        inset-inline-start: auto;
        inset-inline-end: var(--rail-w-compact);
    }

    body[data-rail="hidden"] .panel-host {
        inset-inline-start: 0;
    }

    .portal-header__kicker {
        display: none;
    }

    .map .ol-attribution {
        max-width: calc(100% - 28px);
    }

    .legend-card {
        width: 220px;
    }
}

@media (max-width: 640px) {
    :root {
        --header-h: 56px;
        --footer-h: 26px;
    }

    .portal-header {
        padding: 0 8px;
        gap: 8px;
    }

    .brand img {
        height: 34px;
    }

    .portal-header__title {
        padding-inline-start: 8px;
    }

    .portal-header h1 {
        font-size: 0.86rem;
    }

    .toolbar {
        position: absolute;
        top: calc(100% + 8px);
        inset-inline-end: 8px;
        flex-direction: column;
        border: 0;
        color: var(--navy);
        background: var(--white);
        box-shadow: var(--shadow-sm);
    }

    body.has-panel .toolbar {
        display: none;
    }

    .toolbar .tool-menu__list {
        top: 0;
        inset-inline-end: calc(100% + 8px);
    }

    .map .ol-zoom,
    .map .ctl-stack {
        right: auto;
        left: 10px;
    }

    .map .ctl-stack {
        top: 100px;
    }

    .map .ol-zoomslider {
        display: none;
    }

    .map-dock {
        top: 10px;
    }

    .map-dock--start {
        inset-inline-start: 10px;
    }

    .map-dock--end {
        inset-inline-end: 10px;
    }

    .map-dock .ol-zoomslider {
        display: none;
    }

    [dir="rtl"] .map .ol-zoom,
    [dir="rtl"] .map .ctl-stack {
        right: 10px;
        left: auto;
    }

    .lang-picker__toggle {
        padding: 0 9px;
    }

    .lang-picker__toggle .ico {
        display: none;
    }

    .legend-card {
        bottom: 46px;
        width: calc(100% - 28px);
        max-width: 300px;
    }

    .legend-card__body {
        max-height: 34vh;
    }

    .map .ol-mouse-position {
        display: none;
    }

    .portal-footer {
        justify-content: center;
    }

    .portal-footer span {
        display: none;
    }
}

/* ---- Impression : la carte seule, titre conservé -------------------------------- */

@media print {
    @page {
        size: landscape;
        margin: 10mm;
    }

    @page sheet-portrait {
        size: A4 portrait;
        margin: 0;
    }

    @page sheet-landscape {
        size: A4 landscape;
        margin: 0;
    }

    body.is-printing-sheet > *:not(.print-sheet) {
        display: none !important;
    }

    body.is-printing-sheet {
        display: block;
        height: auto;
        overflow: visible;
    }

    body.is-printing-sheet .print-sheet {
        display: block;
        margin: 0;
    }

    .print-sheet--portrait {
        page: sheet-portrait;
    }

    .print-sheet--landscape {
        page: sheet-landscape;
    }

    .print-sheet--portrait img {
        display: block;
        width: 210mm;
        height: 297mm;
    }

    .print-sheet--landscape img {
        display: block;
        width: 297mm;
        height: 210mm;
    }

    body.portal {
        display: block;
        overflow: visible;
        height: auto;
    }

    .toolbar,
    .map-dock,
    .lang-picker,
    .rail,
    .panel-host,
    .results,
    .map-hint,
    .popup,
    .skip-link,
    .portal-header__menu,
    .map .ol-control:not(.ol-scale-line):not(.ol-attribution),
    .portal-footer .link-btn {
        display: none !important;
    }

    .portal-header {
        box-shadow: none;
    }

    .portal-body,
    .map-area {
        display: block;
        height: 160mm;
    }

    .map {
        position: relative;
        height: 100%;
    }

    .legend-card {
        box-shadow: none;
        border: 1px solid var(--line);
    }

    .portal-footer {
        color: var(--ink);
        background: none;
    }
}

.map.is-hit {
    cursor: pointer;
}

/* ---- Page « Géoportail inaccessible » (public/notpublicated.php) --------------- */

body.status-page {
    display: grid;
    /* 100vh: the footer stays at the bottom of the screen even when html has no height. */
    min-height: 100vh;
    margin: 0;
    grid-template-rows: auto 1fr auto;
    color: var(--ink);
    background:
        radial-gradient(circle at 85% 10%, rgb(67 187 209 / 16%), transparent 40%),
        radial-gradient(circle at 10% 90%, rgb(0 164 146 / 12%), transparent 45%),
        var(--paper);
    font-size: 16px;
    line-height: 1.6;
}

.status-page__header {
    display: flex;
    padding: 14px 24px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--white);
    box-shadow: 0 4px 20px rgb(16 62 73 / 7%);
}

.status-page__header .brand {
    padding: 0;
}

.status-page__langs {
    display: flex;
    gap: 6px;
}

.status-page__langs a {
    display: inline-grid;
    min-width: 40px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--navy);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    place-items: center;
}

.status-page__langs a[aria-current="page"] {
    border-color: var(--navy);
    color: var(--white);
    background: var(--navy);
}

.status-card {
    width: min(620px, calc(100% - 32px));
    margin: 48px auto;
    padding: 40px 36px 34px;
    align-self: center;
    border-radius: 18px;
    background: var(--white);
    box-shadow: var(--shadow);
    text-align: center;
}

.status-card__icon {
    display: grid;
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    border-radius: 50%;
    color: var(--blue);
    background: #e6f1f6;
    place-items: center;
}

.status-card__icon .ico {
    width: 38px;
    height: 38px;
}

.status-card__kicker {
    margin: 0;
    color: var(--green-dark);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.status-card h1 {
    margin: 6px 0 12px;
    color: var(--navy);
    font-size: clamp(1.45rem, 3.4vw, 2rem);
    line-height: 1.25;
}

.status-card p {
    margin: 0 0 10px;
    color: #33494f;
}

.status-card__actions {
    display: flex;
    margin-top: 24px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.status-card__actions .btn {
    min-height: 44px;
    padding-inline: 20px;
    text-decoration: none;
}

.status-page__footer {
    padding: 12px 24px;
    color: #d5e6ea;
    background: var(--navy);
    font-size: 0.78rem;
    text-align: center;
}

/* Titre de panneau focalisé par script à l'ouverture : pas d'anneau visuel. */
.panel__head h2:focus {
    outline: none;
}

/* ---- Géoportail dynamique : arborescence de la légende publiée ------------------- */

.sr-only {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    white-space: nowrap;
}

.tree {
    display: grid;
    margin: 0;
    padding: 0;
    gap: 2px;
    list-style: none;
}

.tree--root {
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
}

/* Niveaux : retrait et filet guide à chaque profondeur. */
.tree .tree {
    margin-inline-start: 15px;
    padding-inline-start: 10px;
    border-inline-start: 1px dashed #c9d7da;
}

/* « Cartes et données » : arborescence lisible d'un coup d'œil (comme l'éditeur de légende du
   Back-Office) — chaque groupe, en-tête et contenu, est entouré de son cadre, de plus en plus clair
   à chaque niveau ; l'en-tête porte la couleur du niveau ; chaque couche est une carte blanche. */
#panel-layers .tree--root {
    gap: 8px;
    padding: 8px;
}

#panel-layers .tree__node--group {
    /* Couleurs fixes par niveau (aucune couleur calculée : même rendu dans tous les navigateurs). */
    --level: #103e49;
    --level-bg: #f6f8f9;
    --level-head: #eef3f4;
    --level-head-hover: #e4ecee;
    --level-border: #d5e1e3;
    --level-count: #dfe8ea;
    --level-rule: #c8d6d9;
    padding: 4px;
    border: 1px solid var(--level-border);
    border-radius: 10px;
    background: var(--level-bg);
}

#panel-layers .tree__node--group[data-level="2"] {
    --level: #00796c;
    --level-bg: #f7fbfa;
    --level-head: #eaf6f3;
    --level-head-hover: #ddf0eb;
    --level-border: #cfe8e2;
    --level-count: #d6efe9;
    --level-rule: #bfe2da;
}

#panel-layers .tree__node--group[data-level="3"] {
    --level: #8a6420;
    --level-bg: #fcfaf7;
    --level-head: #f8f2e6;
    --level-head-hover: #f2e8d5;
    --level-border: #ebdcc0;
    --level-count: #f1e4c9;
    --level-rule: #e6d3ad;
}

#panel-layers .tree__node--group[data-level="4"] {
    --level: #a3471f;
    --level-bg: #fdf9f7;
    --level-head: #fbefe9;
    --level-head-hover: #f6e1d7;
    --level-border: #f0d4c7;
    --level-count: #f5dccf;
    --level-rule: #ecc7b6;
}

/* En-tête du groupe : bandeau clair, bordure gauche de la couleur du niveau. */
#panel-layers .tree__node--group > details > summary.tree__row {
    padding: 7px 8px;
    border-inline-start: 4px solid var(--level);
    border-radius: 7px;
    background: var(--level-head);
}

#panel-layers .tree__node--group > details > summary.tree__row:hover {
    background: var(--level-head-hover);
}

#panel-layers .tree__node--group > details > summary.tree__row:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 1px;
}

#panel-layers .tree__node--group > details > summary .check__label {
    flex: 1 1 auto;
    color: var(--level);
    font-weight: 700;
}

#panel-layers .tree__node--group > details > summary .ico--node,
#panel-layers .tree__node--group > details > summary .ico--chevron {
    color: var(--level);
}

#panel-layers .tree__node--group > details > summary .count {
    color: var(--level);
    background: var(--level-count);
}

/* Contenu du groupe : décalé derrière un filet de la couleur du niveau. */
#panel-layers .tree .tree {
    margin: 6px 2px 2px;
    margin-inline-start: 8px;
    padding-inline-start: 8px;
    gap: 6px;
    border-inline-start: 2px solid var(--level-rule, #c8d6d9);
}

/* Couche : carte blanche, nom en gras, légende, puis la barre de boutons. */
#panel-layers .tree__node--layer {
    padding: 8px 10px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 1px 2px rgb(16 62 73 / 8%);
}

#panel-layers .tree__node--layer > .tree__row {
    min-height: 0;
    padding: 0 0 4px;
}

#panel-layers .tree__node--layer > .tree__row:hover {
    background: none;
}

#panel-layers .tree__node--layer .layer-name .check__label {
    color: var(--ink);
    font-weight: 700;
}

#panel-layers .tree__node--label {
    color: var(--muted);
    background: var(--paper);
    box-shadow: none;
}

/* Boutons d'une couche : de vrais boutons, distincts les uns des autres. */
#panel-layers .layer-tools {
    margin: 6px 0 0;
    padding-top: 7px;
    gap: 6px;
    border-top: 1px dashed var(--line);
}

#panel-layers .layer-tools .icon-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #c9d7da;
    border-radius: 8px;
    color: var(--navy);
    background: var(--white);
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

#panel-layers .layer-tools .icon-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--paper);
}

#panel-layers .layer-tools .icon-btn:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 1px;
}

/* Œil : rempli quand la couche est affichée, gris quand elle est masquée. */
#panel-layers .layer-tools .layer-eye[aria-pressed="true"] {
    border-color: var(--accent);
    color: var(--white);
    background: var(--accent);
}

#panel-layers .layer-tools .layer-eye[aria-pressed="true"]:hover {
    color: var(--white);
    background: var(--accent);
    filter: brightness(0.9);
}

#panel-layers .layer-tools .layer-eye[aria-pressed="false"] {
    color: var(--muted);
    background: var(--paper);
}

#panel-layers .layer-opacity[open] > summary.icon-btn {
    border-color: var(--accent);
    color: var(--accent);
}

.tree__row {
    display: flex;
    min-height: 36px;
    padding: 3px 6px;
    align-items: center;
    gap: 6px;
    border-radius: 7px;
}

.tree__row:hover {
    background: var(--paper);
}

summary.tree__row {
    list-style: none;
    cursor: pointer;
}

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

.tree__node--group > details > summary .ico--chevron,
.imported > summary .ico--chevron {
    color: var(--muted);
}

.tree__node--group > details[open] > summary .ico--chevron,
.imported[open] > summary .ico--chevron {
    transform: rotate(90deg);
}

.tree__node--group > details > summary .check__label {
    color: var(--navy);
    font-weight: 700;
}

.tree__node--layer {
    padding-inline-start: 22px;
}

.tree__node--layer .legend-list {
    margin: 0 0 6px;
    padding-inline-start: 36px;
}

.ico--node {
    width: 17px;
    height: 17px;
    color: var(--blue);
}

.ico--ext {
    width: 14px;
    height: 14px;
    margin-inline-start: auto;
    color: var(--muted);
}

[dir="rtl"] .ico--ext {
    transform: scaleX(-1);
}

.tree__link {
    padding-inline-start: 28px;
    color: var(--blue);
    font-size: 0.86rem;
    font-weight: 500;
    text-decoration: none;
}

.tree__link:hover span {
    text-decoration: underline;
}

.check .swatch {
    width: 15px;
    height: 15px;
}

/* Case d'un groupe partiellement coché. */
.check input:indeterminate + .check__box {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 18%, var(--white));
}

.check input:indeterminate + .check__box .ico {
    display: none;
}

.check input:indeterminate + .check__box::after {
    width: 10px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    content: "";
}

.imported {
    margin-top: 10px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.imported > .tree {
    margin-inline-start: 6px;
}

.imported .tree__node--layer {
    padding-inline-start: 6px;
}

.legend-card__layer p {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- Menu publié : niveaux et séparateur ------------------------------------------ */

.rail__list {
    overflow: auto;
}

.rail__sep {
    height: 1px;
    margin: 6px 8px;
    background: color-mix(in srgb, currentColor 18%, transparent);
}

.rail__item--group .ico--chevron {
    margin-inline-start: auto;
    opacity: 0.75;
}

.rail__item--group[aria-expanded="true"] .ico--chevron {
    transform: rotate(90deg);
}

.rail__sub {
    display: grid;
    margin: 2px 0 4px;
    padding: 0;
    padding-inline-start: 14px;
    gap: 2px;
    list-style: none;
    border-inline-start: 2px solid color-mix(in srgb, currentColor 16%, transparent);
    margin-inline-start: 20px;
}

.rail__sub .rail__item {
    min-height: 40px;
    font-size: 0.84rem;
}

a.rail__item {
    text-decoration: none;
}

.rail__item .ico--ext {
    color: inherit;
    opacity: 0.7;
}

body[data-rail="compact"] .rail__sub,
body[data-rail="compact"] .rail__item--group .ico--chevron,
body[data-rail="compact"] .rail__item .ico--ext {
    margin-inline-start: 0;
    padding-inline-start: 0;
    border-inline-start: 0;
}

body[data-rail="compact"] .rail__item--group .ico--chevron,
body[data-rail="compact"] .rail__item .ico--ext {
    display: none;
}

body[data-rail="compact"] .rail__sub {
    padding: 4px 0;
    border-radius: 9px;
    background: color-mix(in srgb, currentColor 8%, transparent);
}

@media (max-width: 860px) {
    .rail__sub {
        margin-inline-start: 0;
        padding: 4px 0;
        border-inline-start: 0;
        border-radius: 9px;
        background: color-mix(in srgb, currentColor 8%, transparent);
    }

    .rail__item--group .ico--chevron,
    .rail__item .ico--ext {
        display: none;
    }
}

/* ---- Fonctionnalité publiée mais pas encore réalisée ------------------------------- */

.dev-card {
    display: grid;
    padding: 28px 18px;
    justify-items: center;
    gap: 6px;
    border: 1px dashed #c9d7da;
    border-radius: var(--radius);
    background: var(--paper);
    text-align: center;
}

.dev-card__icon {
    display: grid;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    color: #a5823f;
    background: #f7efe0;
    place-items: center;
}

.dev-card__icon .ico {
    width: 28px;
    height: 28px;
}

.dev-card__title {
    margin: 4px 0 0;
    color: var(--navy);
    font-weight: 700;
}

.dev-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

/* Groupe du menu déplié : pas l'apparence « panneau ouvert ». */
.rail__item--group[aria-expanded="true"] {
    color: inherit;
    background: color-mix(in srgb, currentColor 8%, transparent);
}

/* Icônes font-gis (police locale assets/vendor/font-gis-1.0.6) dans les menus et la légende. */
.ico--fg {
    display: inline-grid;
    font-size: 20px;
    font-style: normal;
    line-height: 1;
    place-items: center;
}

.ico--fg.ico--node {
    font-size: 17px;
}

/* Icônes Font Awesome Free 6.7.2 (police locale assets/vendor/fontawesome-free-6.7.2). */
.ico--fa {
    display: inline-grid;
    width: 20px;
    font-size: 17px;
    line-height: 1;
    text-align: center;
    place-items: center;
}

.ico--fa.ico--node {
    width: 18px;
    font-size: 15px;
}

/* ---- Espace privé : utilisateur connecté et bascule entre géoportails ------------- */

.user-menu {
    position: relative;
}

.user-chip {
    display: flex;
    margin: 0;
    padding: 3px 10px 3px 4px;
    align-items: center;
    gap: 8px;
    border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
    border-radius: 999px;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: start;
    cursor: pointer;
}

.user-chip:hover,
.user-chip[aria-expanded="true"] {
    background: color-mix(in srgb, currentColor 8%, transparent);
}

.user-chip__avatar {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: 50%;
    color: var(--white);
    background: var(--accent);
    font-size: 0.86rem;
    font-weight: 700;
    place-items: center;
}

.user-chip__text {
    display: grid;
    line-height: 1.2;
}

.user-chip__label {
    opacity: 0.7;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.user-chip__text strong {
    max-width: 160px;
    overflow: hidden;
    font-size: 0.84rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ico--down {
    transform: rotate(90deg);
}

.user-chip[aria-expanded="true"] .ico--down {
    transform: rotate(-90deg);
}

.user-menu__panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    width: 300px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: var(--white);
    box-shadow: var(--shadow);
}

.user-menu__who {
    display: flex;
    padding: 10px;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--line);
}

.user-menu__who strong {
    display: block;
    color: var(--navy);
    font-size: 0.9rem;
}

.user-menu__who small {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.3;
}

.user-menu__projects {
    display: grid;
    margin: 0;
    padding: 6px 0;
    gap: 2px;
    border-bottom: 1px solid var(--line);
}

.user-menu__title {
    margin: 4px 10px 4px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.user-menu__projects button,
.user-menu__logout {
    display: flex;
    width: 100%;
    padding: 9px 10px;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 7px;
    color: var(--ink);
    background: transparent;
    font: inherit;
    font-size: 0.88rem;
    text-align: start;
    cursor: pointer;
}

.user-menu__projects button .ico,
.user-menu__logout .ico {
    width: 18px;
    height: 18px;
    color: var(--blue);
}

.user-menu__projects button:hover,
.user-menu__logout:hover {
    background: #eef6f6;
}

.user-menu__projects button[aria-current="page"] {
    color: var(--green-dark);
    background: #e8f6f3;
    font-weight: 700;
    cursor: default;
}

.ico--current {
    margin-inline-start: auto;
    color: var(--green-dark) !important;
}

.user-menu__logout {
    margin-top: 6px;
    color: var(--danger);
}

.user-menu__logout .ico {
    color: var(--danger);
}

@media (max-width: 860px) {
    .user-chip__text,
    .user-chip .ico--down {
        display: none;
    }

    .user-chip {
        padding: 3px;
    }
}

/* ---- Défilement du menu de gauche et des panneaux : barre fine, sans horizontal ---- */

.rail {
    overflow: hidden;
}

.rail__list {
    min-height: 0;
    flex: 1 1 auto;
    /* The list fills the column (footer at the bottom): its rows stay at the top instead
       of sharing the free height (large gaps between the items). */
    align-content: start;
    margin-inline-end: -4px;
    padding-inline-end: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: color-mix(in srgb, var(--rail-ink) 32%, transparent) transparent;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
}

.rail__list::-webkit-scrollbar {
    width: 6px;
}

.rail__list::-webkit-scrollbar-track {
    background: transparent;
}

.rail__list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: color-mix(in srgb, var(--rail-ink) 30%, transparent);
}

.rail__list:hover::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--rail-ink) 50%, transparent);
}

.rail__list li,
.rail__item {
    min-width: 0;
    max-width: 100%;
}

.rail__label {
    min-width: 0;
    overflow-wrap: break-word;
    hyphens: auto;
}

.rail__sub {
    min-width: 0;
}

.panel__body,
.legend-card__body,
.results__body,
.notif-list,
.dialog__body {
    scrollbar-color: #b8c9cd transparent;
    scrollbar-width: thin;
}

.panel__body::-webkit-scrollbar,
.legend-card__body::-webkit-scrollbar,
.results__body::-webkit-scrollbar,
.notif-list::-webkit-scrollbar,
.dialog__body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.panel__body::-webkit-scrollbar-thumb,
.legend-card__body::-webkit-scrollbar-thumb,
.results__body::-webkit-scrollbar-thumb,
.notif-list::-webkit-scrollbar-thumb,
.dialog__body::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #c9d7da;
}

.panel__body {
    overflow-x: hidden;
}

/* ---- Notifications (cloche) ---------------------------------------------------------- */

.notif-menu {
    position: relative;
}

.notif-menu__toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
    border-radius: 50%;
}

.notif-menu__badge {
    position: absolute;
    top: -3px;
    inset-inline-end: -3px;
    display: grid;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border: 2px solid var(--header-bg);
    border-radius: 999px;
    color: var(--white);
    background: var(--danger);
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1;
    place-items: center;
}

.notif-menu__panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    inset-inline-end: -60px;
    width: 360px;
    max-width: calc(100vw - 24px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: var(--white);
    box-shadow: var(--shadow);
}

.notif-menu__head {
    display: flex;
    padding: 12px 14px;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    border-bottom: 1px solid var(--line);
}

.notif-menu__head strong {
    color: var(--navy);
}

.notif-menu__head > span {
    color: var(--muted);
    font-size: 0.78rem;
}

.notif-menu__head form {
    margin: 0 0 0 auto;
}

.link-action {
    padding: 0;
    border: 0;
    color: var(--blue);
    background: transparent;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

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

.notif-menu__empty {
    display: flex;
    margin: 0;
    padding: 22px 16px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.86rem;
}

.notif-menu__empty .ico {
    color: var(--green);
}

.notif-list {
    display: grid;
    max-height: 340px;
    margin: 0;
    padding: 6px;
    gap: 2px;
    overflow-y: auto;
    list-style: none;
}

.notif-list--all {
    max-height: none;
    padding: 0;
    gap: 6px;
}

.notif {
    display: flex;
    padding: 9px 8px;
    align-items: flex-start;
    gap: 10px;
    border-radius: 8px;
}

.notif:hover {
    background: var(--paper);
}

.notif-list--all .notif {
    border: 1px solid var(--line);
}

.notif__icon {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: 50%;
    color: var(--blue);
    background: #e6f1f6;
    place-items: center;
}

.notif__icon .ico {
    width: 16px;
    height: 16px;
}

.notif--ajout .notif__icon {
    color: var(--green-dark);
    background: #e8f6f3;
}

.notif--edition .notif__icon {
    color: #a5823f;
    background: #f7efe0;
}

.notif--suppression .notif__icon {
    color: var(--danger);
    background: #fff3f1;
}

.notif__body {
    display: grid;
    min-width: 0;
    flex: 1 1 auto;
    gap: 1px;
    font-size: 0.82rem;
}

.notif__body strong {
    color: var(--navy);
    font-size: 0.86rem;
}

.notif__body span {
    color: #33494f;
}

.notif__body small {
    color: var(--muted);
    font-size: 0.74rem;
}

.notif form {
    margin: 0;
}

.notif.is-read {
    opacity: 0.62;
}

.notif__state {
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 999px;
    color: var(--muted);
    background: var(--paper);
    font-size: 0.72rem;
    font-weight: 700;
}

.notif:not(.is-read) .notif__state {
    color: var(--white);
    background: var(--accent);
}

.notif-menu__all {
    display: flex;
    width: 100%;
    padding: 11px 14px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    border-top: 1px solid var(--line);
    color: var(--blue);
    background: var(--paper);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

.notif-menu__all:hover {
    background: #eef6f6;
}

/* ---- Menu utilisateur : Mon profil --------------------------------------------------- */

.user-menu__item {
    display: flex;
    width: 100%;
    margin-top: 6px;
    padding: 9px 10px;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 7px;
    color: var(--ink);
    background: transparent;
    font: inherit;
    font-size: 0.88rem;
    text-align: start;
    cursor: pointer;
}

.user-menu__item .ico {
    width: 18px;
    height: 18px;
    color: var(--blue);
}

.user-menu__item:hover {
    background: #eef6f6;
}

/* ---- Fenêtres Mon profil et Toutes les notifications --------------------------------- */

.dialog--wide {
    width: min(680px, calc(100% - 32px));
}

.dialog__head > div {
    min-width: 0;
    flex: 1 1 auto;
}

.dialog__sub {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.dialog__close {
    color: var(--muted);
}

.dialog--wide .dialog__body {
    max-height: min(62vh, 560px);
    padding-block: 10px 6px;
    overflow-y: auto;
}

.dialog__foot {
    gap: 8px;
    border-top: 1px solid var(--line);
}

.field input[type="email"],
.field input[type="password"] {
    width: 100%;
    min-height: 42px;
    padding: 8px 11px;
    border: 1px solid #c9d7da;
    border-radius: 8px;
    color: var(--ink);
    background: var(--white);
}

.field input[aria-invalid="true"] {
    border-color: var(--danger);
    background: #fffafa;
}

.field__error {
    margin: 0;
    color: #842c26;
    font-size: 0.78rem;
}

.fieldset {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.fieldset legend {
    padding: 0 6px;
}

.field--confirm {
    padding: 12px 14px;
    border-radius: var(--radius);
    background: #eef6f9;
}

.req {
    color: var(--danger);
}

@media (max-width: 640px) {
    .dialog--wide .field-row {
        grid-template-columns: 1fr;
    }

    .notif-menu__panel {
        position: fixed;
        top: var(--header-h);
        inset-inline: 8px;
        width: auto;
    }
}

/* Champs côte à côte : alignés en haut (un message d'erreur n'étire pas le voisin). */
.field-row {
    align-items: start;
}

.field {
    align-content: start;
}

/* Libellés du menu : taille compacte, mots entiers (coupure seulement en dernier recours). */
.rail__item {
    font-size: 0.85rem;
}

.rail__sub .rail__item {
    font-size: 0.82rem;
}

.rail__item--group .ico--chevron {
    width: 14px;
    height: 14px;
}

/* Légende statique (Gestion des légendes statiques) : éléments fixes du cartouche. */
.legend-list--static {
    margin: 0;
    padding: 10px 0 0;
    gap: 6px;
}

.legend-list--static li {
    color: var(--ink);
    font-size: 0.82rem;
}

/* Limitation de responsabilité : mise en forme saisie dans Gestion Responsabilité limitée
   (HTML nettoyé par DisclaimerRepository). */
#disclaimer .dialog__body h3,
#disclaimer .dialog__body h4 {
    margin: 6px 0 8px;
    color: var(--navy);
    font-size: 1rem;
}

#disclaimer .dialog__body ul,
#disclaimer .dialog__body ol {
    margin: 0 0 12px;
    padding-inline-start: 22px;
}

#disclaimer .dialog__body blockquote {
    margin: 0 0 12px;
    padding-inline-start: 12px;
    border-inline-start: 3px solid var(--line);
}

#disclaimer .dialog__body a {
    color: var(--green-dark);
}

/* Légende des couches dessinées par MapServer (image GetLegendGraphic du mapfile). */
.legend-graphic-box {
    margin: 2px 0 6px;
    padding-inline-start: 34px;
}

.legend-graphic {
    display: block;
    max-width: 100%;
    height: auto;
}

.legend-card .legend-graphic-box {
    padding-inline-start: 0;
}

/* Légende statique avec images MapServer : alignée au début de la ligne (gauche en
   français / anglais, droite en arabe), jamais centrée. */
.legend-list li.legend-list__graphic {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    text-align: start;
}

.legend-list li.legend-list__graphic .legend-graphic {
    align-self: flex-start;
}

/* Arabe : légende écrite en HTML, une ligne par classe — symbole (MapServer, RULE) puis nom,
   de droite à gauche. */
.legend-rules {
    display: grid;
    margin: 2px 0 0;
    padding: 0;
    gap: 3px;
    list-style: none;
}

.legend-rules li {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ink);
    font-size: 0.8rem;
}

.legend-rules .legend-graphic--rule {
    flex: none;
    width: 20px;
    height: 14px;
}

/* Légende statique : le titre de la couche, puis son image de légende en dessous. */
.legend-list--static li.legend-list__graphic + li {
    margin-top: 4px;
}

.legend-list__title {
    color: var(--ink);
    font-weight: 600;
}

/* Liste déroulante à choix multiples (« ms ») : filtre par défaut et filtres de Gestion des
   filtres. Fermée, elle ressemble à une liste déroulante et montre le choix ; ouverte, ses
   cases à cocher, dans le flux du panneau (rien n'est coupé par le défilement du panneau). */
.ms {
    min-width: 0;
    margin: 0 0 12px;
    padding: 0;
    border: 0;
}

.ms__label {
    margin-bottom: 6px;
    padding: 0;
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 600;
}

.ms__box {
    position: relative;
}

.ms__button {
    display: flex;
    min-height: 42px;
    padding: 8px 11px;
    align-items: center;
    gap: 8px;
    border: 1px solid #c9d7da;
    border-radius: 8px;
    color: var(--ink);
    background: var(--white);
    cursor: pointer;
    list-style: none;
}

.ms__button::-webkit-details-marker {
    display: none;
}

.ms__button:hover {
    border-color: var(--accent);
}

.ms__button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent);
    outline-offset: 0;
    border-color: var(--accent);
}

.ms__box[open] > .ms__button {
    border-color: var(--accent);
    border-radius: 8px 8px 0 0;
}

.ms__value {
    overflow: hidden;
    min-width: 0;
    flex: 1 1 auto;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms__count {
    min-width: 22px;
    padding: 1px 7px;
    flex: none;
    border-radius: 999px;
    color: var(--accent-ink);
    background: var(--accent);
    font-size: 0.74rem;
    font-weight: 700;
    text-align: center;
}

.ms__count[hidden] {
    display: none;
}

.ms__chevron {
    flex: none;
    transform: rotate(90deg);
}

.ms__box[open] .ms__chevron {
    transform: rotate(-90deg);
}

.ms__list {
    display: grid;
    max-height: 240px;
    padding: 8px 11px;
    gap: 7px;
    overflow: auto;
    border: 1px solid var(--accent);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.ms .df-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.9rem;
    line-height: 1.3;
    cursor: pointer;
}

.ms .df-check input {
    flex: none;
    margin-top: 2px;
}

[dir="rtl"] .ms__chevron {
    transform: rotate(90deg);
}

[dir="rtl"] .ms__box[open] .ms__chevron {
    transform: rotate(-90deg);
}
