/* The live whiteboard (public/whiteboard.js): Nova's marks on a canvas layered exactly over the
   writing pad (public/answer-pad.css sizes the pad canvas; the layer follows it). The layer never
   takes pointer events, so writing goes straight to the pad. Mobile-first, logical properties for
   right-to-left pages, 44 px touch targets, Okabe-Ito colours (drawn in whiteboard.js). */
.wb-stage { position: relative; width: 100%; }
.wb-stage > .wp-canvas { position: relative; z-index: 0; }
.wb-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.wb-layer[hidden] { display: none; }
.wb-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin-block: 0.25rem 0;
  min-width: 0;
}
.wb-status {
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  color: #4a4d6e;
  overflow-wrap: anywhere;
}
.wb-status:empty { display: none; }
.wb-status[data-state="unavailable"] {
  padding: 0.3rem 0.6rem;
  border-radius: 10px;
  background: #fff4dc;
  color: #6b4500;
  border-inline-start: 4px solid #e69f00;
}
.wb-status[data-state="unsure"],
.wb-status[data-state="retry"] {
  padding: 0.3rem 0.6rem;
  border-radius: 10px;
  background: #fbeaf3;
  color: #5c1f45;
  border-inline-start: 4px dotted #cc79a7;
}
.wb-status[data-state="looking"]::before {
  content: "";
  display: inline-block;
  inline-size: 0.6rem;
  block-size: 0.6rem;
  margin-inline-end: 0.4rem;
  border-radius: 50%;
  background: #0072b2;
  animation: wb-pulse 1.2s ease-in-out infinite;
}
.wb-caption {
  flex: 1 1 100%;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.4;
  color: #12204f;
  overflow-wrap: anywhere;
}
.wb-caption:empty { display: none; }
.wb-toggle {
  min-height: 44px;
  min-width: 44px;
  padding: 0.35rem 0.75rem;
  border: 2px solid #c9c3e6;
  border-radius: 12px;
  background: #ffffff;
  color: #1d1b3a;
  font: inherit;
  white-space: normal;
  margin-inline-start: auto;
}
.wb-toggle[aria-pressed="true"] { background: #e9e4ff; border-color: #6b5bd6; }
.wb-toggle:focus-visible { outline: 3px solid #6b5bd6; outline-offset: 2px; }
/* RC8C W2 (founder: Pen, Eraser and Undo wrapped one letter per line). Root cause: the sheet sits
   inside the question's message (.ws-msg, workspace.css: overflow-wrap: anywhere), which every
   label inherits, so a button's narrowest size became one letter; from 640 px workspace.css puts
   the pad in a row (tools | page) and the board's status bar became a third, squeezed column.
   With the board mounted (data-wb-on, set by whiteboard.js): labels break only between words
   (longer translations still wrap at spaces), the tools take the width of their longest word, the
   page takes the rest, and Nova's status and words run full width under the page. */
.wp[data-wb-on] .wp-btn,
.wp[data-wb-on] .wb-toggle { overflow-wrap: normal; word-break: normal; hyphens: manual; }
.wp[data-wb-on] .wb-status,
.wp[data-wb-on] .wb-caption { overflow-wrap: break-word; }
.wp[data-wb-on] > .wb-stage { min-inline-size: 0; }
.wp[data-wb-on] > .wb-bar { inline-size: 100%; min-inline-size: 0; }
@media (max-width: 639.98px) {
  /* Phones: the tools in one or two even rows above the page. */
  .wp[data-wb-on] > .wp-bar .wp-btn { flex: 1 0 auto; padding-inline: 0.6rem; }
}
@media (min-width: 640px) {
  .ws-pad-host .wp[data-wb-on],
  .wp[data-wb-on] {
    display: grid;
    grid-template-columns: fit-content(11rem) minmax(0, 1fr);
    grid-template-areas: "tools stage" "tools status";
    align-items: start;
    gap: 0.4rem 0.6rem;
  }
  .ws-pad-host .wp[data-wb-on] > .wp-bar,
  .wp[data-wb-on] > .wp-bar { grid-area: tools; display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .wp[data-wb-on] > .wb-stage { grid-area: stage; }
  .wp[data-wb-on] > .wb-bar { grid-area: status; margin-block: 0; }
}
@keyframes wb-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .wb-status[data-state="looking"]::before { animation: none; opacity: 1; }
}
