/* ==========================================================================
   Fonts
   ========================================================================== */

@font-face {
    font-family: 'IBM Plex Sans';
    src: url('fonts/IBMPlexSans-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IBM Plex Sans';
    src: url('fonts/IBMPlexSans-Italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'IBM Plex Sans';
    src: url('fonts/IBMPlexSans-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IBM Plex Sans';
    src: url('fonts/IBMPlexSans-SemiBoldItalic.woff2') format('woff2');
    font-weight: 600;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'IBM Plex Sans Condensed';
    src: url('fonts/IBMPlexSansCondensed-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
    --ink-chrome: #FFFC68;
    --paper: #e4e0d4;
    --ink: #363B29;
    --rule: #000;
    --glass: rgba(28, 26, 22, 0.72);
    --glass-edge: rgba(255, 252, 104, 0.16);
    --blotter-edge: rgba(54, 59, 41, 0.12);
    --quiet: #333;
    --field: #fff;
    --field-border: #888;
    --btn: #e8e8e8;
    --danger: #c00;
    --ok: #0a6b2d;
    --radius: 6px;
    --shadow: 3px 2px 5px rgba(0, 0, 0, 0.38);
    --font: 'IBM Plex Sans', Arial, Helvetica, sans-serif;
    --font-table: 'IBM Plex Sans Condensed', 'IBM Plex Sans', Arial, Helvetica, sans-serif;
}

/* ==========================================================================
   Base
   ========================================================================== */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { min-height: 100%; }
body {
    color: var(--ink-chrome);
    background: #1f1e1b;
    font: 400 15px/1.45 var(--font);
    font-variant-numeric: tabular-nums;
}
a,
a:hover { color: #000; }
:focus-visible {
    outline: 2px solid var(--ink-chrome);
    outline-offset: 2px;
}
#principal :focus-visible,
#cdv :focus-visible {
    outline-color: var(--ink);
}

/* ==========================================================================
   Sky — header photograph
   Two layers of the same image: a blurred full-bleed underlay, then a
   sharp strip at the top that fades out so the blotter can sit on it.
   ========================================================================== */

#sky {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
#sky::before {
    content: '';
    position: absolute;
    inset: -12%;
    background: url('header-scene.jpg?v=6') center 22% / cover no-repeat;
    filter: blur(44px) saturate(0.72) brightness(0.38);
}
#sky::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: min(40vh, 400px);
    background: url('header-scene.jpg?v=6') center 5% / cover no-repeat;
    -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
    mask-image: linear-gradient(to bottom, #000 40%, transparent);
}
body.layout-welcome #sky::before {
    background-position: 50% 0%;
}
body.layout-welcome #sky::after {
    height: 100vh;
    background-size: auto 100vh;
    background-position: 50% 0;
    background-repeat: no-repeat;
    -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent);
    mask-image: linear-gradient(to bottom, #000 62%, transparent);
}

/* ==========================================================================
   Page shell
   The menu is floated; #principal is indented to sit beside it.
   Carnet pages drop the max-width so the logbook table can use the screen.
   ========================================================================== */

#global {
    position: relative;
    z-index: 1;
    width: min(1400px, calc(100% - 24px));
    min-width: 0;
    margin: 0 auto;
    padding-bottom: 16px;
}
body.layout-carnet #global {
    width: calc(100% - 16px);
    max-width: none;
}
@media (min-width: 1100px) {
    /* Logbook table is ~980px; keep the chrome from collapsing it. */
    body.layout-carnet,
    body.layout-carnet #global {
        min-width: 1100px;
    }
}

#central {
    clear: both;
    overflow: hidden;
}
body.layout-carnet #central,
body.layout-carte #central {
    overflow: visible;
}

/* ==========================================================================
   Header
   ========================================================================== */

#entete {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0 10px;
}
#entete1 {
    overflow: visible;
}
#entete1 .brand {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}
#entete1 .brand:hover .brand-name,
#entete1 .brand:hover .brand-kicker {
    color: #fff;
}
.brand-kicker {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--ink-chrome);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
    opacity: 0.82;
}
.brand-name {
    font-size: 1.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--ink-chrome);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.65);
    line-height: 1.1;
}
#entete2 {
    margin: 0;
    text-align: right;
    color: #eeebe3;
    flex-shrink: 0;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
}
#entete2 a {
    color: #eeebe3;
    text-decoration: none;
}
#entete2 a:hover,
#entete2 a:focus-visible {
    color: var(--ink-chrome);
}
#entete2 .account-who,
#entete2 .account-out {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
#entete2 .account-sep {
    margin: 0 0.55em;
    opacity: 0.55;
}
#entete2 .icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

body.logged #entete {
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0;
    padding: 12px 0 10px;
}
body.logged .brand-kicker {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
}
body.logged .brand-name {
    font-size: 1.15rem;
    letter-spacing: 0.02em;
}
body.logged #entete2 {
    margin: 0;
    clear: none;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
    font-style: italic;
    justify-self: end;
}
#entete .hdv {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 8px;
    color: var(--ink-chrome);
    font-size: 12px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    backdrop-filter: blur(18px) saturate(1.2);
    border: 1px solid var(--glass-edge);
    border-radius: 10px;
    justify-self: start;
    width: max-content;
    max-width: 100%;
}

/* ==========================================================================
   Navigation
   #nav-toggle is a clipped checkbox (not display:none) so <label for>
   still opens the menu without JS. Escape is the only scripted close.
   ========================================================================== */

.nav-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}
.nav-toolbar {
    display: none;
}

