:root {
  --app-bg: #111113;
  --panel: #191a1d;
  --panel-2: #202126;
  --panel-3: #262831;
  --line: #343741;
  --text: #f4f5f7;
  --muted: #a7adba;
  --subtle: #747b8b;
  --accent: #36d1b4;
  --accent-2: #8b5cf6;
  --warn: #f5b94b;
  --danger: #ff6b6b;
  --shadow: 0 20px 70px rgba(0, 0, 0, .35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
}

body {
  background: var(--app-bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
  overflow: hidden;
}

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

button {
  border: 0;
}

.app-frame {
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 17, 19, .92);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.brand p {
  margin: 3px 0 0;
  color: var(--subtle);
  font-size: 12px;
}

.top-actions,
.export-stack,
.field-line,
.canvas-tabs,
.segmented,
.config-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary-btn,
.ghost-btn,
.segmented button,
.canvas-tabs button,
.config-tabs button {
  min-height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.primary-btn {
  padding: 0 16px;
  color: #071411;
  background: linear-gradient(135deg, var(--accent), #c7ff62);
}

.ghost-btn {
  padding: 0 14px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.ghost-btn:disabled,
.primary-btn:disabled {
  cursor: not-allowed;
  opacity: .52;
}

.editor-layout {
  display: grid;
  grid-template-columns: 270px minmax(420px, 1fr) 360px;
  min-height: 0;
}

.left-rail,
.right-panel,
.workspace {
  min-height: 0;
  border-right: 1px solid var(--line);
}

.left-rail,
.right-panel {
  background: var(--panel);
  overflow: auto;
}

.left-rail {
  padding: 14px;
}

.rail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.rail-head span,
.hint {
  color: var(--subtle);
  font-size: 12px;
}

.segmented,
.config-tabs,
.canvas-tabs {
  padding: 4px;
  background: #101114;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.segmented {
  margin-bottom: 12px;
}

.segmented button,
.canvas-tabs button,
.config-tabs button {
  flex: 1;
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
}

.segmented button.active,
.canvas-tabs button.active,
.config-tabs button.active {
  color: var(--text);
  background: var(--panel-3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}

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

.template-card {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  width: 100%;
  min-height: 92px;
  padding: 8px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
}

.template-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(54, 209, 180, .15);
}

.template-thumb {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  object-fit: cover;
  background: #111;
}

.template-meta strong {
  display: block;
  margin: 4px 0;
  font-size: 14px;
}

.template-meta span {
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.4;
}

.workspace {
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr) 230px;
  background:
    radial-gradient(circle at 20% 0%, rgba(54, 209, 180, .16), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(245, 185, 75, .12), transparent 28%),
    #131416;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}

.status-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(0, 0, 0, .22);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}

.status-pill.error {
  color: #ffd8d8;
  border-color: rgba(255, 107, 107, .55);
}

.canvas-stage {
  position: relative;
  min-height: 0;
  overflow: auto;
  padding: 34px;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 24px 24px;
}

.live-card-shell,
.image-result {
  display: grid;
  place-items: start center;
  min-height: 100%;
}

.image-result {
  display: none;
}

.live-card {
  width: min(var(--card-width, 440px), 100%);
  color: #101214;
  background: linear-gradient(145deg, #e4efff, #7dc2ff 52%, #6f61ff);
  padding: 12px;
  border-radius: calc(var(--card-radius, 18) * 1px + 12px);
  box-shadow: var(--shadow);
  transform: rotate(var(--card-rotate, 0deg));
}

.live-card-inner {
  position: relative;
  min-height: 280px;
  height: var(--card-height, auto);
  padding: var(--card-padding, 30px);
  border-radius: calc(var(--card-radius, 18) * 1px);
  background: rgba(255, 255, 255, .88);
  overflow: hidden;
}

.card-topline {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
  color: rgba(16, 18, 20, .6);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  display: none;
}

.foreword {
  margin-top: 4px;
  font-size: 13px;
}

.date {
  font-size: 13px;
}

.live-card h2 {
  margin: 0 0 16px;
  font-size: calc(var(--font-scale, 1) * 25px);
  line-height: 1.25;
}

.content-preview {
  font-size: calc(var(--font-scale, 1) * 15px);
  line-height: 1.75;
  white-space: pre-wrap;
  text-align: var(--card-align, left);
}

.content-preview p {
  margin: 0 0 10px;
}

.content-preview ul {
  margin: 8px 0 8px 20px;
}

.translation {
  margin-top: 16px;
  color: rgba(16, 18, 20, .58);
  font-size: calc(var(--font-scale, 1) * 13px);
  line-height: 1.6;
  white-space: pre-wrap;
}

.live-card footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 34px;
  color: rgba(16, 18, 20, .48);
  font-size: 13px;
}

.qr-block {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(16, 18, 20, .12);
}

.qr-box {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, #111 50%, transparent 0) 0 0 / 12px 12px,
    linear-gradient(#111 50%, transparent 0) 0 0 / 12px 12px,
    #fff;
  border: 7px solid #fff;
}

.qr-block strong,
.qr-block span {
  display: block;
}

.qr-block span {
  color: rgba(16, 18, 20, .55);
  font-size: 12px;
  margin-top: 4px;
}

.watermark {
  display: none;
  position: absolute;
  right: 20px;
  bottom: 18px;
  color: rgba(16, 18, 20, .14);
  font-weight: 800;
  transform: rotate(-12deg);
}

.image-result img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.empty-image {
  display: grid;
  gap: 8px;
  place-items: center;
  width: min(520px, 100%);
  min-height: 260px;
  color: var(--muted);
  background: rgba(25, 26, 29, .62);
  border: 1px dashed #525866;
  border-radius: 14px;
}

.empty-image span {
  color: var(--subtle);
  font-size: 13px;
}

.bottom-editor {
  padding: 14px;
  background: rgba(17, 17, 19, .9);
  border-top: 1px solid var(--line);
}

.field-line {
  margin-bottom: 10px;
}

.field-line input {
  flex: 1;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: #111216;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
}

input,
select {
  height: 38px;
  padding: 0 11px;
}

input[type="color"] {
  padding: 4px;
}

textarea {
  resize: vertical;
  padding: 10px 11px;
  line-height: 1.6;
}

#jsonInput {
  min-height: 220px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(54, 209, 180, .14);
}

.right-panel {
  border-right: 0;
}

.config-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 12px;
}

.panel-body {
  display: none;
  padding: 0 14px 18px;
}

.panel-body.active {
  display: grid;
  gap: 14px;
}

.control {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.control b {
  color: var(--text);
  font-weight: 700;
}

.range-grid {
  display: grid;
  gap: 14px;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
}

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

.swatch {
  aspect-ratio: 1;
  border-radius: 9px;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--swatch-bg);
}

.swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--accent);
}

.toggle-list {
  display: grid;
  gap: 10px;
}

.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.toggle-item span {
  font-weight: 700;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.switch i {
  display: block;
  width: 44px;
  height: 24px;
  background: #4a4f5d;
  border-radius: 999px;
  transition: .2s;
}

.switch i::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  transition: .2s;
}

.switch input:checked + i {
  background: var(--accent);
}

.switch input:checked + i::after {
  transform: translateX(20px);
}

.export-stack {
  align-items: stretch;
  flex-direction: column;
}

.export-stack button {
  min-height: 42px;
}

.hidden-field {
  display: none !important;
}

body.image-mode .live-card-shell {
  display: none;
}

body.image-mode .image-result {
  display: grid;
}

.theme-tempB .live-card {
  background: linear-gradient(160deg, #15171f, #4d6bff 45%, #f5b94b);
}

.theme-tempB .live-card-inner {
  color: #fff;
  background: rgba(10, 12, 18, .88);
}

.theme-tempB .card-topline,
.theme-tempB .translation,
.theme-tempB footer,
.theme-tempB .qr-block span {
  color: rgba(255, 255, 255, .62);
}

.theme-tempC .live-card {
  background: linear-gradient(135deg, #fbfbfd, #eae6df);
}

.theme-tempC .live-card-inner {
  background: #fff;
}

.theme-tempMemo .live-card {
  background: #f7f2e8;
  box-shadow: 0 16px 52px rgba(0, 0, 0, .25);
}

.theme-tempMemo .live-card-inner {
  background: repeating-linear-gradient(#fffef8, #fffef8 34px, #edf0d8 35px);
}

.theme-tempJin .live-card {
  background: linear-gradient(145deg, #15110a, #c79535);
}

.theme-tempWrite .live-card {
  background: linear-gradient(145deg, #f7efe1, #c9ad82);
}

.theme-tempStory .live-card {
  background: linear-gradient(160deg, #fff, #25201c);
}

@media (max-width: 1180px) {
  .editor-layout {
    grid-template-columns: 230px minmax(360px, 1fr) 320px;
  }
}

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

  .app-frame {
    height: auto;
    min-height: 100vh;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    min-height: 64px;
  }

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

  .left-rail,
  .right-panel,
  .workspace {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    min-height: 760px;
  }

  .template-list {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  }
}

@media (max-width: 560px) {
  .topbar,
  .field-line,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .canvas-stage {
    padding: 18px;
  }

  .workspace {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
}

/* design-taste-frontend: Liquid Spectrum landing refinement */
:root {
  --taste-bg: #030611;
  --taste-surface: rgba(8, 13, 27, .58);
  --taste-surface-strong: rgba(13, 20, 38, .76);
  --taste-border: rgba(214, 232, 255, .16);
  --taste-border-hot: rgba(124, 235, 255, .42);
  --taste-text: #fbfdff;
  --taste-dim: rgba(225, 236, 255, .72);
  --taste-faint: rgba(171, 187, 216, .56);
  --taste-blue: #60d8ff;
  --taste-violet: #9b8cff;
  --taste-pink: #ff4fd8;
  --taste-green: #68ffd0;
}

body {
  color: var(--taste-text);
  background-color: var(--taste-bg);
  background-image:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, .88) 0 1px, transparent 1.7px),
    radial-gradient(circle at 78% 22%, rgba(96, 216, 255, .76) 0 1px, transparent 1.8px),
    radial-gradient(circle at 30% 78%, rgba(255, 79, 216, .58) 0 1px, transparent 1.8px),
    linear-gradient(rgba(130, 204, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .032) 1px, transparent 1px),
    radial-gradient(ellipse at 18% 24%, rgba(96, 216, 255, .34), transparent 32%),
    radial-gradient(ellipse at 78% 18%, rgba(155, 140, 255, .34), transparent 34%),
    radial-gradient(ellipse at 62% 78%, rgba(255, 79, 216, .24), transparent 36%),
    conic-gradient(from 220deg at 50% 42%, rgba(96, 216, 255, .62), rgba(155, 140, 255, .62), rgba(255, 79, 216, .58), rgba(104, 255, 208, .44), rgba(96, 216, 255, .62)),
    linear-gradient(145deg, #030611 0%, #071226 46%, #0b1026 72%, #030611 100%);
  background-size:
    300px 300px,
    420px 420px,
    520px 520px,
    52px 52px,
    52px 52px,
    100% 100%,
    100% 100%,
    100% 100%,
    150% 150%,
    100% 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -4;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 18%, rgba(255, 255, 255, .12) 36%, transparent 54%),
    radial-gradient(circle at 50% -12%, rgba(255, 255, 255, .18), transparent 34%);
  mix-blend-mode: screen;
  opacity: .48;
}

.app-frame {
  grid-template-rows: 106px minmax(0, 1fr);
  padding: 16px 20px 20px;
  gap: 16px;
}

.app-frame::before {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(96, 216, 255, .24), transparent 42%),
    radial-gradient(ellipse at 84% 18%, rgba(155, 140, 255, .24), transparent 42%),
    radial-gradient(ellipse at 56% 94%, rgba(255, 79, 216, .18), transparent 46%),
    linear-gradient(118deg, transparent 0 18%, rgba(96, 216, 255, .12) 32%, rgba(155, 140, 255, .11) 50%, rgba(255, 79, 216, .1) 68%, transparent 86%);
  opacity: .82;
  animation: neonMist 12s ease-in-out infinite alternate;
}

.app-frame::after {
  inset: 124px 20px 20px;
  border-color: rgba(220, 238, 255, .12);
  border-radius: 36px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .018) 40%, rgba(96, 216, 255, .055)),
    radial-gradient(circle at 18% 20%, rgba(96, 216, 255, .06), transparent 34%),
    linear-gradient(rgba(255, 255, 255, .038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 0 120px rgba(96, 216, 255, .055),
    0 0 80px rgba(96, 216, 255, .1),
    0 36px 120px rgba(0, 0, 0, .42);
}

.topbar {
  height: 106px;
  padding: 20px 24px;
  border-radius: 32px;
  border-color: rgba(222, 238, 255, .18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .055) 38%, rgba(96, 216, 255, .07)),
    linear-gradient(90deg, rgba(96, 216, 255, .08), rgba(255, 79, 216, .055)),
    rgba(5, 10, 22, .72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    inset 0 -1px 0 rgba(255, 255, 255, .05),
    0 24px 86px rgba(0, 0, 0, .38),
    0 0 72px rgba(96, 216, 255, .1);
}

.brand-mark {
  width: 60px;
  height: 60px;
  border-radius: 19px;
  color: #050714;
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, .78), transparent 31%),
    linear-gradient(145deg, #b9f4ff 0%, #9b8cff 44%, #ff4fd8 100%);
  box-shadow:
    0 18px 48px rgba(96, 216, 255, .24),
    0 0 42px rgba(255, 79, 216, .18),
    inset 0 1px 0 rgba(255, 255, 255, .62),
    inset 0 -14px 30px rgba(5, 7, 20, .16);
}

.brand h1 {
  color: #ffffff;
  font-size: clamp(30px, 2.6vw, 40px);
  font-weight: 860;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, .08),
    0 0 32px rgba(96, 216, 255, .2);
}

.brand h1::after {
  color: #050714;
  border-color: rgba(255, 255, 255, .32);
  background:
    radial-gradient(circle at 22% 12%, rgba(255, 255, 255, .78), transparent 34%),
    linear-gradient(135deg, #b9f4ff, #d8c8ff 46%, #ffd1f4 74%, #fff0a8);
  box-shadow:
    0 0 22px rgba(96, 216, 255, .22),
    0 0 26px rgba(255, 79, 216, .14),
    inset 0 1px 0 rgba(255, 255, 255, .62);
}

.brand p {
  color: var(--taste-dim);
  font-size: 13px;
  font-weight: 690;
}

.top-actions .ghost-btn,
.top-actions .primary-btn {
  min-height: 43px;
  border-radius: 999px;
}

.top-actions .ghost-btn {
  color: #eef7ff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .055)),
    rgba(10, 16, 31, .64);
  border-color: rgba(222, 238, 255, .18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    0 12px 32px rgba(0, 0, 0, .24);
}

.top-actions .primary-btn,
.export-stack .primary-btn {
  background:
    radial-gradient(circle at 24% 12%, rgba(255, 255, 255, .8), transparent 30%),
    linear-gradient(135deg, var(--taste-blue), var(--taste-violet) 42%, var(--taste-pink) 72%, #ffcf73);
  box-shadow:
    0 0 28px rgba(96, 216, 255, .28),
    0 0 42px rgba(255, 79, 216, .2),
    0 16px 38px rgba(0, 0, 0, .24),
    inset 0 1px 0 rgba(255, 255, 255, .68);
}

.editor-layout {
  gap: 16px;
  grid-template-columns: minmax(244px, 292px) minmax(540px, 1fr) minmax(334px, 392px);
}

.left-rail,
.workspace,
.right-panel {
  border-radius: 32px;
  border-color: var(--taste-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .038)),
    radial-gradient(circle at 24% 0%, rgba(96, 216, 255, .065), transparent 32%),
    var(--taste-surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .18),
    inset 0 -1px 0 rgba(255, 255, 255, .04),
    0 28px 92px rgba(0, 0, 0, .34);
}

.left-rail {
  padding: 19px;
}

.workspace {
  grid-template-rows: 60px minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .095), rgba(255, 255, 255, .032)),
    radial-gradient(circle at 50% 0%, rgba(96, 216, 255, .1), transparent 38%),
    rgba(6, 11, 23, .5);
}

.canvas-toolbar {
  min-height: 60px;
  background:
    linear-gradient(90deg, rgba(96, 216, 255, .12), rgba(155, 140, 255, .09), rgba(255, 79, 216, .08)),
    rgba(6, 11, 23, .48);
}

.canvas-stage {
  background-color: rgba(4, 9, 20, .22);
  background-image:
    linear-gradient(rgba(96, 216, 255, .075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .038) 1px, transparent 1px),
    radial-gradient(circle at 22% 18%, rgba(96, 216, 255, .14), transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(255, 79, 216, .11), transparent 32%),
    radial-gradient(circle at 50% 78%, rgba(104, 255, 208, .08), transparent 38%);
  background-size: 30px 30px, 30px 30px, 100% 100%, 100% 100%, 100% 100%;
}

.segmented,
.config-tabs,
.canvas-tabs {
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .045)),
    rgba(4, 9, 20, .6);
  border-color: rgba(222, 238, 255, .16);
}

