:root {
  color-scheme: light;
  --ink: #241f28;
  --muted: #8b8494;
  --line: rgb(255 255 255 / 62%);
  --panel: rgb(255 255 255 / 58%);
  --panel-strong: rgb(255 255 255 / 76%);
  --soft: rgb(255 245 250 / 64%);
  --accent: #f56847;
  --accent-dark: #c94c32;
  --blue: #8fc2f4;
  --shadow: 0 24px 60px rgb(106 84 116 / 20%);
  --inner-shadow: inset 0 1px 0 rgb(255 255 255 / 78%);
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

@font-face {
  font-family: "Alibaba PuHuiTi";
  src: url("otf/AlibabaPuHuiTi-2-55-Regular.otf?v=af8f7e04c3ba") format("opentype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 6%, rgb(203 218 255 / 78%), transparent 32%),
    radial-gradient(circle at 78% 10%, rgb(255 194 209 / 82%), transparent 34%),
    radial-gradient(circle at 78% 82%, rgb(255 232 189 / 70%), transparent 30%),
    linear-gradient(135deg, #edf3ff 0%, #fff2f8 48%, #fff6e8 100%);
}

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

button {
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(640px, 1fr) minmax(280px, 360px);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px 22px;
  min-height: min(900px, calc(100vh - 70px));
  margin: 35px auto;
  width: min(1680px, calc(100vw - 82px));
  padding: 26px 34px 34px;
  border: 1px solid rgb(255 255 255 / 82%);
  border-radius: 42px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 72%), rgb(255 248 252 / 48%)),
    rgb(255 255 255 / 52%);
  box-shadow: var(--shadow), var(--inner-shadow);
  backdrop-filter: blur(24px);
}

.workspace,
.controls {
  min-width: 0;
}

.workspace {
  display: contents;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 4px 8px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffe4ee, #fff8fb);
  box-shadow: 0 10px 22px rgb(221 104 147 / 20%), var(--inner-shadow);
  font-size: 25px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: 0;
}

.topbar p {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.top-actions,
.action-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.top-actions {
  width: min(360px, 100%);
}

.ghost-action,
.icon-action,
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--ink);
  background: rgb(255 255 255 / 62%);
  box-shadow: 0 10px 24px rgb(116 92 111 / 11%), var(--inner-shadow);
}

.ghost-action {
  padding: 0 18px;
  border: 1px solid rgb(255 255 255 / 72%);
}

.top-actions .ghost-action {
  flex: 1 1 0;
  padding: 0 14px;
}

.ghost-action span,
.icon-action {
  font-weight: 800;
}

.icon-action {
  width: 44px;
  padding: 0;
}

.primary-action {
  flex: 1;
  min-height: 58px;
  color: white;
  font-size: 19px;
  font-weight: 800;
  box-shadow: 0 18px 32px rgb(210 103 151 / 24%), var(--inner-shadow);
}

.primary-action {
  background: linear-gradient(135deg, #7fb3f4, #c9edff);
}

.top-actions .primary-action {
  flex: 1.32 1 0;
  min-height: 44px;
  padding: 0 14px;
  font-size: 15px;
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.secondary-action {
  width: 100%;
  min-height: 38px;
  background: rgb(255 255 255 / 66%);
  border: 1px solid rgb(255 255 255 / 72%);
  color: var(--muted);
}

.preview-area {
  grid-column: 1;
  position: relative;
  height: clamp(640px, calc(100vh - 172px), 820px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 78%);
  border-radius: 30px;
  background:
    radial-gradient(circle at 64% 56%, rgb(255 171 205 / 26%), transparent 23%),
    radial-gradient(circle at 25% 90%, rgb(183 174 248 / 22%), transparent 26%),
    linear-gradient(135deg, rgb(255 255 255 / 60%), rgb(255 245 251 / 46%));
  box-shadow: 0 16px 45px rgb(103 80 111 / 12%), var(--inner-shadow);
}

.preview-area::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgb(99 78 105 / 5%) 1px, transparent 1px),
    linear-gradient(rgb(99 78 105 / 5%) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(90deg, transparent 0, black 90px, black 100%);
  pointer-events: none;
}

.preview-title {
  position: absolute;
  top: 28px;
  left: 128px;
  z-index: 2;
}

.preview-title h2 {
  font-size: 18px;
  letter-spacing: 0;
}

.preview-title h2::before {
  content: "✦ ";
  color: var(--accent);
}

.preview-title p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
}

.object-panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.object-panel > * {
  pointer-events: auto;
}

.custom-toolbar,
.object-list,
.floating-editor {
  border: 1px solid rgb(255 255 255 / 74%);
  border-radius: 20px;
  background: rgb(255 255 255 / 52%);
  box-shadow: 0 14px 30px rgb(116 92 111 / 10%), var(--inner-shadow);
  backdrop-filter: blur(16px);
}

.custom-toolbar {
  position: absolute;
  top: 22px;
  left: 24px;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.add-menu-toggle,
.tool-tab,
.add-submenu button,
.layer-select,
.layer-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 14px;
  background: rgb(255 255 255 / 62%);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.add-menu-toggle {
  flex-direction: column;
  gap: 3px;
  width: 76px;
  min-height: 66px;
  padding: 8px 10px;
  border: 1px solid rgb(255 255 255 / 74%);
  border-radius: 18px;
  background: rgb(255 255 255 / 64%);
  color: var(--accent-dark);
  box-shadow: 0 14px 30px rgb(116 92 111 / 10%), var(--inner-shadow);
  backdrop-filter: blur(16px);
  font-size: 12px;
  font-weight: 800;
}

.add-menu-toggle span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgb(245 104 71 / 16%);
  font-size: 24px;
  line-height: 1;
}

.add-menu-panel {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: auto;
  padding: 10px;
  border: 1px solid rgb(255 255 255 / 74%);
  border-radius: 20px;
  background: rgb(255 255 255 / 58%);
  box-shadow: 0 14px 30px rgb(116 92 111 / 10%), var(--inner-shadow);
  backdrop-filter: blur(16px);
}

.custom-toolbar.open .add-menu-panel {
  display: flex;
}

.add-menu-row,
.add-submenu {
  display: flex;
  gap: 8px;
}

.add-submenu {
  display: none;
  padding-top: 8px;
  border-top: 1px solid rgb(245 104 71 / 24%);
}

.custom-toolbar[data-submenu="decoration"] .add-submenu[data-submenu-panel="decoration"],
.custom-toolbar[data-submenu="background"] .add-submenu[data-submenu-panel="background"] {
  display: flex;
}

.add-submenu button {
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 14px;
  font-size: 19px;
  font-weight: 900;
}

.add-submenu[data-submenu-panel="background"] button {
  width: auto;
  min-width: 72px;
  padding: 0 14px;
  font-size: 14px;
  letter-spacing: 0;
}

.menu-icon-canvas {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.tool-tab span {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  color: var(--accent);
  font-weight: 900;
}

.tool-tab:hover,
.tool-tab.active,
.layer-select:hover,
.layer-item.active .layer-select,
.layer-delete:hover {
  color: var(--accent-dark);
  outline: 1px solid rgb(245 104 71 / 48%);
  background: rgb(245 104 71 / 12%);
}

#imagePicker,
#shapeImagePicker {
  display: none;
}

.upload-shape-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.upload-shape-box .secondary-action {
  width: 100%;
  min-height: 38px;
}

.upload-shape-box span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.object-list {
  position: absolute;
  top: 154px;
  left: 22px;
  bottom: 86px;
  width: 156px;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px;
  max-height: none;
  overflow-y: auto;
}

.object-list::before {
  content: "图层";
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.layer-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: stretch;
}

