:root {
  --board-ink: #21302f;
  --board-muted: #667774;
  --board-line: rgba(33, 48, 47, .14);
  --board-purple: #7c6bd8;
  --toolbar-height: 88px;
}

* { box-sizing: border-box; }

html,
body {
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  background: #edf2f5;
  color: var(--board-ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

.smart-board {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100dvh;
  width: 100vw;
}

.smart-board-mobile-warning {
  display: none;
}

.board-toolbar {
  align-items: center;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--board-line);
  box-shadow: 0 12px 30px rgba(33, 48, 47, .08);
  display: flex;
  gap: 10px;
  min-height: var(--toolbar-height);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 10px 14px;
  position: relative;
  scrollbar-width: thin;
  z-index: 5;
}

.smart-board.toolbar-hidden .board-toolbar { display: none; }

.smart-board.toolbar-hidden,
.smart-board.toolbar-hidden.toolbar-top,
.smart-board.toolbar-hidden.toolbar-bottom,
.smart-board.toolbar-hidden.toolbar-left,
.smart-board.toolbar-hidden.toolbar-right {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.smart-board.toolbar-hidden .board-workspace,
.smart-board.toolbar-hidden.toolbar-top .board-workspace,
.smart-board.toolbar-hidden.toolbar-bottom .board-workspace,
.smart-board.toolbar-hidden.toolbar-left .board-workspace,
.smart-board.toolbar-hidden.toolbar-right .board-workspace {
  grid-column: 1;
  grid-row: 1;
}

.toolbar-brand {
  align-items: center;
  align-self: stretch;
  background: rgba(255, 255, 255, .98);
  color: var(--board-ink);
  display: grid;
  flex: 0 0 220px;
  gap: 2px 10px;
  grid-template-columns: 42px minmax(0, 1fr);
  line-height: 1.2;
  margin: -10px 0 -10px -14px;
  padding: 10px 14px;
  position: sticky;
  left: 0;
  text-decoration: none;
  z-index: 7;
}

.toolbar-brand img {
  grid-row: 1 / span 2;
  height: 42px;
  object-fit: contain;
  width: 42px;
}

.toolbar-brand strong {
  color: var(--board-purple);
  font-size: .98rem;
}

.toolbar-brand span {
  color: var(--board-muted);
  font-size: .78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar-group {
  align-items: center;
  border-left: 1px solid var(--board-line);
  display: inline-flex;
  flex: 0 0 auto;
  gap: 7px;
  padding-left: 10px;
  position: relative;
}

.toolbar-window-controls {
  margin-left: -2px;
}

.toolbar-system-controls {
  align-items: center;
  background: #fff;
  border: 1px solid var(--board-line);
  border-radius: 12px;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  padding: 6px;
}

.toolbar-position-control {
  align-items: center;
  color: var(--board-purple);
  display: inline-flex;
  font-size: .72rem;
  font-weight: 800;
  gap: 6px;
}

.toolbar-position-control select {
  background: #fff;
  border: 1px solid var(--board-line);
  border-radius: 8px;
  color: var(--board-ink);
  font: inherit;
  font-size: .86rem;
  min-height: 42px;
  min-width: 74px;
  padding: 9px 10px;
}

.toolbar-cluster {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 7px;
}

.toolbar-group::before {
  color: var(--board-purple);
  content: attr(aria-label);
  flex: 0 0 auto;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .01em;
  margin-right: 2px;
  white-space: nowrap;
}

.tool-button,
.toolbar-group select {
  background: #fff;
  border: 1px solid var(--board-line);
  border-radius: 8px;
  color: var(--board-ink);
  font: inherit;
  font-size: .86rem;
  min-height: 42px;
  min-width: 42px;
  padding: 9px 11px;
  touch-action: manipulation;
}

.toolbar-group select {
  max-width: min(260px, 42vw);
}

.toolbar-group select[hidden] {
  display: none;
}

.icon-tool {
  font-weight: 900;
  min-width: 44px;
  padding-inline: 0;
}

.icon-tool span {
  align-items: center;
  display: inline-flex;
  font-size: 1rem;
  height: 1.1em;
  justify-content: center;
  line-height: 1;
  width: 1.4em;
}

.tool-button.is-active,
.tool-button:hover,
.toolbar-group select:focus {
  background: var(--board-purple);
  border-color: var(--board-purple);
  color: #fff;
}

.tool-button.danger {
  border-color: rgba(214, 90, 90, .45);
  color: #b74747;
}

.window-controls {
  align-items: center;
  background: #f7faf9;
  border: 1px solid var(--board-line);
  border-radius: 10px;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
}

.window-control {
  align-items: center;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--board-muted);
  cursor: pointer;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  padding: 0;
  position: relative;
  touch-action: manipulation;
  width: 34px;
}

.window-control:hover,
.window-control.is-active {
  background: var(--board-purple);
  border-color: var(--board-purple);
  color: #fff;
}

.pin-control span {
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 2px 2px;
  height: 13px;
  position: relative;
  width: 13px;
}

.pin-control span::before {
  background: currentColor;
  content: "";
  height: 10px;
  left: 50%;
  position: absolute;
  top: 9px;
  transform: translateX(-50%);
  width: 2px;
}

.pin-control span::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  content: "";
  left: 50%;
  position: absolute;
  top: 17px;
  transform: translateX(-50%);
}

.hide-control span {
  background: currentColor;
  border-radius: 999px;
  height: 2px;
  width: 16px;
}

.board-controls label {
  align-items: center;
  color: var(--board-muted);
  display: inline-flex;
  font-size: .75rem;
  gap: 6px;
}

.board-controls input[type="color"] {
  border: 1px solid var(--board-line);
  border-radius: 999px;
  height: 40px;
  padding: 2px;
  width: 48px;
}

.board-controls input[type="range"] {
  accent-color: var(--board-purple);
  width: 118px;
}

.page-indicator,
.zoom-indicator {
  color: var(--board-muted);
  font-size: .82rem;
  min-width: 66px;
  text-align: center;
}

.toolbar-reopen {
  background: var(--board-purple);
  border: 0;
  border-radius: 999px;
  bottom: 18px;
  box-shadow: 0 14px 28px rgba(93, 75, 184, .26);
  color: #fff;
  display: none;
  font-weight: 800;
  padding: 12px 16px;
  position: fixed;
  right: 18px;
  z-index: 6;
}

.smart-board.toolbar-hidden .toolbar-reopen { display: inline-flex; }

.smart-board.toolbar-hidden.toolbar-top .toolbar-reopen {
  bottom: auto;
  left: 50%;
  right: auto;
  top: 18px;
  transform: translateX(-50%);
}

.smart-board.toolbar-hidden.toolbar-bottom .toolbar-reopen {
  bottom: 18px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.smart-board.toolbar-hidden.toolbar-left .toolbar-reopen {
  bottom: auto;
  left: 18px;
  right: auto;
  top: 50%;
  transform: translateY(-50%);
}

.smart-board.toolbar-hidden.toolbar-right .toolbar-reopen {
  bottom: auto;
  left: auto;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.board-workspace {
  min-height: 0;
  overflow: hidden;
  padding: 18px;
  position: relative;
  touch-action: none;
}

.board-stage {
  --pan-x: 0px;
  --pan-y: 0px;
  --zoom: 1;
  background: #fff;
  border: 1px solid var(--board-line);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(33, 48, 47, .12);
  height: 100%;
  isolation: isolate;
  overflow: hidden;
  position: relative;
  transform: translate(var(--pan-x), var(--pan-y)) scale(var(--zoom));
  transform-origin: 0 0;
  width: 100%;
}

.resource-surface,
.drawing-layer,
.text-layer {
  inset: 0;
  position: absolute;
}

.resource-surface {
  align-items: center;
  background: #fff;
  display: flex;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
}

.resource-surface img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.pdf-layer {
  display: block;
  max-height: 100%;
  max-width: 100%;
}

.drawing-layer {
  cursor: crosshair;
  touch-action: none;
  z-index: 2;
}

.text-layer {
  pointer-events: none;
  z-index: 3;
}

.board-text-note {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--board-ink);
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 700;
  left: var(--x);
  min-height: 48px;
  max-width: min(70vw, 760px);
  min-width: 72px;
  outline: 0;
  overflow: visible;
  pointer-events: auto;
  position: absolute;
  touch-action: none;
  top: var(--y);
  user-select: text;
  white-space: pre-wrap;
  word-break: break-word;
  width: var(--w, auto);
}

.board-text-note:focus,
.board-text-note:focus-within {
  outline: 0;
}

.board-text-note.is-selected,
.board-text-note.is-editing {
  border-color: rgba(124, 107, 216, .72);
  box-shadow: 0 0 0 3px rgba(124, 107, 216, .14);
}

.board-text-note.is-moving {
  opacity: .86;
}

.board-text-selection-controls {
  align-items: center;
  display: none;
  gap: 4px;
  position: absolute;
  right: -12px;
  top: -34px;
}

.board-text-note-body {
  min-height: 28px;
  outline: 0;
  padding: 4px;
}

.board-text-note-body[contenteditable="true"] {
  background: rgba(255, 255, 255, .92);
  border-radius: 4px;
  cursor: text;
  touch-action: manipulation;
}

.board-context-menu {
  background: #fff;
  border: 1px solid rgba(33, 48, 47, .14);
  border-radius: 8px;
  box-shadow: 0 16px 38px rgba(33, 48, 47, .2);
  display: grid;
  gap: 2px;
  min-width: 184px;
  padding: 6px;
  position: fixed;
  z-index: 90;
}

.board-context-menu[hidden],
.board-context-menu [hidden] {
  display: none !important;
}

.board-context-menu button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--board-ink);
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 10px;
  grid-template-columns: 20px 1fr;
  min-height: 38px;
  padding: 7px 10px;
  text-align: left;
}