.segmented button,
.canvas-tabs button,
.config-tabs button {
  border-radius: 999px;
  font-weight: 800;
}

.segmented button.active,
.canvas-tabs button.active,
.config-tabs button.active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .08)),
    linear-gradient(135deg, rgba(96, 216, 255, .22), rgba(155, 140, 255, .18));
  box-shadow:
    inset 0 0 0 1px rgba(124, 235, 255, .2),
    0 0 26px rgba(96, 216, 255, .16),
    0 10px 26px rgba(0, 0, 0, .22);
}

.template-card {
  border-radius: 23px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .036)),
    rgba(12, 19, 36, .64);
}

.template-card.active {
  border-color: var(--taste-border-hot);
  background:
    linear-gradient(145deg, rgba(96, 216, 255, .16), rgba(155, 140, 255, .1) 45%, rgba(255, 79, 216, .07)),
    rgba(12, 19, 36, .72);
}

.template-thumb {
  border-radius: 19px;
}

.status-pill {
  border-radius: 999px;
  color: rgba(238, 248, 255, .88);
  border-color: rgba(124, 235, 255, .24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05)),
    rgba(4, 9, 20, .58);
}

input,
select,
textarea,
.toggle-item,
.shadow-card,
.empty-image,
.color-lab {
  border-color: rgba(222, 238, 255, .15);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .045)),
    rgba(10, 17, 33, .68);
}

input,
select,
textarea {
  color: #f8fbff;
}

input,
select {
  height: 43px;
  border-radius: 999px;
}

textarea,
.color-lab,
.toggle-item,
.shadow-card {
  border-radius: 22px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(124, 235, 255, .8);
  box-shadow:
    0 0 0 4px rgba(96, 216, 255, .12),
    0 0 30px rgba(255, 79, 216, .1),
    inset 0 1px 0 rgba(255, 255, 255, .18);
}

.live-card {
  box-shadow:
    0 34px 96px rgba(0, 0, 0, .36),
    0 0 38px rgba(96, 216, 255, .16),
    0 0 72px rgba(255, 79, 216, .1);
}

.live-card [data-inline-edit]:focus {
  box-shadow:
    0 0 0 2px rgba(124, 235, 255, .52),
    0 0 28px rgba(96, 216, 255, .18),
    0 0 42px rgba(255, 79, 216, .12);
}

.panel-scroll::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, rgba(124, 235, 255, .9), rgba(155, 140, 255, .76), rgba(255, 79, 216, .72));
}

::selection {
  color: #04111f;
  background: rgba(124, 235, 255, .82);
}

@media (max-width: 1180px) {
  .app-frame {
    grid-template-rows: 102px minmax(0, 1fr);
  }

  .topbar {
    height: 102px;
  }

  .editor-layout {
    grid-template-columns: minmax(220px, 252px) minmax(430px, 1fr) minmax(310px, 344px);
  }
}

@media (max-width: 900px) {
  .app-frame {
    grid-template-rows: auto;
    padding: 12px;
  }

  .topbar {
    height: auto;
    min-height: 104px;
    border-radius: 28px;
  }

  .brand h1::after {
    display: none;
  }

  .brand {
    min-width: 0;
  }

  .brand p {
    max-width: 240px;
  }

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

  .left-rail,
  .workspace,
  .right-panel {
    border-radius: 28px;
  }
}

@media (max-width: 700px) {
  .brand p {
    display: none;
  }

  .brand {
    align-items: center;
  }

  .topbar {
    align-items: center;
  }
}

@media (max-width: 560px) {
  .topbar {
    min-height: 0;
    gap: 14px;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 17px;
    font-size: 28px;
  }

  .brand h1 {
    font-size: 25px;
  }

  .top-actions .ghost-btn,
  .top-actions .primary-btn {
    font-size: 13px;
  }
}

/* Apple-style visual refresh */
:root {
  --app-bg: #f5f5f7;
  --panel: rgba(255, 255, 255, .72);
  --panel-2: rgba(255, 255, 255, .78);
  --panel-3: rgba(242, 242, 247, .9);
  --line: rgba(60, 60, 67, .14);
  --text: #1d1d1f;
  --muted: #515154;
  --subtle: #86868b;
  --accent: #007aff;
  --accent-2: #5856d6;
  --shadow: 0 22px 60px rgba(0, 0, 0, .12);
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(10, 132, 255, .18), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(191, 90, 242, .14), transparent 30%),
    linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 48%, #ececf1 100%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Microsoft YaHei", sans-serif;
}

.topbar {
  min-height: 68px;
  background: rgba(251, 251, 253, .72);
  border-bottom: 1px solid rgba(60, 60, 67, .12);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .72) inset;
  backdrop-filter: saturate(180%) blur(24px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #0a84ff, #5e5ce6 54%, #bf5af2);
  box-shadow: 0 10px 24px rgba(10, 132, 255, .22);
  font-weight: 800;
}

.brand h1 {
  font-size: 19px;
  font-weight: 760;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(180deg, #0a84ff, #0071e3);
  box-shadow: 0 8px 20px rgba(0, 122, 255, .22);
}

.ghost-btn,
.segmented,
.config-tabs,
.canvas-tabs {
  background: rgba(255, 255, 255, .64);
  border: 1px solid rgba(60, 60, 67, .13);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .78) inset;
  backdrop-filter: blur(18px) saturate(160%);
}

