/* SPDX-License-Identifier: Apache-2.0 */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: #29272e;
  font: 14px system-ui;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  min-width: 40px;
  min-height: 40px;
  background: white;
  border: 1px solid #e8e7ed;
  border-radius: 8px;
  padding: 8px 12px;
}
button:disabled,
button[aria-disabled=true] {
  opacity: .45;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.scene:focus-visible {
  outline: 3px solid #7051cf;
  outline-offset: 3px;
}
button[aria-pressed=true],
.primary {
  background: #7051cf;
  color: white;
}
.scene {
  position: absolute;
  inset: 0;
  background-color: #fafafa;
  background-image: radial-gradient(#ddd 1px,transparent 1px);
  background-size: 24px 24px;
  touch-action: none;
  overflow: hidden;
}
.scene > div {
  pointer-events: none;
}
.scene.grab { cursor: grab; }
.scene.grabbing { cursor: grabbing; }
main {
  position: relative;
  min-height: 640px;
  height: 100dvh;
  overflow: hidden;
}
.floating {
  background: #fff;
  border: 1px solid #e9e7ed;
  border-radius: 12px;
  box-shadow: 0 2px 8px #29202e0a;
  padding: 6px;
  position: absolute;
  z-index: 3;
}
.file {
  top: 12px;
  left: 12px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  max-width: calc(100% - 344px);
}
.file > button:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px;
  border: 0;
}
.board-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}
.brand {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: #302d36;
  color: white;
  border-radius: 6px;
}
.file small {
  background: #f5f0ff;
  color: #7051cf;
  padding: 4px 6px;
  border-radius: 6px;
}
.actions {
  right: 12px;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  min-height: 48px;
  max-width: 312px;
}
.save-status {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
  font-size: 12px;
}
svg { flex-shrink: 0; }
.divider {
  width: 1px;
  height: 20px;
  background: #e8e7ed;
  flex-shrink: 0;
}
.notice {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: min(660px,calc(100% - 24px));
  font-size: 12px;
  background: #f3f0f8e8;
  border: 1px solid #e1dce8;
  padding: 10px 14px;
  border-radius: 10px;
  z-index: 4;
}
.notice button {
  margin-left: 8px;
}
.palette {
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}
.icon-button {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
}
.palette { height: 56px; align-items: center; }
.tool-divider { margin-left: 9px; }
.tool-divider::before {
  content: "";
  position: absolute;
  left: -7px;
  width: 1px;
  height: 20px;
  background: #e8e7ed;
}
.tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #302d36;
  color: white;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  visibility: hidden;
  z-index: 5;
}
.icon-button:hover .tooltip,
.icon-button:focus-visible .tooltip { visibility: visible; }
.file .tooltip { bottom: auto; top: calc(100% + 8px); }
button:hover:not(:disabled):not([aria-disabled=true]) { background: #f1eff5; }
button[aria-pressed=true]:hover,
button[aria-pressed=true] { background: #7051cf; color: white; }
button.error { background: #a32940; color: white; }
button.primary:hover:not(:disabled) { background: #6142be; }
button.error:hover:not(:disabled) { background: #8d2036; }
.zoom {
  bottom: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.zoom button {
  border: 0;
  padding: 4px;
}
.objects,
.details,
.navigation {
  right: 12px;
  top: 130px;
  width: 288px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100% - 220px);
  overflow: auto;
}
.details {
  left: 12px;
  right: auto;
  top: 70px;
}
.navigation {
  top: auto;
  bottom: 78px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
h2 {
  font-size: 14px;
  margin: 0;
}
input,
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #dcd9e2;
  border-radius: 7px;
  background: white;
}
textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.45;
}
.moves {
  display: flex;
  gap: 5px;
}
small {
  color: #79737f;
  font-size: 12px;
}
.context {
  position: absolute;
  width: max-content;
  flex-wrap: nowrap;
  height: 40px;
  background: #302d36;
  color: white;
  display: flex;
  gap: 4px;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px;
  padding: 0 8px;
  z-index: 1;
}
.context button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
  background: transparent;
  border: 0;
  color: white;
}
.context button:hover:not(:disabled) { color: #29272e; }
.context small { color: #eee; white-space: nowrap; }
.context .divider { background: #79737f; }
.context > span:first-child { white-space: nowrap; }
.object-commands { display: flex; gap: 8px; flex-wrap: wrap; }
.object-commands button { display: inline-flex; gap: 4px; align-items: center; }
.information { position: absolute; left: 12px; bottom: 12px; }
.information .tooltip { left: 0; transform: none; }
.information-panel {
  left: 12px;
  bottom: 60px;
  width: min(288px, calc(100% - 24px));
  padding: 12px;
  max-height: calc(100% - var(--panel-top) - 140px);
  overflow: auto;
}
.information-panel p { margin-top: 0; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
[hidden] { display: none !important; }
.inline {
  position: absolute;
  z-index: 2;
}
.inline label,
.inline small {
  position: absolute;
  left: -10000px;
}
.inline textarea {
  font: inherit;
  line-height: 1.45;
  padding: 0;
  border: 0;
  border-radius: 0;
  resize: none;
  background: transparent;
  width: 100%;
  height: 100%;
  min-height: 0;
  outline: 0;
}
.inline:focus-within {
  outline: 3px solid #7051cf;
  outline-offset: 4px;
}
@media (max-width:1000px) {
  .palette {
    bottom: 72px;
  }
  .zoom {
    bottom: 12px;
  }
  .objects {
    max-height: calc(100% - 280px);
  }
}
@media (max-width:767px) {
  main {
    min-height: 900px;
  }
  .file {
    left: 12px;
    right: 12px;
    max-width: none;
  }
  .actions {
    top: 68px;
    left: 12px;
    right: 12px;
    max-width: none;
    justify-content: space-between;
  }
  .notice {
    top: 145px;
  }
  .objects,
  .details {
    top: 220px;
    left: 12px;
    right: 12px;
    width: calc(100% - 24px);
    max-width: 360px;
    max-height: calc(100% - 380px);
  }
  .palette {
    bottom: 76px;
  }
  .navigation {
    max-width: calc(100% - 24px);
  }
  .context {
    display: none;
  }
}

/* Stack status and secondary surfaces beneath the actual action-bar height. */
.notice {
  top: var(--notice-top,80px);
}
.objects,
.details {
  top: var(--panel-top,130px);
  max-height: calc(100% - var(--panel-top,130px) - 154px);
}

@media (max-width:767px) {
  .file > button:first-child { flex: 1; }
  .file { gap: 2px; }
  .file small { padding: 4px; }
}

/* W5 controls share the shell's target sizes, focus and icon states. */
.object-styles { display: grid; gap: 8px; }
.object-formats { display: flex; gap: 8px; flex-wrap: wrap; }
.format-preview { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; color: #4b4752; }
.alignments, .formats, .colour-control { display: inline-flex; gap: 4px; }
.context .context-size {
  width: 124px;
  min-height: 40px;
  padding: 4px;
  background: #302d36;
  color: white;
  border: 1px solid #79737f;
  flex-shrink: 0;
}
.context .context-size:disabled { opacity: .45; }
.colour-dot {
  display: block;
  width: 22px;
  height: 22px;
  border: 1px solid #79737f;
  border-radius: 50%;
}
.swatches {
  position: absolute;
  width: 196px;
  height: 108px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(4, 40px);
  gap: 4px;
  background: white;
  border: 1px solid #e9e7ed;
  border-radius: 12px;
  box-shadow: 0 2px 8px #29202e20;
}
.context .swatches button[aria-pressed=true] .colour-dot {
  outline: 2px solid #7051cf;
  outline-offset: 3px;
}

/* W7 selection preview sits above objects and below floating controls. */
.selection-box {
  position: absolute;
  border: 1px solid #518de0;
  background: rgb(81 141 224 / 12%);
  pointer-events: none;
}
.colour-dot.mixed {
  background: conic-gradient(#f2dce5 0deg 45deg, #f8e9a6 45deg 90deg,
    #f9d9bd 90deg 135deg, #d6ecc9 135deg 180deg, #cbe9e3 180deg 225deg,
    #d4e3f8 225deg 270deg, #e2dbf6 270deg 315deg, #e9e7ed 315deg 360deg);
}
.objects select[multiple] { min-height: 132px; overflow-y: auto; }

/* W8 handles use CSS pixels and route presses through the scene's capture. */
.scene > .resize-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}
.resize-handle::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: white;
  border: 1px solid #518de0;
}
.resize-handle.nw, .resize-handle.se { cursor: nwse-resize; }
.resize-handle.ne, .resize-handle.sw { cursor: nesw-resize; }
.sizes { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }

/* W9 uses the same commands in the contextual popover and Objects. */
.arrange-control { display: inline-flex; }
.arrange-menu {
  position: absolute;
  width: 268px;
  padding: 10px;
  overflow: auto;
  background: white;
  color: #29272e;
  border: 1px solid #e9e7ed;
  border-radius: 12px;
  box-shadow: 0 2px 8px #29202e20;
}
.arrange-group { display: grid; gap: 4px; }
.arrange-group + .arrange-group { margin-top: 8px; }
.arrange-group h3 { margin: 0; font-size: 12px; color: #79737f; }
.arrange-group > span { display: block; }
.arrange-group button,
.context .arrange-group button {
  width: 100%;
  min-height: 40px;
  padding: 6px 8px;
  color: #29272e;
  text-align: left;
  background: white;
  border: 1px solid #e8e7ed;
}
.objects-arrange { display: grid; gap: 8px; }

/* W10 outlines are sized in CSS pixels, above objects and below controls. */
.group-outline {
  position: absolute;
  overflow: visible;
  pointer-events: none;
}
.group-outline rect {
  fill: none;
  stroke: #518de0;
  stroke-width: 1px;
  stroke-dasharray: 4px 4px;
}
.arrange-group[aria-label="Group"] {
  border-top: 1px solid #e8e7ed;
  padding-top: 8px;
}

/* Sections use a drawing preview and a compact editor above their saved frame. */
.selection-box.drawing {
  border: 1.5px dashed #518de0;
  background: rgb(81 141 224 / 6%);
}
.inline.name-field {
  background: white;
  border: 2px solid #518de0;
  border-radius: 4px;
  font-weight: 600;
}
.inline.name-field:focus-within { outline: none; }
.inline.name-field textarea { line-height: 1; }

/* Basic shapes share the idea controls while keeping their own paint. */
.shapes-panel { left: 12px; top: 70px; width: 264px; padding: 12px; }
.shapes-panel h3 { font-size: 13px; margin: 12px 0; }
.shapes-panel p { color: #79737f; font-size: 12px; }
.shape-tiles { display: grid; grid-template-columns: repeat(4, 52px); gap: 8px; }
.shape-tiles button { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; padding: 0; min-width: 0; }
.shape-tiles button svg { width: 24px; height: 24px; }
.shape-control { display: inline-flex; }
.shape-menu, .shape-paint-panel {
  position: absolute; left: 0; top: 48px; background: #1f1f22; color: white;
  border-radius: 12px; padding: 12px; box-shadow: 0 2px 8px #29202e20;
}
.shape-menu { display: grid; gap: 4px; min-width: 160px; }
.shape-menu button[aria-checked=true] { background: #7051cf; }
.shape-paint-panel { width: 508px; }
.paint-modes { display: flex; gap: 8px; margin-bottom: 12px; }
.paint-modes button { flex: 1; }
.context .paint-modes button[aria-pressed=true] { background: #7051cf; }
.shape-swatches { display: grid; grid-template-columns: repeat(11, 40px); gap: 4px; }
.shape-swatches .colour-dot { width: 26px; height: 26px; }
.shape-swatches button[aria-pressed=true] .colour-dot, .custom-colour[data-pressed=true] {
  outline: 2px solid white; outline-offset: 2px;
}
.custom-colour { position: relative; width: 28px; height: 28px; margin: 6px; border-radius: 50%;
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.custom-colour-input { width: 1px; height: 1px; padding: 0; border: 0; position: absolute;
  opacity: 0; pointer-events: none; }
.custom-colour .custom-colour-input { width: 100%; height: 100%; inset: 0; pointer-events: auto; cursor: pointer; }
.custom-colour:focus-within { outline: 3px solid #a88cf4; outline-offset: 3px; }
.colour-dot.no-fill { background: transparent !important; border-color: white; }
.grow-shape { position: absolute; z-index: 1; transform: translate(-50%, -50%); width: 24px; height: 24px;
  min-width: 24px; min-height: 24px; border: 0; border-radius: 6px; padding: 2px; background: #518de0; color: white; }
.inline.shape-editor { display: flex; align-items: center; }
.inline.shape-editor textarea { height: auto; max-height: 100%; min-height: 1.45em; field-sizing: content;
  color: inherit; text-align: inherit; overflow-y: auto; }
.shape-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #929292; pointer-events: none; }
@media (max-width:767px) { .shapes-panel { top: var(--panel-top); max-width: calc(100% - 24px); } }

/* Connection dots are pointer controls; routes and labels remain document-free. */
.scene > .connection-dot {
  position: absolute; width: 16px; height: 16px; transform: translate(-50%, -50%);
  pointer-events: auto; cursor: crosshair;
}
.connection-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: #8fbdf5; }
.connection-preview { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.connection-preview line, .connection-preview circle { stroke: #518de0; fill: none; }
.connection-target { position: absolute; border: 3px solid #518de0; pointer-events: none; }
.inline.connector-editor { background: #fafafa; border: 1.5px solid #518de0; color: #2c2c2c; }
.inline.connector-editor:focus-within { outline: none; }
.inline.connector-editor textarea { text-align: center; }
.inline.connector-editor textarea::placeholder { color: #929292; opacity: 1; }
.board-file-commands { display: flex; flex-direction: column; gap: 12px; }
.boards-heading { margin: 0; font-size: 14px; }
.boards-list { display: flex; flex-direction: column; gap: 8px; }
.boards-list button { text-align: left; overflow-wrap: anywhere; }
.boards-list button > span, .boards-list small { display: block; }
.boards-list small { margin-top: 4px; }
.boards-list [aria-current=true] { border-color: #7051cf; background: #f5f0ff; }
.board-question { width: min(520px, calc(100% - 24px)); padding: 24px; border: 1px solid #e9e7ed; border-radius: 12px; color: #29272e; }
.board-question::backdrop { background: #29272e66; }
.board-question h2 { margin-top: 0; font-size: 20px; }
.board-question p { overflow-wrap: anywhere; }
.board-question-actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width:399px) {
  .board-question-actions { flex-wrap: wrap; }
}

/* Templates share toolbar pressed states and stay within the viewport. */
.templates-panel {
  left: calc(50% + 40px); bottom: 78px; width: 448px;
  max-height: calc(100% - 170px); overflow: auto; padding: 16px;
}
.templates-panel h3 { margin: 16px 0 12px; font-size: 13px; }
.template-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.template-card { min-width: 0; }
.template-preview { position: relative; aspect-ratio: 200 / 130; background: #fafafa; border: 1px solid #e9e7ed; border-radius: 8px; }
.template-preview svg { display: block; width: 100%; height: 100%; }
.template-preview rect, .template-preview line { stroke-width: 2; vector-effect: non-scaling-stroke; }
.add-template { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; opacity: 0; }
.template-card:hover .add-template, .add-template:focus { opacity: 1; }
.template-card h4 { font-size: 14px; margin: 10px 0 6px; }
.template-card p { font-size: 12px; margin: 0 0 8px; }
@media (max-width:1000px) {
  .templates-panel { bottom: 138px; }
}
@media (max-width:999.98px) {
  .templates-panel { left: 12px; width: calc(100% - 24px); }
}
@media (max-width:767px) {
  .templates-panel { bottom: 142px; }
}
@media (max-width:599px) {
  .templates-panel { max-height: calc(100% - 300px); }
  .template-cards { grid-template-columns: minmax(0, 1fr); }
}

/* Drawing controls share the toolbar container and stay a single scrollable row. */
.drawing-bar { bottom: 78px; left: 50%; transform: translateX(-50%); display: flex; align-items: center;
  gap: 4px; max-width: calc(100% - 24px); width: max-content; overflow-x: auto; flex-wrap: nowrap; }
.drawing-bar .icon-button { min-width: 36px; min-height: 36px; }
.drawing-bar button[aria-pressed=true] { background: #e9e2fb; color: #29272e; }
.drawing-bar .ink-dot[aria-pressed=true] { background: white; }
.drawing-bar .ink-dot[aria-pressed=true] .colour-dot { outline: 2px solid #7051cf; outline-offset: 2px; }
.drawing-bar button:disabled { opacity: .35; }
.context:has(.arrange-menu), .context:has(#colour-swatches), .context:has(details[open]) { z-index: 6; }
.stroke-control { position: relative; }
.stroke-control summary { display: inline-flex; gap: 6px; align-items: center; min-height: 40px; cursor: pointer; list-style: none; }
.stroke-control summary::-webkit-details-marker { display: none; }
.stroke-control summary[aria-disabled=true] { opacity: .45; cursor: default; }
.stroke-control summary:focus-visible { outline: 3px solid #7051cf; outline-offset: 3px; }
.ink-menu { position: absolute; top: 48px; left: 0; min-width: 160px; background: white; color: #29272e;
  padding: 8px; border: 1px solid #e9e7ed; border-radius: 12px; box-shadow: 0 2px 8px #29202e20; }
.context .ink-menu button { width: 100%; min-height: 40px; color: #29272e; padding: 6px 8px; }
.context .ink-menu button[aria-pressed=true] { background: #e9e2fb; }
@media (max-width:1000px) { .drawing-bar { bottom: 138px; } }
@media (max-width:767px) { .drawing-bar { bottom: 142px; } }

.connector-control { display: inline-flex; }
.connector-popup { left: 0; top: 48px; }
.connector-popup.shape-menu { min-width: 180px; }
.connector-ends { border: 1px solid #dedede; border-radius: 6px; margin: 10px 0; padding: 8px; }
.connector-end { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; margin: 6px 0; align-items: center; }
.connector-end select { min-width: 0; width: 100%; }
.reconnect-outline { position: absolute; border: 1px solid #518de0; pointer-events: none; }
.scene > .connection-dot.drop-side { width: 24px; height: 24px; border: 3px solid #518de0; border-radius: 50%; }
.connection-dot.drop-side::after { inset: 0; }
.context:has(.connector-popup) { z-index: 6; }

/* Local image descriptions reuse the dark contextual panel. */
.image-description-control { display: inline-flex; }
.image-description-panel {
  position: absolute; left: 0; top: 48px; width: min(340px, calc(100vw - 24px));
  padding: 12px; display: grid; gap: 8px; background: #1f1f22; color: white;
  border-radius: 12px; box-shadow: 0 2px 8px #29202e20;
}
.image-description-field { min-height: 0; height: auto; }
.context:has(.image-description-panel) { z-index: 6; }
@media (max-width:479.98px) {
  .palette { max-width: calc(100% - 24px); overflow-x: auto; flex-wrap: nowrap; }
}

/* Team surfaces are scoped so an off build keeps the local board's layout. */
.team-page { display: grid; place-items: center; background: #fafafa; min-height: 100dvh; padding: 24px; overflow: auto; }
.team-card, .team-dialog { background: white; color: #29272e; border: 1px solid #e9e7ed; border-radius: 12px; padding: 24px; }
.team-card { width: min(400px, calc(100vw - 24px)); }
.team-dialog { width: min(400px, calc(100vw - 24px)); max-height: calc(100dvh - 100px); overflow: auto; }
.team-dialog::backdrop { background: #29272e66; }
.team-card h1, .team-dialog h1 { font-size: 20px; margin: 12px 0; }
.team-card p, .team-dialog p { line-height: 1.5; }
.team-dialog h2 { margin: 20px 0 12px; }
.team-close { float: right; }
.team-submit { width: 100%; margin-top: 16px; }
.team-digits { display: flex; gap: 8px; }
.team-digits input { min-width: 0; text-align: center; font-size: 24px; padding: 10px 0; }
.team-dialog [role=alert], .team-card [role=alert] { color: #a32940; }
.team-ending { width: min(420px, calc(100vw - 24px)); }
.team-share { position: fixed; inset: 70px 12px auto auto; margin: 0; width: min(480px, calc(100vw - 24px)); padding: 20px; }
.team-share header { gap: 8px; }
.team-share header h1 { flex: 1; font-size: 18px; }
.team-invite { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.team-invite > span { position: relative; flex: 1; min-width: 0; }
.team-invite select { position: absolute; width: 100px; right: 4px; top: 4px; padding: 7px; border: 0; }
.team-invite input:not(:placeholder-shown) { padding-right: 108px; }
.team-person, .team-workspace { display: flex; align-items: center; gap: 10px; padding: 10px 0; width: 100%; text-align: left; }
.team-person > span:nth-child(2), .team-workspace > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.team-person small, .team-workspace small { display: block; margin-top: 4px; }
.team-avatar { display: grid; place-items: center; border-radius: 50%; width: 32px; height: 32px; flex-shrink: 0; background: #f3f0f8; }
.team-workspace { border: 0; }
.team-role { position: relative; flex-shrink: 0; }
.team-role [role=menu] { position: absolute; right: 0; top: 100%; width: 156px; padding: 6px; background: white; border: 1px solid #e9e7ed; border-radius: 8px; box-shadow: 0 2px 8px #29202e20; z-index: 1; }
.team-role [role=menu] button { width: 100%; text-align: left; border: 0; }
.team-role .team-remove { color: #a32940; }
.team-account { display: grid; gap: 8px; overflow-wrap: anywhere; }
.team-banner, .team-toast { position: absolute; left: 50%; transform: translateX(-50%); z-index: 4; border-radius: 10px; padding: 10px 14px; background: #f3f0f8; border: 1px solid #e1dce8; width: max-content; max-width: calc(100% - 24px); }
.team-banner { top: 76px; }
.team-toast { position: fixed; bottom: 86px; }
.team-amber { color: #936000; background: #fff5da; }
@media (max-width:1099.98px) { .team-banner { top: 128px; } }
@media (max-width:767.98px) { .team-share { top: 128px; } .team-toast { bottom: 148px; } }

/* Hosted board presence (0004-W3). Local boards match none of these rules. */
.actions:has(.presence-people) { max-width: calc(100% - 24px); }
.presence-people {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  height: 32px;
  padding: 0 6px 0 2px;
}
.presence-people ul {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
}
.presence-people li { display: flex; align-items: center; }
.presence-people .presence-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 2px solid #ffffff;
  border-radius: 50%;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  outline-offset: 1px;
}
.presence-people li + li > .presence-avatar, .presence-people .presence-overflow { margin-left: -6px; }
.presence-people .presence-overflow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0 6px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #ece9f2;
  color: #3b3a40;
  font-size: 12px;
  font-weight: 600;
}
.presence-people .presence-chevron {
  display: inline-flex;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  padding: 0;
  margin-left: 4px;
  border: 0;
  background: none;
}
.presence-people button.presence-chevron:hover:not(:disabled):not([aria-disabled=true]) { background: transparent; }
.presence-people button.presence-overflow:hover:not(:disabled):not([aria-disabled=true]) { background: #ece9f2; }
.presence-menu {
  position: fixed;
  width: min(316px, calc(100vw - 24px));
  max-height: calc(100dvh - 160px);
  overflow: auto;
  padding: 8px;
  border: 0;
  border-radius: 12px;
  background: #2b2a30;
  color: #ffffff;
  font: 14px system-ui;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 6;
}
.presence-menu button {
  width: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.presence-person, .presence-cursor-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
}
.presence-menu button:hover, .presence-menu button:focus { background: #45434d; }
.presence-menu button:focus { outline: none; }
.presence-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
}
.presence-person-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.presence-person-label small { display: block; color: #b9b6c3; font-size: 12px; }
.presence-follow-word { visibility: hidden; color: #d6d1ff; font-size: 13px; }
.presence-person:hover .presence-follow-word, .presence-person:focus .presence-follow-word { visibility: visible; }
.presence-menu [role=separator] { height: 1px; background: #45434d; margin: 6px 4px; }
.presence-cursor-switch > span:first-child { width: 26px; flex-shrink: 0; text-align: center; }
.presence-cursor-switch > span:nth-child(2) { flex: 1; }
.presence-cursor-switch small { color: #b9b6c3; font-size: 12px; white-space: nowrap; }
.presence-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.presence-outline { position: absolute; border: 2px solid; border-radius: 2px; }
.presence-cursor { position: absolute; }
.presence-cursor svg { display: block; }
.presence-cursor span {
  position: absolute;
  left: 14px;
  top: 16px;
  color: #ffffff;
  border-radius: 999px;
  padding: 4px 7px;
  white-space: nowrap;
  font: 600 12px/1 system-ui;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.presence-frame { position: absolute; inset: 0; border: 3px solid; z-index: 5; }
.presence-follow-banner {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 12px;
  border-radius: 8px;
  color: #ffffff;
  font: 600 13px system-ui;
  z-index: 5;
}
.presence-follow-banner > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.presence-follow-banner button {
  flex-shrink: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
  font: inherit;
  padding: 4px 10px;
}
@media (min-width: 1100px) {
  main:has(.presence-people) .file { max-width: calc(50% - 220px); }
  .presence-follow-banner { max-width: min(400px, calc(100% - 24px)); }
}
@media (min-width: 768px) and (max-width: 1099.98px) {
  main:has(.presence-people) .file { max-width: calc(100% - 440px); }
}
@media (max-width: 1099.98px) {
  .presence-follow-banner { top: 70px; }
  main:has(.presence-follow-banner) > .team-banner { top: 132px; }
}
@media (max-width: 767.98px) {
  .presence-follow-banner { top: 126px; }
  main:has(.presence-follow-banner) > .team-banner { top: 188px; }
}

/* Home (0003-W5). These rules apply only to the team controls. */
.home {
  position: fixed;
  inset: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  background: #fafafa;
  color: #29272e;
  font: 14px system-ui;
}
.home h1, .home h2, .home p { margin: 0; }
.home svg { flex-shrink: 0; }
.home-sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  min-height: 0;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid #e9e7ed;
}
.home-account {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  height: 44px;
  min-height: 44px;
  flex-shrink: 0;
  padding: 0 6px;
  margin-bottom: 8px;
  border: 0;
}
.home-account > span { flex: 1; min-width: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-brand {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: #302d36;
  color: #fff;
  font-weight: 700;
  border-radius: 6px;
}
.home-sidebar .home-sidebar-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  height: 36px;
  min-height: 36px;
  flex-shrink: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}
.home-sidebar .home-sidebar-item:hover { background: #f1eff5; }
.home-sidebar .home-sidebar-item[aria-current=page],
.home-sidebar .home-sidebar-item[aria-current=page]:hover { background: #f5f0ff; color: #7051cf; font-weight: 600; }
.home-workspaces-label { font-size: 12px; color: #79737f; margin: 16px 10px 4px; }
.home-workspace-tile {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 5px;
  background: #ece9f2;
  color: #45434d;
  font-size: 11px;
  font-weight: 700;
}
.home-workspace-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-sidebar-item small { color: #79737f; font-size: 12px; font-weight: 400; white-space: nowrap; }
.home-local { margin-top: auto; border-top: 1px solid #e9e7ed; padding-top: 8px; }
.home-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.home-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 64px;
  flex-shrink: 0;
  padding: 0 32px;
  background: #fff;
  border-bottom: 1px solid #e9e7ed;
}
.home-topbar h1 { flex: 1; font-size: 14px; font-weight: 600; }
.home .home-new-board { display: flex; align-items: center; gap: 6px; background: #7051cf; color: #fff; border: 0; }
.home .home-new-board:hover:not(:disabled):not([aria-disabled=true]),
.home .home-empty-new:hover:not(:disabled):not([aria-disabled=true]) { background: #6142be; }
.home-body { position: relative; flex: 1; min-height: 0; padding: 24px 32px; overflow-y: auto; }
.home-workspace-head { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.home-workspace-head h2 { font-size: 24px; font-weight: 600; }
.home-head-space { flex: 1; }
.home-sort { display: flex; align-items: center; gap: 6px; }
.home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.home-board-card { background: #fff; border: 1px solid #e9e7ed; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px #29202e0a; }
.home-board-card[aria-selected=true], .home-board-card:focus-visible { outline: 2px solid #518de0; outline-offset: -1px; }
.home-board-tile {
  display: grid;
  place-items: center;
  height: 168px;
  border-bottom: 1px solid #e9e7ed;
  background: #fafafa radial-gradient(#ddd 1px, transparent 1px);
  background-size: 24px 24px;
}
.home-board-tile b { display: grid; place-items: center; width: 44px; height: 44px; background: #fff; border: 1px solid #e9e7ed; border-radius: 10px; color: #b9b6c3; font-size: 18px; font-weight: 700; }
.home-board-details { display: grid; grid-template-columns: 20px minmax(0, 1fr) max-content; grid-template-rows: auto auto; gap: 4px 10px; align-items: center; padding: 12px 14px; }
.home-type-mark { display: grid; place-items: center; grid-row: 1 / 3; width: 20px; height: 20px; background: #302d36; color: #fff; font-size: 11px; font-weight: 700; border-radius: 5px; }
.home-board-name { grid-column: 2; grid-row: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-edited { grid-column: 2; grid-row: 2; font-size: 12px; color: #79737f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-chip { font-size: 12px; color: #45434d; background: #f3f0f8; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.home-board-role { grid-column: 3; grid-row: 1 / 3; }
.home .home-rename { grid-column: 2; grid-row: 1; width: 100%; min-width: 0; font-weight: 600; border: 0; border-bottom: 1px solid #7051cf; padding: 0 0 1px; outline: none; border-radius: 0; background: transparent; }
.home-rename::selection { background: #e9e2fb; }
.home-menu { position: fixed; width: 208px; padding: 6px; background: #fff; border: 1px solid #e9e7ed; border-radius: 8px; box-shadow: 0 2px 8px #29202e20; z-index: 5; }
.home-menu button { position: relative; display: block; width: 100%; min-height: 32px; padding: 6px 10px 6px 28px; border: 0; border-radius: 6px; background: transparent; text-align: left; }
.home-menu button:hover:not(:disabled):not([aria-disabled=true]), .home-menu button:focus { background: #f3f0f8; outline: none; }
.home-menu-label { font-size: 12px; color: #79737f; padding: 6px 10px 4px 28px; }
.home-menu [role=separator] { height: 1px; background: #e9e7ed; margin: 6px 0; }
.home-menu-tick { position: absolute; left: 9px; color: #7051cf; }
.home-state { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; text-align: center; }
.home-state > div { display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: auto; }
.home-state b { font-size: 14px; }
.home .home-state-hint { color: #79737f; line-height: 1.5; max-width: 380px; margin-bottom: 8px; }
.home-error { color: #a32940; }
.home-toast { position: fixed; bottom: 24px; left: calc(50% + 120px); transform: translateX(-50%); padding: 10px 14px; border: 1px solid #e1dce8; border-radius: 10px; background: #f3f0f8; max-width: calc(100% - 32px); z-index: 6; }
.back-to-files { display: flex; align-items: center; justify-content: flex-start; gap: 8px; }
.back-to-files svg { flex-shrink: 0; }
@media (max-width: 1099.98px) {
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 799.98px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599.98px) {
  .home { grid-template-columns: 160px minmax(0, 1fr); }
  .home-topbar { padding-left: 12px; padding-right: 12px; }
  .home-body { padding-left: 12px; padding-right: 12px; }
  .home-sidebar .home-sidebar-item { gap: 6px; padding-left: 4px; padding-right: 4px; height: auto; }
  .home-workspace-name { white-space: normal; overflow-wrap: anywhere; }
  .home-sidebar-item small { font-size: 10px; }
  .home-workspace-head { flex-wrap: wrap; }
  .home-toast { left: 50%; }
}

/* Recovery notices (0004-W2) share the hosted banner's position. */
.team-notice-column {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 24px);
  pointer-events: none;
}
.team-notice-column > .team-banner {
  position: static;
  transform: none;
  max-width: 100%;
  pointer-events: auto;
}
.team-loss-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: 100%;
  padding: 10px 14px;
  color: #a32940;
  background: #fdf0f2;
  border: 1px solid #f2cdd5;
  border-radius: 10px;
  pointer-events: auto;
}
.team-loss-notice button { min-height: 28px; padding: 2px 10px; flex-shrink: 0; }
.team-leave button.primary:focus, .team-ending button.team-close:focus {
  outline: 3px solid #7051cf;
  outline-offset: 3px;
}
@media (max-width: 1099.98px) {
  .team-notice-column { top: 128px; }
  main:has(.presence-follow-banner) > .team-notice-column { top: 132px; }
}
@media (max-width: 767.98px) {
  .team-loss-notice { flex-wrap: wrap; }
  main:has(.presence-follow-banner) > .team-notice-column { top: 188px; }
}

/* Hosted comments (0005-W1). Explicit button/field values override shared controls. */
.comment-pins { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.comment-attach-outline { position: absolute; border: 2px solid #518de0; border-radius: 2px; pointer-events: none; z-index: 2; }
.comment-pin, button.comment-pin { position: absolute; width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0; border: 0;
  border-radius: 16px 16px 16px 3px; background: white; box-shadow: 0 2px 8px #29202e30; display: grid; place-items: center; z-index: 2; pointer-events: auto; touch-action: none; }
button.comment-pin:hover:not(:disabled):not([aria-disabled=true]) { background: white; }
.comment-initial, .comment-avatar { width: 24px; height: 24px; border-radius: 50%; color: white; font: 600 12px system-ui;
  display: grid; place-items: center; flex: none; }
.comment-pin.resolved { opacity: .55; }
.comment-pin.open { outline: 2px solid #7051cf; outline-offset: 1px; }
.comment-pin.new { pointer-events: none; }
.comment-pin.new > .comment-initial { background: #e9e2fb; color: #7051cf; }
.comment-pin.detached, button.comment-pin.detached:hover:not(:disabled):not([aria-disabled=true]) { background: #fff5da; box-shadow: 0 0 0 1.5px #936000 inset, 0 2px 8px #29202e30; }
.comment-badge { position: absolute; right: -6px; top: -6px; width: 18px; height: 18px; border-radius: 50%; background: #936000; color: white; display: grid; place-items: center; }
.comment-composer { position: absolute; z-index: 4; width: 300px; }
.comment-composer-row { display: flex; align-items: center; gap: 8px; width: 100%; background: white; border: 1.5px solid #7051cf; border-radius: 22px;
  padding: 4px 4px 4px 14px; box-shadow: 0 2px 8px #29202e20; }
.comment-composer textarea, .comment-card textarea { width: 100%; min-width: 0; min-height: 24px; max-height: 120px; resize: none; border: 0; border-radius: 0;
  padding: 2px 0; background: transparent; font: 14px/1.45 system-ui; color: #29272e; outline: none; box-shadow: none; overflow-y: auto; }
.comment-composer textarea:focus-visible, .comment-card textarea:focus-visible { outline: none; box-shadow: none; }
.comment-composer textarea::placeholder, .comment-card textarea::placeholder { color: #79737f; opacity: 1; }
.comment-composer-row > textarea, .comment-reply > textarea { flex: 1; }
button.comment-post { width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0; border: 0; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: #7051cf; color: white; }
button.comment-post:hover:not(:disabled):not([aria-disabled=true]) { background: #7051cf; }
button.comment-post:disabled { background: #e8e7ed; color: #79737f; opacity: 1; }
.comment-card { position: absolute; z-index: 4; width: 320px; background: white; border: 1px solid #e9e7ed; border-radius: 12px;
  box-shadow: 0 2px 8px #29202e20; font-size: 14px; overflow: auto; }
.comment-card-head, .comment-panel-head { display: flex; align-items: center; gap: 2px; padding: 6px 6px 6px 14px; border-bottom: 1px solid #e9e7ed; }
.comment-card-head > .comment-title { flex: 1; font-size: 13px; font-weight: 700; }
.comment-panel-head > .comment-title { flex: 1; font-size: 14px; font-weight: 700; }
button.comment-icon { width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0; border: 0; background: transparent;
  display: grid; place-items: center; color: #3b3a40; border-radius: 8px; flex: none; }
button.comment-icon:hover:not(:disabled):not([aria-disabled=true]) { background: #f1eff5; }
button.comment-icon.active, button.comment-icon.active:hover:not(:disabled):not([aria-disabled=true]), button.comment-icon.active:focus { background: #e9e2fb; color: #7051cf; }
.comment-row { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) 32px; gap: 0 10px; padding: 10px 6px 4px 14px; align-items: center; }
.comment-who { font-size: 13px; }
.comment-who .comment-name { font-weight: 600; }
.comment-who .comment-time { color: #79737f; font-size: 12px; margin-left: 6px; }
.comment-row .comment-text { grid-column: 2 / 4; margin: 2px 0 6px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-row button.comment-icon { width: 28px; height: 28px; min-width: 28px; min-height: 28px; }
.comment-reply { display: flex; align-items: flex-end; gap: 8px; margin: 6px 10px 10px; padding: 6px 6px 6px 12px;
  border: 1px solid #e8e7ed; border-radius: 10px; min-height: 44px; }
.comment-reply > textarea { align-self: center; }
.comment-reply:focus-within { border-color: #7051cf; box-shadow: 0 0 0 1px #7051cf; }
.comment-card textarea.comment-edit-field { border: 1px solid #7051cf; border-radius: 8px; padding: 6px 8px; }
.comment-unposted { margin: 0 10px 10px; }
.comment-edit-actions { display: flex; gap: 8px; margin-top: 6px; }
.comment-note { margin: 0 10px 10px; padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4; }
.comment-note.amber { color: #936000; background: #fff5da; }
.comment-note.error, .comment-toast.error { color: #a32940; background: #fdf0f2; border: 1px solid #f2cdd5; }
.comment-note.neutral { color: #79737f; background: #f5f4f7; }
.comment-gone { margin: 10px; }
.comment-length { color: #a32940; font-size: 13px; margin: 0 10px 10px; }
.comment-detached-line { display: flex; gap: 6px; align-items: center; margin: 10px 10px 0; padding: 8px 10px; border-radius: 8px;
  color: #936000; background: #fff5da; font-size: 13px; line-height: 1.35; }
.comment-detached-line svg, .comment-detached svg, .comment-empty svg { flex: none; }
.comment-panel { position: absolute; z-index: 3; top: 72px; right: 12px; width: 296px; bottom: 80px; background: white;
  border: 1px solid #e9e7ed; border-radius: 12px; box-shadow: 0 2px 8px #29202e0a; display: flex; flex-direction: column; overflow: hidden; }
.comment-panel-head { flex: none; }
.comment-list { overflow: auto; }
.comment-empty { display: flex; align-items: flex-start; gap: 10px; padding: 16px 14px; color: #79737f; font-size: 13px; line-height: 1.45; }
button.comment-item { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 2px 10px; width: 100%; min-width: 0; min-height: 0;
  padding: 12px 14px; border: 0; border-bottom: 1px solid #f0eff3; border-radius: 0; background: white; color: #29272e; font-size: 13px; text-align: left; }
button.comment-item:hover:not(:disabled):not([aria-disabled=true]), button.comment-item.current { background: #f5f0ff; }
button.comment-item.current { box-shadow: inset 3px 0 0 #7051cf; }
.comment-item .comment-name { font-weight: 700; }
.comment-item .comment-time { color: #79737f; font-size: 12px; }
.comment-item .comment-text { margin: 0; grid-column: 2; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-item .comment-on { grid-column: 2; color: #79737f; font-size: 12px; }
.comment-item .comment-count { grid-column: 2; color: #7051cf; font-size: 12px; font-weight: 600; }
.comment-item .comment-detached { grid-column: 2; color: #936000; font-size: 12px; display: flex; gap: 4px; align-items: center; }
.comment-menu { position: absolute; z-index: 6; background: #302d36; color: white; border-radius: 12px; padding: 6px;
  box-shadow: 0 2px 8px #29202e20; min-width: 190px; }
.comment-menu button { display: flex; gap: 8px; align-items: center; width: 100%; min-width: 0; min-height: 0; padding: 8px 10px;
  border: 0; border-radius: 8px; background: transparent; color: white; font-size: 13px; text-align: left; }
.comment-menu button:hover:not(:disabled):not([aria-disabled=true]), .comment-menu button:focus { background: #7051cf; outline: 0; }
.comment-tick { width: 14px; flex: none; }
.comment-toast { display: flex; align-items: center; gap: 12px; }
.comment-toast button, .comment-note button { min-height: 28px; padding: 2px 10px; }
.comment-note button { margin-left: 12px; }
.comment-question { width: min(420px, calc(100vw - 24px)); }
button.comment-destructive, button.comment-destructive:hover:not(:disabled):not([aria-disabled=true]) { background: #a32940; color: white; }
@media (max-width: 767.98px) {
  .comment-panel { position: fixed; top: auto; left: 12px; right: 12px; bottom: 80px; width: auto; height: min(42dvh, 320px); }
  .comment-card, .comment-composer { z-index: 5; max-width: calc(100% - 24px); }
}

.home-import { display: flex; align-items: center; gap: 6px; }
@media (max-width: 599.98px) {
  .home-import { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .home-import span { display: none; }
  .home-import, .home .home-new-board { flex-shrink: 0; white-space: nowrap; }
  .home-topbar h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.w2-editor { width:100%; min-width:0; min-height:24px; max-height:120px; overflow:auto; flex:1; align-self:center; font:14px/1.45 system-ui; color:#29272e; white-space:pre-wrap; overflow-wrap:anywhere; outline:none; }
.w2-mention { color:#2563eb; background:transparent; border:0; padding:0; border-radius:0; font:inherit; }
.w2-caret { display:inline-block; height:16px; width:1px; background:#29272e; vertical-align:-3px; }
.w2-picker { position:fixed; width:300px; max-width:calc(100vw - 24px); z-index:7; background:white; border:1px solid #e9e7ed; border-radius:8px; box-shadow:0 2px 8px #29202e20; overflow:hidden; font:13px system-ui; color:#29272e; }
.w2-picker-label { padding:10px 12px 6px; font-size:12px; color:#79737f; }
.w2-options { max-height:200px; overflow:auto; padding:4px 6px; }
.w2-option { display:flex; align-items:center; gap:10px; min-height:40px; padding:6px 8px; border-radius:6px; }
.w2-option[aria-selected=true] { color:#7051cf; background:#f5f0ff; }
.w2-option small { color:#79737f; font-size:12px; margin-left:auto; font-variant-numeric:tabular-nums; }
.w2-picker-foot { padding:6px; border-top:1px solid #e9e7ed; }
.w2-picker-foot button { width:100%; min-height:32px; font-size:13px; }
.w2-picker-keys { padding:6px 12px 10px; font-size:12px; color:#79737f; line-height:1.4; }
.w2-picker-state { padding:16px 12px; color:#79737f; font-size:13px; line-height:1.45; }
.w2-picker-state.error { color:#a32940; }
.w2-picker-state button { margin-top:10px; min-height:32px; }
.w2-account-row { display:flex; align-items:center; gap:4px; min-height:44px; flex-shrink:0; margin-bottom:8px; }
.w2-account-row .home-account { flex:1; width:0; min-width:0; margin-bottom:0; }
button.w2-bell { position:relative; flex:none; display:grid; place-items:center; width:40px; height:40px; min-width:40px; min-height:40px; padding:0; border:0; border-radius:8px; background:transparent; color:#3b3a40; }
button.w2-bell[aria-expanded=true] { color:#7051cf; background:#e9e2fb; }
.w2-bell-dot { position:absolute; top:7px; right:7px; width:8px; height:8px; border-radius:50%; background:#dc2626; border:2px solid white; box-sizing:content-box; }
.w2-inbox { position:fixed; left:12px; top:62px; width:400px; max-width:calc(100vw - 24px); max-height:calc(100dvh - 74px); z-index:6; border:1px solid #e9e7ed; border-radius:12px; background:white; box-shadow:0 2px 8px #29202e20; overflow:auto; font:14px system-ui; color:#29272e; }
.w2-inbox-head { display:flex; align-items:center; gap:6px; padding:6px 6px 6px 14px; border-bottom:1px solid #e9e7ed; }
.w2-inbox-head strong { flex:1; font-size:14px; font-weight:700; }
.w2-mark-all { min-height:32px; min-width:0; padding:4px 6px; border:0; background:transparent; color:#7051cf; font-size:12px; white-space:nowrap; }
.w2-limit { padding:8px 14px; font-size:12px; color:#79737f; border-bottom:1px solid #f0eff3; }
.w2-notice { position:relative; display:grid; grid-template-columns:24px minmax(0,1fr) 32px; gap:0 10px; align-items:start; padding:14px; border-bottom:1px solid #f0eff3; }
.w2-notice.unread { background:#f5f0ff; }
.w2-notice .comment-avatar { margin-top:2px; }
.w2-notice-open { display:block; min-width:0; min-height:0; padding:0; border:0; border-radius:0; background:transparent; color:inherit; text-align:left; font:13px/1.45 system-ui; }
.w2-notice-open:hover { background:transparent !important; }
.w2-notice-open strong { font-weight:600; }
.w2-notice-open small { display:block; font-size:12px; color:#79737f; margin-top:4px; }
.w2-preview { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin-top:6px; font-size:14px; line-height:1.45; }
.w2-unread-dot { display:inline-block; width:6px; height:6px; margin-left:6px; border-radius:50%; background:#2563eb; vertical-align:1px; }
.w2-notice-status { grid-column:2 / 4; margin-top:8px; padding:8px 10px; border-radius:8px; background:#fff5da; color:#936000; font-size:13px; line-height:1.4; }
.w2-notice-status button { min-height:28px; padding:2px 10px; margin-left:8px; }
.w2-inbox-state { display:flex; flex-direction:column; align-items:center; gap:8px; padding:40px 20px; text-align:center; color:#79737f; line-height:1.5; }
.w2-inbox-state strong { font-size:14px; color:#29272e; }
.w2-inbox-state.error strong { color:#a32940; }
.w2-inbox-state p { margin:0; max-width:300px; font-size:13px; }
.w2-action-menu { z-index:8; }
.w2-target { border-left:3px solid #7051cf; background:#f5f0ff; padding-left:11px; }
.comment-title.w2-heading:focus { outline:3px solid #7051cf; outline-offset:3px; border-radius:2px; }
.w2-unread-line { grid-column:2; color:#2563eb; font-size:12px; font-weight:600; }
.w2-sort-label { padding:6px 10px 4px; font-size:12px; color:#b9b6c3; }
.w2-filter-menu { position:fixed; right:20px; top:118px; }
.w2-short-note { margin:10px 10px 0; }
@media (max-width:599.98px) { .w2-inbox { width:calc(100vw - 24px); } .w2-action-menu { left:auto; right:20px; } }

.w2-editor:empty::before { content: attr(data-placeholder); color:#79737f; pointer-events:none; }
.comment-card div.comment-edit-field { border:1px solid #7051cf; border-radius:8px; padding:6px 8px; }
.w2-option { cursor:pointer; }

/* Hosted document history (interaction v33). */
.history-limit { padding:8px 14px; border-bottom:1px solid #f0eff3; font-size:12px; line-height:1.45; color:#79737f; }
.history-actions { padding:10px 14px; border-bottom:1px solid #e9e7ed; }
.history-actions button { width:100%; }
.history-list { overflow:auto; }
.history-row { display:grid; grid-template-columns:minmax(0,1fr) 32px; gap:4px 6px; width:100%; min-width:0; padding:12px 14px; border:0; border-bottom:1px solid #f0eff3; border-radius:0; background:white; text-align:left; font-size:13px; line-height:1.45; }
.history-row.current { background:#f5f0ff; color:#7051cf; box-shadow:inset 3px 0 #7051cf; }
.history-row strong { font-weight:600; }
.history-row small { grid-column:1; font-size:12px; color:#79737f; }
.history-row .comment-icon { grid-column:2; grid-row:1 / 4; }
.history-footer { padding:12px 14px; border-top:1px solid #e9e7ed; margin-top:auto; display:flex; flex-direction:column; gap:8px; }
.history-footer p { margin:0; color:#79737f; font-size:12px; line-height:1.45; }
.history-state { display:flex; flex-direction:column; align-items:center; gap:8px; padding:40px 20px; text-align:center; color:#79737f; font-size:13px; line-height:1.5; }
.history-state strong { color:#29272e; font-size:14px; }
.history-state.error strong { color:#a32940; }
.history-state p { margin:0; }
.history-banner { position:absolute; top:72px; left:12px; right:320px; z-index:4; display:flex; align-items:center; gap:12px; padding:12px; background:white; border:1px solid #e9e7ed; border-radius:12px; box-shadow:0 2px 8px #29202e20; font:13px/1.45 system-ui; }
.history-banner .history-summary { flex:1; min-width:0; }
.history-banner strong,.history-banner small { display:block; }
.history-banner small { color:#79737f; font-size:12px; }
.history-banner.amber { background:#fff5da; color:#936000; }
.history-banner.wide { right:12px; }
.history-dialog { width:min(420px,calc(100vw - 24px)); }
.history-dialog p { line-height:1.5; }
.history-dialog label { display:block; margin:12px 0 6px; font-weight:600; font-size:13px; }
.history-field { display:block; width:100%; min-height:40px; padding:8px 12px; border:1px solid #e8e7ed; border-radius:8px; background:white; }
textarea.history-field { height:96px; resize:none; }
.history-count { display:block; margin-top:4px; color:#79737f; font-size:12px; text-align:right; }
.history-dialog .comment-note { margin:12px 0; }
.history-unposted { margin:0 10px 10px; }
.history-focus { outline:3px solid #7051cf; outline-offset:3px; }
@media(max-width:767.98px) {
 .history-banner { top:124px; right:12px; align-items:stretch; flex-direction:column; gap:8px; }
 .history-banner button { align-self:flex-start; }
}

.history-shell { position:absolute; z-index:3; top:72px; right:12px; bottom:80px; width:296px; background:white; border:1px solid #e9e7ed; border-radius:12px; box-shadow:0 2px 8px #29202e0a; overflow:hidden; display:flex; flex-direction:column; }
.history-header { display:flex; align-items:center; gap:2px; padding:6px 6px 6px 14px; border-bottom:1px solid #e9e7ed; flex:none; }
.history-header h2 { flex:1; font-size:14px; font-weight:700; margin:0; }
.history-limit,.history-actions,.history-footer { flex:none; }
.history-open { display:flex; flex-direction:column; gap:4px; min-width:0; min-height:0; padding:0; border:0; border-radius:0; background:transparent; color:inherit; font:inherit; text-align:inherit; }
.history-open:hover:not(:disabled):not([aria-disabled=true]) { background:transparent; }
.history-dialog-actions { display:flex; justify-content:flex-end; gap:8px; }
.history-version-menu { z-index:8; }
.history-shell :focus-visible,.history-banner :focus-visible,.history-dialog :focus-visible { outline:3px solid #7051cf; outline-offset:3px; }
.history-denied { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:min(420px,calc(100vw - 24px)); padding:24px; border:1px solid #e9e7ed; border-radius:12px; background:white; text-align:center; }
.history-denied h1 { font-size:20px; }
.history-denied p { line-height:1.5; }
@media(max-width:767.98px) {
 .history-shell { position:fixed; top:auto; left:12px; right:12px; bottom:80px; width:auto; height:min(42dvh,320px); }
}

.history-ending { position:fixed; inset:0; background-color:#fafafa; background-image:radial-gradient(#ddd 1px,transparent 1px); background-size:24px 24px; }

/* Workspace Trash and lifecycle controls (interaction v34). */
.w4-sidebar-slot { flex:none; width:20px; height:20px; }
button.w4-danger { color:#a32940; }
button.w4-destructive,button.w4-destructive:hover:not(:disabled):not([aria-disabled=true]) { color:#fff; background:#a32940; border-color:#a32940; }
.w4-title { display:flex; align-items:center; gap:10px; margin-bottom:20px; }
.w4-title h2 { margin:0; font-size:24px; font-weight:600; }
.w4-title .home-chip { margin-left:0; }
.home .w4-explain { padding:12px; margin:0 0 16px; background:#f3f0f8; border:1px solid #e9e7ed; border-radius:8px; font:13px/1.5 system-ui; color:#45434d; }
.w4-list { display:flex; flex-direction:column; gap:12px; }
.w4-row { display:grid; grid-template-columns:minmax(0,1fr) max-content; align-items:center; gap:16px; padding:16px; border:1px solid #e9e7ed; border-radius:12px; background:#fff; box-shadow:0 2px 8px #29202e0a; }
.w4-meta { min-width:0; display:flex; flex-direction:column; gap:4px; font:13px/1.5 system-ui; }
.w4-meta strong { font-size:14px; font-weight:600; }
.w4-meta small { font-size:12px; color:#79737f; overflow-wrap:anywhere; }
.w4-row-actions { display:flex; flex-wrap:wrap; gap:8px; }
.w4-message,.w4-success { padding:12px; border:1px solid #e9e7ed; border-radius:8px; font:13px/1.5 system-ui; }
.w4-message { background:#fff5da; color:#936000; }
.w4-success { background:#fff; color:#29272e; }
.home .w4-row-state { grid-column:1 / -1; margin:0; }
.w4-state { display:flex; flex-direction:column; align-items:center; gap:8px; padding:40px 20px; text-align:center; font:13px/1.5 system-ui; color:#79737f; }
.w4-state strong { font:700 14px/21px system-ui; color:#29272e; }
.w4-state.error strong { color:#a32940; }
.home .w4-state p { margin:0; }
.w4-state button { font:400 13px/19.5px system-ui; color:#79737f; }
.w4-modal { max-height:calc(100dvh - 100px); overflow:auto; padding:24px; border:1px solid #e9e7ed; border-radius:12px; background:#fff; }
.w4-modal::backdrop { background:#29272e66; }
.w4-modal h1 { font-size:20px; font-weight:700; margin:0 0 12px; }
.home .w4-modal p,.w4-modal p { margin:14px 0; font-size:14px; line-height:1.5; }
.home .w4-modal .comment-note,.w4-modal .comment-note { margin:12px 0; padding:8px 10px; font:13px/1.4 system-ui; border:1px solid #e9e7ed; border-radius:8px; }
.w4-modal .comment-note.error { border-color:#f2cdd5; color:#a32940; background:#fdf0f2; }
.w4-modal .comment-note.amber { color:#936000; background:#fff5da; }
.w4-title h2:focus,.w4-state strong:focus,.history-denied h1:focus,.w4-modal:focus,.home-toast:focus { outline:3px solid #7051cf; outline-offset:3px; }
.w4-end-status { font:13px/1.5 system-ui; color:#79737f; }
@media(max-width:599.98px) {
  .w4-title { flex-wrap:wrap; gap:8px; }
  .w4-row { grid-template-columns:minmax(0,1fr); gap:12px; padding:12px; }
  .w4-row-actions { flex-direction:column; }
  .w4-row-actions button { width:100%; }
  .home .w4-explain { padding:10px; }
  .w4-state { padding:24px 10px; }
}

/* Shared workshop timer; all overrides stay within the timer slot. */
button.w1-trigger { flex:none; width:98px; min-width:98px; height:40px; min-height:40px; padding:0; display:inline-flex; align-items:center; justify-content:center; gap:8px; background:#fff; color:#79737f; font:12px system-ui; font-variant-numeric:tabular-nums; border:1px solid #e8e7ed; border-radius:8px; }
button.w1-trigger.active { width:62px; min-width:62px; background:#f5f0ff; color:#7051cf; }
button.w1-trigger.paused,button.w1-trigger.uncertain { color:#79737f; }
.w1-panel { position:fixed; right:12px; width:240px; max-width:calc(100vw - 24px); max-height:calc(100dvh - var(--w1-top) - 12px); top:var(--w1-top); overflow:auto; z-index:4; display:flex; flex-direction:column; gap:8px; padding:12px; background:#fff; border:1px solid #e9e7ed; border-radius:12px; box-shadow:0 2px 8px #29202e0a; color:#29272e; font:13px/1.5 system-ui; }
.w1-head { display:flex; align-items:center; justify-content:space-between; gap:8px; height:40px; flex:none; }
.w1-head h2,.w1-panel h3 { margin:0; font:600 13px/1.5 system-ui; }
.w1-panel button.w1-close { position:absolute; top:12px; right:12px; display:grid; place-items:center; flex:none; width:40px; min-width:40px; height:40px; min-height:40px; padding:0; border:0; background:transparent; }
.w1-fields { display:grid; grid-template-columns:79px 16px 79px; gap:8px; justify-content:center; align-items:end; }
.w1-field-slot { display:contents; }
.w1-fields label { display:flex; flex-direction:column; gap:4px; font:12px/1.45 system-ui; color:#79737f; }
.w1-fields input { width:79px; height:68px; padding:0; border:1px solid #e9e7ed; border-radius:8px; background:white; color:#29272e; font:48px/1 system-ui; font-variant-numeric:tabular-nums; text-align:center; }
.w1-fields .w1-colon { display:grid; place-items:center; height:68px; font:48px/1 system-ui; color:#79737f; }
.w1-panel.paused .w1-fields input,.w1-panel.uncertain .w1-fields input { color:#79737f; }
.w1-row { display:flex; justify-content:center; align-items:center; gap:8px; }
.w1-panel button.w1-hit { display:grid; place-items:center; width:40px; min-width:40px; height:40px; min-height:40px; padding:0; border:0; background:transparent; border-radius:8px; }
.w1-disc { display:grid; place-items:center; width:33px; height:33px; border-radius:50%; background:#fff; border:1px solid #e8e7ed; color:#29272e; }
.w1-hit.primary .w1-disc { background:#7051cf; color:#fff; border:0; }
.w1-panel button.w1-add { width:68px; min-width:68px; height:40px; min-height:40px; padding:0; border:0; background:transparent; border-radius:8px; font:12px system-ui; }
.w1-add span { display:grid; place-items:center; width:68px; height:24px; border:1px solid #e8e7ed; border-radius:8px; background:#fff; }
.w1-panel button:hover:not(:disabled) { background:#f1eff5; }
.w1-panel .w1-hit:hover:not(:disabled) .w1-disc,.w1-add:hover:not(:disabled) span { background:#f1eff5; }
.w1-panel .w1-hit.primary:hover:not(:disabled) .w1-disc { background:#6142be; }
.w1-panel button:disabled { opacity:.45; }
.w1-panel :focus-visible,.w1-trigger:focus-visible { outline:3px solid #7051cf; outline-offset:3px; }
.w1-panel p.w1-status { margin:0; font:12px/1.45 system-ui; color:#79737f; text-align:center; overflow-wrap:anywhere; }
.w1-panel p.w1-confirm-copy { margin:0; font:13px/1.5 system-ui; }
.w1-confirm-row { display:flex; justify-content:flex-end; gap:8px; }
.w1-confirm-row button { min-height:40px; padding:8px 12px; font:13px/1.5 system-ui; white-space:nowrap; border:1px solid #e8e7ed; border-radius:8px; }
.w1-confirm-row .primary { background:#7051cf; border-color:#7051cf; color:#fff; }
.w1-confirm-row .primary:hover:not(:disabled) { background:#6142be; }
.w1-shake { animation:w1-zero 300ms linear 1; }
@keyframes w1-zero { 0%,100% { transform:translateX(0); } 25%,75% { transform:translateX(2px); } 50% { transform:translateX(-2px); } }
@media (prefers-reduced-motion:reduce) { .w1-shake { animation:none; } }

/* Voting shares the workshop surface; Timer keeps its own control treatments. */
.w1-panel > * { flex-shrink:0; }
.vote-card { display:flex; flex-direction:column; gap:8px; min-width:0; }
.vote-separator { height:1px; background:#e9e7ed; width:100%; }
.w1-panel .timer-label,.vote-card h3 { margin:0; font:600 13px/1.5 system-ui; }
.w1-panel .vote-card p { margin:0; font:13px/1.5 system-ui; overflow-wrap:anywhere; }
.w1-panel .vote-card .vote-status,.vote-label,.vote-counter { font:12px/1.45 system-ui; color:#79737f; }
.vote-card button,.vote-strip button { min-height:40px; padding:8px 12px; border:1px solid #e8e7ed; border-radius:8px; font:13px/1.5 system-ui; background:#fff; color:#29272e; }
.w1-panel .vote-card button.primary { background:#7051cf; color:#fff; border-color:#7051cf; }
.w1-panel .vote-card button.primary:hover:not(:disabled) { background:#6142be; }
.vote-card button:hover:not(:disabled),.vote-strip button:hover:not(:disabled) { background:#f1eff5; }
.vote-card button:disabled,.vote-strip button:disabled { opacity:.45; }
.vote-card :focus-visible,.vote-strip :focus-visible { outline:3px solid #7051cf; outline-offset:3px; }
.vote-label { display:flex; flex-direction:column; gap:4px; }
.vote-card textarea,.vote-card select { font:13px/1.5 system-ui; border:1px solid #e8e7ed; border-radius:8px; padding:8px 12px; width:100%; min-width:0; background:#fff; color:#29272e; }
.vote-card textarea { height:96px; min-height:96px; resize:none; }
.vote-card select { height:40px; }
.vote-counter { text-align:right; }
.vote-stepper { display:grid; grid-template-columns:40px 1fr 40px; gap:8px; align-items:center; }
.vote-stepper button { padding:0; width:40px; height:40px; }
.vote-stepper output { text-align:center; font-variant-numeric:tabular-nums; }
.vote-buttons { display:flex; gap:8px; }
.vote-buttons button { flex:1 1 auto; min-width:0; }
.vote-confirm { display:flex; flex-direction:column; gap:8px; }
.vote-confirm .vote-buttons { justify-content:flex-end; }
.vote-confirm .vote-buttons button { flex:0 0 auto; }
.vote-results { display:flex; flex-direction:column; gap:8px; max-height:280px; overflow:auto; }
.vote-result { display:flex; align-items:center; gap:8px; min-height:40px; padding:0; border:0; background:transparent; text-align:left; }
.vote-result button { flex:1; min-width:0; padding:8px 0; border:0; text-align:left; background:transparent; }
.vote-result .result-label { flex:1; min-width:0; font:13px/1.5 system-ui; overflow-wrap:anywhere; }
.vote-result .missing { color:#79737f; }
.vote-count { display:grid; place-items:center; min-width:24px; height:24px; padding:0 6px; border-radius:12px; background:#7051cf; color:#fff; font:12px/1.45 system-ui; font-variant-numeric:tabular-nums; flex:none; }
.vote-strip { position:fixed; z-index:3; left:12px; display:flex; align-items:center; flex-wrap:wrap; gap:8px; max-width:calc(100vw - 24px); padding:8px 12px; border:1px solid #e9e7ed; border-radius:12px; box-shadow:0 2px 8px #29202e0a; background:#fff; color:#29272e; font:13px/1.5 system-ui; }
.vote-dot { position:fixed; width:12px; height:12px; border:2px solid white; border-radius:50%; z-index:2; pointer-events:none; }
.vote-badge { position:fixed; z-index:2; pointer-events:none; }
.vote-hover { position:fixed; outline:2px solid #7051cf; z-index:1; pointer-events:none; }
main:has(> .vote-hover) > .scene > .resize-handle { z-index:2; }
.vote-tooltip { position:fixed; z-index:3; padding:4px 8px; border:1px solid #e9e7ed; border-radius:8px; background:#fff; color:#29272e; font:12px/1.45 system-ui; pointer-events:none; }
.vote-tooltip.ineligible { color:#79737f; }
@media(max-width:599.98px) {
  .vote-strip { width:calc(100vw - 24px); }
  .vote-strip button { flex-basis:100%; }
  .vote-strip.vote-panel-open button { width:100%; min-width:0; white-space:normal; padding:8px 4px; }
}

/* Spotlight (0007-W3): one shared banner for ordinary and workshop Follow. */
.presence-follow-banner.spotlight-banner {
  position: fixed; left: 12px; transform: none; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  border: 1px solid #e9e7ed; border-radius: 12px; padding: 8px 12px;
  background: #fff; color: #29272e; font: 400 13px/1.5 system-ui;
  box-shadow: inset 0 3px 0 var(--spotlight-colour), 0 2px 8px #29202e0a;
  overflow: auto;
}
.spotlight-banner > .spotlight-status { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; white-space: normal; overflow: visible; text-overflow: clip; }
.spotlight-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; max-width: 100%; }
.spotlight-banner .spotlight-actions button { white-space: normal; min-height: 40px; padding: 8px 12px; border-radius: 8px; border: 1px solid #e8e7ed; background: #fff; color: #29272e; font: inherit; }
.spotlight-banner .spotlight-actions button:hover:not(:disabled) { background: #f1eff5; }
.spotlight-banner .spotlight-actions .spotlight-primary, .presence-menu button.spotlight-primary { background: #7051cf; border: 1px solid #7051cf; color: #fff; }
.spotlight-banner .spotlight-actions .spotlight-primary:hover:not(:disabled), .presence-menu button.spotlight-primary:hover:not(:disabled) { background: #6142be; }
.spotlight-banner .spotlight-actions button:disabled, .presence-menu button:disabled { opacity: .45; }
.spotlight-banner .spotlight-actions button:focus-visible, .presence-menu button.spotlight-primary:focus-visible { outline: 3px solid #7051cf; outline-offset: 3px; }
.spotlight-banner .spotlight-actions .spotlight-dismiss { width: 40px; height: 40px; min-width: 40px; padding: 0; }
.spotlight-frame { pointer-events: none; }
.presence-menu button.spotlight-primary { border: 0; font: 400 13px/1.5 system-ui; min-height: 40px; padding: 8px 12px; border-radius: 8px; text-align: center; }
.presence-menu .spotlight-disabled-reason { margin: 4px 8px; font: 12px/1.45 system-ui; color: #b9b6c3; overflow-wrap: anywhere; }
@media (max-width: 599.98px) {
  .spotlight-banner > .spotlight-status, .spotlight-banner .spotlight-actions { width: 100%; }
  .spotlight-banner > .spotlight-status { flex-basis: 100%; }
}

.presence-menu .presence-person:disabled .presence-follow-word { visibility: visible; }
.presence-menu button.spotlight-primary:disabled:hover { background: #7051cf; }

/* Workshop reactions (interaction v38). Existing surfaces keep their stacking. */
.reactions-wheel { position: fixed; z-index: 20; width: 224px; height: 224px; box-sizing: border-box; border-radius: 50%; background: #fff; border: 1px solid #e9e7ed; box-shadow: 0 6px 20px #29202e1f; }
.reactions-slot { position: absolute; width: 48px; height: 48px; min-height: 0; border-radius: 50%; border: 0; padding: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
.reactions-slot[aria-checked=true] { background: #ece7fb; }
.reactions-slot:hover, .reactions-centre:hover { background: #f1eff5; }
.reactions-slot:focus-visible, .reactions-centre:focus-visible { outline: 3px solid #7051cf; outline-offset: 3px; }
.reactions-slot > svg { width: 30px; height: 30px; }
.reactions-label { position: absolute; left: 50%; top: -30px; transform: translateX(-50%); background: #302d36; color: #fff; font-size: 12px; line-height: 1.35; padding: 4px 8px; border-radius: 4px; white-space: nowrap; pointer-events: none; visibility: hidden; }
.reactions-slot:hover .reactions-label, .reactions-slot:focus-visible .reactions-label { visibility: visible; }
.reactions-centre { position: absolute; left: 80px; top: 80px; width: 64px; height: 64px; min-height: 0; border-radius: 50%; border: 1px solid #e9e7ed; background: #faf9fc; display: flex; align-items: center; justify-content: center; padding: 0; }
.reaction-burst { position: absolute; inset: 0; pointer-events: none; }
.reaction-copy, .reaction-pointer { position: absolute; pointer-events: none; filter: drop-shadow(0 1px 2px #29202e33); }
.reaction-pointer { width: 24px; height: 24px; }
.reaction-copy svg, .reaction-pointer svg { width: 100%; height: 100%; display: block; }

/* Team template controls leave the local Templates panel unchanged. */
.team-template-head { display: flex; align-items: center; gap: 8px; margin: 16px 0 12px; height: 32px; }
.team-template-head h3 { margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-template-count { font-size: 12px; color: #6b6772; white-space: nowrap; }
.team-template-save { min-height: 32px; padding: 5px 10px; font-size: 12px; white-space: nowrap; }
.team-template-status { font-size: 12px; color: #6b6772; margin: 0 0 4px; line-height: 1.5; }
.team-template-by { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #6b6772; }
.team-template-new .template-preview { box-shadow: 0 0 0 2px #7051cf; }
.team-template-more { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; min-width: 28px; min-height: 28px;
  padding: 0; border-radius: 6px; display: flex; align-items: center; justify-content: center; background: white; border: 1px solid #e9e7ed; color: #3b3a40; }
.team-template-more svg { width: 16px; height: 16px; }
.team-template-more[aria-expanded=true], .team-template-more[aria-expanded=true]:hover { background: #e9e2fb; color: #7051cf; border-color: #e9e2fb; }
.team-template-menu { position: fixed; z-index: 60; width: 200px; padding: 6px; background: white; border: 1px solid #e9e7ed;
  border-radius: 10px; box-shadow: 0 6px 20px #29202e1f; }
.team-template-menu button { display: block; width: 100%; text-align: left; border: 0; min-height: 32px; height: 32px;
  padding: 6px 10px; font-size: 13px; border-radius: 6px; background: transparent; }
.team-template-menu button:hover, .team-template-menu button:focus { background: #f1eff5; }
.team-template-menu button:focus-visible { outline-offset: -3px; }
.team-template-menu hr { border: 0; border-top: 1px solid #e9e7ed; margin: 4px 0; }
.team-template-menu button.error { color: #a32940; }
.team-template-menu button.error:hover:not(:disabled), .team-template-menu button.error:focus { background: #f1eff5; }
.team-template-tip { position: fixed; z-index: 70; background: #302d36; color: white; font-size: 12px; line-height: 1.35;
  padding: 4px 8px; border-radius: 4px; max-width: min(240px, calc(100% - 16px)); pointer-events: none; overflow-wrap: anywhere; }
.team-template-dialog h2 { font-size: 20px; margin: 0 0 4px; }
.team-template-dialog .team-template-sub { font-size: 13px; color: #57535d; margin: 0; }
.team-template-dialog label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 13px; }
.team-template-dialog label span { font-weight: 400; color: #6b6772; }
.team-template-dialog input, .team-template-dialog textarea { width: 100%; border: 1px solid #d9d6df; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.team-template-dialog textarea { height: 120px; resize: none; }
.team-template-dialog .team-template-hint { font-size: 12px; color: #6b6772; margin: 4px 0 0; }
.team-template-dialog .team-template-error { font-size: 12px; color: #a32940; margin: 4px 0 0; }
.team-template-dialog .template-preview { margin-top: 14px; }
.team-template-dialog .team-template-what { font-size: 12px; color: #6b6772; margin: 8px 0 0; }
.team-template-dialog .board-question-actions { margin-top: 20px; }

/* Mind maps: add buttons, collapse badges and the node editor (interaction v40). */
.scene > .mind-map-add, .scene > .mind-map-badge { position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center;
  min-width: 0; min-height: 0; padding: 0; border-radius: 50%; background: white; pointer-events: auto; cursor: pointer; }
.scene > .mind-map-add { width: 22px; height: 22px; border: 1.5px solid #518de0; color: #518de0; }
.scene > .mind-map-badge { width: 20px; height: 20px; border: 1.5px solid #6b6b6b; color: #3b3a40; font: 600 11px/1 system-ui; }
.mind-map-add::before, .mind-map-badge::before { content: ""; position: absolute; left: 50%; top: 50%; width: 28px; height: 28px;
  transform: translate(-50%, -50%); border-radius: 50%; }
.scene > .mind-map-add:hover:not(:disabled), .scene > .mind-map-badge:hover:not(:disabled) { background: #eef4fd; }
.scene > .mind-map-add:active:not(:disabled), .scene > .mind-map-badge:active:not(:disabled) { background: #dce8fb; }
.scene > .mind-map-add:focus-visible, .scene > .mind-map-badge:focus-visible { outline: 2px solid #518de0; outline-offset: 2px; }
.mind-map-tip { position: absolute; left: 50%; top: calc(50% + 18px); transform: translateX(-50%); z-index: 5; visibility: hidden;
  pointer-events: none; background: #302d36; color: white; font: 12px/1.35 system-ui; padding: 4px 8px; border-radius: 4px; white-space: nowrap; }
.mind-map-add:hover .mind-map-tip, .mind-map-add:focus-visible .mind-map-tip { visibility: visible; }
.inline.node-editor:focus-within { outline: none; }
.inline.node-editor textarea { overflow: hidden; color: inherit; font-weight: inherit; }
.inline.node-editor textarea::placeholder { color: #79737f; opacity: 1; }

/* Drawing and layout controls. */
#shape-kind-popup { grid-template-columns: 1fr 1fr; width: 360px; gap: 2px; }
.tape-swatch { display: inline-block; width: 22px; height: 22px; border: 1px solid rgba(0,0,0,.15); border-radius: 5px; flex-shrink: 0; }
.context .tape-label, .context .tidy-label { color: white; font-size: 13px; font-weight: 600; padding: 0 8px; white-space: nowrap; }
.tape-control summary { padding: 0 6px; }
.tidy-grid { position: absolute; margin: -1px; border: 1.5px solid #518de0; pointer-events: none; box-sizing: border-box; }
.scene > .tidy-handle { position: absolute; z-index: 2; touch-action: none; pointer-events: auto; }
.tidy-handle.vertical { width: 20px; height: 28px; margin: -14px 0 0 -10px; cursor: ew-resize; }
.tidy-handle.horizontal { width: 28px; height: 20px; margin: -10px 0 0 -14px; cursor: ns-resize; }
.tidy-handle-line { position: absolute; background: #7051cf; pointer-events: none; }
.vertical .tidy-handle-line { width: 2px; height: 28px; left: 9px; top: 0; }
.horizontal .tidy-handle-line { height: 2px; width: 28px; top: 9px; left: 0; }
.dragging.vertical .tidy-handle-line { width: 3px; left: 8.5px; }
.dragging.horizontal .tidy-handle-line { height: 3px; top: 8.5px; }
.tidy-handle-circle { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 11px; height: 11px; box-sizing: border-box; border: 2px solid #7051cf; border-radius: 50%; background: white; pointer-events: none; }
.dragging .tidy-handle-circle { width: 14px; height: 14px; background: #7051cf; }
.tidy-spacing-label { position: absolute; left: 50%; top: calc(50% + 14px); transform: translateX(-50%); background: #7051cf; color: white; font-size: 12px; font-weight: 400; line-height: 1.35; border-radius: 4px; padding: 4px 8px; pointer-events: none; }
.context.tidy-bar { z-index: 6; }
.tidy-bar .tidy-field { display: inline-flex; align-items: center; gap: 6px; color: #d9d6de; font-size: 13px; padding: 0 6px; white-space: nowrap; }
.tidy-bar .tidy-field input { height: 28px; width: 42px; min-width: 34px; border: 1px solid #57525f; border-radius: 6px; color: white; font-size: 13px; text-align: center; padding: 0 6px; background: none; }
.context.tidy-bar .tidy-step { width: 24px; min-width: 24px; height: 28px; min-height: 28px; padding: 0; color: white; background: none; border: 0; font-size: 16px; }
.context.tidy-bar .tidy-cancel { color: white; background: none; border: 0; font-size: 13px; font-weight: 600; height: 32px; min-height: 32px; padding: 0 10px; border-radius: 6px; }
.context.tidy-bar .tidy-apply { color: white; background: #7051cf; border: 0; font-size: 13px; font-weight: 600; height: 30px; min-height: 30px; padding: 0 14px; border-radius: 6px; margin-left: 4px; }
.context.tidy-bar .tidy-apply:hover { color: white; background: #6142be; }
.context.tidy-bar .tidy-step:hover:not(:disabled), .context.tidy-bar .tidy-cancel:hover { background: #57525f; color: white; }

/* Find and navigation, interaction v42. Rings are in scene screen coordinates. */
.find-bar { right: 12px; top: 68px; width: 290px; padding: 3px 6px 3px 12px; z-index: 4; color: #29202e; line-height: 1.2; }
.find-bar:has(input:focus) { border-color: #7051cf; }
.find-row { display: grid; grid-template-columns: 18px minmax(0,1fr) auto 40px 40px 5px 40px; grid-template-rows: 40px; column-gap: 4px; row-gap: 2px; align-items: center; }
.find-search { display: flex; color: #6f6876; grid-column: 1; grid-row: 1; }
.find-row input { grid-column: 2; grid-row: 1; min-width: 0; width: 100%; border: 0; background: transparent; outline: none; padding: 0 4px; font-size: 14px; line-height: 1.2; }
.find-live { display: contents; }
.find-counter { grid-column: 3; grid-row: 1; font-size: 13px; color: #6f6876; font-variant-numeric: tabular-nums; white-space: nowrap; margin-right: 2px; }
.find-row > button { grid-row: 1; }
.find-row > button:nth-of-type(1) { grid-column: 4; }
.find-row > button:nth-of-type(2) { grid-column: 5; }
.find-row > button:nth-of-type(2) > svg { transform: rotate(180deg); }
.find-row > button:nth-of-type(3) { grid-column: 7; }
.find-divider { grid-column: 6; grid-row: 1; width: 1px; height: 20px; margin: 0 2px; background: #e9e7ed; }
.find-removed { grid-column: 2 / -1; grid-row: 2; padding: 0 0 3px 4px; font-size: 12px; color: #6f6876; overflow-wrap: anywhere; }
.find-bar .tooltip { bottom: auto; top: calc(100% + 8px); }
.find-bar button:last-child .tooltip { left: auto; right: 0; transform: none; }
.find-ring { position: absolute; pointer-events: none; border: 2px solid #fcc419; border-radius: 6px; }
.find-ring.current { border: 3px solid #f08c00; border-radius: 7px; box-shadow: 0 0 0 3px rgba(240,140,0,0.18); }
.navigation kbd { font: 12px/1.2 system-ui; color: #6f6876; }
.navigation .find-hint { margin-left: 6px; }
.navigation-fit { display: flex; gap: 8px; }
.navigation-fit button { flex: 1; min-width: 0; padding: 6px 4px; line-height: 1.2; }
.navigation-fit kbd { display: block; font-size: 11px; margin-top: 2px; }
.navigation h3 { font-size: 13px; font-weight: 600; margin: 6px 0 0; }
.navigation-sections { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.navigation-sections button { width: 100%; overflow-wrap: anywhere; }
.navigation-empty { margin: 0; font-size: 13px; color: #6f6876; }
.navigation-pan { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 767px) { .find-bar { left: 12px; right: 12px; width: calc(100% - 24px); } }

/* Pages: interaction v43. These tokens apply only to the new controls. */
:root {
  --np-surface: #ffffff; --np-sunken: #eef1f5; --np-ink: #1b2433;
  --np-muted: #525d6c; --np-line: #d9dfe7; --np-accent: #1665d8;
  --np-accent-soft: #dceafb; --np-critical: #a3302a;
  --np-popover: 0 12px 30px rgb(21 32 51 / 0.08);
  --np-font: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}
.pages-button:hover:not(:disabled):not([aria-disabled=true]) { background: var(--np-sunken); }
.pages-button.page-active:not(:disabled):not([aria-disabled=true]), .context .move-page-button.page-active:not(:disabled):not([aria-disabled=true]) { background: var(--np-accent-soft); color: var(--np-accent); }
.pages-panel, .page-menu {
  position: fixed; box-sizing: border-box; color: var(--np-ink); background: var(--np-surface);
  border: 1px solid var(--np-line); border-radius: 12px; box-shadow: var(--np-popover);
  font-family: var(--np-font);
}
.pages-panel { top: 68px; width: 240px; padding: 8px; max-height: 360px; z-index: 5; display: flex; flex-direction: column; }
.pages-panel header { display: flex; align-items: center; justify-content: space-between; height: 36px; flex-shrink: 0; padding-left: 8px; margin-bottom: 4px; }
.pages-panel h2 { margin: 0; font: 600 13px/1.25 var(--np-font); }
.pages-panel ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; max-height: 302px; }
.page-row { position: relative; display: flex; align-items: center; height: 36px; min-height: 36px; border-radius: 8px; padding: 0 2px 0 10px; }
.pages-panel button { border: 0; min-width: 0; min-height: 0; padding: 0; background: transparent; color: var(--np-ink); border-radius: 8px; }
.pages-panel .page-icon { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; }
.pages-panel .page-name { display: block; text-align: left; height: 36px; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 500 13px/1.25 var(--np-font); touch-action: none; }
.pages-panel .page-row button.page-name { background: transparent; }
.page-row.current { background: var(--np-accent-soft); }
.page-row.current .page-name { font-weight: 600; }
.page-row:not(.current):hover { background: var(--np-sunken); }
.pages-panel .page-icon:hover:not(:disabled):not([aria-disabled=true]) { background: var(--np-sunken); }
.pages-panel .page-icon:active:not(:disabled):not([aria-disabled=true]), .page-row:has(.page-name:active) { background: var(--np-line); }
.pages-panel .page-row.menu-open { background: var(--np-sunken); }
.pages-panel .page-row.menu-open .page-options:not(:disabled):not([aria-disabled=true]) { background: var(--np-line); }
.page-options { visibility: hidden; }
.page-row.current .page-options, .page-row:hover .page-options, .page-row:focus-within .page-options, .page-row.menu-open .page-options { visibility: visible; }
.pages-panel button:focus-visible, .page-menu button:focus-visible { outline: 3px solid var(--np-accent); outline-offset: 2px; }
.page-row:has(input) { padding: 0; }
.pages-panel input { width: 100%; height: 36px; padding: 0 10px; border: 2px solid var(--np-accent); border-radius: 8px; font: 500 13px var(--np-font); color: var(--np-ink); background: var(--np-surface); outline: none; box-sizing: border-box; }
.page-row.dragging { opacity: .5; pointer-events: none; }
.page-row.drop-before::before, .page-drop-end::before { content: ''; position: absolute; top: -2px; left: 0; right: 0; height: 2px; background: var(--np-accent); pointer-events: none; }
.page-drop-end { position: relative; height: 0; pointer-events: none; }
.page-menu { width: 220px; padding: 6px; z-index: 7; font: 400 14px/1.45 var(--np-font); }
.page-menu button, .context .page-menu button { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 0; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; font: inherit; color: var(--np-ink); }
.page-menu button > span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.page-menu button:hover:not(:disabled), .page-menu button:focus:not(:disabled), .context .page-menu button:hover:not(:disabled) { background: var(--np-sunken); color: var(--np-ink); }
.page-menu button:active:not(:disabled), .context .page-menu button:active:not(:disabled) { background: var(--np-line); }
.page-menu button:disabled, .context .page-menu button:disabled { opacity: 1; color: var(--np-muted); background: transparent; }
.page-menu button.page-danger:not(:disabled) { color: var(--np-critical); }
.page-menu [role=separator] { height: 1px; background: var(--np-line); margin: 6px 4px; }
.page-menu-heading { font: 600 12px/1.4 var(--np-font); color: var(--np-muted); padding: 6px 10px 4px; }
.page-menu small, .context .page-menu small { font: 500 12px var(--np-font); color: var(--np-muted); white-space: nowrap; }
.context:has(.move-page-menu) { z-index: 6; }
.move-page-control { display: inline-flex; }
@media (max-width: 767px) { .pages-panel { left: 12px !important; right: 12px; width: auto; } }
