:root {
  font-family: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 16px;
  font-synthesis: none;
  --ink: #12213d;
  --muted: #526482;
  --line: #dde4ef;
  --paper: #fff;
  --canvas: #f3f5fa;
  --primary: #124cd5;
  --sidebar-bg: #0d1934;
  --sidebar-text: #bdcbe5;
  --radius: 16px;
}

:root, [data-theme] {
  --primary-hover: color-mix(in srgb, var(--primary) 79%, black);
  --tint: color-mix(in srgb, var(--primary) 9%, white);
  --accent-border: color-mix(in srgb, var(--primary) 35%, white);
  --sidebar-hover: color-mix(in srgb, var(--sidebar-bg) 88%, var(--sidebar-text));
  --sidebar-active: color-mix(in srgb, var(--sidebar-bg) 64%, var(--primary));
}

[data-theme="bleu"] {
  --ink: #12213d; --muted: #526482; --line: #dde4ef; --canvas: #f3f5fa;
  --primary: #124cd5; --sidebar-bg: #0d1934; --sidebar-text: #bdcbe5;
}
[data-theme="ardoise"] {
  --ink: #202b38; --muted: #4c5c6c; --line: #dae0e7; --canvas: #f1f4f7;
  --primary: #39536b; --sidebar-bg: #202c39; --sidebar-text: #d5e0ea;
}
[data-theme="emeraude"] {
  --ink: #103226; --muted: #405e51; --line: #d0e5dc; --canvas: #edf7f2;
  --primary: #077052; --sidebar-bg: #103d31; --sidebar-text: #bfe6d5;
}
[data-theme="violet"] {
  --ink: #281b40; --muted: #5c5070; --line: #e3daef; --canvas: #f7f2fd;
  --primary: #6337ac; --sidebar-bg: #291648; --sidebar-text: #ded2f2;
}
[data-theme="ambre"] {
  --ink: #38271a; --muted: #645345; --line: #ecdfca; --canvas: #fff8ee;
  --primary: #8c4a06; --sidebar-bg: #402809; --sidebar-text: #f0daba;
}
[data-theme="rouge"] {
  --ink: #401d27; --muted: #754d58; --line: #ecdbe0; --canvas: #fff3f5;
  --primary: #a32650; --sidebar-bg: #471327; --sidebar-text: #f1cbd6;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; background: var(--canvas); color: var(--ink); }
a { color: inherit; }
h1, h2, p { margin-top: 0; }
h1, h2 { letter-spacing: -.025em; line-height: 1.12; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 4vw, 2.9rem); margin-bottom: .45rem; }
h2 { font-size: 1.18rem; margin-bottom: .35rem; }
p { line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.skip-link { position: absolute; z-index: 4; top: .7rem; left: .7rem; padding: .75rem; background: white; transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.muted { color: var(--muted); }

.app-page { min-height: 100vh; display: grid; grid-template-columns: 15.3rem minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100dvh; z-index: 1;
  display: flex; flex-direction: column; padding: 1.65rem 1rem 1.1rem;
  background: var(--sidebar-bg); color: var(--sidebar-text);
}
.brand {
  display: inline-flex; align-items: center; gap: .65rem; text-decoration: none;
  color: white; font-size: 1.31rem; font-weight: 500; letter-spacing: -.045em;
}
.sidebar .brand { padding: .2rem .55rem 0; margin-bottom: 2.35rem; }
.brand strong { font-weight: 800; }
.brand-mark {
  width: 2rem; height: 2rem; border-radius: 10px; display: inline-block; flex-shrink: 0;
  background: url('/assets/icone.png') center / contain no-repeat;
}
.sidebar nav { display: grid; gap: .35rem; }
.nav-link {
  display: flex; align-items: center; gap: .72rem; padding: .72rem .73rem;
  border-radius: 10px; font-size: .94rem; font-weight: 650; text-decoration: none;
  color: var(--sidebar-text);
}
.nav-link:hover { color: white; background: var(--sidebar-hover); }
.nav-link.selected { color: white; background: var(--sidebar-active); box-shadow: inset 2px 0 var(--accent-border); }
.nav-icon { display: grid; place-items: center; font-size: 1rem; width: 1.25rem; height: 1.25rem; }
.sidebar-bottom { position: relative; margin-top: auto; border-top: 1px solid var(--sidebar-hover); padding: .55rem 0 0; }
.account { display: flex; list-style: none; gap: .57rem; align-items: center; padding: .52rem .55rem; border-radius: 8px; }
.account:hover, .sidebar-bottom[open] .account { background: var(--sidebar-hover); }
.account::-webkit-details-marker { display: none; }
.account::after {
  content: ""; width: .45rem; height: .45rem; flex-shrink: 0; margin: 0 .1rem .2rem 0;
  border-right: 2px solid #dbe6fb; border-bottom: 2px solid #dbe6fb; transform: rotate(45deg);
}
.sidebar-bottom[open] .account::after { transform: rotate(225deg); margin-bottom: 0; }
.account-copy { min-width: 0; flex: 1; }
.account-copy strong, .account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: .86rem; color: #fff; }
.account-copy small { font-size: .75rem; color: var(--sidebar-text); }
.avatar {
  display: inline-grid; place-items: center; background: var(--sidebar-active); color: #fff;
  font-weight: 750; border-radius: 50%; width: 2.1rem; height: 2.1rem; flex-shrink: 0;
}
.player-avatar { background: var(--tint); color: var(--primary-hover); }
.profile-actions {
  position: absolute; bottom: calc(100% + .35rem); inset-inline: 0; z-index: 3; display: grid; gap: .15rem;
  background: var(--sidebar-hover); border: 1px solid var(--sidebar-active); border-radius: 10px; padding: .3rem;
  box-shadow: 0 8px 18px #070d1f6b;
}
.profile-action {
  display: block; width: 100%; background: transparent; border: 0; color: #eef4ff; padding: .6rem;
  text-decoration: none; text-align: left; border-radius: 6px; font-size: .9rem; font-weight: 700;
}
.profile-action:hover { background: var(--sidebar-active); }

.workspace { min-width: 0; }
.topbar {
  min-height: 4.15rem; display: flex; justify-content: space-between; align-items: center; gap: .8rem;
  padding: .65rem clamp(1rem, 3.7vw, 3rem); background: var(--paper); border-bottom: 1px solid var(--line);
}
.topbar > span { color: #384968; font-size: .93rem; font-weight: 700; overflow-wrap: anywhere; }
.mode {
  display: inline-flex; align-items: center; gap: .42rem; white-space: nowrap; text-decoration: none;
  padding: .4rem .62rem; background: var(--tint); color: var(--primary-hover); border-radius: 7px;
  font-size: .82rem; font-weight: 700;
}
.mode i { width: .43rem; height: .43rem; border-radius: 50%; background: var(--primary); }
.mode:hover { background: color-mix(in srgb, var(--primary) 15%, white); }
.main { max-width: 90rem; margin-inline: auto; padding: clamp(1.1rem, 3.7vw, 3rem); }
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem;
  margin-bottom: 1.4rem;
}
.page-head p { color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 2.7rem; border-radius: 8px; border: 1px solid transparent; padding: .55rem .92rem;
  font-size: .9rem; font-weight: 720; line-height: 1.25; text-decoration: none; text-align: center;
}
.primary { background: var(--primary); color: white; }
.primary:hover { background: var(--primary-hover); }
.secondary { background: var(--paper); border-color: var(--line); color: var(--primary-hover); }
.secondary:hover:not(:disabled) { background: var(--tint); border-color: var(--accent-border); }
.on-dark { background: var(--paper); color: var(--primary-hover); }
.on-dark:hover { background: var(--tint); }
.danger { background: #a62036; color: white; }
.danger:hover { background: #841529; }
.compact { min-height: 2.25rem; padding: .42rem .6rem; font-size: .83rem; }
.full { width: 100%; }
.text-link { color: var(--primary); font-weight: 700; text-underline-offset: 3px; overflow-wrap: anywhere; }
.back { display: inline-block; margin-bottom: 1rem; }

.hero {
  overflow: hidden; border-radius: var(--radius); min-height: 17rem;
  display: flex; align-items: center;
  background: var(--sidebar-bg);
  color: #fff; margin-bottom: 1.15rem;
}
.hero-content { width: min(43rem, 100%); padding: 1.75rem clamp(1.15rem, 4vw, 2.6rem); }
.cover { position: relative; isolation: isolate; }
.cover::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, var(--sidebar-bg), color-mix(in srgb, var(--sidebar-bg) 80%, transparent) 47%,
    color-mix(in srgb, var(--sidebar-bg) 32%, transparent));
}
.cover-image { position: absolute; width: 100%; height: 100%; inset: 0; object-fit: cover; object-position: 65% 54%; z-index: -2; }
.hero h2 { font-size: clamp(1.75rem, 3.8vw, 2.9rem); letter-spacing: -.042em; margin-bottom: .65rem; }
.kicker {
  display: block; margin: 0 0 .5rem; text-transform: uppercase; font-size: .8rem;
  font-weight: 800; letter-spacing: .13em; color: var(--sidebar-text);
}
.hero-details { color: #dbe6fd; margin-bottom: 1.1rem; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.metric {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: 1rem .95rem; background: white; border: 1px solid var(--line); border-radius: 12px;
}
.metric p { color: var(--muted); font-size: .86rem; font-weight: 680; line-height: 1.3; margin: .05rem 0 .29rem; }
.metric strong { display: block; font-size: 1.85rem; letter-spacing: -.04em; line-height: 1.15; }
.metric small { display: block; font-size: .79rem; color: var(--muted); }
.metric strong small { display: inline; font-size: .95rem; font-weight: 650; letter-spacing: 0; }
.metric-icon { display: grid; place-items: center; flex-shrink: 0; width: 2.28rem; height: 2.28rem; border-radius: 9px; font-weight: 850; }
.metric-icon.blue { color: var(--primary-hover); background: var(--tint); }
.metric-icon.teal { color: #146e65; background: #def5ef; }
.metric-icon.gold { color: #855212; background: #fff0d8; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); margin-bottom: 1rem; }
.panel-heading { padding: .95rem 1.1rem; display: flex; align-items: center; gap: .7rem; justify-content: space-between; }
.panel-heading h2 { margin: 0; }
.panel-empty { margin: 0; border-top: 1px solid var(--line); padding: 1.2rem 1.1rem; color: var(--muted); }
.empty-inline, .action-panel { display: flex; align-items: center; justify-content: space-between; gap: .9rem; padding: 1.1rem; }
.empty-inline p, .action-panel p { color: var(--muted); margin: .3rem 0 0; }
.list-row {
  display: flex; align-items: center; gap: .75rem; padding: .75rem 1.1rem;
  border-top: 1px solid #e8edf5; text-decoration: none;
}
a.list-row:hover { background: #f2f6ff; }
a.list-row:last-child { border-radius: 0 0 var(--radius) var(--radius); }
a.list-row:focus-visible { outline-offset: -3px; }
.row-info { display: grid; flex: 1; min-width: 0; gap: .15rem; overflow-wrap: anywhere; }
.row-info > strong { font-weight: 740; }
.row-info > span { color: var(--muted); font-size: .88rem; }
.substitute-panel { scroll-margin-top: 8rem; }
.substitute-list { margin: 0; padding: 0; list-style: none; }
.substitute-list li {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  border-top: 1px solid var(--line); padding-inline: .65rem;
}
.substitute-list .list-row { border: 0; padding-inline: .5rem; }
.roster-rank, .roster-moves { display: flex; align-items: center; gap: .24rem; }
.reorder-position { min-width: 1.35rem; text-align: center; font-size: .85rem; font-weight: 750; color: var(--muted); }
.reorder-handle {
  display: grid; place-items: center; width: 1.9rem; min-height: 2.15rem;
  border: 0; border-radius: 5px; color: var(--primary-hover); background: transparent; cursor: grab;
}
.reorder-handle:hover, .reorder-handle:focus-visible { background: var(--tint); }
.reorder-handle:active { cursor: grabbing; }
.drag-grip { width: .85rem; height: .65rem; border-block: 1.5px solid currentColor; position: relative; }
.drag-grip::after { content: ""; position: absolute; inset: 50% 0 auto; border-top: 1.5px solid currentColor; }
.roster-moves .button { min-width: 2rem; padding-inline: .35rem; }
.roster-moves [aria-disabled="true"] { opacity: .4; cursor: default; }
.substitute-list li.is-dragging { opacity: .5; }
.substitute-list [data-drop-position]::after {
  content: ""; pointer-events: none; position: absolute; inset-inline: .65rem; border-top: 3px solid var(--primary);
}
.substitute-list [data-drop-position="before"]::after { top: 0; }
.substitute-list [data-drop-position="after"]::after { bottom: 0; }
.roster-order-help, .roster-order-actions, .roster-error { margin: .3rem 1.1rem .9rem; }
.roster-order-actions { margin-top: .85rem; }
.offer-summary { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.offer-recipients { margin: 0; padding: 0; list-style: none; }
.offer-recipients label {
  display: grid; grid-template-columns: 2rem 1.15rem minmax(0, 1fr); align-items: center; gap: .7rem;
  min-height: 2.75rem; padding: .4rem .55rem; border-top: 1px solid var(--line); cursor: pointer;
  overflow-wrap: anywhere;
}
.offer-recipients label:has(input:checked) { background: var(--tint); }
.offer-recipients input { width: 1.1rem; min-height: 1.1rem; margin: 0; padding: 0; accent-color: var(--primary); }
.offer-rank { font-weight: 750; text-align: center; color: var(--muted); }
.offer-selection-status { margin: 0; font-size: .9rem; }
@media (max-width: 34rem) {
  .substitute-list li { padding-inline: .25rem; }
  .substitute-list .player-avatar { display: none; }
  .roster-moves { flex-direction: column; gap: .12rem; }
  .roster-moves .button { min-height: 1.8rem; padding-block: .12rem; }
}
.date-tile {
  display: grid; place-items: center; width: 3rem; border-radius: 9px; padding: .35rem 0; flex-shrink: 0;
  background: #eaf0ff; color: #214eaa;
}
.date-tile span { font-size: .73rem; text-transform: uppercase; font-weight: 750; }
.date-tile strong { font-size: 1.32rem; line-height: 1.06; }
.pill {
  display: inline-block; padding: .25rem .56rem; border-radius: 99px; font-size: .81rem;
  font-weight: 750; line-height: 1.2; text-align: center;
}
.pill.pending { background: #eef2f8; color: #344971; }
.pill.yes { background: #daf3e9; color: #0e654d; }
.pill.maybe { background: #fff1ce; color: #744504; }
.pill.no { background: #fbe4ea; color: #94263f; }
.pill.expired, .pill.withdrawn { background: #eceef4; color: #525c73; }
.inline-form { display: flex; gap: .45rem; align-items: center; }
.inline-form select { width: auto; min-height: 2.25rem; font-size: .84rem; }
.game-notes { padding: .85rem 1rem; border-left: 3px solid var(--accent-border); background: var(--tint); white-space: pre-wrap; overflow-wrap: anywhere; }
.cancel { margin: 1.2rem 0; color: #8c2139; }
.cancel form { max-width: 33rem; padding: .6rem 0; }

.form-panel { padding: clamp(1rem, 2.4vw, 1.55rem); max-width: 52rem; }
.form-panel h2 { margin-bottom: .85rem; }
.form-grid { display: grid; gap: .95rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .95rem; }
.fieldset { min-width: 0; display: grid; gap: .8rem; border: 1px solid var(--line); border-radius: 10px; padding: .75rem; margin: 0; }
.fieldset legend { padding: 0 .35rem; font-weight: 750; }
.fieldset p { margin: 0; font-size: .88rem; }
.duration-field { min-width: 0; border: 0; padding: 0; margin: 0; }
.duration-field legend { padding: 0; margin-bottom: .25rem; font-size: .93rem; }
.duration-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 6.5rem)); gap: .55rem; }
.duration-inputs label { font-size: .83rem; color: var(--muted); }
.reminder-options { display: grid; gap: .85rem; padding-left: .8rem; border-left: 2px solid var(--line); }
.reminder-toggle:has(input:not(:checked)) + .reminder-options { display: none; }
.reminder-advanced .field-hint { margin-top: .45rem; }
.theme-options, .banner-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(8rem, 100%), 1fr)); gap: .5rem; }
.banner-options { grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr)); }
.theme-option, .banner-option {
  display: grid; gap: .35rem; align-content: start; padding: .48rem; border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer;
}
.theme-option { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.theme-option > span:last-child { grid-column: 1 / -1; }
.theme-option > span:last-child, .banner-option > span { font-size: .86rem; }
.theme-option:has(input:checked), .banner-option:has(input:checked) { border-color: var(--primary); background: var(--tint); }
.theme-option > input, .banner-option input { width: 1rem; min-height: 1rem; margin: 0; padding: 0; accent-color: var(--primary); }
.theme-samples { display: grid; grid-template-columns: 1fr 2fr 1fr; height: 1.45rem; overflow: hidden; border-radius: 5px; border: 1px solid var(--line); }
.theme-samples i:nth-child(1) { background: var(--sidebar-bg); }
.theme-samples i:nth-child(2) { background: var(--canvas); }
.theme-samples i:nth-child(3) { background: var(--primary); }
.banner-option img, .banner-preview { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 6px; }
.banner-preview { width: min(15rem, 100%); }
.banner-current-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.banner-library .banner-options { margin-top: .5rem; }
.banner-option { grid-template-columns: auto 1fr; align-items: center; }
.banner-options .banner-option img { grid-column: 1 / -1; }
.filter { display: flex; align-items: flex-end; gap: .6rem; margin-bottom: 1rem; }
.filter label { width: min(18rem, 75%); }
.type-thumb { width: 3.1rem; height: 2.6rem; border-radius: 7px; object-fit: cover; }
.role-list { margin: 0; color: var(--muted); }
.role-list dt { color: var(--ink); font-size: .9rem; font-weight: 750; }
.role-list dd { margin: .15rem 0 .4rem; font-size: .88rem; }
label { display: block; font-weight: 710; font-size: .92rem; }
label .muted { font-weight: 550; }
label > input, label > textarea, label > select { display: block; margin-top: .34rem; }
input, textarea, select {
  width: 100%; background: white; border: 1px solid #b9c7de; color: var(--ink);
  border-radius: 8px; padding: .54rem .66rem; min-height: 2.7rem; font-size: 1rem;
}
.password-input { display: flex; gap: .45rem; margin-top: .34rem; }
.password-input input { flex: 1; min-width: 0; }
.password-input input::-ms-reveal { display: none; }
.password-toggle { flex-shrink: 0; min-width: 5.2rem; }
.password-toggle[hidden] { display: none; }
select {
  appearance: none; background: #fff linear-gradient(45deg, transparent 52%, #4e6285 52%) right .78rem center / 5px 5px no-repeat;
  background-image: linear-gradient(45deg, transparent 50%, #4e6285 50%), linear-gradient(135deg, #4e6285 50%, transparent 50%);
  background-position: right 1rem center, right .7rem center; background-size: .3rem .3rem; padding-right: 1.8rem;
}
textarea { resize: vertical; }
.field-hint { color: var(--muted); font-size: .86rem; margin: -.45rem 0 0; }
.checkbox { display: flex; align-items: center; gap: .5rem; }
.checkbox input { min-height: 0; width: 1.12rem; height: 1.12rem; margin: 0; accent-color: var(--primary); }
.flash, .error { border-radius: 8px; padding: .63rem .8rem; margin: 0 0 1rem; }
.flash { background: #e2f5ec; color: #155f43; }
.error { background: #fbe8ed; color: #8d2139; }
details summary { cursor: pointer; font-weight: 740; }
.admin-list { color: var(--muted); padding-left: 1.3rem; overflow-wrap: anywhere; }
.secondary-form { margin: .8rem 0 0; }
.mail-content { overflow-wrap: anywhere; }
.mail-content p { margin-bottom: .7rem; }
.mail-content p:last-child { margin-bottom: 0; }
.preview-panel { overflow: hidden; max-width: 52rem; }
.mail-preview { display: block; border: 0; width: 100%; min-height: 31rem; }
.preview-actions { padding: .8rem 1rem; border-top: 1px solid var(--line); }
.league-mail-panel { scroll-margin-top: 8rem; }
.league-mail-panel[open] { max-width: 72rem; }
.league-mail-editor {
  display: grid; gap: 1.1rem; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start;
}
.league-mail-preview, .league-mail-form { min-width: 0; }
.league-mail-preview {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff;
}
.league-mail-preview-head {
  display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; justify-content: space-between; padding: .85rem .9rem .2rem;
}
.league-mail-editor h2 { font-size: 1.07rem; margin: 0; }
.league-mail-preview-head .button { min-height: 2.2rem; padding: .3rem .55rem; font-size: .79rem; }
.league-mail-preview-head .button[hidden] { display: none; }
.league-mail-preview-head .button[aria-pressed="true"] { color: var(--primary-hover); background: var(--tint); border-color: var(--accent-border); }
.league-mail-editor p.muted { margin: .35rem 0 0; font-size: .87rem; }
.league-mail-preview > p.muted { padding: 0 .9rem .7rem; }
.league-mail-subject {
  padding: .65rem .9rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .86rem;
}
.league-mail-subject button {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: .4rem; margin-top: .25rem;
  padding: .4rem .55rem; border: 1px dashed var(--accent-border); border-radius: 6px; background: var(--tint);
  color: var(--ink); font: inherit; text-align: start; cursor: pointer; overflow-wrap: anywhere;
}
.league-mail-subject-action { flex: none; color: var(--primary-hover); font-size: .77rem; font-weight: 750; }
.league-mail-subject button:disabled { border-color: transparent; background: transparent; cursor: default; }
.league-mail-subject button:disabled .league-mail-subject-action { display: none; }
.league-mail-frame { display: block; width: 100%; height: 38rem; border: 0; background: #eef2f8; }
.league-mail-form { padding: .85rem; border: 1px solid var(--line); border-radius: 12px; }
.league-mail-text textarea { display: block; margin-top: .34rem; }
.league-mail-form :is(input, textarea) { scroll-margin-top: 9rem; }
.league-mail-form a { color: var(--primary-hover); }
.league-mail-test [data-mail-test-status] { margin: 0; }
@media (max-width: 69rem) {
  .league-mail-editor { grid-template-columns: 1fr; }
}

.public-page { min-height: 100vh; }
.public-header { display: flex; justify-content: center; background: var(--sidebar-bg); padding: .85rem 1rem; }
.public-main { padding: clamp(1rem, 5vw, 3.5rem) 1rem; max-width: 64rem; margin-inline: auto; }
.login-shell {
  display: grid; grid-template-columns: 1fr 1fr; max-width: 53rem;
  margin: 0 auto; border: 1px solid var(--line); border-radius: 18px;
  background: white; overflow: hidden; box-shadow: 0 12px 36px #20386a14;
}
.login-art {
  min-height: 25rem; background: linear-gradient(180deg, #08193404, #081934eb),
    var(--sidebar-bg) url('/assets/banc-complet.webp') 77% center / cover no-repeat;
  color: white; padding: 1.6rem; display: flex; align-items: flex-end;
}
.login-art p { font-size: clamp(1.45rem, 3.6vw, 2.35rem); font-weight: 800; letter-spacing: -.045em; margin: 0; line-height: 1.07; }
.login-form { padding: clamp(1.1rem, 4vw, 2.1rem); align-self: center; }
.login-form h1 { font-size: clamp(1.55rem, 3.5vw, 2.3rem); }
.reply-card, .notice { max-width: 40rem; margin-inline: auto; }
.reply-card { border: 1px solid var(--line); border-radius: 17px; overflow: hidden; background: white; box-shadow: 0 12px 35px #20386a14; }
.reply-banner {
  background: var(--sidebar-bg);
  color: #fff; padding: clamp(1.2rem, 5vw, 2.1rem);
}
.reply-banner h1 { font-size: clamp(1.5rem, 6vw, 2.65rem); }
.reply-banner p { color: #e0eaff; margin-bottom: 0; overflow-wrap: anywhere; }
.reply-body { padding: clamp(1.2rem, 5vw, 2.1rem); }
.reply-body h2 { font-size: clamp(1.25rem, 5vw, 1.65rem); margin-bottom: .8rem; }
.roster-section { border-top: 1px solid var(--line); }
.roster-row { display: flex; justify-content: space-between; gap: .65rem; padding: .6rem 0; overflow-wrap: anywhere; }
.roster-row + .roster-row { border-top: 1px solid var(--line); }
.reply-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; margin: 1.05rem 0; }
.reply-actions .button { white-space: normal; overflow-wrap: anywhere; }
.reply-yes { color: #0d674e; border-color: #8bcabc; background: #e5f7ee; }
.reply-maybe { color: #75440b; border-color: #dcc380; background: #fff4d8; }
.reply-no { color: #8a2941; border-color: #e9adbe; background: #fce9ed; }
.reply-actions .chosen, .reply-actions .button:hover { box-shadow: inset 0 0 0 2px currentColor; }
.calendar-link { display: inline-block; text-align: center; }
.notice h1 { font-size: clamp(1.35rem, 5vw, 2rem); }

.event-time-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: .75rem; }
.event-time-row label, .weekly-slot label { min-width: 0; }
.section-navigation { position: sticky; top: 0; z-index: 2; background: var(--canvas); padding-block: .55rem; margin-bottom: .8rem; }
.league-navigation {
  position: sticky; top: 0; z-index: 5; padding: .8rem 0 .45rem;
  margin-bottom: 1.25rem; background: var(--canvas); border-bottom: 1px solid var(--line);
}
.league-navigation-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .75rem; margin-bottom: .6rem; }
.league-navigation-title a { font-size: .88rem; }
.league-navigation-title span { font-weight: 750; font-size: clamp(1rem, 2.3vw, 1.3rem); overflow-wrap: anywhere; }
.league-navigation-links { display: flex; gap: .25rem; overflow-x: auto; }
.league-navigation-links a {
  display: flex; align-items: center; min-height: 2.7rem; padding: .48rem .76rem;
  border-radius: 8px; color: var(--muted); text-decoration: none; white-space: nowrap; font-size: .9rem; font-weight: 700;
}
.league-navigation-links a:hover, .league-navigation-links a[aria-current="page"] {
  background: var(--tint); color: var(--primary-hover);
}
.league-navigation-links a[aria-current="page"] { box-shadow: inset 0 -2px var(--primary); }
.league-navigation-select { display: none; }
.season-picker { flex-wrap: wrap; }
.season-picker .text-link { align-self: center; }
.season-picker select { max-width: min(100%, 26rem); }
.league-navigation ~ :is(#statistiques, #classement) { scroll-margin-top: 7rem; }
.calendar-view-picker { display: inline-block; margin-bottom: .8rem; }
.calendar-view-picker > nav { position: absolute; z-index: 3; min-width: 10rem; margin-top: .3rem; }
.calendar-view-picker [aria-current="page"] { color: var(--primary-hover); font-weight: 750; background: var(--tint); }
@media (max-width: 58rem) {
  .has-league-selector .league-navigation-links { display: none; }
  .has-league-selector .league-navigation-select { display: grid; gap: .25rem; font-size: .82rem; color: var(--muted); }
  .league-navigation-select select { min-height: 2.75rem; }
}
.plan-menu { position: relative; }
.plan-menu[open] { z-index: 3; }
.plan-menu > div { position: absolute; inset-inline-end: 0; top: calc(100% + .35rem); width: max-content; max-width: 75vw; }
.plan-menu .list-row { font-size: .9rem; }
.season-choices { display: grid; gap: .6rem; padding-top: .3rem; }
.season-roster:has(input[value="all"]:checked) .season-choices { display: none; }
#reglages-envoi .field-hint { margin-block: 0; }
.calendar-controls { display: flex; align-items: flex-end; justify-content: space-between; gap: .65rem; flex-wrap: wrap; }
.calendar-controls .filter { margin: 0; }
.calendar-panel { overflow: hidden; }
.calendar-heading h2 { text-transform: capitalize; }
.calendar-weekdays, .calendar-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays {
  color: var(--muted); font-size: .8rem; text-align: center; font-weight: 750;
  border-top: 1px solid var(--line); background: #f5f7fc;
}
.calendar-weekdays span { padding: .48rem .15rem; }
.calendar-cell { min-width: 0; min-height: 6rem; border-top: 1px solid var(--line); padding: .28rem .33rem; }
.calendar-cell + .calendar-cell { border-left: 1px solid var(--line); }
.outside-month { background: #f2f4f9; color: var(--muted); }
.calendar-date { display: flex; justify-content: space-between; align-items: center; margin-bottom: .3rem; }
.calendar-date time, .day-add {
  display: grid; place-items: center; min-width: 1.65rem; min-height: 1.65rem; border-radius: 7px;
  font-weight: 720; font-size: .81rem;
}
.calendar-date time[aria-current="date"] { background: var(--primary); color: #fff; }
.day-add { text-decoration: none; color: #2057bb; background: #edf3ff; }
.day-add:hover { background: #dce9ff; }
.event-chip {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: .3rem;
  background: #e7efff; color: #123d7e; text-decoration: none; border-left: 2px solid #4d7cf0;
  border-radius: 5px; padding: .28rem .3rem; font-size: .8rem; line-height: 1.22; margin: 0 0 .25rem;
}
.event-chip time { white-space: nowrap; font-weight: 800; }
.event-chip span { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.event-chip:hover { background: #d7e7fc; }
.event-cancelled { background: #fbe7ee; border-left-color: #b53b55; color: #8f243d; }
.event-inactive { background: #eef1f6; border-left-color: #8391a9; color: #40516b; }
.confirm-dialog {
  width: min(29rem, calc(100% - 2rem)); padding: 1.25rem; border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--ink); background: var(--paper);
}
.confirm-dialog::backdrop { background: #0b1834a9; }
.confirm-dialog h2 { margin-bottom: .75rem; }
.confirm-dialog .actions { justify-content: flex-end; }
.week-slots { display: grid; gap: .7rem; }
.weekly-slot { display: grid; grid-template-columns: 1.1fr 1fr 1fr auto; align-items: end; gap: .65rem; }
.weekly-slot + .weekly-slot { padding-top: .7rem; border-top: 1px solid var(--line); }
.weekly-slot .remove-slot { min-height: 2.7rem; }
.remove-slot[hidden], [data-add-slot][hidden] { display: none; }
.series-times, .season-actions { margin-bottom: 1rem; }
.schedule-actions {
  position: sticky; bottom: 0; z-index: 3; justify-content: flex-end;
  padding: .65rem .8rem calc(.65rem + env(safe-area-inset-bottom, 0px));
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
}
.series-edit .secondary-form > p { margin: 0; }
.league-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)); gap: .8rem; }
.league-card {
  display: grid; gap: .42rem; padding: 1rem; text-decoration: none; align-content: start; margin: 0;
  overflow-wrap: anywhere;
}
.league-card:hover { border-color: #95b4fc; background: #f9fbff; }
.league-card strong { font-size: 1.2rem; }
.league-card > span:last-child { color: var(--muted); }
.table-scroll { overflow-x: auto; }
.stat-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.stat-table th, .stat-table td { border-top: 1px solid var(--line); padding: .66rem .85rem; text-align: left; white-space: nowrap; }
.stat-table thead { background: var(--tint); color: var(--primary-hover); font-size: .88rem; }
.stat-table tbody tr:nth-child(even) { background: #f9faff; }
.stat-table th small { display: block; font-weight: 550; color: var(--muted); }
.stat-table .points, .match-score { font-weight: 800; color: var(--primary-hover); }
.stat-table .points { background: var(--tint); }
.table-note { border-top: 1px solid var(--line); margin: 0; padding: .7rem .85rem; font-size: .86rem; color: var(--muted); }
.league-fixture .match-score { min-width: 4rem; text-align: right; }
.member-edit { border-top: 1px solid var(--line); padding: .72rem 1rem; }
.member-edit .secondary-form { max-width: 33rem; }
.panel-heading h3 { margin: 0; color: var(--muted); font-size: .98rem; }

@media (max-width: 65rem) {
  .app-page { grid-template-columns: 12rem minmax(0, 1fr); }
  .response-row { flex-wrap: wrap; }
}
@media (max-width: 47rem) {
  .app-page { display: block; }
  .sidebar { position: static; height: auto; padding: .8rem .8rem .55rem; }
  .sidebar .brand { margin: 0 0 .55rem; padding: 0 .15rem; }
  .sidebar nav { display: flex; gap: .18rem; overflow-x: auto; padding: .2rem 0; }
  .nav-link { padding: .46rem .56rem; gap: .3rem; white-space: nowrap; }
  .sidebar-bottom { margin: .44rem 0 0; padding: .35rem 0 0; }
  .sidebar-bottom .avatar { display: none; }
  .profile-actions { bottom: auto; top: calc(100% + .25rem); max-width: 19rem; }
  .topbar { min-height: 2.85rem; }
  .main { padding: 1rem; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .plan-menu > div { inset-inline-start: 0; inset-inline-end: auto; }
  .empty-inline, .action-panel { align-items: flex-start; flex-direction: column; }
  .metrics { gap: .55rem; }
  .metric { display: block; padding: .62rem; }
  .metric-icon { margin-bottom: .25rem; width: 1.85rem; height: 1.85rem; }
  .metric strong { font-size: 1.45rem; }
  .hero { min-height: 13rem; }
}
@media (max-width: 34rem) {
  .schedule-actions > .button { flex: 1 1 auto; }
  .field-row { grid-template-columns: 1fr; }
  .event-time-row { grid-template-columns: 1fr 1fr; }
  .event-time-row label:first-child { grid-column: 1 / -1; }
  .weekly-slot { grid-template-columns: 1fr 1fr; }
  .weekly-slot label:first-child { grid-column: 1 / -1; }
  .calendar-cell { padding: .16rem; min-height: 4.7rem; }
  .calendar-date time, .day-add { min-width: 1rem; min-height: 1.35rem; font-size: .74rem; }
  .event-chip { grid-template-columns: minmax(0, 1fr); gap: .1rem; font-size: .73rem; padding: .2rem .15rem; }
  .calendar-heading { align-items: flex-start; flex-direction: column; }
  .calendar-heading .button { min-height: 2.3rem; }
  .login-shell { grid-template-columns: 1fr; }
  .login-art { min-height: 8.5rem; padding: .9rem 1rem; background-position: center, 70% 45%; }
  .login-art br { display: none; }
  .reply-actions { grid-template-columns: 1fr; }
  .list-row { padding-inline: .7rem; gap: .48rem; }
  .response-row .inline-form { flex-basis: 100%; }
}