.ghost-btn {
  color: var(--text);
}

.left-rail,
.right-panel {
  background: rgba(246, 246, 248, .66);
  backdrop-filter: blur(24px) saturate(180%);
}

.workspace {
  background:
    radial-gradient(circle at 22% 4%, rgba(10, 132, 255, .16), transparent 28%),
    radial-gradient(circle at 78% 0%, rgba(255, 159, 10, .13), transparent 26%),
    #f5f5f7;
}

.canvas-stage {
  background-color: #f5f5f7;
  background-image:
    linear-gradient(rgba(60, 60, 67, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 60, 67, .055) 1px, transparent 1px);
}

.template-card,
.toggle-item,
input,
select,
textarea {
  color: var(--text);
  background: rgba(255, 255, 255, .8);
  border-color: rgba(60, 60, 67, .14);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .78) inset;
}

.template-card {
  border-radius: 16px;
}

.template-card.active {
  border-color: rgba(0, 122, 255, .62);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, .12), 0 12px 28px rgba(0, 0, 0, .06);
}

.template-thumb,
.live-card,
.live-card-inner,
.image-result img,
.empty-image {
  border-radius: 22px;
}

.live-card {
  box-shadow: 0 28px 70px rgba(0, 0, 0, .18);
}

.live-card-inner {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(18px) saturate(145%);
}

.bottom-editor {
  background: rgba(251, 251, 253, .76);
  backdrop-filter: blur(22px) saturate(180%);
}

.status-pill {
  color: #1d1d1f;
  background: rgba(255, 255, 255, .68);
  border-color: rgba(60, 60, 67, .12);
}

.swatch-grid {
  grid-template-columns: repeat(7, 1fr);
}

.swatch {
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .72) inset, 0 6px 16px rgba(0, 0, 0, .08);
}

.switch i {
  background: rgba(120, 120, 128, .28);
}

.switch input:checked + i {
  background: #34c759;
}

.color-lab {
  gap: 14px;
  padding: 14px;
  color: #1d1d1f;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(60, 60, 67, .12);
  border-radius: 22px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .07), 0 1px 0 rgba(255, 255, 255, .82) inset;
  backdrop-filter: blur(22px) saturate(180%);
}

.color-lab-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  min-height: 42px;
  border-bottom: 1px solid rgba(60, 60, 67, .14);
}

.color-lab-tabs button {
  position: relative;
  color: #6e6e73;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  font-weight: 760;
  outline: none;
}

.color-lab-tabs button.active {
  color: #1d1d1f;
}

.color-lab-tabs button.active::after {
  content: "";
  position: absolute;
  left: 24%;
  right: 24%;
  bottom: -1px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0a84ff, #64d2ff);
}

.upload-bg-btn {
  width: 100%;
  min-height: 42px;
  color: #1d1d1f;
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(60, 60, 67, .26);
  border-radius: 999px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .92) inset;
  cursor: pointer;
  font-size: 15px;
  font-weight: 760;
  outline: none;
}

.upload-bg-btn:hover {
  background: rgba(255, 255, 255, .78);
}

.color-panel {
  display: none;
}

.color-panel.active {
  display: block;
}

.swatch-groups {
  display: grid;
  gap: 18px;
}

.swatch-section {
  display: grid;
  gap: 12px;
}

.swatch-section header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.swatch-section h3 {
  margin: 0;
  color: #1d1d1f;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 780;
}

.swatch-section span {
  color: #8e8e93;
  font-size: 12px;
  font-weight: 700;
}

.orb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 14px 12px;
  align-items: center;
}

.orb-swatch {
  position: relative;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border: 0;
  border-radius: 50%;
  background: var(--swatch-bg);
  box-shadow:
    inset 0 10px 14px rgba(255, 255, 255, .34),
    inset 0 -14px 18px rgba(0, 0, 0, .23),
    0 12px 24px rgba(0, 0, 0, .12);
  cursor: pointer;
  outline: none;
  transition: transform .18s ease, box-shadow .18s ease;
}

.orb-swatch::before {
  content: "";
  position: absolute;
  inset: 4px 5px auto;
  height: 42%;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 25%, rgba(255, 255, 255, .62), rgba(255, 255, 255, .08) 62%, transparent 70%);
  pointer-events: none;
}

.orb-swatch::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid transparent;
  pointer-events: none;
}

.orb-swatch:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    inset 0 10px 14px rgba(255, 255, 255, .36),
    inset 0 -14px 18px rgba(0, 0, 0, .24),
    0 18px 34px rgba(0, 0, 0, .16);
}

.orb-swatch.active::after {
  border-color: #0a84ff;
  box-shadow: 0 0 0 4px rgba(10, 132, 255, .16);
}

.shadow-grid {
  display: grid;
  gap: 10px;
}

.shadow-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  color: #1d1d1f;
  text-align: left;
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(60, 60, 67, .13);
  border-radius: 16px;
  cursor: pointer;
  outline: none;
}

.color-lab-tabs button:focus-visible,
.upload-bg-btn:focus-visible,
.orb-swatch:focus-visible,
.shadow-card:focus-visible {
  box-shadow: 0 0 0 4px rgba(10, 132, 255, .16);
}

/* Apple glass workspace and richer local template previews */
body {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .96) 0%, rgba(245, 247, 251, .92) 34%, rgba(232, 240, 255, .9) 66%, rgba(250, 246, 255, .94) 100%),
    conic-gradient(from 210deg at 50% 18%, rgba(10, 132, 255, .2), rgba(191, 90, 242, .14), rgba(100, 210, 255, .16), rgba(255, 255, 255, .24), rgba(10, 132, 255, .2));
}

.app-frame {
  position: relative;
  isolation: isolate;
}

.app-frame::before {
  content: "";
  position: fixed;
  inset: 68px 0 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 20%, rgba(255, 255, 255, .46) 20% 21%, transparent 21% 100%),
    linear-gradient(72deg, transparent 0 62%, rgba(10, 132, 255, .08) 62% 63%, transparent 63% 100%),
    linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 42%);
  backdrop-filter: blur(1px);
}

.topbar,
.left-rail,
.right-panel,
.bottom-editor,
.canvas-toolbar {
  background: rgba(255, 255, 255, .58);
  border-color: rgba(255, 255, 255, .62);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 14px 38px rgba(31, 35, 46, .06);
  backdrop-filter: blur(28px) saturate(180%);
}

.workspace {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(246, 248, 252, .46)),
    linear-gradient(120deg, rgba(10, 132, 255, .08), rgba(191, 90, 242, .06) 52%, rgba(255, 214, 102, .08));
}

.canvas-stage {
  background-color: rgba(247, 248, 252, .58);
  background-image:
    linear-gradient(rgba(29, 29, 31, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 29, 31, .045) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 48%, rgba(10, 132, 255, .05));
  background-size: 24px 24px, 24px 24px, 100% 100%;
}

.live-card {
  border: 1px solid rgba(255, 255, 255, .58);
  transition: background .2s ease, box-shadow .2s ease, border-radius .2s ease;
}

.live-card-inner {
  border: 1px solid rgba(255, 255, 255, .56);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .66) inset;
}

.theme-tempB .live-card-inner,
.theme-code .live-card-inner,
.theme-tempJin .live-card-inner,
.theme-tempBlackSun .live-card-inner,
.theme-tempStory .live-card-inner,
.theme-tempMH .live-card-inner {
  background: rgba(8, 10, 18, .78);
  border-color: rgba(255, 255, 255, .16);
}

.theme-tempB .card-topline,
.theme-tempB .translation,
.theme-tempB footer,
.theme-tempB .qr-block span,
.theme-code .card-topline,
.theme-code .translation,
.theme-code footer,
.theme-code .qr-block span,
.theme-tempJin .card-topline,
.theme-tempJin .translation,
.theme-tempJin footer,
.theme-tempJin .qr-block span,
.theme-tempBlackSun .card-topline,
.theme-tempBlackSun .translation,
.theme-tempBlackSun footer,
.theme-tempBlackSun .qr-block span,
.theme-tempStory .card-topline,
.theme-tempStory .translation,
.theme-tempStory footer,
.theme-tempStory .qr-block span,
.theme-tempMH .card-topline,
.theme-tempMH .translation,
.theme-tempMH footer,
.theme-tempMH .qr-block span {
  color: rgba(255, 255, 255, .66);
}

.theme-tempEasy .live-card-inner {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(245, 251, 255, .76)),
    linear-gradient(135deg, rgba(10, 132, 255, .1), rgba(255, 255, 255, 0) 48%);
}

.theme-tempD .live-card-inner {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .88) 0 68%, rgba(229, 241, 226, .88) 68% 100%),
    linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, .62));
}

.theme-code .live-card-inner {
  font-family: "SF Mono", Consolas, "Courier New", monospace;
  background:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px) 0 0 / 100% 32px,
    linear-gradient(180deg, rgba(10, 14, 28, .9), rgba(3, 7, 18, .92));
}

.theme-code .content-preview {
  padding: 16px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
}

.theme-tempBlackSun .live-card-inner {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .08), transparent 38%),
    linear-gradient(180deg, rgba(9, 10, 15, .94), rgba(24, 25, 31, .9));
}

.theme-tempBlackSun .live-card-inner::before {
  content: "";
  position: absolute;
  inset: 20px 20px auto auto;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .22), rgba(255, 255, 255, .06) 58%, transparent 62%);
}

.theme-tempWrite .live-card-inner {
  background:
    repeating-linear-gradient(0deg, rgba(120, 90, 46, .08) 0 1px, transparent 1px 34px),
    linear-gradient(180deg, rgba(255, 250, 240, .94), rgba(244, 230, 203, .88));
}

.theme-tempE .live-card-inner {
  background:
    linear-gradient(90deg, rgba(29, 29, 31, .1) 0 3px, transparent 3px calc(100% - 3px), rgba(29, 29, 31, .1) calc(100% - 3px)),
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(245, 247, 251, .84));
}

.theme-tempF .live-card-inner {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(239, 246, 255, .82));
}

.theme-tempF h2 {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(60, 60, 67, .16);
}

.theme-tempStory .live-card-inner {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .78)),
    linear-gradient(135deg, rgba(248, 113, 113, .68), rgba(124, 58, 237, .72));
}

.theme-tempStory h2 {
  margin-top: 56px;
  font-size: calc(var(--font-scale, 1) * 30px);
}

.theme-tempMH .live-card-inner {
  border: 3px solid rgba(255, 255, 255, .92);
  outline: 3px solid rgba(24, 24, 27, .78);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .1), transparent 40%),
    linear-gradient(180deg, rgba(45, 20, 86, .94), rgba(8, 10, 24, .92));
}

.theme-tempMH .content-preview {
  padding: 14px;
  background: rgba(255, 255, 255, .1);
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 4px;
}

.live-card {
  border-radius: calc(var(--card-radius, 18) * 1px + 12px);
}

.live-card-inner {
  border-radius: calc(var(--card-radius, 18) * 1px);
}

.shadow-card.active {
  border-color: rgba(10, 132, 255, .5);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, .12);
}

