/* Outil « Réseaux sociaux : comptes et calendrier éditorial ». S'appuie sur
   suivi-temps.css (st-h2, st-alert, st-form, st-actions, st-link), charge.css
   (pc-head, pc-tabs, pc-plans, pc-bar, pc-row, pc-detail) et cv.css
   (cv-item, cv-mini, cv-status). Mois en grille sur ordinateur, liste des
   jours sur téléphone ; fenêtre d'édition en bas de l'écran sur téléphone. */
.rs-root, .rs-dialog { --rs-idee: rgba(var(--w), .10); --rs-preparer: rgba(234, 179, 8, .24); --rs-pret: rgba(59, 130, 246, .24); --rs-publie: rgba(34, 197, 94, .20); --rs-late: var(--color-error, #e05c5c); }
.rs-root [hidden], .rs-dialog [hidden] { display: none !important; }
.rs-root :focus-visible, .rs-dialog :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.rs-dot { flex: none; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* ---- barre du mois */
.rs-bar .st-actions { align-items: center; }
.rs-mtitle { margin: 0 4px; min-width: 9.5em; white-space: nowrap; color: var(--ink); font-size: 1.05rem; text-align: center; text-transform: capitalize; }
.rs-toggle { display: flex; align-items: center; gap: 6px; color: var(--soft); font-size: .86rem; }

/* ---- grille du mois (ordinateur) */
.rs-month { display: none; border: 1px solid var(--hair); border-radius: 10px; overflow: hidden; background: var(--card); }
.rs-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.rs-row + .rs-row { border-top: 1px solid var(--hair); }
.rs-dow span { padding: 6px 8px; color: var(--muted); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.rs-day { position: relative; display: flex; flex-direction: column; gap: 3px; min-height: 104px; padding: 4px 5px 6px; border-left: 1px solid var(--hair); min-width: 0; }
.rs-day:first-child { border-left: 0; }
.rs-day.is-out { background: rgba(var(--w), .03); }
.rs-day.is-out .rs-dnum span { color: var(--muted); opacity: .6; }
.rs-day.is-ferie { background: rgba(210, 162, 58, .07); }
.rs-dnum { display: flex; align-items: center; justify-content: space-between; min-height: 24px; }
.rs-dnum span { color: var(--soft); font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.rs-day.is-today .rs-dnum span { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 12px; background: var(--ink); color: var(--card); }
.rs-add { width: 24px; height: 24px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--muted); font: inherit; font-size: 1rem; line-height: 1; cursor: pointer; opacity: 0; }
.rs-day:hover .rs-add, .rs-add:focus-visible { opacity: 1; border-color: var(--hair); color: var(--ink); }
@media (hover: none) { .rs-add { opacity: 1; } }

/* ---- publications et repères */
.rs-chip { display: flex; align-items: center; gap: 2px; width: 100%; min-height: 26px; padding: 3px 6px; border: 1px solid transparent; border-radius: 6px; background: var(--rs-idee); color: var(--ink); font: inherit; font-size: .76rem; line-height: 1.25; text-align: left; cursor: pointer; }
.rs-chip > b, .rs-chip > span:not(.rs-dot) { margin-left: 3px; }
.rs-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rs-chip b { flex: none; margin-right: 3px; font-variant-numeric: tabular-nums; }
.rs-chip .rs-dot { width: 7px; height: 7px; margin-right: 1px; }
.rs-chip.is-preparer { background: var(--rs-preparer); }
.rs-chip.is-pret { background: var(--rs-pret); }
.rs-chip.is-publie { background: var(--rs-publie); color: var(--soft); }
.rs-chip.is-late { border-color: var(--rs-late); }
.rs-chip:hover { border-color: rgba(var(--w), .35); }
.rs-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rs-chips .rs-chip { width: auto; max-width: 100%; }
.rs-rep { display: block; width: 100%; padding: 1px 5px; border: 0; border-left: 3px solid var(--gold); border-radius: 3px; background: none; color: var(--soft); font: inherit; font-size: .72rem; line-height: 1.3; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-rep small { display: block; color: var(--muted); font-size: .76rem; white-space: normal; }
.rs-rep.is-ferie { border-left-color: var(--gold); font-weight: 600; }
.rs-rep.is-commerce { border-left-color: #3b82f6; }
.rs-rep.is-soldes { border-left-color: #d62976; }
.rs-rep:hover { color: var(--ink); background: rgba(var(--w), .05); }
.rs-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.rs-legend .rs-rep { display: inline-block; width: auto; cursor: default; }
.rs-hint { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin-top: 12px; }

/* ---- liste des jours (téléphone) */
.rs-agenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rs-agenda > li { display: grid; gap: 5px; padding: 10px 12px; border: 1px solid var(--hair); border-radius: 10px; background: var(--card-2); }
.rs-agenda > li.is-today { border-color: rgba(var(--w), .4); }
.rs-ag-h { display: flex; align-items: baseline; gap: 6px; }
.rs-ag-h b { color: var(--ink); font-size: .92rem; }
.rs-ag-h small { color: var(--muted); }
.rs-ag-h .st-link { margin-left: auto; font-size: .86rem; }
.rs-agenda .rs-chip { min-height: 36px; font-size: .86rem; }
.rs-agenda .rs-rep { white-space: normal; font-size: .84rem; padding: 2px 8px; }
.rs-ag-empty { color: var(--muted); }
@media (min-width: 760px) {
  .rs-month { display: block; }
  .rs-agenda { display: none; }
}

/* ---- cartes des publications */
.rs-gt { margin: 16px 0 8px; }
.rs-cards, .rs-comptes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rs-card, .rs-compte { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--hair); border-radius: 10px; background: var(--card-2); min-width: 0; }
.rs-card.is-late { border-color: var(--rs-late); }
.rs-card-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .84rem; }
.rs-when { color: var(--soft); }
.rs-dots { margin-left: auto; }
.rs-card-t { color: var(--ink); }
.rs-excerpt { margin: 0; color: var(--soft); font-size: .88rem; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.rs-card-a, .rs-compte .st-actions { margin: 2px 0 0; gap: 8px; }
.rs-st { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--rs-idee); color: var(--ink); font-size: .74rem; font-weight: 700; }
.rs-st.is-preparer { background: var(--rs-preparer); }
.rs-st.is-pret { background: var(--rs-pret); }
.rs-st.is-publie { background: var(--rs-publie); }
.rs-st.is-late { background: var(--rs-late); color: #fff; }
.sim-note.is-bad, .rs-count.is-bad { color: var(--rs-late); }

/* ---- comptes */
.rs-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.rs-quick .btn-ghost { display: inline-flex; align-items: center; }
.rs-compte-h { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.rs-compte-h b { color: var(--ink); }
.rs-compte-h small { color: var(--muted); }
.rs-compte p { margin: 0; }
.rs-url a { color: var(--soft); font-size: .86rem; overflow-wrap: anywhere; }
.rs-danger { margin-top: 18px; }
.rs-danger .is-danger, .rs-dialog .is-danger { color: var(--st-danger, #e05c5c); }
.rs-safety .sim-note { margin: 0; line-height: 1.6; }

/* ---- fenêtre d'édition */
.rs-dialog { width: min(600px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid rgba(var(--w), .18); border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); overflow: auto; }
.rs-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.rs-dialog .ar-dialog-body { display: grid; gap: 10px; padding: 20px; }
.rs-dialog .ar-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rs-dialog .ar-dialog-head h2 { margin: 0; font-size: 1.15rem; line-height: 1.3; }
.rs-dialog .ar-actions { position: sticky; bottom: -20px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px -20px -20px; padding: 14px 20px; border-top: 1px solid var(--hair); background: var(--card); }
.rs-dialog .ar-actions > .is-cta { flex: 1 1 160px; }
.rs-dialog .btn-ghost { min-height: 44px; justify-content: center; font: inherit; font-size: .92rem; font-weight: 700; cursor: pointer; }
.rs-dialog textarea { min-height: 140px; resize: vertical; }
.rs-where { display: grid; gap: 4px; margin: 0; padding: 0; border: 0; }
.rs-where legend { margin-bottom: 4px; }
.rs-where .sim-check { display: flex; align-items: center; gap: 6px; min-height: 36px; }
.rs-where small { color: var(--muted); }
.rs-count, .rs-nopass { margin: -4px 0 0; }
.rs-dialog .sim-note { margin: 0; }
@media (max-width: 620px) {
  .rs-dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; border-bottom: 0; max-height: 92dvh; }
  .rs-bar { gap: 10px; }
  .rs-bar .pc-out { width: 100%; justify-content: center; }
  .rs-mtitle { min-width: 0; flex: 1; }
  .rs-bar > .st-actions { width: 100%; flex-wrap: nowrap; }
  .rs-today { white-space: nowrap; }
}
@media (max-width: 440px) { .rs-n { display: none; } }
