:root {
  color-scheme: light;
  --bg: #f4eff5;
  --paper: #fffdfd;
  --panel: #f8f4f8;
  --line: rgba(35, 22, 38, 0.14);
  --line-strong: rgba(35, 22, 38, 0.38);
  --text: #171219;
  --muted: #715f75;
  --purple: #7e269d;
  --purple-2: #b45ad6;
  --purple-soft: rgba(152, 61, 188, 0.1);
  --green: #09825f;
  --red: #b82f4b;
  --ink: #0d0f14;
  --workbench: #15171d;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 16px 16px, rgba(55, 31, 59, 0.15) 1.3px, transparent 1.6px) 0 0 / 32px 32px,
    linear-gradient(90deg, transparent 0 74%, rgba(126, 38, 157, 0.055) 74% 76%, transparent 76%),
    var(--bg);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
  background: repeating-linear-gradient(0deg, transparent 0 7px, rgba(47, 13, 55, 0.03) 7px 8px);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--purple-2);
  outline-offset: 2px;
}
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.studio-shell { position: relative; width: min(1680px, calc(100% - 24px)); margin: 0 auto; padding: 12px 0 36px; }
.site-bar {
  position: sticky;
  z-index: 8;
  top: 12px;
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 7px 9px;
  background: rgba(255, 253, 253, 0.95);
  box-shadow: 0 10px 28px rgba(25, 14, 28, 0.08);
  backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 13px; font-weight: 900; text-decoration: none; }
.brand-mark {
  width: 29px;
  height: 29px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 30% 35%, var(--purple) 0 6px, transparent 7px),
    radial-gradient(circle at 70% 35%, var(--purple-2) 0 6px, transparent 7px),
    radial-gradient(circle at 50% 72%, #2d0938 0 6px, transparent 7px),
    var(--paper);
}
.primary-nav { display: inline-flex; align-items: center; align-self: stretch; }
.primary-nav a { min-width: 92px; display: grid; place-items: center; padding: 0 14px; border-bottom: 3px solid transparent; color: var(--muted); font-size: 13px; font-weight: 800; text-decoration: none; }
.primary-nav a:hover, .primary-nav a.active { color: var(--text); }
.primary-nav a.active { border-bottom-color: var(--purple); }
.site-meta { display: flex; justify-content: flex-end; }
.profile-button { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 5px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper); color: var(--text); font-weight: 800; }
.profile-button:hover { border-color: var(--purple); background: var(--purple-soft); }
.profile-avatar, .identity-avatar { display: grid; place-items: center; overflow: hidden; background: var(--ink); color: white; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 900; }
.profile-avatar { width: 30px; height: 30px; font-size: 12px; }
.profile-avatar img, .identity-avatar img { width: 100%; height: 100%; object-fit: cover; }