.board-context-menu button:hover,
.board-context-menu button:focus-visible {
  background: rgba(124, 107, 216, .1);
  outline: 0;
}

.board-context-menu button.danger { color: #c83f3f; }
.board-context-menu button:disabled { cursor: default; opacity: .42; }

.board-context-menu svg {
  fill: none;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 20px;
}

.board-context-separator {
  background: rgba(33, 48, 47, .1);
  display: block;
  height: 1px;
  margin: 4px 2px;
}

.board-install-suggestion {
  align-items: center;
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(33, 48, 47, .13);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(33, 48, 47, .2);
  display: grid;
  gap: 10px;
  grid-template-columns: 40px minmax(0, 1fr) auto 32px;
  left: 50%;
  max-width: min(680px, calc(100vw - 24px));
  padding: 10px;
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  transform: translateX(-50%);
  width: max-content;
  z-index: 110;
}

.board-install-suggestion[hidden],
.board-install-guide[hidden] { display: none !important; }

.board-install-suggestion img {
  height: 40px;
  object-fit: contain;
  width: 40px;
}

.board-install-suggestion div {
  display: grid;
  gap: 2px;
}

.board-install-suggestion strong {
  color: var(--board-ink);
  font-size: .9rem;
}

.board-install-suggestion span {
  color: var(--board-muted);
  font-size: .8rem;
}

.board-install-action {
  background: var(--board-purple);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: .86rem;
  font-weight: 700;
  min-height: 40px;
  padding: 0 18px;
}

.board-install-close,
.board-install-guide-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--board-muted);
  cursor: pointer;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  padding: 0;
  width: 32px;
}

.board-install-close svg,
.board-install-guide-close svg {
  fill: none;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
  width: 20px;
}

.board-install-guide {
  align-items: center;
  background: rgba(23, 31, 30, .48);
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 18px;
  position: fixed;
  z-index: 120;
}

.board-install-guide > section {
  background: #fff;
  border: 1px solid rgba(33, 48, 47, .13);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(33, 48, 47, .24);
  max-width: 440px;
  padding: 24px;
  position: relative;
  width: 100%;
}

.board-install-guide img {
  display: block;
  height: 54px;
  margin: 0 auto 12px;
  object-fit: contain;
  width: 54px;
}

.board-install-guide h2 {
  color: var(--board-ink);
  font-size: 1.15rem;
  margin: 0 36px 14px;
  text-align: center;
}

.board-install-guide ol {
  color: var(--board-ink);
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
  padding-left: 22px;
}

.board-install-guide p {
  color: var(--board-muted);
  margin: 0 0 18px;
}

.board-install-guide .tool-button {
  min-height: 42px;
  width: 100%;
}

.smart-board .board-install-guide .board-install-guide-ok {
  display: flex;
  min-width: 100%;
  width: 100%;
}

.board-install-guide-close {
  position: absolute;
  right: 10px;
  top: 10px;
}

