/* ============================================================================
 * İzzət Məktəbi — the shared board of the live class (js/live-board.js).
 * The panel #rLesson.rb holds: header (.rb-h) · tools (.rb-tools) · stage
 * (.rb-stage: the lesson iframe or the blank board + two canvases).
 * Tokens come from platform.css.
 * ============================================================================ */
.room.wide .rlesson{margin-top:18px}
.rpen{align-self:flex-start}
.rpen.on{border-color:var(--gold);color:var(--gold-t)}
.rb .rb-h{flex-wrap:wrap;align-items:center;gap:8px 10px;margin-bottom:0}
.rb .rb-t{flex:1 1 180px;min-width:0}
.rb-seg{display:inline-flex;border:1.5px solid var(--line);border-radius:10px;overflow:hidden;flex:0 0 auto}
.rb-seg button{border:0;background:#fff;padding:7px 13px;font:600 13px var(--sans);color:var(--ink2);cursor:pointer}
.rb-seg button+button{border-left:1.5px solid var(--line)}
.rb-seg button[aria-pressed=true]{background:var(--em);color:#fff}
.rb-pages{display:inline-flex;align-items:center;gap:6px;font-size:13px;white-space:nowrap}
.rb-pb{display:inline-flex;align-items:center;gap:5px;border:1.5px solid var(--line);background:#fff;border-radius:9px;min-width:34px;height:34px;padding:0 9px;font:600 14px var(--sans);color:var(--em);cursor:pointer;justify-content:center}
.rb-pb:disabled{opacity:.4;cursor:default}
.rb-pb.rb-add{font-size:13px}
.rb-fullb span{font-size:13px}
.rb-fullb[aria-pressed=true]{background:var(--gold-l);border-color:var(--gold);color:var(--gold-t)}

.rb-tools{display:flex;align-items:center;gap:4px;margin:12px -20px 0;padding:6px 14px;background:var(--em-d);overflow-x:auto;scrollbar-width:none}
.rb-tools::-webkit-scrollbar{display:none}
.rb-b{display:inline-flex;align-items:center;gap:6px;background:transparent;border:0;color:#fff;padding:7px 9px;border-radius:9px;cursor:pointer;font:600 13px var(--sans);flex:0 0 auto}
.rb-b:hover{background:rgba(255,255,255,.12)}
.rb-b.on{background:var(--gold-l);color:var(--em-d)}
.rb-girl .rb-b[data-rbt=eraser]{display:none}
.rb-cols{display:inline-flex;gap:5px;padding:0 6px;flex:0 0 auto}
.rb-col{width:24px;height:24px;border-radius:50%;border:2px solid rgba(255,255,255,.7);background:var(--c);cursor:pointer;padding:0;flex:0 0 auto}
.rb-col.on{box-shadow:0 0 0 2px var(--gold-hi);border-color:#fff}

.rb-stage{position:relative;overflow:hidden;background:#fff}
.rb .rb-tools:not([hidden])+.rb-stage{margin-top:0;border-top:0}
.rb-stage canvas{position:absolute;left:0;top:0;pointer-events:none;z-index:2}
.rb-stage #rbLive{z-index:3}
.rb-stage #rbLive.draw{pointer-events:auto;touch-action:none;cursor:crosshair}
.rb-stage #rbLive.draw.eraser{cursor:cell}
/* the blank board: a 4:3 sheet with a faint squared grid (20 x 15), placed by the script */
.rb-board{position:absolute;z-index:1;background-color:#fff;background-image:linear-gradient(#EDF1EE 1px,transparent 1px),linear-gradient(90deg,#EDF1EE 1px,transparent 1px);background-size:5% 6.6667%;box-shadow:0 0 0 1px var(--line)}
.rb.is-board .rb-stage{background:#ECEAE2;height:auto;min-height:0;aspect-ratio:4/3;max-height:74vh}
.rb.is-board .rb-stage iframe{visibility:hidden}

/* «Böyüt»: the panel fills the screen (under the modal and the toast) */
html.rb-lock,html.rb-lock body{overflow:hidden}
.rb.rb-full{position:fixed;inset:0;z-index:40;margin:0!important;max-width:none;border:0;border-radius:0;padding:10px 12px 0;padding-top:max(10px,env(safe-area-inset-top))}
.rb.rb-full .rb-tools{margin:8px -12px 0}
.rb.rb-full .rb-stage{flex:1 1 auto;height:auto;min-height:0;max-height:none;aspect-ratio:auto;margin:8px -12px 0}
.rb.rb-full .rb-tools:not([hidden])+.rb-stage{margin-top:0}
.rb.rb-full .rb-stage iframe{border-radius:0}

@media (max-width:760px){
  .rb-tools{margin:10px -16px 0;padding:5px 8px;gap:2px}
  .rb-b span,.rb-fullb span{display:none}
  .rb-b{padding:8px}
  .rb-cols{gap:4px;padding:0 4px}
  .rb .rb-t{flex-basis:100%}
  .rb .rb-t .sub{display:none}
  .rb.is-board .rb-stage{max-height:70vh}
}
/* a phone turned sideways, panel enlarged: tools go to the left edge, the sheet takes the rest */
@media (max-height:500px){
  .rb-b span,.rb-fullb span{display:none}
  .rb.rb-full{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);padding:6px 8px 0}
  .rb.rb-full .rb-h{grid-column:1/3;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
  .rb.rb-full .rb-t{flex:0 1 auto}
  .rb.rb-full .rb-t .sub{display:none}
  .rb.rb-full .rb-t h3{font-size:15px;white-space:nowrap}
  .rb.rb-full .rb-tools{grid-column:1;grid-row:2;flex-direction:column;margin:6px 0 0 -8px;padding:4px;overflow-x:hidden;overflow-y:auto}
  .rb.rb-full .rb-cols{flex-direction:column;padding:4px 0}
  .rb.rb-full .rb-stage{grid-column:2;grid-row:2;margin:6px -8px 0 0}
  .rb.rb-full .rb-tools[hidden]+.rb-stage{grid-column:1/3;margin-left:-8px}
}
