/* Grille commune : un même rythme d’espacement et des commandes alignées.
   Les vues de table conservent leurs dimensions et leur défilement propres. */
:root { color-scheme:dark; --space-1:8px; --space-2:12px; --space-3:18px; --space-4:24px; --control-height:46px; }
html,body { min-width:320px; }
main { width:calc(100% - 195px); margin-left:195px; }
main>header { align-items:center; min-height:110px; gap:24px; }
main>header>div:first-child { min-width:0; }
main>header h1 { margin-bottom:6px; }
.header-actions { flex-shrink:0; justify-content:flex-end; gap:10px; }
.header-actions>.primary,.header-actions>.secondary { min-height:42px; display:inline-flex; align-items:center; justify-content:center; }
main>section { min-width:0; }
.panel { min-width:0; }
.panel-head { gap:18px; align-items:center; }
.panel-head>div { min-width:0; }
.panel-head h2 { margin-bottom:6px; }
.panel-head p { margin-bottom:0; }
.toolbar { display:grid; grid-template-columns:minmax(220px,1fr) minmax(180px,.8fr); align-items:center; gap:14px; }
.toolbar.has-demo-loader { grid-template-columns:auto minmax(220px,1fr) minmax(180px,.8fr); }
.toolbar .filters { display:grid; grid-template-columns:1fr 1fr; min-width:0; gap:10px; }
.toolbar input,.toolbar select,.toolbar>button { min-height:var(--control-height); width:100%; }
.section-intro { align-items:flex-end; gap:18px; }
.stats-filters { align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.stats-filters select { min-height:42px; min-width:170px; }
.form-grid { align-items:start; gap:18px; }
.form-grid>label { min-width:0; }
.form-grid>label>input,.form-grid>label>select { min-height:var(--control-height); }
.form-grid>label>textarea { min-height:78px; }
.modal-actions { align-items:center; gap:12px; }
.modal-actions>button { min-height:42px; }
.bank-heading { gap:22px; align-items:center; }
.bankroll-form-card { display:flex; flex-direction:column; }
.bankroll-form-card>p { min-height:40px; }
.bankroll-form-card form { display:flex; flex-direction:column; gap:14px; height:100%; }
.bankroll-form-card form>button { align-self:flex-start; margin-top:auto; }
.bankroll-form-card form>.form-grid { grid-template-columns:repeat(auto-fit,minmax(105px,1fr)); }
.calendar-controls { align-items:center; }
.calendar-controls>button { min-height:36px; }
.calendar-key { flex-wrap:wrap; }
.account-stat-grid>div { display:flex; flex-direction:column; justify-content:space-between; gap:9px; }
.account-stat-grid span { margin:0; min-height:30px; }
/* La barre des mains est une seule grille, avec les mêmes hauteurs de champs. */
.hand-section-intro { display:block; margin:22px 0 16px; }
.hand-section-heading { margin-bottom:22px; }
.hand-section-heading p { max-width:none; }
#handsView .hand-list-filters { width:100%; display:grid; grid-template-columns:minmax(180px,1.12fr) minmax(170px,1.08fr) minmax(135px,.85fr) minmax(135px,.85fr) minmax(170px,1.08fr); gap:12px; align-items:end; }
#handsView .hand-list-filters label { display:flex; flex-direction:column; max-width:none; width:100%; min-width:0; gap:8px; margin:0; }
#handsView .hand-unit-field { display:flex; flex-direction:column; gap:8px; min-width:0; }
#handsView .filter-label { color:#dbc4c7; font-size:12px; line-height:1.5; }
#handsView .hand-list-filters .segmented { display:flex; width:100%; min-height:var(--control-height); padding:4px; align-self:stretch; box-sizing:border-box; }
#handsView .hand-list-filters .segmented button { flex:1; min-width:0; min-height:36px; display:flex; align-items:center; justify-content:center; padding:7px 10px; font-size:12px; white-space:nowrap; }
#handsView .hand-list-filters input,#handsView .hand-list-filters select { width:100%; min-width:0; height:var(--control-height); min-height:var(--control-height); margin:0; padding:11px 12px; font-size:12px; }
#handsView input[type=date] { -webkit-appearance:none; appearance:none; text-align:left; line-height:22px; }
#handsView input[type=date]::-webkit-date-and-time-value { text-align:left; }
#handsView .hand-history-tools { display:grid; grid-template-columns:minmax(210px,auto) minmax(220px,1fr) minmax(180px,.6fr); gap:12px; align-items:center; margin:0 0 16px; }
#handsView .hand-history-tools>button,#handsView .hand-history-tools>input,#handsView .hand-history-tools>select { min-height:var(--control-height); width:100%; min-width:0; max-width:none; margin:0; }
#handsView .hand-demo-tools { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin:0 0 24px; }
#handsView .hand-demo-tools button { min-height:42px; }
#handsView .journal-cards { align-items:start; }
#handsView .journal-head { align-items:center; gap:16px; }
#handsView .card-actions { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
#handsView .card-actions>.primary { min-height:38px; }
@media(max-width:1280px){
  #handsView .hand-list-filters { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #handsView .hand-history-tools { grid-template-columns:minmax(180px,auto) minmax(200px,1fr); }
  #handsView .hand-history-tools>select { grid-column:1/-1; }
}
@media(max-width:1050px){
  main>header { align-items:flex-start; }
  .header-actions { flex-wrap:wrap; }
  .toolbar.has-demo-loader { grid-template-columns:auto minmax(220px,1fr); }
  .toolbar>input { grid-column:1/-1; }
}
@media(max-width:900px){ main { width:calc(100% - 175px); margin-left:175px; } }
@media(max-width:700px){
  main { width:100%; margin-left:0; padding:0 17px 26px; }
  .sidebar { width:100%; padding:15px 17px; }
  .sidebar nav { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; margin-top:15px; width:100%; }
  .sidebar nav button { width:100%; padding:10px 7px; text-align:center; min-width:0; font-size:12px; }
  main>header { min-height:0; padding:16px 0 14px; flex-direction:column; gap:12px; align-items:stretch; }
  .header-actions { width:100%; justify-content:flex-end; gap:8px; }
  .header-actions>.primary,.header-actions>.secondary { min-height:44px; font-size:13px; }
  .header-actions .profile-dropdown { margin-left:auto; }
  .section-intro { align-items:stretch; flex-direction:column; }
  .stats-filters { justify-content:stretch; display:grid; grid-template-columns:1fr 1fr; gap:10px; width:100%; }
  .stats-filters select { width:100%; min-width:0; }
  .toolbar,.toolbar.has-demo-loader { grid-template-columns:1fr; gap:12px; }
  .toolbar>input { grid-column:auto; }
  .toolbar .filters { width:100%; }
  .panel-head { align-items:flex-start; gap:14px; flex-wrap:wrap; }
  .bank-heading { align-items:stretch; flex-direction:column; gap:14px; }
  .bank-heading>.primary { align-self:flex-start; }
  .bankroll-form-card>p { min-height:0; }
  #handsView .hand-list-filters { grid-template-columns:1fr 1fr; gap:12px; }
  #handsView .hand-unit-field { grid-column:1/-1; }
  #handsView .hand-list-filters>label:nth-child(2),#handsView .hand-list-filters>label:last-child { grid-column:1/-1; }
  #handsView .hand-history-tools { grid-template-columns:1fr; gap:12px; }
  #handsView .hand-history-tools>select { grid-column:auto; }
  #handsView .hand-history-tools>button { white-space:normal; }
  #handsView .hand-section-heading { margin-bottom:19px; }
  .account-stat-grid { gap:10px; }
}
@media(max-width:380px){ .header-actions>.primary,.header-actions>.secondary{padding:9px 10px;font-size:12px;} .calendar-controls{width:100%;justify-content:space-between;} }
/* Compteurs sociaux : visibles dans le tracker sans alourdir la navigation. */
.tracker-social-counts { border:0; background:transparent; color:var(--muted,#b09fa2); font-size:12px; padding:8px 0; max-width:190px; line-height:1.5; text-align:right; }
.account-social-summary { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:16px; margin:18px 0; border:1px solid var(--line,#452a2f); border-radius:12px; background:#1a0f11; }
.account-social-summary h3,.account-social-summary p { margin:0 0 7px; }
.account-social-summary>div { min-width:0; overflow-wrap:anywhere; }
.account-social-summary .secondary { flex-shrink:0; }
@media(max-width:700px){.tracker-social-counts{max-width:none;flex:1;text-align:left;}.account-social-summary{align-items:flex-start;flex-direction:column;}}

/* Le type et les limites contrôlent le graphique comme les résultats détaillés. */
#analyticsView .stats-stake-filter { display:flex; flex-direction:column; gap:6px; color:var(--muted,#bdafb1); font-size:12px; min-width:150px; margin:0; }
#analyticsView .stats-stake-filter select { min-height:42px; width:100%; }
.session-edit-help { margin:0 22px 12px; color:#e3bac1; font-size:12px; }
.session-edit-mode tr[data-session-row] { cursor:pointer; }
@media(hover:hover){.session-edit-mode tr[data-session-row]:hover td { background:#321e22; }}
.session-edit-mode tr[data-session-row]:focus-visible { outline:2px solid #ed5262; outline-offset:-2px; }
#toggleSessionEdit[aria-pressed=true] { background:#78323e; border-color:#d56b80; color:#fff; }
.session-break-toggle { display:flex; align-items:center; gap:10px; flex-direction:row; margin:0; }
.session-break-toggle input { width:18px; min-width:18px; height:18px; margin:0; accent-color:#ed5262; }
.profile-person-icon { display:block; width:22px; height:22px; flex:0 0 auto; }
.river-profile-avatar.large .profile-person-icon { width:46px; height:46px; }
#handsView .hand-history-tools { grid-template-columns:minmax(210px,auto) minmax(220px,1fr); }
@media(max-width:700px){
 #handsView .hand-history-tools {grid-template-columns:minmax(0,1fr);}
 .session-edit-help {margin-inline:16px;}
}

/* Sur mobile, les compteurs occupent leur ligne sans couper un nombre. */
@media(max-width:700px){
 .header-actions>.tracker-social-counts { flex:1 0 100%; max-width:none; text-align:center; white-space:nowrap; padding:4px 0; }
}

/* Comparaisons en EUR : bloc dépliable, replié par défaut. */
.fx-fold { padding:0; margin-top:24px; }
.fx-fold>summary { list-style:none; display:flex; align-items:center; justify-content:space-between; gap:14px; min-height:44px; padding:18px 22px; cursor:pointer; }
.fx-fold>summary::-webkit-details-marker { display:none; }
.fx-fold>summary b { display:block; font-size:16px; font-weight:650; }
.fx-fold>summary small { display:block; margin-top:3px; font-size:12px; color:var(--muted); font-weight:400; }
.fx-fold>summary::after { content:""; flex:none; width:8px; height:8px; border-right:2px solid var(--muted); border-bottom:2px solid var(--muted); transform:rotate(45deg); transition:transform .2s ease; margin-right:4px; }
.fx-fold[open]>summary::after { transform:rotate(-135deg); }
.fx-fold>summary:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; border-radius:inherit; }
.fx-fold-body { padding:0 22px 22px; border-top:1px solid var(--border); }
.fx-fold-body>p { margin:16px 0 14px; color:var(--muted); font-size:12px; line-height:1.8; }
.fx-fold-body form { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:14px; align-items:end; }
.fx-fold-body label { display:flex; flex-direction:column; gap:7px; font-size:12px; }
.fx-fold-body input,.fx-fold-body form>button { height:44px; box-sizing:border-box; margin:0; }
.fx-fold-body form>button { align-self:end; }
@media(max-width:600px) { .fx-fold>summary { padding:15px 17px; } .fx-fold-body { padding:0 17px 18px; } .fx-fold-body form { grid-template-columns:1fr; } }
@media(prefers-reduced-motion:reduce) { .fx-fold>summary::after { transition:none; } }

/* Sept rubriques dans le menu mobile : quatre colonnes au lieu de trois. */
@media(max-width:700px) {
  .sidebar nav { grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
  .sidebar nav button { padding:10px 2px; font-size:12px; }
}
.fx-fold[open]>.fx-fold-body { animation:fx-fold-open .3s cubic-bezier(.2,.8,.2,1); }
@keyframes fx-fold-open { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }
@media(prefers-reduced-motion:reduce){ .fx-fold[open]>.fx-fold-body { animation:none; } }
