/* ═══ VARIABLES THEME ═══════════════════════════════════════════════════ */
:root {
  --bg-app:        #f5f5f0;
  --bg-card:       #ffffff;
  --bg-input:      #fafafa;
  --bg-topbar:     #1D3A7A;
  --bg-bar:        #1a1a1a;
  --bg-secondary:  #f0f0f0;
  --border:        #e0e0e0;
  --border-input:  #ddd;
  --border-light:  #eee;
  --text-main:     #1a1a1a;
  --text-muted:    #888;
  --text-hint:     #aaa;
  --text:          #1a1a2e;
  --text-secondary:#555;
  --bg-hover:      #eef2fb;
  --text-sub:      #666;
  --blue-main:     #1D3A7A;
  --blue-light:    #E6F1FB;
  --blue-text:     #185FA5;
  --green-bg:      #EAF3DE;
  --green-text:    #3B6D11;
  --green-border:  #C0DD97;
  --green-dark:    #27500A;
  --red-bg:        #FCEBEB;
  --red-text:      #A32D2D;
  --red-border:    #F7C1C1;
  --red-dark:      #791F1F;
  --amber-bg:      #faddd9;
  --amber-text:    #9c1513;
  --amber-border:  #fc1500;
  --score-color:   #1D3A7A;
  --shadow:        rgba(0,0,0,0.08);

  --blue-mid:      #2a4f9a;
  --amber-ef:      #EF9F27;
  --amber-fff3:    #FFF3CD;
  --green-badge:   #EAF3DE;
  --red-badge:     #FCEBEB;
  --blue-badge:    #E6F1FB;
  --blue-bg:       #e5f0fb;
  --blue-a1:       #1D3A7A;
  --amber-badge:   #faddd9;
  --amber-a2:      #c4241e;
  --white:         #ffffff;
  --bbb:           #bbbbbb;
  --ccc:           #cccccc;
  --red-main:      #E24B4A;
  --green-main:    #1D9E75;
  --border-tme:    #B5D4F4;
}

body.dark {
  --bg-app:        #0f1117;
  --bg-card:       #1c1f2e;
  --bg-input:      #252838;
  --bg-topbar:     #842E23;
  --bg-bar:        #080c14;
  --bg-secondary:  #252838;
  --border:        #2e3347;
  --border-input:  #3a3f54;
  --border-light:  #2e3347;
  --text-main:     #e4e6f0;
  --text-muted:    #7a80a0;
  --text-hint:     #555a70;
  --text:          #e4e6f0;
  --text-secondary:#8890b0;
  --bg-hover:      #2a2f45;
  --text-sub:      #8890b0;
  --blue-main:     #832E23;
  --blue-light:    #fba2a2;
  --blue-text:     #c45a52;
  --green-bg:      #162616;
  --green-text:    #5abf5a;
  --green-border:  #2a5a2a;
  --green-dark:    #5abf5a;
  --red-bg:        #2a1616;
  --red-text:      #e07070;
  --red-border:    #5a2525;
  --red-dark:      #e07070;
  --amber-bg:      #252e57;
  --amber-text:    #a5a1ff;
  --amber-border:  #bfcaff;
  --score-color:   #c45a52;
  --shadow:        rgba(0,0,0,0.4);

  --blue-mid:      #8F251D;
  --amber-ef:      #d4901f;
  --amber-fff3:    #2a1e0a;
  --green-badge:   #162616;
  --red-badge:     #2a1616;
  --blue-badge:    #1c0e0e;
  --blue-bg:       #323c6c;
  --blue-a1:       #c4c1fb;
  --amber-badge:   #462828;
  --amber-a2:      #f9a09d;
  --white:         #e4e6f0;
  --bbb:           #555a70;
  --ccc:           #444860;
  --red-main:      #e05555;
  --green-main:    #1a8a65;
  --border-tme:    #7e1f1f;;
}

/* ═══ BOUTON THEME ═══════════════════════════════════════════════════════ */
.btn-theme {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.1);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-theme:active { background: rgba(255,255,255,0.22); }
.btn-theme-icon {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.8);
  position: relative;
  flex-shrink: 0;
}
/* Demi-cercle pour l'icône mode */
.btn-theme-icon::after {
  content: '';
  position: absolute;
  top: 1px; left: 50%;
  width: 50%; height: calc(100% - 2px);
  background: rgba(255,255,255,0.9);
  border-radius: 0 50px 50px 0;
}

.btn-theme:active { background: rgba(255,255,255,0.25); }

/* ── Bouton thème adaptatif (écrans à fond variable) ── */
.btn-theme-adaptive {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border-input);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-theme-adaptive:active { background: var(--border-input); }
.btn-theme-adaptive .btn-theme-icon {
  border-color: var(--text-sub);
}
.btn-theme-adaptive .btn-theme-icon::after {
  background: var(--text-sub);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, system-ui, sans-serif; background: var(--bg-app); color: var(--text-main); min-height: 100vh; }
.app { display: flex; flex-direction: column; min-height: 100vh; }
.copyright-bar { background: var(--bg-bar); color: var(--text-muted); font-size: 11px; text-align: center; padding: 5px 16px; }
.copyright-bar strong { color: var(--bbb); }

/* SETUP */
.setup-screen { display: none; flex-direction: column; height: 100vh; overflow: hidden; }
.setup-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; gap: 12px; overflow-y: auto; min-height: 0; }
.setup-card-inner { width: 100%; max-width: 580px; }
.setup-topbar-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
.g3 .sf { min-width: 0; }
.sf label { display: block; font-size: 12px; color: var(--text-sub); margin-bottom: 5px; font-weight: 600; }
.sf input { width: 100%; padding: 10px 12px; border: 1px solid var(--border-input); border-radius: 10px; background: var(--bg-input); color: var(--text-main); font-size: 15px; font-family: inherit; box-sizing: border-box; height: 44px; }
.sf input:focus { outline: none; border-color: var(--blue-main); }
/* ── Picker date/heure : input display visible + input natif caché en overlay ── */
.picker-wrap { position: relative; }
.picker-display {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-input);
  border-radius: 10px; background: var(--bg-input); color: var(--text-main);
  font-size: 15px; font-family: inherit; box-sizing: border-box; height: 44px;
  cursor: pointer; caret-color: transparent; text-align: center;
}
.picker-display:focus { outline: none; border-color: var(--blue-main); }
.picker-hidden {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; z-index: 1;
}
.btn-start { width: 100%; padding: 15px; background: var(--blue-main); color: var(--white); border: none; border-radius: 12px; font-size: 17px; font-weight: 700; cursor: pointer; font-family: inherit; margin-top: 20px; }
.btn-start:active { opacity: 0.85; }