#menu,
.nav-toggle-btn,
.nav-toolbar .hdv {
    background: var(--glass);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    backdrop-filter: blur(18px) saturate(1.2);
    border: 1px solid var(--glass-edge);
    border-radius: 10px;
}
#menu {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    width: 220px;
    padding: 10px 8px 16px;
    float: left;
}
#menu a {
    color: var(--ink-chrome);
    text-decoration: none;
}
#menu a:hover,
#menu a:focus-visible {
    color: #fff;
}
#menu ul {
    margin: 0;
    padding: 0 0 0 5px;
    list-style: none;
}
#menu li {
    margin: 0;
    padding: 12px 0 0;
}
#menu .navigation > li > a,
#menu .navigation > li > details > summary {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}
#menu .menu-ico {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.92;
}
#menu details {
    padding: 0;
}
#menu summary {
    cursor: pointer;
    color: var(--ink-chrome);
    list-style: none;
}
#menu summary::-webkit-details-marker,
#menu summary::marker {
    display: none;
    content: '';
}
#menu summary:hover {
    color: #fff;
}
#menu details ul {
    padding: 0 0 0 12px;
    margin: 4px 0 0 4px;
    border-left: 1px solid rgba(255, 252, 104, 0.18);
}
#menu details li {
    padding-top: 6px;
}

.menu-login {
    padding: 8px 4px 0;
}
.menu-login input[type="text"],
.menu-login input[type="password"] {
    width: 100%;
    margin: 0 0 8px;
    padding: 6px 8px;
    border: 0;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
}
.menu-login button {
    display: block;
    width: 100%;
    margin: 4px 0 8px;
    background: var(--ink-chrome);
    color: #222;
    border: 0;
    border-radius: 6px;
}
.menu-login button:hover {
    background: #fff;
}

.menu-backdrop {
    display: none;
}
.menu-close-wrap {
    display: none;
    margin: 0 0 8px;
    padding: 0;
}
.menu-close {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--ink-chrome);
    font-weight: 600;
    font-size: 14px;
}
.menu-close .icon {
    width: 16px;
    height: 16px;
}
.menu-close:hover,
.menu-close:focus-visible {
    color: #fff;
}

/*
 * Carnet overlay: only when #ret_menu is present. carte_vol.php also uses
 * layout-carnet (wide page) but keeps the normal sidebar.
 */
body.layout-carnet:has(#ret_menu) .nav-toolbar {
    display: none;
}
body.layout-carnet:has(#ret_menu) #menu {
    display: none;
    float: none;
    position: fixed;
    z-index: 3000;
    left: 12px;
    top: 12px;
    width: 260px;
    max-height: calc(100vh - 24px);
    overflow: auto;
    margin: 0;
}
body.layout-carnet:has(#ret_menu) .nav-toggle:checked ~ #menu {
    display: block;
}
body.layout-carnet:has(#ret_menu) .nav-toggle:checked ~ .menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 2999;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
}
body.layout-carnet:has(#ret_menu) .menu-close-wrap {
    display: block;
}

#menu_pied {
    display: none;
}

/* ==========================================================================
   HDV split-flap
   ========================================================================== */

#menu .hdv {
    margin: 0 5px 10px;
    padding: 6px 4px 4px;
    color: var(--ink-chrome);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.hdv-flap {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: #0e0d0b;
    border-radius: 3px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55);
}
.flap {
    position: relative;
    width: 0.78em;
    height: 1.22em;
    font-size: 1.22rem;
    font-family: var(--font-table);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #f3e98a;
    background: #1c1a16;
    border-radius: 2px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    perspective: 140px;
}
.flap-top,
.flap-bot {
    position: absolute;
    left: 0;
    right: 0;
    height: 50%;
    overflow: hidden;
    background: inherit;
}
.flap-top {
    top: 0;
    border-radius: 2px 2px 0 0;
    z-index: 2;
    transform-origin: bottom center;
    backface-visibility: hidden;
}
.flap-bot {
    bottom: 0;
    border-radius: 0 0 2px 2px;
    z-index: 1;
}
.flap-ch {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200%;
    line-height: 1;
}
.flap-top .flap-ch { top: 0; }
.flap-bot .flap-ch { bottom: 0; }
.flap::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(0, 0, 0, 0.7);
    z-index: 4;
    pointer-events: none;
}
.flap.tick .flap-top {
    animation: hdv-flap-top 0.14s ease-in forwards;
}
@keyframes hdv-flap-top {
    from { transform: rotateX(0deg); }
    to { transform: rotateX(-95deg); }
}
@media (prefers-reduced-motion: reduce) {
    .flap.tick .flap-top { animation: none; }
}
.hdv-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    opacity: 0.85;
}

/* ==========================================================================
   Blotter — #principal (most pages) and #cdv (carnet)
   Shared paper panel; #principal clears the floated menu.
   ========================================================================== */

#principal,
#cdv {
    padding: 16px 22px 24px;
    color: var(--ink);
    background: var(--paper);
    min-height: 500px;
    border-radius: 10px;
    border: 1px solid var(--blotter-edge);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.32);
}
#principal {
    margin-left: 238px;
}
#principal h1 { margin: 8px 0 10px; font-size: 1.45rem; font-weight: 600; letter-spacing: -0.02em; }
#principal h2 { margin: 1.15rem 0 0.4rem; font-size: 1.1rem; font-weight: 600; }
#cdv {
    padding-bottom: 40px;
    position: relative;
    overflow: visible;
}
#cdv h2 {
    text-align: center;
    margin: 0 0 12px;
    font-weight: 600;
}

body.layout-welcome #central {
    overflow: visible;
}
body.layout-welcome #principal {
    float: right;
    clear: none;
    width: min(26rem, calc(100% - 248px));
    max-width: 26rem;
    margin: clamp(280px, 50vh, 540px) 0 16px auto;
    min-height: 0;
    background: rgba(228, 224, 212, 0.86);
    -webkit-backdrop-filter: blur(14px) saturate(1.05);
    backdrop-filter: blur(14px) saturate(1.05);
}
body.layout-welcome #pied {
    float: right;
    clear: both;
    width: min(26rem, calc(100% - 248px));
    max-width: 26rem;
    margin-left: auto;
}