@media (max-width: 600px) {
  .board-install-suggestion {
    gap: 7px 9px;
    grid-template-columns: 36px minmax(0, 1fr) 32px;
    padding: 9px;
    width: calc(100vw - 20px);
  }

  .board-install-suggestion img {
    height: 36px;
    width: 36px;
  }

  .board-install-suggestion div { grid-column: 2; }
  .board-install-close { grid-column: 3; grid-row: 1; }

  .board-install-action {
    grid-column: 2 / 4;
    min-height: 38px;
    width: 100%;
  }

  .board-install-guide > section { padding: 22px 18px 18px; }
}

.board-text-note.is-selected .board-text-selection-controls,
.board-text-note.is-selected .board-text-resize {
  display: inline-flex;
}

.board-text-control,
.board-text-resize {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(33, 48, 47, .16);
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(33, 48, 47, .14);
  color: var(--board-ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 1rem;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  padding: 0;
  touch-action: none;
  user-select: none;
  width: 30px;
}

.board-text-control:hover {
  background: #d94b4b;
  border-color: #d94b4b;
  color: #fff;
}

.board-text-resize {
  bottom: -14px;
  cursor: nwse-resize;
  display: none;
  font-size: .85rem;
  position: absolute;
  right: -14px;
}

.board-empty-message {
  align-items: center;
  color: var(--board-muted);
  display: grid;
  gap: 8px;
  height: 100%;
  justify-items: center;
  padding: 24px;
  text-align: center;
}

.board-stage[data-board-surface="white"] .resource-surface { background: #fff; }

.board-stage[data-board-surface="lined"] .resource-surface {
  background: repeating-linear-gradient(to bottom, #fff 0 31px, rgba(124, 107, 216, .18) 32px);
}

.board-stage[data-board-surface="grid"] .resource-surface {
  background-image:
    linear-gradient(rgba(124, 107, 216, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 107, 216, .12) 1px, transparent 1px);
  background-size: clamp(24px, 4vw, 36px) clamp(24px, 4vw, 36px);
}

.board-stage[data-board-surface="dots"] .resource-surface {
  background-image: radial-gradient(rgba(124, 107, 216, .28) 1.5px, transparent 1.5px);
  background-size: clamp(20px, 3.5vw, 30px) clamp(20px, 3.5vw, 30px);
}

.board-stage[data-board-surface="white"] .pdf-layer,
.board-stage[data-board-surface="white"] img,
.board-stage[data-board-surface="lined"] .pdf-layer,
.board-stage[data-board-surface="lined"] img,
.board-stage[data-board-surface="grid"] .pdf-layer,
.board-stage[data-board-surface="grid"] img,
.board-stage[data-board-surface="dots"] .pdf-layer,
.board-stage[data-board-surface="dots"] img {
  display: none;
}

.smart-board.toolbar-bottom {
  grid-template-rows: minmax(0, 1fr) auto;
}

.smart-board.toolbar-bottom .board-toolbar {
  border-bottom: 0;
  border-top: 1px solid var(--board-line);
  grid-row: 2;
}

.smart-board.toolbar-bottom .board-workspace {
  grid-row: 1;
}

.smart-board.toolbar-left,
.smart-board.toolbar-right {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.smart-board.toolbar-right {
  grid-template-columns: minmax(0, 1fr) auto;
}

.smart-board.toolbar-left .board-toolbar,
.smart-board.toolbar-right .board-toolbar {
  align-content: start;
  align-items: stretch;
  border-bottom: 0;
  flex-direction: column;
  height: 100dvh;
  max-width: 340px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 14px 14px;
  width: min(340px, 28vw);
}

.smart-board.toolbar-left .board-workspace { grid-column: 2; }
.smart-board.toolbar-right .board-toolbar { grid-column: 2; grid-row: 1; }
.smart-board.toolbar-right .board-workspace { grid-column: 1; grid-row: 1; }

.smart-board.toolbar-left .toolbar-group,
.smart-board.toolbar-right .toolbar-group {
  background: #fff;
  border: 1px solid var(--board-line);
  border-left: 0;
  border-radius: 12px;
  flex-wrap: wrap;
  padding: 32px 10px 10px;
}

.smart-board.toolbar-left .toolbar-brand,
.smart-board.toolbar-right .toolbar-brand {
  border-bottom: 1px solid var(--board-line);
  flex: 0 0 auto;
  grid-template-columns: 48px minmax(0, 1fr);
  left: auto;
  margin: 0 -14px 4px;
  padding: 16px 14px 14px;
  position: sticky;
  top: 0;
}

.smart-board.toolbar-left .toolbar-brand img,
.smart-board.toolbar-right .toolbar-brand img {
  height: 48px;
  width: 48px;
}

.smart-board.toolbar-left .toolbar-brand strong,
.smart-board.toolbar-right .toolbar-brand strong {
  font-size: 1.02rem;
}

.smart-board.toolbar-left .toolbar-group::before,
.smart-board.toolbar-right .toolbar-group::before {
  left: 0;
  margin: 0;
  padding-inline: 10px;
  position: absolute;
  top: 8px;
  width: 100%;
}

.smart-board.toolbar-left .toolbar-window-controls,
.smart-board.toolbar-right .toolbar-window-controls {
  align-self: end;
  margin: -58px 0 12px;
  position: sticky;
  top: 14px;
  z-index: 8;
}

.smart-board.toolbar-left .toolbar-system-controls,
.smart-board.toolbar-right .toolbar-system-controls {
  align-items: stretch;
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 4px;
}

.smart-board.toolbar-left .toolbar-position-control,
.smart-board.toolbar-right .toolbar-position-control {
  align-items: stretch;
  display: grid;
  gap: 5px;
}

.smart-board.toolbar-left [aria-label="Araçlar"],
.smart-board.toolbar-right [aria-label="Araçlar"] {
  display: grid;
  grid-template-columns: repeat(5, minmax(42px, 1fr));
}

.smart-board.toolbar-left .icon-tool,
.smart-board.toolbar-right .icon-tool {
  min-width: 42px;
}

.smart-board.toolbar-left .toolbar-page-controls,
.smart-board.toolbar-right .toolbar-page-controls {
  display: grid;
  grid-template-columns: 1fr;
}

.smart-board.toolbar-left .screen-controls,
.smart-board.toolbar-right .screen-controls {
  align-items: center;
}

.smart-board.toolbar-left .toolbar-cluster,
.smart-board.toolbar-right .toolbar-cluster {
  display: grid;
  gap: 7px;
  width: 100%;
}

.smart-board.toolbar-left .page-open-cluster,
.smart-board.toolbar-right .page-open-cluster {
  grid-template-columns: minmax(0, 1fr);
}

.smart-board.toolbar-left .page-nav-cluster,
.smart-board.toolbar-right .page-nav-cluster {
  grid-template-columns: minmax(0, auto) minmax(78px, 1fr) minmax(0, auto);
}

.smart-board.toolbar-left .fit-cluster,
.smart-board.toolbar-right .fit-cluster {
  grid-template-columns: repeat(2, minmax(0, auto));
  justify-content: start;
}

.smart-board.toolbar-left .zoom-cluster,
.smart-board.toolbar-right .zoom-cluster {
  grid-template-columns: minmax(42px, auto) minmax(68px, 1fr) minmax(42px, auto);
  max-width: none;
}

.smart-board.toolbar-left .zoom-cluster .zoom-indicator,
.smart-board.toolbar-right .zoom-cluster .zoom-indicator,
.smart-board.toolbar-left .page-nav-cluster .page-indicator,
.smart-board.toolbar-right .page-nav-cluster .page-indicator {
  align-self: center;
  justify-self: center;
}

.smart-board.toolbar-left .board-controls,
.smart-board.toolbar-right .board-controls {
  display: grid;
  grid-template-columns: 1fr;
}

.smart-board.toolbar-left .toolbar-group select,
.smart-board.toolbar-right .toolbar-group select {
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.smart-board.toolbar-left .board-controls label,
.smart-board.toolbar-right .board-controls label {
  justify-content: space-between;
  width: 100%;
}

.smart-board.toolbar-left .board-controls input[type="range"],
.smart-board.toolbar-right .board-controls input[type="range"] {
  flex: 1 1 auto;
  min-width: 150px;
}

.board-panel {
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--board-line);
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(33, 48, 47, .14);
  max-height: calc(100% - 36px);
  overflow: auto;
  padding: 12px;
  position: absolute;
  top: 18px;
  width: min(260px, calc(100vw - 36px));
  z-index: 4;
}

.pages-panel { left: 18px; }
.related-panel { right: 18px; }
.activity-picker-panel {
  right: 18px;
  width: min(360px, calc(100vw - 36px));
}

.panel-title {
  color: var(--board-purple);
  font-size: .86rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.page-thumbnails,
.related-list {
  display: grid;
  gap: 10px;
}

.activity-search-input {
  border: 1px solid rgba(33, 48, 47, .14);
  border-radius: 10px;
  color: var(--board-ink);
  font: inherit;
  min-height: 42px;
  padding: 9px 12px;
  width: 100%;
}

.activity-search-input:focus {
  border-color: var(--board-purple);
  box-shadow: 0 0 0 3px rgba(124, 107, 216, .14);
  outline: 0;
}

.activity-results {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.page-thumb,
.related-item,
.activity-result-item {
  background: #fff;
  border: 1px solid var(--board-line);
  border-radius: 10px;
  color: var(--board-ink);
  cursor: pointer;
  display: grid;
  gap: 7px;
  padding: 8px;
  text-align: left;
}

.page-thumb.is-active,
.related-item:hover,
.activity-result-item:hover,
.activity-result-item:focus-visible {
  border-color: var(--board-purple);
  box-shadow: 0 0 0 3px rgba(124, 107, 216, .14);
  outline: 0;
}

.page-thumb canvas,
.related-item img,
.activity-result-item img {
  background: #f7faf9;
  border-radius: 8px;
  display: block;
  height: auto;
  width: 100%;
}

.page-thumb span,
.related-item span,
.activity-result-item span {
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.25;
}

.activity-result-item {
  align-items: center;
  grid-template-columns: 58px minmax(0, 1fr);
}

.activity-result-item img {
  height: 44px;
  object-fit: cover;
  width: 58px;
}

.board-splash {
  align-items: center;
  backdrop-filter: blur(3px);
  background: rgba(255, 255, 255, .68);
  display: grid;
  gap: 10px;
  inset: 18px;
  justify-items: center;
  position: absolute;
  z-index: 8;
}

.board-splash[hidden] { display: none; }

.splash-brand {
  align-items: center;
  animation: boardSplashPulse 1.15s ease-in-out infinite;
  display: inline-flex;
  gap: 12px;
}

.splash-brand img {
  filter: drop-shadow(0 16px 24px rgba(124, 107, 216, .24));
  height: clamp(54px, 10vw, 96px);
  object-fit: contain;
  width: clamp(54px, 10vw, 96px);
}

.splash-brand strong {
  color: var(--board-ink);
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1;
}

.board-splash span {
  color: var(--board-purple);
  font-weight: 800;
}

@keyframes boardSplashPulse {
  0%, 100% { opacity: .68; transform: scale(.96); }
  50% { opacity: 1; transform: scale(1.04); }
}

@media (max-width: 600px) {
  :root { --toolbar-height: 62px; }
}

@media (min-width: 601px) and (max-width: 900px) {
  :root { --toolbar-height: 86px; }

  .smart-board { grid-template-rows: minmax(0, 1fr) auto; }

  .board-toolbar {
    align-items: stretch;
    border-bottom: 0;
    border-top: 1px solid var(--board-line);
    box-shadow: 0 -12px 30px rgba(33, 48, 47, .08);
    grid-row: 2;
    min-height: var(--toolbar-height);
    max-height: 34dvh;
    overflow-x: auto;
    overflow-y: auto;
    padding: 9px;
  }

  .board-workspace {
    grid-row: 1;
    padding: 8px;
  }

  .toolbar-brand {
    flex: 0 0 148px;
    grid-template-columns: 38px minmax(0, 1fr);
    margin: -9px 0 -9px -9px;
    padding: 9px;
  }

  .toolbar-brand img {
    height: 38px;
    width: 38px;
  }

  .toolbar-brand span { display: none; }

  .toolbar-group {
    align-content: start;
    align-items: center;
    background: #fff;
    border: 1px solid var(--board-line);
    border-radius: 12px;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px;
    max-width: min(82vw, 520px);
    padding: 8px;
  }

  .toolbar-window-controls {
    align-self: center;
    margin-left: 0;
  }

  .toolbar-system-controls {
    align-self: center;
  }

  .toolbar-cluster {
    display: inline-flex;
    flex-wrap: nowrap;
    width: auto;
  }

  .toolbar-group::before {
    display: none;
  }

  .tool-button,
  .toolbar-group select {
    font-size: .82rem;
    min-height: 46px;
    min-width: 48px;
    padding: 9px 11px;
  }

  .icon-tool {
    min-width: 48px;
    width: 48px;
  }

  .toolbar-page-controls {
    display: grid;
    grid-template-columns: 1fr;
    min-width: min(78vw, 360px);
  }

  .toolbar-page-controls .page-nav-cluster {
    display: grid;
    grid-template-columns: minmax(72px, auto) minmax(72px, 1fr) minmax(72px, auto);
  }

  .toolbar-page-controls .page-open-cluster {
    display: grid;
    grid-template-columns: minmax(76px, auto);
    justify-content: start;
  }

  .toolbar-page-controls .fit-cluster {
    display: grid;
    grid-template-columns: repeat(2, minmax(86px, auto));
    justify-content: start;
  }

  .toolbar-page-controls .zoom-cluster {
    display: grid;
    grid-template-columns: 48px minmax(72px, 1fr) 48px;
    max-width: 190px;
  }

  .toolbar-page-controls .page-indicator,
  .toolbar-page-controls .zoom-indicator {
    align-self: center;
    justify-self: center;
  }

  .board-controls {
    display: grid;
    min-width: 210px;
  }

  .screen-controls {
    max-width: 280px;
  }

  .board-controls label span { display: none; }
  .board-controls input[type="range"] { width: 132px; }
  .toolbar-reopen { bottom: 94px; }

  .smart-board.toolbar-left,
  .smart-board.toolbar-right,
  .smart-board.toolbar-top,
  .smart-board.toolbar-bottom {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .smart-board.toolbar-left .board-toolbar,
  .smart-board.toolbar-right .board-toolbar,
  .smart-board.toolbar-top .board-toolbar,
  .smart-board.toolbar-bottom .board-toolbar {
    border-bottom: 0;
    border-top: 1px solid var(--board-line);
    flex-direction: row;
    grid-column: 1;
    grid-row: 2;
    height: auto;
    max-width: none;
    min-height: var(--toolbar-height);
    overflow-x: auto;
    overflow-y: auto;
    padding: 9px;
    width: auto;
  }

  .smart-board.toolbar-left .board-workspace,
  .smart-board.toolbar-right .board-workspace,
  .smart-board.toolbar-top .board-workspace,
  .smart-board.toolbar-bottom .board-workspace {
    grid-column: 1;
    grid-row: 1;
  }

  .smart-board.toolbar-left .toolbar-group,
  .smart-board.toolbar-right .toolbar-group {
    border: 1px solid var(--board-line);
    border-radius: 12px;
    flex-wrap: wrap;
    padding: 8px;
  }

  .smart-board.toolbar-left .toolbar-page-controls,
  .smart-board.toolbar-right .toolbar-page-controls {
    display: grid;
    width: min(78vw, 360px);
  }

  .smart-board.toolbar-left .zoom-cluster,
  .smart-board.toolbar-right .zoom-cluster {
    max-width: none;
  }

  .smart-board.toolbar-left [aria-label="Araçlar"],
  .smart-board.toolbar-right [aria-label="Araçlar"] {
    display: grid;
    grid-template-columns: repeat(5, 48px);
    max-width: none;
  }

  .smart-board.toolbar-left .toolbar-window-controls,
  .smart-board.toolbar-right .toolbar-window-controls,
  .smart-board.toolbar-top .toolbar-window-controls,
  .smart-board.toolbar-bottom .toolbar-window-controls {
    align-self: center;
    margin: 0;
    position: static;
  }

  .smart-board.toolbar-left .toolbar-system-controls,
  .smart-board.toolbar-right .toolbar-system-controls,
  .smart-board.toolbar-top .toolbar-system-controls,
  .smart-board.toolbar-bottom .toolbar-system-controls {
    display: inline-flex;
  }

  .smart-board.toolbar-left .toolbar-brand,
  .smart-board.toolbar-right .toolbar-brand,
  .smart-board.toolbar-top .toolbar-brand,
  .smart-board.toolbar-bottom .toolbar-brand {
    border-bottom: 0;
    flex-basis: 168px;
    grid-template-columns: 38px minmax(0, 1fr);
    left: 0;
    margin: -9px 0 -9px -9px;
    padding: 9px;
    position: sticky;
    top: auto;
  }

  .smart-board.toolbar-left .toolbar-brand img,
  .smart-board.toolbar-right .toolbar-brand img {
    height: 38px;
    width: 38px;
  }

  .board-panel {
    bottom: calc(var(--toolbar-height) + 10px);
    max-height: min(52dvh, 440px);
    top: auto;
  }

  .pages-panel { left: 8px; }
  .related-panel { right: 8px; }
  .board-splash { inset: 8px; }
}

/* Phone docking is deterministic: portrait uses the top edge, landscape the left edge. */
.board-floating-brand {
  cursor: default;
  pointer-events: none;
  user-select: none;
}

.smart-board.is-phone-layout [data-toolbar-position-control] {
  display: none !important;
}

.smart-board.is-phone-layout.toolbar-top {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
}

.smart-board.is-phone-layout.toolbar-top:not(.toolbar-hidden) .board-toolbar {
  border-bottom: 1px solid var(--board-line);
  border-top: 0;
  grid-column: 1;
  grid-row: 1;
}

.smart-board.is-phone-layout.toolbar-top .board-workspace {
  grid-column: 1;
  grid-row: 2;
}

.smart-board.is-phone-layout.toolbar-left {
  grid-template-columns: auto minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}

.smart-board.is-phone-layout.toolbar-left:not(.toolbar-hidden) .board-toolbar {
  align-items: center;
  border-bottom: 0;
  border-right: 1px solid var(--board-line);
  border-top: 0;
  display: flex !important;
  flex-direction: column;
  grid-column: 1;
  grid-row: 1;
  height: 100dvh;
  max-height: 100dvh;
  max-width: 58px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px;
  width: 58px;
}

.smart-board.is-phone-layout.toolbar-left .board-workspace {
  grid-column: 2;
  grid-row: 1;
}

.smart-board.is-phone-layout.toolbar-left .toolbar-window-controls,
.smart-board.is-phone-layout.toolbar-left .toolbar-group,
.smart-board.is-phone-layout.toolbar-left .quick-actions {
  border-left: 0;
  border-top: 1px solid rgba(33, 48, 47, .1);
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 1fr;
  padding: 5px 0 0;
  width: 100%;
}

.smart-board.is-phone-layout.toolbar-left .toolbar-window-controls {
  border-top: 0;
  padding-top: 0;
}

.smart-board.is-phone-layout.toolbar-left .tool-button,
.smart-board.is-phone-layout.toolbar-left .window-control {
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  width: 44px;
}

.smart-board.is-phone-layout.toolbar-left .settings-toggle {
  flex: 0 0 44px;
}

.smart-board.is-phone-layout.toolbar-left .toolbar-popover .tool-button {
  width: auto;
}

.smart-board.is-phone-layout.toolbar-left .toolbar-popover .menu-action {
  width: 100%;
}

.smart-board.is-phone-layout.toolbar-hidden.toolbar-top .board-workspace,
.smart-board.is-phone-layout.toolbar-hidden.toolbar-left .board-workspace {
  grid-column: 1;
  grid-row: 1;
}

@media (min-width: 601px) and (max-width: 1180px) {
  :root { --toolbar-height: 82px; }

  .board-toolbar {
    gap: 8px;
    min-height: var(--toolbar-height);
    padding: 8px 10px;
  }

  .toolbar-brand {
    flex-basis: 188px;
    margin: -8px 0 -8px -10px;
    padding: 8px 10px;
  }

  .toolbar-brand img {
    height: 38px;
    width: 38px;
  }

  .toolbar-brand span {
    max-width: 124px;
  }

  .tool-button,
  .toolbar-group select {
    font-size: .82rem;
    min-height: 42px;
    min-width: 42px;
    padding: 8px 10px;
  }

  .icon-tool {
    min-width: 42px;
    width: 42px;
  }

  .toolbar-group {
    gap: 6px;
    padding-left: 8px;
  }

  .board-controls input[type="range"] {
    width: 96px;
  }

  .smart-board.toolbar-left .board-toolbar,
  .smart-board.toolbar-right .board-toolbar {
    max-width: 310px;
    width: min(310px, 34vw);
  }

  .smart-board.toolbar-left [aria-label="Araçlar"],
  .smart-board.toolbar-right [aria-label="Araçlar"] {
    grid-template-columns: repeat(5, minmax(38px, 1fr));
  }

  .smart-board.toolbar-left .page-cluster,
  .smart-board.toolbar-right .page-cluster {
    grid-template-columns: repeat(2, minmax(0, auto)) minmax(66px, 1fr) minmax(0, auto);
  }
}

/* Compact smart-board toolbar */
:root {
  --toolbar-height: 48px;
  --toolbar-size: 38px;
}

.smart-board {
  background: #edf2f5;
}

.board-toolbar {
  align-items: center;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(33, 48, 47, .12);
  border-radius: 0;
  box-shadow: 0 10px 28px rgba(33, 48, 47, .10);
  gap: 5px;
  min-height: var(--toolbar-height);
  overflow: visible;
  padding: 5px;
  z-index: 20;
}

.toolbar-brand,
.toolbar-system-controls,
.board-controls,
.toolbar-page-controls {
  display: none !important;
}

.toolbar-group,
.window-controls {
  background: transparent;
  border: 0;
  border-left: 1px solid rgba(33, 48, 47, .10);
  border-radius: 0;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 0 0 0 5px;
}

.toolbar-group:first-child,
.window-controls:first-child {
  border-left: 0;
  padding-left: 0;
}

.toolbar-group::before {
  display: none;
}

.tool-button,
.toolbar-group select,
.toolbar-popover select {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(33, 48, 47, .14);
  border-radius: 8px;
  color: var(--board-ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: .82rem;
  justify-content: center;
  min-height: var(--toolbar-size);
  min-width: var(--toolbar-size);
  padding: 7px 10px;
  touch-action: manipulation;
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.icon-tool {
  height: var(--toolbar-size);
  min-width: var(--toolbar-size);
  padding: 0;
  width: var(--toolbar-size);
}

.icon-tool svg {
  fill: none;
  height: 19px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 19px;
}

.tool-button.is-active,
.tool-button:hover,
.tool-button:focus-visible,
.window-control:hover,
.window-control.is-active {
  background: var(--board-purple);
  border-color: var(--board-purple);
  color: #fff;
  outline: 0;
}

.tool-button.danger {
  border-color: rgba(221, 79, 79, .35);
  color: #d94b4b;
}

.tool-button.danger:hover,
.tool-button.danger:focus-visible {
  background: #d94b4b;
  border-color: #d94b4b;
  color: #fff;
}

.window-controls {
  gap: 3px;
  padding-right: 1px;
}

.window-control {
  background: #fff;
  border: 1px solid rgba(33, 48, 47, .14);
  border-radius: 8px;
  height: var(--toolbar-size);
  width: var(--toolbar-size);
}

.primary-tools {
  border-left: 0;
  display: inline-flex;
  flex-wrap: nowrap;
  padding-left: 0;
}

.quick-actions {
  display: inline-flex;
  flex-wrap: nowrap;
}

.settings-toggle {
  gap: 0;
  position: relative;
}

.color-dot {
  background: var(--active-tool-color, var(--board-purple));
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(33, 48, 47, .18);
  height: 20px;
  width: 20px;
}

.size-dot {
  background: var(--active-tool-color, currentColor);
  border-radius: 999px;
  bottom: 8px;
  height: 3px;
  position: absolute;
  right: 8px;
  width: var(--active-tool-size, 12px);
}

.toolbar-popover {
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(33, 48, 47, .14);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(33, 48, 47, .16);
  display: none;
  gap: 10px;
  max-height: min(78dvh, 620px);
  overflow: auto;
  padding: 12px;
  position: fixed;
  width: min(320px, calc(100vw - 24px));
  overscroll-behavior: contain;
  z-index: 60;
}

.toolbar-popover.is-open {
  display: grid;
}

.pen-settings-popover {
  width: min(250px, calc(100vw - 24px));
}

.popover-title {
  color: var(--board-purple);
  font-size: .76rem;
  font-weight: 900;
  line-height: 1;
}

.popover-section {
  border-top: 1px solid rgba(33, 48, 47, .10);
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.popover-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.compact-row {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-row.page-nav-cluster,
.compact-row.zoom-cluster {
  grid-template-columns: var(--toolbar-size) minmax(74px, 1fr) var(--toolbar-size);
}

.compact-field {
  color: var(--board-muted);
  display: grid;
  font-size: .76rem;
  font-weight: 800;
  gap: 6px;
}

.compact-field input[type="range"] {
  accent-color: var(--board-purple);
  width: 100%;
}

.compact-field input[type="color"] {
  border: 1px solid rgba(33, 48, 47, .14);
  border-radius: 999px;
  height: 38px;
  padding: 2px;
  width: 100%;
}

.toolbar-popover select,
.toolbar-popover .menu-action {
  justify-content: flex-start;
  width: 100%;
}

.page-indicator,
.zoom-indicator {
  align-items: center;
  background: #f7faf9;
  border: 1px solid rgba(33, 48, 47, .10);
  border-radius: 8px;
  color: var(--board-muted);
  display: inline-flex;
  font-size: .8rem;
  font-weight: 800;
  justify-content: center;
  min-height: var(--toolbar-size);
  min-width: 0;
  padding: 0 8px;
  text-align: center;
}

.board-workspace {
  padding: 10px;
}

.board-floating-brand {
  align-items: center;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(33, 48, 47, .12);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(33, 48, 47, .10);
  color: var(--board-ink);
  display: grid;
  gap: 0 8px;
  grid-template-columns: 34px minmax(0, auto);
  max-width: min(220px, calc(100vw - 36px));
  padding: 6px 12px 6px 6px;
  position: absolute;
  right: 18px;
  text-decoration: none;
  top: 18px;
  z-index: 12;
}

.board-floating-brand img {
  height: 34px;
  object-fit: contain;
  width: 34px;
}

.board-floating-brand span {
  color: var(--board-purple);
  font-size: .86rem;
  font-weight: 900;
  line-height: 1.1;
}

.smart-board.toolbar-bottom {
  grid-template-rows: minmax(0, 1fr) auto;
}

.smart-board.toolbar-bottom .board-toolbar {
  grid-row: 2;
}

.smart-board.toolbar-bottom .board-workspace {
  grid-row: 1;
}

.smart-board.toolbar-left,
.smart-board.toolbar-right {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.smart-board.toolbar-right {
  grid-template-columns: minmax(0, 1fr) auto;
}

.smart-board.toolbar-left .board-toolbar,
.smart-board.toolbar-right .board-toolbar {
  align-items: center;
  flex-direction: column;
  gap: 5px;
  height: 100dvh;
  max-width: 52px;
  min-height: 0;
  overflow-x: visible;
  overflow-y: auto;
  padding: 5px;
  width: 52px;
}

.smart-board.toolbar-left .board-workspace {
  grid-column: 2;
}

.smart-board.toolbar-right .board-toolbar {
  grid-column: 2;
  grid-row: 1;
}

.smart-board.toolbar-right .board-workspace {
  grid-column: 1;
  grid-row: 1;
}

.smart-board.toolbar-left .toolbar-group,
.smart-board.toolbar-right .toolbar-group,
.smart-board.toolbar-left .window-controls,
.smart-board.toolbar-right .window-controls,
.smart-board.toolbar-left .quick-actions,
.smart-board.toolbar-right .quick-actions {
  border-left: 0;
  border-top: 1px solid rgba(33, 48, 47, .10);
  display: grid;
  grid-template-columns: 1fr;
  padding: 5px 0 0;
  width: 100%;
}

.smart-board.toolbar-left .primary-tools,
.smart-board.toolbar-right .primary-tools {
  border-top: 0;
  padding-top: 0;
}

.smart-board.toolbar-left .settings-toggle,
.smart-board.toolbar-right .settings-toggle {
  flex: 0 0 auto;
}

.smart-board.toolbar-left .tool-button,
.smart-board.toolbar-right .tool-button,
.smart-board.toolbar-left .window-control,
.smart-board.toolbar-right .window-control {
  height: 40px;
  min-height: 40px;
  min-width: 40px;
  width: 40px;
}

.smart-board.toolbar-left .toolbar-popover .tool-button,
.smart-board.toolbar-right .toolbar-popover .tool-button {
  height: var(--toolbar-size);
  min-height: var(--toolbar-size);
  min-width: 0;
  width: auto;
}

.smart-board.toolbar-left .toolbar-popover .icon-tool,
.smart-board.toolbar-right .toolbar-popover .icon-tool {
  min-width: var(--toolbar-size);
  width: var(--toolbar-size);
}

.smart-board.toolbar-left .toolbar-popover .menu-action,
.smart-board.toolbar-right .toolbar-popover .menu-action,
.smart-board.toolbar-left .toolbar-popover .compact-row > .tool-button:not(.icon-tool),
.smart-board.toolbar-right .toolbar-popover .compact-row > .tool-button:not(.icon-tool) {
  width: 100%;
}

.toolbar-reopen {
  align-items: center;
  background: var(--board-purple);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(93, 75, 184, .28);
  color: #fff;
  cursor: pointer;
  justify-content: center;
  height: 40px;
  min-height: 40px;
  min-width: 40px;
  padding: 0;
  width: 40px;
  z-index: 30;
}

.toolbar-reopen svg {
  fill: none;
  height: 19px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 19px;
}

.toolbar-reopen:hover,
.toolbar-reopen:focus-visible {
  background: #6957ca;
  box-shadow: 0 14px 34px rgba(93, 75, 184, .36);
  outline: 3px solid rgba(124, 107, 216, .2);
  outline-offset: 2px;
}

.smart-board.toolbar-hidden.toolbar-top .toolbar-reopen svg {
  transform: rotate(90deg);
}

.smart-board.toolbar-hidden.toolbar-bottom .toolbar-reopen svg {
  transform: rotate(-90deg);
}

.smart-board.toolbar-hidden.toolbar-right .toolbar-reopen svg {
  transform: rotate(180deg);
}

.toolbar-window-controls {
  align-self: center;
  background: rgba(247, 250, 249, .92);
  border: 1px solid rgba(33, 48, 47, .10);
  border-radius: 10px;
  gap: 4px;
  padding: 3px;
}

.window-control svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.pin-control .lock-closed-icon,
.pin-control.is-active .lock-open-icon {
  display: none;
}

.pin-control.is-active .lock-closed-icon {
  display: block;
}

.smart-board.toolbar-left .toolbar-window-controls,
.smart-board.toolbar-right .toolbar-window-controls {
  align-self: stretch;
  border-left: 0;
  border-top: 0;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 1fr;
  margin: 0 0 4px;
  padding: 4px 0 8px;
  width: 100%;
}

.smart-board.toolbar-left .primary-tools,
.smart-board.toolbar-right .primary-tools {
  border-top: 1px solid rgba(33, 48, 47, .10);
  padding-top: 6px;
}

.smart-board.toolbar-hidden.toolbar-top .toolbar-reopen {
  bottom: auto;
  left: 12px;
  right: auto;
  top: 12px;
  transform: none;
}

.smart-board.toolbar-hidden.toolbar-left .toolbar-reopen {
  bottom: 12px;
  left: 12px;
  right: auto;
  top: auto;
  transform: none;
}

.smart-board.toolbar-hidden.toolbar-bottom .toolbar-reopen,
.smart-board.toolbar-hidden.toolbar-right .toolbar-reopen {
  bottom: 12px;
  left: auto;
  right: 12px;
  top: auto;
  transform: none;
}

.board-panel {
  z-index: 14;
}

.board-toast-stack {
  display: grid;
  gap: 8px;
  pointer-events: none;
  position: fixed;
  right: 18px;
  top: 18px;
  width: min(360px, calc(100vw - 36px));
  z-index: 80;
}

.board-toast {
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(33, 48, 47, .14);
  border-left: 4px solid var(--board-purple);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(33, 48, 47, .14);
  color: var(--board-ink);
  font-size: .9rem;
  font-weight: 700;
  padding: 12px 14px;
}

.board-toast.is-error {
  border-left-color: #d94b4b;
}

.board-confirm {
  align-items: center;
  background: rgba(33, 48, 47, .34);
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 18px;
  position: fixed;
  z-index: 90;
}

.board-confirm[hidden] {
  display: none;
}

.board-confirm-card {
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(33, 48, 47, .14);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(33, 48, 47, .22);
  display: grid;
  gap: 12px;
  max-width: 460px;
  padding: 20px;
  width: min(460px, 100%);
}

.board-confirm-card strong {
  color: var(--board-purple);
  font-size: 1rem;
}

.board-confirm-card p {
  color: var(--board-ink);
  margin: 0;
}

.board-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 600px) {
  :root {
    --toolbar-height: 62px;
    --toolbar-size: 44px;
  }

  .smart-board-mobile-warning {
    display: none;
  }

  .smart-board,
  .smart-board.toolbar-top,
  .smart-board.toolbar-bottom,
  .smart-board.toolbar-left,
  .smart-board.toolbar-right {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    padding: 0;
  }

  .smart-board:not(.toolbar-hidden) .board-toolbar,
  .smart-board.toolbar-top:not(.toolbar-hidden) .board-toolbar,
  .smart-board.toolbar-bottom:not(.toolbar-hidden) .board-toolbar,
  .smart-board.toolbar-left:not(.toolbar-hidden) .board-toolbar,
  .smart-board.toolbar-right:not(.toolbar-hidden) .board-toolbar {
    align-items: center;
    border: 0;
    border-radius: 0;
    border-top: 1px solid var(--board-line);
    display: flex !important;
    flex-direction: row;
    grid-column: 1;
    grid-row: 2;
    height: auto;
    max-height: none;
    max-width: none;
    min-height: var(--toolbar-height);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 7px;
    width: 100%;
  }

  .smart-board.toolbar-hidden .board-toolbar {
    display: none !important;
  }

  .smart-board .board-workspace,
  .smart-board.toolbar-top .board-workspace,
  .smart-board.toolbar-bottom .board-workspace,
  .smart-board.toolbar-left .board-workspace,
  .smart-board.toolbar-right .board-workspace {
    display: block !important;
    grid-column: 1;
    grid-row: 1;
    padding: 4px;
  }

  .smart-board.toolbar-left .toolbar-window-controls,
  .smart-board.toolbar-right .toolbar-window-controls,
  .smart-board .toolbar-window-controls {
    align-self: center;
    display: inline-flex;
    flex: 0 0 auto;
    grid-template-columns: none;
    margin: 0;
    padding: 3px;
    width: auto;
  }

  .smart-board .toolbar-group,
  .smart-board.toolbar-left .toolbar-group,
  .smart-board.toolbar-right .toolbar-group {
    border: 0;
    border-left: 1px solid rgba(33, 48, 47, .1);
    display: inline-flex;
    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: nowrap;
    grid-template-columns: none;
    padding: 0 0 0 5px;
    width: auto;
  }

  .smart-board .tool-button,
  .smart-board .window-control {
    height: var(--toolbar-size);
    min-height: var(--toolbar-size);
    min-width: var(--toolbar-size);
    width: var(--toolbar-size);
  }

  .smart-board .toolbar-popover .tool-button {
    height: var(--toolbar-size);
    min-height: var(--toolbar-size);
    min-width: 0;
    width: auto;
  }

  .smart-board .toolbar-popover .icon-tool {
    min-width: var(--toolbar-size);
    width: var(--toolbar-size);
  }

  .smart-board .toolbar-popover .menu-action,
  .smart-board .toolbar-popover .compact-row > .tool-button:not(.icon-tool) {
    width: 100%;
  }

  .smart-board .settings-toggle {
    flex: 0 0 var(--toolbar-size);
  }

  .board-floating-brand {
    display: grid;
    grid-template-columns: 28px minmax(0, auto);
    max-width: 170px;
    padding: 4px 9px 4px 4px;
    right: 9px;
    top: 9px;
  }

  .board-floating-brand img {
    height: 28px;
    width: 28px;
  }

  .board-floating-brand span {
    font-size: .74rem;
  }

  .toolbar-popover {
    max-height: min(62dvh, 480px);
    width: min(300px, calc(100vw - 20px));
  }

  .toolbar-popover.is-open {
    display: grid !important;
  }

  .board-panel {
    bottom: calc(var(--toolbar-height) + 8px);
    left: 8px;
    max-height: min(58dvh, 430px);
    right: 8px;
    top: auto;
    width: auto;
  }

  .smart-board.toolbar-hidden .toolbar-reopen {
    bottom: 12px;
    display: inline-flex !important;
    right: 12px;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  :root {
    --toolbar-height: 50px;
  }

  .board-toolbar {
    align-items: center;
    flex-wrap: nowrap;
    min-height: var(--toolbar-height);
    overflow-x: auto;
    overflow-y: visible;
    padding: 5px;
  }

  .board-workspace {
    padding: 8px;
  }

  .board-floating-brand {
    right: 14px;
    top: 14px;
  }

  .smart-board.toolbar-left .board-toolbar,
  .smart-board.toolbar-right .board-toolbar,
  .smart-board.toolbar-top .board-toolbar,
  .smart-board.toolbar-bottom .board-toolbar {
    max-height: none;
  }
}

/* Final responsive layer: keep temporary UI above the document at every dock. */
.board-panel { z-index: 55; }
.toolbar-popover { z-index: 70; }
.board-context-menu { z-index: 75; }

.smart-board.is-phone-layout.toolbar-top .board-panel {
  bottom: auto;
  top: calc(var(--toolbar-height) + 8px);
}

.smart-board.is-phone-layout.toolbar-left .board-panel {
  bottom: 8px;
  left: 66px;
  right: 8px;
  top: 8px;
  width: auto;
}