/* MAIN */
.main-screen { display: none; flex-direction: column; height: 100vh; overflow: hidden; }
.topbar { background: var(--bg-topbar); padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; }
.topbar-logo { height: 32px; object-fit: contain; cursor: pointer;  }
.match-info { font-size: 12px; color: rgba(255,255,255,0.85); flex: 1; min-width: 0; }
.match-info strong { color: var(--white); font-weight: 700; }
.match-meta { font-size: 11px; color: rgba(255,255,255,0.65); margin-top: 1px; }
.btn-end { padding: 7px 14px; border: 1.5px solid rgba(255,255,255,0.7); border-radius: 10px; background: rgba(255,255,255,0.12); color: #ffffff; font-size: 13px; cursor: pointer; font-family: inherit; font-weight: 600; }

.content { flex: 1; display: grid; grid-template-columns: 300px 1fr; grid-template-rows: auto 1fr; gap: 12px; padding: 12px; overflow-y: auto; }
.left-panel { grid-row: 1/3; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; align-self: start; max-height: calc(100vh - 80px); overflow-y: auto; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.card-title { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; font-weight: 700; }

.period-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.p-mt1 { background: var(--blue-badge); color: var(--blue-main); }
.p-mt2 { background: var(--green-badge); color: var(--green-text); }
.p-mt3  { background: #FFF3E0; color: #E65100; }
.p-prol { background: var(--amber-bg); color: var(--amber-text); }

.chrono-num { font-size: 52px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -2px; text-align: center; margin: 4px 0 10px; color: var(--blue-main); }
.row2 { display: flex; gap: 6px; }
.bc { flex: 1; padding: 11px; border-radius: 10px; border: 1px solid var(--border-input); background: transparent; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; color: var(--text-main); }
.bc.go { background: var(--blue-main); color: var(--white); border-color: var(--blue-main); }
.bc.stop { background: var(--red-main); color: var(--white); border-color: var(--red-main); }
.bc:active { opacity: .8; }

/* RECALAGE CLAVIER avec : fixe */
.recal-wrap { margin-top: 10px; }
.recal-label { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.recal-input-row { display: flex; align-items: center; gap: 4px; }
.recal-field { width: 52px; padding: 8px 4px; border: 1px solid var(--border-input); border-radius: 8px; background: var(--bg-input); color: var(--text-main); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; font-family: inherit; }
.recal-field:focus { outline: none; border-color: var(--blue-main); }
.recal-sep { font-size: 24px; font-weight: 700; color: var(--bbb); padding: 0 2px; user-select: none; }
.btn-apply { flex: 1; padding: 8px 10px; border: 1px solid var(--blue-main); border-radius: 8px; background: var(--blue-main); color: var(--white); font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; margin-left: 6px; }
.btn-apply:active { opacity: .85; }

/* SCORE */
.score-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.score-team { text-align: center; }
.stn { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.score-num { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; margin: 4px 0; color: var(--blue-main); }
.score-btns { display: flex; gap: 4px; justify-content: center; }
.bs { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border-input); background: transparent; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-main); font-family: inherit; }
.bs:active { background: var(--bg-secondary); }
.score-sep-d { font-size: 28px; color: var(--ccc); font-weight: 300; }

/* TME */
.tme-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tme-table th { font-size: 11px; color: var(--text-muted); font-weight: 600; padding: 4px 6px; text-align: center; border-bottom: 1px solid var(--border-light); }
.tme-table td { padding: 3px; text-align: center; }
.tme-cell { min-height: 32px; border-radius: 8px; border: 1px solid var(--border-light); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.tme-cell.tme-ok { background: var(--blue-badge); color: var(--blue-main); border-color: var(--border-tme); cursor: default; }

.tme-paused { display: none; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; background: var(--amber-fff3); border: 1px solid var(--amber-border); margin-top: 8px; font-size: 12px; color: var(--amber-text); font-weight: 600; }
.tme-paused.on { display: flex; }
.btn-resume { margin-left: auto; padding: 4px 10px; background: var(--blue-main); color: var(--white); border: none; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; }

.ctx-area { width: 100%; min-height: 80px; padding: 10px 12px; border: 1px solid var(--border-input); border-radius: 10px; background: var(--bg-input); color: var(--text-main); font-size: 14px; font-family: inherit; resize: none; }
.ctx-area:focus { outline: none; border-color: var(--blue-main); }

.prolong-banner { display: none; background: var(--amber-bg); border: 1px solid var(--amber-border); border-radius: 10px; padding: 12px 16px; margin: 12px 12px 0; align-items: center; justify-content: space-between; gap: 12px; }
.prolong-banner.on { display: flex; }
.prolong-banner span { font-size: 14px; color: var(--amber-text); }
.btn-prolong { padding: 9px 16px; background: var(--amber-text); color: var(--white); border: none; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; }

/* OBS FORM */

.arb-row { display: flex; gap: 8px; margin-bottom: 10px; }
.cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.ta { width: 100%; min-height: 70px; padding: 10px 12px; border: 1px solid var(--border-input); border-radius: 10px; background: var(--bg-input); color: var(--text-main); font-size: 14px; font-family: inherit; resize: none; margin-bottom: 10px; }
.ta:focus { outline: none; border-color: var(--blue-main); }

/* TABLEAU */
.obs-cnt { font-size: 12px; color: var(--text-hint); margin-left: auto; }
table.olist { width: 100%; border-collapse: collapse; font-size: 13px; }
table.olist th { font-size: 11px; color: var(--text-muted); font-weight: 600; padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border-light); white-space: nowrap; }
table.olist td { padding: 7px 8px; vertical-align: middle; }
table.olist tr.rr td { background: var(--red-bg); color: var(--red-dark); border-bottom: 1px solid var(--red-border); }
table.olist tr.rg td { background: var(--green-bg); color: var(--green-dark); border-bottom: 1px solid var(--green-border); }
table.olist tr.rr:last-child td, table.olist tr.rg:last-child td { border-bottom: none; }
table.olist tr.rr td .ba { background: var(--red-border); color: var(--red-dark); }
table.olist tr.rg td .ba { background: var(--green-border); color: var(--green-dark); }
table.olist tr.rr td .lc { font-size: 11px; font-weight: 700; color: var(--red-text); }
table.olist tr.rg td .lc { font-size: 11px; font-weight: 700; color: var(--green-text); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.empty { text-align: center; padding: 2rem; color: var(--text-hint); font-size: 14px; }

/* END */
.end-screen { display: none; flex-direction: column; min-height: 100vh; padding: 16px; gap: 12px; }
.end-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; position: relative; }
.end-header h2 { font-size: 20px; font-weight: 700; }
#ET, #ET strong, #EM { color: #000; }
body.dark #ET, body.dark #ET strong, body.dark #EM { color: var(--text-main); }
.end-acts { display: flex; gap: 8px; }
.btn-act { padding: 9px 16px; border: 1px solid var(--border-input); border-radius: 10px; background: var(--bg-card); font-size: 13px; cursor: pointer; font-family: inherit; color: var(--text-main); font-weight: 600; }
.btn-act.prim { background: var(--blue-main); color: var(--white); border-color: var(--blue-main); }
.btn-act.prim:disabled { opacity: .5; cursor: wait; }

/* TABLEAU SYNTHESE UNIFIE */
.arb-header { background: var(--blue-mid) !important; font-size: 10px !important; }

.q-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border-light); gap: 12px; }
.q-row:last-child { border-bottom: none; }
.q-left { display: flex; align-items: center; gap: 10px; flex: 1; }
.q-lbl { font-size: 14px; }
.q-st { font-size: 12px; font-weight: 700; min-width: 60px; }
.q-st.oui { color: var(--green-text); } .q-st.non { color: var(--red-text); } .q-st.pend { color: var(--text-hint); }
.yn-btns { display: flex; gap: 6px; }
.btn-yn { padding: 9px 20px; border-radius: 20px; border: 1px solid var(--border-input); background: transparent; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; color: var(--text-muted); }
.btn-yn.ysel { background: var(--green-badge); color: var(--green-text); border-color: var(--green-text); border-width: 2px; }
.btn-yn.nsel { background: var(--red-badge); color: var(--red-text); border-color: var(--red-text); border-width: 2px; }
@keyframes fl { 0%{transform:scale(1);}30%{transform:scale(.92);}60%{transform:scale(1.04);}100%{transform:scale(1);} }
.btn-yn.fl { animation: fl .28s ease; }
.gc-ta { width: 100%; min-height: 120px; padding: 12px; border: 1px solid var(--border-input); border-radius: 10px; background: var(--bg-input); color: var(--text-main); font-size: 14px; font-family: inherit; resize: none; }
.gc-ta:focus { outline: none; border-color: var(--blue-main); }
.alert-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 999; }
.alert-overlay.on { display: flex; }
.alert-box { background: var(--bg-card); border-radius: 16px; padding: 1.5rem; max-width: 340px; width: 90%; text-align: center; }
.alert-box p { font-size: 15px; margin-bottom: 1rem; line-height: 1.5; }
.alert-box button { padding: 10px 28px; background: var(--blue-main); color: var(--white); border: none; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; }

