/* =========================================================
   Aéroclub — feuille de style
   Direction : app mobile compacte, flat design, grands rayons,
   barre d'onglets flottante. Pas d'effets de survol (mobile first).
   ========================================================= */

:root {
    --bg: #F3F4F7;
    --surface: #FFFFFF;
    --surface-2: #F8F9FB;
    --border: #E5E7EC;
    --text: #1A1D22;
    --text-muted: #6B7280;

    --primary: #1B75FA;
    --primary-dark: #002053;
    --primary-tint: #E9F1FE;

    --red: #DC161A;
    --red-tint: #FCEAEA;
    --red-border: #F5C6C7;

    --safe: #1E8E5A;
    --safe-tint: #E7F5EE;

    --amber: #B9750E;
    --amber-tint: #FBF0DD;
    --pastel-blue: #DCEAFE;

    --radius: 20px;
    --radius-sm: 14px;
    --shadow: 0 4px 18px rgba(20, 24, 31, 0.07);

    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

    --app-max: 560px;
    --tabbar-h: 60px;
    --tabbar-gap: 14px;
}

[data-theme="dark"] {
    --bg: #14171C;
    --surface: #1E222A;
    --surface-2: #262B34;
    --border: #333944;
    --text: #EDEFF2;
    --text-muted: #9AA1AC;

    --primary: #4C93FA;
    --primary-dark: #0C2C4C;
    --primary-tint: rgba(76, 147, 250, 0.16);

    --red: #FF7A7D;
    --red-tint: rgba(220, 22, 26, 0.2);
    --red-border: rgba(255, 122, 125, 0.35);

    --safe: #34C77E;
    --safe-tint: rgba(52, 199, 126, 0.16);

    --amber: #E3A83B;
    --amber-tint: rgba(227, 168, 59, 0.16);
    --pastel-blue: rgba(76, 147, 250, 0.14);

    --shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.45;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1 0 auto; display: flex; flex-direction: column; }