/* ==========================================================================
   Feedback
   ========================================================================== */

.erreur { color: var(--danger); }
.status-ok { color: var(--ok); }
.hint { color: #888; font-style: italic; }
.start-box {
    margin: 0.6rem 0 1.2rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--blotter-edge);
    border-radius: 6px;
    background: rgba(255, 252, 247, 0.55);
}
.start-box ul {
    margin: 0.4rem 0 0;
    padding-left: 1.2rem;
}
.start-box li { margin: 0.2rem 0; }

/* ==========================================================================
   Home dashboard
   ========================================================================== */

.dash-hello {
    margin: 0 0 12px;
    font-size: 1.15rem;
    font-weight: 600;
}
.dash-banner { margin: 0 0 12px; }
.dash-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 14px;
}
.dash-kpi {
    background: #fff;
    border: 1px solid var(--blotter-edge);
    border-radius: 8px;
    padding: 10px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.dash-kpi-n {
    font-size: 1.25rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.dash-kpi-l {
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--quiet);
}
.dash-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}
@media (max-width: 1220px) {
    .dash-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.dash-card {
    background: #f7f4ec;
    border: 1px solid var(--blotter-edge);
    border-radius: 8px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.dash-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px 0;
}
#principal .dash-card-head h2 {
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.dash-card-head a {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--quiet);
    text-decoration: none;
}
.dash-card-head a:hover { color: var(--ink); }
.dash-ico {
    width: 15px;
    height: 15px;
}
.dash-card-body {
    padding: 8px 12px 12px;
    flex: 1;
    min-width: 0;
}
.dash-chart .stat-chart-wrap {
    height: 220px;
    max-width: none;
    margin: 0;
    background: #fff;
}
.dash-map .carte-wrap { margin: 0; }
.dash-map .carte-map,
.dash-map .leaflet-container {
    height: 220px;
    border-color: #bbb;
}
.dash-map-n,
.dash-last-cap {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: var(--quiet);
}
.dash-recent-h {
    margin: 0 0 8px;
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.dash-recent-h span {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--quiet);
}
.dash-facts {
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
}
.dash-facts li { margin: 0 0 4px; }
.dash-last {
    margin: 0 0 6px;
    padding-top: 8px;
    border-top: 1px solid var(--blotter-edge);
}
.nat-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nat-row {
    display: grid;
    grid-template-columns: minmax(3.2rem, auto) minmax(0, 1fr) 4.2rem;
    gap: 8px;
    align-items: center;
    font-size: 0.88rem;
}
.nat-row a { color: inherit; text-decoration: none; font-weight: 600; }
.nat-row a:hover { text-decoration: underline; }
.nat-bar {
    height: 8px;
    background: #e4e0d4;
    border-radius: 4px;
    overflow: hidden;
}
.nat-bar > span {
    display: block;
    height: 100%;
    background: #5ba3d9;
    border-radius: 4px;
}
.nat-hm {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.dash-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}
.lic-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lic-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 10px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid var(--blotter-edge);
    border-left-width: 4px;
}
.lic-ok { border-left-color: #0a6b2d; }
.lic-soon { border-left-color: #c9a227; }
.lic-warn { border-left-color: #c45c12; }
.lic-bad {
    border-left-color: #c00;
    background: #fbeaea;
}
.lic-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.lic-main strong { font-size: 0.92rem; }
.lic-exp { font-size: 0.8rem; color: var(--quiet); }
.lic-days {
    flex: 0 0 auto;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    white-space: nowrap;
}
.lic-ok .lic-days { color: #0a6b2d; }
.lic-soon .lic-days { color: #8a5a00; }
.lic-warn .lic-days { color: #c45c12; }
.lic-bad .lic-days { color: #c00; }
.lic-hide { margin: 0; }
.lic-hide button {
    border: 0;
    background: transparent;
    color: #888;
    font: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 4px;
}
.lic-hide button:hover { color: var(--ink); }
.lic-row-off td { opacity: 0.55; }
.share-dlg { max-width: min(520px, 96vw); }
.share-url-row {
    display: flex;
    gap: 6px;
    align-items: stretch;
}
.share-url-row input {
    flex: 1 1 auto;
    min-width: 0;
    font: inherit;
    padding: 6px 8px;
    background: #fff;
    border: 1px solid var(--field-border);
    border-radius: 4px;
}
.share-url-row button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.share-shown { font-size: 0.85rem; color: var(--quiet); margin: 4px 0 8px; }
.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.share-actions a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.dev-link {
    background: #fff8d5;
    padding: 0.75rem;
    border: 1px solid #e0d28a;
    color: var(--ink);
}
.stat-icon {
    width: 18px;
    height: 18px;
    vertical-align: -3px;
    margin-right: 6px;
}

/* ==========================================================================
   Buttons and icons
   ========================================================================== */

button {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.4rem 0.95rem;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: var(--btn);
    color: var(--ink);
    cursor: pointer;
}
button:hover {
    background: #f2f2f2;
}
.format-toggle button,
.btn-plus {
    font-weight: inherit;
    padding: 0;
    border: 0;
    background: none;
    border-radius: 0;
}
.format-toggle button:hover,
.btn-plus:hover {
    background: none;
}
.btn-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}
.btn-plus .icon {
    width: 16px;
    height: 16px;
    display: block;
}
.icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}
.icon-link {
    color: inherit;
    text-decoration: none;
}
.icon-link:hover {
    color: #555;
}
.icon-nav .icon {
    width: 28px;
    height: 28px;
    color: var(--ink);
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* ==========================================================================
   Welcome / auth
   ========================================================================== */

#principal .hero-title {
    text-align: left;
}
#principal .hero-title h1 { font-size: 1.45rem; }
.welcome-lede {
    margin: 0.15rem 0 0.85rem;
    font-size: 1.02rem;
    color: var(--quiet);
}
.welcome-copy ul {
    margin: 0 0 0.8rem;
    padding-left: 1.15rem;
}
.welcome-copy li { margin: 0.28rem 0; }
.welcome-cta {
    margin: 0 0 1rem;
    font-weight: 600;
}
.welcome-news {
    margin: 0;
    padding-top: 0.6rem;
    border-top: 1px solid var(--blotter-edge);
}
#principal .welcome-news h2 {
    margin: 0 0 0.55rem;
    font-size: 1rem;
}
.welcome-news-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.welcome-news-list li {
    margin: 0 0 0.85rem;
}
.welcome-news-list time {
    display: block;
    font-size: 0.78rem;
    color: var(--quiet);
    font-variant-numeric: tabular-nums;
}
.welcome-news-list strong {
    display: block;
    margin: 0.1rem 0 0.2rem;
}
.welcome-news-list p {
    margin: 0;
    font-size: 0.92rem;
}

form.auth label { display: block; margin: 0.75rem 0 0.2rem; }
form.auth input[type="text"],
form.auth input[type="password"],
form.auth input[type="email"] {
    width: 100%;
    max-width: 22rem;
    padding: 0.4rem 0.55rem;
    font-family: inherit;
    font-size: 1rem;
    border: 1px solid var(--field-border);
    border-radius: 4px;
}
form.auth button {
    margin-top: 1rem;
}

/* ==========================================================================
   Carnet
   .num = centered counts / short codes; .hm = hours and other numerics.
   min-width 980px matches the printed grid; .carnet-scroll handles overflow.
   ========================================================================== */

#ret_menu {
    position: absolute;
    left: 0;
    top: 10px;
    background: #333;
    background: linear-gradient(#333, #555);
    width: auto;
    margin: 0;
    padding: 8px 10px;
    text-align: center;
    z-index: 1;
    border: 1px solid var(--rule);
    border-left: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: var(--shadow);
}
#ret_menu label {
    color: var(--ink-chrome);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
#ret_menu label:hover { color: #fff; }
#ret_menu .icon {
    width: 22px;
    height: 22px;
    display: block;
}
.carnet-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 8px 0 12px;
}
.carnet-nav h2 { margin: 0; }
.format-toggle {
    position: absolute;
    right: 16px;
    bottom: 8px;
}
.carnet-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 0 1rem;
}
.vol_table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    background: #fff;
    margin: 0 auto 1rem;
    color: #000;
    font-family: var(--font-table);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.015em;
}
.vol_table th,
.vol_table td {
    padding: 2px 4px;
    white-space: nowrap;
}
.vol_table th {
    background: #bbb;
    border: 1px solid #000;
    font-weight: bold;
}
.vol_table td {
    background: #eee;
    border: 1px solid #000;
}
.vol_table td:last-child,
.vol_table th:last-child {
    white-space: normal;
}
.vol_table a { text-decoration: none; }
.vol_table a:hover { color: #555; text-decoration: underline; }
.vol_table .sep_col { border-left: 2px solid #000; }
.vol_table .num { text-align: center; }
.vol_table .hm { text-align: right; }
.vol_table .att {
    min-width: 4ch;
    box-sizing: content-box;
}
.vol_table thead th.att {
    font-size: 11px;
}
.vol_table th.vert {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    max-width: 1.6em;
    line-height: 1.15;
    padding: 6px 2px;
    vertical-align: middle;
}

.carnet-choix .carnet-group {
    margin: 0 0 1.4rem;
    column-width: 14rem;
    column-gap: 1.75rem;
}
.carnet-choix .carnet-group h3 {
    column-span: all;
    margin: 0 0 8px;
}
.carnet-choix .carnet-group > div {
    break-inside: avoid;
    margin: 2px 0;
}

/* ==========================================================================
   Flight form
   Plus / delete sit outside the ICAO cell (absolute, left: 100%) so they
   don't shift the input. nature-N hides T&G / landing fields that don't apply.
   ========================================================================== */

.vol-form {
    max-width: 560px;
    color: var(--ink);
}
.vol-form fieldset {
    border: 0;
    margin: 0;
    padding: 0 0 4px;
}
.vol-form legend {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: #c5c5c5;
    color: var(--ink);
    font-weight: bold;
    padding: 3px 8px;
    margin: 0 0 4px;
}
.vol-form-table {
    width: 100%;
    border-collapse: collapse;
}
.vol-form-table td {
    text-align: right;
    font-weight: bold;
    padding: 3px 12px;
    white-space: nowrap;
    vertical-align: middle;
    width: 50%;
}
.vol-form-table td.group-title {
    text-align: left;
    padding: 8px 8px 2px;
}
.vol-form-table td.icao-field {
    position: relative;
}
.vol-form-table td.icao-field > .btn-plus,
.vol-form-table td.icao-field > .btn-tg-del {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 2px;
}
.vol-form-table td.icao-meta {
    text-align: left;
    font-weight: normal;
    padding-left: 36px;
}
.icao-ok { font-weight: normal; font-size: 12px; }
.vol-form-table .icao-ok {
    margin-right: 8px;
}
.vol-form input[type="text"],
.vol-form input[type="date"],
.vol-form input[type="time"],
.vol-form select,
.vol-form textarea {
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    padding: 3px 6px;
    border: 1px solid var(--field-border);
    border-radius: 4px;
    background: var(--field);
    color: #000;
}
.vol-form textarea {
    width: 16rem;
    max-width: 100%;
    resize: vertical;
    vertical-align: middle;
}
.vol-form input.icao {
    text-transform: uppercase;
    width: 5.2em;
}
.vol-form.nature-1 #tg-rows,
.vol-form.nature-1 #row_att,
.vol-form.nature-2 #tg-rows,
.vol-form.nature-2 #row_att,
.vol-form.nature-4 #tg-rows,
.vol-form.nature-6 #tg-rows,
.vol-form.nature-7 #tg-rows,
.vol-form.nature-8 #tg-rows {
    display: none;
}
.btn-tg-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    cursor: pointer;
    vertical-align: middle;
}
.btn-tg-del[hidden] {
    display: none;
}
.btn-tg-del .icon {
    width: 16px;
    height: 16px;
    display: block;
}
.btn-tg-del:hover {
    color: #800;
}
.vol-form-table .tg-label {
    display: inline-block;
    min-width: 5.5em;
}
.vol-form.vol-close,
.vol-form fieldset.vol-close {
    border-top: 1px solid #bbb;
    margin-top: 6px;
    padding-top: 8px;
}
.vol-form button[type="submit"] {
    padding: 0.4rem 0.95rem;
}
.vol-form .btn-plus {
    margin-left: 4px;
    color: var(--ink);
}
.vol-form .hint {
    padding: 0 8px;
    text-align: right;
}

