:root {
  --font-ui: "Consolas", "Courier New", monospace;
  --bg: #ffffff;
  --dot: rgba(0, 0, 0, 0.06);
  --panel: rgba(0, 0, 0, 0.01);
  --line: rgba(0, 0, 0, 0.045);
  --line-soft: rgba(0, 0, 0, 0.02);
  --text: rgba(28, 28, 28, 0.56);
  --text-dim: rgba(28, 28, 28, 0.22);
  --knot-bg: rgba(120, 120, 120, 0.08);
  --knot-bg-hover: rgba(120, 120, 120, 0.12);
  --red: #ff0000;
  --red-soft: rgba(255, 0, 0, 0.68);
  --port-bg: rgba(255, 0, 0, 0.06);
  --edge: rgba(110, 110, 110, 0.14);
  --tray-bg: rgba(0, 0, 0, 0.008);
  --ctrl-fg: rgba(0, 0, 0, 0.42);
  --ctrl-size: 10px;
  --ctrl-font: 8px;
  --ambient-ctrl-height: 16px;
  --ambient-ctrl-pad-x: 4px;
  --ambient-ctrl-font: 8px;
  --ambient-ctrl-radius: 2px;
  --ambient-ctrl-border: rgba(0, 0, 0, 0.08);
  --ambient-ctrl-bg: rgba(255, 255, 255, 0.42);
  --ambient-ctrl-bg-hover: rgba(255, 255, 255, 0.68);
  --ambient-ctrl-fg: rgba(0, 0, 0, 0.46);
  --ambient-ctrl-fg-hover: var(--red);
}

/* pure white mode */
body.white-mode {
  --bg: #ffffff;
  --dot: rgba(0, 0, 0, 0.07);
  --panel: rgba(0, 0, 0, 0.012);
  --line: rgba(0, 0, 0, 0.05);
  --line-soft: rgba(0, 0, 0, 0.024);
  --text: rgba(28, 28, 28, 0.6);
  --text-dim: rgba(28, 28, 28, 0.24);
  --knot-bg: rgba(120, 120, 120, 0.09);
  --knot-bg-hover: rgba(120, 120, 120, 0.13);
  --red: #ff0000;
  --red-soft: rgba(255, 0, 0, 0.68);
  --port-bg: rgba(255, 0, 0, 0.06);
  --edge: rgba(110, 110, 110, 0.16);
  --tray-bg: rgba(0, 0, 0, 0.01);
  --ctrl-fg: rgba(0, 0, 0, 0.46);
  --ctrl-size: 10px;
  --ctrl-font: 8px;
  --ambient-ctrl-border: rgba(0, 0, 0, 0.09);
  --ambient-ctrl-bg: rgba(255, 255, 255, 0.46);
  --ambient-ctrl-bg-hover: rgba(255, 255, 255, 0.72);
  --ambient-ctrl-fg: rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html {
  font-family: var(--font-ui);
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* toolbar: almost no presence */
.toolbar {
  height: 16px;
  padding: 0;
  border-bottom: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  opacity: 0.08;
  user-select: none;
}

.toolbar:hover {
  opacity: 0.22;
}

.title-wrap {
  display: none;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: auto;
}

.tool-btn {
  height: 12px;
  min-width: 0;
  padding: 0 3px;
  border: 0;
  background: transparent;
  color: var(--ctrl-fg);
  border-radius: 0;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: var(--ctrl-font);
  line-height: 12px;
}

.tool-btn:hover,
.tool-btn:focus-visible {
  color: var(--red);
  outline: none;
}

.tool-btn.danger:hover,
.tool-btn.danger:focus-visible {
  color: var(--red);
  background: transparent;
}

.workspace {
  flex: 1;
  position: relative;
  display: grid;
  /* tray 欄寬：先前 468px 的 70% */
  grid-template-columns: minmax(0, 1fr) calc(468px * 0.7);
  min-height: 0;
  overflow: hidden;
}

.canvas-pane {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

body.is-panning .canvas-pane {
  cursor: grabbing;
}

.knot,
.port,
.side-add,
.zoom-controls,
.edge-cut {
  cursor: auto;
}

.knot-content-input,
.knot-title {
  touch-action: auto;
}

.canvas {
  position: absolute;
  inset: 0;
  background-color: #fff;
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.055) 0.6px, transparent 0.75px);
  background-size: 26px 26px;
  background-position: 0 0;
}

.edge-layer,
.knot-layer,
.edge-tool-layer {
  position: absolute;
  inset: 0;
}

.edge-layer {
  pointer-events: auto;
  z-index: 2;
}

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

.edge-tool-layer {
  z-index: 7;
  pointer-events: none;
}

.edge {
  fill: none;
  stroke: var(--edge);
  stroke-width: 1;
  pointer-events: visibleStroke;
}

.edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 14px;
  pointer-events: stroke;
}

