:root {
  color-scheme: dark;
  --bg: #090e13;
  --panel: #10171e;
  --panel-raised: #151f27;
  --panel-soft: #0c1319;
  --ink: #ecf5f2;
  --muted: #83949c;
  --quiet: #62727a;
  --line: #25333b;
  --line-soft: #1d2a32;
  --lime: #c6ff52;
  --cyan: #5be4ee;
  --violet: #b69bff;
  --range-track-empty: #34433d;
  --range-track-fill: #a1d34b;
  --sans: 'Space Grotesk', 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 52% 0%, #15212a 0, transparent 45%), var(--bg); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
::selection { color: #081014; background: var(--lime); }

.topbar { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 max(20px, calc((100% - 1370px) / 2)); border-bottom: 1px solid var(--line-soft); background: rgb(9 14 19 / 88%); backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; letter-spacing: -.06em; }
.brand-muted { color: #81918c; }
.brand-mark { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 6px; background: var(--lime); color: #111a17; font-size: 12px; }
.breadcrumb { color: #72828a; font: 8px var(--mono); letter-spacing: .1em; }
.breadcrumb b { color: #3e5158; margin: 0 8px; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.top-actions .preference-controls { display: inline-flex; align-items: center; gap: 4px; }
.top-actions .preference-button { min-width: 30px; height: 27px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 7px; border: 1px solid #34454b; border-radius: 4px; background: #121c22; color: #dbe7df; cursor: pointer; font: 7px var(--mono); }
.top-actions .preference-button:hover { border-color: var(--lime); color: var(--lime); }
.top-actions .preference-button [data-theme-icon] { color: var(--lime); font: 14px var(--sans); }
.top-actions .language-button { min-width: 44px; }
.top-actions .language-button span:last-child { color: #788b8d; font-size: 9px; }
.itch-link { color: var(--lime); font-size: 10px; font-weight: 700; }
.itch-link span { margin-left: 4px; font-size: 13px; }
.store-link { color: #92a0a4; font: 8px var(--mono); }
.store-link:hover, .app-footer a:hover { color: var(--lime); }

.app-shell { width: min(1440px, calc(100% - 36px)); margin: 0 auto; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: 26px 4px 18px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #8da097; font: 8px var(--mono); letter-spacing: .13em; }
.pulse, .heading-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px rgb(198 255 82 / 60%); }
.eyebrow-code { margin-left: 8px; color: #586a70; }
.intro h1 { margin: 10px 0 6px; font-size: clamp(32px, 4.3vw, 50px); line-height: .98; letter-spacing: -.075em; font-weight: 700; }
.intro h1 > span:first-child { color: var(--lime); }
.title-mark { color: var(--cyan); }
.intro p { max-width: 620px; margin: 0; color: #9aa9ac; font-size: 11px; line-height: 1.65; }
.intro-stats { display: flex; align-items: center; gap: 13px; padding: 11px 13px; border: 1px solid #22323a; border-radius: 5px; background: rgb(15 23 29 / 70%); color: #788990; font: 8px var(--mono); white-space: nowrap; }
.intro-stats b { color: var(--lime); font-size: 11px; font-weight: 500; }
.intro-stats i { width: 1px; height: 14px; background: #2a3940; }

.workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(390px, 36%); height: min(78vh, 820px); min-height: 540px; border: 1px solid #293840; border-radius: 8px; overflow: hidden; background: #0d141a; box-shadow: 0 24px 90px rgb(0 0 0 / 26%); }
.preview-side { min-width: 0; min-height: 0; padding: 14px 17px 12px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: linear-gradient(135deg, rgb(17 27 34 / 55%), transparent 50%), #0b1217; }
.panel-heading, .preview-toolbar { min-height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.panel-heading { color: #95a4a6; font: 9px var(--mono); letter-spacing: .11em; }
.heading-dot { width: 5px; height: 5px; margin-right: 6px; vertical-align: 1px; }
.live-state { display: inline-flex; align-items: center; gap: 6px; color: #8f9e9d; font-size: 8px; }
.live-state i { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 9px rgb(91 228 238 / 65%); }
.live-state b { font-weight: 400; }
.preview-toolbar { margin-top: 11px; padding-bottom: 11px; border-bottom: 1px solid #1c2a31; }
.preview-tabs { display: flex; gap: 4px; }
.preview-tab { min-height: 32px; padding: 0 12px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: #718087; cursor: pointer; font: 8px var(--mono); letter-spacing: .06em; }
.preview-tab:hover { color: #c9d6d3; }
.preview-tab[aria-pressed="true"] { border-color: #34434a; background: #19242b; color: var(--lime); }
.resolution-readout { color: #74858b; font: 7px var(--mono); letter-spacing: .08em; }
.resolution-readout span { color: #d0dfd8; }
.preview-stage { min-height: 0; flex: 1; position: relative; isolation: isolate; display: grid; place-items: center; overflow: hidden; margin: 10px 0 9px; border: 1px solid #263941; border-radius: 5px; background-color: #0a1116; background-image: linear-gradient(rgb(91 228 238 / 5%) 1px, transparent 1px), linear-gradient(90deg, rgb(91 228 238 / 5%) 1px, transparent 1px), radial-gradient(ellipse at center, #18252b 0, #0a1116 70%); background-size: 22px 22px, 22px 22px, auto; }
.preview-stage::before { content: ''; position: absolute; z-index: -1; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent 49.9%, rgb(91 228 238 / 8%) 50%, transparent 50.1%), linear-gradient(transparent 49.9%, rgb(91 228 238 / 8%) 50%, transparent 50.1%); }
.preview-stage canvas { display: block; max-width: min(94%, 760px); max-height: 88%; border: 1px solid rgb(255 255 255 / 13%); border-radius: 3px; box-shadow: 0 0 0 8px rgb(5 10 13 / 45%), 0 20px 60px rgb(0 0 0 / 35%), 0 0 28px rgb(91 228 238 / 7%); image-rendering: auto; }
.preview-stage #pattern-canvas, .preview-stage #repeat-canvas { background-color: #f3f3f3; background-image: linear-gradient(45deg, #d8d8d8 25%, transparent 25%, transparent 75%, #d8d8d8 75%), linear-gradient(45deg, #d8d8d8 25%, transparent 25%, transparent 75%, #d8d8d8 75%); background-position: 0 0, 8px 8px; background-size: 16px 16px; }
.preview-stage #repeat-canvas { width: min(94%, 760px); max-width: 94%; max-height: 88%; }
.preview-stage canvas[hidden] { display: none; }
.stage-corner { position: absolute; bottom: 13px; color: #657a80; font: 7px var(--mono); letter-spacing: .1em; }
.stage-corner-left { left: 14px; }
.stage-corner-left span { color: var(--lime); }
.stage-corner-right { right: 14px; }
.stage-crosshair { position: absolute; top: 13px; right: 14px; color: #48616a; font: 13px var(--mono); }
.preview-caption { display: flex; align-items: center; gap: 8px; color: #84949a; font-size: 8px; line-height: 1.5; }
.caption-icon { color: var(--cyan); font-size: 13px; }
.frame-readout { margin-left: auto; display: flex; align-items: center; gap: 6px; color: #5f7379; font: 7px var(--mono); white-space: nowrap; }
.frame-readout b { color: #a3b3ad; font-weight: 400; }
.frame-readout i { width: 3px; height: 3px; border-radius: 50%; background: #4a6870; }

.controls { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 0; overflow: hidden; overscroll-behavior: contain; padding: 12px 14px 10px; background: #10181f; scrollbar-color: #46594d transparent; scrollbar-width: thin; container-type: inline-size; }
.controls-head { display: flex; justify-content: space-between; align-items: start; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.controls-head-tools { display: flex; align-items: center; gap: 8px; }
.autosave-indicator { max-width: 145px; color: #91a09f; font: 7px var(--mono); text-align: right; }
.autosave-indicator::before { content: '●'; margin-right: 5px; color: var(--lime); }
.autosave-indicator[data-state="saving"]::before, .autosave-indicator[data-state="loading"]::before { color: var(--cyan); }
.autosave-indicator[data-state="error"]::before { color: #ff6e78; }
.eyebrow-small { color: #718188; font: 8px var(--mono); letter-spacing: .12em; }
.controls-head h2 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.04em; }
.control-symbol { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #39484a; border-radius: 50%; color: var(--lime); font-size: 16px; }
.control-tabs { flex: 0 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin: 9px 0 2px; }
.control-tabs button { min-width: 0; min-height: 35px; padding: 0 4px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-soft); color: var(--muted); cursor: pointer; font: 8px var(--mono); transition: border-color .16s ease, color .16s ease, background .16s ease; }
.control-tabs button:hover { border-color: #657963; color: var(--ink); }
.control-tabs button[aria-selected="true"] { border-color: var(--lime); background: color-mix(in srgb, var(--lime) 10%, var(--panel)); color: var(--lime); }
.control-group { padding: 12px 0 11px; border-bottom: 1px solid var(--line-soft); }
.control-group:not([data-control-active="true"]) { display: none; }
.control-group[data-control-active="true"] { display: block; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 3px; border-bottom: 0; overscroll-behavior: contain; scrollbar-color: #46594d transparent; scrollbar-width: thin; }
.control-group[data-control-active="true"] .group-title { margin-bottom: 6px; }
.control-group[data-control-active="true"] .field-label { margin-bottom: 5px; }
.group-title { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; color: #839399; font: 8px var(--mono); letter-spacing: .11em; }
.group-number { color: var(--cyan); font-size: 9px; }
.group-rule { height: 1px; flex: 1; background: #27353a; }
.field-label { display: block; margin: 0 0 7px; color: #a6b2b1; font-size: 10px; font-weight: 500; }
.icon-style-field { margin-top: 10px; }
.icon-style-field[hidden] { display: none; }
.icon-picker-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.icon-picker-heading .field-label { margin-bottom: 7px; }
.icon-active-count { color: var(--cyan); font: 7px var(--mono); white-space: nowrap; }
.icon-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.icon-choice { min-width: 0; min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 4px 7px; border: 1px solid #2a3940; border-radius: 4px; background: #0c1318; color: #a8b5b2; text-align: left; cursor: pointer; font-size: 8px; }
.icon-choice:hover { border-color: #667b68; color: #e5eee8; }
.icon-choice[aria-pressed="true"] { border-color: #78984c; background: #16221a; color: #dcebd4; box-shadow: inset 0 0 0 1px rgb(198 255 82 / 8%); }
.icon-choice[aria-pressed="true"]::after { content: '✓'; flex: 0 0 auto; margin-left: auto; color: var(--lime); font-size: 10px; }
.icon-choice > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-choice-glyph { width: 22px; flex: 0 0 22px; color: var(--lime); font-size: 17px; line-height: 1; text-align: center; }
.icon-custom-card { min-width: 0; position: relative; }
.icon-custom-card .icon-choice { width: 100%; padding-right: 29px; }
.icon-choice-image { width: 22px; height: 22px; flex: 0 0 22px; object-fit: contain; }
.icon-remove-button { position: absolute; top: 50%; right: 5px; width: 23px; height: 23px; transform: translateY(-50%); border: 1px solid #39484a; border-radius: 4px; background: #121b20; color: #aebbb7; cursor: pointer; font-size: 16px; line-height: 1; }
.icon-remove-button:hover { border-color: #df5472; color: #ff91a4; }
.icon-upload-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.icon-upload-button { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px dashed #51675b; border-radius: 4px; background: #111b1c; color: var(--lime); cursor: pointer; font-size: 8px; }
.icon-upload-button:hover, .icon-upload-button:focus-within { border-color: var(--lime); background: #17221b; }
.icon-upload-button > span:first-child { font-size: 15px; }
.icon-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
.icon-tint-control { min-width: 0; display: inline-flex; align-items: center; gap: 5px; color: #9ba9a5; font-size: 8px; cursor: pointer; }
.icon-tint-control[hidden] { display: none; }
.icon-tint-control input { width: 14px; height: 14px; margin: 0; accent-color: var(--lime); cursor: pointer; }
.icon-upload-help { margin: 6px 0 0; color: #71817d; font-size: 8px; line-height: 1.45; }
.icon-upload-status { margin: 5px 0 0; color: #95b875; font-size: 8px; line-height: 1.4; }
.icon-upload-status:empty { display: none; }
.pattern-image-field { margin-top: 10px; }
.pattern-image-field[hidden] { display: none; }
.pattern-image-upload-row { display: flex; align-items: center; gap: 7px; }
.pattern-image-upload-button { flex: 1; justify-content: center; }
.pattern-image-options:empty { display: none; }
.pattern-image-card .icon-choice { min-height: 42px; }
.pattern-image-card .icon-choice-image { width: 28px; height: 28px; flex-basis: 28px; border-radius: 2px; background-color: #172229; background-image: linear-gradient(45deg, #26353b 25%, transparent 25%, transparent 75%, #26353b 75%), linear-gradient(45deg, #26353b 25%, transparent 25%, transparent 75%, #26353b 75%); background-position: 0 0, 5px 5px; background-size: 10px 10px; }
.pattern-image-layout-field { margin-top: 9px; }
.pattern-image-help { margin: 6px 0 0; color: #71817d; font-size: 8px; line-height: 1.45; }
.custom-colors.image-pattern { grid-template-columns: minmax(0, 1fr); }
.custom-colors.image-pattern #swap-colors, .custom-colors.image-pattern #foreground-color-field { display: none; }
.stripe-angle-field[hidden] { display: none; }
#motion-waves-field[hidden], #motion-direction-field[hidden], #motion-amount-field[hidden] { display: none; }
.motion-scroll-note { margin: 8px 0 0; padding: 8px 10px; border-left: 2px solid var(--lime); background: color-mix(in srgb, var(--lime) 7%, transparent); color: #9ba9a7; font-size: 9px; line-height: 1.45; }
.select-wrap { position: relative; display: block; }
.select-wrap select { appearance: none; width: 100%; height: 36px; padding: 0 27px 0 10px; border: 1px solid #2b3a41; border-radius: 4px; background: #0b1217; color: #d9e5e1; font-size: 10px; cursor: pointer; }
.select-wrap select:focus { border-color: #6c9d55; }
.select-wrap > span, .select-wrap > i { pointer-events: none; position: absolute; top: 10px; right: 10px; color: #82908e; font: normal 12px var(--mono); }
.palette-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.palette-chip { min-width: 0; height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 7px; border: 1px solid #2a383e; border-radius: 4px; background: #0c1318; color: #8b9a9a; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.palette-chip:hover { border-color: #667b68; }
.palette-chip:disabled { opacity: .55; cursor: wait; }
.palette-chip[aria-pressed="true"] { border-color: var(--lime); background: #152019; color: #d8e5d1; }
.palette-chip i { width: 18px; height: 18px; flex: 0 0 18px; border-radius: 3px; background: conic-gradient(var(--palette-fg) 0 25%, var(--palette-accent-2, var(--palette-fg)) 0 50%, var(--palette-accent-3, var(--palette-bg)) 0 75%, var(--palette-accent-4, var(--palette-bg)) 0); box-shadow: 0 0 8px color-mix(in srgb, var(--palette-fg), transparent 78%); }
.palette-chip span { overflow: hidden; font: 7px var(--mono); letter-spacing: .02em; text-overflow: ellipsis; }
.custom-colors { display: grid; grid-template-columns: minmax(0,1fr) 34px minmax(0,1fr); align-items: end; gap: 9px; margin-top: 12px; }
.background-opacity-control { margin-top: 9px; }
.background-opacity-help { margin: 2px 0 0; color: #718078; font-size: 8px; line-height: 1.4; }
.color-field { min-width: 0; display: flex; flex-direction: column; gap: 6px; color: #708087; font: 8px var(--mono); letter-spacing: .06em; }
.color-well { min-width: 0; height: 36px; display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 5px; border: 1px solid #2a3940; border-radius: 4px; background: #0a1116; }
.color-well input { width: 25px; height: 25px; flex: 0 0 25px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.color-well input::-webkit-color-swatch-wrapper { padding: 0; }
.color-well input::-webkit-color-swatch { border: 1px solid rgb(255 255 255 / 15%); border-radius: 2px; }
.color-well code { overflow: hidden; color: #adbbb7; font: 8px var(--mono); text-overflow: ellipsis; }
.swap-button { width: 34px; height: 34px; border: 1px solid #2b3b40; border-radius: 4px; background: #141e23; color: var(--cyan); font-size: 17px; cursor: pointer; }
.swap-button:hover { color: var(--lime); border-color: #718a5d; }

.range-heading { display: flex; justify-content: space-between; margin-top: 6px; color: #a2b0ad; font-size: 10px; }
.range-heading b { color: var(--lime); font: 9px var(--mono); font-weight: 500; }
.range-input { appearance: none; width: 100%; height: 22px; margin: 2px 0 1px; border: 0; border-radius: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.range-input::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: var(--range-track-empty); }
.range-input::-moz-range-track { height: 6px; border-radius: 99px; background: var(--range-track-empty); }
.range-input::-webkit-slider-thumb { appearance: none; width: 17px; height: 17px; margin-top: -5.5px; border: 3px solid #d8ff8b; border-radius: 50%; background: #18251d; box-shadow: 0 0 0 2px #31472f, 0 0 10px rgb(198 255 82 / 35%); }
.range-input::-moz-range-thumb { width: 11px; height: 11px; border: 3px solid #d8ff8b; border-radius: 50%; background: #18251d; box-shadow: 0 0 0 2px #31472f; }
.speed-input::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--range-track-fill) 0 var(--range-progress, 43%), var(--range-track-empty) var(--range-progress, 43%) 100%); }
.speed-input::-moz-range-track { background: linear-gradient(90deg, var(--range-track-fill) 0 var(--range-progress, 43%), var(--range-track-empty) var(--range-progress, 43%) 100%); }
.range-ends { display: flex; justify-content: space-between; color: #718078; font: 7px var(--mono); }
.range-secondary { margin-top: 10px; }

.export-group { padding-bottom: 11px; }
.export-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.select-field { display: flex; flex-direction: column; gap: 6px; color: #91a09f; font-size: 9px; }
.select-field .select-wrap select { height: 36px; padding-left: 10px; font-size: 10px; }
.select-field .select-wrap > i { top: 10px; right: 9px; font-size: 10px; }
.dimension-input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid #2b3a41; border-radius: 4px; background: #0b1217; color: #d9e5e1; font-size: 10px; }
.export-options-bottom { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; margin-top: 11px; }
.export-options-bottom .select-field .select-wrap select { height: 36px; }
.export-limit-help { grid-column: 1 / -1; margin: -3px 0 0; color: #718078; font-size: 8px; line-height: 1.35; }
.motion-toggle { display: flex; align-items: center; justify-content: space-between; min-height: 36px; padding: 0 2px; }
.motion-toggle-export { margin-top: 12px; }
.motion-toggle > span:first-child { display: flex; flex-direction: column; gap: 3px; }
.motion-toggle b { color: #aab7b2; font-size: 9px; font-weight: 500; }
.motion-toggle small { color: #81908f; font-size: 8px; }
.switch { position: relative; width: 38px; height: 22px; flex: 0 0 38px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border: 1px solid #35464b; border-radius: 99px; background: #182329; pointer-events: none; transition: .2s ease; }
.switch i::before { content: ''; position: absolute; width: 12px; height: 12px; top: 4px; left: 4px; border-radius: 50%; background: #718087; transition: .2s ease; }
.switch input:checked + i { border-color: #749544; background: #26391d; }
.switch input:checked + i::before { transform: translateX(16px); background: var(--lime); box-shadow: 0 0 7px rgb(198 255 82 / 55%); }
.loop-note { display: flex; align-items: center; gap: 7px; margin-top: 11px; padding: 9px 10px; border: 1px solid #283a37; border-radius: 4px; background: #0c1717; color: #a0afaa; font-size: 9px; }
.loop-note > span:first-child { color: var(--lime); font: 14px var(--sans); }
.loop-note b { color: #d9e6ce; font-weight: 500; }
.seam-badge { margin-left: auto; color: var(--cyan); font: 7px var(--mono); letter-spacing: .06em; white-space: nowrap; }
.action-row { display: grid; grid-template-columns: .95fr .95fr 1.5fr; gap: 8px; margin-top: 14px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 4px; cursor: pointer; font: 9px var(--mono); letter-spacing: .03em; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .48; cursor: wait; transform: none; }
.button-quiet { border-color: #2a383e; background: #141e24; color: #9aa8a6; }
.button-quiet span { font-size: 13px; }
.button-secondary { border-color: #3b5554; background: #152a2c; color: var(--cyan); }
.button-primary { min-height: 44px; background: var(--lime); color: #101a14; font-weight: 600; }
.button-primary:hover { background: #dcff9e; }
.button-primary > span:last-child, .button-secondary span { font-size: 12px; }
.record-dot { width: 6px; height: 6px; border-radius: 50%; background: #df5472; box-shadow: 0 0 7px rgb(223 84 114 / 60%); }
.export-status { min-height: 16px; margin: 9px 0 0; color: #81908f; text-align: center; font-size: 8px; }
#gif-progress { appearance: none; width: 100%; height: 3px; margin-top: 8px; border: 0; border-radius: 99px; background: #233139; }
#gif-progress::-webkit-progress-bar { border-radius: 99px; background: #233139; }
#gif-progress::-webkit-progress-value { border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--lime)); }
#gif-progress::-moz-progress-bar { border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--lime)); }

.workflow-strip { display: grid; grid-template-columns: 1fr 20px 1fr 20px 1fr auto; align-items: center; gap: 14px; margin: 17px 0 0; padding: 14px 17px; border: 1px solid #202e35; border-radius: 5px; background: #0d1419; }
.workflow-strip > div { display: grid; grid-template-columns: 22px 1fr; gap: 2px 7px; align-items: center; }
.workflow-strip > div > span { grid-row: span 2; color: var(--cyan); font: 8px var(--mono); }
.workflow-strip b { color: #b7c5c0; font: 7px var(--mono); letter-spacing: .09em; }
.workflow-strip small { color: #68787e; font-size: 7px; }
.workflow-strip > i { color: #465a60; font: 12px var(--mono); font-style: normal; }
.workflow-strip > a { color: var(--lime); font: 7px var(--mono); letter-spacing: .04em; text-align: right; }
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 4px 22px; color: #68787e; font: 7px var(--mono); letter-spacing: .08em; }
.footer-brand { display: inline-flex; align-items: center; gap: 7px; color: #d8e4df; font: 700 9px var(--sans); letter-spacing: -.03em; }
.footer-brand .brand-mark { width: 19px; height: 19px; border-radius: 4px; font-size: 9px; }
.app-footer b { color: var(--cyan); font-weight: 400; }
.app-footer > div { display: flex; gap: 17px; }
.app-footer a { color: #9aa9a6; }

:root.embedded-app .topbar { min-height: 46px; padding-inline: 14px; }
:root.embedded-app .breadcrumb, :root.embedded-app .store-link,
:root.embedded-app .intro, :root.embedded-app .workflow-strip, :root.embedded-app .app-footer { display: none; }
:root.embedded-app .app-shell { width: 100%; max-width: none; margin: 0; }
:root.embedded-app .workbench { height: calc(100vh - 46px); min-height: 420px; border: 0; border-radius: 0; }
:root.embedded-app .preview-side { padding: 12px 14px; }
:root.embedded-app .controls { padding: 12px 16px; }

@media (max-width: 1050px) {
  .workbench { grid-template-columns: minmax(0, 1fr) minmax(370px, 40%); }
  .app-shell { width: min(100% - 30px, 1440px); }
  .intro-stats { display: none; }
}

@media (max-width: 720px) {
  .topbar { padding-inline: 16px; }
  .breadcrumb { display: none; }
  .workbench { height: auto; min-height: 0; grid-template-columns: 1fr; }
  .preview-side { min-height: 610px; border-right: 0; border-bottom: 1px solid var(--line); }
  .preview-stage { min-height: 440px; }
  .controls { overflow: visible; padding: 15px 18px; }
  .action-row { grid-template-columns: 1fr 1fr; }
  .button-primary { grid-column: 1 / -1; }
  :root.embedded-app .workbench { height: auto; min-height: 0; }
  :root.embedded-app .preview-side { min-height: 0; }
  :root.embedded-app .controls { overflow: visible; }
  .workflow-strip { grid-template-columns: 1fr 18px 1fr 18px 1fr; }
  .workflow-strip > a { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid #202e35; text-align: left; }
}

@media (max-width: 520px) {
  .topbar { min-height: 56px; padding-inline: 14px; }
  .top-actions { gap: 10px; }
  .itch-link { font-size: 8px; }
  .store-link { font-size: 7px; }
  .app-shell { width: calc(100% - 24px); }
  .intro { padding: 34px 3px 20px; }
  .intro h1 { font-size: clamp(31px, 9vw, 43px); }
  .intro p { font-size: 10px; }
  .eyebrow { font-size: 7px; }
  .eyebrow-code { margin-left: 2px; }
  .preview-side { min-height: 400px; padding: 13px 12px; }
  .preview-stage { min-height: 270px; }
  .preview-stage canvas { max-width: 88%; max-height: 82%; }
  .preview-caption { flex-wrap: wrap; }
  .frame-readout { width: 100%; margin-left: 21px; }
  .controls { padding: 16px 13px; }
  .palette-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .palette-chip { gap: 4px; padding: 0 5px; }
  .palette-chip i { width: 15px; height: 15px; flex-basis: 15px; }
  .palette-chip span { font-size: 6px; }
  .workflow-strip { grid-template-columns: 1fr; gap: 9px; }
  .workflow-strip > i { display: none; }
  .workflow-strip > a { grid-column: auto; }
  .app-footer { align-items: flex-start; flex-wrap: wrap; }
  .app-footer > span { order: 3; width: 100%; }
}

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

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6ef; --panel: #fff; --panel-raised: #f6f8f3; --panel-soft: #edf2ea;
  --ink: #19251e; --muted: #697970; --quiet: #849188; --line: #d7e1d7; --line-soft: #e5ebe3;
  --lime: #76a93f; --cyan: #268a94; --violet: #7865b5;
  --range-track-empty: #d7e5ce; --range-track-fill: #8fbe61;
}
:root[data-theme="light"] body { background: radial-gradient(ellipse at 52% 0%, #e1ecdf 0, transparent 47%), var(--bg); }
:root[data-theme="light"] .topbar { border-color: var(--line); background: rgb(250 252 248 / 91%); }
:root[data-theme="light"] .brand-muted { color: #77877b; }
:root[data-theme="light"] .brand-mark { color: #172117; }
:root[data-theme="light"] .breadcrumb { color: #7f8d84; }
:root[data-theme="light"] .breadcrumb b { color: #b2bdb4; }
:root[data-theme="light"] .store-link { color: #59685f; }
:root[data-theme="light"] .intro .eyebrow { color: #64776d; }
:root[data-theme="light"] .eyebrow-code { color: #91a096; }
:root[data-theme="light"] .intro h1 { color: #16221c; }
:root[data-theme="light"] .intro h1 > span:first-child { color: #699c3d; }
:root[data-theme="light"] .title-mark { color: #268a94; }
:root[data-theme="light"] .intro p { color: #687970; }
:root[data-theme="light"] .intro-stats { border-color: #d9e2d8; background: rgb(255 255 255 / 78%); color: #697970; }
:root[data-theme="light"] .intro-stats b { color: #67973e; }
:root[data-theme="light"] .intro-stats i { background: #d7e1d7; }
:root[data-theme="light"] .workbench { border-color: #d5e0d8; background: #fff; box-shadow: 0 20px 60px rgb(30 51 36 / 9%); }
:root[data-theme="light"] .preview-side { border-color: #dce5dd; background: linear-gradient(135deg, rgb(228 240 226 / 60%), transparent 55%), #f8faf6; }
:root[data-theme="light"] .panel-heading, :root[data-theme="light"] .live-state { color: #65776f; }
:root[data-theme="light"] .live-state i { background: #268a94; box-shadow: 0 0 8px rgb(38 138 148 / 40%); }
:root[data-theme="light"] .preview-toolbar { border-color: #e1e9e1; }
:root[data-theme="light"] .preview-tab { color: #73847a; }
:root[data-theme="light"] .preview-tab:hover { color: #243b30; }
:root[data-theme="light"] .preview-tab[aria-pressed="true"] { border-color: #b6c9b2; background: #eaf2e5; color: #4e7d35; }
:root[data-theme="light"] .resolution-readout { color: #829188; }
:root[data-theme="light"] .resolution-readout span { color: #34493b; }
:root[data-theme="light"] .preview-stage { border-color: #d8e3dd; background-color: #edf3ef; background-image: linear-gradient(rgb(38 138 148 / 7%) 1px, transparent 1px), linear-gradient(90deg, rgb(38 138 148 / 7%) 1px, transparent 1px), radial-gradient(ellipse at center, #e7f0e9 0, #f5f8f4 72%); }
:root[data-theme="light"] .preview-stage::before { background: linear-gradient(90deg, transparent 49.9%, rgb(38 138 148 / 12%) 50%, transparent 50.1%), linear-gradient(transparent 49.9%, rgb(38 138 148 / 12%) 50%, transparent 50.1%); }
:root[data-theme="light"] .preview-stage canvas { border-color: rgb(20 48 31 / 20%); box-shadow: 0 0 0 8px rgb(255 255 255 / 60%), 0 20px 50px rgb(29 55 36 / 18%); }
:root[data-theme="light"] .autosave-indicator { color: #687970; }
:root[data-theme="light"] .background-opacity-help { color: #74847a; }
:root[data-theme="light"] .stage-corner { color: #788b82; }
:root[data-theme="light"] .stage-corner-left span { color: #5d9235; }
:root[data-theme="light"] .stage-crosshair { color: #7c9999; }
:root[data-theme="light"] .preview-caption { color: #65776e; }
:root[data-theme="light"] .caption-icon { color: #268a94; }
:root[data-theme="light"] .frame-readout { color: #819089; }
:root[data-theme="light"] .frame-readout b { color: #52655a; }
:root[data-theme="light"] .frame-readout i { background: #78a7a0; }
:root[data-theme="light"] .controls { background: #fff; }
:root[data-theme="light"] .controls-head { border-color: #e6ece4; }
:root[data-theme="light"] .eyebrow-small { color: #7d8b81; }
:root[data-theme="light"] .controls-head h2 { color: #1a2820; }
:root[data-theme="light"] .control-symbol { border-color: #d8e5d7; background: #f3f7ed; color: #6c9e3c; }
:root[data-theme="light"] .control-group { border-color: #e6ece4; }
:root[data-theme="light"] .group-title { color: #64766e; }
:root[data-theme="light"] .group-number { color: #268a94; }
:root[data-theme="light"] .group-rule { background: #e0e8e0; }
:root[data-theme="light"] .field-label { color: #64766e; }
:root[data-theme="light"] .icon-active-count { color: #268a94; }
:root[data-theme="light"] .icon-choice { border-color: #dce5dd; background: #f7f9f5; color: #52665a; }
:root[data-theme="light"] .icon-choice:hover { border-color: #91b57b; color: #273b2e; }
:root[data-theme="light"] .icon-choice[aria-pressed="true"] { border-color: #70a545; background: #f1f7e9; color: #344c35; }
:root[data-theme="light"] .icon-choice[aria-pressed="true"]::after { color: #5b8e37; }
:root[data-theme="light"] .icon-choice-glyph { color: #669c3b; }
:root[data-theme="light"] .icon-remove-button { border-color: #dce5dd; background: #fff; color: #64766e; }
:root[data-theme="light"] .icon-upload-button { border-color: #a9c59e; background: #f5f9f1; color: #5b8e37; }
:root[data-theme="light"] .icon-upload-button:hover, :root[data-theme="light"] .icon-upload-button:focus-within { border-color: #70a545; background: #edf5e5; }
:root[data-theme="light"] .icon-tint-control { color: #64766e; }
:root[data-theme="light"] .icon-upload-help { color: #74847a; }
:root[data-theme="light"] .icon-upload-status { color: #527b3b; }
:root[data-theme="light"] .pattern-image-remove { border-color: #dce5dd; background: #fff; color: #64766e; }
:root[data-theme="light"] .pattern-image-preview { border-color: #dce5dd; background: #fff; color: #52665a; }
:root[data-theme="light"] .pattern-image-preview img { background-color: #f0f3ef; background-image: linear-gradient(45deg, #dce5dd 25%, transparent 25%, transparent 75%, #dce5dd 75%), linear-gradient(45deg, #dce5dd 25%, transparent 25%, transparent 75%, #dce5dd 75%); }
:root[data-theme="light"] .pattern-image-help { color: #74847a; }
:root[data-theme="light"] .select-wrap select { border-color: #dbe4dc; background: #f8faf7; color: #26382d; }
:root[data-theme="light"] .dimension-input { border-color: #dbe4dc; background: #f8faf7; color: #26382d; }
:root[data-theme="light"] .select-wrap > span, :root[data-theme="light"] .select-wrap > i { color: #78887e; }
:root[data-theme="light"] .palette-chip { border-color: #dce5dd; background: #f7f9f5; color: #6d7d73; }
:root[data-theme="light"] .palette-chip:hover { border-color: #91b57b; }
:root[data-theme="light"] .palette-chip[aria-pressed="true"] { border-color: #70a545; background: #f1f7e9; color: #344c35; }
:root[data-theme="light"] .color-field { color: #77877d; }
:root[data-theme="light"] .color-well { border-color: #dce5dd; background: #fbfcfa; }
:root[data-theme="light"] .color-well code { color: #607167; }
:root[data-theme="light"] .swap-button { border-color: #dce5dd; background: #f3f7f4; color: #268a94; }
:root[data-theme="light"] .range-heading { color: #687970; }
:root[data-theme="light"] .range-heading b { color: #588739; }
:root[data-theme="light"] .range-input::-webkit-slider-thumb { border-color: #fff; background: #527b3b; box-shadow: 0 0 0 1px #527b3b; }
:root[data-theme="light"] .range-input::-moz-range-thumb { border-color: #fff; background: #527b3b; box-shadow: 0 0 0 1px #527b3b; }
:root[data-theme="light"] .range-ends { color: #8d9b90; }
:root[data-theme="light"] .select-field { color: #718178; }
:root[data-theme="light"] .motion-toggle b { color: #52645a; }
:root[data-theme="light"] .motion-toggle small { color: #829188; }
:root[data-theme="light"] .switch i { border-color: #c9d7ca; background: #e8eee7; }
:root[data-theme="light"] .switch i::before { background: #839187; }
:root[data-theme="light"] .switch input:checked + i { border-color: #7fa65c; background: #e7f1dd; }
:root[data-theme="light"] .switch input:checked + i::before { background: #679b3d; }
:root[data-theme="light"] .loop-note { border-color: #d9e6d8; background: #f3f8ef; color: #64766d; }
:root[data-theme="light"] .loop-note > span:first-child { color: #669c3b; }
:root[data-theme="light"] .loop-note b { color: #344b37; }
:root[data-theme="light"] .seam-badge { color: #268a94; }
:root[data-theme="light"] .button-quiet { border-color: #dce5dd; background: #f7f9f6; color: #586a60; }
:root[data-theme="light"] .button-secondary { border-color: #bfd7d5; background: #edf7f5; color: #267d85; }
:root[data-theme="light"] .button-primary { background: #b7ef6a; color: #182318; }
:root[data-theme="light"] .button-primary:hover { background: #a4e452; }
:root[data-theme="light"] .export-status { color: #73847a; }
:root[data-theme="light"] #gif-progress, :root[data-theme="light"] #gif-progress::-webkit-progress-bar { background: #dae5df; }
:root[data-theme="light"] .workflow-strip { border-color: #dce5dd; background: #fff; }
:root[data-theme="light"] .workflow-strip > div > span { color: #268a94; }
:root[data-theme="light"] .workflow-strip b { color: #35483c; }
:root[data-theme="light"] .workflow-strip small { color: #798981; }
:root[data-theme="light"] .workflow-strip > i { color: #92a19a; }
:root[data-theme="light"] .workflow-strip > a { color: #5a873b; }
:root[data-theme="light"] .app-footer { color: #819087; }
:root[data-theme="light"] .footer-brand { color: #314238; }
:root[data-theme="light"] .footer-brand .brand-mark { color: #172117; }
:root[data-theme="light"] .app-footer b { color: #268a94; }
:root[data-theme="light"] .app-footer a { color: #5f7167; }
:root[data-theme="light"] .top-actions .preference-button { border-color: #d5e0d8; background: #fff; color: #35483d; }
:root[data-theme="light"] .top-actions .preference-button:hover { border-color: #7ea95a; color: #416c38; }
:root[data-theme="light"] .top-actions .preference-button [data-theme-icon] { color: #689a3d; }

@media (max-width: 520px) {
  .store-link { display: none; }
}

@container (min-width: 455px) {
  .palette-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .palette-chip { gap: 4px; padding-inline: 5px; }
  .palette-chip i { width: 15px; height: 15px; flex-basis: 15px; }
  .palette-chip span { font-size: 6px; }
}

@container (min-width: 455px) and (max-width: 500px) {
  .palette-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.mobile-view-tabs { display: none; }

:root.embedded-app body { width: 100%; height: 100vh; height: 100dvh; overflow: hidden; }
:root.embedded-app .app-shell { width: 100%; height: calc(100vh - 42px); height: calc(100dvh - 42px); max-width: none; min-height: 0; display: flex; flex-direction: column; margin: 0; }
:root.embedded-app .topbar { height: 42px; min-height: 42px; flex: 0 0 42px; padding-inline: 12px; }
:root.embedded-app .workbench { height: auto; min-height: 0; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr) minmax(360px, 38%); border: 0; border-radius: 0; }
:root.embedded-app .preview-side { padding: 9px 12px 8px; }
:root.embedded-app .panel-heading { min-height: 24px; font-size: 8px; }
:root.embedded-app .preview-toolbar { min-height: 27px; margin-top: 4px; padding-bottom: 5px; }
:root.embedded-app .preview-tab { min-height: 28px; padding-inline: 9px; }
:root.embedded-app .preview-stage { margin-block: 6px; }
:root.embedded-app .preview-caption { font-size: 7px; }
:root.embedded-app .controls { display: flex; flex-direction: column; gap: 0; overflow: hidden; padding: 8px 12px 9px; }
:root.embedded-app .controls-head { flex: 0 0 auto; align-items: center; padding-bottom: 7px; }
:root.embedded-app .controls-head h2 { margin-top: 2px; font-size: 15px; }
:root.embedded-app .eyebrow-small { font-size: 7px; }
:root.embedded-app .control-symbol { width: 25px; height: 25px; font-size: 13px; }
:root.embedded-app .control-tabs { flex: 0 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 7px 0 2px; }
:root.embedded-app .control-tabs button { min-width: 0; min-height: 31px; padding: 0 3px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-soft); color: var(--muted); cursor: pointer; font: 7px var(--mono); }
:root.embedded-app .control-tabs button[aria-selected="true"] { border-color: var(--lime); background: color-mix(in srgb, var(--lime) 10%, var(--panel)); color: var(--lime); }
:root.embedded-app .control-group:not([data-control-active="true"]) { display: none; }
:root.embedded-app .control-group[data-control-active="true"] { display: block; flex: 1 1 auto; min-height: 0; overflow: auto; padding: 7px 3px 8px; border-bottom: 0; overscroll-behavior: contain; scrollbar-color: #46594d transparent; scrollbar-width: thin; }
:root.embedded-app .control-group .group-title { margin-bottom: 6px; }
:root.embedded-app .control-group .field-label { margin-bottom: 5px; }
:root.embedded-app .control-group .range-secondary { margin-top: 6px; }
:root.embedded-app .control-group .icon-style-field,
:root.embedded-app .control-group .pattern-image-field { margin-top: 7px; }
:root.embedded-app .control-group .select-wrap select,
:root.embedded-app .control-group .dimension-input { height: 33px; }
:root.embedded-app .control-group .icon-choice { min-height: 34px; }
:root.embedded-app .control-group .icon-upload-help,
:root.embedded-app .control-group .pattern-image-help { margin-top: 4px; }
:root.embedded-app .action-row { flex: 0 0 auto; gap: 5px; margin-top: 5px; }
:root.embedded-app .button { min-height: 39px; font-size: 8px; }
:root.embedded-app .button-primary { min-height: 39px; }
:root.embedded-app .export-status { flex: 0 0 auto; min-height: 13px; margin: 4px 0 0; font-size: 7px; }
:root.embedded-app #gif-progress { flex: 0 0 3px; margin-top: 4px; }

@media (max-height: 720px) and (min-width: 721px) {
  :root.embedded-app .topbar { height: 36px; min-height: 36px; flex-basis: 36px; }
  :root.embedded-app .app-shell { height: calc(100vh - 36px); height: calc(100dvh - 36px); }
  :root.embedded-app .workbench { grid-template-columns: minmax(0, 1fr) minmax(340px, 38%); }
  :root.embedded-app .controls { padding-block: 5px; }
  :root.embedded-app .controls-head { padding-bottom: 4px; }
  :root.embedded-app .control-tabs { margin-top: 4px; }
  :root.embedded-app .control-tabs button { min-height: 28px; }
  :root.embedded-app .control-group[data-control-active="true"] { padding-block: 4px; }
  :root.embedded-app .control-group { padding-block: 7px; }
  :root.embedded-app .action-row { margin-top: 3px; }
  :root.embedded-app .button, :root.embedded-app .button-primary { min-height: 36px; }
}

@media (max-width: 720px) {
  :root.embedded-app .topbar { height: 40px; min-height: 40px; flex-basis: 40px; padding-inline: 10px; }
  :root.embedded-app .app-shell { height: calc(100vh - 40px); height: calc(100dvh - 40px); }
  :root.embedded-app .brand { gap: 6px; font-size: 11px; }
  :root.embedded-app .brand-mark { width: 22px; height: 22px; }
  :root.embedded-app .top-actions { gap: 7px; }
  :root.embedded-app .itch-link { font-size: 8px; }
  :root.embedded-app .top-actions .preference-button { min-width: 28px; height: 27px; }
  :root.embedded-app .mobile-view-tabs { flex: 0 0 38px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px 9px; border-bottom: 1px solid var(--line); background: var(--panel); }
  :root.embedded-app .mobile-view-tabs button { min-height: 30px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-soft); color: var(--muted); cursor: pointer; font: 8px var(--mono); }
  :root.embedded-app .mobile-view-tabs button[aria-selected="true"] { border-color: var(--lime); color: var(--lime); }
  :root.embedded-app .workbench { min-height: 0; grid-template-columns: minmax(0, 1fr); }
  :root.embedded-app .preview-side { min-width: 0; min-height: 0; padding: 7px 9px; border: 0; }
  :root.embedded-app .preview-stage { min-height: 0; flex: 1 1 auto; }
  :root.embedded-app .controls { display: none; width: 100%; min-height: 0; padding: 7px 10px; }
  :root.embedded-app[data-mobile-view="preview"] .controls { display: none; }
  :root.embedded-app[data-mobile-view="preview"] .preview-side { display: flex; }
  :root.embedded-app[data-mobile-view="settings"] .preview-side { display: none; }
  :root.embedded-app[data-mobile-view="settings"] .controls { display: flex; }
  :root.embedded-app .control-tabs button { min-height: 32px; font-size: 7px; }
}
