/* Portail de planning des communautés partenaires.
   Jetons, polices et angles droits d'index4g.com (css/site.css), comme social.index4g.com/admin.
   L'or ne signale que l'action principale et le focus ; l'état actif est du contraste (blanc). */
:root {
  color-scheme: dark;
  --bg:        #0a0a0a;
  --raise:     #151515;
  --surface:   rgba(255,255,255,.055);
  --line:      rgba(255,255,255,.1);
  --line-soft: rgba(255,255,255,.06);
  --text:      #f0eff0;
  --muted:     #b5b5b5;
  --dim:       #6a6a6a;
  --gold:      #e5c469;
  --signal:    #f44336;
  --discord:   #5865f2;
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
  --display: 'Bebas Neue', Impact, sans-serif;
  --body:    'Satoshi', system-ui, -apple-system, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
/* Angles droits partout : règle n°1 du hub, sans exception. */
* { border-radius: 0 !important; }
[hidden] { display: none !important; }

body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--body); }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
h1 { font: 400 44px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; margin: 0; }
.hint { color: var(--dim); font-size: 12px; line-height: 1.6; margin: 0 0 10px; }

/* ── Boutons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 14px; padding: 9px 16px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.btn:hover { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.09); }
.btn:disabled { opacity: .45; cursor: progress; }
.btn-small { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #14120a; font-weight: 700; letter-spacing: .04em; }
.btn-gold:hover { background: #efd482; border-color: #efd482; }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: rgba(244,67,54,.4); color: var(--signal); }
.btn-danger:hover { border-color: var(--signal); background: rgba(244,67,54,.08); }
.quit { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.welcome-staff { margin-top: 30px; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.welcome-staff .fill-options { justify-content: center; }
.btn-discord { background: var(--discord); border-color: var(--discord); color: #fff; font-weight: 700; padding: 12px 22px; }
.btn-discord:hover { background: #4752c4; border-color: #4752c4; }
.link { border: 0; background: none; padding: 2px 0; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.link:hover { color: var(--text); text-decoration-color: currentColor; }
.icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; flex: none; }
.icon:hover { border-color: rgba(255,255,255,.28); }

/* ── Connexion et premier passage ── */
.gate { max-width: 460px; margin: 0 auto; padding: 14vh 24px 40px; text-align: center; }
.gate-logo { width: 72px; height: 72px; margin: 0 auto 20px; background: var(--raise); object-fit: cover; }
.gate-logo.round, .pic.round, .space-logo { border-radius: 50% !important; }
.gate-sub { color: var(--muted); margin: 12px 0 28px; }
.gate-note { color: var(--dim); font-size: 12px; margin-top: 22px; }
.gate-invite { border: 1px solid var(--line); background: var(--raise); padding: 12px 14px; font-size: 14px; }
.gate-error { background: rgba(244,67,54,.1); border: 1px solid rgba(244,67,54,.35); color: #ffb4b4; padding: 12px 14px; text-align: left; font-size: 14px; }
.create { display: grid; gap: 10px; text-align: left; margin-top: 8px; }
.create label { font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.create-row { display: flex; align-items: stretch; gap: 8px; }
.create-row input { flex: 1; min-width: 0; }
.prefix { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); color: var(--dim); font: 13px var(--mono); background: var(--raise); }

/* ── Barre ── */
.bar { display: flex; align-items: center; gap: 14px 22px; flex-wrap: wrap; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--raise); position: sticky; top: 0; z-index: 10; }
.bar-id { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 220px; }
.space-logo { width: 38px; height: 38px; flex: none; background: var(--bg); object-fit: cover; }
.bar-name { min-width: 0; }
.bar-name strong { display: block; font: 400 24px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-name select { width: auto; max-width: 100%; margin: 0; padding: 4px 8px; font: 400 20px/1 var(--display); letter-spacing: .1em; }
.bar-sub { display: block; margin-top: 4px; color: var(--dim); font: 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.bar-sub.err { color: #ffb4b4; }
.bar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
/* Onglets en tête de la colonne d'édition, collés sous la barre (--bar-h mesurée par app.js). */
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--bg); position: sticky; top: var(--bar-h, 64px); z-index: 6; margin-bottom: 22px; }
.tabs [role=tab] { border: 0; background: var(--bg); padding: 12px 6px; color: var(--dim); font: 400 19px/1 var(--display); letter-spacing: .1em; cursor: pointer; white-space: nowrap; }
.tabs [role=tab] + [role=tab] { border-left: 1px solid var(--line); }
.tabs [role=tab]:hover { color: var(--muted); }
.tabs [aria-selected=true] { background: var(--raise); color: var(--text); }

/* ── Colonnes ── */
/* L'éditeur garde sa largeur ; l'aperçu prend tout le reste de l'écran, sans jamais dépasser sa hauteur. */
.cols { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 32px; padding: 24px; align-items: start; }
.editor { min-width: 0; }
.preview { position: sticky; top: calc(var(--bar-h, 64px) + 24px); min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.preview canvas { display: block; max-width: 100%; max-height: calc(100vh - var(--bar-h, 64px) - 90px); width: auto; height: auto; border: 1px solid var(--line); background: var(--raise); }
.caption { margin: 0; color: var(--dim); font: 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; text-align: center; }
@media (max-width: 900px) {
  .cols { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .preview { position: static; order: -1; }
  .preview canvas { max-height: 70vh; }
  .bar { padding: 12px 16px; }
}

/* ── Semaine ── */
.weeknav { display: flex; align-items: center; gap: 10px; }
.weeknav h2 { flex: 1; margin: 0; text-align: center; font: 400 28px/1.1 var(--display); letter-spacing: .1em; text-transform: uppercase; }
.fill { margin-top: 16px; border: 1px solid var(--line); background: var(--raise); padding: 14px 16px; }
.fill p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.fill-options { display: flex; flex-wrap: wrap; gap: 8px; }
.days { list-style: none; margin: 16px 0 0; padding: 0; }
.day { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.day:last-child { border-bottom: 1px solid var(--line-soft); }
.day-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dname { font: 400 22px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; }
.ddate { color: var(--dim); font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.seg { margin-left: auto; display: flex; border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 5px 12px; color: var(--dim); font: 600 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed=true] { background: var(--text); color: var(--bg); }
.slot { display: grid; grid-template-columns: 128px minmax(0, 1fr) 42px; gap: 6px 8px; margin-top: 10px; }
.slot.has-rm { grid-template-columns: 128px minmax(0, 1fr) 42px 38px; }
input[type=text], input[type=time], select {
  display: block; width: 100%; min-height: 42px; padding: 9px 11px;
  background: var(--bg); border: 1px solid var(--line); color: var(--text); font-weight: 400;
}
input:focus, select:focus { outline: none; border-color: var(--gold); }
input::placeholder { color: var(--dim); }
.slot .note { grid-column: 2 / -1; min-height: 34px; padding-block: 6px; font-size: 13px; color: var(--muted); background: transparent; border-color: var(--line-soft); }
.slot .reset-img { grid-column: 2 / -1; justify-self: start; }
.thumb { width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); background: var(--raise); overflow: hidden; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { border-color: rgba(255,255,255,.28); }
.what { position: relative; min-width: 0; }
.sugg { position: absolute; left: 0; right: -50px; top: calc(100% + 4px); z-index: 5; list-style: none; margin: 0; padding: 4px; background: var(--raise); border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,.6); max-height: 380px; overflow: auto; }
.sugg .sec { padding: 8px 8px 4px; color: var(--dim); font: 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.sugg button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 5px 8px; font-size: 14px; text-align: left; cursor: pointer; color: var(--muted); }
.sugg button:hover, .sugg button.on { background: var(--surface); color: var(--text); }
.sugg img, .sugg .ph { flex: none; width: 24px; height: 32px; object-fit: cover; background: var(--bg); }
.sugg span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg small { flex: none; color: var(--dim); font: 11px var(--mono); }
.add { display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0 136px; border: 0; background: none; padding: 4px 0; color: var(--muted); font-size: 13px; cursor: pointer; }
.add:hover { color: var(--text); }
.offnote { margin: 8px 0 0; color: var(--dim); font-size: 13px; }
.presets-bar { margin-top: 14px; }
.preset-form { margin-top: 10px; display: grid; gap: 8px; }
.preset-form label { font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }

/* ── Réglages : trois onglets courts, deux petits réglages côte à côte quand ils tiennent ── */
.set { border: 0; margin: 0 0 26px; padding: 0; min-width: 0; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.opts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opts.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.opts.five { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.opts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .opts.three { grid-template-columns: minmax(0, 1fr); } }
.pair .opt.fmt { flex-direction: column; align-items: flex-start; gap: 8px; }
@media (max-width: 520px) {
  .pair { grid-template-columns: minmax(0, 1fr); }
  .opts.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.set legend { padding: 0; margin-bottom: 12px; color: var(--dim); font: 600 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-width: 0; min-height: 36px; padding: 6px 8px; border: 1px solid var(--line); background: transparent; color: var(--dim); font-weight: 700; cursor: pointer; }
.chip[aria-pressed=true] { background: var(--text); border-color: var(--text); color: var(--bg); }
.quick { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.opts { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
/* Une option garde son filet au repos ; la sélection se dit par le fond et le blanc. */
.opt { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border: 1px solid var(--line); background: transparent; color: var(--muted); text-align: left; cursor: pointer; min-width: 0; }
.opt:hover { border-color: rgba(255,255,255,.28); }
.opt[aria-pressed=true] { background: var(--surface); border-color: rgba(255,255,255,.4); color: var(--text); }
.opt strong { font-size: 14px; }
.opt small { display: block; color: var(--dim); font: 11px var(--mono); }
.opt.fmt { flex-direction: row; align-items: center; gap: 12px; }
.shape { flex: none; display: block; border: 2px solid currentColor; }
.shape.h { width: 48px; height: 27px; }
.shape.v { width: 28px; height: 35px; }
.shape.s { width: 22px; height: 39px; }
.mini { display: block; width: 100%; height: 34px; background: var(--raise); border: 1px solid var(--line-soft); }
.mini.plein { background: linear-gradient(90deg, var(--raise) 12%, #6b5a2c); }
.mini.diagonale { background: linear-gradient(104deg, var(--raise) 0 62%, #6b5a2c 62% 100%); }
.mini.moitie { background: linear-gradient(90deg, var(--raise) 0 66%, #6b5a2c 66% 100%); }
.sw { position: relative; display: block; width: 100%; height: 44px; overflow: hidden; }
.sw i { position: absolute; left: 10px; top: 10px; width: 22px; height: 5px; }
.sw b { position: absolute; left: 10px; bottom: 7px; font: 800 17px/1 var(--body); }
.sample { font-size: 21px; line-height: 1.1; white-space: nowrap; color: var(--text); }
.colors { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 12px; }
.colors label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
input[type=color] { width: 34px; height: 34px; padding: 2px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.pic-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.pic { width: 64px; height: 64px; object-fit: cover; background: var(--raise); }
.pic.wide { width: 160px; height: 64px; }
.sr:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 2px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.fields label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; }
.tags:empty { display: none; }
.tags li { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 5px 6px 5px 10px; font-size: 13px; }
.tags li small { color: var(--dim); font: 11px var(--mono); }
.tags button { border: 0; background: none; color: var(--dim); cursor: pointer; padding: 0 4px; font-size: 13px; }
.tags button:hover { color: var(--text); }
.invite { display: flex; gap: 8px; margin-top: 10px; }
.invite input { flex: 1; min-width: 0; font: 12px var(--mono); }

/* ── Retours ── */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 30; max-width: calc(100% - 32px); padding: 12px 18px; background: var(--text); color: var(--bg); font-weight: 700; font-size: 14px; }
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.72); }
.sheet { width: min(760px, 100%); max-height: calc(100% - 32px); overflow: auto; display: grid; gap: 12px; padding: 22px; background: var(--raise); border: 1px solid var(--line); }
.sheet h2 { margin: 0; font: 400 26px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; }
.sheet p { margin: 0; color: var(--muted); font-size: 14px; }
.sheet .row { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