/* HISTORIQUE */
.hist-screen { display:none; flex-direction:column; min-height:100vh; background:var(--bg-app, #f5f5f0); }
.hist-header { background:var(--blue-main); padding:10px 16px; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-shrink:0; }
.hist-header h2 { color:var(--white); }
.hist-card { background:var(--bg-card); border:1px solid #e0e0e0; border-radius:14px; padding:16px; }
.hist-card-title { font-size:15px; font-weight:700; color:var(--blue-main, #1D3A7A); }
.hist-card-meta { font-size:12px; color:#888; margin-top:2px; }
.hist-card-score { font-size:24px; font-weight:700; color:var(--blue-main, #1D3A7A); text-align:right; flex-shrink:0; }
.hist-card-actions { display:flex; gap:8px; justify-content:flex-end; }
.hist-empty { text-align:center; padding:4rem 2rem; color:#aaa; font-size:15px; }

/* ── Auth screen ── */
.auth-screen { display:none; flex-direction:column; align-items:center; justify-content:center; position:fixed; top:0; left:0; width:100%; height:100%; background:var(--bg-page); padding:1rem; box-sizing:border-box; z-index:1000; overflow-y:auto; }
.setup-card { background:var(--bg-card); border:1px solid var(--border); border-radius:16px; padding:32px 28px; width:100%; max-width:400px; box-shadow:0 8px 32px rgba(0,0,0,0.08); }
.setup-logo { text-align:center; margin-bottom:16px; }
.setup-logo img { height:56px; width:auto; }
.setup-title { text-align:center; font-size:20px; font-weight:700; color:var(--text-main); margin-bottom:6px; }
.setup-subtitle { text-align:center; font-size:13px; color:var(--text-sub); margin-bottom:20px; }

/* ── Admin screen ── */
.admin-screen { display:none; flex-direction:column; min-height:100vh; background:var(--bg-page); }
.admin-header { background:var(--blue-main); padding:10px 16px; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-shrink:0; }
.admin-header h2 { color:var(--white); }
.admin-header #adminUserCount { font-size:11px; color:rgba(255,255,255,.7); }
.admin-user-row { background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:14px 16px; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.admin-user-info { display:flex; flex-direction:column; gap:4px; flex:1; min-width:0; }
.admin-user-email { font-size:14px; font-weight:700; color:var(--text-main); }
.admin-user-meta { font-size:11px; color:var(--text-hint); }
.admin-user-actions { display:flex; gap:8px; align-items:center; flex-shrink:0; }
.admin-role-badge { display:inline-block; padding:2px 8px; border-radius:20px; font-size:11px; font-weight:700; }
.role-admin { background:#e8f0ff; color:#1D3A7A; }
.btn-danger { border-color:var(--red-text,#E24B4A) !important; color:var(--red-text,#E24B4A) !important; }
body.dark .admin-user-row { background:var(--bg-card); border-color:var(--border); }
body.dark .role-admin { background:#1a2a4a; color:#8ab4f8; }

/* BANNIERE REPRISE */
.resume-banner { display:none; background:var(--blue-main); border-radius:12px; padding:14px 18px; margin-bottom:16px; align-items:center; gap:12px; }
.resume-banner.on { display:flex; }
.resume-banner-txt { flex:1; }
.resume-banner-txt strong { color:var(--white); font-size:14px; display:block; margin-bottom:2px; }
.resume-banner-txt span { color:rgba(255,255,255,0.7); font-size:12px; }
.btn-resume-match { padding:9px 16px; background:transparent; border:1px solid rgba(255,255,255,1); color:rgba(255,255,255,1); border-radius:8px; font-size:13px; font-weight:700; cursor:pointer; font-family:inherit; flex-shrink:0; }
.btn-discard-match { padding:9px 16px; background:transparent; border:1px solid rgba(255,255,255,0.4); color:rgba(255,255,255,0.8); border-radius:8px; font-size:13px; font-weight:700; cursor:pointer; font-family:inherit; flex-shrink:0; }

/* Anti-flash: appliqué avant que body soit disponible */
html.dark-init { background: #0f1117; }

/* ── Inputs / selects / textareas en mode sombre ────────────────────────── */
body.dark input,
body.dark select,
body.dark textarea {
  background: var(--bg-input);
  color: var(--text-main);
  border-color: var(--border-input);
}
body.dark input::placeholder,
body.dark textarea::placeholder {
  color: var(--text-hint);
}
body.dark .sf input {
  background: var(--bg-input);
  color: var(--text-main);
  border-color: var(--border-input);
}
/* Boutons non colorés sur fond sombre */
body.dark .bc:not(.go):not(.stop) {
  background: var(--bg-secondary);
  color: var(--text-main);
  border-color: var(--border-input);
}
body.dark .bs {
  background: var(--bg-secondary);
  color: var(--text-main);
  border-color: var(--border-input);
}
body.dark .btn-yn:not(.ysel):not(.nsel) {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-color: var(--border-input);
}
body.dark .btn-act:not(.prim) {
  background: var(--bg-secondary);
  color: var(--text-main);
  border-color: var(--border-input);
}
body.dark .btn-end {
  border-color: rgba(255,255,255,0.5);
  color: #ffffff;
}
body.dark .tme-cell:not(.tme-ok):not(.tme-gray):not(.tme-red) {
  background: var(--bg-secondary);
  color: var(--text-main);
  border-color: var(--border-input);
}
body.dark .tme-cell.tme-gray {
  background: var(--bg-secondary);
  color: var(--text-hint);
  border-color: var(--border-light);
}
body.dark .score-sep-d { color: var(--border); }
body.dark .prolong-banner { background: var(--amber-bg); border-color: var(--amber-border); }
body.dark .tme-paused { background: var(--amber-bg); border-color: var(--amber-border); color: var(--amber-text); }
body.dark table.olist th { color: var(--text-muted); border-color: var(--border-light); }
body.dark .q-row { border-color: var(--border-light); }
body.dark .copyright-bar strong { color: var(--text-muted); }
body.dark .match-info { color: rgba(255,255,255,0.9); }
body.dark .match-meta { color: rgba(255,255,255,0.6); }
body.dark .card-title { color: var(--text-muted); }
body.dark .stn { color: var(--text-muted); }
body.dark .obs-cnt { color: var(--text-hint); }
body.dark .recal-label { color: var(--text-muted); }
body.dark .empty { color: var(--text-hint); }
body.dark .btn-apply {
  background: var(--blue-main);
  border-color: var(--blue-main);
  color: var(--white);
}
body.dark .hist-card { background: var(--bg-card); border-color: var(--border); }
body.dark .hist-card-title { color: #e07060; }
body.dark .hist-card-score { color: #e07060; }
body.dark .hist-card-meta { color: var(--text-sub); }
body.dark .hist-empty { color: var(--text-hint, #666); }
body.dark .hist-card { border-color: var(--border); }
body.dark .alert-box p { color: var(--text-main); }
body.dark .alert-overlay { background: rgba(0,0,0,0.65); }

/* ── FILTRES SYNTHESE ────────────────────────────────────────────────────── */
.syn-filters {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 10px 0 4px;
  border-top: 1px solid var(--border-light);
}
.syn-filter-group {
  display: flex; align-items: center; gap: 6px;
}
.syn-filter-label {
  font-size: 10px; font-weight: 700; color: var(--text-hint);
  text-transform: uppercase; letter-spacing: 0.06em;
  white-space: nowrap; min-width: 40px;
}
.syn-filter-btns { display: flex; gap: 4px; }
.syn-fb {
  padding: 5px 11px; border-radius: 20px;
  border: 1px solid var(--border-input);
  background: transparent; color: var(--text-muted);
  font-size: 11px; font-weight: 600; cursor: pointer;
  font-family: inherit; white-space: nowrap;
  transition: all 0.15s;
}
.syn-fb.active {
  background: var(--blue-main); color: #fff;
  border-color: var(--blue-main);
}
.syn-fb:active { opacity: 0.8; }

/* Bouton suppression TME */
.tme-del-btn {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 5px;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: none;
  background: rgba(226,75,74,0.15);
  color: var(--red-main);
  font-size: 9px; font-weight: 700;
  cursor: pointer; line-height: 1;
  padding: 0; flex-shrink: 0;
  vertical-align: middle;
  transition: background 0.15s;
}
.tme-del-btn:active { background: rgba(226,75,74,0.35); }
.tme-cell.tme-ok { display: flex; align-items: center; justify-content: center; gap: 2px; }

/* ═══ RESPONSIVE MOBILE PORTRAIT (≤ 767px) ══════════════════════════════ */
@media (max-width: 767px) {

  /* ── Auth ───────────────────────────────────────────────────────────── */
  .setup-card { padding: 24px 16px; border-radius: 14px; }
  .setup-logo img { height: 44px; }
  .setup-title { font-size: 17px; }
  .setup-subtitle { font-size: 12px; margin-bottom: 16px; }

  /* ── Historique header ──────────────────────────────────────────────── */
  .hist-header { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .hist-header h2 { font-size: 16px; }
  .hist-header > div:last-child { width: 100%; justify-content: flex-end; }

  /* ── Admin header ───────────────────────────────────────────────────── */
  .admin-header { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .admin-header h2 { font-size: 16px; }
  .admin-header > div:last-child { width: 100%; justify-content: flex-end; }

  /* ── Setup ─────────────────────────────────────────────────────────── */
  .setup-screen { height: auto; min-height: 100vh; overflow-y: auto; overflow-x: hidden; }
  .setup-content { justify-content: flex-start; padding: 16px 12px; gap: 12px; }
  .setup-card-inner { border-radius: 12px; }
  .g3 { grid-template-columns: 1fr; gap: 0.6rem; }
  .setup-topbar-actions { gap: 4px; }
  .setup-topbar-actions .btn-end { padding: 5px 8px; font-size: 10px; }
  .g2 { grid-template-columns: 1fr; gap: 0.6rem; }
  .g3 .sf { min-width: 0; }
  .g3 .sf input { font-size: 14px; padding: 10px 6px; height: 44px; box-sizing: border-box; letter-spacing: -0.2px; }
  .sf input { font-size: 16px; padding: 11px 12px; } /* 16px évite le zoom auto sur iOS */
  .btn-start { font-size: 16px; padding: 14px; }

  /* ── Topbar ─────────────────────────────────────────────────────────── */
  .topbar { padding: 8px 10px; gap: 8px; flex-wrap: nowrap; }
  .topbar-logo { height: 26px; }
  .match-info { font-size: 11px; }
  .match-meta { font-size: 10px; }
  .btn-theme { padding: 5px 8px; font-size: 10px; }
  .btn-theme-icon { width: 14px; height: 14px; }
  .btn-end { padding: 6px 10px; font-size: 12px; }
  /* v1.9.1 : bandeau écran match sur 2 lignes (titre pleine largeur, puis boutons) */
  #MS .topbar { flex-wrap: wrap; row-gap: 8px; }
  #MS .match-info { flex: 1 1 calc(100% - 44px); font-size: 13px; line-height: 1.3; }
  #MS .match-meta { font-size: 11px; }
  #MS .topbar > .btn-end { flex: 1 1 0; text-align: center; margin: 0; white-space: nowrap; }
  #MS .topbar > .btn-gear, #MS .topbar > .btn-theme { flex: 0 0 auto; }
  #MS .match-info { padding-right: 14px; }

  /* ── Layout principal : colonne unique ──────────────────────────────── */
  .content {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 8px;
    padding: 8px;
  }
  .left-panel {
    order: 1;
    grid-row: auto;
    gap: 8px;
    position: static;
    max-height: none;
    overflow-y: visible;
    background: transparent;
    padding-bottom: 0;
  }
  /* Observations rapides et tableau en dessous du left-panel */
  #cardQuickNotes { order: 2; }
  #cardObsTable   { order: 3; min-height: 400px; }

  /* ── Cards ──────────────────────────────────────────────────────────── */
  .card { padding: 12px; border-radius: 12px; }
  .card-title { font-size: 10px; margin-bottom: 8px; }

  /* ── Chronomètre ────────────────────────────────────────────────────── */
  .chrono-num { font-size: 44px; margin: 2px 0 8px; }
  .bc { padding: 13px; font-size: 14px; min-height: 48px; }
  .recal-field { font-size: 18px; width: 46px; padding: 7px 4px; }
  .recal-sep { font-size: 20px; }
  .btn-apply { font-size: 12px; padding: 8px 8px; }

  /* ── Score ──────────────────────────────────────────────────────────── */
  .score-num { font-size: 36px; }
  .bs { width: 40px; height: 40px; font-size: 20px; }

  /* ── TME ────────────────────────────────────────────────────────────── */
  .tme-cell { min-height: 36px; font-size: 12px; }

  /* ── Formulaire d'observation ───────────────────────────────────────── */
  .ta { font-size: 16px; min-height: 64px; }

  /* ── Tableau observations : scroll horizontal ───────────────────────── */
  .obs-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.olist { font-size: 12px; min-width: 480px; }
  table.olist th, table.olist td { padding: 6px 6px; }

  /* ── Écran de fin ───────────────────────────────────────────────────── */
  .end-screen { padding: 10px; gap: 10px; }
  .end-header { gap: 6px; }
  .end-header h2 { font-size: 17px; }
  .end-acts { flex-wrap: wrap; }
  .btn-act { padding: 10px 14px; font-size: 13px; min-height: 44px; }

  /* ── Questions oui/non ──────────────────────────────────────────────── */
  .q-row { flex-wrap: wrap; gap: 8px; }
  .q-left { flex: 1 1 100%; }
  .yn-btns { width: 100%; justify-content: flex-end; }
  .btn-yn { padding: 10px 22px; font-size: 13px; min-height: 44px; }

  /* ── Filtres synthèse ───────────────────────────────────────────────── */
  .syn-filters { gap: 6px; }
  .syn-fb { padding: 6px 10px; font-size: 11px; min-height: 36px; }

  /* ── Bannière prolongation ──────────────────────────────────────────── */
  .prolong-banner { margin: 8px 8px 0; padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .prolong-banner span { font-size: 13px; }
  .btn-prolong { font-size: 13px; padding: 10px 14px; width: 100%; }

  /* ── Historique ─────────────────────────────────────────────────────── */
  .hist-card { padding: 12px; }
  .hist-card-actions { flex-wrap: wrap; }

  /* ── Alertes ────────────────────────────────────────────────────────── */
  .alert-box { padding: 1.2rem; }
  .alert-box p { font-size: 14px; }
  .alert-box button { padding: 12px 28px; font-size: 15px; }
}

/* ═══ QUICK NOTES — Styles pour le mode tap rapide v0.3.5 ═══════════════ */

/* ── Conteneur des zones A1/A2 ── */
#quickNotesWrap {
  display: flex; flex-direction: column; gap: 8px;
}
/* ═══ OBSERVATIONS RAPIDES v1.5.0 — grille par familles ═══════════════
   A1 = bleu de l'app, A2 = rouge du logo (#981010). */
:root {
  --a1-main:#1D3A7A; --a1-bg:#E6F1FB; --a1-border:#B5D4F4; --a1-text:#1D3A7A;
  --a2-main:#981010; --a2-bg:#FBE9E7; --a2-border:#E8B4B0; --a2-text:#7A0D0D;
  --flag-main:#92400E; --flag-bg:#FEF3C7; --flag-border:#F0D48A; --flag-text:#6B2F06;
  --qn-row-bg:#ffffff; --qn-a-bg:#FAF5E6; --qn-b-bg:#FCD9D9; --qn-c-bg:#D7DEF6; --qn-autre-bg:#E3E1DD;
}
body.dark {
  --a1-main:#3b5bb5; --a1-bg:#1e2a4a; --a1-border:#34508f; --a1-text:#b8ccff;
  --a2-main:#b32020; --a2-bg:#3a1414; --a2-border:#7a2a2a; --a2-text:#ffb4b0;
  --flag-main:#b8741a; --flag-bg:#3a2e10; --flag-border:#6b5320; --flag-text:#f6d98a;
  --qn-row-bg:#1c1f2e; --qn-a-bg:#2a2418; --qn-b-bg:#3a1e1e; --qn-c-bg:#1e2340; --qn-autre-bg:#2a2a2a;
}

.qn-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.qn-cnt-head { margin-left: 0; background: var(--bg-input); border-radius: 12px; padding: 2px 9px; }
.qn-head-spacer { flex: 1 1 0; min-width: 0; }
.qn-chip {
  font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--border); white-space: nowrap;
}
.qn-chip:empty { display: none; }
.qn-chip-a1   { background: var(--a1-bg);   color: var(--a1-text);   border-color: var(--a1-border); }
.qn-chip-a2   { background: var(--a2-bg);   color: var(--a2-text);   border-color: var(--a2-border); }
.qn-chip-flag { background: var(--flag-bg); color: var(--flag-text); border-color: var(--flag-border); }
.qn-hbtn {
  min-height: 44px; padding: 0 14px; border-radius: 10px;
  border: 1.5px solid var(--border-input); background: var(--bg-card); color: var(--text-main);
  font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.qn-hbtn:disabled { opacity: .4; cursor: default; }

/* v1.5.1 — groupes A/B/C alignés sur 7 colonnes (iPad) ; liste (iPhone) */
.qn-families { display: grid; gap: 6px; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: stretch; }
.qn-g-A { grid-column: 1 / 7; background: var(--qn-a-bg); }
.qn-g-B { grid-column: 7; background: var(--qn-b-bg); }
.qn-g-C { grid-column: 1 / 8; background: var(--qn-c-bg); }
.qn-group { border: 1px solid var(--border); border-radius: 12px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.qn-group-head { font-size: 11px; font-weight: 800; letter-spacing: .04em; color: var(--text-main); padding: 1px 2px; display: flex; align-items: center; gap: 6px; }
.qn-gshort { display: none; }
@media (min-width: 768px) {
  .qn-g-B .qn-gfull { display: none; }
  .qn-g-B .qn-gshort { display: inline; }
  .qn-g-B .qn-block-title { visibility: hidden; white-space: nowrap; overflow: hidden; } /* garde la même hauteur d'en-tête que A : SPP/SPA alignés sur les lignes de A */
}
.qn-gchip { font-size: 10px; font-weight: 800; color: #fff; border-radius: 5px; padding: 1px 6px; }
.qn-g-A .qn-gchip { background: #7A5C2E; }
.qn-g-B .qn-gchip { background: #8B1A1A; }
.qn-g-C .qn-gchip { background: #5B4B8A; }
.qn-blocks { display: grid; grid-template-columns: repeat(var(--span), minmax(0, 1fr)); column-gap: 5px; row-gap: 3px; flex: 1; }
.qn-block { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.qn-block-title { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--text-muted); padding: 0 2px; }
.qn-cells { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 5px; flex: 1; }
.qn-cell {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0;
  background: var(--qn-row-bg); box-shadow: 0 0 0 1px var(--border); border-radius: 12px; padding: 4px 3px;
}
.qn-cell-autre { background: var(--qn-autre-bg); }
.qn-rname { height: 25px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11.5px; font-weight: 700; line-height: 1.1; color: var(--text-main); }
.qn-btns { display: flex; gap: 4px; }

/* ── Boutons tap (✘ / ✔) : carrés arrondis ── */
.qn-tap {
  flex: none; width: 36px; height: 36px; border-radius: 12px; border: 1.5px solid transparent; padding: 0;
  font-size: 18px; font-weight: 800; cursor: pointer; font-family: inherit;
  position: relative; display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.qn-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.qn-tap.red   { background: var(--red-bg);   color: var(--red-dark);   border-color: var(--red-border); }
.qn-tap.green { background: var(--green-bg); color: var(--green-dark); border-color: var(--green-border); }

/* Compteur en haut à droite du bouton */
.qn-count {
  position: absolute; top: 1px; right: 4px;
  font-size: 10px; font-weight: 700; opacity: 0.7;
  min-width: 10px; text-align: center;
}

/* ── Bottom sheet détail (appui long) ── */
.qn-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}
.qn-overlay.on { display: flex; }
@media (min-width: 768px) {
  .qn-overlay { align-items: center; }
  .qn-sheet { border-radius: 20px; }
}

.qn-sheet {
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 640px;
  padding: 16px 16px 24px;
  max-height: 92vh; max-height: 92dvh;
  overscroll-behavior: contain;
  overflow-y: auto;
  animation: qnSlideUp 0.2s ease-out;
}
@keyframes qnSlideUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.qn-detail-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.qn-detail-title { font-size: 16px; font-weight: 700; }
.qn-detail-meta  { font-size: 12px; color: var(--text-muted); }

.qn-detail-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin: 10px 0 6px;
}

.qn-tags-wrap { display: flex; flex-wrap: wrap; gap: 5px; }

.qn-tag {
  font-size: 14px; padding: 7px 14px; min-height: 44px;
  border-radius: 22px;
  border: 1px solid var(--border-input);
  background: var(--bg-input);
  color: var(--text-main);
  font-weight: 600; cursor: pointer;
  font-family: inherit;
  transition: background 0.1s, border-color 0.1s;
}
.qn-tag.selected {
  background: var(--blue-badge);
  border-color: #B5D4F4;
  color: var(--blue-main);
}
body.dark .qn-tag.selected {
  background: var(--blue-main);
  border-color: var(--amber-a2);
  color: var(--text-main);
}

.qn-detail-textarea {
  width: 100%; min-height: 60px; padding: 10px 12px;
  border: 1px solid var(--border-input); border-radius: 10px;
  background: var(--bg-input); color: var(--text-main);
  font-size: 16px; font-family: inherit; resize: none; margin-top: 6px;
}
.qn-detail-textarea:focus { outline: none; border-color: var(--blue-main); }

.qn-detail-actions { display: flex; gap: 8px; margin-top: 14px; }
.qn-detail-actions button {
  flex: 1; padding: 12px; border-radius: 12px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: inherit; border: none;
}
.qn-btn-cancel {
  background: var(--bg-input); color: var(--text-muted);
  border: 1px solid var(--border) !important;
}

/* ── Fenêtre d'observation : drapeau + enregistrement par arbitre ── */
.qn-flag-btn {
  width: 100%; min-height: 48px; margin: 2px 0 4px; border-radius: 12px;
  border: 2px solid var(--flag-main); background: var(--flag-bg); color: var(--flag-text);
  font-size: 15px; font-weight: 800; font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  touch-action: manipulation;
}
.qn-flag-btn.on { background: var(--flag-main); color: #fff; }
.qn-save-zone {
  position: sticky; bottom: -24px; margin: 14px -16px -24px;
  padding: 4px 16px calc(14px + env(safe-area-inset-bottom));
  background: var(--bg-card); border-top: 1px solid var(--border);
}
.qn-save-arbs { display: flex; gap: 8px; }
.qn-save-arb {
  flex: 1 1 0; min-width: 0; min-height: 56px; padding: 6px 8px; border-radius: 12px;
  border: 2px solid transparent; font-size: 17px; font-weight: 800; color: #fff;
  font-family: inherit; cursor: pointer; overflow-wrap: anywhere; touch-action: manipulation;
}
.qn-save-a1   { background: var(--a1-main); }
.qn-save-a2   { background: var(--a2-main); }
.qn-save-both { background: var(--bg-card); color: var(--a1-text); border-color: var(--a1-main); }
.qn-save-arb.is-current { outline: 3px solid var(--text-main); outline-offset: 2px; }
.qn-btn-close {
  width: 100%; margin-top: 8px; min-height: 44px; padding: 10px; border-radius: 10px;
  font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.obs-flag { text-align: center; color: var(--flag-main); font-weight: 800; font-size: 16px; }
body.dark .obs-flag { color: #f0b45a; }

/* ── Responsive mobile (iPhone) ── */
@media (max-width: 767px) {
  .qn-head { gap: 6px; }
  .qn-chip { font-size: 12px; padding: 5px 8px; }
  .qn-hbtn { padding: 0 10px; font-size: 13px; }
  .qn-families { display: flex; flex-direction: column; gap: 8px; }
  .qn-g-A, .qn-g-B, .qn-g-C { grid-column: auto; }
  .qn-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 6px; }
  .qn-block { grid-column: auto !important; }
  .qn-cells { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 4px; }
  .qn-cell { flex-direction: row; align-items: center; padding: 3px 4px 3px 10px; gap: 6px; border-radius: 10px; }
  .qn-rname { height: auto; flex: 1; justify-content: flex-start; text-align: left; font-size: 14px; }
  .qn-tap { width: 44px; height: 44px; }
  .qn-save-arb { font-size: 15px; }
}

/* ═══ RADAR SYNTHESE v0.3.6 ═════════════════════════════════════════════ */
.syn-radar-wrap {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 20px; flex-wrap: wrap; margin-top: 12px;
}
.syn-radar-svg { flex: 1; min-width: 300px; max-width: 480px; }
.syn-detail-panel { min-width: 220px; max-width: 270px; flex-shrink: 0; }

.syn-legend { display: flex; gap: 16px; margin-bottom: 10px; }
.syn-leg { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-main); }

.syn-det-title { font-size: 12px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
.syn-det-sub { font-size: 10px; color: var(--text-hint); margin-bottom: 8px; }
.syn-det-list { display: flex; flex-direction: column; gap: 4px; }
.syn-det-row {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
}
.syn-det-name { min-width: 55px; font-weight: 600; }
.syn-det-pct { font-size: 11px; font-weight: 500; min-width: 32px; text-align: right; }

/* Barres avec chiffres intégrés */
.syn-bar-r {
  background: #F09595; color: #791F1F;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 500; min-width: 0;
}
.syn-bar-g {
  background: #97C459; color: #27500A;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 500; min-width: 0;
}

@media (max-width: 767px) {
  .syn-radar-wrap { flex-direction: column; align-items: center; }
  .syn-detail-panel { max-width: 100%; min-width: 0; width: 100%; }
}

/* === Barres histogramme avec chiffres integres v0.3.6 === */
.syn-bar {
  width: 110px; display: flex; height: 18px; border-radius: 4px;
  overflow: hidden; background: var(--bg-secondary, #eee); flex-shrink: 0;
}
.syn-bar-r {
  background: #F09595; color: #791F1F;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; min-width: 18px;
}
.syn-bar-g {
  background: #97C459; color: #27500A;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; min-width: 18px;
}
.syn-det-pct { font-size: 11px; font-weight: 600; min-width: 36px; text-align: right; }

/* ─────────────────────────────────────────────────────────────────────────
   v0.3.25 — Indicateur visuel d'autosave
   ─────────────────────────────────────────────────────────────────────────
   Petit point coloré (10 px) discret dans la topbar des écrans MS et ES,
   qui reflète l'état de la dernière tentative d'autosave.
   - .autosave-ok    : vert (état nominal, défaut après chaque autosave OK)
   - .autosave-error : rouge (la dernière tentative a échoué : quota dépassé,
                              autre erreur localStorage, etc.)
   Le tooltip natif (attribut title) donne le détail au survol.
═════════════════════════════════════════════════════════════════════════ */
.autosave-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0 8px;
  vertical-align: middle;
  flex-shrink: 0;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  cursor: help;
}
/* v0.3.26 — Variante "coin" : positionne le point en haut à droite du
   parent (qui doit avoir position: relative). Override la marge et la
   taille du .autosave-dot de base. */
.autosave-dot-corner {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 8px;
  height: 8px;
  margin: 0;
  z-index: 10;
}
.autosave-dot.autosave-ok {
  background-color: #4CAF50;
  box-shadow: 0 0 4px rgba(76, 175, 80, 0.4);
}
.autosave-dot.autosave-error {
  background-color: #E24B4A;
  box-shadow: 0 0 4px rgba(226, 75, 74, 0.6);
  animation: autosave-pulse 1.5s ease-in-out infinite;
}
@keyframes autosave-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ─────────────────────────────────────────────────────────────────────────
   v0.3.27 (FRAG-2) — Bandeau "Nouvelle version disponible"
   ─────────────────────────────────────────────────────────────────────────
   Bandeau fixe en bas de l'écran, affiché via JS quand le service worker
   détecte une mise à jour en arrière-plan. Discret mais visible, avec
   animation d'entrée douce par le bas. Z-index élevé pour passer au-dessus
   de tout (y compris les overlays de l'app).
═════════════════════════════════════════════════════════════════════════ */
.sw-update-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  background: #1D3A7A;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  max-width: calc(100vw - 32px);
  animation: sw-update-slide-in 0.3s ease-out;
}
@keyframes sw-update-slide-in {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0);    }
}
.sw-update-text {
  flex: 1;
  min-width: 0;
}
.sw-update-btn {
  background: #fff;
  color: #1D3A7A;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.sw-update-btn:hover {
  background: #f0f0f0;
}
.sw-update-close {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  font-family: inherit;
  flex-shrink: 0;
}
.sw-update-close:hover {
  color: #fff;
}

/* ═══ Filtres par colonne — v0.3.32 ═══════════════════════════════════ */
.flt-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-input);
  margin-bottom: 6px;
}
/* Titre intégré dans la barre — v0.3.33 */
.flt-title {
  margin-bottom: 0 !important;
  margin-right: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.flt-bar select {
  font-size: 12px;
  padding: 4px 6px;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  height: 28px;
}
/* Mise en évidence d'un filtre actif (valeur ≠ première option) */
.flt-bar select.flt-on {
  border-color: #1D3A7A;
  background: #e8eef8;
  color: #1D3A7A;
  font-weight: 600;
}
body.dark .flt-bar select.flt-on {
  background: #1a2a4a;
  color: #8ab4f8;
  border-color: #4a7fd4;
}
/* Badge "N filtre(s) actif(s)" */
.flt-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background: #1D3A7A;
  color: #fff;
  white-space: nowrap;
}
/* Bouton reset */
.flt-reset {
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  height: 28px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.flt-reset:disabled {
  opacity: 0.35;
  cursor: default;
}
.flt-reset.flt-reset-active {
  border-color: #c0392b;
  color: #c0392b;
}
.flt-reset.flt-reset-active:hover {
  background: #c0392b;
  color: #fff;
}
@media (max-width: 767px) {
  .flt-bar select { font-size: 11px; padding: 3px 4px; }
  .flt-badge      { font-size: 10px; }
}

/* ═══ Actions par ligne (édition / suppression) — v0.4.9 ══════════════ */
.th-actions { width: 56px; min-width: 56px; }

.obs-actions {
  vertical-align: middle;
  padding-right: 4px;
  white-space: nowrap;
}
.obs-actions-inner {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
}

/* Bouton crayon — bleu discret */
.obs-btn-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #5b8fc9;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.obs-btn-edit:hover {
  background: #ddeaf8;
  color: #1D3A7A;
}
body.dark .obs-btn-edit { color: #6fa3d8; }
body.dark .obs-btn-edit:hover { background: #1a2e4a; color: #90c2f5; }

/* Bouton croix — rouge discret */
.obs-btn-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #c9727b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.obs-btn-del:hover {
  background: #fde8ea;
  color: #c0392b;
}
body.dark .obs-btn-del { color: #d98a8a; }
body.dark .obs-btn-del:hover { background: #3a1a1a; color: #f08080; }

/* Modale de confirmation — v0.4.9 */
.confirm-sheet {
  max-width: 380px !important;
  text-align: center;
  padding: 28px 24px 20px;
}
.confirm-icon {
  margin-bottom: 12px;
}
.confirm-msg {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
  line-height: 1.4;
}
.confirm-summary {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 20px;
  line-height: 1.5;
  text-align: left;
  word-break: break-word;
}
/* Bouton Supprimer — rouge */
.qn-btn-delete {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: #c0392b;
  color: #fff;
  transition: background 0.15s;
  font-family: inherit;
}
.qn-btn-delete:hover { background: #a93226; }

/* ═══ Contrôles édition dans la popup — v0.4.11 ══════════════════════ */
.detail-edit-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--border-input);
  margin-bottom: 8px;
}
.detail-edit-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-edit-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  white-space: nowrap;
}
.detail-edit-btns {
  display: flex;
  gap: 4px;
}
/* Base des boutons de contrôle */
.edit-ctrl-arb,
.edit-ctrl-type {
  padding: 5px 12px;
  border: 1.5px solid var(--border-input);
  border-radius: 20px;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
/* Arbitre actif — bleu neutre */
.edit-ctrl-arb.edit-ctrl-active {
  background: #1D3A7A;
  color: #fff;
  border-color: #1D3A7A;
}
/* Type Non conforme actif — rouge */
.edit-ctrl-red.edit-ctrl-active {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}
/* Type Conforme actif — vert */
.edit-ctrl-green.edit-ctrl-active {
  background: #27ae60;
  color: #fff;
  border-color: #27ae60;
}
body.dark .edit-ctrl-arb,
body.dark .edit-ctrl-type {
  background: var(--bg-input);
  color: var(--text-secondary);
  border-color: var(--border-input);
}
body.dark .edit-ctrl-arb.edit-ctrl-active { background: #2a4a8a; border-color: #4a7fd4; }
body.dark .edit-ctrl-red.edit-ctrl-active  { background: #8b2020; border-color: #d45a5a; }
body.dark .edit-ctrl-green.edit-ctrl-active{ background: #1a6b35; border-color: #4ac070; }

/* ═══ HOME SCREEN — Page de garde v1.4.9 ════════════════════════════════ */
.home-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-app);
}

.home-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Stats rapides */
.home-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.home-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  text-align: center;
  flex: 1;
  min-width: 80px;
}

.home-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--blue-main);
  line-height: 1.1;
}

.home-stat-lbl {
  font-size: 11px;
  color: var(--text-hint);
  margin-top: 2px;
}
/* v1.18.8 : % conforme par bloc — mêmes seuils que le radar (≥ 70 vert, ≥ 50 orange) ;
   7 cases sur une ligne en iPad : pas de coupure dans les valeurs ni les libellés */
.home-stat-card { padding: 10px 8px; }
.home-stat-val, .home-stat-lbl { white-space: nowrap; }
.home-stat-sync { flex: 0 0 auto; white-space: nowrap; }
.home-stat-sync > span { flex-shrink: 0; }
.home-stat-val.ok  { color: var(--green-text); }
.home-stat-val.mid { color: #8a6d00; }
body.dark .home-stat-val.mid { color: #e0b84a; }
.home-stat-val.ko  { color: var(--red-text); }

.home-stat-sync {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-sub);
}

/* Bouton + Nouveau match */
.btn-home-new {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .4px;
  background: var(--blue-main);
  color: #fff;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  box-shadow: 0 3px 10px rgba(29,58,122,.25);
}

.btn-home-new:active {
  opacity: .85;
  transform: scale(.98);
}

/* En-tête liste */
.home-hist-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 4px 0 0;
}

/* Filtres */
.home-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Carte match */
.home-match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow .15s;
}

.home-match-card:hover {
  box-shadow: 0 2px 10px var(--shadow);
}

.home-match-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-match-teams {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-match-score {
  font-size: 20px;
  font-weight: 700;
  color: var(--blue-main);
  white-space: nowrap;
}

.home-match-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-sub);
}

.home-match-meta span::before {
  content: '';
}

.home-match-meta span + span::before {
  content: '· ';
  color: var(--text-hint);
  margin-right: 2px;
}

.home-match-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

@media (max-width: 767px) {
  .home-content { padding: 12px; gap: 10px; }
  .home-stat-card { padding: 8px 10px; }
  .home-stat-val { font-size: 18px; }
  .btn-home-new { font-size: 15px; padding: 14px; }
  .home-match-teams { font-size: 14px; }
  .home-match-score { font-size: 18px; }
  .home-filters { gap: 6px; }
  .home-filters input,
  .home-filters select { font-size: 14px; }
}

/* ═══ DÉBRIEF v1.6.0 — écran de fin de match ═════════════════════════════ */
.db-score-card .db-score { display: flex; align-items: flex-end; gap: 28px; flex-wrap: wrap; }
.db-score-lab { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.db-score-main { font-size: 34px; font-weight: 700; color: var(--score-color); line-height: 1.1; }
.db-score-ht { display: flex; gap: 22px; border-left: 2px dashed var(--border-input); padding-left: 22px; }
.db-score-sub { font-size: 22px; font-weight: 800; color: var(--blue-main); line-height: 1.2; }
.db-sub-title { font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text-hint); margin-left: 8px; }

.db-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
.db-flab { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.db-seg { display: inline-flex; border: 1.5px solid var(--border-input); border-radius: 10px; overflow: hidden; }
.db-seg-b {
  min-height: 36px; padding: 0 12px; border: 0; background: var(--bg-card); color: var(--text-main);
  font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.db-seg-b + .db-seg-b { border-left: 1px solid var(--border-input); }
.db-seg-b.on { background: var(--blue-main); color: #fff; }
.db-empty, .db-hint { font-size: 13px; color: var(--text-hint); padding: 8px 2px; }

.db-row {
  display: grid; grid-template-columns: 26px 96px auto minmax(90px, 150px) 34px 1fr; gap: 8px; align-items: center;
  padding: 8px 6px; border-top: 1px solid var(--border); font-size: 14px; cursor: pointer; min-width: 0;
}
.db-row.db-nocat { grid-template-columns: 26px 96px auto 34px 1fr; }
.db-row.db-flag { background: var(--flag-bg); border-radius: 8px; border-top-color: transparent; }
.db-ico { color: var(--flag-main); font-weight: 800; text-align: center; }
.db-tm { font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-tm i { font-style: normal; color: var(--text-muted); font-size: 12px; }
.db-who { display: flex; gap: 4px; flex-wrap: wrap; }
.db-cat { font-weight: 700; }
.db-note { color: var(--text-muted); min-width: 0; overflow-wrap: anywhere; }
.db-arb { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; border: 1px solid transparent; white-space: nowrap; }
.db-arb-a1 { background: var(--a1-bg); color: var(--a1-text); border-color: var(--a1-border); }
.db-arb-a2 { background: var(--a2-bg); color: var(--a2-text); border-color: var(--a2-border); }
.db-type { font-weight: 800; text-align: center; border-radius: 8px; padding: 2px 0; }
.db-type-n { background: var(--red-bg); color: var(--red-dark); }
.db-type-o { background: var(--green-bg); color: var(--green-dark); }

.db-grp { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 10px 0 2px; }
.db-crow {
  display: grid; grid-template-columns: minmax(110px, 180px) 1fr 170px 20px; gap: 10px; align-items: center;
  padding: 9px 4px; border-top: 1px solid var(--border); cursor: pointer; min-height: 44px;
}
.db-cname { font-weight: 700; font-size: 15px; }
.db-bar { height: 10px; border-radius: 6px; overflow: hidden; background: var(--bg-input); }
.db-bar i { display: block; height: 100%; }
.db-bar-n i { background: #E57B7B; }
.db-bar-o i { background: #8CC46A; }
.db-cnt { font-size: 13px; white-space: nowrap; }
.db-n { color: var(--red-dark); } .db-o { color: var(--green-dark); }
.db-chev { color: var(--text-muted); }
.db-sub { background: var(--qn-fam-bg, var(--bg-input)); border-radius: 8px; margin: 2px 0 6px 12px; padding: 2px 8px; }

.db-tl { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; }
.db-tl-lab { width: 64px; flex: none; display: flex; flex-direction: column; font-size: 11px; color: var(--text-muted); }
.db-tl-lab b { font-size: 15px; color: var(--text-main); }
.db-axis { position: relative; flex: 1; border-bottom: 3px solid var(--border-input); margin-right: 14px; }
.db-ticks { display: flex; justify-content: space-between; margin: 2px 14px 10px 74px; font-size: 11px; color: var(--text-muted); }
.db-mk {
  position: absolute; width: 28px; height: 28px; margin-left: -14px; padding: 0; border-radius: 9px; border: 1.5px solid;
  font-size: 14px; font-weight: 800; font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.db-mk-n { background: var(--red-bg); color: var(--red-dark); border-color: var(--red-border); }
.db-mk-o { background: var(--green-bg); color: var(--green-dark); border-color: var(--green-border); }
.db-mk-fl { background: var(--flag-bg); color: var(--flag-main); border-color: var(--flag-border); }
/* v1.18.5–1.18.6 : action liée = un repère, une icône par catégorie (largeur et bandes de couleur en style) */
.db-mk-m { color: var(--text-main); border-color: var(--border-input); }
.db-mk-x { font-size: 13px; letter-spacing: 1px; }
.db-mk-m .mk-n { color: var(--red-dark); }
.db-mk-m .mk-o { color: var(--green-dark); }
.db-mk-m .mk-f { color: var(--flag-main); }
.db-mk.sel { outline: 3px solid var(--text-main); outline-offset: 1px; z-index: 2; }
.db-bubble { background: var(--flag-bg); border: 1px solid var(--flag-border); border-radius: 10px; padding: 2px 8px; margin-top: 6px; }
.db-bubble .db-row { border-top: 0; }

@media (max-width: 767px) {
  .db-row { grid-template-columns: 24px 1fr auto; grid-template-areas: "i t w" "c c y" "n n n"; row-gap: 4px; }
  .db-ico { grid-area: i; } .db-tm { grid-area: t; } .db-who { grid-area: w; justify-content: flex-end; }
  .db-row.db-nocat { grid-template-areas: "i t w" "y y y" "n n n"; }
  .db-cat { grid-area: c; } .db-type { grid-area: y; width: 34px; } .db-note { grid-area: n; }
  .db-crow { grid-template-columns: 1fr 20px; grid-template-areas: "n c" "b b" "s s"; row-gap: 4px; }
  .db-cname { grid-area: n; } .db-chev { grid-area: c; } .db-bar { grid-area: b; } .db-cnt { grid-area: s; }
  .db-score-ht { border-left: 0; padding-left: 0; }
  .db-tl { flex-direction: column; gap: 4px; } .db-tl-lab { flex-direction: row; gap: 8px; align-items: baseline; width: auto; }
  .db-axis { margin-right: 14px; margin-left: 14px; width: calc(100% - 28px); flex: none; } .db-ticks { margin-left: 14px; }
}

/* ═══ Mi-temps — v1.7.0 ═══════════════════════════════════════════════ */
#mtOverlay { z-index: 190; }
.mt-sheet { max-width: 900px; }
.mt-close { width: auto; padding: 8px 16px; }
.mt-score { font-size: 17px; margin: 0 0 10px; }
.mt-score b { font-size: 24px; color: var(--navy, #1e3a7a); }
.mt-sc-lab { font-size: 12px; text-transform: uppercase; color: var(--text-sub, #666); font-weight: 700; }
.mt-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mt-rk { display: grid; grid-template-columns: 1fr 70px; gap: 4px 8px; align-items: center; padding: 6px 0; }
.mt-rk .db-cnt { grid-column: 1 / -1; }
@media (max-width: 767px) { .mt-cols { grid-template-columns: 1fr; } }
.qn-todo-btn { border-color: #5B4B8A; background: transparent; color: #5B4B8A; }
.qn-todo-btn.on { background: #5B4B8A; color: #fff; }
.db-pause-hint { font-weight: 400; text-transform: none; opacity: .7; }
.db-pause-txt { white-space: pre-wrap; font-size: 15px; }

/* ═══ Équipes et numéros — v1.7.1 ═════════════════════════════════════ */
.qn-teams { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 6px; }
.qn-team { display: flex; flex-direction: column; gap: 6px; }
.qn-nums { display: flex; flex-wrap: wrap; gap: 6px; max-width: 320px; }
.qn-num { min-height: 36px; min-width: 40px; padding: 4px 8px; font-size: 13px; border-radius: 12px; }
.qn-hbtn { min-width: 48px; font-size: 20px; }

.home-match-open { cursor: pointer; }
.home-match-open:active { opacity: .85; }

/* ═══ iPad : colonne de gauche compacte (tient sans défiler) — v1.8.3 ═══ */
@media (min-width: 768px) {
  .left-panel { gap: 6px; }
  .left-panel .card { padding: 9px 12px; }
  .left-panel .card-title { margin-bottom: 4px; }
  .left-panel .period-badge { margin-bottom: 0; padding: 2px 9px; }
  .left-panel .chrono-num { font-size: 40px; margin: 0 0 6px; letter-spacing: -1.5px; }
  .left-panel .bc { padding: 8px; min-height: 40px; }
  .left-panel .recal-wrap { margin-top: 6px; }
  .left-panel .recal-label { margin-bottom: 3px; }
  .left-panel .recal-field { font-size: 17px; padding: 5px 4px; width: 48px; }
  .left-panel .score-num { font-size: 30px; margin: 2px 0; }
  .left-panel .stn { margin-bottom: 0; }
  .left-panel .bs { width: 38px; height: 34px; }
  .left-panel .tme-cell { min-height: 28px; }
  .left-panel .tme-table th { padding: 2px 6px; }
  .left-panel .tme-table td { padding: 2px 3px; }
  .left-panel .ctx-area { min-height: 56px; height: 56px; padding: 6px 10px; }
}

/* ═══ iPhone (≤767 px) : fin de match et mi-temps — v1.8.3 ═══════════════ */
@media (max-width: 767px) {
  /* Bandeau du haut : titre sur la 1re ligne, boutons alignés sur la 2e */
  .end-header { align-items: center; row-gap: 8px; column-gap: 10px; padding-bottom: 2px; }
  .end-header .topbar-logo { height: 36px; }
  .end-header .match-info { flex: 1 1 0; min-width: 0; }
  .end-header #ET { font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
  .end-header .match-meta { font-size: 11px; line-height: 1.3; }
  .end-acts { flex: 0 0 100%; display: grid; grid-template-columns: 44px 1fr 1fr 1.5fr; gap: 8px; flex-wrap: nowrap; }
  .end-acts .btn-act { padding: 0 6px; min-height: 44px; white-space: nowrap; }
  .end-acts .btn-theme-adaptive { width: 44px; height: 44px; padding: 0; display: flex; align-items: center; justify-content: center; }

  /* Filtres des blocs : libellé à gauche, boutons sur toute la largeur */
  .db-filters { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; }
  .db-filters .db-seg { display: flex; }
  .db-filters .db-seg-b { flex: 1; padding: 0 6px; min-height: 40px; }
  .db-sub-title { display: block; margin: 2px 0 0; }

  /* « À revoir et notes » : ligne compacte (heure · arbitre · type, puis catégorie, puis note) */
  .db-row, .db-row.db-nocat { grid-template-columns: 22px 1fr auto 34px; grid-template-areas: "i t w y" ". c c c" ". n n n"; gap: 2px 8px; padding: 9px 4px; }
  .db-row.db-nocat { grid-template-areas: "i t w y" ". n n n"; }
  .db-tm { font-size: 14px; } .db-tm i { font-size: 11px; }
  .db-cat { grid-area: c; font-size: 15px; }
  .db-type { grid-area: y; width: 34px; }
  .db-note { grid-area: n; font-size: 13px; line-height: 1.35; }

  /* Écran mi-temps : en-tête fixe, score lisible, classements en 2 lignes */
  .mt-sheet { padding: 0 14px 22px; }
  .mt-sheet .qn-detail-header { position: sticky; top: 0; z-index: 3; background: var(--bg-card); padding: 14px 0 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
  .mt-sheet .qn-detail-title { font-size: 17px; }
  .mt-close { min-height: 44px; }
  .mt-score { font-size: 15px; line-height: 1.3; }
  .mt-score .mt-sc-lab { display: block; margin-bottom: 2px; }
  .mt-score b { font-size: 26px; white-space: nowrap; }
  .mt-rk { grid-template-columns: 1fr auto; grid-template-areas: "n s" "b b"; gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--border); }
  .mt-rk .db-cname { grid-area: n; }
  .mt-rk .db-cnt { grid-area: s; grid-column: auto; font-size: 13px; text-align: right; }
  .mt-rk .db-bar { grid-area: b; }
  .mt-cols { gap: 4px; }
  #mtPauseNote { min-height: 96px; font-size: 16px; }
}

/* ═══ Réglages du match — v1.12.0 : même charte que « Paramètres du match » ═══ */
#sgOverlay { z-index: 195; align-items: center; justify-content: center; }
.sg-card { background: var(--bg-card, #fff); border-radius: 14px; padding: 24px 20px 20px; width: 92%; max-width: 560px; max-height: 94vh; max-height: 94dvh; overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 8px 32px rgba(0,0,0,.25); }
.sg-title { font-size: 16px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
.sg-sub { font-size: 12px; color: var(--text-hint); }
.sg-lab { font-size: 12px; font-weight: 600; color: var(--text-hint); text-transform: uppercase; letter-spacing: .06em; margin: 18px 0 8px; }
.sg-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.sg-card .sf { margin-bottom: 0; }
.sg-card > .sf { margin-top: 10px; }
.sg-nb { display: flex; gap: 8px; }
.sg-nb button { flex: 1; padding: 9px; min-height: 44px; border-radius: 10px; border: 2px solid var(--border-input); background: var(--bg-input); color: var(--text-main); font: inherit; font-size: 14px; font-weight: 400; cursor: pointer; }
.sg-nb button.on { border-color: var(--blue-main); color: var(--blue-main); background: rgba(29,58,122,.1); font-weight: 700; }
.sg-nb button:disabled { opacity: .45; cursor: not-allowed; }
.sg-note { font-size: 12px; color: var(--text-hint); margin-top: 6px; }
.sg-wrow { display: flex; gap: 16px; justify-content: center; }
.sg-wcol { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.sg-wlab { font-size: 12px; font-weight: 600; color: var(--text-hint); }
.sg-wunit { font-size: 11px; color: var(--text-hint); }
.sg-prol { display: flex; align-items: center; gap: 10px; }
.sg-prol .sg-wunit { font-size: 12px; }
.sg-acts { display: flex; gap: 10px; margin-top: 22px; }
.sg-cancel, .sg-save { flex: 1; padding: 12px; min-height: 46px; border-radius: 10px; font: inherit; font-size: 14px; cursor: pointer; }
.sg-cancel { border: 1px solid var(--border-input); background: var(--bg-input); color: var(--text-main); }
.sg-save { border: none; background: var(--blue-main, #1D3A7A); color: #fff; font-weight: 700; }
/* Engrenage blanc, vu de face, au trait */
.btn-gear { line-height: 0; padding-top: 0; padding-bottom: 0; margin-right: 8px; color: #fff; display: inline-flex; align-items: center; justify-content: center; align-self: stretch; }
.btn-gear .ico-gear { display: block; width: 18px; height: 18px; }
@media (max-width: 767px) {
  .sg-g2 { grid-template-columns: 1fr; }
  .sg-card { padding: 20px 16px 16px; }
  /* Fin de match : « Enregistrer et retour à l'accueil » sur toute la largeur, 2e ligne */
  .end-acts { grid-template-columns: 44px 1fr 1.5fr; }
  .end-acts .btn-home-save { grid-column: 1 / -1; grid-row: 2; }
}

/* ═══ Catégories liées — v1.11.0 ═══════════════════════════════════════ */
.qn-link-btn { border-style: dashed; border-width: 2px; }
.qn-link-btn.selected { border-style: solid; }
.qn-linked-wrap { width: 100%; }
.qn-linked-wrap:empty { display: none; }
.qn-linked { border: 2px solid var(--border-input); border-radius: 14px; padding: 8px 10px 10px; margin: 6px 0; }
.qn-linked-red { border-color: var(--red-border); background: var(--red-bg); }
.qn-linked-green { border-color: var(--green-border); background: var(--green-bg); }
.qn-linked-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.qn-linked-head b { flex: 1; font-size: 16px; color: var(--text-main); }
.qn-linked-head .edit-ctrl-type { min-height: 40px; font-size: 13px; }
.qn-linked-x { border: 0; background: none; color: var(--text-secondary); font-size: 18px; min-width: 44px; min-height: 44px; cursor: pointer; font-family: inherit; }
/* v1.18.2 : dégradé posé sur la ligne entière (cases transparentes), calculé par oRow.
   shortcut: Safari antérieur à 18 répète le fond d'un <tr> dans chaque case (bug WebKit 9268,
   corrigé en 2024) ; passer par un calcul JS si un appareil plus ancien doit être pris en charge. */
table.olist tr.rm { background: var(--rm-bg, linear-gradient(90deg, var(--red-bg), var(--green-bg))); }
table.olist tr.rm td { background: transparent; color: var(--text-main); border-bottom: 1px solid var(--border-input); }
table.olist tr.rm:last-child td { border-bottom: none; }
table.olist tr.rm td .lc { font-size: 11px; font-weight: 700; }
table.olist td .lk-n, table.olist tr.rm td .lc-n { color: var(--red-text); font-weight: 700; }
table.olist td .lk-o, table.olist tr.rm td .lc-o { color: var(--green-text); font-weight: 700; }

/* ═══ Tags en ordre fixe, rangés par groupes — v1.14.0 ═════════════════ */
.qn-tgrp { width: 100%; display: grid; grid-template-columns: 92px 1fr; gap: 4px 10px; align-items: start; padding: 6px 0; border-top: 1px dashed var(--border-input); }
.qn-tgrp:first-child { border-top: 0; padding-top: 0; }
.qn-tgrp-name { font-size: 11px; font-weight: 700; color: var(--blue-text); text-transform: uppercase; letter-spacing: .04em; padding-top: 14px; }
@media (max-width: 520px) {
  .qn-tgrp { grid-template-columns: 1fr; }
  .qn-tgrp-name { padding-top: 2px; }
}

/* ═══ Débrief : radar par bloc — v1.15.0 ═══════════════════════════════ */
.db-radar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.db-radar-svg { display: block; width: 100%; max-width: 420px; margin: 0 auto; }
.db-radar-svg .rd-grid { fill: none; stroke: var(--border-input); stroke-width: 1; }
.db-radar-svg .rd-scale { font-size: 9px; fill: var(--text-hint); }
.db-radar-svg .rd-area { stroke-width: 2.5; stroke-linejoin: round; fill-opacity: .12; }
.db-radar-svg .rd-area.rd-a1 { stroke: var(--a1-main); fill: var(--a1-main); }
.db-radar-svg .rd-area.rd-a2 { stroke: var(--a2-main); fill: var(--a2-main); }
.db-radar-svg .rd-dot.rd-a1 { fill: var(--a1-main); }
.db-radar-svg .rd-dot.rd-a2 { fill: var(--a2-main); }
.db-radar-svg .rd-dot.rd-few { fill: var(--text-hint); }
.db-radar-svg .rd-lab { cursor: pointer; }
.db-radar-svg .rd-lab rect { fill: var(--bg-card); stroke: var(--border-input); }
.db-radar-svg .rd-lab.on rect { fill: var(--a1-bg); stroke: var(--a1-border); }
.db-radar-svg .rd-lab text { text-anchor: middle; }
.db-radar-svg .rd-t { font-size: 12px; font-weight: 700; fill: var(--text-main); }
.db-radar-svg .rd-n { font-size: 10px; fill: var(--text-hint); }
.db-radar-svg .rd-lab.few .rd-t { fill: var(--text-hint); }
.db-radar-leg { display: flex; gap: 16px; justify-content: center; font-size: 13px; font-weight: 600; color: var(--text-main); margin-top: 2px; }
.db-radar-leg i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.db-radar-leg .rd-leg-a1 { background: var(--a1-main); }
.db-radar-leg .rd-leg-a2 { background: var(--a2-main); }
.db-radar-dt { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.db-radar-tab { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--text-main); }
.db-radar-tab th, .db-radar-tab td { text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--border-input); }
.db-radar-tab th { font-size: 11px; color: var(--text-hint); text-transform: uppercase; font-weight: 600; }
.db-radar-tab .a1 { color: var(--a1-text); }
.db-radar-tab .a2 { color: var(--a2-text); }
.db-radar-tab .tot { font-weight: 800; white-space: nowrap; }
.db-radar-tab .tot.ok { color: var(--green-text); }
.db-radar-tab .tot.mid { color: #8a6d00; }
.db-radar-tab .tot.ko { color: var(--red-text); }
@media (max-width: 767px) { .db-radar { grid-template-columns: 1fr; } }
body.dark .db-radar-tab .tot.mid { color: #e0b84a; }

/* ═══ Préparation Suivi — v1.16.0 (js/prep.js) ═════════════════════════ */
.ps-wrap { max-width: 900px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 12px; }
#PST, #PST strong, #PSM { color: #000; }
body.dark #PST, body.dark #PST strong, body.dark #PSM { color: var(--text-main); }
.ps-intro { font-size: 13px; color: var(--text-hint); line-height: 1.45; }
.ps-info { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.ps-info .sf { margin: 0; }
.ps-val { font-size: 15px; color: var(--text-main); font-weight: 600; }
.ps-item { padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.ps-item:first-of-type { padding-top: 0; }
.ps-item:last-child { border-bottom: none; padding-bottom: 0; }
.ps-ih { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ps-ih b { font-size: 15px; color: var(--text-main); }
.ps-code { color: var(--blue-main); margin-right: 6px; font-weight: 800; }
body.dark .ps-code { color: var(--blue-text); }
.ps-sugg { font-size: 12px; color: var(--text-hint); }
.ps-sugg b { color: var(--text-main); }
.ps-notes { display: grid; grid-template-columns: repeat(11, 1fr); width: 100%; margin: 8px 0; }
.ps-notes .db-seg-b { padding: 0; min-width: 0; min-height: 40px; }
.ps-notes .db-seg-b.sugg:not(.on) { box-shadow: inset 0 0 0 2px var(--blue-main); }
.ps-seg { display: flex; width: 100%; margin: 8px 0; }
.ps-seg .db-seg-b { flex: 1; min-height: 40px; }
.ps-seg .db-seg-b.on.neg { background: var(--red-text); }
.ps-seg .db-seg-b.on.pos { background: var(--green-text); }
.gc-ta.ps-ta { min-height: 84px; }
.ps-tbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
.ps-cnt { font-size: 12px; color: var(--text-hint); }
.ps-cnt.over { color: var(--red-text); font-weight: 700; }
.btn-act.ps-copy { padding: 6px 12px; font-size: 12px; }
.btn-act.ps-warn { border-color: var(--red-text); color: var(--red-text); }
.ps-auto { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--blue-badge); color: var(--blue-main); border: 1px solid #B5D4F4; vertical-align: 1px; text-transform: none; letter-spacing: 0; }
.ps-why { font-size: 12px; color: var(--text-hint); margin-top: 4px; }
.ps-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.card > .ps-tags { margin-top: 0; }
.ps-total { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ps-total .card-title { margin-bottom: 2px; }
.ps-big { font-size: 26px; font-weight: 800; color: var(--score-color, var(--blue-main)); }
.ps-sub { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin: 10px 0 2px; }
.q-row .q-lbl small { display: block; font-size: 11px; color: var(--text-hint); }
.btn-yn.nvsel { background: var(--bg-secondary); color: var(--text-main); border-color: var(--text-hint); border-width: 2px; }
.ps-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.ps-export { display: none; white-space: pre-wrap; font-size: 13px; background: var(--bg-input); border: 1px solid var(--border-input); border-radius: 10px; padding: 12px; max-height: 340px; overflow: auto; margin-top: 10px; color: var(--text-main); }
.ps-export.on { display: block; }
/* v1.17.0 : menu des actions d'une rubrique (réduit par défaut) */
.ps-det { margin: 0 0 8px; }
.ps-det > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 2px; font-size: 13px; font-weight: 700; color: var(--blue-main); -webkit-tap-highlight-color: transparent; }
.ps-det > summary::-webkit-details-marker { display: none; }
.ps-det > summary::before { content: '▸'; color: var(--text-muted); width: 12px; }
.ps-det[open] > summary::before { content: '▾'; }
body.dark .ps-det > summary { color: var(--blue-text); }
.db-row.db-ro { cursor: default; }

/* ═══ v1.18.0 ═══════════════════════════════════════════════════════════ */
/* Observations rapides (iPad) : ↶ ↷ restent en face du titre ; si la carte est
   étroite (iPad portrait), les pastilles arbitres / ⚑ passent en 2e ligne. */
.qn-chips { display: contents; }
@media (min-width: 768px) {
  .qn-head { container-type: inline-size; }
  @container (max-width: 760px) {
    .qn-chips { display: flex; order: 10; flex: 1 0 100%; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
  }
}
/* Mi-temps : catégories des « 3 moins / mieux réussis » développables */
.mt-rk-d > summary { list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mt-rk-d > summary::-webkit-details-marker { display: none; }
.mt-rk-d > summary .db-cname::before { content: '▸ '; color: var(--text-muted); }
.mt-rk-d[open] > summary .db-cname::before { content: '▾ '; }
.mt-rk-d[open] { padding-bottom: 6px; }
/* lignes compactes : la colonne est étroite sur iPad */
.mt-rk-d .db-row, .mt-rk-d .db-row.db-nocat { grid-template-columns: 22px 1fr auto 34px; grid-template-areas: "i t w y" ". c c c" ". n n n"; gap: 2px 8px; padding: 8px 4px; }
.mt-rk-d .db-ico { grid-area: i; } .mt-rk-d .db-tm { grid-area: t; } .mt-rk-d .db-who { grid-area: w; justify-content: flex-end; }
.mt-rk-d .db-cat { grid-area: c; } .mt-rk-d .db-type { grid-area: y; width: 34px; } .mt-rk-d .db-note { grid-area: n; font-size: 13px; }
@media (max-width: 767px) {
  .ps-info { grid-template-columns: 1fr; }
  .yn-btns.ps-yn .btn-yn { padding: 9px 12px; }
  .end-header #PST { font-size: 15px; line-height: 1.25; }
  /* Fin de match : « Préparation Suivi » sur toute la largeur, 3e ligne */
  .end-acts .btn-prep { grid-column: 1 / -1; grid-row: 3; }
}
