.sd3-dialog {
  --sd3-bg: #edf2ef;
  --sd3-paper: #fbfcfa;
  --sd3-line: #d6e1db;
  --sd3-ink: #17342d;
  --sd3-muted: #4c665d;
  --sd3-accent: #126650;
  color: var(--sd3-ink);
  font-family: var(--font-ui, 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif);
}
.sd3-dialog { width: min(1260px, calc(100vw - 42px)); max-width: none; max-height: calc(100dvh - 52px); border: 1px solid var(--sd3-line); border-radius: 18px; padding: 0; box-shadow: 0 32px 110px #051b1e75; background: var(--sd3-bg); }
.sd3-dialog::backdrop { background: #0b28376e; backdrop-filter: blur(6px); }
.sd3-shell *, .sd3-chart * { box-sizing: border-box; }
.sd3-header { display: flex; align-items: center; justify-content: space-between; padding: 19px clamp(18px, 3vw, 36px); border-bottom: 1px solid var(--sd3-line); }
.sd3-header span { color: var(--sd3-accent); font-size: 12px; font-weight: 680; }
.sd3-header h1 { margin: 2px 0 0; font-size: clamp(25px, 2.5vw, 32px); line-height: 1.1; font-weight: 660; letter-spacing: -.04em; }
.sd3-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(238px, 285px); gap: 18px; padding: clamp(12px, 2vw, 28px); align-items: start; }
.sd3-preview { position: relative; min-width: 0; aspect-ratio: 16 / 9; border-radius: 13px; overflow: hidden; isolation: isolate; background: #092f44; }
.sd3-art-frame { display: block; width: 100%; height: 100%; object-fit: contain; touch-action: none; cursor: grab; }
.sd3-art-frame[hidden] { visibility: hidden; }
.sd3-art-frame:active { cursor: grabbing; }
.sd3-preview-tools { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; position: absolute; top: 12px; right: 12px; left: 12px; pointer-events: none; }
.sd3-preview-tools button { pointer-events: auto; }
.sd3-controls { position: absolute; margin: 0; inset: auto auto 10px 11px; max-width: calc(100% - 22px); color: #ddf3ed; background: #0a2a36e8; padding: 7px 10px; border-radius: 7px; font-size: 11px; line-height: 1.35; }
.sd3-panel { display: grid; gap: 13px; padding: 15px; border: 1px solid var(--sd3-line); border-radius: 13px; background: var(--sd3-paper); }
.sd3-panel label { min-width: 0; display: grid; gap: 5px; color: var(--sd3-muted); font-size: 12px; font-weight: 600; }
.sd3-panel :is(input,select), .sd3-shell button { font: inherit; min-height: 34px; color: var(--sd3-ink); border: 1px solid var(--sd3-line); border-radius: 7px; background: var(--sd3-paper); }
.sd3-panel :is(select,input[type=number]) { padding: 5px 7px; width: 100%; font-size: 13px; }
.sd3-panel input[type=range] { min-height: 19px; margin: 0; width: 100%; accent-color: var(--sd3-accent); }
.sd3-panel input[type=color] { width: 100%; min-height: 28px; padding: 3px; cursor: pointer; }
.sd3-color-row { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sd3-shell button, .sd3-chart button { cursor: pointer; padding: 6px 10px; font-size: 12px; font-weight: 640; }
.sd3-shell button:disabled { cursor: default; opacity: .48; }
.sd3-shell :is(button, input, select, img):focus-visible, .sd3-chart :is(button, .sd3-chart-plot):focus-visible { outline: 2px solid #4fa990; outline-offset: 2px; }
.sd3-preview-tools button { min-height: 27px; background: #092b38df; color: #ecf7f6; border-color: #c9eff04a; }
.sd3-preview-tools button:hover { background: #214852; }
.sd3-export { display: flex; gap: 6px; flex-wrap: wrap; }
.sd3-export button { flex: 1 0 auto; }
.sd3-export button:last-child { background: var(--sd3-accent); color: #fff; border-color: var(--sd3-accent); }
.sd3-status { margin: 0; color: var(--sd3-muted); font-size: 11.5px; line-height: 1.45; }
.sd3-chart { position: relative; min-width: 0; color: #17342d; }
.sd3-chart svg { display: block; aspect-ratio: 900 / 423; width: 100%; height: auto; max-height: 46cqh; border-radius: 7px; }
.sd3-chart-plot { touch-action: none; cursor: grab; }
.sd3-chart-tools { display: flex; justify-content: center; gap: 3px; margin-top: 3px; }
.sd3-chart-tools button { padding: 3px 6px; background: #f5f9f6; border: 1px solid #baced0; color: #1d5244; border-radius: 4px; font-size: 9px; white-space: nowrap; }
.sd3-chart[data-static] .sd3-chart-tools { display: none; }
@media (max-width: 770px) {
  .sd3-dialog { width: calc(100vw - 18px); max-height: calc(100dvh - 22px); border-radius: 13px; }
  .sd3-workspace { grid-template-columns: 1fr; gap: 11px; }
  .sd3-preview { aspect-ratio: 5 / 4; }
  .sd3-controls { font-size: 10px; }
}
