:root {
    color-scheme: dark;
    --bg: #11151d;
    --panel: #1a202b;
    --panel-2: #222936;
    --border: #343e4d;
    --text: #f4f6fa;
    --muted: #9ca7b5;
    --accent: #5b8ee6;
    --accent-2: #77a7f6;
    --danger: #db6670;
    --success: #66c297;
    --radius: 22px;
    --radius-sm: 15px;
    --shadow: 0 14px 34px rgba(0,0,0,.22);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 0%, rgba(91,142,230,.10), transparent 32rem),
        var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select, input { min-height: 46px; }
.app-shell { width: min(100%, 980px); margin: 0 auto; padding: 0 14px 48px; }
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between;
    min-height: 70px; padding: env(safe-area-inset-top) 4px 0;
    background: rgba(17,21,29,.88); backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 760; letter-spacing: -.02em; }
.brand-mark {
    width: 34px; height: 34px; display: grid; place-items: center;
    border-radius: 50%; border: 1px solid var(--border);
    background: var(--panel-2); color: var(--accent-2); font-size: 22px;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-user {
    display: grid;
    justify-items: end;
    gap: 1px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.2;
}
.topbar-club {
    color: var(--accent-2);
    font-size: 12px;
    font-weight: 650;
}
.topbar-club-switch { margin: 0; }
.topbar-club-switch-mobile,
.topbar-club-mobile { display: none; }
.topbar-club-select {
    width: auto;
    max-width: 190px;
    min-height: 22px;
    height: 22px;
    padding: 0 22px 0 6px;
    border: 0;
    border-radius: 7px;
    background-color: transparent;
    color: var(--accent-2);
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}
.topbar-club-select:focus {
    border-color: transparent;
    box-shadow: 0 0 0 2px rgba(91,142,230,.2);
}
.nav-toggle {
    display: none; width: 42px; min-width: 42px; min-height: 42px; padding: 0;
    border-radius: 12px; border: 1px solid var(--border);
    background: var(--panel-2); color: white; cursor: pointer; font-size: 19px;
}
.nav {
    display: flex; gap: 7px; overflow-x: auto; padding: 4px 0 14px;
    scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
    flex: 0 0 auto; padding: 9px 13px; border-radius: 999px;
    color: var(--muted); border: 1px solid transparent; font-size: 14px;
}
.nav a.active { color: white; background: rgba(91,142,230,.18); border-color: rgba(91,142,230,.34); }
.content { display: grid; gap: 16px; }
.card {
    border: 1px solid var(--border); border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(34,41,54,.96), rgba(26,32,43,.96));
    box-shadow: var(--shadow); padding: 18px;
}
.card.compact { padding: 14px; }
.card h1, .card h2, .card h3 { margin: 0 0 12px; letter-spacing: -.03em; }
h1 { font-size: clamp(25px, 6vw, 38px); }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { color: var(--muted); line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.kicker { color: var(--accent-2); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.field { display: grid; gap: 7px; }
.field label { color: var(--muted); font-size: 13px; }
input, select, textarea {
    width: 100%; color: var(--text); background: rgba(11,15,22,.48);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 11px 13px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,142,230,.15); }
textarea { min-height: 92px; resize: vertical; }
.btn {
    display: inline-flex; justify-content: center; align-items: center; gap: 8px;
    min-height: 48px; padding: 11px 16px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--panel-2); color: white;
    font-weight: 700; cursor: pointer;
}
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: transparent; }
.btn.danger { color: #ffd8dc; border-color: rgba(219,102,112,.45); background: rgba(219,102,112,.10); }
.btn.ghost { background: transparent; }
.btn.small-btn { min-height: 38px; padding: 8px 11px; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.actions.stretch .btn { flex: 1; }
.flash { margin: 8px 0 0; padding: 11px 14px; border-radius: 13px; border: 1px solid var(--border); }
.flash.success { background: rgba(102,194,151,.12); border-color: rgba(102,194,151,.35); }
.flash.error { background: rgba(219,102,112,.12); border-color: rgba(219,102,112,.35); }
.flash.warning { background: rgba(230,158,91,.10); border-color: rgba(230,158,91,.35); }
.stat-row { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.stat {
    padding: 13px; border-radius: 16px; background: rgba(10,14,20,.30);
    border: 1px solid rgba(255,255,255,.06);
}
.stat strong { display: block; font-size: 24px; letter-spacing: -.03em; }
.stat span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.list { display: grid; gap: 9px; }
.list-item {
    display: flex; gap: 12px; align-items: center; justify-content: space-between;
    padding: 12px 13px; border-radius: 16px; border: 1px solid rgba(255,255,255,.07);
    background: rgba(9,13,18,.24);
}
.list-main { min-width: 0; }
.list-title { font-weight: 720; }
.list-meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.badge {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px;
    border-radius: 999px; font-size: 12px; border: 1px solid var(--border); color: var(--muted);
}
.badge.accent { color: #dceaff; border-color: rgba(91,142,230,.35); background: rgba(91,142,230,.12); }
.badge.warn { color: #ffd6a4; border-color: rgba(230,158,91,.35); background: rgba(230,158,91,.10); }
.tabs { display: flex; gap: 7px; overflow-x: auto; }
.tabs a { padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); }
.tabs a.active { background: rgba(91,142,230,.16); color: white; border-color: rgba(91,142,230,.34); }
.empty { text-align: center; padding: 28px 10px; color: var(--muted); }

.shooting-page .app-shell { width: min(100%, 760px); }
.shooting-shell { width: 100%; margin: 0 auto; display: grid; gap: 12px; padding-bottom: 120px; }
.shooting-header {
    display: flex; justify-content: space-between; align-items: start; gap: 12px;
}
.shooting-program { font-weight: 760; font-size: 18px; }
.shooting-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.shooting-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.score-card { text-align: center; padding: 18px; }
.big-score { font-size: clamp(58px, 18vw, 92px); line-height: .95; font-weight: 760; color: var(--accent-2); letter-spacing: -.06em; }
.score-label { color: var(--muted); margin-bottom: 9px; }
.shot-count { margin-top: 12px; color: var(--muted); }
.score-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.score-btn {
    position: relative; min-height: 104px; border-radius: 20px;
    border: 1px solid var(--border); color: white;
    background: linear-gradient(180deg, rgba(72,86,108,.56), rgba(37,45,59,.86));
    font-size: 42px; font-weight: 620; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.score-btn:active { transform: scale(.98); }
.score-btn.has-count { background: linear-gradient(180deg, rgba(105,158,239,.94), rgba(76,127,208,.94)); border-color: rgba(255,255,255,.14); }
.score-btn:disabled { opacity: .45; cursor: default; }
.score-count {
    position: absolute; left: 50%; bottom: 9px; transform: translateX(-50%);
    min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px;
    display: grid; place-items: center; font-size: 14px;
    background: rgba(255,255,255,.17); color: white;
}
.score-actions {
    display: grid; gap: 9px;
    position: sticky; bottom: calc(env(safe-area-inset-bottom) + 8px); z-index: 25;
    padding: 10px; border-radius: 18px;
    background: rgba(17,21,29,.92); backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 14px 32px rgba(0,0,0,.24);
}
.progress-line { height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 9px; }
.progress-line > span { display:block; height: 100%; background: var(--accent); border-radius: inherit; }
.series-strip { display:flex; gap:7px; overflow-x:auto; padding-bottom: 3px; }
.series-pill { flex:0 0 auto; min-width: 66px; padding:8px 10px; text-align:center; border-radius:12px; background:rgba(255,255,255,.05); color:var(--muted); font-size:12px; }
.series-pill strong { display:block; color:white; font-size:16px; }
.series-pill.current { outline:1px solid var(--accent); background:rgba(91,142,230,.12); }

.chart { display:flex; align-items:end; gap:7px; min-height:150px; padding:14px 4px 0; border-bottom:1px solid var(--border); }
.chart-col { flex:1; min-width:18px; display:grid; align-items:end; justify-items:center; gap:5px; height:140px; }
.chart-bar { width:100%; max-width:36px; min-height:3px; border-radius:8px 8px 2px 2px; background:linear-gradient(180deg, var(--accent-2), var(--accent)); }
.chart-label { font-size:11px; color:var(--muted); }
.chart-value { font-size:11px; color:var(--text); }

.step-editor { display:grid; gap:8px; }
.step-row {
    display:grid; grid-template-columns: 1.5fr .8fr .8fr .8fr auto; gap:7px; align-items:end;
    padding:10px; border:1px solid rgba(255,255,255,.07); border-radius:14px;
}
hr.sep { border:0; border-top:1px solid var(--border); margin:16px 0; }

.login-wrap { min-height: 100vh; display:grid; place-items:center; padding:20px; }
.login-card { width:min(100%,420px); }
.login-brand { display:flex; align-items:center; gap:12px; margin-bottom:18px; }
.login-brand .brand-mark { width:44px; height:44px; font-size:28px; }
.login-brand strong { font-size:22px; }
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; min-width:620px; }
th, td { text-align:left; padding:10px; border-bottom:1px solid rgba(255,255,255,.08); font-size:14px; }
th { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.04em; }

@media (min-width: 620px) {
    .score-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 760px) {
    .topbar { min-height: 62px; }
    .topbar-user { display: none; }
    .topbar-club-switch-mobile { display: block; }
    .topbar-club-mobile {
        display: block;
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .topbar-club-switch-mobile .topbar-club-select {
        max-width: 150px;
        min-height: 36px;
        height: 36px;
        padding: 0 26px 0 10px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background-color: var(--panel-2);
        font-size: 12px;
    }
    .nav-toggle { display: inline-grid; place-items: center; }
    .nav {
        display: grid; gap: 8px; overflow: visible; padding: 0; margin: 0 0 12px;
        background: rgba(20,25,34,.96); border: 1px solid var(--border); border-radius: 18px;
        box-shadow: var(--shadow); padding: 10px;
    }
    .nav[hidden] { display: none; }
    .nav a { width: 100%; text-align: left; border: 1px solid rgba(255,255,255,.06); border-radius: 13px; }
    .shooting-header { gap: 8px; }
    .shooting-program { font-size: 16px; }
    .shooting-sub { font-size: 12px; }
    .score-card { padding: 14px; }
    .big-score { font-size: clamp(46px, 14vw, 68px); }
    .shot-count { margin-top: 8px; }
    .score-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
    .score-btn { min-height: 84px; border-radius: 18px; font-size: 34px; }
    .score-count { height: 24px; min-width: 24px; font-size: 12px; bottom: 6px; }
    .score-actions { grid-template-columns: 1fr; }
    .score-actions .btn { min-height: 44px; }
}

@media (max-width: 680px) {
    .grid.two, .grid.three, .stat-row { grid-template-columns: 1fr; }
    .step-row { grid-template-columns: 1fr 1fr; }
    .step-row .wide { grid-column: 1 / -1; }
    .step-row .remove-step { grid-column: 1 / -1; }
    .card { padding: 15px; border-radius: 19px; }
    .shooting-shell { gap: 10px; }
    .shooting-page .content { gap: 10px; }
    .shooting-page .card.compact { padding: 12px; }
    .shooting-page .series-strip { gap: 6px; }
    .shooting-page .series-pill { min-width: 60px; padding: 7px 8px; }
}

/* Ajustements finaux mobile / préparation */
.grid > *, .field { min-width: 0; }

/* Espace visuel entre l'en-tête et le premier bloc, sans barre décorative. */
.content {
    padding-top: 14px;
}

.topbar {
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 14px;
    padding-right: 14px;
    background: #13223a;
}

/* Le texte d'introduction reste secondaire par rapport au formulaire. */
.session-intro {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.45;
}

/* Rangeur et distance sur la même ligne, date/heure dessous. */
.session-setup-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

/* Safari iOS peut imposer une largeur intrinsèque excessive au datetime-local. */
input[type="datetime-local"] {
    display: block;
    box-sizing: border-box;
    width: -webkit-fill-available;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-inline-size: 0;
    -webkit-appearance: none;
    appearance: none;
}

input[type="datetime-local"]::-webkit-date-and-time-value {
    min-width: 0;
    text-align: left;
}

@media (max-width: 760px) {
    .topbar {
        background: #13223a;
    }

    .content {
        padding-top: 12px;
    }

    .session-setup-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 12px;
    }

    .session-setup-grid .datetime-field {
        grid-column: 1 / -1;
        min-width: 0;
        overflow: hidden;
    }

    .session-intro {
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 14px;
    }
}

/* Détail séries / chargeurs */
.series-detail { align-items: flex-start; }
.magazine-list { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.magazine-result { display:inline-flex; align-items:center; gap:4px; padding:5px 8px; border-radius:10px; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.06); color:var(--muted); font-size:12px; }
.magazine-result strong { color:var(--text); }

@media (max-width: 760px) {
    .history-on-shooting { margin-bottom: 4px; }
    .shooting-page .shooting-meta { gap:6px; }
    .shooting-page .badge { font-size:11px; padding:4px 7px; }
}

/* =========================================================
   Mode tir compact - plein écran mobile
   ========================================================= */

.shooting-page .app-shell {
    width: min(100%, 760px);
    padding-bottom: 92px;
}

.shooting-page .content {
    padding-top: 8px;
    gap: 8px;
}

.shooting-page .topbar {
    min-height: 54px;
}

.shooting-page .brand {
    font-size: 16px;
}

.shooting-page .brand-mark {
    width: 30px;
    height: 30px;
    font-size: 19px;
}

.shooting-shell {
    gap: 8px;
    padding-bottom: 82px;
}

.shooting-context {
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(34,41,54,.94), rgba(26,32,43,.94));
    box-shadow: 0 8px 24px rgba(0,0,0,.16);
}

.shooting-header {
    align-items: center;
}

.shooting-header-main {
    min-width: 0;
    flex: 1;
}

.shooting-program {
    font-size: 17px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shooting-live-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
}

.shooting-live-meta span:not(:last-child)::after {
    content: " · ";
    color: #6f7c8f;
    padding: 0 3px;
}

.shooting-header-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
}

.series-badge {
    white-space: nowrap;
    font-size: 11px;
    padding: 5px 8px;
}

.shooting-menu {
    position: relative;
}

.shooting-menu summary {
    list-style: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(255,255,255,.04);
    color: var(--muted);
    cursor: pointer;
    font-weight: 800;
    letter-spacing: 1px;
    -webkit-tap-highlight-color: transparent;
}

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

.shooting-menu[open] summary {
    color: white;
    border-color: rgba(91,142,230,.5);
    background: rgba(91,142,230,.13);
}

.shooting-menu-panel {
    position: absolute;
    z-index: 80;
    right: 0;
    top: calc(100% + 8px);
    width: min(270px, calc(100vw - 42px));
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #18202d;
    box-shadow: 0 18px 42px rgba(0,0,0,.38);
}

.shooting-menu-info {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.shooting-finish-btn {
    width: 100%;
    min-height: 42px;
}

.shooting-score-card {
    padding: 11px 14px 12px;
}

.shooting-score-card .score-label {
    margin-bottom: 2px;
    font-size: 13px;
}

.shooting-score-card .big-score {
    font-size: clamp(48px, 13vw, 66px);
    line-height: .95;
}

.shooting-score-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

.shooting-score-meta strong {
    color: var(--text);
    font-weight: 700;
}

.meta-dot {
    color: #69768a;
}

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

.shooting-score-grid .score-btn {
    min-height: 86px;
    border-radius: 18px;
    font-size: 37px;
}

.shooting-score-grid .score-count {
    bottom: 5px;
    height: 23px;
    min-width: 23px;
    padding: 0 6px;
    font-size: 11px;
}

.shooting-actionbar {
    position: fixed;
    z-index: 70;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom) + 8px);
    transform: translateX(-50%);
    width: min(calc(100% - 28px), 732px);
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 17px;
    background: rgba(17,21,29,.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 14px 34px rgba(0,0,0,.34);
}

.shooting-actionbar .btn {
    min-height: 48px;
}

.shooting-undo-btn {
    width: 52px;
    padding: 0;
    font-size: 25px;
}

.shooting-next-btn {
    width: 100%;
    font-size: 16px;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: .38;
}

.shooting-next-btn:disabled {
    color: #9aa5b3;
    background: #343d4b;
    border-color: #465161;
    box-shadow: none;
}

/* L'historique détaillé n'est pas utile pendant la saisie du tir. */
.shooting-page .history-on-shooting {
    display: none;
}

@media (max-width: 760px) {
    .shooting-page .app-shell {
        padding-left: 10px;
        padding-right: 10px;
    }

    .shooting-page .topbar {
        margin-left: -10px;
        margin-right: -10px;
        padding-left: 12px;
        padding-right: 12px;
        min-height: 52px;
    }

    .shooting-page .content {
        padding-top: 7px;
    }

    .shooting-shell {
        gap: 7px;
    }

    .shooting-context {
        padding: 10px 11px;
        border-radius: 16px;
    }

    .shooting-program {
        font-size: 16px;
    }

    .shooting-live-meta {
        margin-top: 5px;
        font-size: 11px;
    }

    .shooting-score-card {
        padding: 9px 12px 10px;
        border-radius: 17px;
    }

    .shooting-score-card .big-score {
        font-size: clamp(46px, 12vw, 58px);
    }

    .shooting-score-grid .score-btn {
        min-height: 82px;
        font-size: 35px;
    }
}

@media (max-width: 390px) {
    .shooting-program {
        max-width: 190px;
    }

    .series-badge {
        padding-left: 6px;
        padding-right: 6px;
    }

    .shooting-score-grid .score-btn {
        min-height: 78px;
    }
}

@media (max-height: 740px) and (max-width: 760px) {
    .shooting-page .topbar {
        min-height: 48px;
    }

    .shooting-context {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .shooting-score-card {
        padding-top: 7px;
        padding-bottom: 8px;
    }

    .shooting-score-grid .score-btn {
        min-height: 72px;
    }
}

/* =========================================================
   Déroulement minimal du programme pendant le tir
   ========================================================= */
.shooting-program-strip {
    display: flex;
    align-items: stretch;
    gap: 6px;
    min-width: 0;
}

.program-strip-step {
    flex: 0 0 42px;
    min-width: 0;
    min-height: 52px;
    padding: 6px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 13px;
    background: rgba(255,255,255,.025);
    color: #6f7b8b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.program-strip-step.current {
    flex: 1 1 auto;
    justify-content: flex-start;
    padding: 7px 10px;
    border-color: rgba(91,142,230,.58);
    background: rgba(91,142,230,.12);
    color: var(--text);
}

.program-strip-step.done {
    color: #8f9cac;
    background: rgba(255,255,255,.035);
}

.program-strip-step.interrupted {
    border-color: rgba(219,102,112,.35);
}

.program-strip-number {
    flex: 0 0 auto;
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
}

.program-strip-step.current .program-strip-number {
    border-color: rgba(91,142,230,.62);
    background: rgba(91,142,230,.22);
    color: #dce9ff;
}

.program-strip-step.done .program-strip-number {
    color: var(--success);
}

.program-strip-current {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.program-strip-current-text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.program-strip-current-text strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.15;
}

.program-strip-current-text > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.15;
}

.program-strip-current-text b {
    color: var(--accent-2);
    font-weight: 750;
}

.program-strip-time {
    font-size: 9px;
    line-height: 1;
    color: #667283;
}

.program-strip-step.done .program-strip-time {
    display: none;
}

@media (max-width: 420px) {
    .shooting-program-strip {
        gap: 5px;
    }

    .program-strip-step {
        flex-basis: 38px;
        min-height: 48px;
        padding: 5px;
    }

    .program-strip-step.current {
        padding: 6px 8px;
    }

    .program-strip-number {
        width: 23px;
        height: 23px;
        font-size: 10px;
    }

    .program-strip-current {
        gap: 6px;
    }

    .program-strip-current-text strong {
        font-size: 11.5px;
    }

    .program-strip-current-text > span {
        font-size: 10px;
    }

    .program-strip-time {
        font-size: 8.5px;
    }
}

@media (max-width: 350px) {
    .program-strip-step {
        flex-basis: 34px;
    }

    .program-strip-time {
        display: none;
    }
}

/* Mes listes : navigation compacte sur mobile */
.library-nav-mobile {
    display: none;
}

.library-nav-desktop {
    max-width: 100%;
}

@media (max-width: 760px) {
    .library-header {
        overflow: hidden;
    }

    .library-header p {
        margin-bottom: 14px;
    }

    .library-nav-desktop {
        display: none;
    }

    .library-nav-mobile {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        width: 100%;
        min-width: 0;
    }

    .library-nav-mobile label {
        color: var(--muted);
        font-size: 13px;
        white-space: nowrap;
    }

    .library-nav-mobile select {
        min-width: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
}

/* Historique : suppression volontairement discrète d'une session */
.session-delete-action {
    display: flex;
    justify-content: flex-end;
    padding: 2px 4px 8px;
}

.session-delete-btn {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 650;
    opacity: .72;
}

.session-delete-btn:hover,
.session-delete-btn:focus-visible {
    opacity: 1;
}

/* =========================================================
   Mes listes : modification / suppression / archivage
   ========================================================= */
.library-edit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.library-edit-head h2 {
    margin: 0;
}

.library-list-item {
    align-items: flex-start;
}

.library-item-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
}

.library-item-actions form {
    margin: 0;
}

.library-secondary-action {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.07);
}

.program-readonly-list {
    display: grid;
    gap: 7px;
}

@media (max-width: 680px) {
    .library-list-item {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .library-item-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .library-item-actions .btn {
        min-height: 40px;
    }
}

/* V3-BETA — inventaire des munitions */
.inventory-title-row {
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:18px;
}
.inventory-title-row h1 { margin-bottom:8px; }
.inventory-title-row p { margin:0; max-width:640px; }
.inventory-total {
    flex:0 0 auto;
    min-width:150px;
    text-align:right;
    padding:12px 14px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:16px;
    background:rgba(9,13,18,.24);
}
.inventory-total strong { display:block; font-size:30px; line-height:1; }
.inventory-total span { display:block; color:var(--muted); font-size:12px; margin-top:5px; }
.inventory-ammo-grid {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
    gap:10px;
}
.inventory-ammo-card {
    min-width:0;
    padding:14px;
    border-radius:18px;
    border:1px solid var(--border);
    background:linear-gradient(180deg, rgba(34,41,54,.92), rgba(26,32,43,.92));
    box-shadow:var(--shadow);
}
.inventory-ammo-card.active {
    border-color:rgba(91,142,230,.72);
    box-shadow:0 0 0 2px rgba(91,142,230,.13), var(--shadow);
}
.inventory-ammo-name { font-weight:760; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.inventory-ammo-meta { color:var(--muted); font-size:12px; margin-top:3px; min-height:15px; }
.inventory-stock { display:block; font-size:34px; line-height:1; margin-top:14px; letter-spacing:-.04em; }
.inventory-ammo-card > span { display:block; color:var(--muted); font-size:12px; margin-top:4px; }
.inventory-stock.negative,
.inventory-current-stock.negative strong,
.inventory-change.negative { color:#ff9aa3; }
.inventory-selected-head {
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:14px;
    margin-bottom:16px;
}
.inventory-selected-head h2 { margin-bottom:4px; }
.inventory-current-stock { text-align:right; flex:0 0 auto; }
.inventory-current-stock strong { display:block; font-size:38px; line-height:1; letter-spacing:-.04em; }
.inventory-current-stock span { display:block; color:var(--muted); font-size:12px; margin-top:5px; }
.inventory-forms { align-items:start; }
.inventory-form-box {
    display:grid;
    gap:10px;
    padding:14px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:17px;
    background:rgba(9,13,18,.22);
}
.inventory-form-box h3 { margin:0; }
.inventory-form-box p { margin:0; }
.inventory-history-head {
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:14px;
    margin-bottom:12px;
}
.inventory-history-head h2 { margin-bottom:0; }
.inventory-history-head > .small { max-width:420px; text-align:right; }
.inventory-movement { align-items:flex-start; }
.inventory-change {
    flex:0 0 auto;
    font-size:21px;
    min-width:55px;
    text-align:right;
}
.inventory-change.positive { color:#8bd6ae; }

@media (max-width:680px) {
    .inventory-title-row { display:block; }
    .inventory-total {
        margin-top:14px;
        width:100%;
        text-align:left;
        display:flex;
        align-items:baseline;
        gap:8px;
    }
    .inventory-total strong { display:inline; font-size:28px; }
    .inventory-total span { display:inline; margin:0; }
    .inventory-ammo-grid {
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:8px;
    }
    .inventory-ammo-card { padding:12px; border-radius:16px; }
    .inventory-stock { font-size:30px; }
    .inventory-selected-head { align-items:center; }
    .inventory-current-stock strong { font-size:32px; }
    .inventory-history-head { display:block; }
    .inventory-history-head > .small { max-width:none; text-align:left; margin-top:5px; }
    .inventory-movement { gap:8px; }
}

/* ===== Statistiques V2 ===== */
.stats-head-card { display:grid; gap:16px; }
.stats-title-row,
.stats-section-head {
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:14px;
}
.stats-title-row h1,
.stats-section-head h2 { margin-bottom:5px; }
.stats-title-row p,
.stats-section-head p { margin:0; }
.stats-filters {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr)) auto;
    gap:10px;
    align-items:end;
}
.stats-filter-button { min-width:110px; }
.stats-kpi-grid {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
}
.stats-kpi {
    padding:16px;
    min-width:0;
}
.stats-kpi > span { display:block; color:var(--muted); font-size:12px; }
.stats-kpi > strong {
    display:block;
    font-size:clamp(28px,5vw,42px);
    line-height:1;
    margin-top:9px;
    letter-spacing:-.045em;
}
.stats-kpi > small { display:block; color:var(--muted); font-size:11px; margin-top:7px; }
.stats-kpi.positive > strong { color:#8bd6ae; }
.stats-kpi.negative > strong { color:#ff9aa3; }
.stats-line-chart-wrap {
    width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    margin-top:12px;
    padding-bottom:4px;
    -webkit-overflow-scrolling:touch;
}
.stats-line-chart { display:block; width:100%; height:auto; max-height:260px; }
.stats-grid-line { stroke:rgba(255,255,255,.08); stroke-width:1; }
.stats-axis-label,
.stats-date-label { fill:var(--muted); font-size:11px; }
.stats-session-line { fill:none; stroke:rgba(119,167,246,.38); stroke-width:2; }
.stats-trend-line { fill:none; stroke:var(--accent-2); stroke-width:3.5; stroke-linecap:round; stroke-linejoin:round; }
.stats-session-dot { fill:var(--panel-2); stroke:var(--accent-2); stroke-width:2.5; }
.stats-chart-legend {
    display:flex;
    gap:16px;
    flex-wrap:wrap;
    margin-top:8px;
    color:var(--muted);
    font-size:11px;
}
.stats-chart-legend span { display:flex; align-items:center; gap:6px; }
.legend-dot { width:9px; height:9px; border-radius:50%; border:2px solid var(--accent-2); display:inline-block; }
.legend-line { width:22px; height:3px; border-radius:999px; background:var(--accent-2); display:inline-block; }
.stats-two-column {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:16px;
}
.compact-head { margin-bottom:14px; }
.stats-distribution { display:grid; gap:9px; }
.stats-distribution-row {
    display:grid;
    grid-template-columns:28px minmax(0,1fr) 48px 42px;
    gap:8px;
    align-items:center;
}
.stats-distribution-row > strong { font-size:16px; }
.stats-distribution-row > span,
.stats-distribution-row > small { text-align:right; color:var(--muted); font-size:11px; }
.stats-distribution-track,
.stats-series-track {
    height:10px;
    border-radius:999px;
    overflow:hidden;
    background:rgba(255,255,255,.07);
}
.stats-distribution-track span,
.stats-series-track span {
    display:block;
    height:100%;
    border-radius:inherit;
    background:linear-gradient(90deg,var(--accent),var(--accent-2));
}
.stats-series-chart { display:grid; gap:11px; }
.stats-series-row {
    display:grid;
    grid-template-columns:minmax(108px,1.1fr) minmax(90px,1.4fr) 42px 52px;
    gap:8px;
    align-items:center;
}
.stats-series-label { min-width:0; }
.stats-series-label strong { display:inline-block; margin-right:6px; }
.stats-series-label span {
    color:var(--muted);
    font-size:11px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    vertical-align:middle;
    max-width:calc(100% - 34px);
}
.stats-series-row > strong { text-align:right; }
.stats-series-row > small { color:var(--muted); text-align:right; font-size:10px; }
.stats-compare-tabs {
    display:flex;
    gap:7px;
    overflow-x:auto;
    scrollbar-width:none;
    margin:4px 0 14px;
    padding-bottom:2px;
}
.stats-compare-tabs::-webkit-scrollbar { display:none; }
.stats-compare-tabs a {
    flex:0 0 auto;
    padding:8px 11px;
    border:1px solid var(--border);
    border-radius:999px;
    color:var(--muted);
    font-size:12px;
}
.stats-compare-tabs a.active {
    color:#fff;
    border-color:rgba(91,142,230,.48);
    background:rgba(91,142,230,.16);
}
.stats-compare-list { display:grid; gap:8px; }
.stats-compare-row {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:11px 12px;
    border:1px solid rgba(255,255,255,.07);
    border-radius:15px;
    background:rgba(9,13,18,.22);
}
.stats-compare-name { min-width:0; }
.stats-compare-name strong {
    display:block;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.stats-compare-name span { display:block; color:var(--muted); font-size:11px; margin-top:3px; }
.stats-compare-score { flex:0 0 auto; text-align:right; }
.stats-compare-score strong { display:block; font-size:23px; line-height:1; }
.stats-compare-score span { display:block; color:var(--muted); font-size:10px; margin-top:4px; }
.stats-insights { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.stats-insight {
    display:flex;
    gap:10px;
    align-items:flex-start;
    padding:13px;
    border-radius:16px;
    border:1px solid rgba(255,255,255,.07);
    background:rgba(9,13,18,.22);
}
.stats-insight-mark {
    flex:0 0 auto;
    width:28px;
    height:28px;
    display:grid;
    place-items:center;
    border-radius:50%;
    color:var(--accent-2);
    background:rgba(91,142,230,.13);
    border:1px solid rgba(91,142,230,.24);
}
.stats-insight strong { display:block; font-size:13px; }
.stats-insight p { margin:4px 0 0; font-size:12px; line-height:1.45; }
.stats-insight.positive { border-color:rgba(102,194,151,.18); background:rgba(102,194,151,.06); }
.stats-insight.positive .stats-insight-mark { color:#8bd6ae; background:rgba(102,194,151,.13); border-color:rgba(102,194,151,.30); }
.stats-insight.negative { border-color:rgba(219,102,112,.18); background:rgba(219,102,112,.06); }
.stats-insight.negative .stats-insight-mark { color:#ff9aa3; background:rgba(219,102,112,.13); border-color:rgba(219,102,112,.30); }
.stats-insight.neutral .stats-insight-mark { color:var(--accent-2); }

@media (max-width:760px) {
    .stats-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .stats-program-filter { grid-column:1 / -1; }
    .stats-filter-button { grid-column:1 / -1; width:100%; }
    .stats-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
    .stats-kpi { padding:13px; }
    .stats-kpi > strong { font-size:31px; }
    .stats-two-column { grid-template-columns:1fr; gap:12px; }
    .stats-insights { grid-template-columns:1fr; }
    .stats-line-chart { width:auto; }
}

@media (max-width:520px) {
    .stats-title-row,
    .stats-section-head { display:block; }
    .stats-title-row > .badge,
    .stats-section-head > .small { margin-top:8px; }
    .stats-distribution-row { grid-template-columns:24px minmax(0,1fr) 44px 34px; gap:6px; }
    .stats-series-row { grid-template-columns:minmax(90px,1fr) minmax(80px,1.2fr) 38px; }
    .stats-series-row > small { display:none; }
}

/* ===== Correctif iPhone / largeur Statistiques V2 ===== */
.stats-head-card,
.stats-title-row,
.stats-filters,
.stats-filters > *,
.stats-kpi-grid,
.stats-kpi,
.stats-two-column,
.stats-two-column > *,
.stats-line-chart-wrap,
.stats-compare-tabs,
.stats-compare-list,
.stats-compare-row,
.stats-compare-name,
.stats-insights,
.stats-insight,
.stats-section-head {
    min-width: 0;
    max-width: 100%;
}

.stats-line-chart-wrap {
    box-sizing: border-box;
    contain: inline-size;
}

@media (max-width: 760px) {
    /* Safari iOS tient compte du min-width inline du SVG et peut élargir toute la page.
       Sur téléphone on force donc le graphique à rester dans la carte. */
    .stats-line-chart {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .stats-filters {
        width: 100%;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .stats-filters select,
    .stats-filters input,
    .stats-filters button {
        min-width: 0;
        max-width: 100%;
    }

    .stats-compare-tabs {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .stats-compare-row {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .stats-head-card,
    .stats-kpi,
    .stats-two-column > .card,
    .stats-compare-row,
    .stats-insight {
        max-width: 100%;
    }

    .stats-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-kpi > strong {
        font-size: 28px;
    }

    .stats-distribution-row {
        grid-template-columns: 22px minmax(0, 1fr) 40px 30px;
    }

    .stats-series-row {
        grid-template-columns: minmax(72px, 1fr) minmax(72px, 1.1fr) 34px;
    }
}

/* ===== Stats V2 - verrouillage largeur iPhone ===== */
.stats-page {
    overflow-x: hidden;
}

.stats-page .app-shell {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
}

.stats-page .content,
.stats-page .content > *,
.stats-page .card {
    min-width: 0;
    max-width: 100%;
}

.stats-page .stats-line-chart-wrap {
    overflow: hidden;
}

.stats-page .stats-line-chart {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto;
}

.stats-page .stats-filters .field,
.stats-page .stats-filters select,
.stats-page .stats-program-filter,
.stats-page .stats-program-filter select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.stats-page .stats-title-row p,
.stats-page .stats-section-head p,
.stats-page .stats-insight p,
.stats-page .stats-kpi small {
    overflow-wrap: anywhere;
}

@media (max-width: 430px) {
    .stats-page .app-shell {
        padding-left: 10px;
        padding-right: 10px;
    }

    .stats-page .topbar {
        margin-left: -10px;
        margin-right: -10px;
        padding-left: 14px;
        padding-right: 14px;
    }

    .stats-page .card {
        padding: 13px;
    }

    .stats-page .stats-head-card {
        padding: 15px;
    }

    .stats-page .stats-kpi-grid {
        gap: 8px;
    }

    .stats-page .stats-kpi {
        padding: 12px;
    }
}

/* V3-BETA — coups d'essai hors score */
.trial-setup {
    border: 1px solid rgba(230,158,91,.28);
    border-radius: 17px;
    background: rgba(230,158,91,.055);
    overflow: hidden;
}
.trial-setup[hidden] { display: none; }
.trial-setup summary {
    min-height: 50px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
    color: var(--text);
    font-weight: 700;
    -webkit-tap-highlight-color: transparent;
}
.trial-setup summary::-webkit-details-marker { display: none; }
.trial-setup summary small {
    color: #e5b985;
    font-size: 11px;
    font-weight: 650;
    margin-left: 5px;
}
.trial-count-badge {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid rgba(230,158,91,.34);
    color: #ffd6a4;
    background: rgba(230,158,91,.10);
    font-size: 12px;
}
.trial-setup-body {
    padding: 0 14px 14px;
    border-top: 1px solid rgba(230,158,91,.14);
}
.trial-setup-body > p {
    margin: 12px 0;
    font-size: 12px;
    line-height: 1.45;
}
.trial-score-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0,1fr));
    gap: 7px;
}
.trial-score-btn {
    min-width: 0;
    min-height: 50px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 13px;
    color: var(--text);
    background: rgba(34,41,54,.78);
    font-size: 20px;
    font-weight: 720;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.trial-score-btn:active { transform: scale(.97); background: rgba(91,142,230,.22); }
.trial-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}
.trial-sequence {
    min-height: 20px;
    margin-top: 10px;
    padding: 9px 10px;
    border-radius: 11px;
    background: rgba(9,13,18,.22);
    overflow-wrap: anywhere;
}
.trial-result-card { border-color: rgba(230,158,91,.24); }
.trial-result-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.trial-result-head h2 { margin-bottom: 8px; }
.trial-result-scores {
    margin: 4px 0 9px;
    font-size: 20px;
    font-weight: 720;
    letter-spacing: .02em;
}

@media (max-width: 520px) {
    .trial-score-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .trial-score-btn { min-height: 48px; }
    .trial-actions .btn { flex: 1 1 auto; }
}


/* History V2 */
.history-head-card { display:grid; gap:16px; }
.history-head-card h1 { margin-bottom:6px; }
.history-head-card p { margin:0; }
.history-filters {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:10px;
}
.history-search-field { grid-column:span 2; }
.history-filter-actions { align-self:end; min-height:46px; }
.history-summary {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
}
.history-session-context {
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin-top:7px;
}
.history-session-context span {
    display:inline-flex;
    padding:3px 7px;
    border-radius:999px;
    background:rgba(255,255,255,.05);
    color:var(--muted);
    font-size:11px;
}
.history-score {
    flex:0 0 auto;
    text-align:right;
    min-width:78px;
}
.history-score strong { display:block; font-size:25px; line-height:1; }
.history-score span { display:block; margin-top:5px; color:var(--muted); font-size:11px; }

@media (max-width:760px) {
    .history-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .history-search-field { grid-column:1 / -1; }
    .history-filter-actions { grid-column:1 / -1; }
}
@media (max-width:430px) {
    .history-summary { grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
    .history-summary .stat { padding:10px 8px; }
    .history-summary .stat strong { font-size:20px; }
    .history-session-row { align-items:flex-start; }
}


/* Session metadata edit */
.session-edit-card details > summary {
    cursor:pointer;
    font-weight:720;
    color:var(--text);
    list-style:none;
}
.session-edit-card details > summary::-webkit-details-marker { display:none; }
.session-edit-card details > summary::after {
    content:'Modifier';
    float:right;
    color:var(--accent-2);
    font-size:12px;
    font-weight:700;
}
.session-edit-card details[open] > summary::after { content:'Fermer'; }
.session-edit-warning { margin:12px 0; }
.session-edit-form { margin-top:12px; }


/* Quick session configuration */
.quick-config-box {
    padding:12px;
    border:1px solid rgba(91,142,230,.20);
    border-radius:16px;
    background:rgba(91,142,230,.06);
}
.quick-config-head { margin-bottom:9px; }
.quick-config-list {
    display:flex;
    gap:7px;
    overflow-x:auto;
    padding-bottom:2px;
    scrollbar-width:none;
}
.quick-config-list::-webkit-scrollbar { display:none; }
.quick-config-btn {
    flex:0 0 auto;
    min-height:40px;
    padding:8px 12px;
    border:1px solid var(--border);
    border-radius:999px;
    background:var(--panel-2);
    color:var(--text);
    font-weight:650;
    cursor:pointer;
    touch-action:manipulation;
}
.quick-config-btn.applied {
    border-color:rgba(102,194,151,.55);
    background:rgba(102,194,151,.12);
}
.preset-save-box,
.preset-manage-box {
    border-top:1px solid rgba(255,255,255,.07);
    padding-top:10px;
}
.preset-save-box > summary,
.preset-manage-box > summary {
    cursor:pointer;
    color:var(--muted);
    font-size:13px;
}
.preset-save-row {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
    margin-top:9px;
}
@media (max-width:430px) {
    .preset-save-row { grid-template-columns:1fr; }
}


/* Inventory V2 */
.inventory-alert {
    margin-top:12px;
    padding:10px 12px;
    border-radius:13px;
    color:#ffd2d6;
    background:rgba(219,102,112,.10);
    border:1px solid rgba(219,102,112,.28);
    font-size:13px;
}
.inventory-ammo-card.low-stock {
    border-color:rgba(219,102,112,.34);
    background:linear-gradient(180deg, rgba(219,102,112,.08), rgba(26,32,43,.96));
}
.inventory-ammo-card.low-stock > span { color:#ff9aa3; }
.inventory-kpi-grid {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:9px;
    margin:14px 0;
}
.inventory-history-filters {
    display:grid;
    grid-template-columns:minmax(0,180px) minmax(0,180px) auto;
    gap:8px;
    align-items:end;
    margin:12px 0 14px;
}
@media (max-width:680px) {
    .inventory-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .inventory-history-filters { grid-template-columns:1fr 1fr; }
    .inventory-history-filters .btn { grid-column:1 / -1; }
}


/* Quick configuration — compact UI */
.quick-config-box,
.quick-config-head,
.preset-save-box,
.preset-manage-box { display:none; }

.quick-config-strip {
    display:flex;
    align-items:center;
    gap:9px;
    min-width:0;
    padding:1px 0 3px;
}

.quick-config-label {
    flex:0 0 auto;
    color:var(--muted);
    font-size:12px;
    font-weight:750;
}

.quick-config-list {
    flex:1 1 auto;
    min-width:0;
    display:flex;
    gap:7px;
    overflow-x:auto;
    padding:2px 1px 4px;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
}
.quick-config-list::-webkit-scrollbar { display:none; }

.quick-config-btn {
    flex:0 0 auto;
    min-height:34px;
    max-width:190px;
    padding:7px 10px;
    border:1px solid var(--border);
    border-radius:999px;
    background:rgba(255,255,255,.025);
    color:var(--text);
    font-size:12px;
    font-weight:680;
    line-height:1;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    cursor:pointer;
    touch-action:manipulation;
}

.quick-config-btn span { color:var(--accent-2); }

.quick-config-btn.applied {
    border-color:rgba(102,194,151,.55);
    background:rgba(102,194,151,.10);
}

.favorites-box {
    margin-top:2px;
    border-top:1px solid rgba(255,255,255,.07);
}

.favorites-box > summary {
    min-height:40px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    cursor:pointer;
    list-style:none;
    color:var(--muted);
    font-size:13px;
    font-weight:650;
    user-select:none;
}

.favorites-box > summary::-webkit-details-marker { display:none; }

.favorites-box > summary::after {
    content:'⌄';
    margin-left:2px;
    transition:transform .18s ease;
}

.favorites-box[open] > summary::after { transform:rotate(180deg); }

.favorites-panel {
    display:grid;
    gap:13px;
    padding:2px 0 6px;
}

.favorites-save-form {
    padding:12px;
    border:1px solid rgba(255,255,255,.07);
    border-radius:14px;
    background:rgba(255,255,255,.025);
}

.favorites-list {
    display:grid;
    border-top:1px solid rgba(255,255,255,.06);
}

.favorites-row {
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 0;
    border-bottom:1px solid rgba(255,255,255,.06);
}

.favorites-row .btn { flex:0 0 auto; }

@media (max-width:430px) {
    .quick-config-strip { gap:7px; }
    .quick-config-label { font-size:11px; }
    .quick-config-btn {
        max-width:155px;
        min-height:33px;
        padding:7px 9px;
        font-size:12px;
    }
    .favorites-row { align-items:flex-start; }
}

/* Mes listes — list-first CRUD */
.library-header-compact {
    display:grid;
    gap:14px;
}

.library-header-compact h1 {
    margin-bottom:0;
}

.library-list-card {
    padding-top:16px;
}

.library-section-head {
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:14px;
    margin-bottom:10px;
}

.library-section-head h2 {
    margin:0 0 4px;
}

.library-add-btn {
    flex:0 0 auto;
    white-space:nowrap;
}

.library-clean-list {
    margin-top:2px;
}

.library-list-first-item {
    min-width:0;
    gap:12px;
}

.library-row-controls {
    position:relative;
    flex:0 0 auto;
    display:flex;
    align-items:center;
    gap:6px;
}

.library-more-menu {
    position:relative;
}

.library-more-menu > summary {
    width:38px;
    height:38px;
    display:grid;
    place-items:center;
    list-style:none;
    cursor:pointer;
    border:1px solid var(--border);
    border-radius:12px;
    background:rgba(255,255,255,.025);
    color:var(--text);
    font-size:21px;
    line-height:1;
    user-select:none;
}

.library-more-menu > summary::-webkit-details-marker {
    display:none;
}

.library-more-menu[open] > summary {
    border-color:rgba(91,142,230,.42);
    background:rgba(91,142,230,.10);
}

.library-more-panel {
    position:absolute;
    z-index:30;
    right:0;
    top:44px;
    min-width:168px;
    padding:6px;
    border:1px solid var(--border);
    border-radius:13px;
    background:var(--panel-2);
    box-shadow:0 16px 34px rgba(0,0,0,.32);
}

.library-more-panel form {
    margin:0;
}

.library-menu-action {
    width:100%;
    min-height:40px;
    padding:8px 10px;
    border:0;
    border-radius:9px;
    background:transparent;
    color:var(--text);
    text-align:left;
    font:inherit;
    font-size:13px;
    cursor:pointer;
}

.library-menu-action:hover,
.library-menu-action:focus-visible {
    background:rgba(255,255,255,.055);
}

.library-menu-action.danger-text {
    color:#ff9aa3;
}

.library-empty-state {
    display:grid;
    gap:14px;
    justify-items:center;
    padding:26px 12px;
}

.library-form-page {
    max-width:780px;
    margin-inline:auto;
}

.library-form-head {
    margin-bottom:18px;
}

.library-form-head h1 {
    margin-top:4px;
    margin-bottom:0;
}

.library-back-link {
    display:inline-flex;
    align-items:center;
    min-height:32px;
    margin-bottom:8px;
    color:var(--accent-2);
    font-size:13px;
    font-weight:680;
}

.library-dedicated-form {
    gap:14px;
}

.library-form-actions {
    display:flex;
    justify-content:flex-end;
    gap:8px;
    padding-top:4px;
}

.library-check-row {
    display:flex;
    align-items:flex-start;
    gap:9px;
    padding:11px 12px;
    border:1px solid rgba(255,255,255,.07);
    border-radius:13px;
    background:rgba(255,255,255,.025);
}

.library-check-row input {
    width:auto;
    min-height:auto;
    margin-top:3px;
}

.library-check-row span {
    display:grid;
    gap:2px;
}

.library-check-row small {
    color:var(--muted);
    font-size:11px;
    font-weight:400;
}

.library-program-head {
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
    margin-bottom:10px;
}

.library-program-head h2 {
    margin:0 0 3px;
}

.library-program-series {
    display:grid;
    gap:10px;
}

.library-version-action {
    margin-top:12px;
    padding-top:12px;
    border-top:1px solid rgba(255,255,255,.07);
}

@media (max-width:560px) {
    .library-section-head {
        align-items:center;
    }

    .library-section-head .small {
        display:none;
    }

    .library-list-first-item {
        align-items:flex-start;
    }

    .library-row-controls > .btn {
        display:none;
    }

    .library-more-panel {
        position:fixed;
        left:16px;
        right:16px;
        top:auto;
        bottom:calc(16px + env(safe-area-inset-bottom));
        min-width:0;
        padding:8px;
        border-radius:16px;
    }

    .library-more-panel::before {
        content:'Actions';
        display:block;
        padding:7px 10px 5px;
        color:var(--muted);
        font-size:11px;
        font-weight:750;
        text-transform:uppercase;
        letter-spacing:.06em;
    }

    .library-menu-action {
        min-height:46px;
        font-size:15px;
    }

    .library-form-actions {
        display:grid;
        grid-template-columns:1fr 1.4fr;
    }

    .library-program-head {
        align-items:center;
    }
}
.library-more-panel a.library-menu-action {
    display:flex;
    align-items:center;
    text-decoration:none;
}


/* Mes listes — action principale sur la carte, menu secondaire compact */
.library-list-first-item {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:start;
    gap:10px;
}

.library-item-link {
    display:block;
    min-width:0;
    padding:2px 0;
    color:inherit;
    text-decoration:none;
    border-radius:10px;
}

.library-item-link:focus-visible {
    outline:2px solid var(--accent-2);
    outline-offset:4px;
}

.library-item-link .list-title {
    transition:color .15s ease;
}

@media (hover:hover) {
    .library-item-link:hover .list-title {
        color:var(--accent-2);
    }
}

.library-row-controls {
    align-self:start;
    margin-top:-2px;
}

.library-more-menu > summary {
    width:34px;
    height:34px;
    border-radius:10px;
    border-color:rgba(255,255,255,.10);
    background:transparent;
    color:var(--muted);
    font-size:19px;
}

.library-more-menu > summary:active,
.library-more-menu[open] > summary {
    color:var(--text);
    border-color:rgba(91,142,230,.38);
    background:rgba(91,142,230,.08);
}

@media (max-width:680px) {
    .library-list-first-item {
        display:grid;
        grid-template-columns:minmax(0,1fr) auto;
        align-items:start;
        gap:8px;
    }

    .library-row-controls {
        width:auto;
        justify-content:flex-end;
    }

    .library-more-menu > summary {
        width:32px;
        height:32px;
        font-size:18px;
    }
}


/* Admin back navigation — compact pill */
.admin-back-link {
    display:inline-flex;
    align-items:center;
    width:max-content;
    max-width:100%;
    min-height:32px;
    padding:6px 10px;
    margin:0 0 13px;
    border:1px solid rgba(255,255,255,.11);
    border-radius:999px;
    background:rgba(255,255,255,.035);
    color:var(--muted);
    text-decoration:none;
    font-size:13px;
    font-weight:680;
    line-height:1;
    white-space:nowrap;
    touch-action:manipulation;
}
.admin-back-link:hover,
.admin-back-link:focus-visible {
    color:var(--text);
    border-color:rgba(91,142,230,.36);
    background:rgba(91,142,230,.08);
}
.admin-back-link:active {
    transform:translateY(1px);
}
@media (max-width:430px) {
    .admin-back-link {
        min-height:30px;
        padding:6px 9px;
        margin-bottom:11px;
        font-size:12px;
    }
}


/* Admin navigation polish */
.admin-back-link {
    gap:5px;
    box-sizing:border-box;
    box-shadow:0 1px 0 rgba(255,255,255,.025) inset;
}

/* La page Calibres a deux actions dans son en-tête.
   Sur mobile on évite qu'elles compressent le titre. */
@media (max-width:680px) {
    .caliber-sort-root .caliber-list-head {
        display:grid !important;
        grid-template-columns:minmax(0,1fr) !important;
        align-items:start !important;
        gap:11px !important;
    }

    .caliber-sort-root .caliber-list-head > .actions {
        width:100%;
        display:flex;
        flex-wrap:wrap;
        justify-content:flex-start;
        gap:8px;
    }

    .caliber-sort-root .caliber-list-head > .actions .btn {
        width:auto;
        flex:0 0 auto;
    }
}


/* Historique — filtres compacts */
.history-head-compact {
    gap:11px;
}

.history-head-compact h1 {
    margin-bottom:4px;
}

.history-head-copy {
    margin:0;
    color:var(--muted);
    font-size:14px;
}

.history-compact-toolbar {
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:9px;
    min-width:0;
}

.history-periods {
    flex:1 1 auto;
    min-width:0;
    display:flex;
    gap:6px;
    overflow-x:auto;
    padding:1px 0 3px;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
}
.history-periods::-webkit-scrollbar { display:none; }

.history-period-chip {
    flex:0 0 auto;
    min-height:34px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:6px 11px;
    border:1px solid var(--border);
    border-radius:999px;
    background:rgba(255,255,255,.025);
    color:var(--muted);
    font-size:12px;
    font-weight:700;
    text-decoration:none;
    white-space:nowrap;
}

.history-period-chip.active {
    border-color:rgba(91,142,230,.48);
    background:rgba(91,142,230,.16);
    color:var(--text);
}

.history-filter-disclosure {
    flex:0 0 auto;
}

.history-filter-disclosure[open] {
    flex-basis:100%;
    width:100%;
}

.history-filter-disclosure > summary {
    min-height:34px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    padding:6px 11px;
    border:1px solid var(--border);
    border-radius:999px;
    background:rgba(255,255,255,.025);
    color:var(--text);
    font-size:12px;
    font-weight:720;
    cursor:pointer;
    list-style:none;
    user-select:none;
}

.history-filter-disclosure > summary::-webkit-details-marker {
    display:none;
}

.history-filter-disclosure > summary::before {
    content:'≡';
    color:var(--accent-2);
    font-size:14px;
    line-height:1;
}

.history-filter-disclosure[open] > summary {
    margin-left:auto;
    margin-bottom:10px;
}

.history-filter-count {
    min-width:18px;
    height:18px;
    padding:0 5px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:999px;
    background:var(--accent);
    color:white;
    font-size:10px;
    line-height:1;
}

.history-filters-compact {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:9px;
    padding:12px;
    border:1px solid rgba(255,255,255,.07);
    border-radius:15px;
    background:rgba(255,255,255,.025);
}

.history-filters-compact .history-search-field {
    grid-column:span 2;
}

.history-filters-compact .history-filter-actions {
    grid-column:1 / -1;
    min-height:auto;
}

.history-active-filters {
    display:flex;
    gap:6px;
    overflow-x:auto;
    padding:1px 0 2px;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
}
.history-active-filters::-webkit-scrollbar { display:none; }

.history-active-filter {
    flex:0 0 auto;
    max-width:200px;
    display:inline-flex;
    align-items:center;
    gap:5px;
    min-height:29px;
    padding:5px 9px;
    border:1px solid rgba(91,142,230,.24);
    border-radius:999px;
    background:rgba(91,142,230,.08);
    color:var(--text);
    font-size:11px;
    font-weight:650;
    text-decoration:none;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.history-active-filter span {
    color:var(--muted);
    font-size:14px;
    line-height:1;
}

@media (max-width:760px) {
    .history-filters-compact {
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .history-filters-compact .history-search-field,
    .history-filters-compact .history-filter-actions {
        grid-column:1 / -1;
    }
}

@media (max-width:430px) {
    .history-head-copy {
        font-size:13px;
    }

    .history-period-chip,
    .history-filter-disclosure > summary {
        min-height:32px;
        padding:6px 9px;
        font-size:11px;
    }

    .history-filter-disclosure[open] > summary {
        margin-bottom:8px;
    }

    .history-filters-compact {
        gap:8px;
        padding:10px;
    }

    .history-filters-compact label {
        font-size:12px;
    }

    .history-filters-compact select,
    .history-filters-compact input {
        min-height:42px;
    }
}


/* Inventaire — actions stock compactes */
.inventory-stock-actions {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:9px;
    margin-top:14px;
}

.inventory-action-disclosure {
    min-width:0;
}

.inventory-action-disclosure[open] {
    grid-column:1 / -1;
}

.inventory-action-disclosure > summary {
    min-height:58px;
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 12px;
    border:1px solid var(--border);
    border-radius:14px;
    background:rgba(255,255,255,.025);
    color:var(--text);
    cursor:pointer;
    list-style:none;
    user-select:none;
}

.inventory-action-disclosure > summary::-webkit-details-marker {
    display:none;
}

.inventory-action-disclosure > summary::after {
    content:'›';
    margin-left:auto;
    color:var(--muted);
    font-size:20px;
    line-height:1;
    transition:transform .18s ease;
}

.inventory-action-disclosure[open] > summary::after {
    transform:rotate(90deg);
}

.inventory-action-icon {
    flex:0 0 auto;
    width:32px;
    height:32px;
    display:grid;
    place-items:center;
    border-radius:10px;
    background:rgba(91,142,230,.10);
    color:var(--accent-2);
    font-size:15px;
    font-weight:800;
}

.inventory-action-disclosure summary > span:nth-child(2) {
    min-width:0;
}

.inventory-action-disclosure summary strong {
    display:block;
    font-size:13px;
    line-height:1.2;
}

.inventory-action-disclosure summary small {
    display:block;
    margin-top:3px;
    color:var(--muted);
    font-size:11px;
    line-height:1.2;
}

.inventory-form-compact {
    margin-top:9px;
    padding:12px;
    border:1px solid rgba(255,255,255,.07);
    border-radius:14px;
    background:rgba(255,255,255,.025);
}

@media (max-width:520px) {
    .inventory-stock-actions {
        grid-template-columns:1fr;
    }

    .inventory-action-disclosure[open] {
        grid-column:auto;
    }

    .inventory-action-disclosure > summary {
        min-height:54px;
    }
}


/* Nouvelle session — mise en page grand écran
   Le mobile reste volontairement inchangé. */
@media (min-width: 1000px) {
    .new-session-card {
        width:min(100%, 1100px);
        margin-inline:auto;
        padding:22px 24px;
    }

    .new-session-card #newSessionForm {
        gap:14px;
    }

    .new-session-card .session-program-grid {
        grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
        gap:16px;
        align-items:start;
    }

    .new-session-card .session-setup-grid {
        grid-template-columns:
            minmax(150px, .55fr)
            minmax(170px, .65fr)
            minmax(300px, 1.35fr);
        gap:16px;
    }

    .new-session-card .session-equipment-grid {
        grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
        gap:16px;
    }

    .new-session-card #newSessionForm textarea {
        min-height:88px;
    }

    .new-session-card .quick-config-strip {
        margin-bottom:2px;
    }
}

/* Sur un écran intermédiaire on conserve le comportement actuel,
   ce qui évite de modifier le rendu tablette / iPhone. */


/* Profil tireur — champs structurés et correctif Safari date */
.profile-shooter-form,
.shooter-admin-form {
    min-width:0;
}

.profile-shooter-form .field,
.shooter-admin-form .field,
.profile-shooter-form .grid > *,
.shooter-admin-form .grid > * {
    min-width:0;
}

.profile-shooter-form input[type="date"],
.shooter-admin-form input[type="date"] {
    display:block;
    width:100%;
    min-width:0;
    max-width:100%;
    box-sizing:border-box;
}

.profile-address-street {
    grid-template-columns:minmax(0,1fr) 110px;
    gap:10px;
}

@media (max-width:430px) {
    .profile-address-street {
        grid-template-columns:minmax(0,1fr) 96px;
    }
}


/* iOS / Safari — largeur du sélecteur de date de naissance
   Safari donne au contrôle date une largeur intrinsèque supérieure au parent.
   On applique le même traitement robuste que pour datetime-local. */
.birth-date-field {
    min-width:0;
    max-width:100%;
    overflow:hidden;
}

.birth-date-field input[type="date"] {
    display:block;
    box-sizing:border-box;
    width:-webkit-fill-available;
    width:100%;
    max-width:100%;
    min-width:0;
    min-inline-size:0;
    max-inline-size:100%;
    -webkit-appearance:none;
    appearance:none;
}

.birth-date-field input[type="date"]::-webkit-date-and-time-value {
    min-width:0;
    width:100%;
    text-align:left;
}

.birth-date-field input[type="date"]::-webkit-datetime-edit {
    min-width:0;
    padding:0;
}

/* Empêche le contenu natif du champ de repousser son conteneur sur iPhone. */
@supports (-webkit-touch-callout: none) {
    .birth-date-field input[type="date"] {
        overflow:hidden;
    }
}


/* =========================================================
   MODE SECRÉTAIRE — PHASE 1
   ========================================================= */

.secretary-home-card .library-section-head,
.secretary-relay-summary .library-section-head {
    align-items:flex-start;
}

.secretary-relay-list-item {
    display:flex;
    align-items:center;
    gap:12px;
    text-decoration:none;
    color:inherit;
}

.secretary-relay-chevron {
    flex:0 0 auto;
    font-size:28px;
    line-height:1;
    opacity:.45;
}

.secretary-relay-form,
.secretary-relay-form * {
    min-width:0;
}

.secretary-lane-form-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
}

.secretary-lane-select {
    display:grid;
    grid-template-columns:42px minmax(0,1fr);
    gap:10px;
    align-items:end;
    padding:10px;
    border:1px solid var(--line);
    border-radius:16px;
    background:rgba(255,255,255,.018);
}

.secretary-lane-number {
    width:42px;
    height:42px;
    display:grid;
    place-items:center;
    border-radius:13px;
    font-size:19px;
    font-weight:800;
    background:var(--panel-2);
    border:1px solid var(--line);
    margin-bottom:1px;
}

.secretary-lane-select .field {
    margin:0;
}

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

.secretary-lane-card {
    min-width:0;
    padding:14px;
    border:1px solid var(--line);
    border-radius:18px;
    background:rgba(255,255,255,.018);
}

.secretary-lane-card.active {
    border-color:rgba(82,145,255,.45);
}

.secretary-lane-card-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-bottom:10px;
}

.secretary-lane-big {
    width:46px;
    height:46px;
    display:grid;
    place-items:center;
    border-radius:14px;
    font-size:22px;
    font-weight:850;
    background:var(--panel-2);
    border:1px solid var(--line);
}

.secretary-lane-card h3 {
    margin:0 0 4px;
}

.secretary-lane-stats {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    margin:14px 0 10px;
}

.secretary-lane-stats > div {
    padding:10px;
    border-radius:13px;
    background:var(--panel-2);
    border:1px solid var(--line);
}

.secretary-lane-stats strong,
.secretary-lane-stats span {
    display:block;
}

.secretary-lane-stats strong {
    font-size:20px;
}

.secretary-lane-stats span {
    margin-top:2px;
    font-size:12px;
    opacity:.65;
}

.secretary-current-series {
    min-height:34px;
    margin:8px 0 10px;
}

.secretary-score-btn {
    width:100%;
    justify-content:center;
}

@media (min-width:900px) {
    .secretary-lane-grid {
        grid-template-columns:repeat(5,minmax(0,1fr));
    }

    .secretary-lane-form-grid {
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media (max-width:640px) {
    .secretary-lane-form-grid,
    .secretary-lane-grid {
        grid-template-columns:1fr;
    }

    .secretary-home-card .library-section-head,
    .secretary-relay-summary .library-section-head {
        gap:12px;
    }
}


/* =========================================================
   MODE SECRÉTAIRE — PHASE 2 : SAISIE COLLECTIVE
   ========================================================= */

.secretary-capture-page .content {
    padding-bottom:250px;
}

.secretary-capture-shell {
    display:grid;
    gap:12px;
}

.secretary-capture-top {
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    gap:12px;
    align-items:center;
    padding:12px;
    border:1px solid var(--line);
    border-radius:18px;
    background:var(--panel);
}

.secretary-capture-top h1 {
    margin:2px 0 3px;
    font-size:21px;
}

.secretary-step-time {
    min-width:54px;
    text-align:center;
    font-weight:800;
    font-size:18px;
}

.secretary-capture-lanes {
    display:grid;
    gap:8px;
}

.secretary-capture-lane {
    width:100%;
    display:grid;
    grid-template-columns:48px minmax(0,1fr) 58px;
    gap:10px;
    align-items:center;
    text-align:left;
    padding:10px;
    border:1px solid var(--line);
    border-radius:16px;
    background:var(--panel);
    color:inherit;
}

.secretary-capture-lane.selected {
    border-color:rgba(82,145,255,.8);
    box-shadow:0 0 0 1px rgba(82,145,255,.22) inset;
}

.secretary-capture-lane.complete {
    opacity:.72;
}

.secretary-capture-lane:disabled {
    opacity:.45;
}

.secretary-capture-lane-no {
    width:44px;
    height:44px;
    display:grid;
    place-items:center;
    border-radius:13px;
    background:var(--panel-2);
    border:1px solid var(--line);
    font-size:21px;
    font-weight:850;
}

.secretary-capture-lane-main,
.secretary-capture-lane-total {
    min-width:0;
}

.secretary-capture-lane-main {
    display:grid;
    gap:7px;
}

.secretary-capture-lane-main strong {
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.secretary-shot-pills {
    display:flex;
    flex-wrap:wrap;
    gap:5px;
}

.secretary-shot-pill {
    width:28px;
    height:25px;
    display:grid;
    place-items:center;
    border-radius:8px;
    border:1px solid var(--line);
    background:var(--panel-2);
    font-size:13px;
    font-weight:750;
    opacity:.55;
}

.secretary-shot-pill.filled {
    opacity:1;
}

.secretary-capture-lane-total {
    text-align:right;
}

.secretary-capture-lane-total strong,
.secretary-capture-lane-total small {
    display:block;
}

.secretary-capture-lane-total strong {
    font-size:20px;
}

.secretary-capture-lane-total small {
    margin-top:2px;
    opacity:.62;
}

.secretary-score-panel {
    position:fixed;
    z-index:30;
    left:max(12px, env(safe-area-inset-left));
    right:max(12px, env(safe-area-inset-right));
    bottom:max(10px, env(safe-area-inset-bottom));
    max-width:760px;
    margin:0 auto;
    padding:10px;
    border:1px solid var(--line);
    border-radius:18px;
    background:rgba(17,21,29,.96);
    box-shadow:0 14px 50px rgba(0,0,0,.45);
    backdrop-filter:blur(16px);
    -webkit-backdrop-filter:blur(16px);
}

.secretary-selected-lane {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-bottom:8px;
}

.secretary-shared-score-grid {
    margin:0;
}

.secretary-next-step {
    width:100%;
    justify-content:center;
    margin-top:8px;
}

@media (min-width:900px) {
    .secretary-capture-page .content {
        padding-bottom:220px;
    }

    .secretary-capture-lanes {
        grid-template-columns:repeat(5,minmax(0,1fr));
    }

    .secretary-capture-lane {
        grid-template-columns:42px minmax(0,1fr);
    }

    .secretary-capture-lane-total {
        grid-column:1 / -1;
        display:flex;
        justify-content:space-between;
        text-align:left;
        padding-top:6px;
        border-top:1px solid var(--line);
    }

    .secretary-shot-pills {
        min-height:54px;
        align-content:flex-start;
    }
}

@media (max-width:560px) {
    .secretary-capture-top {
        grid-template-columns:auto minmax(0,1fr);
    }

    .secretary-step-time {
        grid-column:1 / -1;
        text-align:left;
        min-height:0;
        font-size:14px;
    }

    .secretary-capture-top h1 {
        font-size:18px;
    }
}


/* =========================================================
   MODE SECRÉTAIRE — PHASE 3 : TIMER COMMUN
   ========================================================= */

.secretary-timer-box {
    min-width:138px;
    display:grid;
    gap:7px;
    justify-items:end;
}

.secretary-timer-display {
    min-width:116px;
    padding:7px 10px;
    border-radius:13px;
    border:1px solid var(--line);
    background:var(--panel-2);
    text-align:center;
    font-variant-numeric:tabular-nums;
    font-size:29px;
    line-height:1;
    font-weight:850;
    letter-spacing:.04em;
}

.secretary-timer-controls {
    display:flex;
    gap:5px;
}

.secretary-timer-controls .btn {
    min-width:36px;
    justify-content:center;
    padding-left:9px;
    padding-right:9px;
}

.secretary-timer-box.running .secretary-timer-display {
    border-color:rgba(82,145,255,.72);
}

.secretary-timer-box.finished .secretary-timer-display {
    border-color:rgba(255,110,110,.75);
}

.secretary-timer-box.unsupported {
    opacity:.45;
}

@media (max-width:560px) {
    .secretary-capture-top {
        grid-template-columns:auto minmax(0,1fr);
    }

    .secretary-timer-box {
        grid-column:1 / -1;
        width:100%;
        grid-template-columns:minmax(0,1fr) auto;
        align-items:center;
        justify-items:stretch;
    }

    .secretary-timer-display {
        width:100%;
        min-width:0;
        font-size:26px;
    }

    .secretary-timer-controls {
        justify-content:flex-end;
    }
}


/* Inventaire — prix d'achat et coût */
.inventory-movement-side {
    flex:0 0 auto;
    display:flex;
    align-items:flex-start;
    justify-content:flex-end;
    gap:14px;
}
.inventory-purchase-cost {
    min-width:150px;
    text-align:right;
}
.inventory-purchase-cost > strong {
    display:block;
    font-size:13px;
}
.inventory-purchase-cost > span {
    display:block;
    margin-top:2px;
    color:var(--muted);
    font-size:11px;
}
.inventory-purchase-cost details {
    margin-top:5px;
}
.inventory-purchase-cost summary {
    cursor:pointer;
    color:var(--accent-2);
    font-size:11px;
    list-style:none;
}
.inventory-purchase-cost summary::-webkit-details-marker { display:none; }
.inventory-inline-cost-form {
    display:grid;
    grid-template-columns:minmax(90px,120px) auto;
    gap:6px;
    margin-top:7px;
}
.inventory-inline-cost-form input {
    min-height:34px;
    padding:6px 8px;
    text-align:right;
}
.inventory-inline-cost-form .btn {
    min-height:34px;
}

@media (max-width:680px) {
    .inventory-movement-side {
        flex-direction:column-reverse;
        align-items:flex-end;
        gap:6px;
    }
    .inventory-purchase-cost {
        min-width:0;
        max-width:170px;
    }
    .inventory-inline-cost-form {
        grid-template-columns:1fr;
    }
}


/* Inventaire — budget secondaire et repliable */
.inventory-budget-disclosure {
    padding:0;
    overflow:hidden;
}
.inventory-budget-disclosure > summary {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    min-height:72px;
    padding:16px 20px;
    cursor:pointer;
    list-style:none;
}
.inventory-budget-disclosure > summary::-webkit-details-marker {
    display:none;
}
.inventory-budget-disclosure > summary::after {
    content:'›';
    flex:0 0 auto;
    color:var(--muted);
    font-size:22px;
    line-height:1;
    transition:transform .18s ease;
}
.inventory-budget-disclosure[open] > summary::after {
    transform:rotate(90deg);
}
.inventory-budget-disclosure > summary > div:first-child {
    min-width:0;
}
.inventory-budget-disclosure > summary > div:first-child > strong {
    display:block;
    margin-top:2px;
    font-size:16px;
}
.inventory-budget-summary-values {
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:18px;
    margin-left:auto;
    color:var(--muted);
    font-size:12px;
    white-space:nowrap;
}
.inventory-budget-summary-values span {
    display:block;
}
.inventory-budget-summary-values b {
    color:var(--text);
    font-size:15px;
}
.inventory-budget-details {
    padding:0 20px 18px;
    border-top:1px solid rgba(255,255,255,.06);
}
.inventory-budget-details .inventory-kpi-grid {
    margin:14px 0 0;
}
.inventory-budget-note {
    padding-top:12px;
}
.inventory-budget-selected {
    margin-top:0;
}

@media (max-width:680px) {
    .inventory-budget-disclosure > summary {
        align-items:flex-start;
        min-height:0;
        padding:14px 16px;
    }
    .inventory-budget-summary-values {
        flex-direction:column;
        align-items:flex-end;
        gap:2px;
        white-space:normal;
        text-align:right;
    }
    .inventory-budget-summary-values span {
        font-size:11px;
    }
    .inventory-budget-summary-values b {
        font-size:13px;
    }
    .inventory-budget-details {
        padding:0 16px 16px;
    }
}

@media (max-width:480px) {
    .inventory-budget-disclosure > summary {
        gap:10px;
    }
    .inventory-budget-summary-values span:first-child {
        display:none;
    }
}