.duree-toggle {
    margin: 8px 0 6px;
    padding: 0 8px;
    font-weight: 600;
}
.duree-toggle a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.duree-toggle a:hover {
    color: #000;
}
.duree-panel {
    background: rgba(255, 255, 255, 0.32);
    border: 1px solid var(--blotter-edge);
    border-radius: 8px;
    padding: 10px 12px 12px;
    margin: 0 0 12px;
    color: var(--ink);
}
.duree-lead,
.duree-route .hint {
    margin: 0 0 8px;
    font-weight: 400;
    font-size: 13px;
    white-space: normal;
    text-align: left;
    padding: 0;
    color: var(--quiet);
}
.duree-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    align-items: center;
    margin-bottom: 8px;
}
.duree-fields label,
.duree-route label,
.duree-pairs label,
.duree-extras label {
    font-weight: 600;
    white-space: nowrap;
}
.duree-panel input[type="text"],
.duree-panel input[type="time"] {
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    padding: 3px 6px;
    border: 1px solid var(--field-border);
    border-radius: 4px;
    background: var(--field);
    color: #000;
}
.duree-route {
    margin: 6px 0 8px;
}
.duree-route p {
    margin: 0 0 4px;
    font-weight: 700;
}
.duree-route label {
    display: inline-block;
    margin-right: 14px;
    font-weight: 400;
}
.duree-panel button {
    padding: 0.35rem 0.85rem;
}
.duree-out {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--blotter-edge);
    font-weight: 400;
    white-space: normal;
}
.duree-total {
    margin: 0 0 4px;
    font-weight: 700;
}
.duree-meta {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--quiet);
}
.duree-apply p {
    margin: 0 0 6px;
    font-weight: 600;
}
.duree-pairs,
.duree-extras {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-bottom: 8px;
}
.duree-pairs label,
.duree-extras label {
    font-weight: 400;
}
.vol-form input.duree-flash {
    outline: 2px solid #c4a000;
    background: #fff8d0;
}

