:root {
  color-scheme: light;
  --paper-top: #f8efe8;
  --paper-bottom: #ded1c6;
  --surface: rgba(252, 247, 241, 0.84);
  --surface-strong: #fffaf5;
  --inset: rgba(255, 248, 242, 0.7);
  --ink: #2f2926;
  --ink-soft: #6e5a61;
  --ink-faint: #9b8d8c;
  --blush: #b67a94;
  --blush-soft: #ead4dc;
  --champagne: #b89e78;
  --line: rgba(116, 88, 81, 0.17);
  --line-soft: rgba(116, 88, 81, 0.1);
  --danger: #b94f5f;
  --success: #4f8a65;
  --shadow: 0 22px 58px rgba(89, 67, 61, 0.13);
  --panel-radius: 28px;
  --control-radius: 14px;
  --rail-width: 108px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper-bottom); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 255, 255, 0.66), transparent 28rem),
    linear-gradient(145deg, var(--paper-top), var(--paper-bottom));
}
button, input, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }

.studio-app { min-height: 100vh; padding: 58px 28px 26px; position: relative; }
.traffic-lights { position: absolute; top: 18px; left: 22px; display: flex; gap: 10px; }
.traffic-lights span { width: 14px; height: 14px; border-radius: 50%; background: #ff5f57; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.traffic-lights span:nth-child(2) { background: #febc2e; }
.traffic-lights span:nth-child(3) { background: #28c840; }

.studio-header {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: rgba(248, 239, 232, 0.72);
  box-shadow: 0 14px 42px rgba(89, 67, 61, 0.08);
  backdrop-filter: blur(22px);
}
.studio-brand { min-width: 0; display: flex; align-items: center; gap: 12px; }
.studio-brand img { width: 48px; height: 48px; border-radius: 13px; box-shadow: 0 10px 24px rgba(88, 64, 66, .13); }
.studio-brand span { min-width: 0; display: grid; gap: 2px; }
.studio-brand strong { font-size: 22px; line-height: 1.1; }
.studio-brand small { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.language-switch { display: inline-flex; padding: 4px; border: 1px solid var(--line-soft); border-radius: 999px; background: rgba(255,255,255,.45); }
.language-switch button { min-height: 34px; padding: 0 13px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.language-switch button.is-active { color: var(--ink); background: rgba(255,255,255,.92); box-shadow: 0 5px 14px rgba(89,67,61,.08); }
.account-button { min-height: 44px; max-width: 250px; display: inline-flex; align-items: center; gap: 9px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.68); cursor: pointer; font-weight: 800; }
.account-button > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-avatar { color: var(--blush); font-size: 16px; }
.mobile-rail-toggle { display: none !important; }

.workspace-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 390px) var(--rail-width); gap: 18px; margin-top: 18px; align-items: stretch; }
.workspace-main { min-width: 0; display: grid; grid-template-rows: minmax(580px, calc(100vh - 310px)) minmax(260px, auto); gap: 18px; }
.preview-panel, .editor-panel, .context-panel, .tool-rail {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}
.preview-panel, .editor-panel, .context-panel { border-radius: var(--panel-radius); overflow: hidden; }
.preview-panel { min-height: 580px; display: grid; grid-template-rows: auto minmax(310px, 1fr) auto auto; padding: 24px; }
.editor-panel { min-height: 260px; padding: 20px 22px; }
.context-panel { min-height: 720px; max-height: calc(100vh - 160px); position: sticky; top: 18px; padding: 22px 18px; overflow: hidden; }
.context-content { height: calc(100% - 58px); overflow-y: auto; padding: 4px 4px 16px; scrollbar-width: thin; scrollbar-color: rgba(110,90,97,.25) transparent; }

.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-heading h1 { margin-top: 5px; font-size: clamp(24px, 2.3vw, 34px); line-height: 1.12; }
.panel-heading h2 { margin-top: 4px; font-size: 19px; line-height: 1.2; }
.compact-heading { min-height: 54px; }
.eyebrow { color: var(--ink-soft); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.preview-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.preview-badges span, .selection-status, .mini-badge { min-height: 28px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 999px; background: rgba(255,255,255,.64); border: 1px solid var(--line-soft); color: var(--ink-soft); font-size: 11px; font-weight: 800; }

.folder-stage {
  min-height: 320px;
  position: relative;
  display: grid;
  place-items: center;
  margin: 16px 0 12px;
  overflow: hidden;
  border: 1px dashed rgba(110, 90, 97, 0.2);
  border-radius: 24px;
  background:
    linear-gradient(rgba(116,88,81,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(116,88,81,.025) 1px, transparent 1px),
    rgba(255,255,255,.31);
  background-size: 32px 32px;
}
.folder-stage canvas { width: auto; height: min(40vh, 340px); max-width: 82%; max-height: 88%; aspect-ratio: 1; cursor: default; touch-action: none; filter: drop-shadow(0 26px 28px rgba(73,50,50,.17)); }
.folder-stage canvas.has-selection { cursor: grab; }
.folder-stage canvas.is-dragging { cursor: grabbing; }
.stage-empty-hint { display: none; }

.quick-colors { min-height: 58px; display: flex; align-items: center; gap: 11px; padding: 9px 13px; border: 1px solid var(--line-soft); border-radius: 18px; background: rgba(255,255,255,.38); }
.quick-colors > span { color: var(--ink-soft); font-size: 11px; font-weight: 850; text-transform: uppercase; white-space: nowrap; }
.quick-color-list { min-width: 0; display: flex; gap: 9px; overflow-x: auto; }
.color-dot { flex: 0 0 auto; width: 30px; height: 30px; padding: 0; border: 2px solid rgba(255,255,255,.85); border-radius: 50%; box-shadow: 0 0 0 1px var(--line), inset 0 1px 2px rgba(0,0,0,.08); cursor: pointer; }
.color-dot.is-active { box-shadow: 0 0 0 2px var(--blush), inset 0 1px 2px rgba(0,0,0,.08); }
.color-picker-button { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.7); cursor: pointer; }
.color-picker-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.stage-footer { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; }
.stage-footer p { color: var(--ink-soft); font-size: 13px; line-height: 1.5; }

.primary-button, .secondary-button, .text-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  cursor: pointer;
  font-weight: 820;
  white-space: nowrap;
}
.primary-button { color: #fffaf6; border-color: #2f2926; background: #2f2926; box-shadow: 0 12px 24px rgba(47,41,38,.17); }
.secondary-button { background: rgba(255,255,255,.72); color: var(--ink); }
.text-button { min-height: 34px; padding: 0 12px; border-color: transparent; color: var(--ink-soft); background: transparent; }
.primary-button:hover, .secondary-button:hover, .account-button:hover { transform: translateY(-1px); }
.primary-button:disabled, .secondary-button:disabled { opacity: .5; cursor: wait; transform: none; }
.wide-button { width: 100%; }
.danger { color: var(--danger); }
.editor-content { min-height: 172px; padding-top: 10px; }

.tool-rail { min-height: 720px; max-height: calc(100vh - 160px); position: sticky; top: 18px; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 12px 9px; border-radius: 34px; }
.tool-rail button { min-height: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 22px; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: 11px; font-weight: 820; }
.tool-rail button:focus { outline: 0; }
.tool-rail button:focus-visible { box-shadow: inset 0 0 0 2px rgba(182,122,148,.5); }
.tool-rail button:hover { background: rgba(255,255,255,.36); color: var(--ink); }
.tool-rail button.is-active { color: var(--ink); background: rgba(255,255,255,.74); box-shadow: inset 0 0 0 1px var(--line-soft), 0 8px 18px rgba(89,67,61,.07); }
.rail-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(255,255,255,.48); font-size: 20px; line-height: 1; }

.palette-tabs, .segmented-control { display: flex; gap: 7px; padding: 4px; overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 999px; background: rgba(255,255,255,.34); }
.palette-tabs button, .segmented-control button { min-height: 32px; flex: 0 0 auto; padding: 0 12px; border: 0; border-radius: 999px; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: 11px; font-weight: 820; }
.palette-tabs button.is-active, .segmented-control button.is-active { color: var(--ink); background: rgba(255,255,255,.9); box-shadow: 0 4px 12px rgba(89,67,61,.07); }
.palette-list, .theme-list, .store-list { display: grid; gap: 11px; margin-top: 12px; }
.palette-item, .theme-card, .store-product, .download-step {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255,255,255,.42);
}
button.palette-item, button.theme-card { text-align: left; cursor: pointer; }
.palette-item:hover, .theme-card:hover { border-color: rgba(182,122,148,.35); background: rgba(255,255,255,.64); }
.palette-item.is-active, .theme-card.is-active { border-color: rgba(182,122,148,.48); box-shadow: 0 0 0 3px rgba(182,122,148,.1); }
.palette-item-header, .theme-card-header, .store-product-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.palette-item strong, .theme-card strong, .store-product strong { font-size: 14px; }
.palette-item small, .theme-card small, .store-product small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 11px; }
.swatch-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-top: 11px; }
.swatch-row span { min-height: 39px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.38); }