.layer-select {
  width: 100%;
  min-height: 62px;
  justify-content: flex-start;
  gap: 9px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid transparent;
  background: linear-gradient(180deg, rgb(255 255 255 / 76%), rgb(255 244 248 / 56%));
  white-space: normal;
}

.layer-delete {
  width: 28px;
  min-height: 62px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 13px;
  background: rgb(255 255 255 / 58%);
  color: #b58498;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
}

.layer-delete:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.layer-thumb {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid rgb(245 104 71 / 32%);
  border-radius: 13px;
  background: rgb(245 104 71 / 12%);
  box-shadow: var(--inner-shadow);
}

.layer-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-align: left;
  text-overflow: ellipsis;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.object-editor,
.background-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.floating-editor {
  position: absolute;
  top: 116px;
  right: 22px;
  z-index: 4;
  width: min(270px, calc(100% - 230px));
  max-height: calc(100% - 190px);
  overflow-y: auto;
  padding: 13px;
  pointer-events: auto;
  opacity: 1;
  transform: translateX(0);
  transition: transform 180ms ease, opacity 160ms ease;
}

.floating-editor h2 {
  margin: 0 0 9px;
  font-size: 15px;
  letter-spacing: 0;
}

.custom-control {
  width: 100%;
  border-color: rgb(245 104 71 / 34%);
  background:
    linear-gradient(135deg, rgb(255 238 247 / 72%), rgb(255 255 255 / 54%)),
    var(--panel);
}

.floating-editor.custom-control {
  width: min(270px, calc(100% - 230px));
}

.floating-editor.is-collapsed {
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 34px));
}

body[data-step="shape"] .custom-control[hidden] {
  display: none;
}

.editing-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 12px;
  margin-bottom: 8px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgb(245 104 71 / 14%);
  box-shadow: var(--inner-shadow);
  font-size: 13px;
  font-weight: 800;
}

.background-editor {
  grid-template-columns: 1fr;
}

.app-shell:has(.object-panel[data-tool="background"]) .object-editor,
.app-shell:not(:has(.object-panel[data-tool="background"])) .background-editor {
  display: none;
}

.object-editor .compact,
.background-editor .compact {
  margin-top: 0;
}

.object-editor .field:has(#objSize),
.object-editor .field:has(#objRotation) {
  grid-column: 1 / -1;
}

.object-editor .field:has(#objSize) {
  order: 1;
}

.object-editor .field:has(#objRotation) {
  order: 2;
}

.object-editor .field:has(#objX),
.object-editor .field:has(#objY) {
  order: 3;
}

.object-editor .text-only {
  order: 4;
}

.object-editor .field:has(#objSize) input[type="range"],
.object-editor .field:has(#objRotation) input[type="range"] {
  width: 100%;
}

.object-editor .compact-button {
  grid-column: span 2;
}

.object-editor .text-only,
.object-editor .text-only.select-field {
  grid-column: 1 / -1;
}

.object-editor[data-kind="text"] .decoration-only,
.object-editor[data-kind="decoration"] .text-only,
.object-editor[data-kind="image"] .text-only,
.object-editor[data-kind="drawing"] .text-only,
.object-editor[data-kind="image"] .decoration-only,
.object-editor[data-kind="drawing"] .decoration-only {
  display: none;
}

#previewCanvas {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  cursor: grab;
  touch-action: none;
}

#previewCanvas:active {
  cursor: grabbing;
}

.preview-note {
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 28px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}

.shape-hero-choice {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  gap: 7px;
  width: min(340px, calc(100% - 56px));
  min-height: 128px;
  padding: 24px;
  border: 1px solid rgb(202 76 50 / 34%);
  border-radius: 22px;
  color: white;
  background: var(--accent);
  box-shadow:
    0 22px 38px rgb(112 66 54 / 26%),
    0 10px 22px rgb(245 104 71 / 24%),
    inset 0 1px 0 rgb(255 255 255 / 34%),
    inset 0 -4px 0 rgb(126 50 33 / 18%);
  cursor: pointer;
  text-shadow: 0 1px 1px rgb(97 38 24 / 22%);
  transform: translate(-50%, -50%);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.shape-hero-choice[hidden],
body[data-shape-chosen="true"] .shape-hero-choice {
  display: none !important;
}

.shape-hero-choice span {
  color: white;
  font-size: 22px;
  font-weight: 900;
}

.shape-hero-choice small {
  color: rgb(255 255 255 / 78%);
  font-size: 13px;
  font-weight: 800;
}

.shape-hero-choice:hover {
  filter: brightness(1.02);
  box-shadow:
    0 25px 42px rgb(112 66 54 / 28%),
    0 12px 24px rgb(245 104 71 / 28%),
    inset 0 1px 0 rgb(255 255 255 / 38%),
    inset 0 -4px 0 rgb(126 50 33 / 20%);
  transform: translate(-50%, -51%);
}

.drawing-dialog {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgb(36 31 40 / 18%);
  backdrop-filter: blur(6px);
}

.drawing-dialog[hidden] {
  display: none;
}

.shape-dialog,
.upload-image-dialog,
.share-dialog,
.feedback-dialog,
.guide-dialog,
.examples-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(36 31 40 / 22%);
  backdrop-filter: blur(8px);
}

.shape-dialog[hidden],
.upload-image-dialog[hidden],
.share-dialog[hidden],
.feedback-dialog[hidden],
.guide-dialog[hidden],
.examples-dialog[hidden] {
  display: none;
}

.shape-card,
.upload-image-card,
.share-card,
.feedback-card,
.guide-card,
.examples-card {
  position: relative;
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid rgb(255 255 255 / 82%);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgb(255 246 251 / 96%), rgb(255 255 255 / 92%)),
    var(--panel-strong);
  box-shadow: 0 24px 70px rgb(64 48 72 / 24%), var(--inner-shadow);
}

.upload-image-card {
  width: min(420px, calc(100vw - 28px));
  padding: 22px;
}

.shape-card {
  width: min(1060px, calc(100vw - 28px));
}

.shape-dialog {
  background: rgb(206 205 199 / 50%);
  backdrop-filter: blur(14px) saturate(0.74);
}

.shape-card {
  isolation: isolate;
  padding: 48px 40px 38px;
  border: 1px solid rgb(255 255 255 / 84%);
  border-radius: 30px;
  color: #292927;
  background:
    linear-gradient(120deg, rgb(255 255 255 / 42%) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 18% 12%, rgb(255 255 255 / 72%), transparent 36%),
    linear-gradient(145deg, rgb(247 246 242 / 98%), rgb(232 231 225 / 97%));
  background-size: 6px 6px, auto, auto;
  box-shadow:
    0 34px 58px rgb(47 46 42 / 28%),
    0 7px 16px rgb(47 46 42 / 13%),
    inset 0 1px 0 rgb(255 255 255 / 88%),
    inset 0 -1px 0 rgb(139 136 127 / 22%);
}

.shape-card > * {
  position: relative;
  z-index: 1;
}