/* ==========================================================================
   Lists
   Zebra skips .list-edit so an open editor is not striped. Hover is limited
   to fine pointers so a tap on a phone does not leave a stuck highlight.
   ========================================================================== */

.list-filter {
    margin: 0 0 10px;
}
.list-filter-input {
    width: 18rem;
    max-width: 100%;
    padding: 5px 8px;
}
.list-filter-empty {
    margin: 0 0 10px;
}
.list-add {
    margin-top: 1.5rem;
    max-width: 40rem;
}
.table_liste {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    color: #000;
}
.table_liste th,
.table_liste td {
    border: 1px solid #999;
    padding: 6px 8px;
    vertical-align: middle;
}
.table_liste th {
    background: silver;
    font-weight: bold;
}
.table_liste tbody > tr:nth-child(even of :not(.list-edit)) td {
    background: #f4f1ea;
}
@media (hover: hover) and (pointer: fine) {
    .table_liste tbody > tr:not(.list-edit):hover td {
        background: #e6e0d2;
    }
}
.table_liste tbody > tr:not(.list-edit):focus-within td {
    background: #e6e0d2;
}
.table_liste tr.list-open td,
.table_liste tr.list-open:hover td,
.table_liste tr.list-open:focus-within td,
.list-edit td {
    background: #e8e6df;
}
.list-edit td {
    padding: 12px 12px 8px;
    border-top: none;
}
.list-edit .liste-form {
    margin: 0;
}
.table_liste .acts {
    white-space: nowrap;
    text-align: right;
    width: 1%;
}
.table_liste .acts .icon-link + .icon-link {
    margin-left: 4px;
}
.table_liste .acts .icon {
    width: 16px;
    height: 16px;
}
.liste-form label.check {
    display: block;
    font-weight: normal;
    margin: 2px 0;
}
.liste-form fieldset {
    border: 1px solid #bbb;
    margin: 8px 0;
    padding: 6px 8px;
}
.liste-form legend { font-weight: bold; }