.shadow-sample {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(145deg, #ffffff, #e9eef7);
  box-shadow: var(--shadow-demo);
}

.shadow-card strong {
  font-size: 14px;
  line-height: 1.2;
}

.shadow-card small {
  color: #8e8e93;
  font-size: 12px;
  font-weight: 700;
}

/* Reference-inspired site backdrop: dark grid, gradient glass plate, cyan frame */
body {
  background-color: #0c1118;
  background-image:
    linear-gradient(rgba(122, 232, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 232, 255, .045) 1px, transparent 1px),
    radial-gradient(circle at 18% 16%, rgba(88, 166, 255, .16), transparent 32%),
    radial-gradient(circle at 88% 14%, rgba(124, 58, 237, .18), transparent 34%),
    linear-gradient(180deg, #111923 0%, #0a0d12 100%);
  background-size: 72px 72px, 72px 72px, 100% 100%, 100% 100%, 100% 100%;
}

.app-frame {
  background: transparent;
}

.app-frame::before {
  content: "";
  position: fixed;
  top: clamp(78px, 8vh, 118px);
  left: clamp(24px, 5vw, 78px);
  right: clamp(24px, 5vw, 78px);
  height: min(54vw, 560px);
  z-index: -2;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 34px;
  background:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(115deg, rgba(92, 56, 24, .48) 0%, rgba(67, 107, 58, .42) 28%, rgba(30, 75, 105, .4) 48%, rgba(42, 29, 132, .56) 70%, rgba(74, 22, 151, .62) 100%);
  background-size: 38px 38px, 38px 38px, 100% 100%;
  box-shadow:
    0 34px 110px rgba(0, 0, 0, .34),
    inset 0 1px 0 rgba(255, 255, 255, .2),
    inset 0 0 80px rgba(255, 255, 255, .04);
}

.app-frame::after {
  content: "";
  position: fixed;
  top: clamp(118px, 13vh, 168px);
  left: clamp(118px, 18vw, 260px);
  width: min(70vw, 900px);
  height: min(34vw, 395px);
  z-index: -1;
  pointer-events: none;
  border: 3px solid rgba(122, 232, 255, .86);
  background:
    linear-gradient(#121925, #121925) 3.5% 12% / 17% 80% no-repeat,
    linear-gradient(90deg, rgba(125, 229, 242, .96), rgba(137, 221, 255, .96)) 28% 13% / 31% 3% no-repeat,
    linear-gradient(90deg, rgba(125, 229, 242, .84), rgba(137, 221, 255, .84)) 28% 27% / 19% 2.2% no-repeat,
    linear-gradient(135deg, rgba(30, 51, 83, .92), rgba(76, 54, 99, .88)) 28% 48% / 28% 40% no-repeat,
    linear-gradient(135deg, rgba(236, 248, 255, .95), rgba(255, 248, 255, .94) 50%, rgba(246, 255, 224, .96)) 66% 46% / 28% 48% no-repeat,
    rgba(13, 20, 39, .5);
  box-shadow:
    0 0 0 1px rgba(122, 232, 255, .12),
    0 24px 90px rgba(2, 8, 23, .26),
    inset 0 0 50px rgba(122, 232, 255, .05);
}

.workspace {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .42), rgba(255, 255, 255, .22)),
    rgba(10, 15, 24, .3);
}

.canvas-stage {
  background-color: rgba(10, 15, 24, .22);
  background-image:
    linear-gradient(rgba(123, 207, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 207, 255, .07) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 48%, rgba(122, 232, 255, .08));
  background-size: 28px 28px, 28px 28px, 100% 100%;
}

.topbar,
.left-rail,
.right-panel,
.bottom-editor,
.canvas-toolbar {
  background: rgba(248, 251, 255, .68);
  border-color: rgba(255, 255, 255, .42);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .72) inset, 0 18px 50px rgba(3, 7, 18, .1);
}

@media (max-width: 900px) {
  .app-frame::before {
    top: 96px;
    left: 16px;
    right: 16px;
    height: 420px;
  }

  .app-frame::after {
    top: 144px;
    left: 42px;
    right: 42px;
    width: auto;
    height: 280px;
  }
}

/* Cosmic Apple redesign: unified galaxy glass system */
:root {
  --app-bg: #070a12;
  --panel: rgba(14, 20, 34, .64);
  --panel-2: rgba(20, 28, 46, .62);
  --panel-3: rgba(32, 43, 68, .66);
  --line: rgba(205, 226, 255, .16);
  --text: #f6f9ff;
  --muted: #c2cee3;
  --subtle: #8f9bb3;
  --accent: #8bdfff;
  --accent-2: #d8b4fe;
  --shadow: 0 28px 82px rgba(0, 0, 0, .34);
}

body {
  color: var(--text);
  background-color: #070a12;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .78) 0 1px, transparent 1.6px),
    radial-gradient(circle at 72% 9%, rgba(157, 232, 255, .72) 0 1px, transparent 1.8px),
    radial-gradient(circle at 38% 76%, rgba(255, 216, 155, .6) 0 1px, transparent 1.6px),
    radial-gradient(circle at 84% 64%, rgba(223, 187, 255, .58) 0 1px, transparent 1.7px),
    linear-gradient(rgba(141, 189, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(141, 189, 255, .045) 1px, transparent 1px),
    conic-gradient(from 225deg at 54% 45%, rgba(255, 204, 112, .2), rgba(89, 209, 255, .16), rgba(185, 128, 255, .22), rgba(30, 42, 90, .1), rgba(255, 204, 112, .2)),
    linear-gradient(135deg, #070a12 0%, #11172a 38%, #101a2a 62%, #070a12 100%);
  background-size:
    320px 320px,
    420px 420px,
    360px 360px,
    500px 500px,
    46px 46px,
    46px 46px,
    100% 100%,
    100% 100%;
}

.app-frame {
  background: transparent;
}

.app-frame::before {
  content: "";
  position: fixed;
  inset: 68px 0 0;
  z-index: -2;
  pointer-events: none;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(118deg, transparent 0 12%, rgba(143, 214, 255, .11) 20%, rgba(246, 196, 255, .14) 44%, rgba(255, 214, 140, .1) 62%, transparent 78%),
    linear-gradient(22deg, transparent 0 28%, rgba(255, 255, 255, .08) 44%, transparent 58%),
    radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, .1), transparent 52%);
  box-shadow: none;
  filter: saturate(130%);
}

.app-frame::after {
  content: "";
  position: fixed;
  inset: 88px clamp(18px, 3vw, 46px) 26px;
  z-index: -1;
  pointer-events: none;
  width: auto;
  height: auto;
  border: 1px solid rgba(210, 231, 255, .14);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02) 42%, rgba(140, 222, 255, .05)),
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 100% 100%, 34px 34px, 34px 34px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 0 90px rgba(117, 181, 255, .06),
    0 30px 120px rgba(0, 0, 0, .28);
  backdrop-filter: blur(10px) saturate(142%);
}

.topbar,
.left-rail,
.right-panel,
.bottom-editor,
.canvas-toolbar {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .045)),
    rgba(10, 15, 27, .66);
  border-color: rgba(218, 236, 255, .14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .15),
    0 24px 70px rgba(0, 0, 0, .24);
  backdrop-filter: blur(30px) saturate(168%);
}

.topbar {
  border-bottom-color: rgba(218, 236, 255, .18);
}

.brand h1,
.rail-head,
.control b,
.template-meta strong,
.toggle-item span,
.swatch-section h3,
.shadow-card strong {
  color: #f8fbff;
}

.brand p,
.rail-head span,
.hint,
.template-meta span,
.control,
.swatch-section span,
.shadow-card small {
  color: var(--subtle);
}

.brand-mark {
  background: linear-gradient(145deg, #65d8ff, #8b5cf6 52%, #ffd166);
  box-shadow: 0 12px 30px rgba(101, 216, 255, .24), 0 0 0 1px rgba(255, 255, 255, .18) inset;
}

.workspace {
  background:
    linear-gradient(180deg, rgba(10, 15, 27, .34), rgba(10, 15, 27, .22)),
    rgba(7, 10, 18, .18);
  border-color: rgba(218, 236, 255, .14);
}

.canvas-stage {
  background-color: rgba(8, 12, 22, .28);
  background-image:
    linear-gradient(rgba(178, 215, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(178, 215, 255, .06) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 46%, rgba(139, 223, 255, .08));
  background-size: 28px 28px, 28px 28px, 100% 100%;
}

.segmented,
.config-tabs,
.canvas-tabs,
.ghost-btn,
.template-card,
.toggle-item,
.empty-image,
.color-lab,
.shadow-card,
input,
select,
textarea {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .045)),
    rgba(15, 21, 36, .66);
  border-color: rgba(218, 236, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13);
  backdrop-filter: blur(20px) saturate(150%);
}

input::placeholder,
textarea::placeholder {
  color: rgba(194, 206, 227, .62);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(139, 223, 255, .72);
  box-shadow: 0 0 0 4px rgba(139, 223, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .16);
}

.primary-btn {
  color: #06111c;
  background: linear-gradient(135deg, #8bdfff, #d8b4fe 54%, #ffd166);
  box-shadow: 0 14px 34px rgba(139, 223, 255, .22), inset 0 1px 0 rgba(255, 255, 255, .55);
}

.ghost-btn {
  color: #edf6ff;
}

.segmented button,
.canvas-tabs button,
.config-tabs button {
  color: rgba(216, 226, 244, .72);
}

.segmented button.active,
.canvas-tabs button.active,
.config-tabs button.active {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(139, 223, 255, .18), rgba(216, 180, 254, .1)),
    rgba(255, 255, 255, .08);
  box-shadow: inset 0 0 0 1px rgba(139, 223, 255, .18), 0 10px 24px rgba(0, 0, 0, .18);
}

.template-card {
  border-radius: 18px;
}

.template-card.active {
  border-color: rgba(139, 223, 255, .7);
  box-shadow: 0 0 0 4px rgba(139, 223, 255, .14), 0 18px 44px rgba(0, 0, 0, .24);
}