.edge.is-hovered {
  stroke: rgba(255, 0, 0, 0.67) !important;
}

body.white-mode .edge {
  stroke: rgba(130, 130, 130, 0.18);
}

.edge.temp {
  stroke: #ff0000;
  stroke-dasharray: 2 2;
}

.edge-cut {
  position: absolute;
  width: 47px;
  height: 47px;
  margin-left: -24px;
  margin-top: -24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  font-size: 24px;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
  pointer-events: auto;
}

.edge-cut.is-visible {
  color: var(--text-dim);
}

.edge-cut:hover,
.edge-cut:focus-visible {
  color: var(--red);
  background: transparent;
  outline: none;
}

.knot {
  position: absolute;
  min-width: 72px;
  height: auto;
  min-height: 0;
  overflow: visible;
  border: 1px solid var(--line-soft);
  background: var(--knot-bg);
  color: var(--text);
  user-select: none;
  pointer-events: auto;
}

body.white-mode .knot {
  border: 0;
  background: var(--knot-bg);
}

.knot:hover,
.knot.is-selected {
  border-color: transparent;
  background: var(--knot-bg-hover);
}

body.white-mode .knot:hover,
body.white-mode .knot.is-selected {
  border-color: transparent;
  background: rgba(120, 120, 120, 0.12);
}

.knot.is-child-collapsed {
  border-style: solid;
}

.knot-header {
  min-height: 0;
  height: auto;
  display: flex;
  align-items: flex-start;
  cursor: move;
  position: relative;
  /* 高於 .side-add，避免右側「+」疊在標題列上時擋住刪除鈕 */
  z-index: 2;
  padding: 0;
  margin: 0;
  line-height: 1.25;
  overflow: visible;
}

.knot-title {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  margin: 0;
  outline: none;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  font-size: 7px;
  font-weight: 400;
  font-family: var(--font-ui);
  letter-spacing: 0;
  display: block;
}

.knot-title:focus {
  color: var(--red);
}

.knot.is-renaming .knot-title {
  background: rgba(255, 247, 120, 0.85);
  color: var(--red);
}

/* header controls hidden/minimized */
.knot-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
}

/* completely hide old buttons */
.type-btn,
.collapse-btn,
.children-btn {
  display: none !important;
}

.delete-btn {
  display: none;
  position: relative;
  z-index: 6;
  width: var(--ctrl-size);
  height: var(--ctrl-size);
  border: 0;
  background: transparent;
  color: var(--ctrl-fg);
  padding: 0;
  margin: 0;
  line-height: var(--ctrl-size);
  cursor: pointer;
  font-size: var(--ctrl-font);
  pointer-events: auto;
}

.knot-edit-btn {
  display: none;
  position: relative;
  z-index: 6;
  width: var(--ctrl-size);
  height: var(--ctrl-size);
  border: 0;
  background: transparent;
  color: var(--ctrl-fg);
  padding: 0;
  margin: 0;
  line-height: var(--ctrl-size);
  cursor: pointer;
  font-size: calc(var(--ctrl-font) - 1px);
  pointer-events: auto;
}

.knot:hover .knot-edit-btn,
.knot.is-selected .knot-edit-btn,
.knot:hover .delete-btn,
.knot.is-selected .delete-btn {
  display: inline-block;
}

.knot:hover .delete-btn,
.knot.is-selected .delete-btn {
  display: inline-block;
}

.knot-edit-btn:hover,
.knot-edit-btn:focus-visible,
.delete-btn:hover,
.delete-btn:focus-visible {
  color: var(--red);
  background: transparent;
  outline: none;
}

.knot-content {
  border: 0;
  width: 100%;
  padding: 0;
  margin: 0;
  line-height: 1.25;
}

.knot:not(.content-expanded) .knot-content {
  display: none;
}