.echeance-past { color: var(--danger); font-weight: 600; }
.echeance-soon { color: #8a5a00; font-weight: 600; }
.echeance-ok { color: #5c5a52; }

/* ==========================================================================
   Aircraft cards
   ========================================================================== */

.table_liste tr[id^="avion-"] {
    scroll-margin-top: 12px;
}
.avion-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 8px;
}
@media (max-width: 1220px) {
    .avion-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.avion-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 18px;
    margin: 0 0 14px;
}
.avion-tools p { margin: 0; }
.avion-tools label { font-weight: 600; }
.avion-tools select {
    margin-left: 6px;
    font: inherit;
}
#principal h2.avion-group {
    margin: 1.2rem 0 0.45rem;
    font-size: 1.1rem;
}
.avion-tools + h2.avion-group,
.avion-tools + .avion-grid {
    margin-top: 0;
}
.avion {
    width: auto;
    max-width: 100%;
    min-width: 0;
    height: auto;
    display: flex;
    border-radius: var(--radius);
    border: 1px solid var(--rule);
    box-shadow: var(--shadow);
    background: #ccc;
    color: #000;
}
.avion_photo {
    flex: 0 1 160px;
    min-width: 110px;
    margin: 5px;
    cursor: pointer;
}
.avion_photo img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    background: #eee;
}
.avion_leg {
    flex: 1 1 140px;
    margin: 5px 6px 5px 0;
    min-width: 0;
}
.avion_leg a { color: #000; }
.avion-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
}
.avion-imat {
    margin: 0;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.avion-type {
    margin: 0 0 3px;
    font-size: 12px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}
.avion-stats {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    line-height: 1.25;
}
.avion-stats th,
.avion-stats td {
    padding: 0;
    border: 0;
    font-weight: 400;
    vertical-align: top;
}
.avion-stats th {
    text-align: left;
    padding-right: 8px;
    color: #333;
    white-space: nowrap;
}
.avion-stats td {
    text-align: right;
    white-space: nowrap;
}
.avion-map {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.avion-map:hover { text-decoration: underline; }
.avion-map-ico {
    width: 13px;
    height: 13px;
}
.avion-preview {
    width: 400px;
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   Statistics
   ========================================================================== */

.stat-chart-wrap {
    position: relative;
    height: 350px;
    max-width: 780px;
    margin: 0 auto 1.4rem;
    background: #e8e8e8;
    border: 1px solid #bbb;
    padding: 8px 8px 8px 4px;
}
.stat-chart-wrap.chart-pie {
    height: 240px;
    max-width: 560px;
}
.stat-mois-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 8px;
}
.stat-mois-nav h1,
.stat-mois-nav h3 {
    margin: 0;
    text-align: center;
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.stat-mois-nav .icon-nav,
.stat-mois-nav > span {
    flex: 0 0 28px;
    width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#principal .stat-mois-sub {
    text-align: center;
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 1.15rem 0 0.4rem;
}
.stats-table-wrap {
    overflow-x: auto;
    margin: 0 0 1rem;
}
.stats-table {
    font-size: 12px;
}

/* ==========================================================================
   Settings / init
   ========================================================================== */

.param-box {
    border: 1px solid var(--blotter-edge);
    border-radius: 8px;
    margin: 0 0 14px;
    padding: 4px 14px 8px;
    background: rgba(255, 255, 255, 0.28);
    min-width: 0;
}
.param-box legend {
    padding: 0 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink);
}
.param-form {
    margin: 0;
}
.param-form label.check {
    display: block;
    font-weight: normal;
    margin: 2px 0;
}
.param-form textarea {
    width: 22rem;
    max-width: 100%;
}
.param-checks {
    margin: 0 0 8px;
}
.init-form {
    max-width: 760px;
}

/* ==========================================================================
   Maps
   Leaflet measures with content-box; our global border-box would mis-size
   tiles and controls. Popup links are forced black over Leaflet's blue.
   ========================================================================== */

.kml-export {
    float: right;
    margin: 0 0 8px 12px;
}
.kml-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}
.carte-wrap {
    position: relative;
    margin: 10px 0 16px;
}
.carte-tools {
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 1000;
    background: rgba(221, 221, 221, 0.92);
    border: 1px solid #999;
    padding: 4px 8px;
}
.carte-tools p { margin: 0; }
.carte-tools label { font-weight: normal; color: #000; }
.carte-map,
.leaflet-container {
    width: 100%;
    height: 500px;
    border: 1px solid #000;
    background: #c5d0d8;
}
.carte-map-sm {
    height: 350px;
}
.leaflet-container,
.leaflet-container * {
    box-sizing: content-box !important;
}
.carte-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.carte-stack .carte-wrap {
    flex: none;
    width: 100%;
    min-width: 0;
    margin: 0;
}
.carte-stack .kml-export {
    float: none;
    margin: 0;
    align-self: flex-end;
}
.region-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px 16px;
    align-items: start;
}
.region-block .table_liste {
    margin: 0;
}
.carte-stack .stats-table-wrap {
    max-height: min(70vh, 560px);
    overflow: auto;
}
.carte-popup { text-align: center; }
.carte-popup a,
.leaflet-popup-content a {
    color: #000;
    text-decoration: underline;
}

/* ==========================================================================
   Public shared carnet
   ========================================================================== */

.public-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid #999;
}
.public-tabs li { margin: 0; }
.public-tabs a {
    display: block;
    padding: 6px 12px;
    background: #ccc;
    border: 1px solid #999;
    border-bottom: 0;
    border-radius: 6px 6px 0 0;
    text-decoration: none;
    color: #000;
}
.public-tabs a:hover { background: #eee; }
.public-tabs a.selected {
    background: #eee;
    font-weight: bold;
}
.public-hero { text-align: center; }
.public-hero img {
    max-width: 280px;
    height: auto;
}
.public-hdv {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 16px 0;
}
.public-hdv .hdv-box {
    background: #444;
    padding: 5px 8px;
}
.public-hdv .hdv-box img {
    height: 22px;
    vertical-align: middle;
}
.public-traces { margin: 0 0 1rem; padding-left: 1.2em; }
.public-traces a.selected { font-weight: bold; }

/* ==========================================================================
   Dialogs
   ========================================================================== */

dialog.modal {
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 16px 18px;
    max-width: 440px;
    width: calc(100% - 24px);
    color: var(--ink);
    background: var(--paper);
    font-family: var(--font);
}
dialog.modal::backdrop {
    background: rgba(0, 0, 0, 0.45);
}
dialog.modal h2 {
    margin: 0 0 8px;
    font-size: 1.15rem;
}
dialog.modal .modal-err {
    min-height: 1.2em;
}
dialog.vol-dlg {
    max-width: min(640px, 96vw);
}
dialog.vol-dlg .carte-map {
    height: 280px;
    margin: 0 0 8px;
}
dialog.avion-dlg {
    max-width: min(920px, 96vw);
}
dialog.avion-dlg .carte-wrap {
    margin: 0 0 8px;
}
dialog.avion-dlg .carte-map {
    height: 420px;
}
.dlg-vol-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 0;
    align-items: center;
}
.dlg-vol-actions a {
    display: inline-block;
    padding: 0.4rem 0.95rem;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: var(--btn);
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
}
.dlg-vol-actions a:hover {
    background: #f2f2f2;
    color: var(--ink);
}
#dlg-vol-confirm {
    margin: 8px 0 0;
}
#dlg-vol-confirm[hidden] {
    display: none;
}
dialog.lightbox {
    max-width: min(920px, 96vw);
    padding: 10px 10px 8px;
    background: #1a1a16;
}
dialog.lightbox img {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 82vh;
    margin: 0 auto 8px;
}
dialog.lightbox::backdrop {
    background: rgba(0, 0, 0, 0.72);
}
dialog.lightbox button {
    display: block;
    margin: 0 auto;
}