.shape-card .guide-close {
  top: 38px;
  right: 40px;
  z-index: 2;
  width: 56px;
  height: 56px;
  border: 1px solid rgb(255 255 255 / 74%);
  border-radius: 18px;
  color: #5f5f5a;
  background:
    linear-gradient(145deg, #f0efeb, #dcdbd5);
  box-shadow:
    8px 10px 18px rgb(93 91 84 / 24%),
    -4px -4px 10px rgb(255 255 255 / 58%),
    inset 0 1px 0 rgb(255 255 255 / 82%),
    inset 0 -1px 0 rgb(119 116 108 / 18%);
  font-size: 36px;
  font-weight: 300;
}

.examples-card {
  width: min(980px, calc(100vw - 28px));
}

.shape-card h2,
.upload-image-card h2,
.share-card h2,
.feedback-card h2,
.guide-card h2,
.examples-card h2 {
  margin: 0 46px 14px 0;
  font-size: 22px;
}

.shape-card h2 {
  max-width: 620px;
  margin-bottom: 8px;
  color: #262624;
  font-size: 34px;
  font-weight: 900;
  line-height: 1.08;
}

.shape-card > p,
.upload-image-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.shape-card > p {
  max-width: 680px;
  color: #777670;
  font-size: 15px;
  line-height: 1.65;
}

.shape-dialog-layout {
  display: grid;
  grid-template-columns: 274px minmax(0, 1fr);
  gap: 34px;
  margin-top: 34px;
}

.shape-category-tabs {
  position: relative;
  display: grid;
  gap: 20px;
  align-content: start;
  padding-left: 0;
}

.shape-category-tabs::before {
  content: "";
  position: absolute;
  top: 58px;
  bottom: 58px;
  left: -24px;
  width: 2px;
  border-radius: 999px;
  background: rgb(145 143 136 / 22%);
}

.shape-category-nav-card {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 36px;
  gap: 16px;
  align-items: center;
  min-height: 96px;
  width: 100%;
  padding: 18px;
  border: 1px solid rgb(255 255 255 / 82%);
  border-radius: 18px;
  color: #343431;
  text-align: left;
  background:
    linear-gradient(145deg, rgb(251 250 247 / 96%), rgb(231 230 225 / 94%));
  box-shadow:
    8px 11px 18px rgb(101 99 91 / 19%),
    -4px -4px 10px rgb(255 255 255 / 64%),
    inset 0 1px 0 rgb(255 255 255 / 86%),
    inset 0 -1px 0 rgb(135 132 123 / 12%);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.shape-category-nav-card::before {
  content: "";
  position: absolute;
  left: -28px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #b8b7b0;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 52%),
    0 2px 4px rgb(76 74 68 / 16%);
}

.shape-category-nav-card:hover {
  transform: translateY(-1px);
  box-shadow:
    9px 13px 20px rgb(101 99 91 / 21%),
    -4px -4px 10px rgb(255 255 255 / 66%),
    inset 0 1px 0 rgb(255 255 255 / 88%),
    inset 0 -1px 0 rgb(135 132 123 / 14%);
}

.shape-category-nav-card.is-active {
  min-height: 96px;
  align-items: center;
  color: white;
  background:
    linear-gradient(145deg, var(--accent), var(--accent-dark));
  box-shadow:
    10px 16px 25px rgb(103 60 52 / 24%),
    0 3px 7px rgb(94 49 40 / 16%),
    inset 0 1px 0 rgb(255 255 255 / 28%),
    inset 0 -2px 0 rgb(96 42 32 / 18%);
}

.shape-category-nav-card.is-active::before {
  background: var(--accent);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 30%),
    0 2px 5px rgb(93 48 38 / 18%);
}

.shape-category-icon {
  width: 58px;
  height: 52px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 62%), rgb(227 226 221 / 54%));
  box-shadow:
    inset 3px 3px 6px rgb(121 118 109 / 17%),
    inset -2px -2px 5px rgb(255 255 255 / 72%),
    0 1px 0 rgb(255 255 255 / 58%);
}

.shape-category-nav-card.is-active .shape-category-icon {
  background: rgb(255 255 255 / 18%);
  box-shadow:
    inset 3px 3px 7px rgb(101 48 40 / 16%),
    inset -2px -2px 5px rgb(255 255 255 / 26%);
}

.shape-category-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.shape-category-copy strong {
  overflow: hidden;
  color: currentColor;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shape-category-copy small {
  color: rgb(72 72 68 / 62%);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.shape-category-nav-card.is-active .shape-category-copy small {
  color: rgb(255 255 255 / 82%);
}

.shape-category-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #767570;
  background: rgb(255 255 255 / 38%);
  box-shadow:
    inset 2px 2px 4px rgb(112 110 102 / 16%),
    inset -1px -1px 3px rgb(255 255 255 / 62%);
  font-size: 30px;
  line-height: 1;
}

.shape-category-nav-card.is-active .shape-category-arrow {
  color: var(--accent-dark);
  background: rgb(255 255 255 / 58%);
}

.shape-selection-panel {
  display: grid;
  gap: 22px;
  min-height: 420px;
  padding: 28px;
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 22px;
  background:
    linear-gradient(120deg, rgb(255 255 255 / 22%) 0 1px, transparent 1px 6px),
    linear-gradient(145deg, rgb(246 245 241 / 88%), rgb(226 225 219 / 74%));
  background-size: 7px 7px, auto;
  box-shadow:
    inset 7px 8px 17px rgb(119 116 107 / 16%),
    inset -6px -6px 14px rgb(255 255 255 / 68%),
    0 12px 21px rgb(93 91 84 / 12%);
}

.shape-selection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #777670;
  font-size: 14px;
  font-weight: 700;
}

.shape-panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #292927;
}

.shape-panel-title i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d86c1f;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 26%);
}

.shape-panel-title strong {
  font-size: 18px;
  font-weight: 900;
}

.shape-card .shape-category-list {
  display: block;
  min-height: 0;
  margin-bottom: 0;
}

.shape-card .shape-category-group {
  min-height: 0;
}

.shape-card .shape-category-group.is-hidden {
  display: none !important;
}

.shape-card .shape-category-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 18px;
  max-height: 344px;
  overflow-y: auto;
  padding: 2px 4px 6px;
  background: transparent;
}

.shape-card .shape-category-options label {
  min-height: 178px;
  padding: 16px 12px 18px;
  font-size: 14px;
}

.shape-option-card {
  position: relative;
  display: grid;
  gap: 14px;
  align-content: center;
  justify-items: center;
  border: 1px solid rgb(255 255 255 / 74%);
  border-radius: 18px;
  color: #6c6b65;
  background:
    linear-gradient(145deg, rgb(250 249 246 / 94%), rgb(229 228 223 / 92%));
  box-shadow:
    7px 10px 16px rgb(91 89 82 / 18%),
    -4px -4px 10px rgb(255 255 255 / 66%),
    inset 0 1px 0 rgb(255 255 255 / 84%),
    inset 0 -1px 0 rgb(132 129 120 / 13%);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.shape-option-card:hover {
  transform: translateY(-1px);
  color: #383835;
}

.shape-option-preview {
  width: 116px;
  height: 98px;
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgb(252 251 248 / 86%), rgb(221 220 215 / 70%));
  box-shadow:
    inset 5px 6px 11px rgb(116 113 105 / 18%),
    inset -4px -4px 9px rgb(255 255 255 / 72%),
    0 1px 0 rgb(255 255 255 / 48%);
}

.shape-option-name {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.2;
  font-weight: 800;
}

