/* Panneau Holdfast — mise en page et composants. Couleurs, polices et composants de base : holdfast-theme.css. */
html, body { margin: 0; padding: 0; background: var(--bg); }
body { font-family: var(--font-body); color: var(--ink); -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }
a { color: var(--brass-d); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--brass-d); text-decoration: underline; }
::selection { background: var(--brass-soft); }
button { font-family: inherit; }

.serif { font-family: var(--font-heading); }
.kicker { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }

.layout { display: grid; grid-template-columns: 262px 1fr; min-height: 100vh; }

/* — barre latérale — */
.side { border-right: 1px solid var(--color-divider); background: var(--color-surface); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { padding: 22px 22px 18px; border-bottom: 1px solid var(--color-divider); display: flex; align-items: baseline; gap: 9px; }
.side-brand .name { font-family: var(--font-heading); font-size: 24px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-brand .tag-dash { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--brass-d); }
.side-guild { padding: 16px 22px; border-bottom: 1px solid var(--color-divider); }
.side-guild .row { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.guild-icon { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--color-divider); background: var(--brass-soft); display: grid; place-items: center; font-size: 13px; color: var(--brass-d); flex: none; overflow: hidden; }
.guild-icon img { width: 100%; height: 100%; object-fit: cover; }
.guild-select { width: 100%; border: 0; background: transparent; font: inherit; font-size: 14px; padding: 0; cursor: pointer; color: var(--ink); appearance: none; text-overflow: ellipsis; }
.side-tabs { flex: 1; overflow-y: auto; padding: 14px 0; }
.tab-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; font-size: 13.5px; cursor: pointer; padding: 8px 22px; border: 0; border-left: 2px solid transparent; background: transparent; color: var(--muted); transition: background .15s; }
.tab-btn:hover { background: color-mix(in srgb, var(--brass) 7%, transparent); }
.tab-btn.active { border-left-color: var(--brass); background: color-mix(in srgb, var(--brass) 11%, transparent); color: var(--ink); }
.tab-btn .dot { width: 5px; height: 5px; border-radius: 50%; flex: none; border: 1px solid var(--color-divider); }
.tab-btn .dot.on { background: var(--brass); border-color: var(--brass); }
.side-user { border-top: 1px solid var(--color-divider); padding: 14px 22px; display: flex; align-items: center; gap: 10px; }
.side-user img, .side-user .av { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--color-divider); }
.side-user .who { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* — en-tête — */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg-glass); backdrop-filter: blur(8px); border-bottom: 1px solid var(--color-divider); }
.top-inner { padding: 18px 40px; display: flex; align-items: center; gap: 20px; }
.top .kick { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--brass-d); }
.top .title { font-family: var(--font-heading); font-size: 27px; letter-spacing: -0.015em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .kick { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dirty { font-size: 12px; color: var(--brass-d); border: 1px solid var(--brass); border-radius: 3px; padding: 5px 11px; transition: opacity .2s; opacity: 0; pointer-events: none; white-space: nowrap; }
.dirty.on { opacity: 1; }

main.content { padding: 34px 40px 90px; max-width: 1040px; }
.intro { font-size: 15px; line-height: 1.72; color: var(--ink-2); margin: 0 0 30px; max-width: 68ch; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; border-top: 1px solid var(--color-divider); border-bottom: 1px solid var(--color-divider); padding: 24px 0; margin-bottom: 34px; }
.stat-v { font-family: var(--font-heading); font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-k { font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin-top: 9px; }

section.sec { margin-bottom: 44px; }
section.sec > h2 { font-family: var(--font-heading); font-weight: 400; font-size: 26px; letter-spacing: -0.015em; margin: 0 0 6px; }
section.sec > .hint { font-size: 13.5px; line-height: 1.65; color: var(--muted); margin: 0 0 20px; max-width: 66ch; }
.sec-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.field { padding: 16px 0; border-bottom: 1px solid var(--color-divider); }
.field.toggle-field { padding: 14px 0; }
.field > label, .lbl { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.field .fhint, .fhint { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.55; }
.field .input { max-width: 420px; font-family: inherit; }
.field textarea.input { max-width: 620px; line-height: 1.6; }
.field.wide .input { max-width: 620px; }
.input.sm { max-width: 110px !important; }
.input.xs { max-width: 76px !important; min-height: 32px; padding: 4px 8px; }

.switch-btn { display: flex; align-items: flex-start; gap: 14px; width: 100%; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; }
.switch { flex: none; width: 38px; height: 21px; border-radius: 11px; margin-top: 1px; position: relative; transition: all .18s; background: transparent; border: 1px solid var(--color-divider); }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; transition: left .18s, background .18s; background: var(--knob); }
.switch.on { background: var(--brass-soft); border-color: var(--brass); }
.switch.on .knob { left: 20px; background: var(--brass); }
.switch-btn .l { display: block; font-size: 14.5px; color: var(--ink); }
.switch-btn .h { display: block; font-size: 12.5px; line-height: 1.6; color: var(--muted); margin-top: 3px; }
.switch-inline { white-space: nowrap; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; background: none; border: 0; padding: 0; font-size: 13.5px; color: var(--ink); }

/* — puces et sélecteurs multiples — */
.chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 6px 3px 10px; border-radius: 3px; border: 1px solid var(--brass); color: var(--brass-d); background: transparent; }
.chip .x { border: 0; background: none; cursor: pointer; color: var(--brass-d); font-size: 14px; line-height: 1; padding: 0 2px; }
.chip .x:hover { color: var(--ink); }
.chip .swatch { width: 8px; height: 8px; border-radius: 50%; }
.adder { position: relative; display: inline-block; }
.adder-btn { font-size: 12px; padding: 4px 10px; border: 1px dashed var(--color-divider); border-radius: 3px; background: none; cursor: pointer; color: var(--muted); }
.adder-btn:hover { border-color: var(--brass); color: var(--brass-d); }
.pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 280px; background: var(--raised); border: 1px solid var(--color-divider); border-radius: 4px; box-shadow: var(--shadow-lg); padding: 8px; }
.pop input { margin-bottom: 6px; }
.pop-list { max-height: 260px; overflow-y: auto; }
.pop-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 7px 8px; font-size: 13px; cursor: pointer; border-radius: 3px; color: var(--ink); }
.pop-item:hover { background: color-mix(in srgb, var(--brass) 10%, transparent); }
.pop-item.disabled { opacity: .45; cursor: not-allowed; }
.pop-item .sub { margin-left: auto; font-size: 11px; color: var(--muted); }