.template-thumb {
  background: rgba(5, 8, 15, .7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.status-pill {
  color: #eaf7ff;
  background: rgba(10, 15, 27, .58);
  border-color: rgba(218, 236, 255, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.bottom-editor textarea,
.bottom-editor input {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .045)),
    rgba(13, 19, 32, .76);
  color: #f7fbff;
  border-color: rgba(218, 236, 255, .15);
}

.bottom-editor textarea::placeholder,
.bottom-editor input::placeholder {
  color: rgba(194, 206, 227, .62);
}

.color-lab {
  color: var(--text);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .105), rgba(255, 255, 255, .045)),
    rgba(9, 14, 28, .72);
  border-color: rgba(218, 236, 255, .15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 20px 54px rgba(0, 0, 0, .22);
}

.color-lab-tabs {
  border-bottom-color: rgba(218, 236, 255, .14);
}

.color-lab-tabs button {
  color: rgba(216, 226, 244, .72);
}

.color-lab-tabs button.active {
  color: #f8fbff;
}

.color-lab-tabs button.active::after {
  background: linear-gradient(90deg, #8bdfff, #d8b4fe, #ffd166);
}

.upload-bg-btn {
  color: #f8fbff;
  background: rgba(255, 255, 255, .065);
  border-color: rgba(218, 236, 255, .2);
}

.upload-bg-btn:hover {
  background: rgba(139, 223, 255, .12);
}

.orb-swatch {
  box-shadow:
    inset 0 10px 14px rgba(255, 255, 255, .33),
    inset 0 -15px 20px rgba(0, 0, 0, .28),
    0 12px 26px rgba(0, 0, 0, .26);
}

.orb-swatch.active::after {
  border-color: rgba(139, 223, 255, .96);
  box-shadow: 0 0 0 4px rgba(139, 223, 255, .16), 0 0 22px rgba(216, 180, 254, .22);
}

.shadow-card.active {
  border-color: rgba(139, 223, 255, .66);
  box-shadow: 0 0 0 4px rgba(139, 223, 255, .13);
}

.switch i {
  background: rgba(194, 206, 227, .22);
}

.switch input:checked + i {
  background: linear-gradient(135deg, #8bdfff, #b8f7d4);
}

input[type="range"] {
  accent-color: #8bdfff;
}

input[type="color"] {
  background: rgba(255, 255, 255, .82);
}

@media (max-width: 900px) {
  .app-frame::after {
    inset: 90px 12px 16px;
    height: auto;
  }
}

/* Dopamine neon skin: animated aurora, twinkles, and glowing glass */
body {
  background-color: #050713;
  background-image:
    radial-gradient(circle at 9% 14%, rgba(255, 255, 255, .95) 0 1px, transparent 1.7px),
    radial-gradient(circle at 31% 72%, rgba(255, 244, 161, .88) 0 1.1px, transparent 1.9px),
    radial-gradient(circle at 78% 18%, rgba(135, 245, 255, .88) 0 1.2px, transparent 2px),
    radial-gradient(circle at 88% 68%, rgba(255, 107, 214, .76) 0 1.1px, transparent 1.9px),
    linear-gradient(rgba(103, 232, 249, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 114, 182, .045) 1px, transparent 1px),
    radial-gradient(circle at 18% 28%, rgba(255, 47, 146, .42), transparent 28%),
    radial-gradient(circle at 84% 22%, rgba(0, 224, 255, .36), transparent 28%),
    radial-gradient(circle at 56% 86%, rgba(255, 214, 10, .26), transparent 34%),
    conic-gradient(from 140deg at 52% 46%, #ff2d92, #8b5cf6, #00e0ff, #34f5a5, #ffd60a, #ff2d92),
    linear-gradient(135deg, #050713 0%, #111337 48%, #080a18 100%);
  background-size:
    240px 240px,
    360px 360px,
    420px 420px,
    520px 520px,
    42px 42px,
    42px 42px,
    100% 100%,
    100% 100%,
    100% 100%,
    180% 180%,
    100% 100%;
  animation: neonGalaxyDrift 18s ease-in-out infinite alternate, neonTwinkle 2.8s steps(2, end) infinite;
}

.app-frame::before {
  background:
    radial-gradient(ellipse at 16% 22%, rgba(255, 45, 146, .38), transparent 36%),
    radial-gradient(ellipse at 82% 20%, rgba(0, 224, 255, .34), transparent 36%),
    radial-gradient(ellipse at 58% 76%, rgba(255, 214, 10, .24), transparent 38%),
    linear-gradient(115deg, transparent 0 12%, rgba(255, 45, 146, .16) 24%, rgba(139, 92, 246, .16) 43%, rgba(0, 224, 255, .16) 60%, rgba(52, 245, 165, .12) 74%, transparent 86%);
  filter: saturate(170%);
  animation: neonMist 9s ease-in-out infinite alternate;
}

.app-frame::after {
  border-color: rgba(103, 232, 249, .26);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .02) 42%, rgba(0, 224, 255, .08)),
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .18),
    inset 0 0 120px rgba(0, 224, 255, .08),
    0 0 48px rgba(0, 224, 255, .16),
    0 0 92px rgba(255, 45, 146, .12),
    0 30px 120px rgba(0, 0, 0, .34);
  animation: neonFramePulse 3.8s ease-in-out infinite;
}

.topbar,
.left-rail,
.right-panel,
.bottom-editor,
.canvas-toolbar,
.segmented,
.config-tabs,
.canvas-tabs,
.ghost-btn,
.template-card,
.toggle-item,
.empty-image,
.color-lab,
.shadow-card,
input,
select,
textarea {
  border-color: rgba(103, 232, 249, .18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    0 0 0 1px rgba(255, 45, 146, .035),
    0 22px 70px rgba(0, 0, 0, .28);
}

.brand-mark,
.primary-btn {
  background: linear-gradient(135deg, #00e0ff, #8b5cf6 38%, #ff2d92 68%, #ffd60a);
  background-size: 220% 220%;
  animation: neonButtonShift 4.2s ease-in-out infinite alternate;
}

.primary-btn {
  color: #071018;
  box-shadow:
    0 0 22px rgba(0, 224, 255, .28),
    0 0 34px rgba(255, 45, 146, .22),
    inset 0 1px 0 rgba(255, 255, 255, .62);
}

.template-card.active,
.segmented button.active,
.canvas-tabs button.active,
.config-tabs button.active,
.shadow-card.active,
.orb-swatch.active::after {
  border-color: rgba(0, 224, 255, .9);
  box-shadow:
    0 0 0 3px rgba(0, 224, 255, .14),
    0 0 24px rgba(0, 224, 255, .22),
    0 0 38px rgba(255, 45, 146, .16);
}

.color-lab-tabs button.active::after {
  background: linear-gradient(90deg, #00e0ff, #8b5cf6, #ff2d92, #ffd60a);
  background-size: 220% 100%;
  box-shadow: 0 0 14px rgba(0, 224, 255, .4), 0 0 20px rgba(255, 45, 146, .28);
  animation: neonUnderline 2.2s ease-in-out infinite alternate;
}

.orb-swatch {
  box-shadow:
    inset 0 10px 14px rgba(255, 255, 255, .38),
    inset 0 -15px 20px rgba(0, 0, 0, .32),
    0 0 18px rgba(0, 224, 255, .1),
    0 14px 28px rgba(0, 0, 0, .32);
}

.orb-swatch:hover {
  box-shadow:
    inset 0 10px 14px rgba(255, 255, 255, .4),
    inset 0 -15px 20px rgba(0, 0, 0, .34),
    0 0 22px rgba(0, 224, 255, .22),
    0 0 32px rgba(255, 45, 146, .14),
    0 18px 34px rgba(0, 0, 0, .34);
}

.canvas-stage {
  background-image:
    linear-gradient(rgba(103, 232, 249, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 114, 182, .06) 1px, transparent 1px),
    radial-gradient(circle at 22% 18%, rgba(255, 45, 146, .16), transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(0, 224, 255, .14), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 46%, rgba(255, 214, 10, .07));
  background-size: 28px 28px, 28px 28px, 100% 100%, 100% 100%, 100% 100%;
}

@keyframes neonGalaxyDrift {
  0% {
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0% 50%, 100% 40%, 50% 100%, 0% 50%, 0 0;
    filter: saturate(135%) brightness(.94);
  }
  100% {
    background-position: 20px -18px, -28px 16px, 18px 24px, -16px -22px, 16px 16px, -14px 10px, 12% 46%, 88% 46%, 48% 86%, 100% 50%, 0 0;
    filter: saturate(180%) brightness(1.08);
  }
}

@keyframes neonTwinkle {
  0%, 100% { opacity: .96; }
  50% { opacity: 1; }
}

@keyframes neonMist {
  0% { opacity: .72; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.04); }
}

@keyframes neonFramePulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .18),
      inset 0 0 120px rgba(0, 224, 255, .08),
      0 0 42px rgba(0, 224, 255, .14),
      0 0 84px rgba(255, 45, 146, .1),
      0 30px 120px rgba(0, 0, 0, .34);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .22),
      inset 0 0 140px rgba(255, 214, 10, .1),
      0 0 56px rgba(0, 224, 255, .24),
      0 0 104px rgba(255, 45, 146, .2),
      0 30px 120px rgba(0, 0, 0, .34);
  }
}

@keyframes neonButtonShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

@keyframes neonUnderline {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .app-frame::before,
  .app-frame::after,
  .brand-mark,
  .primary-btn,
  .color-lab-tabs button.active::after {
    animation: none !important;
  }
}

/* NOVA Card brand expansion: international AI product feel */
.topbar {
  min-height: 82px;
  padding: 0 22px;
  background:
    linear-gradient(180deg, rgba(10, 14, 27, .94), rgba(9, 13, 24, .78)),
    rgba(6, 9, 17, .82);
  border-bottom-color: rgba(154, 220, 255, .18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    0 18px 58px rgba(0, 0, 0, .34),
    0 0 60px rgba(0, 224, 255, .06);
}

.brand {
  gap: 18px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: #071018;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .66), transparent 28%),
    linear-gradient(135deg, #a7f3ff 0%, #a78bfa 48%, #f472b6 100%);
  box-shadow:
    0 18px 42px rgba(0, 224, 255, .22),
    0 0 34px rgba(244, 114, 182, .18),
    inset 0 1px 0 rgba(255, 255, 255, .48);
  font-family: "SF Pro Display", Inter, Arial, sans-serif;
  font-size: 31px;
  font-weight: 860;
  line-height: 1;
}

.brand h1 {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: #f8fbff;
  font-family: "SF Pro Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 30px;
  line-height: 1.05;
  font-weight: 840;
  letter-spacing: 0;
  text-shadow: 0 0 26px rgba(157, 232, 255, .2);
}

.brand h1::after {
  content: "AI Studio";
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  color: #071018;
  background: linear-gradient(135deg, #9de8ff, #d8b4fe 52%, #ffd166);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(0, 224, 255, .22);
  font-size: 11px;
  font-weight: 820;
}

.brand p {
  margin-top: 7px;
  color: rgba(218, 230, 255, .68);
  font-size: 12px;
  font-weight: 650;
}

.top-actions {
  gap: 10px;
}

.top-actions .ghost-btn,
.top-actions .primary-btn {
  min-height: 42px;
  border-radius: 13px;
  font-weight: 780;
}

.top-actions .ghost-btn {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .05)),
    rgba(18, 24, 39, .78);
  border: 1px solid rgba(218, 236, 255, .16);
}

.top-actions .primary-btn {
  padding: 0 20px;
}

.editor-layout {
  grid-template-columns: 276px minmax(420px, 1fr) 370px;
}

.rail-head strong,
.config-tabs button,
.canvas-tabs button,
.segmented button {
  font-family: "SF Pro Text", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.workspace {
  box-shadow: inset 1px 0 rgba(255, 255, 255, .05), inset -1px 0 rgba(255, 255, 255, .05);
}

.template-card,
.color-lab,
.bottom-editor input,
.bottom-editor textarea,
.right-panel select,
.right-panel input,
.right-panel textarea {
  border-radius: 16px;
}

.template-meta strong {
  font-weight: 780;
}

.template-meta span {
  font-weight: 600;
}

.live-card {
  box-shadow:
    0 30px 90px rgba(0, 0, 0, .32),
    0 0 42px rgba(0, 224, 255, .16),
    0 0 62px rgba(244, 114, 182, .11);
}

@media (max-width: 900px) {
  .topbar {
    min-height: 96px;
  }

  .brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    font-size: 28px;
  }

  .brand h1 {
    font-size: 24px;
  }

  .brand h1::after {
    display: none;
  }

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

/* Header spacing fix: keep NOVA brand from colliding with editor modules */
.app-frame {
  grid-template-rows: 128px minmax(0, 1fr);
}

.topbar {
  min-height: 128px;
  align-items: center;
  padding: 22px 28px;
}

.brand {
  align-items: center;
}

.brand-mark {
  flex: 0 0 auto;
}

.brand p {
  max-width: 520px;
  line-height: 1.35;
}

.editor-layout {
  border-top: 1px solid rgba(154, 220, 255, .16);
}

.left-rail {
  padding-top: 22px;
}

.canvas-toolbar {
  min-height: 66px;
  padding: 12px 18px;
}

.right-panel {
  padding-top: 8px;
}

.config-tabs {
  top: 8px;
  margin-top: 6px;
  margin-bottom: 18px;
}

.rail-head {
  margin-bottom: 18px;
}

.segmented {
  margin-bottom: 18px;
}

@media (max-width: 1180px) {
  .app-frame {
    grid-template-rows: 118px minmax(0, 1fr);
  }

  .topbar {
    min-height: 118px;
  }

  .brand h1 {
    font-size: 26px;
  }
}

@media (max-width: 900px) {
  .app-frame {
    grid-template-rows: auto;
  }

  .topbar {
    min-height: 132px;
    align-items: flex-start;
    gap: 16px;
  }
}

/* Scrollbar cleanup: keep editor canvas still and use subtle glass scrollbars only where necessary */
.canvas-stage {
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 22px;
}

.live-card-shell,
.image-result {
  width: 100%;
  min-height: 0;
  height: 100%;
  place-items: center;
}

.live-card {
  max-width: min(var(--card-width, 440px), 92%);
  max-height: 96%;
  transform: scale(var(--preview-scale, 1));
  transform-origin: center center;
}

.left-rail,
.right-panel {
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 223, 255, .35) rgba(10, 15, 27, .26);
}

.left-rail::-webkit-scrollbar,
.right-panel::-webkit-scrollbar {
  width: 8px;
}

.left-rail::-webkit-scrollbar-track,
.right-panel::-webkit-scrollbar-track {
  background: rgba(10, 15, 27, .24);
}

.left-rail::-webkit-scrollbar-thumb,
.right-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 224, 255, .42), rgba(255, 45, 146, .34));
  border: 2px solid rgba(10, 15, 27, .24);
  border-radius: 999px;
}