body.admin-body { display: block; min-height: 0; padding-bottom: 0; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
img { max-width: 100%; display: block; }
svg { width: 22px; height: 22px; }

h1, h2, h3, h4 {
    font-weight: 750;
    line-height: 1.2;
    margin: 0 0 0.45em;
    color: var(--text);
    letter-spacing: -0.01em;
}
h1 { font-size: 1.4rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: 0.96rem; }
p { margin: 0 0 0.9em; }
.muted { color: var(--text-muted); }

.container { max-width: var(--app-max); margin: 0 auto; padding: 0 16px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-loose { gap: 18px; }

/* ---------- Top bar ---------- */

.site-header {
    position: sticky; top: 0; z-index: 30;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.site-header .header-grid { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; height: 54px; gap: 8px; }
.back-btn {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: var(--radius-sm);
    border: none; background: var(--primary-tint); color: var(--primary);
    display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.back-btn svg { width: 20px; height: 20px; stroke-width: 2.2; }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.site-header .brand { justify-content: center; }
.brand-mark-logo { width: 30px; height: auto; flex-shrink: 0; }
.brand-text .name { display: block; font-weight: 750; font-size: 0.92rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Bottom tab bar : barre flottante ---------- */

.tab-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; justify-content: center;
    pointer-events: none;
}
.tab-bar .tab-inner {
    width: 100%; display: flex; justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 -4px 24px rgba(20, 24, 31, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    pointer-events: auto;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab-bar .tab-row { display: flex; width: 100%; max-width: var(--app-max); }
[data-theme="dark"] .tab-bar .tab-inner {
    background: rgba(20, 23, 28, 0.72);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.tab-bar a {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 9px 4px; color: var(--text-muted); font-size: 0.66rem; font-weight: 700;
    height: var(--tabbar-h);
}
.tab-bar a:hover { text-decoration: none; }
.tab-bar a svg { width: 21px; height: 21px; stroke-width: 1.8; }
.tab-bar a.active {
    color: var(--primary);
    position: relative;
}
.tab-bar a.active::before {
    content: ''; position: absolute; inset: 6px 4px; border-radius: 999px;
    background: rgba(27, 117, 250, 0.14); z-index: -1;
}

/* ---------- Sections ---------- */

.section { padding: 16px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-head h2 { margin: 0; display: flex; align-items: center; gap: 6px; }
.section-head a { font-size: 0.82rem; font-weight: 700; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 0.88rem;
    border: none; background: var(--surface-2); color: var(--text); cursor: pointer;
    min-height: 42px;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); }
.btn-outline-primary { background: var(--surface); color: var(--primary); border: 1.5px solid var(--primary); }
.btn-danger { color: var(--red); background: var(--red-tint); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; min-height: 34px; }
.btn-block { width: 100%; }

/* ---------- Quick tiles (main icon menu) ---------- */

.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile-grid.wide { grid-template-columns: repeat(2, 1fr); }
.tile-flex { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tile-flex .tile { flex: 1 1 140px; max-width: calc(50% - 5px); }
.tile {
    background: var(--surface); border-radius: var(--radius);
    padding: 18px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    text-align: center; color: var(--text); font-weight: 700; font-size: 0.78rem;
    box-shadow: var(--shadow); height: 140px;
}
.tile .tile-label { display: flex; align-items: center; justify-content: center; line-height: 1.25; }
.tile:hover { text-decoration: none; }
.tile .tile-icon {
    width: 42px; height: 42px; border-radius: var(--radius-sm);
    background: var(--primary-tint); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
}
.tile.emphasis { background: var(--primary-dark); color: #fff; }
.tile.emphasis .tile-icon { background: rgba(255,255,255,0.16); color: #fff; }

.tile-banner {
    display: flex; align-items: center; gap: 12px; margin-top: 14px;
    background: var(--surface); border-radius: var(--radius);
    padding: 12px 14px; color: var(--text); box-shadow: var(--shadow);
}
.tile-banner:hover { text-decoration: none; }
.tile-banner .tile-icon { width: 40px; height: 40px; flex-shrink: 0; }
.tile-banner .li-chevron { margin-left: auto; color: var(--text-muted); }
.tile-banner .li-chevron svg { width: 16px; height: 16px; }

/* Secondary "Plus" list */
.list-menu { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list-menu li + li { border-top: 1px solid var(--border); }
.list-menu a { display: flex; align-items: center; gap: 12px; padding: 13px 14px; color: var(--text); font-weight: 600; font-size: 0.92rem; }
.list-menu a:hover { text-decoration: none; }
.li-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--primary-tint); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.li-icon svg { width: 17px; height: 17px; }
.li-label { flex: 1 1 auto; min-width: 0; }
.list-menu .li-count {
    flex-shrink: 0; font-size: 0.76rem; font-weight: 700; color: var(--text-muted);
    background: var(--surface-2); border-radius: 999px; padding: 2px 8px; line-height: 1.5;
}
.li-chevron { margin-left: auto; color: var(--text-muted); flex-shrink: 0; display: flex; align-items: center; }
.li-chevron svg { width: 16px; height: 16px; }

.policy-banner {
    display: flex; align-items: center; gap: 12px;
    background: var(--primary-dark); color: #fff; border-radius: var(--radius);
    padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.policy-banner:hover { text-decoration: none; }
.policy-banner .li-icon { background: rgba(255,255,255,0.16); color: #fff; }
.policy-banner .li-chevron { color: rgba(255,255,255,0.7); }

/* ---------- Calculateur masse et centrage ---------- */

.mb-tool { display: flex; flex-direction: column; gap: 18px; }
.mb-inputs { display: flex; flex-direction: column; gap: 12px; }
.mb-row label { margin-bottom: 6px; font-size: 0.86rem; }
.mb-row input { margin-bottom: 0; }
.mb-input-unit { display: flex; align-items: center; gap: 8px; }
.mb-unit-suffix {
    flex-shrink: 0; color: var(--text); background: var(--surface); border: 1px solid var(--border);
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
    padding: 3px 9px; border-radius: 999px; white-space: nowrap; pointer-events: none;
}
.mb-row-max { color: var(--text-muted); }
.mb-station-input.over { border-color: var(--red); }
.mb-station-input.over ~ .mb-unit-suffix { color: var(--red); border-color: var(--red); }
.mb-result { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px; }
.mb-result-row { display: flex; align-items: baseline; justify-content: space-between; font-size: 0.9rem; }
.mb-result-row strong { font-size: 1.15rem; }
.mb-bar-wrap { margin-top: 6px; }
.mb-bar { height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; }
.mb-bar-fill { height: 100%; background: var(--safe); border-radius: 999px; width: 0%; }
.mb-bar-fill.over { background: var(--red); }
.mb-envelope { margin-top: 6px; }
.mb-envelope-track { position: relative; height: 10px; background: var(--safe-tint); border-radius: 999px; }
.mb-envelope-marker {
    position: absolute; top: -4px; left: 50%; width: 4px; height: 18px; border-radius: 999px;
    background: var(--primary-dark); transform: translateX(-50%);
}
.mb-envelope-marker.over { background: var(--red); }
.mb-envelope-labels { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.mb-status { margin-top: 14px; font-weight: 700; font-size: 0.9rem; padding: 10px 12px; border-radius: var(--radius-sm); }
.mb-status.ok { background: var(--safe-tint); color: var(--safe); }
.mb-status.warn { background: var(--red-tint); color: var(--red); }

.perf-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.perf-result-card { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.perf-result-card strong { display: block; font-size: 1.3rem; margin: 4px 0 2px; color: var(--primary); }

/* ---------- Aperçu PDF / image en overlay ---------- */

.file-viewer-overlay {
    display: none; position: fixed; inset: 0; z-index: 100;
    background: rgba(10, 12, 15, 0.92); flex-direction: column;
}
.file-viewer-overlay.open { display: flex; }
.file-viewer-bar {
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
    padding: 12px 14px; padding-top: calc(12px + env(safe-area-inset-top, 0px));
    flex-shrink: 0;
}
.file-viewer-download {
    color: #fff; font-weight: 700; font-size: 0.84rem; background: rgba(255,255,255,0.14);
    padding: 8px 14px; border-radius: 999px;
}
.file-viewer-download:hover { text-decoration: none; }
.file-viewer-close {
    width: 38px; height: 38px; border-radius: 50%; border: none; background: rgba(255,255,255,0.14);
    color: #fff; font-size: 1.1rem; cursor: pointer; flex-shrink: 0;
}
.file-viewer-body { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 0 10px 10px; min-height: 0; }
.file-viewer-body embed { width: 100%; height: 100%; border: none; background: #fff; border-radius: 10px; }
.file-viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }

/* ---------- Weather / NOTAM / Consignes (accueil) ---------- */

.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-head h3, .card-head h2 { margin: 0; }
.card-head-icon { font-size: 1.15rem; line-height: 1; width: 22px; text-align: center; flex-shrink: 0; }

.weather-card { background: var(--pastel-blue); }
.checkwx-embed { font-size: 0.92rem; }
.checkwx-embed p { margin: 0 0 0.4em; }
.checkwx-embed p:last-child { margin-bottom: 0; }
.checkwx-embed [data-type] {
    background: var(--surface); border-radius: var(--radius-sm);
    padding: 20px 14px 10px; margin-bottom: 4px; position: relative;
}
.checkwx-embed [data-type]:last-child { margin-bottom: 0; }
.checkwx-embed [data-type]::before {
    content: attr(data-type); position: absolute; top: 8px; left: 14px;
    font-size: 0.64rem; font-weight: 800; letter-spacing: 0.08em; color: var(--primary); text-transform: uppercase;
}
.atis-line {
    display: flex; align-items: baseline; justify-content: flex-start; gap: 8px;
    margin-top: 10px; padding: 10px 14px 0; border-top: 1px solid rgba(27, 117, 250, 0.15);
    font-size: 0.8rem; color: var(--text-muted);
}
.atis-line a { color: var(--text); text-decoration: underline; }
.mini-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 700; margin-bottom: 4px; }
.notam-card { background: var(--amber-tint); }

.consignes-card { background: var(--red-tint); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.see-more-btn {
    display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 10px; margin-left: auto; width: fit-content;
    background: var(--surface); color: var(--red); font-weight: 700; font-size: 0.82rem;
    padding: 8px 14px; border-radius: 999px; box-shadow: var(--shadow);
}
.see-more-btn:hover { text-decoration: none; }
.see-more-btn svg { width: 15px; height: 15px; }

/* ---------- Post row lists (Sécurité sous-pages, listes évolutives) ---------- */

.b-images { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.b-images img { width: 100%; height: auto; border-radius: var(--radius-sm); display: block; }
.p-file { margin-top: 8px; }

.post-row-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.post-row {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface); border-radius: var(--radius); padding: 12px 14px;
    box-shadow: var(--shadow); color: var(--text);
}
.post-row:hover { text-decoration: none; }
.post-row .post-row-icon { width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--red-tint); color: var(--red); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.post-row .post-row-icon.post-row-icon-doc { background: var(--primary-tint); color: var(--primary); }
.post-row .post-row-icon svg { width: 17px; height: 17px; }
.post-row .post-row-main { flex: 1 1 auto; min-width: 0; }
.post-row .post-row-title { font-weight: 700; font-size: 0.92rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-row .post-row-date { color: var(--text-muted); font-size: 0.76rem; }
.post-row .li-chevron { flex-shrink: 0; color: var(--text-muted); }
.post-row .li-chevron svg { width: 16px; height: 16px; }

.post-detail { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.post-detail .post-detail-date { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 6px; }
.post-detail h1 { margin-bottom: 12px; }

/* ---------- Links grid ---------- */

.links-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.links-grid a { background: var(--primary-tint); padding: 9px 14px; border-radius: 999px; font-weight: 700; font-size: 0.84rem; color: var(--primary); }
.links-grid a:hover { text-decoration: none; }

/* ---------- Photos / QR ---------- */

.photo-block { display: flex; gap: 14px; align-items: flex-start; flex-wrap: nowrap; }
.qr-box { background: #fff; border-radius: var(--radius-sm); padding: 8px; width: 88px; flex-shrink: 0; box-shadow: var(--shadow); }
.photo-block .photo-text { min-width: 0; }

/* ---------- PWA install guide ---------- */

.install-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.theme-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-tabs button { display: inline-flex; align-items: center; gap: 5px; padding: 8px 14px; border-radius: 999px; border: none; background: var(--surface-2); font-weight: 700; cursor: pointer; font-size: 0.82rem; color: var(--text); }
.theme-tabs button svg { width: 15px; height: 15px; }
.theme-tabs button.active { background: var(--primary); color: #fff; }
.install-tabs button { padding: 7px 14px; border-radius: 999px; border: none; background: var(--surface-2); color: var(--text); font-weight: 700; cursor: pointer; font-size: 0.82rem; }
.install-tabs button.active { background: var(--primary); color: #fff; }
.install-steps { display: none; flex-direction: column; gap: 8px; }
.install-steps.active { display: flex; }
.install-step { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; box-shadow: var(--shadow); }
.install-step .step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--primary-tint); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.8rem; flex-shrink: 0; }
.install-step p { margin: 0; font-size: 0.86rem; }

/* ---------- Checklists (compact, checkable, no overflow) ---------- */

.category-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.category-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-weight: 700; font-size: 0.8rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.category-pill.normal .dot { background: var(--safe); }
.category-pill.emergency .dot { background: var(--red); }

.checklist-card {
    display: block; background: var(--surface); border-radius: var(--radius);
    padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.checklist-card summary { list-style: none; cursor: pointer; }
.checklist-card > summary::-webkit-details-marker { display: none; }
.checklist-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.checklist-summary .cl-summary-main { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.cl-badge {
    width: 26px; height: 26px; border-radius: var(--radius-sm); flex-shrink: 0;
    background: var(--safe-tint); color: var(--safe);
    display: flex; align-items: center; justify-content: center;
}
.checklist-card.emergency .cl-badge { background: var(--red-tint); color: var(--red); }
.cl-badge svg { width: 14px; height: 14px; }
.checklist-card h2 { margin: 0; font-size: 1rem; }
.cl-count { font-size: 0.74rem; font-weight: 700; color: var(--text-muted); background: var(--surface-2); padding: 2px 8px; border-radius: 999px; flex-shrink: 0; }
.checklist-card .chev { color: var(--text-muted); flex-shrink: 0; transition: none; }
.checklist-card .chev svg { width: 18px; height: 18px; }
.checklist-card[open] > summary .chev { transform: rotate(90deg); }
.checklist-body { margin-top: 12px; }

.checklist-progress { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.checklist-progress .bar { flex: 1; height: 5px; background: var(--border); border-radius: 999px; overflow: hidden; }
.checklist-progress .bar > span { display: block; height: 100%; background: var(--safe); width: 0%; }

/* Sections repliables à l'intérieur d'une checklist */
.section-group { background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 8px; overflow: hidden; }
.section-group summary::-webkit-details-marker { display: none; }
.section-summary {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 12px; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-muted);
}
.section-summary .chev { flex-shrink: 0; color: var(--text-muted); }
.section-summary .chev svg { width: 15px; height: 15px; }
.section-group[open] .section-summary .chev { transform: rotate(90deg); }
.section-body { padding: 0 12px 8px; }
.section-reset { margin: 0 0 10px; font-size: 0.76rem; }
.section-group .checklist-items { padding: 0; }

.checklist-items { list-style: none; margin: 0; padding: 0; }
.checklist-item { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--border); min-height: 44px; }
.checklist-item:last-child { border-bottom: none; }
.checklist-item input[type=checkbox] {
    appearance: none; -webkit-appearance: none; flex-shrink: 0;
    width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--border);
    background: var(--surface); cursor: pointer; margin-top: 1px; position: relative;
}
.checklist-item input[type=checkbox]:checked { background: var(--safe); border-color: var(--safe); }
.checklist-item input[type=checkbox]:checked::after {
    content: ''; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.checklist-item .item-text { flex: 1 1 auto; min-width: 0; }
.checklist-item .item-action { font-weight: 600; font-size: 0.92rem; word-wrap: break-word; }
.checklist-item .item-response { display: inline-block; margin-top: 4px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--primary); background: var(--surface-2); padding: 2px 8px; border-radius: 999px; }
.checklist-item.is-checked .item-action { text-decoration: line-through; color: var(--text-muted); }
.checklist-item.is-checked .item-response { opacity: 0.6; }
.checklist-reset { margin: 10px 0 0; }

@media print {
    .site-header, .tab-bar, .no-print, .checklist-reset { display: none !important; }
    body { padding-bottom: 0; }
    .checklist-card { box-shadow: none; border: 1px solid #000; break-inside: avoid; }
    /* Un dépliant fermé n'imprime rien par défaut : on force tout à s'afficher. */
    details:not([open]) > *:not(summary) { display: block !important; }
    .checklist-card summary .chev, .section-summary .chev { display: none !important; }
}

/* ---------- Aircraft cards (une par ligne) ---------- */

.aircraft-list { display: flex; flex-direction: column; gap: 10px; }
.aircraft-row {
    display: flex; align-items: center; gap: 14px;
    background: var(--surface); border-radius: var(--radius);
    padding: 12px 14px; box-shadow: var(--shadow); color: var(--text);
}
.aircraft-row:hover { text-decoration: none; }
.aircraft-row .thumb { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; object-position: center; background: var(--surface-2); flex-shrink: 0; }
.aircraft-row .thumb-placeholder { width: 64px; height: 64px; border-radius: var(--radius-sm); background: var(--primary-tint); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.aircraft-row .thumb-placeholder svg { width: 26px; height: 26px; }
.aircraft-row .info { flex: 1 1 auto; min-width: 0; }
.aircraft-row .tag { font-size: 0.66rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--primary); font-weight: 700; }
.aircraft-row h3 { margin: 1px 0; }
.aircraft-row .li-chevron { color: var(--text-muted); flex-shrink: 0; }
.aircraft-row .li-chevron svg { width: 18px; height: 18px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }

.card {
    background: var(--surface); border-radius: var(--radius);
    padding: 14px; display: flex; flex-direction: column; gap: 4px; position: relative;
    box-shadow: var(--shadow);
}
.card .tag { align-self: flex-start; font-size: 0.66rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--primary); font-weight: 700; background: var(--primary-tint); padding: 3px 8px; border-radius: 999px; }
.card .thumb { width: 100%; height: 100px; object-fit: cover; object-position: center; border-radius: var(--radius-sm); margin-bottom: 6px; background: var(--surface-2); }
.card-link { position: absolute; inset: 0; }

.empty-state { border-radius: var(--radius); padding: 24px; text-align: center; color: var(--text-muted); background: var(--surface); font-size: 0.9rem; }

/* ---------- Documents ---------- */

.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: var(--radius); margin-bottom: 8px; box-shadow: var(--shadow); }
.doc-icon { flex: 0 0 auto; width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--primary-tint); display: flex; align-items: center; justify-content: center; color: var(--primary); font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700; }
.doc-meta { flex: 1 1 auto; min-width: 0; }
.doc-meta .doc-title { font-weight: 700; font-size: 0.9rem; }
.doc-meta .doc-sub { color: var(--text-muted); font-size: 0.76rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.filter-row a { padding: 6px 12px; border-radius: 999px; color: var(--text-muted); font-size: 0.78rem; font-weight: 700; background: var(--surface-2); }
.filter-row a.active { background: var(--primary); color: #fff; }
.filter-row a:hover { text-decoration: none; }

/* ---------- Forms ---------- */

label { display: block; font-weight: 700; margin-bottom: 5px; font-size: 0.85rem; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=file], input[type=date],
select, textarea {
    width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
    border-radius: var(--radius-sm); padding: 10px 12px; font-family: inherit; font-size: 0.92rem; margin-bottom: 14px;
}
/* iOS Safari zooms the page on focus when an input's font-size is below 16px */
@media (max-width: 768px) {
    input[type=text], input[type=password], input[type=email], input[type=number], input[type=file], input[type=date],
    select, textarea {
        font-size: 16px;
    }
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.helper { color: var(--text-muted); font-size: 0.78rem; margin-top: -8px; margin-bottom: 14px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.checkbox-row input { width: auto; margin: 0; }
.checkbox-row label { margin: 0; font-weight: 500; }

.alert { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.88rem; }
.alert-success { background: var(--safe-tint); color: var(--safe); }
.alert-error { background: var(--red-tint); color: var(--red); }

table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 0.86rem; }
th { color: var(--text-muted); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); padding: 4px 12px; box-shadow: var(--shadow); }

.repeatable-row { display: grid; grid-template-columns: 1.4fr 1.4fr 1fr auto; gap: 8px; align-items: start; margin-bottom: 8px; }
@media (max-width: 640px) { .repeatable-row { grid-template-columns: 1fr; } }

/* ---------- Login / gate ---------- */

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.login-card { background: var(--surface); border-radius: var(--radius); padding: 28px; width: 100%; max-width: 360px; box-shadow: var(--shadow); }
.login-logo { width: 100%; max-width: 260px; height: auto; margin: 0 auto 20px; }

/* ---------- Footer ---------- */

.site-footer { flex-shrink: 0; padding: 18px 0 20px; color: var(--text-muted); font-size: 0.76rem; }
.site-footer a { color: var(--text-muted); font-weight: 700; }
.footer-badge { display: block; font-weight: 700; color: var(--text); margin-bottom: 8px; font-size: 0.82rem; }
.social-links { display: flex; gap: 8px; margin-bottom: 10px; }
.social-links a { width: 30px; height: 30px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; color: var(--text); }
.social-links a:hover { text-decoration: none; }
.social-links a svg { width: 15px; height: 15px; }
.footer-lines { display: flex; flex-direction: column; gap: 3px; }
.footer-spacer { height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 14px); flex-shrink: 0; }

/* ---------- Admin (desktop-friendly back office) ---------- */

.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; flex: 0 0 auto; background: var(--primary-dark); padding: 18px 12px; color: #fff; }
.admin-sidebar .brand-text .name { color: #fff; }
.admin-sidebar .brand { margin-bottom: 20px; }
.admin-sidebar nav a { display: block; padding: 9px 11px; border-radius: var(--radius-sm); color: rgba(255,255,255,0.78); font-weight: 600; font-size: 0.86rem; margin-bottom: 2px; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: rgba(255,255,255,0.14); color: #fff; text-decoration: none; }
.admin-logo-chip { width: 30px; height: 30px; border-radius: var(--radius-sm); background: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 4px; }
.admin-logo-chip img { width: 100%; height: 100%; object-fit: contain; }
.admin-main { flex: 1 1 auto; padding: 26px; max-width: 900px; }
@media (max-width: 780px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
    .admin-sidebar nav { display: flex; gap: 3px; overflow-x: auto; }
    .admin-main { padding: 16px; }
}
.actions-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.admin-back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 0.86rem; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; }
.admin-back-link:hover { color: var(--primary); text-decoration: none; }
.inline-form { display: inline; }

.rich-content p { margin: 0 0 0.9em; }
.rich-content ul, .rich-content ol { margin: 0 0 0.9em; padding-left: 22px; }
.rich-content a { color: var(--primary); font-weight: 600; }
.rich-content h2, .rich-content h3 { margin-top: 0.9em; }
.rich-content h2:first-child, .rich-content h3:first-child { margin-top: 0; }

/* Admin : sections repliables pour la page "Contenu du site" */
.admin-section { background: var(--surface); border-radius: var(--radius); margin-bottom: 14px; box-shadow: var(--shadow); overflow: hidden; }
.admin-section summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; font-weight: 750; }
.admin-section summary::-webkit-details-marker { display: none; }
.admin-section summary .chev svg { width: 18px; height: 18px; color: var(--text-muted); }
.admin-section[open] summary .chev { transform: rotate(90deg); }
.admin-section .admin-section-body { padding: 0 18px 18px; }

/* Éditeur riche (politique de sécurité, corps des posts) */
.rich-editor { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 14px; }
.rich-toolbar { display: flex; gap: 2px; padding: 6px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.rich-toolbar button {
    min-width: 30px; height: 30px; padding: 0 6px; border-radius: 7px; border: none; background: transparent;
    color: var(--text); font-weight: 700; font-size: 0.85rem; cursor: pointer;
}
.rich-toolbar button:hover { background: var(--border); }
.rich-color-input { width: 30px; height: 30px; padding: 2px; border: none; border-radius: 7px; background: transparent; cursor: pointer; margin-left: 2px; }
.rich-editable { min-height: 140px; padding: 12px 14px; font-size: 0.92rem; line-height: 1.5; outline: none; }
.rich-editable p { margin: 0 0 0.7em; }
.rich-editable ul, .rich-editable ol { margin: 0 0 0.7em; padding-left: 22px; }
.rich-editable a { color: var(--primary); }
.rich-editable h2, .rich-editable h3 { margin: 0.6em 0 0.4em; }