/* — listes éditables — */
.item { border: 1px solid var(--color-divider); border-radius: 4px; padding: 18px 20px; margin: 0 0 16px; background: var(--tint); }
.item-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.item-head .t { font-family: var(--font-heading); font-size: 22px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .field:last-child { border-bottom: 0; }
.grid-row { display: grid; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--color-divider); }
.grid-row .input { max-width: none; }
.grid-head { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-bottom: 4px; }
.icon-btn { border: 1px solid var(--color-divider); background: none; border-radius: 3px; width: 30px; height: 30px; cursor: pointer; color: var(--muted); font-size: 14px; flex: none; }
.icon-btn:hover { border-color: var(--brass); color: var(--brass-d); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.status { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; border: 1px solid var(--color-divider); color: var(--muted); white-space: nowrap; }
.status.ok { border-color: var(--brass); color: var(--brass-d); background: var(--brass-soft); }
.status.live { border-color: #fe2c55; color: #c2183c; background: #ffe6ec; }
.status.err { border-color: var(--danger); color: var(--danger); }

.table td, .table th { font-size: 13.5px; }
.row-link { cursor: pointer; }
.row-link:hover td:first-child { color: var(--brass-d); }

/* — images — */
.img-pick { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.thumb { width: 150px; height: 84px; border-radius: 3px; border: 1px solid var(--color-divider); background: var(--surface-2) center/cover no-repeat; display: grid; place-items: center; font-size: 11px; color: var(--muted); flex: none; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.media-card { border: 1px solid var(--color-divider); border-radius: 4px; overflow: hidden; background: var(--tint); display: flex; flex-direction: column; }
.media-card .img { aspect-ratio: 16/10; background: var(--surface-2) center/cover no-repeat; }
.media-card .meta { padding: 9px 10px; font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.media-card .meta .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card.pickable { cursor: pointer; }
.media-card.pickable:hover { border-color: var(--brass); }
.media-card.selected { outline: 2px solid var(--brass); }
.drop { border: 1px dashed color-mix(in srgb, var(--ink) 30%, transparent); border-radius: 4px; padding: 26px; text-align: center; color: var(--muted); font-size: 13.5px; cursor: pointer; margin-bottom: 20px; transition: background .15s, border-color .15s; }
.drop:hover, .drop.over { border-color: var(--brass); background: color-mix(in srgb, var(--brass) 6%, transparent); color: var(--brass-d); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.card-grid figure { margin: 0; }
.card-grid img { width: 100%; border-radius: 3px; }
.card-grid figcaption { font-size: 11px; line-height: 1.4; margin-top: 6px; }

/* — composeur — */
.composer { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.block { border: 1px solid var(--color-divider); border-radius: 4px; padding: 12px 14px; margin-bottom: 10px; background: var(--tint); }
.block-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.block-head .bt { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass-d); flex: 1; }
.block .input { max-width: none; }
.preview-wrap { position: sticky; top: 110px; }
.preview { background: #313338; color: #dbdee1; border-radius: 6px; padding: 16px; font-family: "gg sans", "Noto Sans", Helvetica, Arial, sans-serif; font-size: 14px; }
.preview .who { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.preview .who img { width: 32px; height: 32px; border-radius: 50%; }
.preview .who b { color: #f2f3f5; font-weight: 600; }
.preview .bot-tag { background: #5865f2; color: #fff; font-size: 11px; padding: 1px 4px; border-radius: 3px; font-weight: 600; }
.pv-container { border-radius: 8px; background: #393a41; border-left: 4px solid var(--brass); padding: 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.pv-text { white-space: pre-wrap; line-height: 1.4; word-break: break-word; }
.pv-text h1, .pv-text h2, .pv-text h3 { margin: 4px 0; font-family: inherit; color: #f2f3f5; }
.pv-text h1 { font-size: 22px; } .pv-text h2 { font-size: 19px; } .pv-text h3 { font-size: 16px; }
.pv-sep { height: 1px; background: #4e5058; }
.pv-sep.nodiv { background: transparent; }
.pv-sep.large { margin: 8px 0; }
.pv-img { width: 100%; border-radius: 6px; display: block; }
.pv-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pv-btn { background: #4e5058; color: #fff; padding: 6px 14px; border-radius: 4px; font-size: 13px; }
.pv-select { background: #1e1f22; border-radius: 4px; padding: 9px 12px; color: #949ba4; display: flex; justify-content: space-between; }

.tokens { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--brass-d); }
.day-picks { display: flex; gap: 4px; flex-wrap: wrap; }
.day-picks button { width: 34px; height: 30px; border: 1px solid var(--color-divider); background: none; border-radius: 3px; cursor: pointer; font-size: 12px; color: var(--muted); }
.day-picks button.on { border-color: var(--brass); background: var(--brass-soft); color: var(--brass-d); }

/* — dialogues et notifications — */
.dialog-backdrop { z-index: 100; }
.dialog.wide { width: min(860px, 100%); max-height: 86vh; overflow-y: auto; background: var(--raised); }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 4px; font-size: 13.5px; box-shadow: var(--shadow-lg); max-width: 420px; animation: tin .2s ease both; }
.toast.err { background: #7a1c16; }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.empty { padding: 26px 0; font-size: 14px; color: var(--muted); }
.warn-box { border: 1px solid var(--brass); background: var(--brass-softer); border-radius: 4px; padding: 12px 16px; font-size: 13.5px; line-height: 1.6; color: var(--warn-ink); margin-bottom: 24px; }

/* — pages de connexion — */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-box { width: min(440px, 100%); border: 1px solid var(--color-divider); border-radius: 4px; background: var(--color-surface); padding: 34px 32px; }
.auth-box h1 { font-family: var(--font-heading); font-weight: 400; font-size: 38px; letter-spacing: -0.02em; margin: 0 0 10px; }
.auth-box p { font-size: 14.5px; line-height: 1.7; color: var(--ink-2); }
.auth-box .err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 8px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); } /* sinon la barre d'onglets impose sa largeur à la page */
  .side { position: static; height: auto; }
  .side-tabs { display: flex; overflow-x: auto; padding: 6px 8px; }
  .tab-btn { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; padding: 8px 12px; width: auto; }
  .tab-btn.active { border-bottom-color: var(--brass); }
  .tab-btn .dot { display: none; }
  .top-inner { padding: 14px 16px; flex-wrap: wrap; }
  main.content { padding: 24px 16px 80px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .composer { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
}

.sub-item { border: 1px solid var(--color-divider); border-radius: 4px; padding: 8px 10px 10px; margin-bottom: 8px; background: var(--tint); }
.sub-item .input { max-width: none; }
.container-block { border-left: 3px solid var(--brass); }
.nested { padding-left: 4px; }
.add-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--color-divider); }
.pv-text small { display: block; }

/* ══════ Panneau Holdfast ══════ */
.side-group { padding: 16px 22px 6px; }
.tab-icon { display: inline-block; width: 22px; opacity: .8; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--color-divider); white-space: nowrap; }
.pill .dot, .big-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--knob); flex: none; }
.pill.up { border-color: var(--ok); color: var(--ok-d); background: var(--ok-soft); } .pill.up .dot { background: var(--ok); }
.pill.busy { border-color: var(--brass); color: var(--brass-d); background: var(--brass-softer); } .pill.busy .dot { background: var(--brass); animation: blink 1.2s infinite; }
.pill.down { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); } .pill.down .dot { background: var(--danger); }
@keyframes blink { 50% { opacity: .3; } }

.hero { margin-bottom: 40px; }
.hero-state { border: 1px solid var(--color-divider); border-radius: 8px; padding: 24px 26px; background: var(--tint); border-left: 5px solid var(--knob); }
.hero-state.up { border-left-color: var(--ok); } .hero-state.busy { border-left-color: var(--brass); } .hero-state.down { border-left-color: var(--danger); }
.hero-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.big-dot { width: 16px; height: 16px; }
.hero-state.up .big-dot { background: var(--ok); box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 18%, transparent); }
.hero-state.busy .big-dot { background: var(--brass); animation: blink 1.2s infinite; }
.hero-state.down .big-dot { background: var(--danger); }
.hero-label { font-family: var(--font-heading); font-size: 34px; line-height: 1.1; }
.hero-sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.hero-actions { display: flex; gap: 10px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--color-divider); }
.hero-stats .stat-v { font-size: 28px; }
.connect { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 14px; padding: 16px 20px; border: 1px dashed color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 6px; }
.connect-addr { font-family: ui-monospace, Menlo, monospace; font-size: 20px; margin: 4px 0; }
.mini-players { margin-top: 14px; }

.checklist { display: grid; gap: 8px; max-width: 620px; }
.check-item { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border: 1px solid var(--color-divider); border-radius: 6px; background: var(--tint); cursor: pointer; font-size: 14px; color: var(--ink); }
.check-item:hover:not(.done) { border-color: var(--brass); background: var(--brass-softer); }
.check-item.done { cursor: default; color: var(--muted); text-decoration: line-through; opacity: .75; }
.check-box { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--knob); display: grid; place-items: center; font-size: 12px; flex: none; }
.check-item.done .check-box { background: var(--ok); border-color: var(--ok); color: #fff; }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.summary-card { text-align: left; border: 1px solid var(--color-divider); border-radius: 6px; padding: 16px 18px; background: var(--tint); font: inherit; color: inherit; }
.summary-card.link { cursor: pointer; }
.summary-card.link:hover { border-color: var(--brass); }
.summary-v { font-family: var(--font-heading); font-size: 26px; margin: 4px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

details.fold { border: 1px solid var(--color-divider); border-radius: 6px; margin: 12px 0; background: var(--tint); }
details.fold > summary { cursor: pointer; padding: 11px 14px; font-size: 13.5px; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: '▸'; color: var(--brass-d); transition: transform .15s; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary:hover { color: var(--ink); }
.fold-body { padding: 4px 14px 14px; }
.fold-body .field:last-child { border-bottom: 0; }

.rot-list { display: grid; gap: 10px; margin-bottom: 18px; }
.rot { border: 1px solid var(--color-divider); border-radius: 8px; background: var(--tint); }
.rot.open { border-color: var(--brass); box-shadow: var(--shadow-sm); }
.rot.off { opacity: .6; }
.rot-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; flex-wrap: wrap; }
.rot-num { width: 28px; height: 28px; border-radius: 50%; background: var(--brass-soft); color: var(--brass-d); display: grid; place-items: center; font-size: 13px; flex: none; }
.rot-title { font-family: var(--font-heading); font-size: 21px; line-height: 1.2; }
.rot-body { padding: 4px 20px 18px 56px; border-top: 1px solid var(--color-divider); }
.step { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--color-divider); }
.step-n { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--brass); color: var(--brass-d); display: grid; place-items: center; font-size: 12px; flex: none; margin-left: -38px; background: var(--bg); }
.step-t { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.step .input { max-width: 420px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; padding: 6px 0; }
.form-grid .input { max-width: none; }
.mod-line { display: flex; gap: 12px; align-items: center; margin-top: 10px; font-size: 13px; }
.mod-line img { width: 96px; height: 54px; object-fit: cover; border-radius: 4px; }

.howto { display: grid; gap: 6px; padding: 14px 18px; border-radius: 6px; background: var(--brass-softer); border: 1px solid var(--brass-line); font-size: 14px; margin-bottom: 16px; max-width: 620px; }
.mod-card { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; border: 1px solid var(--color-divider); border-radius: 8px; padding: 14px; margin-bottom: 12px; background: var(--tint); }
.mod-img { width: 140px; height: 80px; border-radius: 4px; background: var(--surface-2) center/cover no-repeat; flex: none; }
.mod-title { font-family: var(--font-heading); font-size: 22px; line-height: 1.2; }
.mod-title a { color: inherit; }
.mod-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.mod-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; min-width: 170px; }
.mod-actions details.fold { margin: 0; width: 100%; }
.err-line { color: var(--danger); font-size: 12.5px; margin-top: 4px; }
.chip-on { background: var(--brass-soft); }
label.chip { cursor: pointer; padding: 4px 10px; }

.log-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.log-tab { border: 1px solid var(--color-divider); background: var(--tint); border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.log-tab:hover { border-color: var(--brass); }
.log-tab.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.log-box { background: #1e1f22; color: #dbdee1; border-radius: 6px; padding: 14px 16px; height: 60vh; overflow: auto; font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; margin: 0; }

.savebar { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 140%); display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; background: var(--ink); color: var(--bg); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 90; transition: transform .22s ease; max-width: calc(100% - 32px); flex-wrap: wrap; }
.savebar { visibility: hidden; }
.savebar.on { transform: translate(-50%, 0); visibility: visible; }
.savebar-text { font-size: 13.5px; margin-right: 6px; }
.savebar .btn-secondary { color: var(--bg); border-color: color-mix(in srgb, var(--bg) 30%, transparent); }
.savebar .btn-secondary:hover { background: color-mix(in srgb, var(--bg) 10%, transparent); }
.savebar .btn-primary { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); box-shadow: none; }
.savebar .btn-primary:hover { background: color-mix(in srgb, var(--gold) 85%, #fff); }
.savebar [hidden] { display: none; }

.search-results { display: grid; gap: 6px; margin-top: 12px; max-width: 620px; }
.search-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--color-divider); border-radius: 6px; background: var(--tint); cursor: pointer; text-align: left; font: inherit; font-size: 14px; color: inherit; }
.search-item:hover { border-color: var(--brass); }
.search-item img, .user-row img { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.role-card { border: 1px solid var(--color-divider); border-radius: 6px; padding: 14px 16px; }
.role-name { font-family: var(--font-heading); font-size: 20px; margin-bottom: 4px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--color-divider); flex-wrap: wrap; }
.side-user .who { line-height: 1.2; }

@media (max-width: 900px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .rot-body { padding-left: 16px; }
  .step-n { margin-left: 0; }
  .side-group { display: none; }
  .mod-actions { align-items: stretch; width: 100%; }
}
.auth-box .ok { color: var(--ok-d); font-size: 13px; margin-top: 8px; }
.auth-box .lbl { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.link-box { display: flex; gap: 8px; align-items: center; margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--brass); border-radius: 6px; background: var(--brass-softer); }
.link-box input { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.av.initial { width: 30px; height: 30px; border-radius: 50%; background: var(--brass-soft); color: var(--brass-d); display: grid; place-items: center; font-size: 13px; flex: none; border: 1px solid var(--color-divider); }
.who-btn { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink); }
.who-btn:hover { color: var(--brass-d); }

/* — états : chargement, vide, erreur — */
.state { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 22px 0; font-size: 14px; color: var(--muted); }
.state-icon { width: 22px; height: 22px; display: grid; place-items: center; flex: none; font-size: 15px; }
.state-loading .state-icon { border: 2px solid var(--color-divider); border-top-color: var(--brass-d); border-radius: 50%; animation: spin .8s linear infinite; }
.state-error { color: var(--danger); }
.state-error .state-text { color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .state-loading .state-icon { animation: none; } }

/* — classement — */
.rank-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.rank-tools .input { width: auto; max-width: 100%; }
.rank-tools input[type=search] { flex: 1 1 220px; max-width: 300px; }
.rank-meta { font-size: 13px; margin-bottom: 22px; line-height: 1.6; }
.medal { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; font-weight: 600; flex: none; }
.medal.m1 { background: var(--gold); color: var(--gold-ink); }
.medal.m2 { background: var(--silver); color: var(--silver-ink); }
.medal.m3 { background: var(--bronze); color: var(--bronze-ink); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 26px; }
.podium-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--color-divider); border-radius: 8px; padding: 14px 16px; background: var(--tint); min-width: 0; }
.podium-card:hover { border-color: var(--brass); }
.podium-card.p1 { border-top: 3px solid var(--gold); } .podium-card.p2 { border-top: 3px solid var(--silver); } .podium-card.p3 { border-top: 3px solid var(--bronze); }
.podium-name { font-family: var(--font-heading); font-size: 21px; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.podium-sub { font-size: 12.5px; }
.rank-table-wrap { overflow-x: auto; }
.rank-table td.num, .rank-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank-row { cursor: pointer; }
.rank-row:focus-visible { outline: 2px solid var(--brass-d); outline-offset: -2px; }
.th-sort { background: none; border: 0; padding: 4px 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; white-space: nowrap; }
.th-sort:hover { color: var(--ink); }
.rank-cards { display: none; flex-direction: column; gap: 8px; }
.rank-card { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; text-align: left; font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--color-divider); border-radius: 8px; padding: 10px 12px; background: var(--tint); }
.rc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rc-name { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-stats { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rc-score { display: flex; flex-direction: column; align-items: flex-end; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rc-score small { font-size: 11px; font-weight: 400; color: var(--muted); }
.pd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.pd-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--color-divider); font-size: 14px; }
.pd-row span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.only-mobile { display: none; }
@media (max-width: 600px) {
  .rank-table-wrap { display: none; }
  .rank-cards { display: flex; }
  .only-mobile { display: contents; }
  .only-mobile > * { flex: 1 1 100%; max-width: none; }
  .podium { display: none; } /* les cartes portent déjà les médailles */
  .rank-tools > * { flex: 1 1 100%; max-width: none !important; }
  .pd-grid { grid-template-columns: 1fr; }
}

/* — barre d'enregistrement : la page garde de quoi défiler au-dessus (audit n° 10) — */
body.has-savebar main.content { padding-bottom: 150px; }

/* — boutons : cible minimale (audit n° 11) — */
.hf .btn { min-height: 36px; }

/* — sélecteur de serveur et menu mobile (audit n° 13) — */
.side-guild .row { position: relative; }
.guild-chev { color: var(--brass-d); font-size: 13px; pointer-events: none; }
.menu-toggle { display: none; }

@media (max-width: 900px) {
  /* Cibles tactiles d'au moins 44 px (audit n° 12) */
  .hf .btn, .hf .input, .hf select.input, .tab-btn, .log-tab, .switch-btn, .who-btn, .menu-toggle { min-height: 44px; }
  .hf input[type=checkbox] { width: 20px; height: 20px; }
  .icon-btn, .chip .x { min-width: 44px; min-height: 44px; }
  .switch-inline { min-height: 44px; }
  .guild-select { min-height: 40px; font-size: 16px; }
  /* Menu : un bouton qui ouvre la liste groupée des onglets */
  .menu-toggle { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; border: 0; border-bottom: 1px solid var(--color-divider); background: none; font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; text-align: left; }
  .menu-current { flex: 1; }
  .side-tabs { display: none; }
  .side-tabs.open { display: block; overflow: visible; padding: 6px 0 10px; border-bottom: 1px solid var(--color-divider); }
  .side-tabs.open .tab-btn { width: 100%; border-bottom: 0; border-left: 2px solid transparent; padding: 10px 16px; }
  .side-tabs.open .tab-btn.active { border-left-color: var(--brass); }
  .side-tabs.open .side-group { display: block; padding: 12px 16px 4px; }
  .side-user { display: none; }
  .side-user.open { display: flex; }
  .side-brand, .side-guild { padding-left: 16px; padding-right: 16px; }
}

/* — en-tête : boutons réduits à leur icône sur téléphone (audit n° 14) — */
@media (max-width: 600px) {
  .top .btn-label { display: none; }
  .top .btn { min-width: 44px; }
  .top-inner { gap: 10px 12px; }
  .top-inner > div:first-child { flex: 1 1 100% !important; } /* le titre en entier, l'état et les boutons dessous (le style en ligne fixe flex: 1) */
  /* Barre d'enregistrement en pleine largeur, boutons côte à côte */
  .savebar { left: 8px; right: 8px; bottom: 8px; max-width: none; transform: translateY(140%); padding: 10px; gap: 8px; }
  .savebar.on { transform: none; }
  .savebar-text { width: 100%; margin: 0 0 2px 2px; }
  .savebar .btn { flex: 1 1 auto; }
}

/* Rang des cartes mobiles : colonne de largeur fixe, les noms restent alignés de 1 à 999 */
.rc-rank { flex: 0 0 34px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }

/* ══════ Maquette « Holdfast Dashboard » : composants ══════ */
a { color: var(--gold); }
a:hover { color: var(--gold-light); }
.ico { width: 20px; height: 20px; flex: none; display: block; }
.muted { color: var(--muted); }

/* Étiquettes : petites capitales Cinzel dorées ; libellés de champ en Garamond discret */
.kicker, .stat-k, .step-t, .grid-head, .block-head .bt, .top .kick, .side-group {
  font-family: var(--font-display); font-weight: 500; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold);
}
.field > label, .lbl { font-family: var(--font-body); font-size: 14.5px; letter-spacing: 0; text-transform: none; color: var(--muted); }
.fhint, .field .fhint { font-size: 14px; color: var(--muted); }
.intro { color: var(--ink-2); font-size: 17px; }

/* Sections : des cartes sombres à filet fin, titre en Garamond clair */
section.sec { background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: 4px; padding: 18px 22px 20px; margin-bottom: 16px; }
section.sec > h2 { font-family: var(--font-heading); font-weight: 500; font-size: 21px; color: var(--heading); margin: 0 0 6px; }
section.sec > .hint { font-size: 15px; color: var(--muted); }
.field { border-bottom-color: var(--color-divider); }

/* Cartes et listes */
.summary-card, .mod-card, .rot, .role-card, .check-item, .item, .search-item, details.fold, .rank-card, .podium-card, .media-card, .block, .connect, .tile {
  background: #0f1014; border: 1px solid var(--color-divider); border-radius: 4px; color: var(--ink);
}
section.sec .summary-card, section.sec .mod-card, section.sec .rot, section.sec details.fold, section.sec .role-card { background: #0c0d10; }
.summary-card.link:hover, .rank-card:hover, .podium-card:hover, .check-item:hover:not(.done), .search-item:hover, .rot.open, .mod-card:hover { border-color: var(--brass-edge); }
.summary-v, .rot-title, .mod-title, .role-name, .item-head .t, .hero-label, .podium-name { font-family: var(--font-heading); color: var(--heading); }
.rot-num, .step-n { background: transparent; border: 1px solid var(--brass-edge); color: var(--gold); font-variant-numeric: lining-nums; }
.howto, .warn-box { background: var(--brass-softer); border: 1px solid var(--brass-edge); border-left: 3px solid var(--gold); color: var(--ink-2); }
.warn-box { color: var(--warn-ink); }

/* Tuiles de statistiques (icône colorée, valeur, libellé) */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.tile { display: flex; align-items: center; gap: 14px; padding: 16px 18px; min-width: 0; }
.tile .ico { width: 26px; height: 26px; }
.tile-v { font-size: 19px; color: var(--heading); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-k { font-size: 14.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile > div { min-width: 0; }
.c-green { color: var(--ok); } .c-red { color: var(--danger); } .c-violet { color: var(--violet); } .c-blue { color: var(--info); } .c-gold { color: var(--gold); } .c-orange { color: var(--orange); }

/* Jauges */
.gauge { height: 6px; border-radius: 3px; background: #23252b; overflow: hidden; margin-top: 10px; }
.gauge > span { display: block; height: 100%; border-radius: 3px; background: var(--ok); }
.gauge.warn > span { background: var(--orange); } .gauge.high > span { background: var(--danger-solid); } .gauge.blue > span { background: #3b82f6; }

/* Statistiques chiffrées */
.stat-v, .summary-v, .podium-score, .rc-score { font-family: var(--font-body); font-weight: 500; color: var(--heading); font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0; }
.connect-addr { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-weight: 500; color: var(--heading); }

/* Pastilles d'état : badge vert « en ligne » de la maquette */
.pill { font-size: 14.5px; padding: 6px 14px; background: #121318; border-color: #3a352b; color: var(--ink-2); }
.pill.up { background: var(--ok-soft); border-color: #2f6b45; color: var(--ok-d); }
.pill.up .dot { background: var(--ok); box-shadow: 0 0 0 0 rgba(62,207,110,.6); animation: ring 1.8s infinite; }
.pill.busy { background: var(--brass-softer); border-color: var(--brass-edge); color: var(--gold); }
.pill.down { background: var(--danger-soft); border-color: #6b2b27; color: var(--danger); }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(62,207,110,.6); } 100% { box-shadow: 0 0 0 8px rgba(62,207,110,0); } }

/* Interrupteurs, onglets de journal, puces, statuts */
.switch { border-color: #3a352b; background: #0c0d10; }
.switch .knob { background: var(--knob); }
.switch.on { background: rgba(80,60,30,.75); border-color: #c49a55; }
.switch.on .knob { background: var(--gold-light); }
.switch-btn .l { color: var(--ink); font-size: 16px; }
.switch-btn .h { color: var(--muted); font-size: 14px; }
.switch-inline { color: var(--ink); font-size: 15px; }
.log-tab { background: #0f1014; border-color: #2f2b23; color: var(--ink-2); font-size: 15px; min-height: 38px; }
.log-tab.on { background: rgba(80,60,30,.75); color: var(--heading); border-color: #c49a55; }
.log-box { background: #050607; color: #d6d3cc; border: 1px solid var(--color-divider); font-size: 12.5px; }
.chip { background: var(--brass-softer); border-color: var(--brass-edge); color: var(--gold); font-size: 14px; }
.status { font-family: var(--font-display); font-size: 11px; letter-spacing: .12em; border-color: #3a352b; color: var(--muted); }
.status.ok { background: var(--brass-softer); border-color: var(--brass-edge); color: var(--gold); }
.icon-btn { background: #0c0d10; border-color: #2f2b23; color: var(--ink-2); border-radius: 3px; }
.icon-btn:hover { border-color: var(--brass-edge); color: var(--gold); }
.icon-btn.danger:hover { border-color: #6b2b27; color: var(--danger); }
details.fold > summary { color: var(--ink-2); font-size: 15.5px; }
details.fold > summary::before { color: var(--gold); }
.check-box { border-color: var(--brass-edge); }
.check-item.done .check-box { background: #2f6b45; border-color: #2f6b45; }
.err-line { color: var(--danger); font-size: 14px; }
.state { color: var(--muted); font-size: 15.5px; }
.state-error .state-text { color: var(--ink); }
.state-loading .state-icon { border-color: #2f2b23; border-top-color: var(--gold); }

/* Barre d'enregistrement et notifications : cartes sombres à filet doré */
.savebar { background: #15171c; color: var(--ink); border: 1px solid var(--brass-edge); box-shadow: var(--shadow-lg); }
.savebar .btn-secondary { color: var(--ink); border-color: #3a352b; background: transparent; }
.savebar .btn-secondary:hover { background: var(--raised); }
.savebar .btn-primary { background: rgba(80,60,30,.85); color: var(--heading); border-color: #c49a55; }
.toast { background: #15171c; color: var(--ink); border: 1px solid var(--brass-edge); border-left: 3px solid var(--gold); font-size: 15px; }
.toast.err { background: #2a1513; color: #f6d6d2; border-color: #6b2b27; border-left-color: var(--danger-solid); }

/* Classement : médailles frappées, podium */
.medal { background-image: radial-gradient(circle at 35% 30%, rgba(255,255,255,.5), transparent 58%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.4); font-family: var(--font-body); font-weight: 600; font-variant-numeric: lining-nums; }
.medal.m1 { background-color: var(--gold-medal); color: var(--gold-ink); }
.podium { align-items: end; }
.podium-card { position: relative; align-items: center; text-align: center; padding: 30px 14px 16px; }
.podium-card.p1 { order: 2; padding-top: 40px; border-color: var(--brass-edge); background: linear-gradient(rgba(217,179,108,.08), transparent 60%), #0f1014; }
.podium-card.p2 { order: 1; } .podium-card.p3 { order: 3; }
.podium-card.p1, .podium-card.p2, .podium-card.p3 { border-top-width: 1px; }
.podium-card .medal { position: relative; width: 42px; height: 42px; font-size: 18px; }
.podium-card.p1 .medal { width: 50px; height: 50px; font-size: 21px; }
.podium-card .medal::before { content: ''; position: absolute; bottom: calc(100% - 2px); left: 50%; transform: translateX(-50%); width: 20px; height: 18px; background: linear-gradient(90deg, #24406b 0 33%, #e8e1d3 33% 66%, #a3272a 66%); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); }
.podium-name { font-size: 20px; }
.podium-score { font-size: 18px; }
.rank-card .rc-name { color: var(--heading); font-size: 16.5px; }
.rc-stats { font-size: 14px; }
.th-sort { font-size: 14px; }
.pd-row { border-bottom-color: var(--color-divider); font-size: 15.5px; }
.link-box { background: var(--brass-softer); border-color: var(--brass-edge); }

/* ══════ Maquette « Holdfast Dashboard » : pages ══════ */

/* Mise en page : barre latérale encadrée, détachée du bord */
.layout { grid-template-columns: 280px minmax(0, 1fr); background: var(--bg); }
.side {
  /* Toute la hauteur de la page, comme la maquette : les onglets restent entiers, le soldat en bas. */
  position: relative; top: auto; height: auto; min-height: calc(100vh - 20px); align-self: stretch; margin: 10px 0 10px 10px; overflow: hidden;
  background: linear-gradient(#111216, #0b0c0e); border: 1px solid var(--side-line); border-radius: 6px; box-shadow: none; color: var(--side-ink);
}
.side > * { position: relative; z-index: 1; }
.side-tabs { flex: none; overflow: visible; }
.side-art { margin-top: auto; height: 250px; pointer-events: none;
  background: url(/static/img/soldat.webp) center 20% / cover no-repeat; opacity: .6;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 62%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 62%, transparent); }
.side-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 18px 20px; border-bottom: 1px solid var(--side-line); text-align: center; }
.logo { font-family: var(--font-display); font-weight: 600; font-size: 34px; line-height: 1; letter-spacing: .02em; text-transform: uppercase;
  background: linear-gradient(90deg, #b88d4a, #f3d89a, #b88d4a); -webkit-background-clip: text; background-clip: text; color: #d9b36c; -webkit-text-fill-color: transparent; }
.logo-sub { font-family: var(--font-display); font-size: 12.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.side-guild { border-bottom: 1px solid var(--side-line); padding: 14px 20px; }
.side-guild .kicker { color: var(--gold); }
.guild-icon { background: #2a241a; border-color: var(--brass-edge); color: var(--gold); }
.guild-select { color: var(--heading); font-size: 16.5px; font-family: var(--font-body); }
.guild-select option { background: #111317; color: var(--ink); }
.guild-chev { color: var(--gold); }
.side-tabs { padding: 10px 0; }
.side-group { padding: 14px 22px 6px; }
.tab-btn { padding: 10px 20px; font-size: 16.5px; color: var(--side-muted); border-left: 3px solid transparent; transition: background .25s, color .25s; }
.tab-btn > span { display: flex; align-items: center; gap: 15px; }
.tab-icon { display: flex; width: auto; opacity: 1; color: var(--muted); }
.tab-icon .ico { width: 19px; height: 19px; }
.tab-btn:hover { background: var(--side-hover); color: var(--heading); }
.tab-btn:hover .tab-icon { color: var(--gold); }
.tab-btn.active { background: var(--side-active); border-left-color: var(--gold); color: var(--heading); font-weight: 500; }
.tab-btn.active .tab-icon { color: var(--gold); }
.side-motto { text-align: center; font-style: italic; font-size: 15.5px; color: var(--side-muted); padding: 0 16px 16px; margin-top: -46px; text-shadow: 0 1px 4px #000; }
.motto-orn { display: block; width: 140px; height: 9px; margin: 0 auto 8px; background:
  linear-gradient(var(--brass-edge), var(--brass-edge)) left center / 60px 1px no-repeat,
  linear-gradient(var(--brass-edge), var(--brass-edge)) right center / 60px 1px no-repeat,
  linear-gradient(45deg, transparent 35%, var(--gold) 35% 65%, transparent 65%) center / 9px 9px no-repeat; }
.side-user { border-top: 1px solid var(--side-line); background: rgba(8,9,11,.6); }
.side-user .who, .side .who-btn { color: var(--heading); font-size: 15px; }
.side-user .muted, .side-user a { color: var(--side-muted) !important; font-size: 13px !important; }
.side-user a:hover { color: var(--gold-light) !important; }
.side .av.initial { background: #2a241a; color: var(--gold); border-color: var(--brass-edge); font-family: var(--font-display); }
.side :focus-visible { outline-color: var(--gold-light); }

/* En-tête illustré : peinture de bataille fondue vers le noir */
.top {
  position: relative; z-index: 2; border-bottom: 0; box-shadow: none; backdrop-filter: none;
  background: linear-gradient(90deg, #08090b 32%, rgba(8,9,11,.6) 58%, rgba(8,9,11,.15)), linear-gradient(transparent 55%, #08090b),
    url(/static/img/entete-bataille.webp) right top / auto 100% no-repeat, #08090b;
}
.top-inner { padding: 46px 30px 26px 34px; align-items: flex-start; min-height: 170px; }
.top .kick { color: var(--gold); }
.top .title { font-family: var(--font-heading); font-weight: 500; font-size: 32px; color: var(--heading); margin: 4px 0 0; text-shadow: 0 2px 8px #000; white-space: normal; }
.top-sub { margin: 6px 0 0; font-size: 16.5px; color: var(--side-muted); max-width: 60ch; text-shadow: 0 1px 4px #000; }
main.content { padding: 4px 30px 90px 34px; max-width: 1180px; }
#status-pill { flex-wrap: wrap; justify-content: flex-end; }

/* Carte « Serveur en ligne » sur la scène de bataille */
.hero { margin-bottom: 16px; }
.srv-card { position: relative; display: flex; flex-wrap: wrap; min-height: 250px; border: 1px solid var(--side-line); border-radius: 4px; overflow: hidden; margin-bottom: 14px;
  background: linear-gradient(90deg, rgba(8,9,11,.72), rgba(8,9,11,.6) 40%, rgba(8,9,11,.8) 58%, rgba(10,11,13,.97) 64%), url(/static/img/serveur-bataille.webp) left center / cover no-repeat, #0f1014; }
.srv-main { flex: 1 1 360px; padding: 24px 26px; display: flex; flex-direction: column; text-shadow: 0 1px 4px #000; }
.srv-state { display: flex; align-items: center; gap: 14px; }
.srv-card .big-dot { width: 18px; height: 18px; background: var(--knob); }
.srv-card.up .big-dot { background: var(--ok); animation: ring 1.8s infinite; }
.srv-card.busy .big-dot { background: var(--orange); }
.srv-card.down .big-dot { background: var(--danger-solid); }
.srv-card .hero-label { font-size: 30px; color: var(--gold-light); }
.srv-card .hero-sub { color: var(--ink-2); font-size: 16.5px; margin: 4px 0 0 32px; }
.srv-card .hero-actions { margin-top: auto; padding-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.srv-info { flex: 0 1 380px; margin: 0; padding: 26px 26px 22px; display: flex; flex-direction: column; gap: 7px; }
.srv-row { display: flex; justify-content: space-between; gap: 16px; font-size: 15.5px; }
.srv-row dt { color: var(--muted); }
.srv-row dd { margin: 0; color: var(--heading); text-align: right; font-variant-numeric: lining-nums tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.copy-addr { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; font: inherit; color: var(--heading); cursor: pointer; text-align: right; }
.copy-addr .ico { width: 15px; height: 15px; color: var(--gold); }
.copy-addr:hover { color: var(--gold-light); }

/* Grille de l'accueil */
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; align-items: start; }
.home-grid section.sec { margin: 0; }
.home-grid section.sec:first-child { grid-column: 1 / -1; }
.rot-mini { list-style: none; margin: 0; padding: 0; }
.rot-mini li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--color-divider); }
.rot-mini li:last-child { border-bottom: 0; }
.rot-mini li.now .rm-name { color: var(--gold-light); }
.rot-mini .rot-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13.5px; flex: none; }
.rm-name { flex: 1; min-width: 0; color: var(--heading); display: flex; flex-direction: column; }
.rm-name small { font-size: 13.5px; color: var(--muted); }
.rm-time { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.rm-time .ico { width: 15px; height: 15px; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.res { background: #0c0d10; border: 1px solid var(--color-divider); border-radius: 4px; padding: 14px 16px; }
.res-top { display: flex; align-items: center; gap: 12px; }
.res-top .ico { width: 24px; height: 24px; }
.res-sub { font-size: 13.5px; color: var(--faint); margin-top: 6px; }

/* Connexion et mot de passe : même ambiance */
.auth { background: linear-gradient(rgba(8,9,11,.72), rgba(8,9,11,.92) 60%, #08090b), url(/static/img/entete-bataille.webp) center top / cover no-repeat, #08090b; }
.auth-box { background: linear-gradient(rgba(17,18,22,.96), rgba(11,12,14,.97)); border: 1px solid var(--brass-edge); border-radius: 6px; box-shadow: var(--shadow-lg); padding: 34px 34px 30px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0 0 22px; padding-bottom: 18px; border-bottom: 1px solid var(--side-line); }
.auth-box h1 { font-family: var(--font-heading); font-weight: 500; font-size: 32px; color: var(--heading); }
.auth-box p { color: var(--ink-2); font-size: 16.5px; }
.auth-box .lbl { color: var(--muted); font-size: 14.5px; }
.auth-box .btn-primary { min-height: var(--tap); padding: 10px 22px !important; font-size: 16px !important; }
.auth-box .input { min-height: var(--tap); }
.auth-box .err { color: var(--danger); font-size: 15px; }
.auth-box .ok { color: var(--ok-d); font-size: 15px; }

/* Téléphone et tablette */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; min-height: 0; margin: 0; border-radius: 0; border-width: 0 0 1px; }
  .side-art, .side-motto { display: none; }
  .side-brand { flex-direction: row; justify-content: center; align-items: baseline; gap: 12px; padding: 16px; }
  .logo { font-size: 27px; }
  .logo-sub { font-size: 11px; letter-spacing: .22em; }
  .menu-toggle { color: var(--heading); border-color: var(--side-line); font-size: 16.5px; }
  .menu-toggle .muted { color: var(--side-muted); }
  .menu-current { display: flex; align-items: center; gap: 10px; }
  .menu-current .ico { color: var(--gold); width: 19px; height: 19px; }
  .side-tabs.open { border-color: var(--side-line); }
  .side-tabs.open .tab-btn.active { border-left-color: var(--gold); }
  .top { background: linear-gradient(rgba(8,9,11,.78), rgba(8,9,11,.86) 70%, #08090b), url(/static/img/entete-bataille.webp) right top / cover no-repeat, #08090b; }
  .top-inner { padding: 22px 16px 16px; min-height: 0; }
  .top .title { font-size: 27px; }
  .top-sub { font-size: 15.5px; }
  main.content { padding: 4px 16px 80px; }
  .srv-card { background: linear-gradient(rgba(8,9,11,.74), rgba(8,9,11,.9) 60%, rgba(10,11,13,.97)), url(/static/img/serveur-bataille.webp) left top / cover no-repeat, #0f1014; }
  .srv-info { flex-basis: 100%; padding: 4px 20px 20px; }
  .srv-main { padding: 20px; }
  section.sec { padding: 16px; }
}
@media (max-width: 600px) {
  .srv-card .hero-sub { margin-left: 0; }
  .srv-card .hero-label { font-size: 26px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile { padding: 12px; gap: 10px; }
  .tile .ico { width: 22px; height: 22px; }
  .tile-v { font-size: 17px; }
  .auth-box { padding: 28px 20px 24px; }
}

/* Noms de parties ou de mods sans espace (ex. « ===== ») : retour à la ligne plutôt que débordement */
.rm-name, .rot-title, .mod-title, .tile-v, .srv-row dd, .rc-name, .podium-name { overflow-wrap: anywhere; }