.studio-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 24px 4px 16px; }
.studio-head h1 { margin: 0; font-size: clamp(32px, 3.6vw, 54px); line-height: 0.96; letter-spacing: 0; }
.eyebrow { margin: 0 0 7px; color: var(--purple); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.save-state { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid transparent; background: rgba(255, 253, 253, 0.64); color: var(--muted); font-size: 11px; font-weight: 800; }
.save-state i { width: 8px; height: 8px; background: var(--green); }
.save-state.saving i { background: var(--purple-2); }
.save-state.error i { background: var(--red); }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 3px; font-weight: 900; }
.button:hover { border-color: var(--purple); box-shadow: 0 0 0 2px rgba(179, 83, 208, 0.12); }
.button-dark { background: var(--ink); color: white; }
.button-dark:hover { background: #242630; }
.button-primary { border-color: var(--purple); background: var(--purple); color: white; }
.button-primary:hover { border-color: #692083; background: #692083; }
.button-secondary { background: var(--paper); color: var(--text); }
.button.full { width: 100%; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--paper); color: var(--text); font-size: 20px; font-weight: 800; }
.icon-button:hover { background: var(--purple); color: white; }

.studio-layout {
  min-height: calc(100vh - 168px);
  display: grid;
  grid-template-columns: 205px minmax(620px, 1fr) 370px;
  overflow: hidden;
  border: 1px solid rgba(19, 16, 22, 0.72);
  border-radius: 5px;
  background: var(--workbench);
  box-shadow: 0 18px 44px rgba(25, 14, 28, 0.14);
}
.project-rail { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid rgba(255, 255, 255, 0.1); background: #101217; color: white; }
.rail-head { min-height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 16px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.rail-head .eyebrow { color: #d79eea; }
.rail-head strong { font-size: 13px; }
.project-rail .icon-button { border-color: rgba(255, 255, 255, 0.22); background: #1b1e25; color: white; }
.project-search { display: block; padding: 11px; }
.project-search input { width: 100%; height: 40px; border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 3px; padding: 0 11px; background: #181a20; color: white; }
.project-search input::placeholder { color: #8f9097; }
.project-list { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 6px; padding: 0 9px 12px; overflow: auto; }
.project-item { width: 100%; min-height: 56px; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 9px; align-items: center; padding: 9px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: #f7f4f8; text-align: left; }
.project-item:hover { background: #1d2027; }
.project-item.active { border-color: #c678df; background: #fdf9fd; color: var(--text); box-shadow: inset 3px 0 0 var(--purple); }
.project-thumb { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 3px; background: #242730; color: white; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 900; }
.project-item.active .project-thumb { border-color: rgba(126, 38, 157, 0.28); background: var(--purple); }
.project-item strong, .project-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-item strong { font-size: 12px; }
.project-item small { margin-top: 3px; color: #aaa1ae; font-size: 10px; }
.project-item.active small { color: var(--muted); }
.empty-list { padding: 12px; color: #aaa1ae; font-size: 12px; }
.rail-foot { display: flex; justify-content: space-between; gap: 8px; padding: 12px; border-top: 1px solid rgba(255, 255, 255, 0.1); color: #a7a2aa; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.rail-foot strong { color: #d79eea; }

.editor-stage { position: relative; min-width: 0; min-height: 100%; padding: 16px; background: var(--workbench); color: white; }
.editor-head { min-height: 54px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 0 2px 13px; }
.editor-head > div:first-child { min-width: 0; flex: 1; }
.editor-head input { width: min(440px, 100%); display: block; border: 0; border-bottom: 1px solid transparent; padding: 0; background: transparent; color: white; font-size: 18px; font-weight: 900; }
.editor-head input:hover, .editor-head input:focus { border-bottom-color: rgba(255, 255, 255, 0.28); outline: 0; }
.editor-head span { display: block; margin-top: 3px; color: #9b9da5; font-size: 11px; }
.editor-tools { display: flex; align-items: center; gap: 10px; }
.stage-timeframe { display: flex; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 4px; background: #202229; }
.stage-timeframe button { width: 38px; height: 31px; flex: 0 0 auto; border: 0; border-right: 1px solid rgba(255, 255, 255, 0.1); background: transparent; color: #a7a9b1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 900; }
.stage-timeframe button:last-child { border-right: 0; }
.stage-timeframe button:hover { background: rgba(255, 255, 255, 0.08); color: white; }
.stage-timeframe button.active { background: var(--purple); color: white; }
.history-tools { display: flex; gap: 5px; }
.history-tools .icon-button { width: 31px; height: 31px; border-color: rgba(255, 255, 255, 0.2); background: #202229; color: white; font-size: 17px; }
.history-tools .icon-button:disabled { cursor: not-allowed; opacity: 0.35; }
.canvas-size { display: flex; align-items: center; gap: 6px; color: #9b9da5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.canvas-size span { margin: 0; }
.canvas-size strong { padding: 3px 5px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 2px; color: #ddd; font-size: 8px; }
.canvas-size i { width: 9px; height: 1px; transform: rotate(-45deg); background: #777982; }
.markup-toolbar {
  min-height: 42px;
  width: max-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: -2px auto 10px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: rgba(36, 38, 45, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  scrollbar-width: none;
}
.markup-toolbar::-webkit-scrollbar { display: none; }
.markup-tool-group, .markup-widths { display: flex; align-items: center; gap: 2px; }
.markup-toolbar button { width: 31px; height: 30px; display: grid; flex: 0 0 auto; place-items: center; border: 0; border-radius: 4px; background: transparent; color: #d9dae0; font-size: 18px; font-weight: 800; line-height: 1; }
.markup-toolbar button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); color: white; }
.markup-toolbar button.active { background: var(--purple); color: white; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.markup-toolbar button:disabled { cursor: default; opacity: .28; }
.markup-divider { width: 1px; height: 24px; flex: 0 0 auto; margin: 0 2px; background: rgba(255, 255, 255, 0.15); }
.markup-color { position: relative; width: 29px; height: 29px; display: block; flex: 0 0 auto; overflow: hidden; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; background: white; }
.markup-color input { width: 42px; height: 42px; position: absolute; inset: -7px; padding: 0; border: 0; cursor: pointer; }
.markup-widths button i { width: 18px; display: block; border-radius: 4px; background: currentColor; }
.markup-widths button:nth-child(1) i { height: 2px; }
.markup-widths button:nth-child(2) i { height: 4px; }
.markup-widths button:nth-child(3) i { height: 8px; }
.markup-delete { color: #ff8b97 !important; font-size: 22px !important; }
.markup-suggestions { min-height: 27px; display: flex; align-items: center; justify-content: center; gap: 9px; margin: -5px 0 8px; color: #8e9099; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.markup-suggestions > div { display: flex; align-items: center; gap: 6px; }
.markup-suggestions button { width: 18px; height: 18px; padding: 0; border: 2px solid #2b2e37; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px rgba(255,255,255,.18); }
.markup-suggestions button:hover { transform: scale(1.12); box-shadow: 0 0 0 2px rgba(255,255,255,.42); }
.markup-suggestions button.active { border-color: white; box-shadow: 0 0 0 2px var(--purple); }
.markup-suggestions button.recommended::after { content: ""; width: 4px; height: 4px; display: block; margin: 0 auto; border-radius: 50%; background: rgba(255,255,255,.92); box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.canvas-viewport { position: relative; width: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 4px; background: #090b0f; box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28); }
.canvas-viewport canvas { display: block; width: 100%; height: 100%; }
.canvas-viewport.has-data canvas { cursor: crosshair; }
.canvas-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 13px; background: rgba(8, 10, 15, 0.76); color: white; }
.canvas-loading > span { width: 34px; height: 34px; border: 3px solid rgba(255, 255, 255, 0.2); border-top-color: var(--purple-2); border-radius: 50%; animation: spin 0.8s linear infinite; }
.canvas-loading strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; text-transform: uppercase; }
.chart-cursor { position: absolute; z-index: 2; width: 1px; border-left: 1px dashed rgba(255, 255, 255, 0.78); pointer-events: none; filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.7)); }
.chart-cursor::after { content: ""; position: absolute; left: -4px; top: var(--point-y, 50%); width: 7px; height: 7px; border: 1px solid white; border-radius: 50%; background: var(--purple); box-shadow: 0 0 0 3px rgba(180, 90, 214, .22); }
.chart-hover-card { position: absolute; top: 8px; left: 8px; width: 188px; padding: 9px 10px; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 4px; background: rgba(13, 15, 20, .96); box-shadow: 0 8px 22px rgba(0, 0, 0, .36); color: white; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 800; }
.chart-cursor.align-right .chart-hover-card { right: 8px; left: auto; }
.chart-cursor.pinned { border-left-style:solid; border-left-color:var(--purple); }
.chart-pin-label { display:block; margin-bottom:6px; color:#dca7f0; font:800 10px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace; }
.chart-hover-card > strong { display: block; margin-bottom: 7px; color: #cfd0d6; font-size: 9px; text-transform: uppercase; }
.chart-hover-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; margin: 0; }
.chart-hover-card div { min-width: 0; }
.chart-hover-card dt { margin-bottom: 2px; color: #858894; font-size: 7px; text-transform: uppercase; }
.chart-hover-card dd { margin: 0; overflow: hidden; color: white; text-overflow: ellipsis; white-space: nowrap; }
.chart-hover-card .hover-main { min-width: 0; }
.chart-hover-card .positive { color: #2bd99f; }
.chart-hover-card .negative { color: #ff6b72; }
.export-bar { min-height: 60px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 13px; }
.export-label { margin-right: auto; color: #8e9099; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 900; }
.export-bar .button-secondary { border-color: rgba(255, 255, 255, 0.18); background: #202229; color: white; }
.export-bar .button-secondary:hover { border-color: #d28ae7; background: #2a2d35; }
.copy-glyph { position: relative; width: 14px; height: 14px; border: 2px solid currentColor; }
.copy-glyph::after { content: ""; position: absolute; width: 8px; height: 8px; left: 4px; top: 4px; border: 2px solid currentColor; background: #202229; }
.download-glyph { position: relative; width: 15px; height: 15px; border-bottom: 2px solid currentColor; }
.download-glyph::before { content: ""; position: absolute; left: 6px; top: 0; width: 2px; height: 10px; background: currentColor; }
.download-glyph::after { content: ""; position: absolute; left: 3px; top: 5px; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }

.inspector { min-width: 0; max-height: calc(100vh - 168px); overflow: auto; border-left: 1px solid rgba(255, 255, 255, 0.1); background: var(--paper); scrollbar-color: rgba(126, 38, 157, 0.35) transparent; scrollbar-width: thin; }
.inspector-section { display: grid; gap: 12px; padding: 20px 18px; border-bottom: 1px solid var(--line); background: var(--paper); }
.inspector-section:nth-of-type(even) { background: #fcf9fc; }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.section-title h2 { margin: 0; font-size: 18px; letter-spacing: 0; }
.section-title > span, .source-status { padding-top: 2px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; text-transform: uppercase; }
.remix-button { min-height: 31px; border: 1px solid var(--purple); border-radius: 3px; padding: 0 10px; background: white; color: var(--purple); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.remix-button:hover { background: var(--purple-soft); }
.source-status.loaded { color: var(--green); }
.inspector label { display: grid; gap: 6px; }
.inspector label > span, .control-label { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.inspector label em { font-style: normal; font-weight: 500; }
.inspector input[type="text"], .inspector input[type="number"], .inspector textarea, .inspector select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(32, 20, 35, 0.18);
  border-radius: 3px;
  padding: 8px 10px;
  background: #faf7fa;
  color: var(--text);
  font-size: 12px;
}
.inspector input:hover, .inspector textarea:hover, .inspector select:hover { border-color: rgba(126, 38, 157, 0.42); }
.inspector input:focus, .inspector textarea:focus, .inspector select:focus { border-color: var(--purple); background: white; box-shadow: 0 0 0 2px rgba(126, 38, 157, 0.1); outline: 0; }
.inspector textarea { min-height: 58px; resize: vertical; }
.source-form { display: grid; gap: 11px; }
.token-address-field input { min-height: 50px !important; border-color: rgba(126, 38, 157, 0.46) !important; background: white !important; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px !important; font-weight: 800; }
.network-autodetect { display: flex; align-items: center; gap: 7px; margin: -3px 0 0; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.network-autodetect span { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--purple); box-shadow: 0 0 0 3px rgba(126, 38, 157, 0.1); }
.load-chart-button { min-height: 48px; text-transform: uppercase; }
.field-grid { display: grid; gap: 9px; }
.field-grid.two { grid-template-columns: 1fr 1fr; }
.control-group { display: grid; gap: 6px; }
.headline-control { display: grid; gap: 7px; }
.headline-control-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.headline-mode-actions { display: flex; align-items: stretch; gap: 6px; }
.segmented.headline-mode { grid-template-columns: repeat(2, 62px); }
.segmented.headline-mode button { min-height: 28px; padding: 0 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; text-transform: uppercase; }
.headline-shuffle { width: 30px; min-height: 28px; border: 1px solid var(--line-strong); border-radius: 3px; background: #f2edf3; color: var(--purple); font-size: 17px; font-weight: 900; line-height: 1; }
.headline-shuffle:hover:not(:disabled) { border-color: var(--purple); background: var(--purple-soft); }
.headline-shuffle:disabled { color: #aaa0ad; cursor: default; opacity: .55; }
.headline-control > input[readonly] { border-color: rgba(126, 38, 157, 0.4); background: #f3e8f6; color: var(--text); cursor: default; }

.advanced-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 3px; background: #faf7fa; }
.advanced-panel summary { min-height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 11px; color: var(--text); font-size: 11px; font-weight: 900; list-style: none; cursor: pointer; }
.advanced-panel summary::-webkit-details-marker { display: none; }
.advanced-panel summary::after { content: "+"; color: var(--purple); font-size: 17px; }
.advanced-panel[open] summary::after { content: "−"; }
.advanced-panel summary span { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; text-transform: uppercase; }
.advanced-panel[open] summary { border-bottom: 1px solid var(--line); background: white; }
.metadata-panel > div, .metadata-panel > label { margin: 10px; }
.chart-panel > div { margin: 10px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 3px; background: #f2edf3; }
.segmented button { min-height: 38px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; font-weight: 900; }
.segmented button:last-child { border-right: 0; }
.segmented button:hover { color: var(--text); background: #ebe3ed; }
.segmented button.active { background: var(--ink); color: white; }
.segmented.compact { grid-template-columns: repeat(5, 1fr); }
.segmented.compact button { min-height: 35px; padding: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.chart-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.chart-options.single { grid-template-columns: 1fr; align-self: end; }
.chart-options label, .toggle-row label { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 3px; background: #f7f2f7; }
.chart-options input, .toggle-row input { position: absolute; opacity: 0; }
.toggle { position: relative; width: 30px; height: 18px; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 9px; background: #e6dde8; }
.toggle::after { content: ""; position: absolute; width: 12px; height: 12px; left: 2px; top: 2px; border-radius: 50%; background: var(--muted); transition: transform 0.15s; }
.chart-options input:checked + .toggle, .toggle-row input:checked + .toggle { background: var(--purple-soft); }
.chart-options input:checked + .toggle::after, .toggle-row input:checked + .toggle::after { transform: translateX(12px); background: var(--purple); }
.chart-options strong, .toggle-row strong { font-size: 10px; }
.chart-quality { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 3px; background: #14161c; color: white; }
.chart-quality > span { min-width: 0; padding: 9px 8px; border-right: 1px solid rgba(255, 255, 255, 0.1); }
.chart-quality > span:last-child { border-right: 0; }
.chart-quality small, .chart-quality strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.chart-quality small { margin-bottom: 3px; color: #92949d; font-size: 7px; font-weight: 900; text-transform: uppercase; }
.chart-quality strong { font-size: 9px; text-transform: uppercase; }

.identity-control { overflow: hidden; border: 1px solid var(--line); border-radius: 3px; background: #f7f2f7; }
.identity-profile { min-height: 58px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px; border-bottom: 1px solid var(--line); background: var(--ink); color: white; }
.identity-avatar { width: 38px; height: 38px; border-radius: 50%; font-size: 12px; }
.identity-profile small, .identity-profile strong { display: block; }
.identity-profile small { margin-bottom: 2px; color: #a4a5ac; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.identity-profile strong { overflow: hidden; text-overflow: ellipsis; font-size: 12px; white-space: nowrap; }
.identity-profile button { min-height: 30px; border: 1px solid rgba(255, 255, 255, 0.24); border-radius: 3px; padding: 0 9px; background: #242730; color: white; font-size: 10px; font-weight: 900; }
.identity-profile button:hover { border-color: #d28ae7; }
.identity-control > label { padding: 10px 10px 0; }
.handle-input { display: grid; grid-template-columns: 34px 1fr; }
.handle-input b { display: grid; place-items: center; border: 1px solid var(--line); border-right: 0; border-radius: 3px 0 0 3px; background: #ece4ee; color: var(--purple); }
.handle-input input { border-radius: 0 3px 3px 0 !important; }
.toggle-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
.toggle-row label.disabled { opacity: 0.48; }

.avatar-style-card { overflow: hidden; border: 1px solid rgba(126, 38, 157, 0.34); border-radius: 3px; background: #f5edf7; }
.avatar-style-head { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; }
.avatar-style-head small, .avatar-style-head strong { display: block; }
.avatar-style-head small { margin-bottom: 3px; color: var(--purple); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.avatar-style-head strong { font-size: 11px; }
.avatar-style-head button { min-height: 32px; flex: 0 0 auto; border: 1px solid var(--purple); border-radius: 3px; padding: 0 10px; background: white; color: var(--purple); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.avatar-style-head button:disabled { cursor: wait; opacity: .55; }
.avatar-style-card > p { margin: 0; padding: 0 10px 10px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.creator-dna { display: grid; gap: 9px; border: 1px solid var(--line); border-radius: 3px; padding: 10px; background: white; }
.creator-dna-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.creator-dna-head small, .creator-dna-head strong { display: block; }
.creator-dna-head small { margin-bottom: 3px; color: var(--purple); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.creator-dna-head strong { font-size: 11px; }
.creator-dna-head > b { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; text-transform: uppercase; }
.avatar-palettes { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(126, 38, 157, 0.2); }
.avatar-palettes button { min-width: 0; min-height: 78px; border: 0; border-right: 1px solid rgba(126, 38, 157, 0.16); padding: 8px 6px; background: white; color: var(--text); text-align: left; }
.avatar-palettes button:last-child { border-right: 0; }
.avatar-palettes button:hover { background: #f3e9f6; }
.avatar-palettes strong, .avatar-palettes small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-palettes strong { margin-top: 6px; font-size: 9px; }
.avatar-palettes small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.palette-swatches { display: grid; grid-template-columns: repeat(3, 1fr); height: 16px; overflow: hidden; border: 1px solid rgba(18, 12, 20, .16); border-radius: 2px; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 6px; }
.preset-grid button { min-width: 0; min-height: 58px; display: grid; grid-template-columns: 9px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 7px; align-content: center; border: 1px solid var(--line); border-radius: 3px; padding: 7px; background: white; color: var(--text); text-align: left; }
.preset-grid button:hover { border-color: var(--purple); background: var(--purple-soft); }
.preset-grid i { width: 9px; height: 30px; grid-row: 1 / 3; background: var(--purple); }
.preset-grid button:nth-child(1) i { background: #20d98b; }
.preset-grid button:nth-child(2) i { background: #516dff; }
.preset-grid button:nth-child(3) i { background: #ff6041; }
.preset-grid button:nth-child(4) i { background: #7e269d; }
.preset-grid button:nth-child(5) i { background: #a95bc4; }
.preset-grid button:nth-child(6) i { background: #303746; }
.preset-grid button:nth-child(7) i { background: #be4cff; }
.preset-grid button:nth-child(8) i { background: #f5c451; }
.preset-grid button:nth-child(9) i { background: #111016; }
.preset-grid button:nth-child(10) i { background: #ef66ae; }
.preset-grid strong, .preset-grid small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-grid strong { font-size: 9px; }
.preset-grid small { color: var(--muted); font-size: 7px; }
.template-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 6px; }
.template-grid button { min-width: 0; min-height: 60px; border: 1px solid var(--line); border-radius: 3px; padding: 5px; background: white; color: var(--muted); }
.template-grid button:hover { border-color: var(--purple); background: var(--purple-soft); }
.template-grid button.active { border-color: var(--purple); box-shadow: inset 0 0 0 1px var(--purple); color: var(--text); }
.template-grid i { display: block; height: 29px; margin-bottom: 5px; border-radius: 2px; background: #0b0d14; }
.template-grid .paper i { background: #eee9e2; }
.template-grid .signal i { border-top: 6px solid #ff5f3a; background: #19131d; }
.template-grid .clean i { border: 1px solid #161019; background: #f8f8f8; }
.template-grid .split i { background: linear-gradient(90deg, #b45ad6 0 40%, #0b0d14 40%); }
.template-grid .neon i { border-top: 6px solid #35e39f; background: #07100c; }
.template-grid .midnight i { border-left: 7px solid #516dff; background: #0a0d16; }
.template-grid .poster i { border: 1px solid #7e269d; background: #f4eff5; }
.template-grid .market i { border: 1px solid #687080; background: linear-gradient(180deg, #111722 0 70%, #1d2430 70%); box-shadow: inset 0 0 0 1px #111722; }
.template-grid span { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 8px; font-weight: 900; }
.color-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.color-control { min-height: 42px; display: grid; grid-template-columns: 42px 1fr; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 3px; background: #faf7fa; }
.color-control input { width: 42px !important; height: 42px; border: 0 !important; border-radius: 0 !important; padding: 3px; background: white; }
.color-control b { padding: 0 8px; color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.png-tool { overflow: hidden; border: 1px solid var(--line); border-radius: 3px; background: #faf7fa; }
.png-tool-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; }
.png-tool-head small, .png-tool-head strong { display: block; }
.png-tool-head small { margin-bottom: 3px; color: var(--purple); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.png-tool-head strong { font-size: 11px; }
.upload-button { min-height: 34px; display: grid !important; place-items: center; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 3px; background: white; color: var(--text) !important; font-family: inherit !important; font-size: 10px !important; font-weight: 900 !important; text-transform: uppercase; cursor: pointer; }
.upload-button:hover { border-color: var(--purple); }
.overlay-controls { display: grid; gap: 10px; padding: 10px; border-top: 1px solid var(--line); background: white; }
.overlay-preview { display: grid; grid-template-columns: 44px minmax(0, 1fr) 28px; align-items: center; gap: 9px; }
.overlay-preview img { width: 44px; height: 44px; object-fit: contain; border: 1px solid var(--line); background: #f4eff5; }
.overlay-preview strong, .overlay-preview small { display: block; }
.overlay-preview strong { font-size: 11px; }
.overlay-preview small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.overlay-preview button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--red); font-size: 18px; font-weight: 900; }
.position-grid { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: 3px; }
.position-grid button { height: 34px; border: 0; border-right: 1px solid var(--line); background: #faf7fa; color: var(--muted); font-size: 15px; }
.position-grid button:last-child { border-right: 0; }
.position-grid button.active { background: var(--ink); color: white; }
.range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.range-row input, .annotation-form input[type="range"], .range-control input[type="range"] { width: 100%; accent-color: var(--purple); }
.range-control { display: grid; gap: 7px; }
.range-control > span { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.range-control > span b { color: var(--text); font-size: 9px; }
.look-panel > div { margin: 10px; }

.markers-section { padding: 0; }
.markers-section > summary { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; list-style: none; cursor: pointer; }
.markers-section > summary::-webkit-details-marker { display: none; }
.markers-section > summary small, .markers-section > summary strong { display: block; }
.markers-section > summary small { margin-bottom: 4px; color: var(--purple); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.markers-section > summary strong { font-size: 13px; }
.markers-section > summary b { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.annotation-form, .annotation-list { display: grid; gap: 10px; margin: 0 18px 14px; }
.marker-help { min-height: 27px; margin: 0; padding: 7px 8px; border-left: 3px solid var(--purple); background: var(--purple-soft); color: var(--muted); font-size: 9px; font-weight: 700; line-height: 1.35; }
.annotation-item { display: grid; grid-template-columns: 24px minmax(0, 1fr) 24px; align-items: center; gap: 7px; padding: 7px; border: 1px solid var(--line); border-radius: 3px; background: #faf7fa; font-size: 10px; }
.annotation-item i { width: 18px; height: 18px; display: grid; place-items: center; background: var(--purple); color: white; font-style: normal; font-weight: 900; }
.annotation-item i.buy { background: #16a36f; }
.annotation-item i.sell { background: #eb553b; }
.annotation-item button { border: 0; background: transparent; color: var(--muted); font-weight: 900; }
.draw-section { padding: 0; }
.draw-section > summary { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; list-style: none; cursor: pointer; }
.draw-section > summary::-webkit-details-marker { display: none; }
.draw-section > summary small, .draw-section > summary strong { display: block; }
.draw-section > summary small { margin-bottom: 4px; color: var(--purple); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.draw-section > summary strong { font-size: 13px; }
.draw-section > summary b { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.drawing-editor { display: grid; gap: 11px; padding: 0 18px 16px; }
.drawing-tools { display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 3px; }
.drawing-tools button { min-height: 38px; border: 0; border-right: 1px solid var(--line); background: #faf7fa; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.drawing-tools button:last-child { border-right: 0; }
.drawing-tools button:hover { color: var(--text); background: var(--purple-soft); }
.drawing-tools button.active { background: var(--ink); color: white; }
.drawing-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.color-control.compact { grid-template-columns: 36px 1fr; min-height: 36px; }
.color-control.compact input { width: 36px !important; height: 36px; }
.drawing-help { min-height: 32px; margin: 0; padding: 8px 9px; border-left: 3px solid var(--purple); background: var(--purple-soft); color: var(--muted); font-size: 9px; font-weight: 700; line-height: 1.4; }
.drawing-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.drawing-actions .button { min-height: 38px; }
.drawing-actions #drawing-toggle.active { border-color: var(--purple); background: var(--purple-soft); color: var(--purple); }
.canvas-viewport.drawing-active canvas { cursor: crosshair; touch-action: none; }
.canvas-viewport.drawing-active[data-drawing-tool="select"] canvas { cursor: default; }
.canvas-viewport.drawing-active[data-drawing-tool="select"].drawing-selected canvas { cursor: move; }
.delete-project { width: calc(100% - 36px); min-height: 40px; margin: 16px 18px; border: 1px solid rgba(179, 43, 72, 0.4); border-radius: 3px; background: transparent; color: var(--red); font-weight: 800; }
.delete-project:hover { border-color: var(--red); background: rgba(184, 47, 75, 0.06); }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 11px 16px; border: 1px solid var(--text); border-radius: 3px; background: var(--paper); box-shadow: 0 12px 28px rgba(29, 14, 32, 0.18); font-size: 12px; font-weight: 900; opacity: 0; pointer-events: none; transition: 0.18s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

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

@media (max-width: 1320px) {
  .studio-layout { grid-template-columns: 180px minmax(520px, 1fr) 340px; }
  .studio-shell { width: min(100% - 16px, 1580px); }
  .project-item { grid-template-columns: 32px minmax(0, 1fr); padding: 7px; }
  .project-thumb { width: 32px; height: 32px; }
}

@media (max-width: 1050px) {
  .site-bar { grid-template-columns: 1fr auto; top: 6px; }
  .primary-nav { grid-row: 2; grid-column: 1 / -1; min-height: 42px; border-top: 1px solid var(--line); }
  .primary-nav a { min-width: 0; flex: 1; }
  .studio-layout { display: flex; flex-direction: column; overflow: visible; }
  .editor-stage { order: -1; min-height: 0; padding: 14px; }
  .project-rail { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
  .project-list { flex-direction: row; overflow-x: auto; padding: 0 11px 12px; }
  .project-item { flex: 0 0 180px; }
  .rail-foot { display: none; }
  .inspector { max-height: none; border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; }
  .source-section { grid-row: span 2; }
  .markers-section, .draw-section, .delete-project { align-self: start; }
}

@media (max-width: 680px) {
  .studio-shell { width: 100%; padding: 0 0 24px; }
  .site-bar { top: 0; border-left: 0; border-right: 0; border-radius: 0; }
  .brand { font-size: 12px; }
  .site-meta { display: flex; }
  .profile-button { width: 38px; padding: 3px; }
  .profile-button #profile-name { display: none; }
  .profile-avatar { width: 30px; height: 30px; }
  .studio-head { padding: 20px 14px 13px; }
  .studio-head h1 { font-size: 32px; }
  .save-state { display: none; }
  .head-actions .button { width: 42px; padding: 0; font-size: 0; }
  .head-actions .button span { font-size: 20px; }
  .editor-stage { padding: 12px 9px 14px; }
  .editor-head { min-height: 48px; flex-wrap: wrap; gap: 10px; }
  .editor-tools { width: 100%; justify-content: space-between; gap: 6px; }
  .stage-timeframe button { width: 34px; }
  .editor-head input { font-size: 16px; }
  .markup-toolbar { justify-content: flex-start; gap: 2px; margin-bottom: 8px; padding: 4px; }
  .markup-tool-group, .markup-widths { gap: 1px; }
  .markup-toolbar button { width: 28px; }
  .markup-widths button { width: 25px; }
  .markup-color { width: 25px; height: 25px; }
  .markup-divider { margin: 0 1px; }
  .markup-suggestions { margin-top: -4px; }
  .canvas-size strong { display: none; }
  .export-bar { display: grid; grid-template-columns: 1fr 1fr 1fr; }
  .export-label { grid-column: 1 / -1; }
  .export-bar .button { min-height: 44px; padding: 0 8px; font-size: 11px; }
  .project-rail { padding: 0; }
  .rail-head { min-height: 67px; }
  .inspector { display: block; }
  .inspector-section { padding: 18px 14px; }
  .markers-section { padding: 0; }
  .draw-section { padding: 0; }
  .template-grid { grid-template-columns: repeat(4, 1fr); }
  .field-grid.two, .toggle-row, .color-fields { grid-template-columns: 1fr 1fr; }
  .chart-quality { grid-template-columns: 1fr 1fr; }
  .chart-quality > span:nth-child(2) { border-right: 0; }
  .chart-quality > span:nth-child(-n + 2) { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
}

@media (max-width: 420px) {
  .primary-nav a { padding: 0 6px; font-size: 11px; }
  .template-grid, .preset-grid { grid-template-columns: repeat(2, 1fr); }
  .field-grid.two, .color-fields, .range-row { grid-template-columns: 1fr; }
  .drawing-settings { grid-template-columns: 1fr; }
}
