/* Tableau blanc partagé (board.js). Variables à redéfinir par l'intégration :
   --wb-max-h : hauteur maximale de la surface (par défaut, la fenêtre moins la barre d'outils) ;
   --wb-bg, --wb-fg, --wb-border, --wb-accent : couleurs de la barre d'outils. */
.wb {
  --wb-bg: #f8f9fa;
  --wb-fg: #212529;
  --wb-border: #ced4da;
  --wb-accent: #1c7ed6;
  --wb-max-h: calc(100vh - 9rem);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  outline: none;
}
/* La surface reste blanche (comme un vrai tableau) ; seule la barre d'outils suit le thème. */
@media (prefers-color-scheme: dark) {
  .wb {
    --wb-bg: #25262b;
    --wb-fg: #e9ecef;
    --wb-border: #495057;
  }
}
.wb-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
  padding: 0.35rem 0.5rem;
  background: var(--wb-bg);
  color: var(--wb-fg);
  border: 1px solid var(--wb-border, #ced4da);
  border-radius: 8px;
}
.wb-toolbar[hidden] {
  display: none;
}
.wb-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  align-items: center;
}
.wb-btn {
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.35rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wb-btn:hover:not(:disabled) {
  border-color: var(--wb-border);
}
.wb-btn[aria-pressed="true"] {
  border-color: var(--wb-accent);
  background: color-mix(in srgb, var(--wb-accent) 15%, transparent);
}
.wb-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.wb-btn:focus-visible,
.wb-swatch:focus-visible {
  outline: 2px solid var(--wb-accent);
  outline-offset: 1px;
}
.wb-unflag {
  font-size: 0.85rem;
  color: #e03131;
}
.wb-swatch {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid var(--wb-border);
  background: var(--wb-c);
  cursor: pointer;
  padding: 0;
}
.wb-swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--wb-bg), 0 0 0 4px var(--wb-accent);
}
.wb-dot {
  width: var(--wb-w);
  height: var(--wb-w);
  border-radius: 50%;
  background: currentColor;
}
.wb-stage {
  position: relative;
  width: min(100%, calc(var(--wb-max-h) * 1.6));
  aspect-ratio: 16 / 10;
  margin: 0 auto;
  border: 1px solid var(--wb-border, #ced4da);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.wb-canvas {
  display: block;
  touch-action: none;
  cursor: crosshair;
}
.wb-stage[data-tool="select"] .wb-canvas {
  cursor: default;
}
.wb-stage[data-tool="text"] .wb-canvas,
.wb-stage[data-tool="note"] .wb-canvas {
  cursor: text;
}
.wb-input {
  position: absolute;
  box-sizing: border-box;
  margin: 0;
  border: 1px dashed var(--wb-accent);
  background: var(--wb-c, transparent);
  resize: none;
  overflow: hidden;
  outline: none;
  white-space: pre;
}
.wb-input-note {
  white-space: pre-wrap;
  border-radius: 4px;
}
.wb-status {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.75;
  text-align: center;
}
.wb-status[hidden] {
  display: none;
}

/* Mosaïque (mosaic.js) : tous les tableaux côte à côte, en lecture seule. */
.wb-mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 0.75rem;
  align-items: start;
}
.wb-mosaic[data-count="1"] { grid-template-columns: 1fr; }
.wb-mosaic[data-count="2"],
.wb-mosaic[data-count="4"] { grid-template-columns: repeat(auto-fill, minmax(min(100%, 28rem), 1fr)); }
.wb-tile {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}
button.wb-tile { cursor: zoom-in; }
.wb-tile-caption {
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wb-tile-art {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  border: 1px solid var(--wb-border, #ced4da);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  color: #868e96;
}
button.wb-tile:hover .wb-tile-art,
button.wb-tile:focus-visible .wb-tile-art { border-color: var(--wb-accent, #1c7ed6); }
.wb-tile-art svg {
  display: block;
  width: 100%;
  height: 100%;
}
.wb-mosaic[data-count="1"] .wb-tile { width: min(100%, calc((100vh - 10rem) * 1.6)); }