/* ==========================================================================
   Footer
   ========================================================================== */

#pied {
    clear: both;
    margin-left: 238px;
    padding: 10px 0 0;
    text-align: center;
    font-style: italic;
    color: #ddd9cf;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.pied-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 22px;
}
#pied a {
    color: #ddd9cf;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
#pied a:hover,
#pied a:focus-visible {
    color: #fff;
}
#pied .icon {
    width: 15px;
    height: 15px;
}

/* ==========================================================================
   Narrow screens
   Inputs at 16px so iOS does not zoom on focus.
   Map height is !important because Leaflet writes an inline height after init.
   ========================================================================== */

@media (max-width: 800px) {
    html {
        -webkit-text-size-adjust: 100%;
    }
    #sky::after {
        height: 130px;
        background-position: center 0%;
    }
    body.layout-welcome #sky::after {
        height: 48vh;
        background-size: auto 48vh;
        background-position: 50% 0;
        -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
        mask-image: linear-gradient(to bottom, #000 70%, transparent);
    }
    body.layout-welcome #principal,
    body.layout-welcome #pied {
        float: none;
        width: auto;
        max-width: none;
        margin: 8px;
    }
    body.layout-welcome #principal {
        margin-top: 8px;
    }
    #global {
        width: 100%;
        margin: 0;
        padding-bottom: 8px;
    }
    body.layout-carnet #global {
        width: 100%;
    }
    #entete1 {
        padding: 6px 8px 0;
    }
    .brand-name {
        font-size: 1.2rem;
    }
    .brand-kicker {
        font-size: 0.6rem;
        letter-spacing: 0.18em;
    }
    #entete2 {
        padding: 0;
        font-size: 13px;
    }
    body.logged #entete {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 8px 6px;
    }
    #entete .hdv {
        padding: 4px 8px;
    }
    #entete .flap {
        font-size: 1.05rem;
        width: 0.78em;
        height: 1.15em;
    }
    #central {
        overflow: visible;
    }

    .nav-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin: 0 8px 8px;
    }
    .nav-toggle-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        color: var(--ink-chrome);
        cursor: pointer;
        font-weight: 600;
        font-size: 14px;
    }
    .nav-toggle-btn::before {
        content: '';
        display: block;
        width: 16px;
        height: 2px;
        background: var(--ink-chrome);
        box-shadow: 0 -5px 0 var(--ink-chrome), 0 5px 0 var(--ink-chrome);
    }
    .nav-toggle:checked + .nav-toolbar .nav-toggle-btn {
        background: #555;
        color: #fff;
    }
    #pied {
        margin-left: 0;
    }
    .dash-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dash-grid {
        grid-template-columns: 1fr;
    }
    .dash-chart .stat-chart-wrap,
    .dash-map .carte-map,
    .dash-map .leaflet-container {
        height: 200px;
    }

    #menu {
        display: none;
        float: none;
        width: auto;
        margin: 0 8px 8px;
    }
    #menu .hdv {
        display: none;
    }
    .nav-toolbar .hdv {
        display: none;
    }
    .nav-toggle:checked ~ #menu {
        display: block;
    }
    #menu li {
        padding-top: 10px;
    }

    #principal,
    #cdv {
        margin-left: 0;
        margin-right: 0;
        padding: 10px 10px 16px;
        min-height: 0;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        overflow-x: auto;
    }
    #principal h1 {
        font-size: 1.25rem;
    }
    #ret_menu {
        display: none;
    }
    body.layout-carnet:has(#ret_menu) #ret_menu {
        display: block;
    }
    body.layout-carnet:has(#ret_menu) .nav-toolbar {
        display: none;
    }

    .hero-title h1 { font-size: 1.35rem; }
    .hero-title h2 { font-size: 1.05rem; }

    .vol-form {
        max-width: none;
    }
    .vol-form-table,
    .vol-form-table tbody,
    .vol-form-table tr {
        display: block;
        width: 100%;
    }
    .vol-form-table td {
        display: grid;
        grid-template-columns: 9.75rem auto auto;
        align-items: center;
        justify-items: start;
        justify-content: start;
        column-gap: 8px;
        width: 100%;
        box-sizing: border-box;
        text-align: left;
        white-space: normal;
        padding: 5px 2px;
    }
    .vol-form-table td.group-title {
        display: block;
        padding: 10px 2px 2px;
        text-align: left;
    }
    .vol-form-table td:empty {
        display: none;
    }
    .vol-form-table td.icao-meta {
        padding-left: 2px;
    }
    .vol-form-table td.icao-meta:not(:has(.icao-ok:not(:empty))) {
        display: none;
    }
    .vol-form-table td.icao-meta .icao-ok {
        grid-column: 2;
        font-weight: normal;
        white-space: normal;
    }
    .vol-form-table td > input {
        grid-column: 2;
        min-width: 0;
        max-width: 100%;
    }
    .vol-form-table td > select {
        min-width: 8rem;
        max-width: 100%;
        grid-column: 2;
    }
    .vol-form-table td:has(> textarea) {
        grid-template-columns: 9.75rem minmax(0, 1fr);
        justify-content: stretch;
    }
    .vol-form-table td > textarea {
        grid-column: 2;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    .vol-form-table td > .btn-plus,
    .vol-form-table td.icao-field > .btn-plus,
    .vol-form-table td > .btn-tg-del,
    .vol-form-table td.icao-field > .btn-tg-del {
        position: static;
        transform: none;
        left: auto;
        top: auto;
        grid-column: 3;
        justify-self: start;
        flex-shrink: 0;
        margin-left: 0;
    }
    .vol-form-table td > .tg-label {
        grid-column: 1;
        min-width: 0;
    }
    .vol-form-table td:has(> button[type="submit"]) {
        display: block;
        padding-top: 10px;
    }
    .vol-form select,
    .vol-form textarea,
    .vol-form input[type="text"],
    .vol-form input[type="date"],
    .vol-form input[type="time"] {
        max-width: 100%;
        font-size: 16px;
    }
    .duree-fields,
    .duree-pairs,
    .duree-extras {
        flex-direction: column;
        align-items: flex-start;
    }
    .duree-fields label,
    .duree-route label,
    .duree-pairs label,
    .duree-extras label {
        white-space: normal;
    }
    .duree-panel input[type="text"],
    .duree-panel input[type="time"] {
        font-size: 16px;
    }
    form.auth input[type="text"],
    form.auth input[type="password"],
    form.auth input[type="email"],
    .menu-login input[type="text"],
    .menu-login input[type="password"],
    .liste-form input,
    .liste-form select,
    .param-form input,
    .param-form select,
    .param-form textarea,
    .init-form input,
    .init-form select {
        font-size: 16px;
        max-width: 100%;
    }

    .avion-grid {
        grid-template-columns: 1fr;
    }
    .avion {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 0;
    }
    .avion_photo {
        flex: 0 0 140px;
        min-width: 140px;
    }
    .avion_photo img {
        width: 140px;
        height: 105px;
        aspect-ratio: auto;
    }
    dialog.avion-dlg .carte-map {
        height: 260px;
    }

    .carte-map,
    .leaflet-container {
        height: 260px !important;
    }
    .leaflet-control-attribution {
        font-size: 10px;
        max-width: 58%;
        padding: 0 4px !important;
        box-sizing: border-box !important;
    }
    .region-list {
        grid-template-columns: 1fr;
    }
    .carte-tools {
        position: static;
        margin: 0 0 8px;
    }
    .stat-chart-wrap {
        height: 240px;
        padding: 4px;
    }
    .stat-chart-wrap.chart-pie {
        height: 200px;
    }
    .stat-mois-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    .stat-mois-nav h1,
    .stat-mois-nav h3 {
        flex: 1 1 100%;
        order: -1;
        font-size: 1.2rem;
    }
    #principal .stat-mois-sub {
        font-size: 1.2rem;
    }

    .format-toggle {
        position: static;
        text-align: right;
        margin: 8px 0;
    }
    .carnet-nav {
        flex-wrap: wrap;
        gap: 8px;
        margin: 4px 0 10px;
    }
    .kml-export {
        float: none;
        display: block;
        margin: 0 0 8px;
    }
    .table_liste {
        font-size: 13px;
    }
    .table_liste .acts {
        white-space: nowrap;
    }

    #pied {
        padding: 8px 8px 12px;
        font-size: 13px;
    }

    body.has-mobile-bar {
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    }
    body.has-mobile-bar #menu_pied {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2000;
        align-items: stretch;
        justify-content: space-around;
        height: calc(56px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: linear-gradient(#999, #666);
        border-top: 2px solid #555;
        box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.35);
    }
    #menu_pied a {
        flex: 1;
        color: #111;
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .menu_pied_bouton {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1px;
        min-width: 50px;
        padding: 4px 0 0;
    }
    .menu_pied_bouton .icon {
        width: 22px;
        height: 22px;
        color: #111;
    }
    .menu_pied_txt {
        font-size: 11px;
        color: #111;
        line-height: 1.1;
    }
}

