html,
body,
#app,
.app-root {
  height: 100%;
  margin: 0;
  background: #fff;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

#menuBar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #dcdcdc;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(8px);
  font: 12px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  user-select: none;
  z-index: 20;
}

#menuBar .menu-root {
  position: relative;
}

#menuBar .menu-trigger {
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #131313;
  min-width: 52px;
  text-align: center;
  cursor: default;
}

#menuBar .menu-root:hover .menu-trigger,
#menuBar .menu-root.open .menu-trigger {
  background: #efefef;
}

#menuBar .menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 252px;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid #d5d5d5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.11);
}

#menuBar .menu-root.open .menu-panel {
  display: flex;
}

#menuBar .menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 7px 8px;
  border-radius: 7px;
  color: #111;
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
}

#menuBar .menu-item:hover,
#menuBar .menu-item.hover {
  background: #111;
  color: #fff;
}

#menuBar .menu-item:hover .menu-icon,
#menuBar .menu-item.hover .menu-icon {
  filter: brightness(0) invert(1);
}

#menuBar .menu-item.disabled {
  opacity: 0.45;
  pointer-events: none;
}

#menuBar .menu-item.danger {
  color: #8a1414;
}

#menuBar .menu-item:hover.danger,
#menuBar .menu-item.hover.danger {
  color: #fff;
}

#menuBar .menu-checkmark {
  width: 12px;
  flex: 0 0 12px;
  opacity: 0;
  text-align: center;
  font-size: 12px;
  line-height: 1;
}

#menuBar .menu-item.selected .menu-checkmark {
  opacity: 1;
}

#menuBar .menu-checkmark.blank {
  opacity: 0;
}

#menuBar .menu-icon,
#menuBar .menu-icon-slot {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

#menuBar .menu-label {
  flex: 1 1 auto;
  min-width: 0;
}

#menuBar .menu-hotkey {
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 14px;
  color: #757575;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: right;
}

#menuBar .menu-item:hover .menu-hotkey,
#menuBar .menu-item.hover .menu-hotkey {
  color: #fff;
}

#menuBar .menu-sep {
  margin: 4px 2px;
  border: 0;
  border-top: 1px solid #e7e7e7;
}

#menuBar .grid-panel {
  min-width: 180px;
}

#menuBar .menu-section-label {
  padding: 3px 8px 4px 36px;
  color: #666;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#toolPalette {
  position: fixed;
  top: 52px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px;
  border: 1px solid #d7d7d7;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.12);
  z-index: 15;
}

#toolPalette.hidden {
  display: none;
}

#toolPalette .palette-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #cbcbcb;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

#toolPalette .palette-btn .menu-icon {
  width: 15px;
  height: 15px;
}

#toolPalette .palette-btn:hover {
  background: #f3f3f3;
}

#toolPalette .palette-btn:active {
  transform: translateY(1px);
}

#toolPalette .palette-btn.selected {
  background: #111;
  border-color: #111;
}

#toolPalette .palette-btn.selected .menu-icon {
  filter: brightness(0) invert(1);
}

#toolPalette .palette-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#toolPalette .palette-sep {
  width: 100%;
  height: 1px;
  background: #e8e8e8;
  margin: 3px 0;
}

.shape-dialog-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(248, 248, 248, 0.72);
  backdrop-filter: blur(3px);
  z-index: 40;
}

.shape-dialog-backdrop.open {
  display: flex;
}

.shape-dialog {
  width: min(390px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid #d4d4d4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.16);
  font: 13px/1.3 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #131313;
}

.shape-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.shape-dialog h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.shape-dialog-copy {
  margin: 8px 0 10px;
  color: #5e5e5e;
}

.shape-dialog-close {
  width: 24px;
  height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #cecece;
  border-radius: 6px;
  background: #fff;
  color: #111;
  cursor: pointer;
}

.shape-dialog-close.hidden {
  display: none;
}

.shape-dialog-close .menu-icon {
  width: 14px;
  height: 14px;
}

.shape-dialog-close:hover {
  border-color: #111;
  background: #111;
}

.shape-dialog-close:hover .menu-icon {
  filter: brightness(0) invert(1);
}

.export-dialog-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(248, 248, 248, 0.72);
  backdrop-filter: blur(3px);
  z-index: 42;
}

.export-dialog-backdrop.open {
  display: flex;
}

.export-dialog {
  width: min(360px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid #d4d4d4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.16);
  font: 13px/1.3 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #131313;
}

.export-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.export-dialog h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.export-dialog-copy {
  margin: 8px 0 10px;
  color: #5e5e5e;
}

.export-dialog-close {
  width: 24px;
  height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #cecece;
  border-radius: 6px;
  background: #fff;
  color: #111;
  cursor: pointer;
}

.export-dialog-close .menu-icon {
  width: 14px;
  height: 14px;
}

.export-dialog-close:hover {
  border-color: #111;
  background: #111;
}

.export-dialog-close:hover .menu-icon {
  filter: brightness(0) invert(1);
}

.export-dialog-form {
  display: grid;
  gap: 10px;
}

.export-field {
  display: grid;
  gap: 4px;
}

.export-field-label {
  color: #4f4f4f;
  font-size: 12px;
}

.export-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #cfcfcf;
  border-radius: 7px;
  box-sizing: border-box;
  font: 13px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.export-input:focus-visible {
  outline: 2px solid #2b66ff;
  outline-offset: 1px;
}

.export-dialog-actions {
  margin-top: 4px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.export-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid #cecece;
  background: #fff;
  color: #111;
  font: 12px/1 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  cursor: pointer;
}

.export-btn.secondary:hover {
  background: #f3f3f3;
}

.export-btn.primary {
  border-color: #111;
  background: #111;
  color: #fff;
}

.export-btn.primary:hover {
  background: #242424;
}

.shape-option-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.shape-option {
  width: 100%;
  height: 86px;
  position: relative;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #d7d7d7;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  color: #111;
}

.shape-option:hover {
  background: #f7f7f7;
}

.shape-option.selected {
  border-color: #111;
  background: #111;
  color: #fff;
}

.shape-option:focus-visible {
  outline: 2px solid #2b66ff;
  outline-offset: 2px;
}

.shape-option-glyph {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  fill: none;
  stroke-width: 8;
  stroke-linejoin: round;
  stroke-linecap: round;
  pointer-events: none;
}

.shape-option-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 6px;
}

.shape-option-glyph-wrap {
  display: grid;
  place-items: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