.left-rail::-webkit-scrollbar-thumb:hover,
.right-panel::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(0, 224, 255, .62), rgba(255, 45, 146, .52));
}

.left-rail,
.right-panel {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

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

@media (max-width: 900px) {
  .canvas-stage {
    overflow: auto;
  }
}

/* Editor density fix: give preview more room and make the lower editor compact */
.workspace {
  grid-template-rows: 64px minmax(420px, 1fr) 174px;
}

.bottom-editor {
  position: relative;
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  padding: 12px 18px 14px;
  border-top: 1px solid rgba(139, 223, 255, .22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    0 -18px 44px rgba(5, 8, 18, .28);
}

.bottom-editor::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 224, 255, .55), rgba(255, 45, 146, .38), transparent);
  pointer-events: none;
}

.field-line {
  height: 42px;
  margin-bottom: 0;
  gap: 12px;
}

.field-line input {
  height: 42px;
}

#contentInput {
  min-height: 0;
  height: 100%;
  resize: none;
  padding: 12px 14px;
  line-height: 1.55;
}

.canvas-stage {
  padding: 28px 26px 30px;
}

@media (max-height: 820px) and (min-width: 901px) {
  .workspace {
    grid-template-rows: 60px minmax(360px, 1fr) 154px;
  }

  .bottom-editor {
    grid-template-rows: 38px minmax(0, 1fr);
    padding: 10px 16px 12px;
  }

  .field-line,
  .field-line input {
    height: 38px;
  }

  #contentInput {
    padding: 10px 12px;
    line-height: 1.45;
  }
}

/* Direct-on-card editing: remove separate copy editor and edit text in the card */
.workspace {
  grid-template-rows: 64px minmax(0, 1fr);
}

.bottom-editor {
  display: none !important;
}

.canvas-stage {
  padding: 34px 30px;
}

.live-card [data-inline-edit] {
  cursor: text;
  border-radius: 10px;
  outline: none;
  transition: background .16s ease, box-shadow .16s ease, color .16s ease;
}

.live-card [data-inline-edit]:hover {
  background: rgba(139, 223, 255, .08);
  box-shadow: 0 0 0 1px rgba(139, 223, 255, .12);
}

.live-card [data-inline-edit]:focus {
  background: rgba(255, 255, 255, .16);
  box-shadow:
    0 0 0 2px rgba(0, 224, 255, .48),
    0 0 24px rgba(0, 224, 255, .16),
    0 0 36px rgba(255, 45, 146, .1);
}

.live-card [data-inline-edit]:empty::before {
  content: attr(data-placeholder);
  color: currentColor;
  opacity: .35;
}

.content-preview[data-inline-edit] {
  min-height: 120px;
  padding: 8px 10px;
  margin: -8px -10px 0;
}

.live-card h2[data-inline-edit] {
  padding: 4px 8px;
  margin-left: -8px;
  margin-right: -8px;
}

.card-topline [data-inline-edit],
.live-card footer [data-inline-edit],
.translation[data-inline-edit] {
  padding: 3px 6px;
  margin-left: -6px;
}

@media (max-width: 900px) {
  .workspace {
    grid-template-rows: auto minmax(620px, 1fr);
  }
}

html,
body,
.app-frame {
  overflow-x: hidden;
}

/* Right panel scroll redesign: fixed tabs, scrolling content, no overlay */
.right-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.right-panel .config-tabs {
  position: relative;
  top: auto;
  z-index: 4;
  margin: 14px 14px 10px;
  flex-shrink: 0;
}

.panel-scroll {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 224, 255, .5) rgba(9, 14, 28, .42);
}

.panel-scroll::-webkit-scrollbar {
  width: 9px;
}

.panel-scroll::-webkit-scrollbar-track {
  background: rgba(9, 14, 28, .42);
  border-left: 1px solid rgba(139, 223, 255, .08);
}

.panel-scroll::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, rgba(0, 224, 255, .76), rgba(139, 92, 246, .68), rgba(255, 45, 146, .6));
  border: 2px solid rgba(9, 14, 28, .42);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(0, 224, 255, .18);
}

.panel-scroll::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, rgba(103, 232, 249, .95), rgba(167, 139, 250, .86), rgba(255, 45, 146, .78));
}

.right-panel {
  -ms-overflow-style: auto;
  scrollbar-width: auto;
}

.right-panel::-webkit-scrollbar {
  display: none;
}

.panel-body {
  padding-top: 4px;
}

/* Atelier palette refinement: soft premium pastel color orbs */
.swatch-groups {
  gap: 28px;
}

.swatch-section {
  gap: 16px;
}

.swatch-section header {
  align-items: end;
  padding: 0 2px;
}

.swatch-section h3 {
  font-size: 22px;
  font-weight: 740;
  letter-spacing: 0;
}

.swatch-section span {
  color: rgba(218, 230, 255, .58);
  font-size: 14px;
  font-weight: 680;
}

.orb-grid {
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 20px 16px;
  padding: 2px 0 4px;
}

.orb-swatch {
  width: 48px;
  height: 48px;
  background: var(--swatch-bg);
  box-shadow:
    inset 0 13px 14px rgba(255, 255, 255, .42),
    inset 0 -10px 18px rgba(40, 45, 65, .16),
    inset 0 0 0 1px rgba(255, 255, 255, .1),
    0 10px 18px rgba(0, 0, 0, .18);
}

.orb-swatch::before {
  inset: 5px 7px auto;
  height: 39%;
  background:
    radial-gradient(ellipse at 34% 18%, rgba(255, 255, 255, .74), rgba(255, 255, 255, .22) 42%, rgba(255, 255, 255, 0) 72%);
  filter: blur(.2px);
}

.orb-swatch::after {
  inset: -6px;
  border: 2px solid transparent;
  box-shadow: none;
}

.orb-swatch:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow:
    inset 0 13px 14px rgba(255, 255, 255, .45),
    inset 0 -10px 18px rgba(40, 45, 65, .17),
    inset 0 0 0 1px rgba(255, 255, 255, .12),
    0 14px 24px rgba(0, 0, 0, .22);
}

.orb-swatch.active::after {
  border-color: rgba(125, 235, 197, .92);
  box-shadow:
    0 0 0 4px rgba(125, 235, 197, .12),
    0 0 0 1px rgba(255, 255, 255, .2) inset;
}

.orb-swatch.active {
  box-shadow:
    inset 0 13px 14px rgba(255, 255, 255, .44),
    inset 0 -10px 18px rgba(40, 45, 65, .16),
    inset 0 0 0 1px rgba(255, 255, 255, .12),
    0 12px 22px rgba(0, 0, 0, .2);
}

.color-lab {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .035)),
    rgba(9, 11, 18, .82);
}

/* Image result fit mode: show generated image as a full-page preview */
body.image-mode .canvas-stage {
  overflow: hidden;
  padding: 26px;
}

body.image-mode .image-result {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  place-items: center;
}

body.image-mode .image-result img {
  width: auto;
  height: auto;
  max-width: min(100%, calc(100vw - 560px));
  max-height: calc(100vh - 230px);
  object-fit: contain;
  border-radius: 22px;
  box-shadow:
    0 26px 80px rgba(0, 0, 0, .34),
    0 0 34px rgba(0, 224, 255, .16),
    0 0 54px rgba(255, 45, 146, .1);
}

body.image-mode .empty-image {
  max-width: min(520px, 92%);
}

@media (max-width: 1180px) {
  body.image-mode .image-result img {
    max-width: min(100%, calc(100vw - 500px));
  }
}

@media (max-width: 900px) {
  body.image-mode .canvas-stage {
    min-height: 620px;
  }

  body.image-mode .image-result img {
    max-width: 94vw;
    max-height: 72vh;
  }
}

/* Final swatch polish override */
.color-lab .orb-grid {
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 20px 16px;
}

.color-lab .orb-swatch {
  width: 48px;
  height: 48px;
  box-shadow:
    inset 0 13px 14px rgba(255, 255, 255, .42),
    inset 0 -10px 18px rgba(40, 45, 65, .16),
    inset 0 0 0 1px rgba(255, 255, 255, .1),
    0 10px 18px rgba(0, 0, 0, .18);
}

.color-lab .orb-swatch::before {
  inset: 5px 7px auto;
  height: 39%;
  background:
    radial-gradient(ellipse at 34% 18%, rgba(255, 255, 255, .74), rgba(255, 255, 255, .22) 42%, rgba(255, 255, 255, 0) 72%);
}

.color-lab .orb-swatch:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow:
    inset 0 13px 14px rgba(255, 255, 255, .45),
    inset 0 -10px 18px rgba(40, 45, 65, .17),
    inset 0 0 0 1px rgba(255, 255, 255, .12),
    0 14px 24px rgba(0, 0, 0, .22);
}