/* ==========================================================================
   Print
   No @page size: Safari ignores landscape hints. JS in carnet-print.js
   scales the table only when it is actually wider than the sheet.
   ========================================================================== */

@page {
    margin: 8mm;
}
@media print {
    html,
    body {
        background: #fff !important;
        color: #000 !important;
    }
    #sky,
    #entete,
    #menu,
    .nav-toolbar,
    .nav-toggle,
    #pied,
    #menu_pied,
    .format-toggle,
    #ret_menu,
    .menu-backdrop,
    #cdv > .hint,
    dialog.vol-dlg,
    dialog.lightbox,
    dialog.share-dlg {
        display: none !important;
    }
    body.has-mobile-bar {
        padding-bottom: 0 !important;
    }
    #global,
    #central,
    #principal,
    #cdv,
    body.layout-carnet #global {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        box-shadow: none !important;
        border: 0 !important;
        border-radius: 0 !important;
        overflow: visible !important;
        float: none !important;
    }
    .carnet-scroll {
        overflow: visible !important;
        width: 100% !important;
        margin: 0 !important;
    }
    #cdv h2 {
        margin: 0 0 6px;
        font-size: 12pt;
    }
    .vol_table {
        min-width: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        font-size: 8pt !important;
    }
    .vol_table th,
    .vol_table td {
        padding: 1px 2px !important;
    }
}
