:root {
  color-scheme: light;
  --blue: #087cfa;
  --blue-strong: #006be6;
  --blue-soft: #eaf3ff;
  --ink: #172033;
  --muted: #6f7a8e;
  --subtle: #9ba5b6;
  --line: #e3e8f0;
  --line-strong: #d7deea;
  --panel: rgba(255, 255, 255, 0.88);
  --canvas-bg: #f7f9fd;
  --success: #1c9a61;
  --danger: #d34c4c;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --shadow-1: 0 8px 24px rgba(31, 51, 79, 0.06);
  --shadow-2: 0 18px 50px rgba(31, 51, 79, 0.11);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 1180px;
  min-height: 100%;
  color: var(--ink);
  background: #f5f7fb;
}

body {
  min-height: 100vh;
  overflow: hidden;
}

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

button,
label,
select,
input[type="color"],
input[type="range"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.design-canvas:focus-visible {
  outline: 3px solid rgba(8, 124, 250, 0.18);
  outline-offset: 2px;
}

.ambient-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 24% 12%, rgba(208, 225, 252, 0.54), transparent 30%),
    radial-gradient(circle at 79% 22%, rgba(232, 221, 251, 0.42), transparent 27%),
    linear-gradient(145deg, #f7f9fc 0%, #f2f5fa 62%, #f8f9fb 100%);
}

.ambient-orb {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(12px);
  opacity: 0.65;
}

.ambient-orb-a {
  width: 520px;
  height: 520px;
  top: -260px;
  left: 28%;
  background: rgba(178, 210, 255, 0.26);
}

.ambient-orb-b {
  width: 640px;
  height: 640px;
  right: -260px;
  bottom: -390px;
  background: rgba(222, 213, 247, 0.25);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image:
    linear-gradient(rgba(109, 127, 154, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109, 127, 154, 0.08) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, transparent, #000 25%, transparent 80%);
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(215, 222, 234, 0.85);
  background: rgba(250, 251, 253, 0.82);
  backdrop-filter: blur(22px) saturate(1.2);
}

.brand-lockup,
.top-actions,
.quiet-btn,
.primary-btn,
.panel-heading,
.section-title,
.autosave-state,
.preview-toolbar,
.preview-actions,
.layer-row,
.property-title,
.modal-header,
.modal-footer,
.thumbnail-heading,
.canvas-statusbar {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(8, 124, 250, 0.28);
  border-radius: 12px;
  background: var(--blue);
  box-shadow: 0 7px 18px rgba(8, 124, 250, 0.24);
}

.brand-mark img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

/* V0.3.19 — keep compact heading metadata on one line */
.brand-lockup > div {
  display: flex;
  align-items: baseline;
  gap: 11px;
  min-width: 0;
  white-space: nowrap;
}

.brand-lockup .brand-meta {
  margin-top: 0;
}

.version-chip {
  color: var(--blue-strong);
  font-weight: 650;
}

.top-actions {
  gap: 8px;
}

.quiet-btn,
.primary-btn,
.icon-btn,
.avatar-button,
.zoom-chip,
.generate-btn,
.add-element-row button,
.add-element-row label,
.segmented button,
.segmented label,
.view-switch button,
.layer-action,
.position-grid button {
  border: 0;
  cursor: pointer;
  transition: transform 160ms var(--ease), background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.quiet-btn {
  height: 38px;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
}

.quiet-btn:hover,
.icon-btn:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.icon-box {
  color: var(--muted);
  font-size: 16px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-size: 18px;
}

.top-divider {
  width: 1px;
  height: 24px;
  margin: 0 4px;
  background: var(--line);
}

.primary-btn {
  height: 40px;
  gap: 10px;
  padding: 0 16px;
  border-radius: 11px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 20px rgba(8, 124, 250, 0.22);
  font-size: 13px;
  font-weight: 650;
}

.primary-btn:hover,
.generate-btn:hover {
  transform: translateY(-1px);
  background: var(--blue-strong);
  box-shadow: 0 10px 24px rgba(8, 124, 250, 0.26);
}

.primary-btn:active,
.generate-btn:active,
.quiet-btn:active,
.icon-btn:active {
  transform: translateY(1px);
}

.avatar-button {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #273245;
  box-shadow: 0 4px 12px rgba(31, 45, 67, 0.2);
  font-size: 13px;
}

.avatar-button i {
  position: absolute;
  right: -1px;
  bottom: 1px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #24b875;
}

.workspace {
  height: calc(100vh - 72px);
  padding: 16px;
  display: grid;
  grid-template-columns: 410px minmax(720px, 1fr);
  gap: 16px;
}

.editor-panel,
.preview-panel {
  min-height: 0;
  border: 1px solid rgba(215, 222, 234, 0.82);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(18px) saturate(1.05);
}

.editor-panel {
  overflow: auto;
  padding: 18px 18px 60px;
  scrollbar-width: thin;
  scrollbar-color: #cfd7e4 transparent;
}

.panel-heading {
  justify-content: space-between;
  padding: 2px 2px 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.autosave-state {
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.autosave-state i,
.canvas-statusbar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #25b777;
  box-shadow: 0 0 0 4px rgba(37, 183, 119, 0.1);
}

.editor-section {
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.68);
}

.section-title {
  width: 100%;
  min-height: 66px;
  padding: 12px 13px;
  gap: 11px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.section-title:hover {
  background: rgba(246, 249, 253, 0.8);
}

.step-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  color: var(--blue-strong);
  background: var(--blue-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
}

.section-title > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.section-title b,
.section-title small {
  display: block;
}

.section-title b {
  font-size: 14px;
}

.section-title small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.section-chevron {
  color: var(--subtle);
  transition: transform 180ms ease;
}

.editor-section:not(.section-open) .section-chevron {
  transform: rotate(180deg);
}

.section-body {
  padding: 0 13px 14px;
}

.editor-section:not(.section-open) .section-body {
  display: none;
}

.group-grid {
  display: grid;
  grid-template-columns: 0.88fr 1.22fr;
  gap: 10px;
}

.field {
  display: block;
  margin-bottom: 10px;
}

.field > span,
.color-field > span,
.range-field > span {
  display: block;
  margin-bottom: 6px;
  color: #536075;
  font-size: 11px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: rgba(251, 252, 254, 0.92);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input,
select {
  height: 36px;
  padding: 0 10px;
}

textarea {
  min-height: 64px;
  padding: 9px 10px;
  resize: vertical;
  line-height: 1.55;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #cdd6e3;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(8, 124, 250, 0.62);
  box-shadow: 0 0 0 3px rgba(8, 124, 250, 0.08);
  background: #fff;
}

.switch {
  position: relative;
  flex: 0 0 auto;
}

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

.switch span {
  width: 34px;
  height: 20px;
  display: block;
  border-radius: 20px;
  background: #d7dde7;
  transition: background 160ms ease;
}

.switch span::after {
  content: "";
  width: 16px;
  height: 16px;
  position: absolute;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(31, 45, 67, 0.18);
  transition: transform 180ms var(--ease);
}

.switch input:checked + span {
  background: var(--blue);
}

.switch input:checked + span::after {
  transform: translateX(14px);
}

.reference-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 2px;
}

.upload-card {
  position: relative;
  min-height: 118px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px dashed #cad5e5;
  border-radius: 13px;
  background: rgba(248, 250, 253, 0.85);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms var(--ease);
}

.upload-card:hover {
  transform: translateY(-1px);
  border-color: rgba(8, 124, 250, 0.52);
  background: #f7fbff;
}

.upload-card input,
.add-element-row input,
.segmented input {
  display: none;
}

.upload-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  color: var(--blue);
  background: #fff;
}

.upload-card b {
  font-size: 12px;
}

.upload-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.upload-card em {
  position: absolute;
  top: 11px;
  right: 11px;
  color: var(--subtle);
  font-size: 9px;
  font-style: normal;
}

.style-ref {
  background: rgba(251, 249, 254, 0.85);
}

.rule-note {
  margin: 9px 0 10px;
  padding: 8px 9px;
  display: flex;
  gap: 8px;
  border-radius: 10px;
  color: #536075;
  background: #f1f5fa;
  font-size: 10px;
  line-height: 1.5;
}

.rule-note i {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #bdc9da;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-style: normal;
  font-size: 9px;
}

.generate-btn {
  width: 100%;
  min-height: 45px;
  padding: 0 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(8, 124, 250, 0.18);
  font-size: 12px;
  font-weight: 650;
}

.generate-btn small {
  opacity: 0.72;
  font-size: 9px;
  font-weight: 400;
}

.spark-symbol {
  font-size: 16px;
}

.add-element-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.add-element-row .ai-content-add {
  color: var(--blue-strong);
  border-color: rgba(8, 124, 250, 0.24);
  background: #f3f8ff;
}

.layer-rule-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0 0 10px;
  padding: 8px 9px;
  border-radius: 9px;
  color: #68758a;
  background: #f4f7fb;
  font-size: 9px;
  line-height: 1.5;
}

.layer-rule-note i {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: var(--blue);
}

.add-element-row button,
.add-element-row label {
  min-height: 54px;
  padding: 7px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  font-size: 10px;
}

.add-element-row button:hover,
.add-element-row label:hover {
  border-color: rgba(8, 124, 250, 0.42);
  color: var(--blue-strong);
  background: #f8fbff;
}

.add-element-row span {
  color: var(--blue);
  font-size: 15px;
  font-weight: 650;
}

.layer-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.layer-row {
  min-height: 42px;
  padding: 6px 7px;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #f7f9fc;
  cursor: pointer;
}

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

.layer-row.active {
  border-color: rgba(8, 124, 250, 0.35);
  background: #f3f8ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.layer-kind {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--blue);
  background: #fff;
  font-size: 10px;
  font-weight: 700;
}

.layer-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.layer-name small {
  overflow: hidden;
  color: #8a95a6;
  font-size: 8px;
  font-weight: 450;
  text-overflow: ellipsis;
}

.layer-row.layer-hidden .layer-name {
  opacity: .48;
  text-decoration: line-through;
}

.layer-row.layer-locked .layer-kind {
  background: #eef2f7;
}

.layer-actions {
  display: flex;
  gap: 2px;
}

.layer-action {
  width: 25px;
  height: 25px;
  padding: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
}

.layer-action:hover {
  color: var(--blue-strong);
  background: var(--blue-soft);
}

.layer-action:disabled {
  opacity: .24;
  pointer-events: none;
}

.property-panel {
  margin-top: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(249, 251, 253, 0.88);
}

.ai-layer-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid rgba(8, 124, 250, .16);
  border-radius: 10px;
  background: linear-gradient(135deg, #f5f9ff, #fff);
}

.ai-layer-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 7px 16px rgba(8, 124, 250, .18);
}