.shape-card .shape-option-card:has(input:checked) {
  border-color: rgb(206 96 29 / 76%);
  color: #373633;
  background: linear-gradient(145deg, #fbfaf7, #ecebe6);
  box-shadow:
    inset 0 0 0 1px rgb(206 96 29 / 18%),
    8px 12px 18px rgb(91 89 82 / 20%),
    -4px -4px 10px rgb(255 255 255 / 72%),
    inset 0 1px 0 rgb(255 255 255 / 88%),
    inset 0 -1px 0 rgb(132 129 120 / 16%);
}

.shape-card .shape-option-card:has(input:checked) .shape-option-preview {
  background: linear-gradient(145deg, #fffdf8, #e7e5df);
}

.shape-card .upload-shape-box {
  grid-template-columns: 58px minmax(0, 1fr) 150px;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding: 18px 22px;
  border: 1px solid rgb(255 255 255 / 74%);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgb(250 249 246 / 92%), rgb(229 228 223 / 82%));
  box-shadow:
    inset 5px 6px 13px rgb(119 116 107 / 13%),
    inset -5px -5px 12px rgb(255 255 255 / 66%),
    0 10px 18px rgb(91 89 82 / 12%);
}

.upload-shape-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  color: #d86c1f;
  background: linear-gradient(145deg, #efeee9, #deddd7);
  box-shadow:
    6px 8px 13px rgb(91 89 82 / 18%),
    -3px -3px 8px rgb(255 255 255 / 62%),
    inset 0 1px 0 rgb(255 255 255 / 82%),
    inset 0 -1px 0 rgb(132 129 120 / 14%);
  font-size: 26px;
  font-weight: 600;
}

.upload-shape-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.upload-shape-copy strong {
  color: #343431;
  font-size: 15px;
  font-weight: 900;
}

.upload-shape-copy small {
  color: #8a8882;
  font-size: 12px;
  line-height: 1.4;
}

.shape-card .upload-shape-box .secondary-action {
  min-height: 48px;
  border: 1px solid rgb(185 183 176 / 48%);
  border-radius: 999px;
  color: #343431;
  background: linear-gradient(145deg, #fdfcf8, #e6e5e0);
  box-shadow:
    6px 8px 13px rgb(91 89 82 / 16%),
    -3px -3px 8px rgb(255 255 255 / 66%),
    inset 0 1px 0 rgb(255 255 255 / 86%),
    inset 0 -1px 0 rgb(132 129 120 / 12%);
  font-weight: 900;
}

.shape-card .upload-shape-box span {
  color: inherit;
}

.upload-image-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.upload-image-actions .secondary-action {
  flex: 0 0 auto;
  width: auto;
  min-height: 34px;
  padding: 0 13px;
  font-size: 12px;
  box-shadow: none;
}

.upload-image-actions .primary-action {
  flex: 0 0 auto;
  min-width: 154px;
  min-height: 54px;
  padding: 0 24px;
  font-size: 18px;
}

.feedback-card {
  width: min(620px, calc(100vw - 28px));
}

.share-card {
  width: min(620px, calc(100vw - 28px));
}

.share-lead,
.share-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.share-preview-panel {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid rgb(245 104 71 / 22%);
  border-radius: 18px;
  background: rgb(255 255 255 / 58%);
}

.share-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #ffffff;
  background: #62625c;
  font-size: 11px;
  font-weight: 900;
}

.share-preview-panel h3 {
  margin: 14px 0 8px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.3;
}

.share-preview-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.share-link-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
}

.share-link-panel code {
  display: block;
  min-width: 0;
  padding: 13px 14px;
  overflow: hidden;
  border: 1px solid rgb(245 104 71 / 20%);
  border-radius: 12px;
  color: #3e444a;
  background: rgb(255 255 255 / 68%);
  font-family: inherit;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-lead,
.feedback-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.feedback-qr-panel {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgb(245 104 71 / 22%);
  border-radius: 18px;
  background: rgb(255 255 255 / 58%);
}

.feedback-qr-panel img {
  display: block;
  width: 180px;
  height: 180px;
  border-radius: 18px;
  background: white;
  box-shadow: 0 14px 28px rgb(64 48 72 / 12%);
}

.feedback-qr-panel h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.feedback-qr-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.guide-section-title {
  margin: 18px 0 10px;
  color: var(--accent-dark);
  font-size: 15px;
}

.guide-card h2 + .guide-section-title {
  margin-top: 0;
}

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

.guide-grid article {
  padding: 14px;
  border: 1px solid rgb(245 104 71 / 24%);
  border-radius: 16px;
  background: rgb(255 255 255 / 58%);
}

.guide-grid h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.guide-grid p,
.guide-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.guide-faq {
  grid-template-columns: 1fr;
}

.guide-faq article {
  padding: 12px 14px;
}

.guide-faq h3 {
  color: var(--ink);
  font-size: 14px;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.example-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgb(245 104 71 / 24%);
  border-radius: 18px;
  background: rgb(255 255 255 / 58%);
}

.example-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 220 / 270;
  border-radius: 16px;
  background: #e9e9e3;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 70%);
}

.example-card h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 15px;
}

.example-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.example-actions {
  display: grid;
  gap: 8px;
}

.example-actions .secondary-action {
  min-height: 36px;
  color: #f5f4ef;
  background: #11110f;
}

.owner-only {
  display: none !important;
}

body[data-owner-mode="true"] .owner-only {
  display: grid !important;
}

.owner-template-panel {
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed rgb(17 17 15 / 24%);
  border-radius: 18px;
  background: rgb(238 238 234 / 70%);
}

.owner-template-panel h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 15px;
}

.owner-template-panel p,
.owner-template-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

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

.owner-template-list {
  display: grid;
  gap: 8px;
}

.owner-template-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: #f6f6f1;
}

.owner-template-item strong,
.owner-template-item span {
  display: block;
}

.owner-template-item strong {
  color: var(--ink);
  font-size: 13px;
}

.owner-template-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.owner-template-row-actions {
  display: flex;
  gap: 6px;
}

.owner-template-row-actions button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: #55554f;
  background: #eeeeea;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .examples-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.guide-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgb(245 104 71 / 14%);
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
  box-shadow: var(--inner-shadow);
}

.drawing-card {
  width: min(720px, calc(100% - 24px));
  padding: 16px;
  border: 1px solid rgb(255 255 255 / 78%);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgb(255 244 250 / 92%), rgb(255 255 255 / 88%)),
    var(--panel-strong);
  box-shadow: 0 24px 60px rgb(106 84 116 / 24%), var(--inner-shadow);
}

.drawing-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.drawing-header h2 {
  font-size: 17px;
}

.drawing-header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.drawing-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgb(255 255 255 / 72%);
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  box-shadow: var(--inner-shadow);
}

#drawingCanvas {
  display: block;
  width: 100%;
  height: min(360px, 45vh);
  border: 1px solid rgb(245 104 71 / 30%);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgb(245 104 71 / 7%) 1px, transparent 1px),
    linear-gradient(rgb(245 104 71 / 7%) 1px, transparent 1px),
    rgb(255 255 255 / 88%);
  background-size: 22px 22px;
  cursor: crosshair;
  touch-action: none;
}

.drawing-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 12px;
}

.drawing-actions {
  display: flex;
  gap: 10px;
}

.drawing-actions .secondary-action {
  width: auto;
  min-width: 72px;
  padding: 0 13px;
}

.drawing-done {
  min-height: 38px;
  padding: 0 18px;
  font-size: 14px;
}

.controls {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 12px;
  align-content: flex-start;
  align-items: stretch;
  height: clamp(640px, calc(100vh - 172px), 820px);
  overflow-y: auto;
  padding-right: 4px;
}

.step-tabs {
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  padding: 8px;
  border: 1px solid rgb(255 255 255 / 74%);
  border-radius: 24px;
  background: rgb(255 255 255 / 48%);
  box-shadow: 0 14px 30px rgb(116 92 111 / 10%), var(--inner-shadow);
  backdrop-filter: blur(16px);
}

.step-tab {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 52px;
  border-radius: 18px;
  color: var(--muted);
  background: rgb(255 255 255 / 58%);
  cursor: pointer;
  font-size: 13px;
}

.step-tab span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgb(245 104 71 / 14%);
  font-size: 12px;
  font-weight: 900;
}

.step-tab.active {
  color: var(--accent-dark);
  background: rgb(245 104 71 / 14%);
  outline: 1px solid rgb(245 104 71 / 48%);
  font-weight: 900;
}

.control-group {
  min-width: 0;
  width: 100%;
  padding: 13px;
  border: 1px solid rgb(255 255 255 / 74%);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 14px 30px rgb(116 92 111 / 10%), var(--inner-shadow);
  backdrop-filter: blur(16px);
}

.control-group[hidden] {
  display: none;
}

