/* Compact workspace controls leave more room for the canvas. */
#plannerTopbar {
  top: 14px;
  left: 14px;
  right: 14px;
  gap: 12px;
  align-items: stretch;
  font-family: Arial, Helvetica, sans-serif;
}

#plannerTopbar > .glass {
  height: 48px;
  min-height: 48px !important;
  border-radius: 12px;
  background-color: rgb(var(--panel-rgb, 250 250 252) / .9);
  border: 1px solid var(--panel-edge, #ffffff70);
  box-shadow: inset 0 1px 0 var(--panel-highlight, #ffffff70), 0 5px 20px #17201b12;
}

body[data-dark-u-i="true"] #plannerTopbar > .glass {
  background-color: color-mix(in srgb, rgb(var(--panel-rgb)) 65%, #17201c 35%);
}

#plannerTopbar .brand-group {
  width: 276px;
  max-width: 100%;
  padding: 6px 10px;
  gap: 8px;
  flex: 0 1 276px;
  align-items: center;
}

#plannerTopbar .workspace-title {
  min-width: 0;
  flex: 1;
}

#plannerTopbar #boardName {
  width: 100%;
  min-width: 0;
  padding: 1px 0;
  border-radius: 4px;
  font: 500 13px/1.25 Arial, Helvetica, sans-serif;
  font-weight: 500 !important;
  letter-spacing: -.2px;
  color: var(--ui-text, #292932);
  text-overflow: ellipsis;
}

#plannerTopbar #boardName:hover {
  background: var(--ui-active);
}

#plannerTopbar #boardName:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 3px;
}

#plannerTopbar #saveStatus {
  margin-top: 2px;
  font: 10px/1.3 Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  white-space: nowrap;
}

#plannerTopbar .planner-pages {
  margin: 0;
  gap: 6px;
  flex: 0 0 auto;
}

#plannerTopbar .planner-page-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 36px;
  height: 30px;
  border-radius: 7px;
  cursor: pointer;
}

#plannerTopbar .planner-page-switch > svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

#plannerTopbar .planner-page-switch > .page-chevron {
  width: 8px;
  height: 8px;
}

#plannerTopbar #plannerPage {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

#plannerTopbar .planner-page-switch:focus-within {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

#plannerTopbar #addPlannerPage {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--panel-edge, #ffffff70);
  background: var(--ui-control);
  border-radius: 7px;
}

#plannerTopbar #addPlannerPage svg {
  width: 16px;
  height: 16px;
}

#plannerTopbar .header-actions {
  padding: 6px !important;
  gap: 2px !important;
  flex: 0 0 auto;
}

#plannerTopbar .header-actions button {
  display: inline-flex !important;
  min-height: 32px;
  padding: 7px 8px !important;
  gap: 5px;
  border-radius: 7px;
  font: 500 11px/1 Arial, Helvetica, sans-serif;
  font-size: 11px !important;
  letter-spacing: -.1px;
  white-space: nowrap;
}

#plannerTopbar .header-actions button span {
  display: inline;
}

#plannerTopbar .header-actions svg {
  width: 16px;
  height: 16px;
}

#plannerTopbar .topbar-divider {
  height: 18px;
  width: 1px;
  flex: 0 0 1px;
  margin: 0 2px;
  background: var(--panel-edge, #858b8740);
}

#plannerTopbar #export {
  margin-left: 2px;
  background: #303634;
  color: #fafaf7;
}

body[data-dark-u-i="true"] #plannerTopbar #export {
  background: #f2f3ef;
  color: #29312d;
}

#plannerTopbar :is(button, .planner-page-switch) {
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

#plannerTopbar :is(button, .planner-page-switch):hover {
  background: var(--ui-active);
}

#plannerTopbar #export:hover {
  background: #444c48;
}

body[data-dark-u-i="true"] #plannerTopbar #export:hover {
  background: #ffffff;
}

#plannerTopbar button:focus-visible {
  outline: 2px solid var(--ui-text, #292932);
  outline-offset: 3px;
}

.extras.glass {
  top: 72px;
  left: 14px;
  gap: 2px;
  padding: 4px;
  border-radius: 10px;
}

.extras.glass button {
  width: 28px;
  height: 28px;
  padding: 6px;
  border-radius: 6px;
}

.extras.glass button svg {
  width: 16px;
  height: 16px;
}

.tools.glass {
  --tools-top: max(122px, calc(50dvh - 153px));
  top: var(--tools-top);
  left: 14px;
  transform: none;
  grid-template-columns: 32px;
  gap: 2px;
  padding: 5px;
  border-radius: 11px;
  max-height: calc(100dvh - var(--tools-top) - 78px);
  overflow-y: auto;
}

.tools.glass button {
  width: 32px;
  height: 32px;
  padding: 6px;
  gap: 0;
  border-radius: 7px;
}

.tools.glass svg,
.tools.glass #delete svg {
  width: 18px;
  height: 18px;
}

.tools.glass small {
  display: none;
}

.tools.glass hr {
  width: 20px;
  margin: 5px auto;
}

.quick-sound.glass {
  top: 72px;
  right: 14px;
}

@media (max-width: 600px) {
  #plannerTopbar {
    top: 12px;
    left: 12px;
    right: 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  #plannerTopbar .brand-group {
    width: 100%;
    flex-basis: 100%;
    height: 48px;
    min-height: 48px !important;
  }

  #plannerTopbar .header-actions {
    height: 40px;
    min-height: 40px !important;
    padding: 3px !important;
  }

  #plannerTopbar .header-actions button {
    min-height: 32px;
    padding: 7px 8px !important;
  }

  .extras.glass {
    top: 70px;
    left: 12px;
  }

  .tools.glass {
    left: 12px;
  }

  .quick-sound.glass {
    top: 120px;
    right: 12px;
  }
}

@media (max-width: 520px) {
  #plannerTopbar :is(#help, #import) {
    width: 32px;
    padding: 7px !important;
  }

  #plannerTopbar :is(#help, #import) span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #plannerTopbar :is(button, .planner-page-switch) {
    transition: none;
  }
}