.ai-layer-heading div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-layer-heading b { font-size: 11px; }
.ai-layer-heading small,
.ai-template-meta span,
.ai-template-empty span { color: #788599; font-size: 9px; line-height: 1.45; }

.ai-template-empty,
.ai-template-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: 10px;
  background: #f5f7fa;
}

.ai-template-empty {
  min-height: 74px;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed #cdd6e2;
}

.ai-template-meta b { color: var(--blue-strong); font-size: 10px; }

.ai-type-help {
  margin-top: -3px;
  padding: 7px 9px;
  border-left: 2px solid rgba(8, 124, 250, .45);
  color: #778398;
  background: #f7f9fc;
  font-size: 8px;
  line-height: 1.5;
}

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

.ai-reference-card {
  min-height: 66px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 9px;
  overflow: hidden;
  border: 1px dashed #cbd6e5;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.ai-reference-card:hover { border-color: rgba(8, 124, 250, .55); background: #f8fbff; }
.ai-reference-card input { display: none; }
.ai-reference-card > span { color: var(--blue); }
.ai-reference-card b { font-size: 9px; }
.ai-reference-card small { color: #8b96a7; font-size: 8px; }

.ai-reference-names {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ai-reference-names span {
  max-width: 120px;
  padding: 3px 6px;
  overflow: hidden;
  border-radius: 5px;
  color: #667287;
  background: #eef2f7;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-layer-rule {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: #748094;
  font-size: 8px;
  line-height: 1.5;
}

.ai-layer-rule .hugeicon-svg { flex: 0 0 auto; color: var(--blue); }
.ai-layer-generate { margin-top: 2px; border: 0; }

.canvas-ai-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px dashed rgba(8, 124, 250, .28);
  border-radius: 18px;
  color: var(--blue);
  background: rgba(244, 249, 255, .88);
}

.canvas-ai-placeholder b { color: #273449; font-size: 22px; }
.canvas-ai-placeholder span { color: #778398; font-size: 15px; }
.canvas-ai-placeholder .hugeicon-svg { width: 30px; height: 30px; }

.empty-property {
  min-height: 68px;
  display: grid;
  place-items: center;
}

.property-placeholder {
  color: var(--subtle);
  font-size: 10px;
}

.property-title {
  justify-content: space-between;
  margin-bottom: 10px;
}

.property-title b {
  font-size: 12px;
}

.property-title button {
  border: 0;
  color: var(--danger);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.property-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.property-grid .field {
  margin: 0;
}

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

.property-grid input,
.property-grid select {
  height: 32px;
  font-size: 11px;
}

.position-grid {
  display: grid;
  grid-template-columns: repeat(3, 25px);
  gap: 4px;
}

.position-grid button {
  width: 25px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.position-grid button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.segmented,
.view-switch {
  padding: 3px;
  display: grid;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f4f6f9;
}

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

.segmented button,
.segmented label,
.view-switch button {
  min-height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: transparent;
  font-size: 10px;
}

.segmented button.active,
.view-switch button.active {
  color: var(--blue-strong);
  background: #fff;
  box-shadow: 0 2px 8px rgba(31, 51, 79, 0.08);
  font-weight: 650;
}

.background-controls {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.color-field,
.range-field {
  min-width: 0;
}

.color-field {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 6px;
}

.color-field > span {
  grid-column: 1 / -1;
}

.color-field input[type="color"] {
  width: 32px;
  height: 32px;
  padding: 3px;
}

.color-field input:not([type="color"]) {
  height: 32px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

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

.range-field span {
  display: flex;
  justify-content: space-between;
}

.range-field em {
  color: var(--blue);
  font-style: normal;
}

input[type="range"] {
  height: 24px;
  padding: 0;
  accent-color: var(--blue);
  background: transparent;
}

.preview-panel {
  padding: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.preview-toolbar {
  min-height: 52px;
  justify-content: space-between;
  gap: 18px;
  padding: 0 3px 14px;
}

.preview-toolbar h2 {
  display: block;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.preview-toolbar > div:first-child > span {
  margin-left: 9px;
  color: var(--muted);
  font-size: 11px;
}

.preview-actions {
  gap: 6px;
}

.view-switch {
  width: 180px;
  grid-template-columns: 1fr 1fr;
}

.zoom-chip {
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #fff;
  font-size: 10px;
}

.stage-wrap {
  position: relative;
  min-height: 0;
  padding: 28px 34px 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(45deg, rgba(224, 230, 238, 0.42) 25%, transparent 25%) 0 0 / 20px 20px,
    linear-gradient(-45deg, rgba(224, 230, 238, 0.42) 25%, transparent 25%) 0 10px / 20px 20px,
    linear-gradient(45deg, transparent 75%, rgba(224, 230, 238, 0.42) 75%) 10px -10px / 20px 20px,
    linear-gradient(-45deg, transparent 75%, rgba(224, 230, 238, 0.42) 75%) -10px 0 / 20px 20px,
    #f6f8fb;
}

.canvas-frame {
  position: relative;
  width: min(92%, 960px);
  aspect-ratio: 16 / 9;
  z-index: 2;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-2), 0 0 0 1px rgba(158, 171, 191, 0.28);
}

.design-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  user-select: none;
  background: #fff;
  transform: translateZ(0);
}

.canvas-background {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.canvas-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.canvas-element {
  position: absolute;
  transform-origin: center;
  touch-action: none;
  cursor: grab;
}

.canvas-element:active {
  cursor: grabbing;
}

.canvas-element.selected::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid var(--blue);
  border-radius: 7px;
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.canvas-element.locked {
  cursor: not-allowed;
}

.canvas-text {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: pre-wrap;
  overflow: hidden;
  line-height: 1.2;
}

.canvas-shape {
  width: 100%;
  height: 100%;
}

.canvas-image,
.canvas-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.resize-handle {
  position: absolute;
  right: -9px;
  bottom: -9px;
  width: 14px;
  height: 14px;
  z-index: 4;
  border: 2px solid #fff;
  border-radius: 4px;
  background: var(--blue);
  box-shadow: 0 2px 8px rgba(8, 124, 250, 0.35);
  cursor: nwse-resize;
}

.ratio-lock-toggle {
  position: absolute;
  z-index: 6;
  top: 5px;
  right: 5px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(8, 124, 250, .22);
  border-radius: 6px;
  color: #718096;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 2px 7px rgba(31, 49, 77, .12);
  cursor: pointer;
  transition: transform var(--duration-fast) ease, color var(--duration-fast) ease, background-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.ratio-lock-toggle.locked {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 2px 7px rgba(8, 124, 250, .22);
}

.ratio-lock-toggle:hover {
  transform: translateY(-1px) scale(1.08);
}

.ratio-lock-toggle:focus-visible {
  outline: 2px solid rgba(8, 124, 250, .34);
  outline-offset: 2px;
}

.snap-guide {
  position: absolute;
  z-index: 2000;
  pointer-events: none;
  background: rgba(8, 124, 250, .8);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .52);
}

.snap-guide.vertical {
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-.5px);
}

.snap-guide.horizontal {
  left: 0;
  right: 0;
  height: 1px;
  transform: translateY(-.5px);
}

.snap-guide.center {
  background: repeating-linear-gradient(
    to bottom,
    rgba(8, 124, 250, .9) 0 5px,
    transparent 5px 8px
  );
  box-shadow: none;
}

.snap-guide.horizontal.center {
  background: repeating-linear-gradient(
    to right,
    rgba(8, 124, 250, .9) 0 5px,
    transparent 5px 8px
  );
}

.canvas-statusbar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 11px;
  z-index: 3;
  justify-content: space-between;
  color: #7f8999;
  font-size: 9px;
}

.canvas-status-left,
.canvas-size-status,
.selected-layer-metrics,
.selected-layer-metrics > span {
  display: flex;
  align-items: center;
}

.canvas-status-left {
  min-width: 0;
  gap: 12px;
  overflow: hidden;
}

.canvas-size-status {
  flex: 0 0 auto;
  gap: 7px;
}

.selected-layer-metrics {
  min-width: 0;
  gap: 8px;
  padding-left: 12px;
  overflow: hidden;
  border-left: 1px solid rgba(127, 137, 153, .22);
  white-space: nowrap;
}

.canvas-statusbar > span:last-child {
  flex: 0 0 auto;
  margin-left: 14px;
}

.selected-layer-metrics b {
  max-width: 110px;
  overflow: hidden;
  color: #48566b;
  text-overflow: ellipsis;
}

.selected-layer-metrics em {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 5px;
  color: var(--blue);
  background: rgba(8, 124, 250, .08);
  font-style: normal;
  font-weight: 650;
}

.selected-layer-metrics > span {
  flex: 0 0 auto;
  gap: 3px;
  color: #4f5d71;
  font-variant-numeric: tabular-nums;
}

.selected-layer-metrics small {
  color: #909aaa;
  font-size: inherit;
}

.selected-layer-metrics.is-empty {
  color: #a0a8b5;
}

.overview-grid {
  position: relative;
  z-index: 4;
  width: min(94%, 1040px);
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stage-wrap.overview .canvas-frame {
  display: none;
}

.stage-wrap.overview .overview-grid {
  display: grid;
}

.overview-card {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 51, 79, 0.1);
  cursor: pointer;
}

.overview-card:hover,
.overview-card.active {
  border-color: var(--blue);
}

.overview-card span {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  padding: 3px 7px;
  border-radius: 6px;
  color: #fff;
  background: rgba(23, 32, 51, 0.76);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
}

.overview-preview,
.thumbnail-preview {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.thumbnail-section {
  padding-top: 13px;
}

.thumbnail-heading {
  justify-content: space-between;
  margin-bottom: 8px;
}

.thumbnail-heading span {
  font-size: 11px;
  font-weight: 650;
}

.thumbnail-heading small {
  color: var(--subtle);
  font-size: 9px;
}

.thumbnail-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(112px, 1fr));
  gap: 9px;
}

.thumbnail-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(31, 51, 79, 0.08);
  cursor: pointer;
}

.thumbnail-card:hover,
.thumbnail-card.active {
  border-color: var(--blue);
}

.thumbnail-card strong {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 5;
  padding: 2px 5px;
  border-radius: 5px;
  color: #fff;
  background: rgba(23, 32, 51, 0.72);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7px;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(27, 36, 51, 0.32);
  backdrop-filter: blur(10px);
}

.modal-root.open {
  display: flex;
}

.modal {
  width: min(920px, 92vw);
  max-height: 86vh;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 32px 90px rgba(22, 34, 53, 0.22);
}

.modal.modal-small {
  width: 460px;
}

.modal.modal-full {
  width: 100%;
  height: 100%;
  max-height: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.modal.modal-full .modal-body {
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.modal.modal-full .resource-layout {
  min-height: 100%;
}

.modal-header {
  min-height: 68px;
  padding: 0 20px;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  margin: 0;
  font-size: 17px;
}

.modal-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.modal-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: #f4f6f9;
  cursor: pointer;
  font-size: 18px;
}

.modal-body {
  max-height: calc(86vh - 68px);
  overflow: auto;
  padding: 20px;
}

.resource-layout {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 18px;
}

.resource-nav {
  padding: 8px;
  border-radius: 13px;
  background: #f5f7fa;
}

.resource-nav small {
  display: block;
  padding: 10px 10px 6px;
  color: var(--subtle);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.resource-nav button {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 11px;
}

.resource-nav button:hover,
.resource-nav button.active {
  color: var(--blue-strong);
  background: #fff;
  box-shadow: 0 3px 10px rgba(31, 51, 79, 0.06);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.resource-card {
  min-height: 150px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.resource-thumb {
  height: 92px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: #f3f6fa;
}

.resource-thumb img {
  max-width: 62px;
  max-height: 62px;
}

.resource-card b {
  display: block;
  margin-top: 9px;
  font-size: 11px;
}

.resource-card small {
  color: var(--muted);
  font-size: 9px;
}

.empty-resource {
  min-height: 330px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--subtle);
  background: #fafbfd;
  font-size: 11px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.history-row {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.history-row b,
.history-row small {
  display: block;
}

.history-row b {
  font-size: 12px;
}

.history-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

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

.history-actions button,
.modal-footer button {
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 10px;
}

.history-actions button:first-child {
  color: var(--blue-strong);
  border-color: rgba(8, 124, 250, 0.25);
  background: var(--blue-soft);
}

.modal-footer {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.api-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.api-card + .api-card {
  margin-top: 10px;
}

.api-card h4 {
  margin: 0 0 10px;
  font-size: 12px;
}

.api-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.toast-stack {
  position: fixed;
  z-index: 8500;
  top: 82px;
  left: 50%;
  width: min(620px, calc(100vw - 48px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  pointer-events: none;
}

.toast {
  position: relative;
  isolation: isolate;
  min-height: 62px;
  padding: 11px 48px 11px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(180, 202, 232, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 44px rgba(35, 64, 103, 0.18), 0 2px 8px rgba(35, 64, 103, 0.08);
  animation: toast-in 220ms var(--ease) both;
  pointer-events: auto;
}

.toast::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--toast-color, var(--blue));
  opacity: .88;
}

.toast-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--toast-color, var(--blue));
  background: color-mix(in srgb, var(--toast-color, var(--blue)) 10%, white);
  font-size: 18px;
  font-weight: 800;
}

.toast.loading .toast-icon {
  border: 2px solid rgba(8, 124, 250, .16);
  border-top-color: var(--blue);
  border-radius: 50%;
  background: transparent;
  animation: toast-spin .8s linear infinite;
}

.toast-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toast-copy strong {
  color: #172033;
  font-size: 13px;
  line-height: 1.35;
}

.toast-copy > span {
  color: #536176;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.toast-close {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 28px;
  height: 28px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  color: #667085;
  background: #f3f6fa;
  cursor: pointer;
  font-size: 17px;
}

.toast-close:hover { color: #172033; background: #e9eef5; }
.toast.success { --toast-color: var(--success); }
.toast.warning { --toast-color: #c67a12; }
.toast.error { --toast-color: var(--danger); border-color: rgba(211, 76, 76, .28); }
.toast.loading { --toast-color: var(--blue); }
.toast-leaving { opacity: 0; transform: translateY(-8px) scale(.985); transition: opacity 180ms ease, transform 180ms ease; }

@keyframes toast-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast-icon { animation: none !important; }
}

/* V0.2 onboarding and verified model connections */
.auth-locked {
  overflow: hidden;
}

.auth-locked .app-shell {
  filter: blur(12px) saturate(.72);
  transform: scale(.992);
  pointer-events: none;
  user-select: none;
}

.app-shell {
  transition: filter 280ms var(--ease), transform 280ms var(--ease);
}

.auth-gate {
  position: fixed;
  z-index: 9000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: auto;
  background: rgba(238, 243, 250, .58);
  backdrop-filter: blur(20px);
  transition: opacity 180ms var(--ease), visibility 180ms var(--ease);
}

.auth-gate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  width: min(880px, calc(100vw - 56px));
  overflow: hidden;
  border: 1px solid rgba(205, 215, 229, .92);
  border-radius: 24px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 30px 90px rgba(47, 66, 95, .22), 0 3px 12px rgba(47, 66, 95, .08);
  animation: auth-card-in 320ms var(--ease) both;
}

.auth-loading-content {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #667085;
  font-weight: 650;
}

.auth-loading-content i {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(8, 133, 255, .18);
  border-top-color: #0885ff;
  border-radius: 50%;
  animation: auth-loading-spin .8s linear infinite;
}

@keyframes auth-loading-spin { to { transform: rotate(360deg); } }

@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-brand {
  height: 78px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.auth-brand img {
  width: 22px;
  height: 22px;
  filter: brightness(0) invert(1);
}

.auth-brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: var(--blue);
  box-shadow: 0 6px 16px rgba(8, 124, 250, .22);
}

.auth-brand b,
.auth-brand small {
  display: block;
}

.auth-brand b {
  font-size: 15px;
  letter-spacing: -.01em;
}

.auth-brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.auth-progress {
  padding: 18px 28px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.auth-progress span {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a1aaba;
  font-size: 10px;
}

.auth-progress span:not(:last-child)::after {
  content: "";
  height: 1px;
  margin: 0 12px;
  flex: 1;
  background: #e3e8f0;
}

.auth-progress i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #d9e0ea;
  border-radius: 50%;
  background: #fff;
  font-style: normal;
  font-weight: 700;
}

.auth-progress .active,
.auth-progress .done {
  color: var(--ink);
}

.auth-progress .active i {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(8, 124, 250, .1);
}

.auth-progress .done i {
  color: #168a5b;
  border-color: #bfe4d2;
  background: #effaf4;
}

.auth-content {
  padding: 34px 62px 38px;
}

.auth-content > h1 {
  margin: 7px 0 10px;
  color: #111826;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -.035em;
}

.auth-content > p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.auth-kicker {
  color: var(--blue-strong);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
}

.auth-form {
  width: min(440px, 100%);
}

.auth-form label,
.integration-card > label {
  display: block;
  margin-top: 12px;
}

.auth-form label > span,
.integration-card > label > span {
  display: block;
  margin-bottom: 7px;
  color: #596579;
  font-size: 10px;
  font-weight: 650;
}

.auth-form input,
.integration-card input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid #dbe2eb;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: #182033;
  font: inherit;
  font-size: 12px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.auth-form input:focus,
.integration-card input:focus {
  border-color: rgba(8, 124, 250, .72);
  box-shadow: 0 0 0 3px rgba(8, 124, 250, .1);
}

.local-invite {
  margin: 10px 0 0;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #d9e9ff;
  border-radius: 9px;
  background: #f5f9ff;
  color: #6b7790;
  font-size: 10px;
}

.local-invite button {
  border: 0;
  background: transparent;
  color: var(--blue-strong);
  cursor: pointer;
  font-weight: 700;
}

.auth-primary,
.test-connection {
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: #087cfa;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  box-shadow: 0 8px 18px rgba(8, 124, 250, .18);
  transition: transform 150ms ease, background 150ms ease, opacity 150ms ease;
}

.auth-form > .auth-primary {
  width: 100%;
  margin-top: 4px;
}

.auth-primary:hover:not(:disabled),
.test-connection:hover:not(:disabled) {
  background: #006fe6;
  transform: translateY(-1px);
}

.auth-primary:disabled,
.test-connection:disabled {
  background: #c8d2df;
  box-shadow: none;
  cursor: not-allowed;
}

.auth-back,
.logout-button {
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: #748096;
  cursor: pointer;
  font-size: 10px;
}

.logout-button {
  float: right;
  color: #bb4f58;
}

.auth-error {
  min-height: 22px;
  padding-top: 6px;
  color: #c23e4c;
  font-size: 10px;
}

.auth-help {
  margin-top: 12px;
  display: block;
  color: #98a1b1;
  font-size: 9px;
  line-height: 1.6;
}

.integration-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.integration-card {
  padding: 18px;
  border: 1px solid #dfe5ee;
  border-radius: 15px;
  background: #fafbfd;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.integration-card.is-connected {
  border-color: #bfe4d2;
  background: #fbfffd;
  box-shadow: 0 10px 30px rgba(30, 128, 88, .06);
}

.integration-card header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.provider-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #d9e7fb;
  border-radius: 10px;
  background: #eef5ff;
  color: #087cfa;
  font-size: 10px;
  font-weight: 800;
}

.integration-card h3,
.integration-card p {
  margin: 0;
}

.integration-card h3 {
  font-size: 13px;
}

.integration-card p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.integration-card header em {
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef1f5;
  color: #8a94a5;
  font-size: 8px;
  font-style: normal;
}

.integration-card.is-connected header em {
  background: #e9f8f0;
  color: #168a5b;
}

.secret-input {
  position: relative;
}

.secret-input input {
  padding-right: 56px;
}

.secret-input button {
  position: absolute;
  top: 6px;
  right: 6px;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: #f1f4f8;
  color: #667287;
  cursor: pointer;
  font-size: 9px;
}

.connection-message {
  min-height: 30px;
  padding-top: 9px;
  color: #8993a3;
  font-size: 9px;
  line-height: 1.45;
}

.connection-message.testing { color: #087cfa; }
.connection-message.success { color: #168a5b; }
.connection-message.error { color: #c23e4c; }

.test-connection {
  width: 100%;
  height: 38px;
  margin-top: 4px;
  border: 1px solid #cfe1fa;
  background: #f1f7ff;
  box-shadow: none;
  color: #087cfa;
  font-size: 10px;
}

.integration-card.is-connected .test-connection {
  border-color: #cae9da;
  background: #f0faf5;
  color: #168a5b;
}

.integration-footer {
  margin-top: 18px;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
}

.integration-footer b,
.integration-footer span {
  display: block;
}

.integration-footer b { font-size: 12px; }
.integration-footer span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.enter-button { min-width: 190px; }

.auth-card > footer {
  height: 50px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  background: #fafbfd;
  color: #8a94a5;
  font-size: 9px;
}

.auth-card > footer span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
}

.auth-card > footer i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #20a66c;
  box-shadow: 0 0 0 3px rgba(32, 166, 108, .11);
}

#apiStatusDot.connected {
  background: #20a66c;
  box-shadow: 0 0 0 3px rgba(32, 166, 108, .16);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(.985); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1440px) {
  .workspace {
    grid-template-columns: 380px minmax(720px, 1fr);
    padding: 12px;
    gap: 12px;
  }

  .editor-panel,
  .preview-panel {
    padding: 15px;
  }

  .topbar {
    padding: 0 18px;
  }

}

@media (max-width: 760px) {
  .auth-gate { padding: 12px; }
  .auth-card { width: 100%; border-radius: 18px; }
  .auth-content { padding: 28px 22px 30px; }
  .auth-content > h1 { font-size: 24px; }
  .auth-progress b { display: none; }
  .integration-grid { grid-template-columns: 1fr; }
  .integration-footer { align-items: stretch; flex-direction: column; }
  .enter-button { width: 100%; }
  .auth-card > footer span:last-child { display: none; }
}

/* V0.3.9 — editable numbered layers and linked selection state */
:root {
  --surface: #ffffff;
  --surface-muted: #f5f6f8;
  --surface-hover: #f0f2f5;
  --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.35, 0.64, 1);
  --duration-fast: 150ms;
  --duration-ui: 220ms;
  --duration-panel: 320ms;
  --shadow-material: 0 1px 3px rgba(24, 31, 44, .05), inset 0 0 0 1px rgba(31, 42, 61, .055), inset 0 -1px 0 rgba(31, 42, 61, .04);
}

.hg-icon,
[data-hgi] {
  width: 18px;
  height: 18px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: inherit;
  line-height: 0;
}

.hugeicon-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.number-control {
  position: relative;
  height: 32px;
}

.number-field {
  position: relative;
}

.number-field:hover,
.number-field:focus-within {
  z-index: 30;
}

.number-control-label {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 10px;
  max-width: 68px;
  overflow: hidden;
  color: #536075;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-50%);
}

.number-control input[type="number"] {
  height: 32px;
  padding: 0 34px 0 76px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}

.number-control input[type="number"]::-webkit-inner-spin-button,
.number-control input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.number-slider-shell {
  position: absolute;
  z-index: 5;
  top: 50%;
  right: 4px;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
}

.number-slider-trigger {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #8694a8;
  background: rgba(240, 244, 249, .72);
  cursor: ns-resize;
  transition: color var(--duration-fast) ease, background-color var(--duration-fast) ease, opacity var(--duration-fast) ease;
}

.number-slider-trigger .hugeicon-svg {
  width: 12px;
  height: 12px;
}

.number-slider-popover {
  position: absolute;
  z-index: 20;
  top: 50%;
  right: -6px;
  width: 40px;
  height: 120px;
  border: 1px solid rgba(8, 124, 250, .2);
  border-radius: 20px;
  opacity: 0;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 14px 34px rgba(31, 49, 77, .16), 0 0 0 4px rgba(8, 124, 250, .06);
  cursor: ns-resize;
  touch-action: none;
  pointer-events: none;
  transform: translate(8px, -50%) scale(.9);
  transform-origin: center;
  transition: opacity var(--duration-ui) var(--ease-smooth-out), transform var(--duration-panel) var(--ease-smooth-out);
}

.number-slider-shell:hover .number-slider-trigger,
.number-slider-shell:focus-within .number-slider-trigger {
  opacity: 0;
}

.number-slider-shell:hover .number-slider-popover,
.number-slider-shell:focus-within .number-slider-popover,
.number-slider-popover.dragging {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%) scale(1);
}

.number-slider-track {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 50%;
  width: 3px;
  border-radius: 999px;
  background: rgba(8, 124, 250, .32);
  transform: translateX(-50%);
  transition: background-color var(--duration-fast) ease;
}

.number-slider-thumb {
  position: absolute;
  z-index: 1;
  top: var(--number-slider-top);
  left: 50%;
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 1px 4px rgba(8, 124, 250, .35);
  transform: translate(-50%, -50%);
  transition: width var(--duration-fast) ease, height var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.number-slider-popover:hover .number-slider-track,
.number-slider-popover:focus-visible .number-slider-track,
.number-slider-popover.dragging .number-slider-track {
  background: var(--blue);
}

.number-slider-popover:hover .number-slider-thumb,
.number-slider-popover:focus-visible .number-slider-thumb,
.number-slider-popover.dragging .number-slider-thumb {
  width: 17px;
  height: 17px;
  box-shadow: 0 0 0 4px rgba(8, 124, 250, .12), 0 2px 7px rgba(8, 124, 250, .36);
}

.number-slider-popover:focus-visible {
  outline: 2px solid rgba(8, 124, 250, .28);
  outline-offset: 1px;
}

.ambient-bg {
  background:
    radial-gradient(circle at 26% 8%, rgba(8, 124, 250, .075), transparent 27%),
    radial-gradient(circle at 84% 18%, rgba(115, 90, 255, .045), transparent 24%),
    #f7f8fa;
}

.ambient-grid { opacity: .07; }

.topbar {
  border-bottom-color: rgba(31, 42, 61, .08);
  background: rgba(253, 253, 253, .9);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9);
}

.brand-mark,
.editor-panel,
.preview-panel,
.editor-section,
.property-panel,
.upload-card,
.modal,
.auth-card {
  box-shadow: var(--shadow-material);
}

.quiet-btn,
.icon-btn,
.primary-btn,
.generate-btn,
.zoom-chip,
.layer-action,
.modal-close,
.history-actions button,
.modal-footer button,
.auth-primary,
.test-connection {
  transition:
    transform var(--duration-ui) var(--ease-smooth-out),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    box-shadow var(--duration-ui) var(--ease-smooth-out),
    opacity var(--duration-fast) ease;
}

.quiet-btn,
.icon-btn,
.zoom-chip,
.modal-close {
  border-radius: 999px;
}

.quiet-btn:hover,
.icon-btn:hover,
.zoom-chip:hover,
.modal-close:hover {
  border-color: transparent;
  background: var(--surface-hover);
}

.quiet-btn:active,
.icon-btn:active,
.primary-btn:active,
.generate-btn:active,
.zoom-chip:active,
.layer-action:active,
.modal-close:active,
.auth-primary:active:not(:disabled),
.test-connection:active:not(:disabled) {
  transform: scale(.96);
  transition-duration: 90ms;
}

.icon-box { width: 17px; height: 17px; }
.primary-btn [data-hgi] { width: 17px; height: 17px; }

.editor-section {
  border-color: rgba(31, 42, 61, .075);
  border-radius: 18px;
  background: rgba(255, 255, 255, .8);
  transition:
    background-color var(--duration-ui) ease,
    box-shadow var(--duration-ui) var(--ease-smooth-out);
}

.editor-section:hover { background: rgba(255, 255, 255, .94); }

.section-title {
  transition: background-color var(--duration-fast) ease;
}

.section-chevron {
  width: 17px;
  height: 17px;
  transform: rotate(0deg);
  transition: transform var(--duration-panel) var(--ease-smooth-out), color var(--duration-fast) ease;
}

.editor-section:not(.section-open) .section-chevron { transform: rotate(180deg); }

.section-body {
  display: block;
  max-height: 2200px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    max-height var(--duration-panel) var(--ease-smooth-out),
    opacity 180ms ease,
    transform var(--duration-panel) var(--ease-smooth-out),
    padding var(--duration-panel) var(--ease-smooth-out),
    visibility 0s linear;
}

.section-body.group-grid { display: grid; }

.editor-section:not(.section-open) .section-body {
  display: block;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-7px);
  pointer-events: none;
  transition:
    max-height var(--duration-panel) var(--ease-smooth-out),
    opacity 140ms ease,
    transform var(--duration-ui) var(--ease-smooth-out),
    padding var(--duration-panel) var(--ease-smooth-out),
    visibility 0s linear var(--duration-panel);
}

.upload-icon {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: #edf5ff;
}

.upload-icon .hugeicon-svg { width: 17px; height: 17px; }
.rule-note i { width: 17px; height: 17px; border: 0; }
.rule-note i .hugeicon-svg { width: 16px; height: 16px; }
.spark-symbol { width: 18px; height: 18px; }

.add-element-row button,
.add-element-row label {
  transition:
    transform var(--duration-ui) var(--ease-smooth-out),
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    background-color var(--duration-fast) ease;
}

.add-element-row button:hover,
.add-element-row label:hover { transform: translateY(-2px); }
.add-element-row button:active,
.add-element-row label:active { transform: translateY(0) scale(.98); }
.add-element-row span { width: 18px; height: 18px; }

.layer-row {
  transition:
    transform var(--duration-ui) var(--ease-smooth-out),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    box-shadow var(--duration-ui) var(--ease-smooth-out);
}

.layer-row:hover { transform: translateX(2px); }
.layer-kind { width: 26px; height: 26px; }
.layer-kind .hugeicon-svg { width: 15px; height: 15px; }
.layer-action { display: inline-grid; place-items: center; }
.layer-action .hugeicon-svg { width: 14px; height: 14px; }

.property-title button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 8px;
}

.property-title button:hover { background: rgba(211, 76, 76, .07); }
.property-title button .hugeicon-svg { width: 14px; height: 14px; }

.segmented,
.view-switch {
  position: relative;
  border: 0;
  border-radius: 12px;
  background: #f0f2f5;
  box-shadow: inset 0 0 0 1px rgba(31, 42, 61, .04);
}

.segmented button,
.segmented label,
.view-switch button {
  transition:
    transform var(--duration-ui) var(--ease-smooth-out),
    color var(--duration-fast) ease,
    background-color var(--duration-fast) ease,
    box-shadow var(--duration-ui) var(--ease-smooth-out);
}

.segmented button.active,
.view-switch button.active {
  box-shadow: 0 1px 3px rgba(31, 42, 61, .09), inset 0 0 0 1px rgba(31, 42, 61, .05);
}

.modal-root {
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 220ms var(--ease-smooth-out),
    visibility 0s linear 220ms,
    backdrop-filter 220ms var(--ease-smooth-out);
}

.modal-root.open {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 220ms var(--ease-smooth-out), visibility 0s linear;
}

.modal {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(14px) scale(.985);
  transition:
    opacity 220ms var(--ease-smooth-out),
    filter 300ms var(--ease-smooth-out),
    transform 300ms var(--ease-smooth-out);
}

.modal-root.open .modal {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
}

.modal-close { display: inline-grid; place-items: center; }
.modal-close .hugeicon-svg { width: 17px; height: 17px; }
.resource-upload-icon { color: var(--blue); background: #edf5ff; }

.toast {
  transform-origin: top center;
  animation: toast-in 300ms var(--ease-smooth-out) both;
}

.toast-icon { border-radius: 11px; }
.toast-icon .hugeicon-svg { width: 19px; height: 19px; }
.toast.loading .toast-icon { border: 0; border-radius: 11px; background: #edf5ff; animation: none; }
.toast.loading .toast-icon .hugeicon-svg { animation: toast-spin .85s linear infinite; }
.toast-close { display: inline-grid; place-items: center; }
.toast-close .hugeicon-svg { width: 15px; height: 15px; }

.auth-loading-content i {
  width: 20px;
  height: 20px;
  border: 0;
  animation: auth-loading-spin .85s linear infinite;
}

.auth-loading-content i .hugeicon-svg { width: 20px; height: 20px; }
.auth-progress i .hugeicon-svg { width: 14px; height: 14px; }

.auth-card {
  opacity: 1;
  transform-origin: center;
  animation: auth-card-in 360ms var(--ease-smooth-out) both;
}

.auth-gate {
  transition: opacity 220ms var(--ease-smooth-out), visibility 0s linear;
}

.auth-gate.hidden {
  transition: opacity 220ms var(--ease-smooth-out), visibility 0s linear 220ms;
}

@keyframes toast-in {
  from { opacity: 0; filter: blur(5px); transform: translateY(-12px) scale(.97); }
  to { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}

.stage-wrap { view-transition-name: preview-stage; }

::view-transition-group(preview-stage) {
  animation-duration: 280ms;
  animation-timing-function: var(--ease-smooth-out);
}

::view-transition-old(preview-stage) {
  animation: preview-old 180ms ease both;
}

::view-transition-new(preview-stage) {
  animation: preview-new 280ms var(--ease-smooth-out) both;
}

@keyframes preview-old {
  to { opacity: 0; filter: blur(5px); transform: scale(.992); }
}

@keyframes preview-new {
  from { opacity: 0; filter: blur(6px); transform: translateY(7px) scale(.992); }
}

/* V0.3.8 — calm, always-open editor sections */
.editor-panel {
  padding: 14px 14px 56px;
}

.editor-section,
.editor-section:hover {
  margin-bottom: 12px;
  border-color: rgba(31, 42, 61, .085);
  border-radius: 16px;
  background: rgba(255, 255, 255, .92);
  box-shadow: none;
}

.section-title {
  min-height: 0;
  padding: 17px 18px 12px;
  gap: 0;
  cursor: default;
  background: transparent;
}

.section-title:hover {
  background: transparent;
}

.section-title > span:first-child {
  min-width: 0;
  flex: 1;
}

.section-title b {
  color: #263247;
  font-size: 14px;
  letter-spacing: -.01em;
}

.section-title small {
  margin-top: 4px;
  font-size: 10px;
}

.section-body,
.editor-section:not(.section-open) .section-body,
.section-body.group-grid,
.editor-section:not(.section-open) .section-body.group-grid {
  max-height: none;
  padding: 0 18px 18px;
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

.section-body.group-grid,
.editor-section:not(.section-open) .section-body.group-grid {
  display: grid;
}

[data-section="group"] select {
  height: 42px;
  border-radius: 11px;
  background-color: #fbfcfe;
}

/* V0.3.17 — compact inline selectors for set count and canvas size */
[data-section="group"] .group-grid {
  grid-template-columns: .82fr 1.18fr;
  gap: 8px;
}

[data-section="group"] .inline-select-field {
  position: relative;
  min-width: 0;
  margin: 0;
}

[data-section="group"] .inline-select-label {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 12px;
  display: inline-flex;
  align-items: center;
  margin: 0;
  color: #7a879a;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);
}

[data-section="group"] .inline-select-field select {
  height: 44px;
  padding: 0 28px 0 48px;
  border-color: #dfe6f0;
  border-radius: 11px;
  color: #172033;
  background-color: #fbfcfe;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: right;
  text-align-last: right;
  cursor: pointer;
}

[data-section="group"] .inline-select-field:hover select {
  border-color: #c9d5e5;
  background-color: #fff;
}

[data-section="group"] .inline-select-field:focus-within select {
  border-color: rgba(8, 124, 250, .62);
  box-shadow: 0 0 0 3px rgba(8, 124, 250, .08);
  background-color: #fff;
}

[data-section="group"] .inline-select-field:focus-within .inline-select-label {
  color: #087cfa;
}

[data-section="group"] .section-title > span,
[data-section="layers"] .section-title > span {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  white-space: nowrap;
}

[data-section="group"] .section-title b,
[data-section="group"] .section-title small,
[data-section="layers"] .section-title b,
[data-section="layers"] .section-title small {
  display: inline;
  margin-top: 0;
}

.preview-title-block {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.preview-title-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
}

.preview-toolbar .preview-title-meta > span {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.preview-title-block .autosave-state {
  margin: 0;
  color: #768297;
  font-size: 10px;
}

.layer-list {
  gap: 6px;
}

.layer-row {
  min-height: 46px;
  padding: 7px 7px 7px 4px;
  gap: 5px;
  border: 0;
  border-radius: 11px;
  background: #f6f8fb;
}

.layer-row:hover {
  border-color: transparent;
  background: #f1f5fa;
}

.layer-kind {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.layer-number {
  width: 20px;
  flex: 0 0 20px;
  color: #738096;
  font-family: "DIN Alternate", "DIN Condensed", "Arial Narrow", ui-monospace, sans-serif;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: .01em;
  text-align: center;
}

.layer-row.active .layer-number {
  color: #fff;
}

.layer-name {
  font-size: 11px;
  font-weight: 560;
}

.layer-actions {
  gap: 2px;
}

.layer-action {
  width: 24px;
  height: 24px;
}

.layer-row.active,
.layer-row.active:hover {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 7px 16px rgba(8, 124, 250, .2);
}

.layer-row.active .layer-kind {
  color: #fff;
  border-color: rgba(255, 255, 255, .34);
  background: rgba(255, 255, 255, .14);
}

.layer-row.active .layer-name,
.layer-row.active .layer-name small,
.layer-row.active .layer-actions,
.layer-row.active .layer-action {
  color: #fff;
}

.layer-row.active .layer-action:hover {
  color: #fff;
  background: rgba(255, 255, 255, .18);
}

.layer-row.active .layer-action:disabled {
  opacity: .34;
}

/* V0.3.20 — make locked layers distinguishable without competing with selection */
.layer-row.layer-locked:not(.active) {
  background: #eaf0f7;
  box-shadow: inset 3px 0 0 #9babc0;
}

.layer-row.layer-locked:not(.active):hover,
.layer-row.layer-locked:not(.active):focus-within {
  background: #e3ebf5;
  box-shadow: inset 3px 0 0 #7f93ad;
}

.layer-row.layer-locked:not(.active) .layer-name {
  color: #46566d;
}

.layer-row.layer-locked:not(.active) .layer-lock-trigger.is-locked .layer-lock-default {
  color: #516d8e;
}

.layer-name {
  cursor: text;
}

.layer-name-input {
  height: 27px;
  min-width: 0;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 7px;
  color: #172033;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .18);
  font-size: 11px;
  font-weight: 600;
}

.layer-name-input:focus {
  border-color: #fff;
  background: #fff;
  outline: none;
}

.property-panel:not(.empty-property) {
  border: 2px solid var(--blue);
  background: rgba(248, 251, 255, .96);
  box-shadow: 0 0 0 3px rgba(8, 124, 250, .09), 0 9px 22px rgba(8, 124, 250, .1);
}

/* V0.3.10 — integer metrics and live-change feedback */
.selected-layer-metrics {
  padding: 3px 8px 3px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  box-shadow: inset 1px 0 0 rgba(127, 137, 153, .22);
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.selected-layer-metrics.is-changing {
  border-color: rgba(8, 124, 250, .28);
  background: rgba(8, 124, 250, .075);
  box-shadow:
    inset 1px 0 0 rgba(8, 124, 250, .18),
    0 0 0 3px rgba(8, 124, 250, .045);
}

.selected-layer-metrics.is-empty {
  border-color: transparent;
  background: transparent;
  box-shadow: inset 1px 0 0 rgba(127, 137, 153, .22);
}

/* V0.3.11 — unified background layer and lighter editor hierarchy */
.workspace {
  grid-template-columns: 360px minmax(720px, 1fr);
}

.editor-panel {
  padding: 12px 10px 52px;
}

[data-section="group"],
[data-section="group"]:hover,
[data-section="layers"],
[data-section="layers"]:hover {
  margin-bottom: 8px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

[data-section="group"] .section-title,
[data-section="layers"] .section-title {
  padding: 13px 8px 10px;
}

[data-section="group"] .section-body,
[data-section="layers"] .section-body {
  padding: 0 8px 14px;
}

.background-layer-row {
  position: relative;
  margin-top: 3px;
}

.background-layer-row::before {
  position: absolute;
  top: -5px;
  right: 8px;
  left: 8px;
  height: 1px;
  content: "";
  background: rgba(31, 42, 61, .07);
}

.background-layer-row.active::before {
  opacity: 0;
}

.background-layer-row .layer-kind {
  color: var(--blue);
  background: #f0f6ff;
}

.fixed-layer-badge {
  padding: 4px 7px;
  border-radius: 7px;
  color: #667287;
  background: #eef2f7;
  font-family: "DIN Alternate", "Arial Narrow", ui-monospace, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
}

.background-layer-controls {
  grid-column: 1 / -1;
}

.background-property-panel .property-title {
  margin-bottom: 10px;
}

.background-property-panel .segmented label.disabled,
.background-property-panel :disabled {
  cursor: not-allowed;
  opacity: .48;
}

.background-lock-note {
  margin-top: 10px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 9px;
  color: #667287;
  background: #f2f5f9;
  font-size: 10px;
  line-height: 1.45;
}

.canvas-background.hidden-background {
  background: transparent !important;
}

/* V0.3.13 — layer label colors */
.layer-list,
.layer-row {
  overflow: visible;
}

.layer-row {
  position: relative;
  z-index: 0;
}

.layer-row:hover,
.layer-row:focus-within {
  z-index: 80;
}

.layer-lock-trigger {
  position: relative;
  width: 20px;
  height: 28px;
  padding: 0;
  flex: 0 0 20px;
  border: 0;
  border-radius: 7px;
  color: #738096;
  background: transparent;
  cursor: pointer;
}

.layer-lock-default,
.layer-lock-hover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity 140ms ease, transform 140ms ease, color 140ms ease, background-color 140ms ease;
}

.layer-lock-default {
  opacity: 1;
  transform: scale(1);
}

.layer-lock-hover {
  color: var(--blue);
  opacity: 0;
  transform: scale(.78);
}

.layer-lock-trigger:hover,
.layer-lock-trigger:focus-visible {
  background: rgba(8, 124, 250, .09);
  outline: none;
}

.layer-lock-trigger:hover .layer-lock-default,
.layer-lock-trigger:focus-visible .layer-lock-default {
  opacity: 0;
  transform: scale(.78);
}

.layer-lock-trigger:hover .layer-lock-hover,
.layer-lock-trigger:focus-visible .layer-lock-hover {
  opacity: 1;
  transform: scale(1);
}

.layer-lock-trigger.is-locked .layer-lock-default {
  color: var(--blue);
}

.layer-lock-trigger .hugeicon-svg {
  width: 14px;
  height: 14px;
}

.layer-row.active .layer-lock-trigger,
.layer-row.active .layer-lock-trigger.is-locked .layer-lock-default,
.layer-row.active .layer-lock-trigger .layer-lock-hover {
  color: #fff;
}

.layer-row.active .layer-lock-trigger:hover,
.layer-row.active .layer-lock-trigger:focus-visible {
  background: rgba(255, 255, 255, .16);
}

.layer-color-trigger {
  position: relative;
  width: 26px;
  height: 28px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  cursor: pointer;
}

.layer-color-trigger > .layer-kind {
  flex: 0 0 26px;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.layer-color-trigger:hover > .layer-kind,
.layer-color-trigger:focus-within > .layer-kind {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 10px rgba(8, 124, 250, .14);
}

.layer-color-menu {
  position: absolute;
  top: calc(100% - 2px);
  left: -24px;
  z-index: 90;
  width: 126px;
  padding: 6px;
  display: grid;
  gap: 1px;
  border: 1px solid rgba(202, 213, 228, .92);
  border-radius: 12px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 14px 34px rgba(31, 49, 77, .16), 0 2px 7px rgba(31, 49, 77, .08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(.98);
  transform-origin: top left;
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
  pointer-events: none;
}

.layer-row:nth-last-child(-n + 6) .layer-color-menu {
  top: auto;
  bottom: calc(100% - 2px);
  transform: translateY(4px) scale(.98);
  transform-origin: bottom left;
}

.layer-color-trigger:hover .layer-color-menu,
.layer-color-trigger:focus-within .layer-color-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.layer-color-option {
  width: 100%;
  min-height: 25px;
  padding: 3px 5px 3px 2px;
  display: grid;
  grid-template-columns: 14px 17px 1fr;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 7px;
  color: #263247;
  background: transparent;
  font-size: 10px;
  font-weight: 560;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

.layer-color-option:hover,
.layer-color-option:focus-visible {
  color: #172033;
  background: #f0f4f9;
  outline: none;
}

.layer-color-option.selected {
  color: #172033;
  background: #edf4ff;
}

.layer-color-check {
  color: #172033;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.layer-color-swatch {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--swatch) 76%, #56657a);
  border-radius: 5px;
  color: #263247;
  background: var(--swatch);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
}

.layer-color-swatch.no-color {
  border-color: #7b8798;
  background: #fff;
}

.layer-row.has-layer-color .layer-kind,
.layer-row.has-layer-color.layer-locked .layer-kind,
.layer-row.active.has-layer-color .layer-kind {
  color: #fff;
  border-color: color-mix(in srgb, var(--layer-label-color) 72%, #56657a);
  background: var(--layer-label-color);
  box-shadow: 0 3px 8px color-mix(in srgb, var(--layer-label-color) 24%, transparent);
}

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

  .editor-panel {
    padding: 11px 9px 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