.control-group h2 {
  margin-bottom: 9px;
  font-size: 15px;
  letter-spacing: 0;
}

.action-row {
  width: 100%;
}

.segmented {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

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

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

.segmented label {
  display: grid;
  place-items: center;
  min-height: 32px;
  padding: 0 6px;
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 15px;
  background: rgb(255 255 255 / 58%);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  box-shadow: var(--inner-shadow);
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label:has(input:checked) {
  color: var(--accent-dark);
  background: rgb(245 104 71 / 13%);
  border-color: rgb(245 104 71 / 58%);
  font-weight: 800;
  box-shadow: 0 10px 20px rgb(245 104 71 / 13%), var(--inner-shadow);
}

.field,
.toggle {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.field span,
.toggle span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #6f6576;
  font-size: 13px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.toggle {
  grid-template-columns: 22px 1fr;
  align-items: center;
  cursor: pointer;
}

.toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.toggle span {
  color: var(--ink);
}

.select-field select,
.object-editor input[type="text"],
.object-editor textarea,
.object-editor select,
.background-editor select {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid rgb(255 255 255 / 78%);
  border-radius: 14px;
  background: rgb(255 255 255 / 68%);
  color: var(--ink);
  box-shadow: var(--inner-shadow);
}

.select-field select:focus,
.object-editor input[type="text"]:focus,
.object-editor textarea:focus,
.object-editor select:focus,
.background-editor select:focus {
  outline: 2px solid rgb(245 104 71 / 22%);
  border-color: rgb(245 104 71 / 54%);
}

.object-editor textarea {
  min-height: 78px;
  border-color: rgb(201 76 50 / 44%);
  background: rgb(255 255 255 / 86%);
  line-height: 1.45;
  resize: vertical;
}

.hint {
  color: var(--muted);
  line-height: 1.45;
  font-size: 12px;
}

.control-group:first-child .hint {
  display: none;
}

.action-row {
  margin-top: 2px;
  width: 100%;
}

.action-row .primary-action {
  width: 100%;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: min(980px, calc(100vw - 28px));
    margin: 14px auto;
    padding: 18px;
    border-radius: 30px;
  }

  .preview-area,
  .controls {
    grid-column: 1;
  }

  .preview-area {
    height: 650px;
  }

  .floating-editor {
    top: auto;
    right: 18px;
    bottom: 62px;
    max-height: 42%;
  }

  .floating-editor.custom-control {
    width: min(300px, calc(100% - 220px));
  }

  .controls {
    height: auto;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .topbar,
  .action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    align-items: stretch;
    justify-content: space-between;
    width: 100%;
  }

  .top-actions .ghost-action,
  .top-actions .primary-action {
    flex: 1 1 0;
    padding: 0 12px;
  }

  .brand-block {
    align-items: flex-start;
  }

  .preview-area {
    height: 700px;
  }

  .preview-title {
    display: none;
  }

  .object-panel {
    inset: 0;
  }

  .custom-toolbar {
    left: 14px;
    right: auto;
    top: 14px;
    display: flex;
    flex-direction: column;
  }

  .add-menu-panel {
    width: min(320px, calc(100vw - 56px));
    flex-wrap: wrap;
  }

  .add-menu-row,
  .add-submenu {
    flex-wrap: wrap;
  }

  .add-submenu {
    padding-top: 8px;
    padding-left: 0;
    border-top: 1px solid rgb(245 104 71 / 24%);
    border-left: 0;
  }

  .tool-tab {
    min-height: 42px;
    padding: 0 6px;
  }

  .object-list {
    top: 118px;
    right: 14px;
    left: 14px;
    bottom: auto;
    width: auto;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
  }

  .layer-select {
    min-width: 92px;
  }

  .layer-delete {
    min-width: 28px;
  }

  .floating-editor {
    left: 14px;
    right: 14px;
    bottom: 58px;
    max-height: 250px;
  }

  .floating-editor.custom-control {
    width: auto;
  }

  .object-editor,
  .background-editor {
    grid-template-columns: 1fr;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }

  .feedback-qr-panel {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .share-link-panel {
    grid-template-columns: 1fr;
  }

  .examples-grid {
    grid-template-columns: 1fr;
  }

  .owner-template-actions,
  .owner-template-item {
    grid-template-columns: 1fr;
  }

  .drawing-controls {
    grid-template-columns: 1fr;
  }

  .drawing-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .object-editor .compact-button {
    grid-column: auto;
  }

  .controls {
    height: auto;
  }

  .control-group,
  .control-group:first-child,
  .control-group:nth-child(4),
  .action-row {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100vw - 16px, 520px);
    padding: 12px;
  }

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

/* Product Design refresh: BOOKMARK.AI gray studio workspace */
:root {
  --ink: #20201d;
  --muted: #77766f;
  --line: rgb(255 255 255 / 45%);
  --panel: rgb(232 232 226 / 82%);
  --panel-strong: rgb(244 244 239 / 90%);
  --soft: rgb(214 214 208 / 62%);
  --accent: #f56847;
  --accent-dark: #c94c32;
  --blue: #bdbdb7;
  --shadow: 0 34px 58px rgb(36 36 33 / 30%);
  --inner-shadow: inset 0 1px 0 rgb(255 255 255 / 48%);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: #8f8f8b;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 84%, rgb(32 32 29 / 22%), transparent 23%),
    linear-gradient(180deg, rgb(255 255 255 / 8%), rgb(0 0 0 / 7%));
}

.matrix-title {
  width: min(1220px, calc(100vw - 76px));
  margin: 28px auto 120px;
  color: #1f1f1d;
  font-family: "Courier New", Consolas, monospace;
  font-size: clamp(42px, 6.2vw, 84px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: 0.02em;
  -webkit-text-fill-color: transparent;
  background-image: radial-gradient(circle, #1f1f1d 0 2px, transparent 2.3px);
  background-size: 12px 12px;
  background-clip: text;
  -webkit-background-clip: text;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(640px, 1fr) 320px;
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: 0;
  row-gap: 0;
  min-height: 600px;
  height: min(620px, calc(100vh - 300px));
  width: min(1220px, calc(100vw - 76px));
  margin: 0 auto 70px;
  padding: 12px;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 44px;
  background: rgb(196 196 190 / 56%);
  box-shadow:
    0 34px 55px rgb(32 32 29 / 26%),
    inset 0 0 0 1px rgb(255 255 255 / 18%),
    inset 0 1px 0 rgb(255 255 255 / 35%);
  backdrop-filter: none;
}

.side-rail {
  grid-row: 1 / -1;
  grid-column: 1;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 52px;
  height: 100%;
  padding: 16px 0;
  border-radius: 28px;
  background: #eeeeea;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 78%);
}

.side-rail button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #5d5d57;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.rail-dot {
  color: white !important;
  background: #050505 !important;
}

.rail-avatar {
  background:
    linear-gradient(135deg, #f5f2ec, #1e1e1b) !important;
  box-shadow: 0 0 0 2px #dddcd7;
}

.rail-tools {
  display: grid;
  gap: 11px;
  margin-top: auto;
  padding: 10px 0;
  border-radius: 18px;
  background: #d9d9d4;
}

.rail-tools button.active,
.rail-tools button:hover {
  color: white;
  background: #8d8d87;
}

.workspace {
  display: contents;
}

.topbar {
  grid-column: 2;
  grid-row: 1;
  height: 86px;
  padding: 16px 18px 8px 24px;
  align-items: flex-start;
}

.brand-block {
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  color: #f2f1ec;
  background: #11110f;
  box-shadow: none;
  font-size: 11px;
  font-weight: 900;
}

h1 {
  font-size: 19px;
  font-weight: 800;
  color: #20201d;
}

.topbar p {
  margin-top: 5px;
  color: #77766f;
  font-size: 12px;
}

.top-actions {
  width: auto;
  gap: 8px;
}

.ghost-action,
.primary-action,
.secondary-action,
.icon-action {
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 38%);
  box-shadow: none;
  font-size: 12px;
}

.ghost-action {
  padding: 0 13px;
  background: #deded9;
  color: #55554f;
}

.primary-action,
.top-actions .primary-action {
  min-height: 34px;
  padding: 0 16px;
  flex: 0 0 auto;
  color: white;
  background: #11110f;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 9px 16px rgb(17 17 15 / 14%);
}

.compact-action {
  background: var(--accent) !important;
}

.secondary-action {
  min-height: 34px;
  color: #5c5c56;
  background: #eeeeea;
}

.preview-area {
  grid-column: 2;
  grid-row: 2;
  height: auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle, rgb(73 73 68 / 18%) 1px, transparent 1.2px),
    #b7b7b7;
  background-size: 18px 18px;
  box-shadow: none;
}

.preview-area::before {
  inset: 0;
  background:
    linear-gradient(90deg, rgb(28 28 25 / 5%) 1px, transparent 1px),
    linear-gradient(rgb(28 28 25 / 5%) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: none;
}

.preview-title {
  top: 22px;
  left: 94px;
  padding: 8px 12px;
  border-radius: 15px;
  background: rgb(238 238 234 / 75%);
}

.preview-title h2 {
  font-size: 13px;
}

.preview-title h2::before {
  content: "";
}

.preview-title p {
  margin-top: 3px;
  font-size: 10px;
}

.custom-toolbar {
  top: 20px;
  left: 22px;
}

.add-menu-toggle {
  width: 54px;
  min-height: 54px;
  border-radius: 18px;
  color: #1e1e1b;
  background: #eeeeea;
  box-shadow: 0 12px 20px rgb(33 33 30 / 10%);
}

.add-menu-toggle span {
  width: 22px;
  height: 22px;
  color: white;
  background: #11110f;
  font-size: 18px;
}

.add-menu-panel,
.custom-toolbar.open .add-menu-panel {
  border-color: rgb(255 255 255 / 42%);
  background: rgb(229 229 223 / 88%);
}

.tool-tab,
.add-submenu button,
.layer-select,
.layer-delete {
  border-radius: 12px;
  color: #686862;
  background: #eeeeea;
}

.tool-tab:hover,
.tool-tab.active,
.layer-select:hover,
.layer-item.active .layer-select,
.layer-delete:hover {
  color: #11110f;
  outline: 1px solid rgb(17 17 15 / 18%);
  background: #d9d9d4;
}

.object-list {
  top: auto;
  left: 190px;
  right: auto;
  bottom: 78px;
  width: min(360px, calc(100% - 420px));
  min-height: 88px;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px;
  border-color: rgb(255 255 255 / 32%);
  border-radius: 18px;
  background: rgb(154 154 148 / 42%);
  box-shadow: none;
  backdrop-filter: blur(4px);
}

.object-list::before {
  content: "图层";
  flex: 0 0 54px;
  align-self: center;
  color: #efeee8;
}

.layer-item {
  min-width: 118px;
}

.layer-select {
  min-height: 56px;
  background: rgb(238 238 234 / 72%);
}

.layer-thumb {
  border-color: rgb(34 34 31 / 12%);
  background: #d6d6d0;
}

.floating-editor {
  top: 142px;
  right: 34px;
  width: 280px;
  height: min(500px, calc(100% - 166px));
  max-height: none;
  padding: 0;
  border-color: rgb(255 255 255 / 36%);
  border-radius: 20px;
  background: rgb(145 145 139 / 58%);
  color: #f2f1ec;
  box-shadow: none;
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.floating-editor.custom-control {
  width: 280px;
  background: rgb(145 145 139 / 58%);
}

.floating-editor-scroll {
  height: 100%;
  margin-right: 8px;
  padding: 14px 14px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgb(242 241 236 / 72%) transparent;
}

.floating-editor-scroll::-webkit-scrollbar {
  width: 8px;
}

.floating-editor-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.floating-editor-scroll::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.floating-editor-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgb(242 241 236 / 72%);
}

.floating-editor-scroll::-webkit-scrollbar-thumb:hover {
  background: rgb(242 241 236 / 88%);
}

@media (max-width: 760px) {
  .floating-editor {
    height: auto;
    max-height: 250px;
  }

  .floating-editor-scroll {
    height: auto;
    max-height: 250px;
  }
}

.floating-editor h2,
.floating-editor .field span,
.floating-editor .toggle span {
  color: #f2f1ec;
}

.editing-status {
  color: white;
  background: rgb(17 17 15 / 74%);
  box-shadow: none;
}

.object-editor textarea,
.object-editor select,
.background-editor select,
.select-field select {
  border-color: rgb(255 255 255 / 32%);
  background: rgb(238 238 234 / 82%);
}

#previewCanvas {
  z-index: 1;
}

.preview-note {
  left: 190px;
  right: auto;
  bottom: 0;
  width: min(460px, calc(100% - 420px));
  padding: 8px 12px;
  border-radius: 999px;
  color: #efeee8;
  background: rgb(93 93 87 / 48%);
}

.controls {
  grid-column: 3;
  grid-row: 1 / -1;
  height: auto;
  padding: 0 0 0 12px;
  overflow-y: auto;
  background: #cfcfca;
  border-radius: 0 32px 32px 0;
}

.control-dashboard,
.control-group,
.step-tabs {
  border: 1px solid rgb(255 255 255 / 38%);
  border-radius: 16px;
  background: #eeeeea;
  box-shadow: none;
  backdrop-filter: none;
}

.control-dashboard {
  display: grid;
  gap: 10px;
  padding: 10px;
  margin-bottom: 10px;
}

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

.dashboard-stats article {
  min-height: 92px;
  padding: 12px;
  border-radius: 15px;
  background: #f6f6f1;
}

.dashboard-stats span,
.dashboard-stats small {
  display: block;
  color: #77766f;
  font-size: 11px;
}

.dashboard-stats strong {
  display: block;
  margin: 10px 0 7px;
  color: #11110f;
  font-size: 21px;
  line-height: 1;
}

.dashboard-preview {
  min-height: 240px;
  padding: 13px;
  border-radius: 18px;
  background: #f6f6f1;
}

.dot-label {
  margin-bottom: 10px;
  font-family: "Courier New", Consolas, monospace;
  font-size: 28px;
  font-weight: 900;
  line-height: 0.92;
  -webkit-text-fill-color: transparent;
  background-image: radial-gradient(circle, #242421 0 1.2px, transparent 1.5px);
  background-size: 7px 7px;
  background-clip: text;
  -webkit-background-clip: text;
}

.mini-bookmark-card {
  position: relative;
  display: grid;
  align-content: end;
  gap: 7px;
  min-height: 142px;
  overflow: hidden;
  padding: 16px;
  border-radius: 18px;
  color: #efeee8;
  background:
    radial-gradient(circle at 74% 34%, var(--accent) 0 38px, transparent 39px),
    linear-gradient(145deg, #2c2c29, #77766f);
}

.mini-bookmark-card span {
  position: absolute;
  top: 22px;
  left: 18px;
  width: 70px;
  height: 88px;
  border-radius: 16px;
  background: rgb(239 238 232 / 20%);
}

.mini-bookmark-card strong {
  position: relative;
  font-size: 26px;
  letter-spacing: 0.12em;
}

.mini-bookmark-card small {
  position: relative;
  color: rgb(239 238 232 / 70%);
  font-size: 11px;
}

.dashboard-actions {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  gap: 8px;
  margin-top: 10px;
}

.dashboard-actions .primary-action,
.dashboard-actions .secondary-action {
  width: 100%;
  min-height: 38px;
}

.dashboard-actions .primary-action {
  background: var(--accent);
}

.control-group {
  padding: 12px;
  margin-bottom: 10px;
}

.control-group h2 {
  margin-bottom: 8px;
  color: #22221f;
  font-size: 13px;
}

.segmented {
  gap: 6px;
}

.segmented label {
  min-height: 31px;
  border-color: rgb(30 30 27 / 8%);
  border-radius: 11px;
  background: #f8f8f4;
  color: #686862;
  box-shadow: none;
}

.segmented label:has(input:checked) {
  color: white;
  border-color: transparent;
  background: #11110f;
  box-shadow: none;
}

.shape-summary-panel {
  display: grid;
  gap: 8px;
}

.shape-summary-panel span {
  color: #77766f;
  font-size: 11px;
  font-weight: 800;
}

.shape-summary-panel strong {
  display: block;
  min-height: 38px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #11110f;
  background: #f8f8f4;
  font-size: 16px;
}

.shape-summary-panel .secondary-action {
  width: 100%;
  border: 1px solid rgb(202 76 50 / 38%);
  color: white;
  background: var(--accent);
  box-shadow:
    0 12px 22px rgb(245 104 71 / 24%),
    inset 0 1px 0 rgb(255 255 255 / 28%),
    inset 0 -3px 0 rgb(126 50 33 / 16%);
  font-weight: 900;
  text-shadow: 0 1px 1px rgb(97 38 24 / 18%);
}

.shape-category-list {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.shape-category-group {
  display: grid;
  gap: 6px;
}

.shape-category-title {
  color: #77766f;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.shape-category-options {
  margin-bottom: 0;
}

.field span,
.toggle span,
.hint,
.upload-shape-box span {
  color: #6a6a63;
}

input[type="range"],
.toggle input {
  accent-color: var(--accent);
}

.guide-card,
.examples-card,
.drawing-card {
  background: #eeeeea;
}

@media (max-width: 1180px) {
  .matrix-title {
    margin-bottom: 42px;
  }

  .app-shell {
    grid-template-columns: 58px minmax(0, 1fr);
    height: auto;
    min-height: 760px;
  }

  .side-rail {
    grid-column: 1;
  }

  .topbar,
  .preview-area,
  .controls {
    grid-column: 2;
  }

  .controls {
    grid-row: 3;
    border-radius: 0 0 28px 0;
    padding: 12px 0 0;
    background: transparent;
  }

  .preview-area {
    min-height: 620px;
  }
}

@media (max-width: 760px) {
  .matrix-title {
    width: min(100vw - 28px, 680px);
    margin: 18px auto 24px;
    font-size: 38px;
  }

  .app-shell {
    width: min(100vw - 16px, 720px);
    grid-template-columns: 1fr;
    padding: 10px;
    border-radius: 30px;
  }

  .side-rail {
    display: none;
  }

  .topbar,
  .preview-area,
  .controls {
    grid-column: 1;
  }

  .topbar {
    height: auto;
    padding: 14px;
  }

  .preview-area {
    min-height: 620px;
    border-radius: 22px;
  }

  .object-list,
  .preview-note {
    left: 14px;
    width: calc(100% - 28px);
  }

  .shape-hero-choice {
    width: min(280px, calc(100% - 32px));
    min-height: 104px;
  }

  .shape-card {
    padding: 24px 18px;
  }

  .shape-card .guide-close {
    top: 18px;
    right: 18px;
    width: 46px;
    height: 46px;
    border-radius: 15px;
  }

  .shape-dialog-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 24px;
  }

  .shape-category-tabs {
    gap: 12px;
  }

  .shape-category-tabs::before,
  .shape-category-nav-card::before {
    display: none;
  }

  .shape-category-nav-card,
  .shape-category-nav-card.is-active {
    min-height: 86px;
  }

  .shape-selection-panel {
    min-height: 0;
    padding: 18px;
  }

  .shape-card .shape-category-list {
    min-height: 0;
  }

  .shape-card .shape-category-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 230px;
    gap: 12px;
  }

  .shape-card .shape-category-options label {
    min-height: 156px;
  }

  .shape-option-preview {
    width: 96px;
    height: 82px;
  }

  .shape-card .upload-shape-box {
    grid-template-columns: 1fr;
  }
}

/* Edge-to-edge workspace: remove outer page whitespace */
html,
body {
  width: 100%;
  height: 100%;
}

body {
  overflow: hidden;
}

.matrix-title {
  position: fixed;
  top: 18px;
  left: 24px;
  z-index: 12;
  width: auto;
  max-width: calc(100vw - 320px);
  margin: 0;
  font-size: clamp(34px, 4.8vw, 64px);
  pointer-events: none;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  padding: 12px;
  border: 0;
  border-radius: 0;
}

.topbar {
  grid-column: 2 / -1;
  padding-top: 18px;
}

.brand-block {
  opacity: 0;
  pointer-events: none;
}

.preview-area,
.controls {
  height: auto;
}

.controls {
  border-radius: 0;
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .matrix-title {
    position: static;
    width: 100vw;
    max-width: none;
    padding: 14px 16px 0;
    margin: 0;
  }

  .app-shell {
    width: 100vw;
    min-height: calc(100vh - 72px);
    margin: 0;
    border-radius: 0;
  }

  .brand-block {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 760px) {
  .matrix-title {
    width: 100vw;
    margin: 0;
    padding: 12px 12px 0;
  }

  .app-shell {
    width: 100vw;
    border-radius: 0;
  }
}

/* Restore the layer menu to the left side of the preview canvas. */
.object-list {
  top: 154px;
  left: 22px;
  right: auto;
  bottom: 86px;
  width: 156px;
  min-height: 0;
  display: grid;
  grid-auto-flow: row;
  grid-auto-columns: auto;
  gap: 10px;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px;
  border-color: rgb(255 255 255 / 34%);
  border-radius: 18px;
  background: rgb(154 154 148 / 42%);
}

.object-list::before {
  content: "图层";
  flex: none;
  align-self: auto;
  color: #efeee8;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.preview-note {
  left: 22px;
}

.layer-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: stretch;
}

.layer-select {
  min-width: 0;
  min-height: 62px;
}

@media (max-width: 760px) {
  .object-list {
    top: 118px;
    left: 14px;
    right: auto;
    bottom: auto;
    width: 156px;
    max-height: 330px;
    display: grid;
    overflow-x: hidden;
    overflow-y: auto;
  }
}

/* Hide the broken dot-matrix title in the top-left corner. */
.matrix-title {
  display: none !important;
}

@media (max-width: 1180px) {
  .app-shell {
    min-height: 100vh;
  }
}

/* Simplify the left rail to background, drawing, and guide actions only. */
.side-rail {
  justify-content: center;
  gap: 0;
}

.rail-tools {
  margin-top: 0;
  gap: 10px;
  padding: 10px 6px;
  background: rgb(217 217 212 / 72%);
}

.rail-tools button {
  width: 40px;
  height: 40px;
  padding: 0 6px;
  border-radius: 15px;
  color: #3d3d38;
  background: #eeeeea;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 800;
  white-space: normal;
}

.rail-tools button.active,
.rail-tools button:hover {
  color: white;
  background: #8d8d87;
}

/* Extend the preview canvas background across the whole page. */
body,
.app-shell {
  background-color: #b7b7b7 !important;
  background-image:
    radial-gradient(circle, rgb(73 73 68 / 18%) 1px, transparent 1.2px),
    linear-gradient(90deg, rgb(28 28 25 / 5%) 1px, transparent 1px),
    linear-gradient(rgb(28 28 25 / 5%) 1px, transparent 1px) !important;
  background-size: 18px 18px, 72px 72px, 72px 72px !important;
  background-position: 0 0 !important;
}

body::before {
  display: none;
}

.app-shell {
  box-shadow: none;
}

.preview-area {
  background: transparent !important;
}

.preview-area::before {
  background: none;
}

.controls {
  background: transparent !important;
}

/* Slightly wider left rail with circular icon buttons. */
.app-shell {
  grid-template-columns: 84px minmax(640px, 1fr) 360px;
}

.side-rail {
  width: 68px;
  padding: 18px 0;
  background: rgb(239 239 234 / 86%);
  box-shadow:
    12px 18px 34px rgb(31 31 28 / 14%),
    inset 0 1px 0 rgb(255 255 255 / 80%),
    inset 0 -1px 0 rgb(105 105 97 / 10%);
}

.rail-tools {
  padding: 12px 8px;
  gap: 14px;
  border-radius: 24px;
  background: rgb(222 222 216 / 78%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 60%),
    inset 0 -1px 0 rgb(105 105 97 / 10%);
}

.rail-tools button {
  display: grid;
  place-items: center;
  gap: 5px;
  width: 50px;
  height: auto;
  padding: 0;
  color: #292925;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  line-height: 1;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.rail-tools button:focus {
  outline: none;
}

.rail-tools button:focus-visible .rail-icon {
  box-shadow:
    0 0 0 3px rgb(245 104 71 / 24%),
    0 10px 18px rgb(31 31 28 / 16%),
    inset 0 1px 0 rgb(255 255 255 / 86%),
    inset 0 -1px 0 rgb(105 105 97 / 12%);
}

.rail-tools button:hover {
  transform: translateY(-1px);
}

.rail-tools button.active {
  color: #292925;
  background: transparent;
  box-shadow: none;
}

.rail-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #292925;
  background: linear-gradient(145deg, #f8f8f3, #d9d9d2);
  box-shadow:
    0 10px 18px rgb(31 31 28 / 16%),
    inset 0 1px 0 rgb(255 255 255 / 86%),
    inset 0 -1px 0 rgb(105 105 97 / 12%);
  font-size: 20px;
  line-height: 1;
}

.rail-tools button:hover .rail-icon {
  box-shadow:
    0 13px 22px rgb(31 31 28 / 18%),
    inset 0 1px 0 rgb(255 255 255 / 88%),
    inset 0 -1px 0 rgb(105 105 97 / 12%);
}

.rail-tools button.active .rail-icon {
  color: white;
  background: linear-gradient(145deg, #989891, #5f5f58);
  box-shadow:
    0 12px 20px rgb(31 31 28 / 20%),
    inset 0 1px 0 rgb(255 255 255 / 20%),
    inset 0 -2px 4px rgb(0 0 0 / 16%);
}

.rail-label {
  color: #55554f;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

#railGuide .rail-icon {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-style: italic;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .side-rail {
    width: 58px;
  }

  .rail-tools button {
    width: 46px;
  }

  .rail-icon {
    width: 40px;
    height: 40px;
  }
}

/* Remove the rail group backing and keep hover effects on icons only. */
.rail-tools {
  background: transparent !important;
  box-shadow: none !important;
}

.rail-tools button,
.rail-tools button:hover,
.rail-tools button.active {
  color: #292925;
  background: transparent !important;
  box-shadow: none !important;
  transform: none;
}

.rail-tools button:hover .rail-icon {
  transform: translateY(-2px);
  color: #292925;
  background: linear-gradient(145deg, #ffffff, #d6d6cf);
  box-shadow:
    0 15px 24px rgb(31 31 28 / 24%),
    0 4px 8px rgb(31 31 28 / 12%),
    inset 0 1px 0 rgb(255 255 255 / 92%),
    inset 0 -2px 3px rgb(105 105 97 / 16%);
}

.rail-tools button.active .rail-icon {
  color: white;
}

.rail-label,
.rail-tools button:hover .rail-label,
.rail-tools button.active .rail-label {
  color: #55554f;
  transform: none;
}

/* Top-left product title. */
.app-title-block {
  position: absolute;
  top: 22px;
  left: 118px;
  z-index: 8;
  pointer-events: none;
}

.app-title-block h1 {
  margin: 0;
  color: #20201d;
  font-family: "Alibaba PuHuiTi", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 34px;
  font-weight: 900;
  font-synthesis-weight: auto;
  line-height: 1;
  letter-spacing: 0;
  -webkit-text-stroke: 0.45px currentColor;
  text-shadow:
    0.45px 0 0 currentColor,
    -0.2px 0 0 currentColor;
}

.app-title-block p {
  margin: 8px 0 0;
  color: #686862;
  font-family: "Alibaba PuHuiTi", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

@media (max-width: 1180px) {
  .app-title-block {
    left: 94px;
  }
}

@media (max-width: 760px) {
  .app-title-block {
    position: static;
    grid-column: 1;
    padding: 14px 14px 0;
  }
}

/* Right panel top action: export only. */
.control-dashboard {
  position: relative;
  z-index: 2;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 78px;
  box-sizing: border-box;
  padding: 12px 12px 13px;
  margin: 0 0 20px;
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 18px;
  background:
    linear-gradient(180deg, #fbfbf7 0%, #eeeeea 100%);
  overflow: visible;
  box-shadow:
    0 8px 18px rgb(45 45 42 / 12%),
    inset 0 1px 0 rgb(255 255 255 / 90%),
    inset 0 -1px 0 rgb(126 126 118 / 8%);
}

.dashboard-export {
  appearance: none;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 1334 / 222;
  flex: none;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  color: #f5f4ef;
  background:
    linear-gradient(180deg, #ff6842 0%, #f55232 52%, #e94729 100%);
  box-shadow:
    0 2px 0 rgb(143 42 26 / 55%),
    inset 0 1px 0 rgb(255 255 255 / 32%);
  font-family: "Alibaba PuHuiTi", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 1px 1px rgb(122 34 20 / 36%);
  transition:
    transform 120ms ease,
    filter 120ms ease;
}

.dashboard-export:hover {
  transform: translateY(-0.5px);
  filter: saturate(1.03) brightness(1.02);
}

.dashboard-export:active {
  transform: translateY(3px);
  filter: saturate(0.96) brightness(0.93);
}

.dashboard-export:focus-visible {
  outline: 2px solid rgb(245 104 71 / 46%);
  outline-offset: 3px;
}

/* Keep the right menu in place while moving its scrollbar to the viewport edge. */
@media (min-width: 1181px) {
  .controls {
    gap: 6px;
    margin-right: -12px;
    padding: 0 12px 0 12px;
    overflow-x: hidden;
    scrollbar-gutter: stable;
  }

  .control-dashboard,
  .control-group {
    margin-bottom: 6px;
  }
}

/* Slightly enlarge the add menu and its secondary panels. */
.add-menu-toggle {
  width: 78px;
  min-height: 76px;
  padding: 10px 12px;
  font-size: 15px;
}

.add-menu-toggle span {
  width: 34px;
  height: 34px;
  position: relative;
  flex: 0 0 34px;
  line-height: 0;
  font-size: 0;
}

.add-menu-toggle span::before,
.add-menu-toggle span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.add-menu-toggle span::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.add-menu-panel,
.custom-toolbar.open .add-menu-panel {
  gap: 10px;
  padding: 12px;
  border-radius: 22px;
}

.add-menu-row,
.add-submenu {
  gap: 10px;
}

.tool-tab {
  min-height: 42px;
  padding: 0 14px;
  font-size: 14px;
}

.add-submenu button {
  width: 48px;
  min-height: 48px;
  border-radius: 15px;
  font-size: 21px;
}

.add-submenu[data-submenu-panel="background"] button {
  min-width: 82px;
  padding: 0 16px;
  font-size: 15px;
}

.menu-icon-canvas {
  width: 38px;
  height: 38px;
}