.color-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: stretch; }
.color-slot, .control-group { padding: 13px; border: 1px solid var(--line-soft); border-radius: 18px; background: rgba(255,255,255,.38); }
.color-slot label, .control-label { display: block; color: var(--ink-soft); font-size: 11px; font-weight: 820; }
.color-slot input[type="color"] { width: 100%; height: 58px; margin-top: 8px; padding: 0; border: 0; border-radius: 13px; background: transparent; cursor: pointer; }
.color-slot input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-slot input[type="color"]::-webkit-color-swatch { border: 1px solid var(--line-soft); border-radius: 13px; }
.color-slot code { display: block; margin-top: 7px; color: var(--ink-soft); font-size: 11px; }
.swap-button { width: 64px; border: 1px solid var(--line-soft); border-radius: 18px; background: rgba(255,255,255,.54); cursor: pointer; font-size: 25px; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }

.gradient-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.control-group input[type="range"] { width: 100%; margin-top: 14px; accent-color: var(--blush); }
.control-value { float: right; color: var(--ink); }
.gradient-presets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 12px; }
.gradient-preset { min-height: 64px; border: 2px solid rgba(255,255,255,.8); border-radius: 15px; box-shadow: 0 0 0 1px var(--line-soft); cursor: pointer; }

.theme-search { width: 100%; min-height: 42px; padding: 0 13px; border: 1px solid var(--line-soft); border-radius: 14px; outline: 0; color: var(--ink); background: rgba(255,255,255,.58); }
.theme-search:focus { border-color: rgba(182,122,148,.48); box-shadow: 0 0 0 3px rgba(182,122,148,.1); }
.theme-card { display: block; }
.theme-card-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 11px; }
.theme-card-preview img { width: 100%; aspect-ratio: 1; object-fit: contain; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.48); }
.theme-price { color: var(--blush); font-size: 12px; font-weight: 850; }
.sample-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.sample-item { aspect-ratio: 1; display: grid; place-items: center; padding: 7px; border: 1px solid var(--line-soft); border-radius: 16px; background: rgba(255,255,255,.42); cursor: pointer; overflow: hidden; }
.sample-item img { width: 100%; height: 100%; object-fit: contain; }
.sample-item.is-locked { position: relative; }
.sample-item.is-locked::after { content: "锁"; position: absolute; right: 5px; bottom: 5px; min-width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-soft); background: rgba(255,255,255,.88); font-size: 10px; font-weight: 850; }
.theme-editor-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.theme-editor-header p { color: var(--ink-soft); font-size: 12px; }