.color-lab .orb-swatch.active::after {
  border-color: rgba(125, 235, 197, .92);
  box-shadow:
    0 0 0 4px rgba(125, 235, 197, .12),
    0 0 0 1px rgba(255, 255, 255, .2) inset;
}

/* Impeccable polish: homepage product-grade galaxy glass finish */
:root {
  --nova-bg: #050714;
  --nova-ink: #f8fbff;
  --nova-muted: rgba(218, 230, 255, .7);
  --nova-soft: rgba(161, 179, 210, .58);
  --nova-line: rgba(190, 220, 255, .18);
  --nova-line-strong: rgba(128, 228, 255, .36);
  --nova-glass: rgba(10, 16, 30, .66);
  --nova-glass-2: rgba(16, 24, 42, .72);
  --nova-cyan: #7fe8ff;
  --nova-pink: #ff5bd6;
  --nova-violet: #a78bfa;
  --nova-gold: #ffd166;
  --shadow: 0 32px 92px rgba(0, 0, 0, .38);
}

html {
  background: var(--nova-bg);
}

body {
  color: var(--nova-ink);
  background-color: var(--nova-bg);
  background-image:
    radial-gradient(circle at 9% 12%, rgba(255, 255, 255, .9) 0 1px, transparent 1.7px),
    radial-gradient(circle at 27% 82%, rgba(255, 209, 102, .72) 0 1px, transparent 1.8px),
    radial-gradient(circle at 74% 16%, rgba(127, 232, 255, .84) 0 1.1px, transparent 1.9px),
    radial-gradient(circle at 88% 68%, rgba(255, 91, 214, .68) 0 1px, transparent 1.8px),
    linear-gradient(rgba(127, 232, 255, .052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 91, 214, .04) 1px, transparent 1px),
    radial-gradient(ellipse at 16% 22%, rgba(255, 91, 214, .34), transparent 33%),
    radial-gradient(ellipse at 82% 18%, rgba(0, 224, 255, .3), transparent 32%),
    radial-gradient(ellipse at 58% 88%, rgba(255, 209, 102, .2), transparent 38%),
    conic-gradient(from 130deg at 52% 44%, rgba(255, 91, 214, .72), rgba(167, 139, 250, .72), rgba(0, 224, 255, .68), rgba(89, 255, 180, .52), rgba(255, 209, 102, .54), rgba(255, 91, 214, .72)),
    linear-gradient(135deg, #050714 0%, #111539 46%, #071827 72%, #050714 100%);
  background-size:
    260px 260px,
    380px 380px,
    460px 460px,
    540px 540px,
    44px 44px,
    44px 44px,
    100% 100%,
    100% 100%,
    100% 100%,
    180% 180%,
    100% 100%;
  animation: neonGalaxyDrift 22s ease-in-out infinite alternate;
}

.app-frame {
  grid-template-rows: 112px minmax(0, 1fr);
  padding: 14px 18px 18px;
  gap: 14px;
}

.app-frame::before {
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(112deg, transparent 0 14%, rgba(127, 232, 255, .13) 27%, rgba(255, 91, 214, .11) 45%, rgba(255, 209, 102, .1) 63%, transparent 82%),
    radial-gradient(ellipse at 48% 5%, rgba(255, 255, 255, .12), transparent 42%),
    radial-gradient(ellipse at 50% 80%, rgba(69, 215, 255, .1), transparent 54%);
  filter: saturate(160%);
  opacity: .92;
}

.app-frame::after {
  inset: 120px 22px 22px;
  z-index: -2;
  border: 1px solid rgba(206, 231, 255, .14);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .018) 44%, rgba(127, 232, 255, .06)),
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 100% 100%, 34px 34px, 34px 34px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 0 120px rgba(127, 232, 255, .06),
    0 0 60px rgba(0, 224, 255, .1),
    0 34px 110px rgba(0, 0, 0, .34);
  backdrop-filter: blur(12px) saturate(145%);
}

.topbar {
  min-height: 0;
  height: 112px;
  padding: 22px 26px;
  border: 1px solid var(--nova-line);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .045) 42%, rgba(127, 232, 255, .065)),
    rgba(7, 12, 24, .76);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .18),
    inset 0 -1px 0 rgba(255, 255, 255, .04),
    0 24px 80px rgba(0, 0, 0, .32),
    0 0 58px rgba(0, 224, 255, .08);
  backdrop-filter: blur(34px) saturate(170%);
}

.brand {
  gap: 18px;
}

.brand-mark {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .72), transparent 30%),
    linear-gradient(135deg, #9de8ff 0%, #a78bfa 46%, #ff5bd6 100%);
  box-shadow:
    0 18px 44px rgba(0, 224, 255, .22),
    0 0 40px rgba(255, 91, 214, .18),
    inset 0 1px 0 rgba(255, 255, 255, .5);
  font-size: 33px;
}

.brand h1 {
  font-size: clamp(28px, 2.4vw, 38px);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 30px rgba(127, 232, 255, .2);
}

.brand h1::after {
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .28);
  background:
    radial-gradient(circle at 25% 10%, rgba(255, 255, 255, .66), transparent 34%),
    linear-gradient(135deg, #a7f3ff, #d8b4fe 52%, #ffd166);
  box-shadow:
    0 0 22px rgba(127, 232, 255, .2),
    inset 0 1px 0 rgba(255, 255, 255, .5);
  font-size: 12px;
}

.brand p {
  margin-top: 9px;
  color: var(--nova-muted);
  font-size: 13px;
}

.top-actions {
  gap: 12px;
}

.top-actions .ghost-btn,
.top-actions .primary-btn {
  min-height: 44px;
  border-radius: 15px;
  padding: 0 18px;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.top-actions .ghost-btn:hover,
.top-actions .primary-btn:hover,
.template-card:hover,
.shadow-card:hover {
  transform: translateY(-1px);
}

.top-actions .ghost-btn {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .05)),
    rgba(16, 24, 42, .7);
  border-color: rgba(218, 236, 255, .2);
}

.top-actions .primary-btn {
  color: #071018;
  background:
    radial-gradient(circle at 24% 12%, rgba(255, 255, 255, .72), transparent 30%),
    linear-gradient(135deg, var(--nova-cyan), var(--nova-violet) 44%, var(--nova-pink) 72%, var(--nova-gold));
  box-shadow:
    0 0 28px rgba(0, 224, 255, .24),
    0 0 42px rgba(255, 91, 214, .18),
    inset 0 1px 0 rgba(255, 255, 255, .58);
}

.editor-layout {
  min-height: 0;
  gap: 14px;
  grid-template-columns: minmax(244px, 286px) minmax(520px, 1fr) minmax(330px, 386px);
  border-top: 0;
}

.left-rail,
.workspace,
.right-panel {
  overflow: hidden;
  border: 1px solid var(--nova-line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .105), rgba(255, 255, 255, .042)),
    var(--nova-glass);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    0 26px 86px rgba(0, 0, 0, .3);
  backdrop-filter: blur(34px) saturate(168%);
}

.left-rail {
  padding: 18px;
  overflow-y: auto;
}

.workspace {
  grid-template-rows: 62px minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03)),
    rgba(7, 12, 24, .46);
}

.right-panel {
  padding-top: 0;
}

.canvas-toolbar {
  min-height: 62px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid rgba(190, 220, 255, .13);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(255, 91, 214, .1), rgba(0, 224, 255, .1)),
    rgba(8, 13, 25, .5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.canvas-stage {
  padding: 28px;
  background-color: rgba(7, 12, 24, .22);
  background-image:
    linear-gradient(rgba(127, 232, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 91, 214, .045) 1px, transparent 1px),
    radial-gradient(circle at 20% 18%, rgba(255, 91, 214, .12), transparent 30%),
    radial-gradient(circle at 82% 16%, rgba(0, 224, 255, .12), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 48%, rgba(255, 209, 102, .06));
  background-size: 30px 30px, 30px 30px, 100% 100%, 100% 100%, 100% 100%;
}

.rail-head {
  margin-bottom: 16px;
  padding: 0 2px;
}

.rail-head strong {
  font-size: 18px;
  letter-spacing: 0;
}

.rail-head span,
.status-pill {
  color: var(--nova-muted);
}

.segmented,
.config-tabs,
.canvas-tabs {
  gap: 4px;
  padding: 5px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .04)),
    rgba(5, 10, 21, .56);
  border-color: rgba(190, 220, 255, .17);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14),
    0 16px 34px rgba(0, 0, 0, .16);
}

.segmented button,
.canvas-tabs button,
.config-tabs button {
  min-height: 36px;
  border-radius: 13px;
  color: rgba(229, 238, 255, .66);
  transition: color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.segmented button.active,
.canvas-tabs button.active,
.config-tabs button.active {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(127, 232, 255, .2), rgba(167, 139, 250, .13)),
    rgba(255, 255, 255, .08);
  box-shadow:
    inset 0 0 0 1px rgba(127, 232, 255, .2),
    0 10px 24px rgba(0, 0, 0, .18),
    0 0 24px rgba(0, 224, 255, .13);
}

.template-list {
  gap: 12px;
}

.template-card {
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 92px;
  padding: 9px;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .105), rgba(255, 255, 255, .038)),
    rgba(14, 21, 38, .62);
  border-color: rgba(190, 220, 255, .13);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    0 14px 38px rgba(0, 0, 0, .18);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.template-card.active {
  border-color: rgba(127, 232, 255, .72);
  background:
    linear-gradient(145deg, rgba(127, 232, 255, .14), rgba(255, 91, 214, .07)),
    rgba(14, 21, 38, .68);
  box-shadow:
    0 0 0 4px rgba(127, 232, 255, .12),
    0 0 30px rgba(0, 224, 255, .16),
    0 20px 54px rgba(0, 0, 0, .28);
}

.template-thumb {
  width: 72px;
  height: 72px;
  border-radius: 17px;
  border: 1px solid rgba(255, 255, 255, .08);
}

.template-meta {
  min-width: 0;
}

.template-meta strong {
  margin: 5px 0 7px;
  font-size: 14px;
}

.template-meta span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--nova-soft);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.status-pill {
  min-height: 34px;
  padding: 0 14px;
  border-color: rgba(127, 232, 255, .22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .045)),
    rgba(5, 10, 21, .5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13), 0 0 20px rgba(0, 224, 255, .08);
}

.right-panel .config-tabs {
  margin: 14px 14px 12px;
}

.panel-scroll {
  padding: 4px 8px 18px 0;
}

.panel-body {
  padding: 2px 14px 18px;
}

.panel-body.active {
  gap: 16px;
}

.control {
  gap: 9px;
  color: var(--nova-soft);
  font-size: 13px;
}

.control > span,
.swatch-section h3,
.shadow-card strong {
  color: rgba(239, 247, 255, .84);
}

input,
select,
textarea,
.toggle-item,
.shadow-card,
.empty-image,
.color-lab {
  border-color: rgba(190, 220, 255, .15);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .105), rgba(255, 255, 255, .045)),
    rgba(14, 21, 38, .66);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .13),
    0 14px 38px rgba(0, 0, 0, .16);
}

input,
select {
  height: 44px;
  border-radius: 16px;
}

