:root {
  color-scheme: dark;
  --bg: #171819;
  --panel: #202223;
  --panel-raised: #292c2d;
  --field: #191b1c;
  --line: #343738;
  --line-soft: #2c2f30;
  --text: #eceeed;
  --muted: #a7afad;
  --quiet: #78827f;
  --mint: #d1eddb;
  --mint-ink: #213c2c;
  --radius: 6px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { width: 100%; height: 100%; overflow: hidden; }
body {
  width: 100%; height: 100vh; height: 100dvh; margin: 0; overflow: hidden;
  display: grid; grid-template-rows: 64px 48px minmax(0, 1fr);
  color: var(--text); background: var(--bg);
}
button, input, select, textarea { font: inherit; }
button, summary, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; border: 0; background: none; cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled { opacity: .38; cursor: not-allowed; }
button, a, summary { touch-action: manipulation; }
button, summary { user-select: none; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, canvas:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
input, select, textarea {
  color: var(--text); background: var(--field); border: 1px solid var(--line);
  border-radius: var(--radius); min-width: 0; outline-offset: 2px;
}
input:hover, select:hover, textarea:hover { border-color: #505754; }
input:focus, select:focus, textarea:focus { border-color: #8aa997; }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
select { height: 34px; padding: 0 26px 0 10px; cursor: pointer; }
option { color: var(--text); background: var(--panel); }
textarea { width: 100%; resize: vertical; min-height: 60px; padding: 10px; line-height: 1.6; }
input[type="checkbox"] { width: 14px; height: 14px; margin: 0; accent-color: var(--mint); cursor: pointer; }
input[type="range"] {
  appearance: none; -webkit-appearance: none; width: 100%; height: 18px; padding: 0;
  background: transparent; border: 0; border-radius: 0; accent-color: var(--mint); cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: #4a514d; }
input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; height: 11px; width: 11px;
  border-radius: 50%; background: var(--mint); margin-top: -4px;
  box-shadow: 0 0 0 3px var(--panel);
}
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: #4a514d; }
input[type="range"]::-moz-range-thumb { height: 11px; width: 11px; border: 0; border-radius: 50%; background: var(--mint); }
input[type="color"] { width: 24px; height: 24px; padding: 2px; border-radius: 5px; cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 3px; }
input[type="color"]::-moz-color-swatch { border: 0; border-radius: 3px; }
::selection { background: #d1eddb45; color: #fff; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #49514c; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #647169; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: 0 0 18px; }
[data-icon] svg { width: 100%; height: 100%; display: block; }
.skip-link { position: fixed; top: -100px; left: 12px; z-index: 100; background: var(--mint); color: var(--mint-ink); padding: 12px 18px; border-radius: 4px; }
.skip-link:focus { top: 10px; }

.topbar { display: flex; align-items: center; gap: 36px; padding: 0 22px; border-bottom: 1px solid var(--line-soft); background: #191b1c; position: relative; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand > svg { color: var(--mint); fill: currentColor; width: 27px; height: 27px; }
.brand > span { font-size: 18px; font-weight: 620; letter-spacing: -.65px; }
.web-badge { display: inline-block; vertical-align: 2px; margin-left: 8px; padding: 3px 5px; font-size: 12px; font-weight: 600; letter-spacing: .5px; line-height: 1; color: var(--muted); border: 1px solid #3c4340; border-radius: 3px; }
.menus { display: flex; height: 100%; align-items: center; gap: 2px; }
.menu { position: relative; }
.menu > summary { list-style: none; color: #bcc2bf; padding: 8px 11px; border-radius: 5px; cursor: pointer; font-size: 12px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { background: #2d3130; color: #fff; }
.menu-popover { position: absolute; top: calc(100% + 14px); left: 0; width: 230px; padding: 6px; border: 1px solid #434946; border-radius: 8px; background: #242827; box-shadow: 0 14px 48px #0008; }
.menu-popover button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 10px 9px; border-radius: 4px; text-align: left; color: #e0e5e2; }
.menu-popover button:hover { background: #3a4440; }
.menu-popover kbd { color: var(--muted); background: none; border: 0; font-size: 12px; }
.menu-popover hr { border: 0; border-top: 1px solid #3a403d; margin: 5px; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: 0 0 auto; }
.language-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #222526; gap: 2px; flex: 0 0 auto; }
.language-switch button { min-width: 30px; min-height: 30px; padding: 0 5px; border: 0; border-radius: 5px; color: #b3b9b6; font-size: 12px; font-weight: 650; }
.language-switch button[aria-pressed="true"] { background: var(--mint); color: var(--mint-ink); }
.language-switch button:hover { color: #fff; background: #383e3a; }
.language-switch button[aria-pressed="true"]:hover { color: var(--mint-ink); background: var(--mint); }
.mobile-menu { display: none; }
.local-badge { display: flex; align-items: center; gap: 6px; color: #abb8af; margin-right: 6px; white-space: nowrap; }
.local-badge i { width: 5px; height: 5px; background: #a9d8b6; border-radius: 50%; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 34px; padding: 0 13px; border: 1px solid transparent; border-radius: var(--radius); font-weight: 550; white-space: nowrap; transition: background .15s, border-color .15s; }
.button.primary { background: var(--mint); border-color: var(--mint); color: #213b2b; }
.button.primary:hover { background: #e4f7eb; border-color: #e4f7eb; }
.button.primary:active { background: #b5d6c1; }
.button.ghost { color: #d6ddd8; background: #252a27; border-color: #3a423d; }
.button.ghost:hover { background: #343c36; border-color: #536256; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: 0 0 30px; color: #aeb8b1; border-radius: 4px; }
.icon-button:hover { color: #eef6f0; background: #353b37; }
.icon-button:active { background: #435047; }
.icon-button [data-icon] { width: 16px; height: 16px; flex-basis: 16px; }

.contextbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px 0 23px; background: var(--panel); border-bottom: 1px solid var(--line); position: relative; z-index: 10; }
.context-left, .context-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.context-left > [data-icon] { color: var(--mint); }
#tool-name { font-weight: 500; white-space: nowrap; }
#tool-hint { color: #97a19b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { height: 16px; width: 1px; background: #444b47; margin: 0 2px; flex: 0 0 1px; }
.context-right { gap: 7px; flex-shrink: 0; }
.color-label { display: flex; align-items: center; gap: 8px; padding-right: 10px; border-right: 1px solid #414742; margin-right: 1px; color: #b9c1bc; }
#brush-options { display: flex; align-items: center; gap: 17px; color: #b9c1bc; }
#brush-options > label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
#brush-size { width: 100px; }
#brush-output { min-width: 23px; color: var(--text); font-variant-numeric: tabular-nums; }
.mask-switch { font-size: 12px; }
.panel-toggle, .mobile-close { display: none; }

.editor { display: grid; grid-template-columns: 64px minmax(0, 1fr) 300px; min-width: 0; min-height: 0; }
.toolrail { display: flex; flex-direction: column; align-items: center; justify-content: space-between; min-height: 0; padding: 15px 0 13px; background: #1d1f20; border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: thin; }
.tool-group { display: flex; flex-direction: column; gap: 7px; align-items: center; }
#move-options, #selection-options, #gradient-options { display: flex; align-items: center; gap: 14px; color: var(--muted); }
#move-options label, #selection-options label, #gradient-options label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
#magic-tolerance { width: 52px; height: 28px; padding: 0 6px; }
#gradient-type { max-width: 95px; height: 28px; padding: 0 5px; }
#retouch-strength { width: 80px; }
.color-swap { width: 28px; flex-basis: 28px; }
.tool { width: 40px; height: 39px; display: flex; align-items: center; justify-content: center; color: #aab4ad; border: 1px solid transparent; border-radius: 7px; transition: color .15s, background .15s; }
.tool > [data-icon] { width: 20px; height: 20px; flex-basis: 20px; }
.tool:hover { color: #e9f2ec; background: #313733; }
.tool.active { color: var(--mint-ink); background: var(--mint); border-color: #dff3e6; box-shadow: 0 2px 8px #0002; }
.rail-divider { width: 23px; height: 1px; background: #3c443e; margin: 6px 0; }
.rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 15px; }
.rail-dot { height: 6px; width: 6px; border-radius: 50%; background: #5d6c61; }
.workspace { min-width: 0; min-height: 0; display: grid; grid-template-rows: 42px minmax(0, 1fr) 36px; }
.document-tabs { display: flex; align-items: stretch; min-width: 0; border-bottom: 1px solid var(--line); background: #1d2020; }
.document-tab { display: flex; align-items: center; gap: 9px; max-width: 280px; padding: 0 17px; color: #cbd6cf; background: #292d2b; border-right: 1px solid #3b443e; font-size: 12px; }
.document-tab > [data-icon] { color: #99b4a3; width: 15px; height: 15px; flex-basis: 15px; }
#document-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.unsaved-dot { height: 5px; width: 5px; margin-left: 7px; flex: 0 0 5px; border-radius: 50%; background: #83998b; }
.new-tab { width: 43px; min-width: 43px; color: #8f9d94; font-size: 22px; font-weight: 300; }
.new-tab:hover { color: var(--mint); background: #292f2b; }
.workspace-label { display: flex; align-items: center; margin-left: auto; padding: 0 19px; color: #7f9185; font-size: 12px; letter-spacing: 1.2px; white-space: nowrap; }
.stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background-color: #171b19; background-image: radial-gradient(#687f6e25 .7px, transparent .7px); background-size: 16px 16px; isolation: isolate; }
.ruler { position: absolute; z-index: 3; background: #222725; pointer-events: none; }
.ruler-top { top: 0; left: 0; height: 22px; width: 100%; border-bottom: 1px solid #37413b; }
.ruler-left { left: 0; top: 0; width: 22px; height: 100%; border-right: 1px solid #37413b; }
.ruler-corner { position: absolute; left: 0; top: 0; width: 22px; height: 22px; z-index: 4; border-right: 1px solid #37413b; border-bottom: 1px solid #37413b; background: #252b28; }
.ruler-corner::after { content: ""; width: 5px; height: 5px; border-top: 1px solid #718777; border-left: 1px solid #718777; position: absolute; top: 9px; left: 9px; }
.canvas-wrap {
  position: absolute; z-index: 1; line-height: 0; box-shadow: 0 4px 9px #0004, 0 20px 65px #0006, 0 0 0 1px #0006;
  background-color: #eff1ef;
  background-image: linear-gradient(45deg, #d6dbd7 25%, transparent 25%), linear-gradient(-45deg, #d6dbd7 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d6dbd7 75%), linear-gradient(-45deg, transparent 75%, #d6dbd7 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
#artboard { display: block; width: 100%; height: 100%; }
#overlay { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }
.stage-note { position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 7px; bottom: 21px; left: 22px; width: calc(100% - 22px); color: #7d8e81; font-size: 12px; pointer-events: none; }
.stage-note > [data-icon] { width: 12px; height: 12px; flex-basis: 12px; }
.dropzone { position: absolute; z-index: 8; inset: 38px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; background: #18251ff2; border: 2px dashed #afd8bc; border-radius: 12px; color: var(--mint); pointer-events: none; backdrop-filter: blur(8px); }
.dropzone > [data-icon] { width: 36px; height: 36px; flex-basis: 36px; }
.dropzone strong { font-size: 20px; font-weight: 500; }
.dropzone > span:last-child { color: #9db8a6; }
.statusbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 13px 0 17px; border-top: 1px solid #343c36; background: #1e2420; color: #8f9f93; font-size: 12px; }
.statusbar > div { display: flex; align-items: center; gap: 9px; min-width: 0; white-space: nowrap; }
.status-dot { background: #a7ccb3; width: 5px; height: 5px; border-radius: 50%; flex: 0 0 5px; }
#save-status { overflow: hidden; text-overflow: ellipsis; }
.status-separator { color: #526057; padding: 0 2px; }
#document-size { font-variant-numeric: tabular-nums; }
.zoom-controls { flex: 0 0 auto; }
.zoom-controls .icon-button { width: 24px; height: 26px; flex-basis: 24px; }
.zoom-controls .icon-button [data-icon] { width: 13px; height: 13px; flex-basis: 13px; }
#zoom-value { min-width: 41px; padding: 4px 1px; color: #d0dbd3; font-size: 12px; font-variant-numeric: tabular-nums; }
.fit-button { font-size: 12px; color: #a9b7ac; padding: 5px 2px; }
.fit-button:hover, #zoom-value:hover { color: var(--mint); }

.inspector { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel); border-left: 1px solid var(--line); }
.inspector-heading { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--line-soft); }
.inspector-heading > span:first-child { font-weight: 550; font-size: 12px; color: #ced7d1; }
.live-tag { margin-left: auto; color: #96ab9d; font-size: 12px; letter-spacing: .5px; }
.inspector-tabs { display: flex; flex: 0 0 39px; gap: 23px; margin: 0 18px; border-bottom: 1px solid #343d36; }
.inspector-tabs button { position: relative; color: #92a397; padding: 0 3px; }
.inspector-tabs button.active { color: var(--mint); }
.inspector-tabs button.active::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 100%; height: 2px; background: var(--mint); }
.properties-body { flex: 0 0 auto; padding: 17px 18px 19px; max-height: min(320px, 43vh); overflow-y: auto; }
.section-heading { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 500; color: #cdd7d0; min-height: 18px; margin-bottom: 12px; }
.subtle-button { color: #879b8d; font-size: 12px; padding: 2px 0 2px 8px; }
.subtle-button:hover { color: var(--mint); }
.transform-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px; }
.transform-grid > label, .rotation-row > label { display: flex; align-items: center; height: 34px; gap: 6px; padding: 0 9px; background: var(--field); border: 1px solid #364138; border-radius: 5px; min-width: 0; }
.transform-grid > label:focus-within, .rotation-row > label:focus-within { border-color: #9ab3a2; }
.transform-grid label > span:first-child { color: #91a897; width: 12px; flex: 0 0 12px; font-size: 12px; }
.transform-grid label > span:last-child, .rotation-row label > span:last-child { color: #718877; font-size: 12px; }
.transform-grid input, .rotation-row input { width: 100%; border: 0; padding: 0; background: transparent; font-variant-numeric: tabular-nums; text-align: right; color: #dae6dd; height: 26px; }
.transform-grid input:focus-visible, .rotation-row input:focus-visible { outline: 0; }
.rotation-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.rotation-row > label { flex: 1; min-width: 0; }
.rotation-row label > [data-icon] { width: 13px; height: 13px; flex-basis: 13px; color: #93aa99; }
.rotation-row .icon-button { border: 1px solid #364138; background: #191e1a; width: 34px; height: 34px; flex-basis: 34px; }
.rotation-row .icon-button:hover { background: #333f36; }
#text-properties, #shape-properties { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.text-setting { display: flex; gap: 8px; margin-top: 9px; }
.text-setting select { flex: 1; width: 0; }
.text-setting input { width: 59px; padding: 0 8px; text-align: center; }
#shape-type { width: 100%; }
.slider-field { display: block; margin-bottom: 13px; color: #a9baaf; }
.slider-field > span { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.slider-field output { color: #c7d9cd; font-variant-numeric: tabular-nums; }
.filter-presets { display: flex; gap: 7px; margin-top: 7px; }
.filter-presets > button { flex: 1; border: 1px solid #3a493e; border-radius: 4px; min-height: 29px; color: #bfd0c4; }
.filter-presets > button:hover { background: #34473b; color: var(--mint); }
.panel-note { font-size: 12px; line-height: 1.6; color: #7f9788; margin: 13px 0 0; }
.layers-section { display: flex; flex-direction: column; flex: 1 1 0; min-height: 145px; border-top: 1px solid var(--line); }
.layers-heading { flex: 0 0 44px; min-height: 44px; padding: 0 12px 0 18px; margin: 0; }
.layers-heading > span { display: flex; align-items: center; gap: 7px; }
.count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 17px; padding: 0 4px; background: #35403a; color: #a0b7a7; border-radius: 4px; font-size: 12px; font-variant-numeric: tabular-nums; }
.blend-row { display: flex; align-items: center; gap: 10px; padding: 0 14px 12px 18px; border-bottom: 1px solid var(--line-soft); }
.blend-row > select { height: 31px; flex: 1; width: 0; padding-left: 8px; font-size: 12px; }
.blend-row > label { display: flex; align-items: center; gap: 3px; white-space: nowrap; font-size: 12px; color: #8fa796; }
.blend-row input { height: 27px; width: 29px; border: 0; background: transparent; padding: 0; text-align: right; font-size: 12px; color: #d4e2d9; }
.blend-row label > span { color: #708b79; }
.layers-list { min-height: 0; flex: 1 1 0; padding: 9px 8px; overflow-y: auto; overscroll-behavior: contain; }
.layer-row { display: flex; align-items: center; gap: 9px; min-height: 62px; padding: 8px 8px; margin-bottom: 3px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; position: relative; user-select: none; }
.layer-row:hover { background: #2b3630; }
.layer-row.selected { border-color: #536d5e; background: #35483c; }
.layer-row.selected::before { content: ""; position: absolute; left: -1px; top: 17px; bottom: 17px; width: 2px; background: var(--mint); border-radius: 2px; }
.layer-select { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; padding: 0; text-align: left; }
.layer-thumb { position: relative; flex: 0 0 42px; width: 42px; height: 34px; border: 1px solid #718276; border-radius: 3px; overflow: hidden; background: repeating-conic-gradient(#c5d2c8 0% 25%, #edf2ee 0% 50%) 50% / 10px 10px; }
.layer-thumb canvas, canvas.layer-thumb { display: block; width: 42px; height: 34px; object-fit: contain; }
.layer-info { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.layer-name { font-size: 12px; color: #d5e0d8; font-weight: 450; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.layer-type { color: #869c8d; font-size: 12px; line-height: 1.2; }
.layer-row.selected .layer-name { color: #e7f5eb; }
.layer-row.selected .layer-type { color: #a5c0af; }
.layer-visibility, .layer-lock { width: 24px; height: 28px; flex: 0 0 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; color: #90aa99; }
.layer-visibility > [data-icon], .layer-lock > [data-icon] { width: 15px; height: 15px; flex-basis: 15px; }
.layer-visibility > svg, .layer-lock > svg { width: 15px; height: 15px; }
.layer-visibility:hover, .layer-lock:hover { background: #4c6555; color: var(--mint); }
.layer-lock.is-locked { color: var(--mint); }
.layer-lock:empty { display: none; }
.layer-row.hidden-layer { opacity: .52; }
.layer-row.has-mask .layer-thumb { border-color: #b1d6be; }
.layer-row.has-mask .layer-thumb::after { content: ""; position: absolute; right: 2px; bottom: 2px; height: 6px; width: 6px; border-radius: 1px; background: linear-gradient(90deg, #fff 50%, #243f2b 50%); box-shadow: 0 0 0 1px #48644f; }
.layer-empty, .empty-state, .empty-layers { text-align: center; color: #9caf9f; font-size: 12px; line-height: 1.7; padding: 24px 14px; white-space: pre-line; }
.layer-actions { display: flex; align-items: center; gap: 5px; flex: 0 0 42px; padding: 0 14px; border-top: 1px solid var(--line-soft); background: #1d2420; }
.layer-actions .icon-button { width: 28px; height: 28px; flex-basis: 28px; }
.actions-spacer { flex: 1; }
.layer-actions [data-action="delete"]:hover { color: #efb3a8; background: #543b36; }
.inspector-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 0 0 41px; padding: 0 15px; border-top: 1px solid var(--line-soft); color: #96ab9d; background: #1b231e; font-size: 12px; }
.inspector-footer a { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.inspector-footer a [data-icon] { width: 13px; height: 13px; flex-basis: 13px; }
.inspector-footer button { font-size: 12px; white-space: nowrap; color: #96ab9d; padding: 4px 0; }
.inspector-footer a:hover, .inspector-footer button:hover { color: var(--mint); }

dialog { width: min(470px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 26px; border: 1px solid #4a5b4e; border-radius: 13px; background: #202923; color: var(--text); box-shadow: 0 24px 100px #0009; overflow-y: auto; }
dialog::backdrop { background: #0a110bd1; backdrop-filter: blur(5px); }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.eyebrow { color: #a7c6b1; font-size: 12px; font-weight: 550; letter-spacing: 1.4px; }
dialog h1 { font-size: 25px; font-weight: 550; letter-spacing: -.6px; margin: 0 0 10px; line-height: 1.4; color: #edf6f0; }
dialog p { font-size: 13px; line-height: 1.7; color: #a5bcad; margin: 0 0 23px; }
.form-field { display: flex; flex-direction: column; gap: 9px; font-size: 12px; font-weight: 500; color: #afc6b7; margin-bottom: 17px; }
.form-field input, .form-field select { width: 100%; height: 40px; padding: 0 12px; color: #e6f0e9; background: #17231c; border-color: #3e5446; }
.form-field textarea { font-weight: 400; font-size: 14px; background: #17231c; border-color: #3e5446; }
.dimension-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.size-presets { display: flex; gap: 7px; margin: -3px 0 22px; }
.size-presets button { flex: 1; min-height: 32px; border: 1px solid #415c49; color: #bed7c6; border-radius: 5px; font-size: 12px; }
.size-presets button:hover { background: #3b5543; }
dialog .small-note { font-size: 12px; line-height: 1.7; color: #8fa799; margin: 17px 0; }
dialog .small-note a { color: #c2ddcb; border-bottom: 1px solid #547761; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; border-top: 1px solid #3b4d40; padding-top: 19px; margin-top: 21px; }
.dialog-actions .button { min-height: 40px; padding: 0 17px; }
.export-summary { display: flex; align-items: center; justify-content: space-between; color: #9eb6a6; padding: 14px 0 2px; }
.export-summary strong { color: #d1e4d7; font-weight: 500; font-variant-numeric: tabular-nums; }
.shortcut-grid { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px 16px; padding: 17px; margin: 20px 0; border: 1px solid #3d5144; border-radius: 7px; background: #1b251f; color: #b5ccbd; }
kbd { font-family: inherit; font-size: 12px; color: #d1e6d8; border-radius: 4px; padding: 3px 5px; border: 1px solid #445e4e; background: #2e4436; white-space: nowrap; }
.toast { position: fixed; left: 50%; bottom: 58px; transform: translateX(-50%); z-index: 80; max-width: calc(100vw - 40px); padding: 12px 18px; border: 1px solid #657e6d; border-radius: 8px; background: #283c2ff5; color: #e4f4e9; box-shadow: 0 7px 30px #0006; font-size: 13px; text-align: center; line-height: 1.5; backdrop-filter: blur(10px); }
.toast.error { border-color: #a87968; background: #492f27f5; color: #ffe4d9; }

@media (max-width: 1150px) {
  .topbar { gap: 20px; padding: 0 17px; }
  .local-badge { display: none; }
  .editor { grid-template-columns: 60px minmax(0, 1fr) 280px; }
  .workspace-label { display: none; }
  .top-actions { gap: 8px; }
  .context-left, .context-right { gap: 8px; }
  .contextbar { padding-left: 18px; }
  .inspector-footer { padding: 0 12px; gap: 6px; }
}

@media (max-width: 900px) {
  .editor { grid-template-columns: 60px minmax(0, 1fr); }
  .inspector { position: fixed; z-index: 30; top: 112px; right: 0; bottom: 0; width: min(320px, calc(100vw - 60px)); transform: translateX(102%); visibility: hidden; transition: transform .2s ease, visibility .2s; box-shadow: -16px 0 55px #0006; }
  .inspector.open { transform: translateX(0); visibility: visible; }
  .panel-toggle { display: flex; }
  .mobile-close { display: flex; width: 30px; height: 30px; flex-basis: 30px; margin-right: -8px; }
  .live-tag { margin-left: auto; }
  .topbar { gap: 19px; }
  .menus { gap: 0; }
  .menus { display: none; }
  .mobile-menu { display: block; }
  .mobile-menu > summary { min-width: 32px; text-align: center; font-size: 19px; }
  .mobile-menu .menu-popover { position: fixed; top: 62px; left: auto; right: 12px; max-height: calc(100dvh - 80px); overflow-y: auto; }
  .color-label { font-size: 0; gap: 0; }
  .color-label input { width: 28px; height: 28px; }
  .menu > summary { padding: 8px; }
  #tool-hint { display: none; }
  .properties-body { max-height: 40vh; }
  .inspector-footer { flex-basis: 42px; }
}

@media (max-width: 700px) {
  .brand > span { font-size: 17px; }
  .web-badge { display: none; }
  .topbar { gap: 9px; padding: 0 13px; }
  .top-actions .button { padding: 0 10px; gap: 5px; }
  #tool-hint { max-width: 200px; }
  .context-left { gap: 7px; }
  #brush-size { width: 65px; }
  #brush-options { gap: 8px; }
  #brush-options > label { gap: 5px; }
  .contextbar { padding: 0 10px 0 17px; }
  .statusbar { padding-left: 12px; padding-right: 8px; }
  #document-size, #document-size + .status-separator { display: none; }
  .statusbar > div:first-child .status-separator { display: none; }
  .statusbar > div { gap: 6px; }
}

@media (max-width: 600px) {
  body { grid-template-rows: 58px 48px minmax(0, 1fr); }
  body.context-expanded { grid-template-rows: 58px 82px minmax(0, 1fr); }
  .topbar { padding: 0 12px; gap: 6px; }
  .brand { gap: 7px; }
  .brand > svg { width: 23px; height: 23px; }
  .brand > span { font-size: 17px; letter-spacing: -.7px; }
  .menus { display: none; }
  .mobile-menu { display: block; }
  .mobile-menu > summary { min-width: 32px; min-height: 36px; padding: 6px; text-align: center; font-size: 19px; }
  .mobile-menu .menu-popover { top: 54px; left: auto; right: 12px; }
  .top-actions { gap: 4px; }
  .top-actions .button { min-height: 36px; font-size: 12px; }
  .top-actions .button.primary [data-icon] { display: none; }
  .language-switch { padding: 2px; gap: 0; }
  .language-switch button { min-width: 28px; min-height: 30px; padding: 0 3px; }
  .top-actions .button.ghost { width: 36px; padding: 0; }
  .import-label, .desktop-only { display: none; }
  .button [data-icon] { width: 16px; height: 16px; flex-basis: 16px; }
  .contextbar { gap: 5px; padding: 0 7px 0 13px; align-items: flex-start; }
  .context-left, .context-right { height: 48px; }
  .context-left { gap: 7px; }
  .context-left > [data-icon] { width: 15px; height: 15px; flex-basis: 15px; }
  .context-left > .divider, #tool-hint { display: none; }
  #tool-name { font-size: 12px; }
  #move-options, #selection-options, #gradient-options { position: absolute; top: 48px; left: 58px; right: 6px; z-index: 8; padding: 5px 9px; min-height: 34px; justify-content: flex-start; border: 1px solid #43584b; background: #25362bfa; border-radius: 0 0 6px 6px; }
  .context-right { gap: 0; }
  .context-right .icon-button { width: 34px; height: 40px; flex-basis: 34px; }
  .color-label { font-size: 0; padding-right: 7px; margin-right: 2px; gap: 0; border: 0; }
  .color-label input { width: 26px; height: 26px; }
  .background-color-label { padding-right: 0; }
  .context-right .color-swap { width: 25px; flex-basis: 25px; }
  #brush-options { position: absolute; top: 48px; left: 58px; right: 6px; z-index: 8; padding: 5px 9px; min-height: 34px; justify-content: space-between; border: 1px solid #43584b; background: #25362bfa; border-radius: 0 0 6px 6px; box-shadow: 0 4px 18px #0004; }
  #brush-options > label { font-size: 12px; gap: 6px; }
  #brush-size { width: 70px; }
  #brush-options input[type="range"] { height: 24px; }
  #brush-output { min-width: 22px; }
  #retouch-strength { width: 55px; }
  .editor { grid-template-columns: 52px minmax(0, 1fr); }
  .toolrail { padding: 8px 0 7px; overflow-y: auto; }
  .tool-group { gap: 2px; }
  .tool { width: 42px; height: 43px; flex: 0 0 43px; border-radius: 5px; }
  .tool > [data-icon] { width: 19px; height: 19px; flex-basis: 19px; }
  .rail-divider { margin: 4px 0; width: 21px; }
  .rail-bottom { gap: 4px; padding-top: 10px; }
  .rail-dot { display: none; }
  .workspace { grid-template-rows: 40px minmax(0, 1fr) 42px; }
  .document-tab { padding: 0 11px; gap: 7px; max-width: calc(100% - 39px); flex: 0 1 auto; font-size: 12px; }
  .document-tab > [data-icon] { width: 14px; height: 14px; flex-basis: 14px; }
  .unsaved-dot { margin-left: 2px; }
  .new-tab { width: 39px; min-width: 39px; }
  .stage-note { bottom: 16px; font-size: 12px; gap: 4px; color: #8d9f92; }
  .statusbar { padding-left: 9px; padding-right: 5px; gap: 3px; }
  .statusbar > div:first-child { gap: 5px; }
  #save-status { font-size: 12px; max-width: 88px; }
  .status-dot { width: 4px; height: 4px; flex-basis: 4px; }
  .zoom-controls { gap: 1px !important; }
  .zoom-controls .icon-button { width: 27px; height: 36px; flex-basis: 27px; }
  .zoom-controls .status-separator, .fit-button { display: none; }
  #zoom-value { min-width: 37px; padding: 9px 0; }
  .inspector { top: 106px; width: min(320px, calc(100vw - 52px)); }
  .context-expanded .inspector { top: 140px; }
  .inspector-heading { min-height: 45px; padding: 0 16px; }
  .inspector-tabs { flex-basis: 44px; margin: 0 16px; }
  .inspector-tabs button { min-width: 44px; }
  .mobile-close { width: 38px; height: 38px; flex-basis: 38px; }
  .properties-body { padding: 15px 16px 17px; max-height: 37vh; }
  .transform-grid > label, .rotation-row > label { height: 38px; }
  .rotation-row .icon-button { width: 38px; height: 38px; flex-basis: 38px; }
  .layer-row { min-height: 66px; padding: 8px 6px; gap: 8px; }
  .layer-visibility, .layer-lock { width: 29px; height: 42px; flex-basis: 29px; }
  .layer-actions { flex-basis: 46px; gap: 4px; padding: 0 11px; }
  .layer-actions .icon-button { height: 42px; width: 36px; flex-basis: 36px; }
  .layers-heading { min-height: 46px; flex-basis: 46px; padding-left: 16px; }
  .layers-heading .icon-button { width: 38px; height: 40px; flex-basis: 38px; }
  .inspector-footer { padding: 0 11px; }
  .blend-row { padding-left: 16px; gap: 7px; }
  .blend-row > select { height: 36px; }
  .blend-row input { height: 36px; }
  .dropzone { inset: 30px 15px 20px 32px; }
  .dropzone strong { font-size: 16px; }
  dialog { padding: 22px; max-height: calc(100dvh - 24px); }
  dialog h1 { font-size: 23px; }
  .form-field input, .form-field select { height: 44px; font-size: 16px; }
  .form-field textarea { font-size: 16px; }
  .dialog-actions .button { min-height: 44px; }
  .size-presets button { min-height: 38px; }
  .shortcut-grid { padding: 13px; gap: 12px 7px; font-size: 12px; }
  .shortcut-grid kbd { font-size: 12px; padding: 3px 4px; }
  .toast { bottom: 57px; font-size: 12px; padding: 10px 15px; }
}

@media (max-height: 680px) and (min-width: 601px) {
  .toolrail { padding-top: 8px; overflow-y: auto; }
  .tool-group { gap: 3px; }
  .tool { height: 35px; flex: 0 0 35px; }
  .rail-bottom { gap: 6px; padding-top: 8px; }
  .properties-body { padding-top: 12px; padding-bottom: 12px; max-height: 37vh; }
  .inspector-heading { min-height: 39px; }
  .inspector-tabs { flex-basis: 35px; }
  .inspector-footer { flex-basis: 34px; }
  .layers-heading { flex-basis: 38px; min-height: 38px; }
  .stage-note { bottom: 13px; }
}

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