.diy-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.diy-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.diy-form label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.diy-form input[type="text"] { min-height: 42px; padding: 0 12px; border: 1px solid var(--line-soft); border-radius: 13px; background: rgba(255,255,255,.6); }
.diy-form input[type="range"] { width: 100%; accent-color: var(--blush); }
.layer-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.layer-chip { min-height: 34px; max-width: 180px; padding: 0 11px; border: 1px solid var(--line-soft); border-radius: 999px; background: rgba(255,255,255,.5); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-chip.is-active { border-color: var(--blush); background: rgba(234,212,220,.5); }
.emoji-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.emoji-button { width: 40px; height: 40px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(255,255,255,.56); cursor: pointer; font-size: 21px; }

.store-product { display: grid; gap: 12px; }
.store-product.is-featured { border-color: rgba(182,122,148,.38); background: linear-gradient(135deg, rgba(234,212,220,.62), rgba(255,255,255,.46)); }
.store-product p { color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.product-price { font-size: 20px; font-weight: 880; }
.store-product .primary-button { width: 100%; }
.license-summary { display: grid; gap: 7px; margin-bottom: 12px; padding: 13px; border: 1px solid var(--line-soft); border-radius: 16px; background: rgba(255,255,255,.42); }
.license-summary strong { font-size: 13px; }
.license-summary span { color: var(--ink-soft); font-size: 11px; }

.download-app-card { display: grid; justify-items: center; gap: 13px; padding: 8px 4px 20px; text-align: center; }
.download-app-card img { width: 82px; border-radius: 22px; box-shadow: 0 18px 35px rgba(89,67,61,.14); }
.download-app-card h3 { font-size: 20px; }
.download-app-card p { max-width: 28rem; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.download-steps { display: grid; gap: 9px; }
.download-step { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.download-step > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--ink); font-size: 11px; font-weight: 850; }
.download-step strong { font-size: 12px; }
.download-step p { margin-top: 3px; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.security-note { margin-top: 10px; padding: 13px; border: 1px solid rgba(184,158,120,.32); border-radius: 16px; background: rgba(233,216,182,.24); color: var(--ink-soft); font-size: 11px; line-height: 1.55; }

.studio-footer { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 14px 0; color: var(--ink-soft); font-size: 11px; }
.studio-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.studio-footer a:hover { color: var(--ink); }

.studio-dialog {
  width: min(92vw, 480px);
  max-height: 88vh;
  padding: 24px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 26px;
  color: var(--ink);
  background: rgba(252,247,241,.98);
  box-shadow: 0 38px 110px rgba(47,41,38,.28);
}
.studio-dialog::backdrop { background: rgba(47,41,38,.34); backdrop-filter: blur(8px); }
.dialog-close-row { height: 0; display: flex; justify-content: flex-end; position: relative; z-index: 2; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-soft); border-radius: 50%; background: rgba(255,255,255,.65); cursor: pointer; font-size: 19px; }
.dialog-brand { display: flex; align-items: center; gap: 12px; padding-right: 44px; }
.dialog-brand img { width: 52px; height: 52px; border-radius: 14px; }
.dialog-brand div { display: grid; gap: 3px; }
.dialog-brand strong { font-size: 20px; }
.dialog-brand span { color: var(--ink-soft); font-size: 12px; }
.dialog-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 20px 0 14px; padding: 4px; border: 1px solid var(--line-soft); border-radius: 999px; background: rgba(255,255,255,.42); }
.dialog-tabs button { min-height: 36px; border: 0; border-radius: 999px; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: 12px; font-weight: 820; }
.dialog-tabs button.is-active { color: var(--ink); background: #fff; box-shadow: 0 5px 12px rgba(89,67,61,.08); }
.auth-form { display: grid; gap: 12px; }
.auth-form > label:not(.checkbox-row) { display: grid; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 820; }
.auth-form input:not([type="checkbox"]), .auth-form select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-soft); border-radius: 13px; color: var(--ink); background: rgba(255,255,255,.7); outline: 0; }
.auth-form input:focus, .auth-form select:focus { border-color: rgba(182,122,148,.5); box-shadow: 0 0 0 3px rgba(182,122,148,.1); }
.verification-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 11px; }
.form-status { min-height: 18px; color: var(--danger); font-size: 11px; line-height: 1.5; }
.form-status.is-success { color: var(--success); }