.knot-content-input {
  width: 100%;
  min-width: 96px;
  min-height: 10px;
  height: auto;
  border: 0;
  resize: both;
  overflow: hidden;
  background: transparent;
  color: #5c5c5c;
  outline: none;
  padding: 0;
  margin: 0;
  line-height: 1.25;
  font-size: 8px;
  font-family: var(--font-ui);
  display: block;
  scrollbar-width: none;
}

.knot-content-input::placeholder {
  color: #5c5c5c;
  opacity: 0.55;
}

.knot-content-input:focus {
  color: var(--red);
}

/* 內容框右下角 resize 抓手：WebKit 約縮至常見尺寸的 30%（Firefox 原生抓手無法縮） */
.knot-content-input::-webkit-resizer {
  width: 6px;
  height: 6px;
  border: 0;
  opacity: 0.8;
}

.knot-content-input::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.port {
  position: absolute;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

.knot:hover .port,
.knot.is-selected .port {
  opacity: 1;
  pointer-events: auto;
  background: var(--port-bg);
}

.port.left {
  left: -2px;
}

.port.right {
  right: -2px;
}

.port:hover {
  background: #ff0000;
}

.knot:hover .port:hover,
.knot.is-selected .port:hover {
  background: #ff0000;
}

.side-add {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  font-size: 9px;
  line-height: 9px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  /* 維持可點，避免滑到 knot 外緣時 hover 斷掉無法按到 */
  pointer-events: auto;
}

.knot.hover-left .side-add.left,
.knot.hover-right .side-add.right,
.knot.is-selected.hover-left .side-add.left,
.knot.is-selected.hover-right .side-add.right {
  opacity: 1;
  color: var(--ctrl-fg);
}

.side-add.left {
  left: -14px;
}

.side-add.right {
  right: -14px;
}

.side-add:hover,
.side-add:focus-visible {
  color: var(--red);
  background: transparent;
  outline: none;
}

.knot.hover-left .side-add.left:hover,
.knot.hover-right .side-add.right:hover,
.knot.is-selected.hover-left .side-add.left:hover,
.knot.is-selected.hover-right .side-add.right:hover {
  color: #ff0000;
}

.knot-meta {
  display: none !important;
}

.drag-hint {
  position: absolute;
  border: 1px dashed rgba(255, 0, 0, 0.38);
  pointer-events: none;
  z-index: 4;
}

.tray-pane {
  grid-column: 2;
  grid-row: 1;
  background: transparent;
  min-width: 0;
  background: rgba(0, 0, 0, 0.015);
  padding: 13px 8px 8px 13px;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.tray-knot-layer {
  position: absolute;
  left: 0;
  right: 0;
  top: 52px;
  bottom: 0;
  z-index: 2;
  pointer-events: auto;
}

.tray-pane::before {
  content: "";
  position: absolute;
  inset: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.01);
  pointer-events: none;
}

.tray-pane.is-active::before {
  border-left-color: var(--red-soft);
}

.tray-title {
  position: relative;
  z-index: 1;
  font-size: 20px;
  font-family: var(--font-ui);
  color: var(--text-dim);
  margin: 0;
  height: auto;
  text-transform: lowercase;
  user-select: none;
  letter-spacing: 0;
}

.tray-head {
  position: relative;
  z-index: 4;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  margin: 0 0 10px 0;
}

.tray-actions {
  display: inline-flex;
  gap: 3px;
  pointer-events: auto;
}

.tray-action-btn {
  height: 30px;
  padding: 0 5px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 20px;
  line-height: 30px;
  font-family: var(--font-ui);
  cursor: pointer;
  pointer-events: auto;
}

.tray-action-btn:hover,
.tray-action-btn:focus-visible {
  color: var(--red);
  outline: none;
}

.template-tray {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0;
  opacity: 1;
  align-items: center;
  pointer-events: none;
}

/* tray「+」：見 docs/tray-template-button.md */
.template-btn {
  display: inline-block;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  font-family: var(--font-ui);
  line-height: 22px;
  text-align: center;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: auto;
}

.template-btn:hover,
.template-btn:focus-visible {
  color: var(--red);
  background: transparent;
  border-color: rgba(255, 0, 0, 0.24);
  outline: none;
}

#trayKnotLayer .knot {
  width: 192px !important;
  min-width: 144px;
}

#trayKnotLayer .knot-title,
#trayKnotLayer .knot-content-input {
  font-size: 14px;
  line-height: 1.25;
}

#trayKnotLayer .knot-content-input {
  min-height: 36px;
}

