/* Vrais boutons : fond plein ou contour net, libellé verbe, 44 px, états visibles (survol, focus, actif, désactivé).
   Chargé après semaine.css : il remplace les styles de liens-texte et de pastilles. */
.sm .btn, .ad .btn, .foot .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; background: var(--ink); color: #fff; border: 2px solid var(--ink); border-radius: 4px; font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer; text-align: center; transition: background-color 120ms ease-out, color 120ms ease-out, transform 120ms ease-out; }
.sm .btn:hover, .ad .btn:hover { background: #333; color: #fff; }
.sm .btn:active, .ad .btn:active, .sm .wbtn:active, .sm .theme:active, .sm .seg button:active, .sm .bigword:active, .fr a:active { transform: scale(0.97); }
.sm .btn.ghost, .ad .btn.ghost { background: var(--paper); color: var(--ink); }
.sm .btn.ghost:hover, .ad .btn.ghost:hover { background: var(--band); color: var(--ink); }
.sm .btn.small, .ad .btn.small { padding: 0 14px; font-size: 15px; }
.sm .btn:disabled, .sm .seg button:disabled { opacity: .4; cursor: not-allowed; }
.sm .btn:focus-visible, .ad .btn:focus-visible, .sm .wbtn:focus-visible, .sm .theme:focus-visible, .sm .seg button:focus-visible, .fr a:focus-visible, .sm-fold > summary:focus-visible, .sm .bigword:focus-visible, .foot .btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.foot .btn { background: transparent; color: #fff; border-color: #fff; }
.foot .btn:hover { background: #fff; color: var(--ink); }
.sm-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.how { margin-top: 14px; }
.how-body { margin-top: 12px; padding: 14px 18px; background: var(--band); border-radius: 4px; max-width: 66ch; }
.how-body p { line-height: 1.5; }

/* contrôle segmenté */
.sm .seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; background: #cfcec9; border-radius: 6px; max-width: 100%; }
.sm .seg button { all: unset; box-sizing: border-box; cursor: pointer; min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; gap: 6px; background: var(--paper); color: var(--ink); font-size: 15px; border-radius: 4px; transition: background-color 120ms ease-out, color 120ms ease-out, transform 120ms ease-out; }
.sm .seg button:hover:not(:disabled) { background: var(--band); }
.sm .seg button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 700; }
.sm .seg .n { font-size: 13px; opacity: .75; font-weight: 400; }
#sm-tweets .seg { margin-bottom: 24px; }

/* mots et thèmes : de vrais boutons */
.sm .wbtn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; background: var(--band); color: var(--ink); border-radius: 4px; font-weight: 700; overflow-wrap: anywhere; transition: background-color 120ms ease-out, transform 120ms ease-out; }
.sm .wbtn:hover { background: #e4e3de; }
.sm .wbtn.nw { color: var(--accent-ink); }
.sm .sm-wordrow { gap: 8px; }
.sm .sm-wl { gap: 8px; }
.sm .sm-bars li { grid-template-columns: minmax(8rem, 15rem) minmax(60px, 1fr) 6rem; gap: 14px; padding: 2px 0; }
.sm .bigword { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; font-size: clamp(26px, 2.6vw, 34px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; padding: 12px 14px; margin: 6px 0 10px; background: var(--band); border-radius: 4px; overflow-wrap: anywhere; transition: background-color 120ms ease-out, transform 120ms ease-out; }
.sm .bigword:hover { background: #e4e3de; text-decoration: none; }
.sm .sm-bloc .btn { margin-top: 12px; }
.sm-themes { display: grid; gap: 6px; }
.sm .sm-themes li { display: block; padding: 0; background: none; }
.sm .theme { all: unset; box-sizing: border-box; width: 100%; min-height: 56px; display: grid; grid-template-columns: 2rem minmax(8rem, 15rem) minmax(0, 1fr) minmax(80px, 18%); gap: 4px 18px; align-items: center; padding: 6px 14px; background: var(--band); border-radius: 4px; cursor: pointer; transition: background-color 120ms ease-out, color 120ms ease-out, transform 120ms ease-out; }
.sm .theme:hover { background: #e4e3de; }
.sm .theme[aria-pressed="true"] { background: var(--ink); color: #fff; }
.sm .theme .rk { color: var(--gray); font-weight: 700; padding: 0; }
.sm .theme .th { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.sm .theme .near { font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm .theme .b { height: 8px; background: #fff; display: block; }
.sm .theme .b i { display: block; height: 100%; background: var(--ink); }
.sm .theme[aria-pressed="true"] .rk, .sm .theme[aria-pressed="true"] .near { color: #d6d6d2; }
.sm .theme[aria-pressed="true"] .b { background: #444; }
.sm .theme[aria-pressed="true"] .b i { background: #fff; }

/* frise : des tuiles-boutons, la semaine affichée est pleine */
.fr { border-bottom: 0; padding-block: 16px 4px; }
.fr ol { gap: 8px; }
.fr a.wk { display: grid; gap: 2px; min-width: 7.5rem; min-height: 60px; padding: 8px 16px; margin: 0; background: var(--band); color: var(--ink); border-radius: 4px; border-bottom: 0; text-decoration: none; transition: background-color 120ms ease-out, transform 120ms ease-out; }
.fr a.wk:hover { background: #e4e3de; color: var(--ink); }
.fr a.wk .d { font-size: 13px; color: var(--ink-2); }
.fr a.wk .m { font-size: 19px; font-weight: 700; color: var(--ink); }
.fr a.wk[aria-current="page"] { background: var(--ink); color: #fff; }
.fr a.wk[aria-current="page"] .d { color: #d6d6d2; }
.fr a.wk[aria-current="page"] .m { color: #fff; }

/* sections repliées : des barres-boutons */
.sm-more { border-top: 0; }
.sm-more-h { margin-bottom: 18px; }
.sm-fold { border-bottom: 0; margin-bottom: 8px; }
.sm-fold > summary { min-height: 64px; padding: 12px 18px; background: var(--band); border-radius: 4px; align-items: center; transition: background-color 120ms ease-out; }
.sm-fold > summary:hover { background: #e4e3de; }
.sm-fold > summary:hover .t h2 { text-decoration: none; }
.sm-fold .t { display: grid; gap: 2px; min-width: 0; }
.sm-fold .t h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.sm-fold .s { font-size: 14px; color: var(--ink-2); line-height: 1.35; }
.sm-fold > summary::after { content: "+"; font-size: 28px; flex: none; width: 32px; text-align: center; }
.sm-fold[open] > summary { background: var(--ink); color: #fff; }
.sm-fold[open] > summary .s { color: #d6d6d2; }
.sm-fold-body { padding: 24px 4px 28px; }
.ad-links { gap: 10px; }
.sm-gone-words { color: var(--ink-2); max-width: 60ch; }
.sm-wordrow { display: flex; flex-wrap: wrap; }
@media (max-width: 700px) {
  .sm .theme { grid-template-columns: 1.6rem minmax(0, 1fr) minmax(60px, 30%); }
  .sm .theme .near { grid-column: 2 / -1; grid-row: 2; }
}
@media (max-width: 520px) {
  .sm .sm-actions .btn { width: 100%; }
  .sm .bigword { font-size: 26px; }
  .sm .seg button { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .sm .btn, .sm .wbtn, .sm .theme, .sm .seg button, .fr a.wk, .sm-fold > summary, .sm .bigword { transition: none; }
  .sm .btn:active, .sm .wbtn:active, .sm .theme:active, .sm .seg button:active, .sm .bigword:active, .fr a:active { transform: none; }
}

.fr { position: relative; }
.sm-mot-small { text-wrap: balance; white-space: normal; }

/* tweets en colonnes (les longs textes sont coupés, le tweet entier est sur X) */
.tw-grid { display: block; columns: 3 300px; column-gap: clamp(24px, 3vw, 48px); }
.tw { break-inside: avoid; margin-bottom: 36px; }
.tw p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 9; line-clamp: 9; overflow: hidden; }
.sm .tw .btn, .sm .sm-bloc .btn.small { border-width: 1px; }
.sm-evo-grid h3 { margin-top: 22px; }
.sm-evo-grid h3:first-child, .sm-start-grid h3 { margin-top: 0; }
.sm-more { margin-top: clamp(64px, 8vw, 104px); }
.sm-more-h { margin-bottom: 16px; }
@media (max-width: 520px) {
  .sm .seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); width: 100%; }
  .sm .seg button { justify-content: center; }
  .tw p { -webkit-line-clamp: 12; line-clamp: 12; }
}

/* v3.1 : « nouveau » ne passe plus par la couleur (anneau noir et étoile), le mot et ses chiffres */
.sm .wbtn.nw { color: var(--ink); }
.sm .star { margin-left: 3px; font-weight: 700; }
.sm-node.is-new text { fill: var(--ink); font-weight: 700; }
.sm-newring { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.sm-node .sm-sel { stroke: var(--accent); stroke-width: 2.5; }
.sm-center .sm-sel { stroke: var(--accent); }
.sm-node text { font-size: 12px; }
.sm-measure { font-size: 12px; font-family: inherit; }
.sm-word-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px 56px; align-items: end; }
.sm-facts { display: grid; gap: 14px; align-content: end; }
.sm-facts .fact { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: 14px; align-items: baseline; }
.sm-facts .fact b { font-size: 44px; letter-spacing: -0.04em; line-height: 1; text-align: right; }
.sm-facts .fact span { font-size: 16px; line-height: 1.25; }
.sm-facts .split { display: flex; height: 12px; gap: 2px; margin-top: 6px; }
.sm-facts .split i { display: block; height: 100%; min-width: 2px; }
.sm-facts .sm-legend { margin-top: 0; }
@media (min-width: 1000px) {
  .sm-word-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); }
}
@media (max-width: 999px) {
  .sm-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; margin-top: 8px; }
  .sm-facts .fact { grid-template-columns: 1fr; gap: 4px; }
  .sm-facts .fact b { text-align: left; font-size: 36px; }
  .sm-facts .fact span { font-size: 14px; }
  .sm-facts .split, .sm-facts .sm-legend { grid-column: 1 / -1; }
}
/* vue Explorer (Administration) : tient à 360 px */
#view-explore .explore-row input { min-width: 0; width: 100%; }
#view-explore .explore-row .btn { flex: 1 0 auto; }
#view-explore .wrap { min-width: 0; }
#view-explore .chart, #view-explore .table-wrap { max-width: 100%; overflow-x: auto; }

.sm-node text { pointer-events: auto; }
.sm-center text { pointer-events: none; }

#explore-docs { grid-template-columns: minmax(0, 1fr); }
#explore-docs .excerpt { min-width: 0; }
#explore-docs .excerpt p { overflow-wrap: anywhere; }