.account-profile { display: flex; gap: 13px; align-items: center; padding: 6px 42px 18px 2px; }
.profile-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; color: var(--blush); background: var(--blush-soft); }
.account-profile div { min-width: 0; display: grid; gap: 4px; }
.account-profile small, .account-profile span { color: var(--ink-soft); font-size: 11px; }
.account-profile strong { overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.account-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line-soft); }

.checkout-dialog { width: min(94vw, 760px); min-height: 360px; padding: 22px; }
.checkout-heading { padding-right: 42px; }
.checkout-heading h2 { margin-top: 5px; font-size: 22px; }
.checkout-heading > p:last-child { margin-top: 5px; color: var(--ink-soft); font-size: 12px; }
.checkout-loading { min-height: 250px; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--ink-soft); font-size: 12px; }
.spinner { width: 30px; height: 30px; border: 3px solid rgba(182,122,148,.18); border-top-color: var(--blush); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.checkout-frame { width: 100%; min-height: 560px; margin-top: 16px; border: 0; border-radius: 16px; background: #fff; }
.checkout-fallback { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; color: var(--ink-soft); font-size: 11px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; max-width: min(88vw, 560px); padding: 11px 16px; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; color: #fff; background: rgba(47,41,38,.9); box-shadow: 0 14px 38px rgba(47,41,38,.22); opacity: 0; transform: translate(-50%, 18px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; font-size: 12px; font-weight: 700; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

[hidden] { display: none !important; }

@media (max-width: 1180px) {
  .workspace-shell { grid-template-columns: minmax(0, 1fr) 330px 92px; }
  .tool-rail button { min-height: 80px; }
  .sample-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .studio-app { padding: 48px 14px 100px; }
  .traffic-lights { top: 14px; left: 18px; }
  .studio-header { min-height: 70px; padding: 10px 12px; border-radius: 25px; }
  .studio-brand img { width: 40px; height: 40px; }
  .studio-brand strong { font-size: 17px; }
  .studio-brand small { display: none; }
  .language-switch { display: none; }
  .account-button { max-width: 160px; min-height: 40px; padding: 0 12px; font-size: 12px; }
  .mobile-rail-toggle { display: grid !important; }
  .workspace-shell { display: block; margin-top: 12px; }
  .workspace-main { display: block; }
  .preview-panel { min-height: 580px; padding: 18px; }
  .editor-panel { margin-top: 12px; padding: 18px; }
  .context-panel { min-height: 0; max-height: none; position: static; margin-top: 12px; padding: 18px; }
  .context-content { height: auto; max-height: 560px; }
  .tool-rail { width: calc(100% - 20px); min-height: 72px; max-height: none; position: fixed; z-index: 40; right: 10px; bottom: 10px; left: 10px; top: auto; flex-direction: row; justify-content: space-around; gap: 2px; padding: 7px; border-radius: 24px; overflow-x: auto; }
  .tool-rail button { min-width: 68px; min-height: 58px; gap: 3px; border-radius: 17px; }
  .rail-icon { width: 28px; height: 28px; border: 0; background: transparent; font-size: 17px; }
  .studio-footer { padding-bottom: 20px; }
}

@media (max-width: 580px) {
  .studio-app { padding-right: 8px; padding-left: 8px; }
  .studio-header { gap: 8px; }
  .studio-brand { gap: 8px; }
  .studio-brand img { width: 36px; height: 36px; border-radius: 10px; }
  .studio-brand strong { font-size: 15px; }
  .account-button { max-width: 120px; padding: 0 10px; }
  .account-avatar { display: none; }
  .preview-panel { min-height: 520px; grid-template-rows: auto minmax(250px, 1fr) auto auto; padding: 15px; border-radius: 23px; }
  .preview-heading { display: block; }
  .preview-badges { justify-content: flex-start; margin-top: 10px; }
  .panel-heading h1 { font-size: 22px; }
  .folder-stage { min-height: 250px; margin-top: 12px; border-radius: 18px; }
  .folder-stage canvas { width: auto; height: min(72vw, 270px); max-width: 94%; }
  .quick-colors > span { display: none; }
  .stage-footer { align-items: stretch; flex-direction: column; }
  .stage-footer .primary-button { width: 100%; }
  .color-editor-grid, .gradient-controls, .diy-form { grid-template-columns: 1fr; }
  .swap-button { width: 100%; min-height: 46px; }
  .sample-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .studio-footer { align-items: flex-start; flex-direction: column; }
  .studio-dialog { padding: 18px; border-radius: 22px; }
  .dialog-tabs button { font-size: 10px; }
  .verification-row { grid-template-columns: 1fr; }
  .checkout-dialog { min-height: 330px; }
  .checkout-frame { min-height: 620px; }
  .checkout-fallback { align-items: stretch; flex-direction: column; }
}

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