:root {
  color-scheme: light;
  --bg: #eef0f3;
  --panel: #ffffff;
  --panel-soft: #f7f8fa;
  --line: #dfe3e8;
  --line-strong: #c9ced6;
  --ink: #151922;
  --muted: #677080;
  --soft-text: #8a93a3;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #0f766e;
  --rose: #f04f5f;
  --amber: #f59e0b;
  --focus: rgba(37, 99, 235, 0.22);
  --shadow: 0 18px 55px rgba(31, 37, 49, 0.16);
  --sidebar-width: 284px;
  --right-width: 324px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.app-shell {
  display: grid;
  grid-template-rows: 52px 1fr;
  width: 100vw;
  height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 52px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  z-index: 10;
}

.brand,
.doc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand {
  flex: 1 1 auto;
}

.tool-options {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  max-width: min(42vw, 460px);
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px;
  background: #fff;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.tool-options::-webkit-scrollbar {
  display: none;
}

.tool-options.is-active {
  display: flex;
}

.tool-option-current {
  display: inline-grid;
  grid-template-columns: 17px minmax(0, auto);
  align-items: center;
  gap: 6px;
  height: 26px;
  min-width: 30px;
  border-radius: 5px;
  padding: 0 7px;
  color: var(--ink);
  background: var(--panel-soft);
  font-size: 11px;
  font-weight: 820;
  white-space: nowrap;
}

.tool-option-current svg {
  width: 17px;
  height: 17px;
}

.tool-option-current span {
  min-width: 0;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-option-icon,
.tool-option-text {
  display: inline-grid;
  place-items: center;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
}

.tool-option-icon {
  width: 26px;
}

.tool-option-text {
  min-width: 76px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 820;
}

.tool-option-icon:hover,
.tool-option-text:hover,
.tool-option-icon.is-active,
.tool-option-text.is-active {
  border-color: var(--line);
  color: var(--ink);
  background: var(--panel-soft);
}

.wand-modes {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-right: 4px;
  border-right: 1px solid var(--line);
}

.wand-tolerance {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.wand-tolerance input {
  width: 48px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
  color: var(--ink);
  background: var(--panel-soft);
  font: inherit;
}

.tool-option-text.wand-toggle {
  min-width: max-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: #ffffff;
  background: conic-gradient(from 40deg, #2563eb, #0f766e, #f59e0b, #f04f5f, #2563eb);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.doc-name {
  min-width: 120px;
  max-width: 430px;
  width: min(44vw, 430px);
  height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 9px;
  color: var(--ink);
  background: transparent;
  font-weight: 760;
}

.doc-name:focus {
  outline: none;
  border-color: var(--line-strong);
  background: var(--panel-soft);
}

.doc-actions {
  flex: 0 0 auto;
}

.top-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  height: 100%;
}

.menu-group {
  position: relative;
  height: 100%;
}

.menu-trigger {
  height: 100%;
  min-width: 58px;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.menu-group:hover .menu-trigger,
.menu-trigger:focus-visible {
  color: var(--ink);
  background: var(--panel-soft);
}

.menu-dropdown {
  position: absolute;
  left: 0;
  top: calc(100% - 4px);
  z-index: 60;
  display: none;
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}

.menu-group:hover .menu-dropdown,
.menu-group:focus-within .menu-dropdown {
  display: grid;
  gap: 2px;
}

.menu-dropdown button {
  display: flex;
  align-items: center;
  min-height: 32px;
  border-radius: 6px;
  padding: 0 9px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 680;
  text-align: left;
}

.menu-dropdown button:hover {
  background: var(--panel-soft);
}

.doc-actions select {
  max-width: 220px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 30px 0 10px;
  color: var(--ink);
  background: #fff;
}

.icon-button,
.mini-icon,
.tool-button,
.zoom-readout {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.icon-button:hover,
.mini-icon:hover,
.tool-button:hover,
.zoom-readout:hover,
.tab:hover,
.layer-row:hover,
.insert-grid button:hover,
.component-tile:hover {
  border-color: var(--line-strong);
  background: #f5f7fb;
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  min-width: 72px;
  padding: 0 11px;
  white-space: nowrap;
}

.text-button.primary {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.text-button.primary:hover {
  background: var(--blue-dark);
}

.workspace {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, calc(100vw - var(--sidebar-width) - var(--right-width))) var(--right-width);
  width: 100vw;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  min-height: 0;
  overflow: hidden;
  border-color: var(--line);
  background: var(--panel);
}

.left-panel {
  border-right: 1px solid var(--line);
}

.right-panel {
  min-width: 0;
  border-left: 1px solid var(--line);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.tab {
  height: 30px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.tab.is-active {
  color: var(--ink);
  border-color: var(--line);
  background: var(--panel-soft);
}

.left-tab-panel,
.right-tab-panel {
  display: none;
  height: calc(100vh - 103px);
  overflow: auto;
}

.left-tab-panel.is-active,
.right-tab-panel.is-active {
  display: block;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  padding: 12px 12px 6px;
  color: var(--soft-text);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.mini-group {
  display: flex;
  gap: 5px;
}

.mini-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: var(--muted);
}

.mini-icon span {
  font-size: 15px;
  line-height: 1;
}

.page-row {
  margin: 0 10px 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--panel-soft);
  font-size: 13px;
  font-weight: 720;
}

.layers-list {
  padding: 0 8px 14px;
}

.layer-row {
  display: grid;
  grid-template-columns: 16px 18px 1fr 24px 24px;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  margin: 2px 0;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 5px;
  color: var(--muted);
  cursor: pointer;
}

.layer-row[draggable="true"] {
  cursor: grab;
}

.layer-row.is-dragging {
  opacity: 0.42;
}

.layer-row.is-drop-before {
  box-shadow: inset 0 2px 0 var(--blue);
}

.layer-row.is-drop-after {
  box-shadow: inset 0 -2px 0 var(--blue);
}

.layer-row.is-drop-inside {
  border-color: rgba(15, 118, 110, 0.45);
  background: rgba(15, 118, 110, 0.08);
}

.layer-row.is-selected {
  border-color: rgba(37, 99, 235, 0.26);
  color: var(--ink);
  background: rgba(37, 99, 235, 0.08);
}

.layer-row.is-primary {
  border-color: rgba(37, 99, 235, 0.52);
  background: rgba(37, 99, 235, 0.14);
}

.layer-row.is-hidden {
  opacity: 0.54;
}

.layer-row.is-cut-pending {
  border-color: #d1d5db;
  color: #9ca3af;
  background: #f3f4f6;
}

.layer-row.is-cut-pending .layer-icon,
.layer-row.is-cut-pending .layer-name {
  color: #9ca3af;
}

.layer-row.is-mask {
  color: #334155;
  background: rgba(15, 23, 42, 0.035);
}

.layer-row.is-mask .layer-icon {
  color: #2563eb;
}

.layer-row.is-mask .layer-name {
  font-style: italic;
}

.layer-disclosure {
  display: grid;
  place-items: center;
  width: 16px;
  height: 24px;
  border: 0;
  padding: 0;
  color: var(--soft-text);
  background: transparent;
}

.layer-disclosure svg {
  width: 14px;
  height: 14px;
  transition: transform 0.14s ease;
}

.layer-disclosure:hover {
  color: var(--ink);
}

.layer-disclosure.is-spacer {
  pointer-events: none;
}

.layer-row:not(.is-collapsed) .layer-disclosure svg {
  transform: rotate(90deg);
}

.layer-icon {
  width: 18px;
  height: 18px;
  color: var(--soft-text);
}

.layer-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}

.layer-rename {
  width: 100%;
  min-width: 0;
  height: 24px;
  border: 1px solid var(--blue);
  border-radius: 5px;
  padding: 0 5px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 650;
}

.component-grid,
.insert-grid,
.token-list {
  padding: 0 10px 14px;
}

.brand-book {
  margin: 0 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.brand-book summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  list-style: none;
}

.brand-book summary::-webkit-details-marker {
  display: none;
}

.brand-book summary svg {
  width: 15px;
  height: 15px;
  transform: rotate(90deg);
}

.brand-book:not([open]) summary svg {
  transform: rotate(0deg);
}

.brand-book-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.brand-book-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
}

.brand-book-head strong {
  font-size: 12px;
  font-weight: 820;
}

.brand-dropzone {
  min-height: 58px;
  border: 1px dashed rgba(116, 127, 145, 0.5);
  border-radius: 7px;
  padding: 8px;
  color: var(--soft-text);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
}

.brand-color-row,
.brand-assets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brand-swatch,
.brand-assets-row button,
.brand-type-list button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.brand-swatch {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 58px;
  padding: 6px;
}

.brand-swatch span {
  display: block;
  width: 34px;
  height: 34px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--brand, #fff);
  box-shadow: 0 0 0 1px rgba(31, 37, 49, 0.18);
}

.brand-swatch.is-add span {
  display: grid;
  place-items: center;
  color: var(--soft-text);
  background: #fff;
  font-size: 24px;
  line-height: 1;
}

.brand-swatch small,
.brand-assets-row small {
  color: var(--soft-text);
  font-size: 10px;
  font-weight: 700;
}

.brand-type-list {
  display: grid;
  gap: 6px;
}

.brand-type-list button {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 8px;
  min-height: 34px;
  padding: 0 9px;
  text-align: left;
}

.brand-type-list strong,
.brand-type-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-type-list strong {
  color: var(--ink);
  font-size: 12px;
}

.brand-type-list span {
  color: var(--soft-text);
  font-size: 11px;
}

.brand-assets-row button {
  display: grid;
  gap: 5px;
  width: calc(50% - 4px);
  padding: 6px;
}

.brand-assets-row .tile-preview {
  height: 42px;
}

.component-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.component-tile {
  display: grid;
  grid-template-rows: 74px auto auto;
  gap: 4px;
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  text-align: left;
  background: #fff;
}

.component-tile strong,
.component-tile small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.component-tile strong {
  font-size: 13px;
}

.component-tile small {
  color: var(--soft-text);
  font-size: 11px;
}

.tile-preview {
  display: block;
  width: 100%;
  height: 74px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 7px;
}

.tile-preview.product {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, #f04f5f, #ffcf5a) border-box;
  box-shadow: inset 0 22px 0 #fee2e2, inset 0 -18px 0 #e0f2fe;
}

.tile-preview.event {
  background: linear-gradient(135deg, #111827 0 34%, #f59e0b 34% 44%, #fff 44%);
}

.tile-preview.profile {
  background: radial-gradient(circle at 24px 24px, #0f766e 0 16px, transparent 17px), linear-gradient(90deg, #ecfeff, #fff);
}

.tile-preview.metric {
  background:
    linear-gradient(90deg, rgba(37, 99, 235, .18) 0 62%, transparent 62%),
    linear-gradient(#fff, #fff);
}

.insert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.insert-grid button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 720;
}

.insert-grid button span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insert-symbol {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-weight: 850;
}

.token-list {
  display: grid;
  gap: 7px;
}

.token-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 7px;
  background: #fff;
}

.swatch {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 6px;
}

.token-row strong,
.token-row code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-row strong {
  font-size: 12px;
}

.token-row code {
  color: var(--soft-text);
  font-size: 11px;
}

.projects-list {
  display: grid;
  gap: 7px;
  padding: 0 10px 14px;
}

.project-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px;
  background: #fff;
  text-align: left;
}

.project-row:hover,
.project-row.is-selected {
  border-color: rgba(37, 99, 235, 0.55);
  background: #eff6ff;
}

.project-row.is-current .project-mark {
  color: #fff;
  background: var(--blue);
}

.project-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: var(--blue);
  background: #dbeafe;
}

.project-mark svg {
  width: 17px;
  height: 17px;
}

.project-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.project-copy strong,
.project-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-copy strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
}

.project-copy small {
  color: var(--soft-text);
  font-size: 11px;
}

.project-inspector .project-state {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--soft-text);
  background: #fff;
  font-size: 11px;
  font-weight: 760;
}

.project-inspector .project-state.is-enabled {
  border-color: rgba(15, 118, 110, 0.24);
  color: #0f766e;
  background: #ecfdf5;
}

.project-inspector .project-state.is-disabled {
  border-color: rgba(89, 96, 109, 0.22);
  color: #59606d;
  background: #f3f4f6;
}

.project-property-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.project-property {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: #fff;
}

.project-property span {
  color: var(--soft-text);
  font-size: 11px;
}

.project-property strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 12px;
}

