:root {
  --draw-accent: #5626bd;
  --draw-tab-width: 48px;
  --draw-panel-width: 164px;
  --draw-panel-inset: 12px;
}

.fw-annotation-canvas {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1000;
  max-width: 100%;
  pointer-events: none;
  touch-action: none;
}
.fw-annotation-canvas.is-active { pointer-events: auto; cursor: crosshair; }
.fw-annotation-canvas[data-tool="eraser"] { cursor: cell; }
.fw-annotation-canvas[data-tool="text"] { cursor: text; }

.fw-annotation-panel-toggle {
  position: fixed;
  z-index: 1010;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: var(--draw-tab-width);
  height: 86px;
  padding: 0;
  border: 0;
  border-radius: 16px 0 0 16px;
  background: white;
  color: #34465b;
  box-shadow: 0 7px 24px #192a3a29;
  font: 800 17px/1 Arial, sans-serif;
}
.fw-annotation-panel-toggle span { writing-mode: vertical-rl; text-orientation: mixed; }
.fw-annotation-panel-toggle:hover { color: var(--draw-accent); }
.fw-annotation-toolbar {
  position: fixed;
  z-index: 1010;
  right: var(--draw-panel-inset);
  top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: var(--draw-panel-width);
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 11px 8px 13px;
  border: 1px solid #cbd9e7;
  border-radius: 22px;
  background: white;
  color: #4e397b;
  box-shadow: 0 12px 30px #27374b24;
  font: 600 13px/1.2 Arial, sans-serif;
}
.fw-annotation-panel-toggle[hidden], .fw-annotation-toolbar[hidden] { display: none; }
.fw-annotation-toolbar > * { flex-shrink: 0; }
.fw-annotation-toolbar button:not(.fw-annotation-color) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 37px;
  padding: 6px;
  border: 1px solid #c5d7e6;
  border-radius: 12px;
  background: white;
  color: var(--tool-ink, inherit);
  font: inherit;
  white-space: nowrap;
}
.fw-annotation-toolbar button:not(.fw-annotation-color):hover { background: #f5f0fc; }
.fw-annotation-toolbar button:not(.fw-annotation-color)[aria-pressed="true"] {
  border-color: var(--draw-accent);
  background: var(--draw-accent);
  color: white;
}
.fw-annotation-toggle { --tool-ink: #36485d; }
.fw-annotation-action--clear { --tool-ink: #c73748; }
.fw-annotation-divider { height: 1px; background: #dbe4ed; margin: 2px 0; }
.fw-annotation-label, .fw-annotation-help {
  text-align: center;
  margin: 3px 0;
  color: #566d85;
  font: 10px/1.3 Arial, sans-serif;
}
.fw-annotation-colors, .fw-annotation-sizes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.fw-annotation-color {
  width: 24px;
  height: 24px;
  justify-self: center;
  padding: 0;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 0 0 1px #cad7e1;
  background: var(--swatch);
}
.fw-annotation-color[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--draw-accent); }
.fw-annotation-size::before {
  content: "";
  width: var(--dot-size);
  height: var(--dot-size);
  background: currentColor;
  border-radius: 50%;
}
.fw-annotation-actions { display: grid; gap: 6px; }
.fw-annotation-text-input {
  position: absolute;
  z-index: 1030;
  width: min(260px, calc(100vw - 32px));
  min-height: 54px;
  padding: 10px 12px;
  border: 2px solid var(--draw-accent);
  border-radius: 11px;
  background: white;
  box-shadow: 0 6px 20px #27374b24;
  font: 800 18px/1.35 Arial, sans-serif;
}

@media screen and (max-width: 1024px), print {
  #fw-annotation-panel-toggle, #fw-annotation-toolbar, #fw-annotation-canvas,
  .fw-annotation-text-input, .settings [data-act="board"] { display: none !important; }
}


/* One shared appearance across public catalogs and lesson engines. */
html:root body #fw-annotation-panel-toggle#fw-annotation-panel-toggle{position:fixed!important;inset:50% 0 auto auto!important;transform:translateY(-50%)!important;width:48px!important;min-width:0!important;max-width:48px!important;height:86px!important;min-height:0!important;padding:0!important;border:0!important;border-radius:16px 0 0 16px!important;box-shadow:0 7px 24px #25344829!important;background:white!important;color:#34465b!important;display:grid!important;place-items:center!important}
html:root body #fw-annotation-panel-toggle#fw-annotation-panel-toggle span{writing-mode:vertical-rl!important;text-orientation:mixed!important;transform:none!important;letter-spacing:normal!important;font:800 17px/1 Arial,sans-serif!important;color:#34465b!important}
html:root body #fw-annotation-panel-toggle#fw-annotation-panel-toggle .fw-annotation-panel-toggle__arrow,html:root body #fw-annotation-panel-toggle#fw-annotation-panel-toggle[aria-expanded=true],html:root body #fw-annotation-toolbar[hidden],html:root body #fw-annotation-toolbar .fw-annotation-toolbar__title{display:none!important}
html:root body #fw-annotation-toolbar:not([hidden]){position:fixed!important;inset:8px 12px auto auto!important;transform:none!important;display:flex!important;flex-direction:column!important;gap:6px!important;width:164px!important;max-height:calc(100dvh - 16px)!important;overflow-y:auto!important;padding:11px 8px 13px!important;box-sizing:border-box!important;border:1px solid #cbd9e7!important;border-radius:22px!important;background:#fff!important;box-shadow:0 12px 30px #27374b24!important}
html:root body #fw-annotation-toolbar button:not(.fw-annotation-color){display:inline-flex!important;align-items:center;justify-content:center;gap:4px;flex-shrink:0;min-height:37px!important;height:auto!important;padding:5px 7px!important;border:1px solid #c5d7e6!important;border-radius:12px!important;color:#493574!important;background:#fff!important;font:600 13px/1.2 Arial,sans-serif!important}
html:root body #fw-annotation-toolbar button:not(.fw-annotation-color)[aria-pressed=true]{background:#5626bd!important;color:white!important}
html:root body #fw-annotation-toolbar #fw-annotation-clear{color:#c73748!important}
html:root body #fw-annotation-toolbar .fw-annotation-toggle__icon{display:none}
html:root body #fw-annotation-toolbar .fw-annotation-sizes{display:grid!important;grid-template-columns:repeat(3,1fr)!important}
html:root body #fw-annotation-toolbar .fw-annotation-help{font:10px/1.4 Arial,sans-serif!important;color:#526980!important;text-align:center}

@media screen and (max-width:1024px), print { html:root body #fw-annotation-panel-toggle#fw-annotation-panel-toggle, html:root body #fw-annotation-toolbar, html:root body #fw-annotation-canvas {display:none!important} }


/* The trial document owns drawing while its modal is open. */
html:root body:has(#byk-trial-dialog[open]) > :is(#fw-annotation-panel-toggle,#fw-annotation-toolbar,#fw-annotation-canvas){display:none!important}
body > #fw-annotation-panel-toggle{position:fixed!important;top:50%!important;right:0!important;left:auto!important;bottom:auto!important;transform:translateY(-50%)!important;width:var(--draw-tab-width)!important;height:86px!important}

/* Mobile and touch tablets: hide all Draw UI, including an already-open panel. */
@media screen and (max-width:1024px), screen and (hover:none) and (pointer:coarse) {
 html:root body #fw-annotation-panel-toggle#fw-annotation-panel-toggle#fw-annotation-panel-toggle,
 html:root body #fw-annotation-toolbar#fw-annotation-toolbar#fw-annotation-toolbar,
 html:root body #fw-annotation-canvas#fw-annotation-canvas#fw-annotation-canvas,
 html:root body #annotation-panel-toggle#annotation-panel-toggle,
 html:root body #annotation-toolbar#annotation-toolbar,
 html:root body #annotation-canvas#annotation-canvas,
 html:root body .fw-annotation-text-input,
 html:root body .annotation-text-input,
 html:root body .page-annotation-layer,
 html:root body .side>.annotation-toolbar,
 html:root body [data-act="board"] {display:none!important;visibility:hidden!important;pointer-events:none!important}
}