#trayKnotLayer .delete-btn {
  width: 20px;
  height: 20px;
  line-height: 20px;
  font-size: 16px;
}

/* 僅蓋在 canvas-pane 上，不壓住 tray；縮放字元在最上層 */
.floating-ui {
  position: absolute;
  inset: 0;
  z-index: 9999;
  min-height: 0;
  min-width: 0;
  pointer-events: none;
}

.zoom-controls {
  position: absolute;
  right: 6px;
  bottom: 4px;
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  pointer-events: auto;
}

.color-controls {
  position: absolute;
  right: 57px;
  bottom: 4px;
  z-index: 10070;
  pointer-events: auto;
}

.color-dot-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.color-dot-btn:hover,
.color-dot-btn:focus-visible {
  color: var(--red);
  outline: none;
}

.color-palette {
  display: none;
  position: absolute;
  right: 0;
  bottom: 26px;
  width: 75px;
  grid-template-columns: repeat(5, 15px);
  grid-auto-rows: 15px;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: rgba(110, 110, 110, 0.22);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.color-controls:hover .color-palette,
.color-palette:hover {
  display: grid;
}

.palette-dot {
  width: 23px;
  height: 23px;
  margin: -4px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 22px;
  line-height: 23px;
  letter-spacing: -1px;
  text-indent: -1px;
  text-align: center;
  cursor: grab;
  font-family: var(--font-ui);
  user-select: none;
  -webkit-user-drag: element;
}

.palette-dot:hover {
  background: transparent;
}

body.is-color-dragging .color-palette {
  display: grid;
}

.color-cursor {
  position: fixed;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 20000;
  display: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}

body.is-color-painting {
  cursor: crosshair;
}

body.is-color-painting .knot {
  cursor: crosshair;
}

.knot[data-color] {
  background: var(--knot-bg-accent, var(--knot-bg));
  border-color: var(--knot-accent, var(--line-soft));
  color: var(--text);
}

.knot[data-color]:hover,
.knot[data-color].is-selected {
  background: var(--knot-bg-accent, var(--knot-bg-hover));
  border-color: var(--knot-accent, transparent);
}

.knot[data-color] .knot-title:focus,
.knot[data-color] .knot-content-input:focus {
  color: #ff0000;
}

.zoom-controls:hover,
.zoom-controls:focus-within {
  opacity: 1;
}

.zoom-btn {
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 0 1px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(0, 0, 0, 0.78);
  cursor: pointer;
  line-height: 1;
  /* 原 11px 增大 200%（+200% → 3×） */
  font-size: 33px;
  font-weight: 400;
  font-family: var(--font-ui);
  letter-spacing: 0;
  text-align: center;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

body.white-mode .zoom-btn {
  color: rgba(0, 0, 0, 0.72);
}

.zoom-btn:hover,
.zoom-btn:focus-visible {
  color: var(--red);
  background: transparent;
  outline: none;
}

#menu-panel {
  display: none;
  position: fixed;
  left: 14px;
  bottom: 14px;
  width: var(--root-panel-fixed-width, 188px);
  max-height: 34vh;
  overflow-y: auto;
  z-index: 9998;
  padding: 2px 3px;
  border: 1px solid rgba(190, 130, 145, 0.28);
  border-radius: 0;
  background: rgba(255, 245, 248, 0.78);
  box-shadow: 0 0 0 1px rgba(255, 210, 220, 0.12) inset;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.menu-drawer-toggle {
  display: none;
}

body.has-menus #menu-panel {
  display: block;
}

.tray-drawer-toggle {
  display: none;
}

.tray-collapse-btn {
  display: block;
  position: fixed;
  right: calc(468px * 0.7 - 1px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 10020;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.tray-collapse-btn:hover,
.tray-collapse-btn:focus-visible {
  color: var(--red);
  outline: none;
}

body.tray-collapsed .workspace {
  grid-template-columns: minmax(0, 1fr) 0;
}

body.tray-collapsed .tray-pane {
  display: none;
}

body.tray-collapsed .tray-collapse-btn {
  right: 2px;
}

#menu-panel::-webkit-scrollbar {
  width: 5px;
}

#menu-panel::-webkit-scrollbar-thumb {
  background: rgba(200, 140, 155, 0.35);
  border-radius: 0;
}

#menu-panel-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.menu-item {
  display: grid;
  grid-template-columns: 14px 1fr 14px;
  align-items: start;
  column-gap: 4px;
  padding: 2px 1px;
  margin: 0;
  border-bottom: 1px solid rgba(220, 170, 180, 0.2);
  color: rgba(48, 36, 40, 0.9);
  font-size: 11px;
  line-height: 1.25;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  letter-spacing: 0.03em;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:hover,
.menu-item:focus-visible {
  background: rgba(255, 228, 234, 0.45);
  color: rgba(24, 18, 22, 0.96);
  outline: none;
}

.menu-item.active {
  background: rgba(255, 215, 225, 0.42);
  color: rgba(12, 8, 10, 0.98);
  box-shadow: inset 0 0 0 1px rgba(190, 110, 125, 0.32);
  text-shadow: 0 0 10px rgba(255, 180, 195, 0.35);
}

.menu-item-prefix {
  display: inline-block;
  font: inherit;
  line-height: 1;
  text-align: left;
  color: inherit;
}

.menu-item-name {
  min-width: 0;
  white-space: normal;
  word-break: break-word;
}

.menu-item-edit {
  display: none;
  width: 14px;
  height: 14px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: rgba(88, 66, 72, 0.82);
  font-size: 10px;
  line-height: 14px;
  font-family: var(--font-ui);
  cursor: pointer;
}

.menu-item:hover .menu-item-edit,
.menu-item:focus-within .menu-item-edit {
  display: inline-block;
}

.menu-item-edit:hover,
.menu-item-edit:focus-visible {
  color: var(--red);
  outline: none;
}

.menu-item.is-renaming .menu-item-name {
  background: rgba(255, 247, 120, 0.85);
  color: var(--red);
  outline: none;
}

.menu-item.is-renaming .menu-item-edit {
  display: inline-block;
}

@media (max-width: 720px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .tray-pane {
    position: fixed;
    right: 0;
    bottom: 0;
    top: auto;
    width: 80vw;
    height: 30vh;
    transform: translateX(100%);
    transition: none;
    z-index: 10020;
    background: rgba(255, 255, 255, 0.92);
    overflow: hidden;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  body.tray-drawer-open .tray-pane {
    transform: translateX(0);
  }

  .canvas-pane {
    grid-column: 1;
    grid-row: 1;
  }

  body.has-menus .menu-drawer-toggle {
    display: block;
    position: fixed;
    left: 10px;
    bottom: 10px;
    z-index: 10001;
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ff00ff;
    font-family: var(--font-ui);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
  }

  body.has-menus #menu-panel {
    display: none;
    position: fixed;
    left: 10px;
    bottom: 34px;
    width: 158px;
    max-height: 42vh;
    overflow-y: auto;
    z-index: 10000;
  }

  body.has-menus.menu-drawer-open #menu-panel {
    display: block;
  }

  .tray-drawer-toggle {
    display: block;
    position: fixed;
    right: 10px;
    bottom: 8px;
    z-index: 10080;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--red);
    font-family: var(--font-ui);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
  }

  .tray-drawer-toggle:hover,
  .tray-drawer-toggle:focus-visible {
    color: var(--red);
    outline: none;
  }

  .toolbar {
    height: 14px;
  }

  .toolbar-actions {
    opacity: 0.35;
  }

  .tool-btn {
    font-size: 7px;
    padding: 0 2px;
  }

  .zoom-btn {
    font-size: 24px;
  }

  .floating-ui {
    z-index: 10060;
  }

  .zoom-controls {
    right: 31px;
    bottom: 5px;
    z-index: 10070;
  }

  .color-controls {
    right: 92px;
    bottom: 8px;
    z-index: 10090;
  }

  .color-dot-btn {
    font-size: 22px;
  }

  .color-palette {
    display: none;
    right: 0;
    bottom: 26px;
    width: 105px;
    grid-template-columns: repeat(5, 21px);
    grid-auto-rows: 21px;
    gap: 0;
    padding: 0;
    border-radius: 3px;
  }

  .palette-dot {
    width: 21px;
    height: 21px;
    margin: 0;
    padding: 0;
    font-size: 20px;
    line-height: 21px;
    text-indent: 0;
    letter-spacing: 0;
  }

  .color-controls:hover .color-palette,
  .color-palette:hover {
    display: none;
  }

  body.color-palette-open .color-palette {
    display: grid;
  }

  .tray-collapse-btn {
    display: none !important;
  }
}