.project-users {
  display: grid;
  gap: 6px;
}

.project-user {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 6px;
  background: #fff;
}

.project-user span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #fff;
  background: #0f766e;
  font-size: 10px;
  font-weight: 800;
}

.project-user strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

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

.presentation-link-row input {
  min-width: 0;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
}

.presentation-link-row .mini-icon.is-active {
  color: #fff;
  background: var(--blue);
}

.empty-state.compact {
  min-height: 34px;
  padding: 8px;
  font-size: 12px;
}

.canvas-shell {
  position: relative;
  width: 100%;
  max-width: calc(100vw - var(--sidebar-width) - var(--right-width));
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background-color: #e7e9ee;
  background-image:
    linear-gradient(rgba(31, 37, 49, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 37, 49, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

.workspace-presentation-link {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 70000;
  display: inline-grid;
  grid-template-columns: max-content 30px 30px;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 3px 4px 3px 10px;
  border: 1px solid rgba(116, 127, 145, 0.28);
  border-radius: 7px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(31, 37, 49, 0.14);
  font-size: 12px;
  font-weight: 850;
}

.workspace-presentation-link.is-disabled {
  color: var(--soft-text);
  opacity: 0.72;
}

.workspace-presentation-link .mini-icon.is-active {
  color: #fff;
  background: var(--blue);
}

.canvas-scroller {
  width: 100%;
  height: 100%;
  overflow: auto;
  cursor: default;
}

.canvas-scroller.is-panning {
  cursor: grabbing;
}

.canvas-shell.is-marquee .canvas-scroller {
  cursor: crosshair;
}

.viewport {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 1600px;
  min-height: 1400px;
  padding: 180px;
}

.artboard {
  position: relative;
  flex: 0 0 auto;
  width: 1080px;
  height: 1080px;
  overflow: visible;
  transform-origin: top left;
  background: #f3f4f6;
  box-shadow: 0 30px 90px rgba(31, 37, 49, .22);
}

.artboard.is-workspace-board {
  background-color: #eef1f5;
  background-image:
    linear-gradient(45deg, rgba(31, 37, 49, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(31, 37, 49, 0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(31, 37, 49, 0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(31, 37, 49, 0.08) 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  box-shadow: none;
}

.canvas-label-layer,
.canvas-notes-layer,
.remote-cursors-layer {
  position: absolute;
  inset: 0;
  z-index: 46000;
  overflow: visible;
  pointer-events: none;
}

.canvas-name-label {
  position: absolute;
  max-width: 280px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(116, 127, 145, 0.28);
  border-radius: 4px;
  color: #243041;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 12px rgba(31, 37, 49, 0.12);
  font: 700 12px/22px Inter, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: auto;
}

.canvas-name-label.is-selected {
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.canvas-notes-layer {
  z-index: 45500;
}

.canvas-notes-panel {
  position: absolute;
  display: grid;
  gap: 7px;
  min-width: 260px;
  max-width: 720px;
  max-height: 188px;
  padding: 9px;
  border: 1px solid rgba(116, 127, 145, 0.28);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 34px rgba(31, 37, 49, 0.14);
  pointer-events: auto;
}

.canvas-notes-panel.is-focused {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18), 0 12px 34px rgba(31, 37, 49, 0.14);
}

.artboard.is-lasso-mode .canvas-notes-panel {
  pointer-events: none;
}

.canvas-notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: #243041;
  font: 780 12px/1 Inter, "Segoe UI", sans-serif;
}

.canvas-notes-head strong {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  color: #0f766e;
  background: #ccfbf1;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.canvas-notes-list {
  display: grid;
  gap: 5px;
  max-height: 82px;
  overflow: auto;
}

.canvas-notes-empty {
  color: var(--soft-text);
  font: 650 12px/1.35 Inter, "Segoe UI", sans-serif;
}

.canvas-note {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 6px 7px;
  border-radius: 5px;
  background: #f8fafc;
}

.canvas-note div {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.canvas-note strong,
.canvas-note time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-note strong {
  color: #111827;
  font: 760 11px/1.2 Inter, "Segoe UI", sans-serif;
}

.canvas-note time {
  flex: 0 0 auto;
  color: #7a8596;
  font: 650 10px/1.2 Inter, "Segoe UI", sans-serif;
}

.canvas-note p {
  margin: 0;
  color: #374151;
  font: 600 12px/1.35 Inter, "Segoe UI", sans-serif;
  overflow-wrap: anywhere;
}

.canvas-note-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px auto;
  gap: 6px;
}

.canvas-note-form input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 9px;
  color: #111827;
  background: #ffffff;
  font: 650 12px/1 Inter, "Segoe UI", sans-serif;
}

.canvas-note-form input:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(37, 99, 235, 0.16);
}

.canvas-note-form button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: 5px;
  color: #ffffff;
  background: var(--blue);
}

.canvas-note-form .canvas-note-approve {
  width: auto;
  min-width: 92px;
  padding: 0 10px;
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.28);
  background: #ccfbf1;
  font: 760 12px/1 Inter, "Segoe UI", sans-serif;
}

.canvas-note-form button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.remote-cursors-layer {
  z-index: 56000;
}

.remote-cursor {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  color: #dc2626;
  filter: drop-shadow(0 3px 8px rgba(127, 29, 29, 0.3));
}

.remote-cursor svg {
  width: 34px;
  height: 34px;
  fill: #ef4444;
  stroke: #7f1d1d;
  stroke-width: 0.95;
}

.remote-cursor span {
  margin-left: 1px;
  margin-top: 20px;
  max-width: 220px;
  padding: 5px 9px;
  border-radius: 4px;
  color: #ffffff;
  background: #dc2626;
  font: 800 13px/1.2 Inter, "Segoe UI", sans-serif;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.canvas-layer {
  position: absolute;
  min-width: 8px;
  min-height: 8px;
  outline: 1px solid transparent;
  transform-origin: center center;
  user-select: none;
  will-change: left, top, width, height, transform;
}

.canvas-layer.is-hidden,
.canvas-layer[hidden] {
  display: none !important;
}

.canvas-layer.is-cut-pending {
  opacity: 0.38 !important;
  filter: grayscale(0.65);
}

.canvas-layer.is-selected {
  outline-color: var(--blue);
  box-shadow: 0 0 0 4px var(--focus);
}

.canvas-layer.is-primary {
  outline-width: 2px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.28);
}

.canvas-layer[data-type="canvas"].is-approved {
  outline: 3px solid #16a34a;
  outline-offset: -3px;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.24), 0 18px 42px rgba(22, 163, 74, 0.14);
}

.layer-row.is-approved {
  box-shadow: inset 3px 0 0 #16a34a;
}

.canvas-note.is-approved strong,
.canvas-note.is-approved p {
  color: #15803d;
}

.canvas-layer.is-locked {
  cursor: not-allowed;
}

.canvas-layer[data-type="canvas"] {
  overflow: hidden;
  outline-offset: 0;
}

.canvas-layer[data-shape="circle"] {
  border-radius: 999px !important;
}

.canvas-layer[data-shape="triangle"] {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.canvas-layer.is-editing-text {
  cursor: text;
  user-select: text;
  outline-color: var(--green);
}

.canvas-layer[contenteditable="true"] {
  white-space: pre-wrap;
  user-select: text;
}

.canvas-layer[data-type="text"] {
  display: block;
  padding: 0;
  background: transparent;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: none;
}

.canvas-layer[data-type="text"][contenteditable="true"],
.canvas-layer[data-type="button"][contenteditable="true"],
.canvas-layer[data-type="tag"][contenteditable="true"] {
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

.canvas-layer[data-type="button"],
.canvas-layer[data-type="tag"],
.canvas-layer[data-type="avatar"] {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
}

.canvas-layer[data-type="image"] {
  overflow: visible;
}

.canvas-layer[data-type="mask"] {
  pointer-events: none;
  background-size: 100% 100%;
  mix-blend-mode: multiply;
}

.canvas-layer[data-type="mask"].is-selected {
  pointer-events: auto;
  outline-style: dashed;
  outline-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.image-fill {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  pointer-events: none;
}

.canvas-layer[data-type="image"] .image-fill {
  inset: var(--raster-stroke-inset, 0px);
}

.image-fill::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.image-fill::after {
  content: "";
  position: absolute;
  inset: auto 12% 14% 12%;
  height: 42%;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.32);
  clip-path: polygon(0 100%, 32% 42%, 53% 68%, 72% 32%, 100% 100%);
}

.image-fill.has-source::before,
.image-fill.has-source::after {
  display: none;
}

.resize-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  z-index: 3;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
  cursor: nwse-resize;
}

.transform-handle {
  position: absolute;
  z-index: 4;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 2px;
  background: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.selection-transform-box {
  position: absolute;
  z-index: 48000;
  border: 1px solid var(--green);
  pointer-events: none;
}

.selection-transform-box .transform-handle,
.selection-transform-box .rotate-handle,
.selection-transform-box .resize-handle {
  pointer-events: auto;
}

.selection-transform-box.is-basic {
  border-color: var(--blue);
}

.selection-transform-box.is-basic .resize-handle {
  z-index: 1;
}

.transform-handle[data-corner="n"],
.transform-handle[data-corner="s"] {
  width: 28px;
  height: 8px;
}

.transform-handle[data-corner="e"],
.transform-handle[data-corner="w"] {
  width: 8px;
  height: 28px;
}

.transform-handle[data-corner="nw"] {
  left: -5px;
  top: -5px;
  cursor: nwse-resize;
}

.transform-handle[data-corner="n"] {
  left: 50%;
  top: -4px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.transform-handle[data-corner="ne"] {
  right: -5px;
  top: -5px;
  cursor: nesw-resize;
}

.transform-handle[data-corner="e"] {
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.transform-handle[data-corner="sw"] {
  left: -5px;
  bottom: -5px;
  cursor: nesw-resize;
}

.transform-handle[data-corner="s"] {
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.transform-handle[data-corner="se"] {
  right: -5px;
  bottom: -5px;
  cursor: nwse-resize;
}

.transform-handle[data-corner="w"] {
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.rotate-handle {
  position: absolute;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(15, 118, 110, 0.52);
  border-radius: 999px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 3px 10px rgba(31, 37, 49, .16);
  cursor: grab;
}

.rotate-handle:active {
  cursor: grabbing;
}

.rotate-handle svg {
  width: 14px;
  height: 14px;
}

.rotate-handle[data-corner="nw"] {
  left: -30px;
  top: -30px;
}

.rotate-handle[data-corner="ne"] {
  right: -30px;
  top: -30px;
}

.rotate-handle[data-corner="se"] {
  right: -30px;
  bottom: -30px;
}

.rotate-handle[data-corner="sw"] {
  left: -30px;
  bottom: -30px;
}

.cut-path {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 30;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.snap-guides-layer {
  position: absolute;
  z-index: 45000;
  overflow: visible;
  pointer-events: none;
}

.snap-guide-line {
  stroke: #ff3fd2;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.snap-guide-badge rect {
  fill: rgba(31, 41, 55, 0.92);
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.snap-guide-badge text {
  fill: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  dominant-baseline: middle;
}

.artboard.is-lasso-mode .canvas-layer {
  pointer-events: none;
}

.lasso-overlay {
  position: absolute;
  inset: 0;
  z-index: 50000;
  cursor: crosshair;
  pointer-events: auto;
}

.magic-wand-outline {
  position: absolute;
  transform-origin: center center;
  pointer-events: none;
}

.magic-wand-outline > span {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, #ffffff 0 4px, #111827 4px 8px);
  background-size: 16px 16px;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  animation: magic-wand-ants 620ms linear infinite;
}

@keyframes magic-wand-ants {
  to { background-position: 16px 0; }
}

.cut-path.is-overlay {
  inset: 0;
  z-index: 1;
}

.cut-path path {
  fill: rgba(15, 118, 110, 0.14);
  stroke: var(--green);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

.cut-path.is-lasso path {
  fill: none;
  stroke-linecap: butt;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.cut-path.is-lasso .lasso-fill {
  fill: rgba(37, 99, 235, 0.14);
  stroke: none;
  animation: none;
}

.cut-path.is-lasso .lasso-ants-white {
  stroke: #ffffff;
  stroke-width: 3;
  stroke-dasharray: 7 7;
  stroke-dashoffset: 0;
  animation: lasso-march-white 650ms linear infinite;
}

.cut-path.is-lasso .lasso-ants-black {
  stroke: #111827;
  stroke-width: 1.6;
  stroke-dasharray: 7 7;
  stroke-dashoffset: 7;
  animation: lasso-march-black 650ms linear infinite;
}

.cut-path.is-open path {
  fill: none;
}

.cut-path circle {
  fill: #ffffff;
  stroke: #111827;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.cut-path.is-lasso circle {
  r: 4.5px;
}

@keyframes lasso-march-white {
  to {
    stroke-dashoffset: -14;
  }
}

@keyframes lasso-march-black {
  to {
    stroke-dashoffset: -7;
  }
}

.marquee-box {
  position: absolute;
  z-index: 20;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border: 1px solid rgba(37, 99, 235, 0.95);
  background: rgba(37, 99, 235, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.65) inset;
  pointer-events: none;
}

.marquee-box.is-contain {
  border-color: rgba(15, 118, 110, 0.95);
  background: rgba(15, 118, 110, 0.12);
}

.marquee-badge {
  position: absolute;
  right: -1px;
  bottom: calc(100% + 6px);
  min-width: 90px;
  padding: 4px 7px;
  border: 1px solid currentColor;
  border-radius: 6px;
  color: var(--blue);
  background: rgba(255, 255, 255, .96);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.marquee-box.is-contain .marquee-badge {
  color: var(--green);
}

.floating-toolbar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.shape-tool {
  position: relative;
  width: 34px;
  height: 34px;
}

.shape-tool > .tool-button {
  width: 34px;
  height: 34px;
}

.lasso-tool {
  position: relative;
  width: 34px;
  height: 34px;
}

.lasso-tool > .tool-button {
  width: 34px;
  height: 34px;
}

.shape-menu-toggle {
  position: absolute;
  right: 1px;
  bottom: 1px;
  display: grid;
  place-items: center;
  width: 13px;
  height: 11px;
  border-radius: 3px;
  color: var(--muted);
  background: rgba(255, 255, 255, .88);
  font-size: 9px;
  line-height: 1;
}

.shape-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 50;
  display: none;
  min-width: 174px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}

.shape-menu.is-open {
  display: grid;
  gap: 3px;
}

.shape-menu button {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border-radius: 6px;
  padding: 0 8px;
  text-align: left;
  font-size: 13px;
  font-weight: 720;
}

.shape-menu button:hover,
.shape-menu button.is-active {
  background: var(--panel-soft);
}

.tool-button.is-active {
  border-color: rgba(37, 99, 235, .32);
  color: var(--blue);
  background: rgba(37, 99, 235, .10);
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
}

.zoom-readout {
  width: 58px;
  font-size: 12px;
  font-weight: 800;
}

.active-tool-chip {
  display: inline-grid;
  place-items: center;
  min-width: 132px;
  max-width: 180px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 820;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snap-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.selection-hint {
  position: absolute;
  left: 16px;
  bottom: 16px;
  max-width: 360px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, .88);
  font-size: 12px;
  font-weight: 650;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
}

.selection-hint.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.inspector {
  padding: 10px 12px 18px;
}

.section {
  padding: 11px 0 13px;
  border-bottom: 1px solid var(--line);
}

.section:last-child {
  border-bottom: 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  margin-bottom: 9px;
  color: var(--soft-text);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.figma-inspector .section {
  padding: 13px 0;
}

.inspector-object-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 13px;
}

.inspector-object-head strong {
  display: block;
  font-size: 13px;
  font-weight: 850;
}

.section-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.property-row {
  display: grid;
  gap: 8px;
}

.property-eye {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--soft-text);
  background: transparent;
}

.property-eye svg {
  width: 15px;
  height: 15px;
}

.property-eye.is-active {
  color: var(--ink);
}

.property-eye:hover {
  border-color: var(--line);
  background: #fff;
}

.selection-count {
  min-width: 0;
  color: var(--blue);
  text-transform: none;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--soft-text);
  font-size: 11px;
  font-weight: 760;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  color: var(--ink);
  background: #fff;
}

.field input,
.field select {
  height: 34px;
}

.field textarea {
  min-height: 78px;
  resize: vertical;
  padding-top: 8px;
}

.field input[type="color"] {
  padding: 2px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.segmented.two {
  grid-template-columns: repeat(2, 1fr);
}

.segmented button {
  min-height: 28px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.segmented button.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 4px rgba(31, 37, 49, .12);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.small-action {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.small-action:hover {
  border-color: var(--line-strong);
  background: var(--panel-soft);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 18px;
  color: var(--soft-text);
  text-align: center;
  font-size: 13px;
}

.code-block {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  color: #1f2937;
  background: #f8fafc;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

.preview-modal {
  width: min(94vw, 1040px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
}

.preview-modal::backdrop {
  background: rgba(17, 24, 39, .56);
}

.preview-frame {
  margin: 0;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.preview-stage {
  display: grid;
  place-items: center;
  min-height: 620px;
  padding: 28px;
  overflow: auto;
  background: #e7e9ee;
}

.preview-stage .artboard {
  transform: scale(.56);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 680;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.context-menu {
  position: fixed;
  z-index: 80;
  display: none;
  min-width: 178px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}

.context-menu.is-open {
  display: grid;
  gap: 2px;
}

.context-menu button {
  min-height: 32px;
  border-radius: 6px;
  padding: 0 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 720;
}

.context-menu button:hover {
  background: var(--panel-soft);
}

.color-palette {
  position: fixed;
  z-index: 90;
  display: none;
  width: 236px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.color-palette.is-open {
  display: grid;
  gap: 8px;
}

.color-mode-row {
  display: grid;
  grid-template-columns: repeat(2, 32px) 1fr;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
}

.color-mode-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
}

.color-mode-button svg {
  width: 16px;
  height: 16px;
}

.color-mode-button.is-active {
  border-color: var(--line-strong);
  color: var(--blue);
  background: #f8fafc;
}

.color-mode-button:disabled {
  opacity: .36;
  cursor: default;
}

.color-plane {
  position: relative;
  height: 150px;
  border-radius: 7px;
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, hsl(220 100% 50%));
  cursor: crosshair;
}

#color-cursor {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .38);
  transform: translate(-6px, -6px);
  pointer-events: none;
}

.color-hue,
.color-hex {
  width: 100%;
}

.color-row {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 8px;
}

.color-current {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background:
    linear-gradient(45deg, #dfe3e8 25%, transparent 25% 75%, #dfe3e8 75%),
    linear-gradient(45deg, #dfe3e8 25%, transparent 25% 75%, #dfe3e8 75%),
    #fff;
  background-position: 0 0, 5px 5px, 0 0;
  background-size: 10px 10px;
}

.color-hex {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 8px;
}

.color-gradient-panel {
  display: none;
  gap: 8px;
  padding-top: 2px;
}

.color-palette[data-mode="gradient"] .color-gradient-panel {
  display: grid;
}

.gradient-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 32px;
  gap: 6px;
}

.gradient-controls select,
.gradient-controls input {
  min-width: 0;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

.gradient-preview {
  position: relative;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(90deg, #2a8fff, #195699);
}

.gradient-stop-handle {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 24px;
  border: 2px solid #fff;
  border-radius: 6px;
  background: var(--stop-color, #2a8fff);
  box-shadow: 0 0 0 1px rgba(31, 37, 49, .22), 0 4px 10px rgba(31, 37, 49, .16);
  transform: translate(-50%, -50%);
  cursor: ew-resize;
  touch-action: none;
}

.gradient-stop-handle.is-active {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.gradient-stops-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  color: var(--soft-text);
  font-size: 11px;
  font-weight: 820;
}

.gradient-stops {
  display: grid;
  gap: 5px;
  max-height: 128px;
  overflow: auto;
}

.gradient-stop-row {
  display: grid;
  grid-template-columns: 44px 20px minmax(0, 1fr) 48px 24px;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  border-radius: 6px;
  padding: 3px;
}

.gradient-stop-row.is-active {
  background: #eef4ff;
}

.gradient-stop-row input {
  min-width: 0;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 6px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
}

.gradient-stop-row .stop-swatch {
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.gradient-stop-remove {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 16px;
}

.gradient-stop-remove:hover {
  color: var(--ink);
  background: #fff;
}

.color-trigger {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 8px 0 5px;
  background: #fff;
  text-align: left;
}

.color-trigger span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 236px;
    --right-width: 286px;
  }

  .text-button span {
    display: none;
  }

  .text-button {
    min-width: 34px;
    padding: 0;
  }
}

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

  .left-panel,
  .right-panel {
    display: none;
  }

  .viewport {
    min-width: 1180px;
  }
}