textarea {
  border-radius: 16px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(127, 232, 255, .76);
  box-shadow:
    0 0 0 4px rgba(127, 232, 255, .13),
    0 0 26px rgba(255, 91, 214, .09),
    inset 0 1px 0 rgba(255, 255, 255, .16);
}

.color-lab {
  border-radius: 24px;
  padding: 0 0 18px;
}

.color-lab-tabs {
  padding: 12px 14px 0;
}

.upload-bg-btn {
  width: calc(100% - 28px);
  margin: 14px 14px 6px;
  min-height: 46px;
  border-radius: 999px;
  color: #f8fbff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .04)),
    rgba(5, 10, 21, .56);
  border-color: rgba(190, 220, 255, .18);
}

.swatch-groups,
.shadow-grid {
  padding: 0 14px;
}

.live-card {
  border: 1px solid rgba(255, 255, 255, .42);
  box-shadow:
    0 34px 92px rgba(0, 0, 0, .34),
    0 0 38px rgba(0, 224, 255, .16),
    0 0 68px rgba(255, 91, 214, .1);
}

.live-card-inner {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .62),
    inset 0 -1px 0 rgba(255, 255, 255, .16);
}

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

.panel-scroll::-webkit-scrollbar-track {
  margin: 2px 0 14px;
  background: rgba(5, 10, 21, .3);
  border-left: 1px solid rgba(127, 232, 255, .08);
}

.panel-scroll::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, rgba(127, 232, 255, .86), rgba(167, 139, 250, .74), rgba(255, 91, 214, .68));
  border: 2px solid rgba(5, 10, 21, .34);
  box-shadow: 0 0 14px rgba(0, 224, 255, .18);
}

@media (max-width: 1180px) {
  .app-frame {
    grid-template-rows: 104px minmax(0, 1fr);
    padding: 12px;
  }

  .topbar {
    height: 104px;
    padding: 18px 20px;
  }

  .editor-layout {
    grid-template-columns: minmax(220px, 252px) minmax(420px, 1fr) minmax(308px, 340px);
  }

  .brand h1 {
    font-size: 28px;
  }
}

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

  .app-frame {
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto;
    padding: 12px;
  }

  .topbar {
    height: auto;
    min-height: 118px;
    align-items: flex-start;
    border-radius: 24px;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions .ghost-btn,
  .top-actions .primary-btn {
    flex: 1;
  }

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

  .workspace {
    order: 1;
  }

  .left-rail {
    order: 2;
  }

  .right-panel {
    order: 3;
  }

  .left-rail,
  .workspace,
  .right-panel {
    border-radius: 24px;
  }

  .workspace {
    min-height: 700px;
  }

  .app-frame::after {
    inset: 132px 12px 18px;
  }
}

@media (max-width: 560px) {
  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 17px;
    font-size: 28px;
  }

  .brand h1 {
    font-size: 25px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    flex-direction: initial;
  }

  .top-actions .ghost-btn,
  .top-actions .primary-btn {
    min-height: 42px;
    padding: 0 10px;
    border-radius: 14px;
    font-size: 14px;
  }
}

/* design-taste-frontend final lock: Apple Liquid Glass, cooler spectrum */
body {
  background-color: #030611;
  background-image:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, .88) 0 1px, transparent 1.7px),
    radial-gradient(circle at 78% 22%, rgba(96, 216, 255, .76) 0 1px, transparent 1.8px),
    radial-gradient(circle at 30% 78%, rgba(255, 79, 216, .58) 0 1px, transparent 1.8px),
    linear-gradient(rgba(130, 204, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .032) 1px, transparent 1px),
    radial-gradient(ellipse at 18% 24%, rgba(96, 216, 255, .34), transparent 32%),
    radial-gradient(ellipse at 78% 18%, rgba(155, 140, 255, .34), transparent 34%),
    radial-gradient(ellipse at 62% 78%, rgba(255, 79, 216, .24), transparent 36%),
    conic-gradient(from 220deg at 50% 42%, rgba(96, 216, 255, .62), rgba(155, 140, 255, .62), rgba(255, 79, 216, .58), rgba(104, 255, 208, .44), rgba(96, 216, 255, .62)),
    linear-gradient(145deg, #030611 0%, #071226 46%, #0b1026 72%, #030611 100%);
  background-size: 300px 300px, 420px 420px, 520px 520px, 52px 52px, 52px 52px, 100% 100%, 100% 100%, 100% 100%, 150% 150%, 100% 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -4;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 18%, rgba(255, 255, 255, .12) 36%, transparent 54%),
    radial-gradient(circle at 50% -12%, rgba(255, 255, 255, .18), transparent 34%);
  mix-blend-mode: screen;
  opacity: .48;
}

.app-frame {
  grid-template-rows: 106px minmax(0, 1fr);
  padding: 16px 20px 20px;
  gap: 16px;
}

.app-frame::before {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(96, 216, 255, .24), transparent 42%),
    radial-gradient(ellipse at 84% 18%, rgba(155, 140, 255, .24), transparent 42%),
    radial-gradient(ellipse at 56% 94%, rgba(255, 79, 216, .18), transparent 46%),
    linear-gradient(118deg, transparent 0 18%, rgba(96, 216, 255, .12) 32%, rgba(155, 140, 255, .11) 50%, rgba(255, 79, 216, .1) 68%, transparent 86%);
  opacity: .82;
}

.app-frame::after {
  inset: 124px 20px 20px;
  border-color: rgba(220, 238, 255, .12);
  border-radius: 36px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .018) 40%, rgba(96, 216, 255, .055)),
    radial-gradient(circle at 18% 20%, rgba(96, 216, 255, .06), transparent 34%),
    linear-gradient(rgba(255, 255, 255, .038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 0 120px rgba(96, 216, 255, .055),
    0 0 80px rgba(96, 216, 255, .1),
    0 36px 120px rgba(0, 0, 0, .42);
}

.topbar {
  height: 106px;
  min-height: 0;
  padding: 20px 24px;
  border-radius: 32px;
  border-color: rgba(222, 238, 255, .18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .055) 38%, rgba(96, 216, 255, .07)),
    linear-gradient(90deg, rgba(96, 216, 255, .08), rgba(255, 79, 216, .055)),
    rgba(5, 10, 22, .72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    inset 0 -1px 0 rgba(255, 255, 255, .05),
    0 24px 86px rgba(0, 0, 0, .38),
    0 0 72px rgba(96, 216, 255, .1);
}

.brand-mark {
  width: 60px;
  height: 60px;
  border-radius: 19px;
  color: #050714;
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, .78), transparent 31%),
    linear-gradient(145deg, #b9f4ff 0%, #9b8cff 44%, #ff4fd8 100%);
  box-shadow:
    0 18px 48px rgba(96, 216, 255, .24),
    0 0 42px rgba(255, 79, 216, .18),
    inset 0 1px 0 rgba(255, 255, 255, .62),
    inset 0 -14px 30px rgba(5, 7, 20, .16);
}

.brand h1 {
  color: #fff;
  font-size: clamp(30px, 2.6vw, 40px);
  font-weight: 860;
}

.brand h1::after {
  color: #050714;
  background:
    radial-gradient(circle at 22% 12%, rgba(255, 255, 255, .78), transparent 34%),
    linear-gradient(135deg, #b9f4ff, #d8c8ff 46%, #ffd1f4 74%, #fff0a8);
}

.top-actions .ghost-btn,
.top-actions .primary-btn {
  min-height: 43px;
  border-radius: 999px;
}

.top-actions .ghost-btn {
  color: #eef7ff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .055)),
    rgba(10, 16, 31, .64);
  border-color: rgba(222, 238, 255, .18);
}

.top-actions .primary-btn,
.export-stack .primary-btn {
  background:
    radial-gradient(circle at 24% 12%, rgba(255, 255, 255, .8), transparent 30%),
    linear-gradient(135deg, #60d8ff, #9b8cff 42%, #ff4fd8 72%, #ffcf73);
  box-shadow:
    0 0 28px rgba(96, 216, 255, .28),
    0 0 42px rgba(255, 79, 216, .2),
    0 16px 38px rgba(0, 0, 0, .24),
    inset 0 1px 0 rgba(255, 255, 255, .68);
}

.editor-layout {
  gap: 16px;
  grid-template-columns: minmax(244px, 292px) minmax(540px, 1fr) minmax(334px, 392px);
}

.left-rail,
.workspace,
.right-panel {
  border-radius: 32px;
  border-color: rgba(214, 232, 255, .16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .038)),
    radial-gradient(circle at 24% 0%, rgba(96, 216, 255, .065), transparent 32%),
    rgba(8, 13, 27, .58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .18),
    inset 0 -1px 0 rgba(255, 255, 255, .04),
    0 28px 92px rgba(0, 0, 0, .34);
}

.workspace {
  grid-template-rows: 60px minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .095), rgba(255, 255, 255, .032)),
    radial-gradient(circle at 50% 0%, rgba(96, 216, 255, .1), transparent 38%),
    rgba(6, 11, 23, .5);
}

.canvas-toolbar {
  min-height: 60px;
  background:
    linear-gradient(90deg, rgba(96, 216, 255, .12), rgba(155, 140, 255, .09), rgba(255, 79, 216, .08)),
    rgba(6, 11, 23, .48);
}

.canvas-stage {
  background-color: rgba(4, 9, 20, .22);
  background-image:
    linear-gradient(rgba(96, 216, 255, .075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .038) 1px, transparent 1px),
    radial-gradient(circle at 22% 18%, rgba(96, 216, 255, .14), transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(255, 79, 216, .11), transparent 32%),
    radial-gradient(circle at 50% 78%, rgba(104, 255, 208, .08), transparent 38%);
}

.segmented,
.config-tabs,
.canvas-tabs {
  border-radius: 999px;
}

.segmented button,
.canvas-tabs button,
.config-tabs button {
  border-radius: 999px;
  font-weight: 800;
}

.template-card {
  border-radius: 23px;
}

.template-card.active {
  border-color: rgba(124, 235, 255, .42);
  background:
    linear-gradient(145deg, rgba(96, 216, 255, .16), rgba(155, 140, 255, .1) 45%, rgba(255, 79, 216, .07)),
    rgba(12, 19, 36, .72);
}

input,
select {
  height: 43px;
  border-radius: 999px;
}

textarea,
.color-lab,
.toggle-item,
.shadow-card {
  border-radius: 22px;
}

.panel-scroll::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, rgba(124, 235, 255, .9), rgba(155, 140, 255, .76), rgba(255, 79, 216, .72));
}

@media (max-width: 1180px) {
  .app-frame {
    grid-template-rows: 102px minmax(0, 1fr);
  }

  .topbar {
    height: 102px;
  }

  .editor-layout {
    grid-template-columns: minmax(220px, 252px) minmax(430px, 1fr) minmax(310px, 344px);
  }
}

@media (max-width: 900px) {
  .app-frame {
    grid-template-rows: auto;
    padding: 12px;
  }

  .topbar {
    height: auto;
    min-height: 116px;
    border-radius: 28px;
  }

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

  .left-rail,
  .workspace,
  .right-panel {
    border-radius: 28px;
  }
}

@media (max-width: 560px) {
  .brand h1 {
    font-size: 25px;
  }

  .top-actions .ghost-btn,
  .top-actions .primary-btn {
    font-size: 13px;
  }
}
