:root {
  color-scheme: light;
  --bg-app: #c8c8c8;
  --bg-panel: #c8c8c8;
  --bg-subtle: #d3d3d3;
  --bg-workspace: #b8b8b8;
  --ink: #172033;
  --ink-soft: #596277;
  --ink-faint: #8992a6;
  --line: #dfe3eb;
  --line-strong: #cdd3df;
  --accent: #4f63e9;
  --accent-hover: #3d50d1;
  --accent-soft: #e9ecff;
  --danger: #d44355;
  --shadow-sm: 0 1px 2px rgba(20, 28, 47, .06), 0 1px 6px rgba(20, 28, 47, .04);
  --shadow-md: 0 8px 24px rgba(24, 31, 50, .13), 0 2px 8px rgba(24, 31, 50, .08);
  --radius: 8px;
  --header-height: 114px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

:root[data-theme="classic"] {
  --bg-app: #eef1f6;
  --bg-panel: #ffffff;
  --bg-subtle: #f7f8fb;
  --bg-workspace: #cfd4dc;
  --ink: #172033;
  --ink-soft: #596277;
  --ink-faint: #8992a6;
  --line: #dfe3eb;
  --line-strong: #cdd3df;
  --accent: #4f63e9;
  --accent-hover: #3d50d1;
  --accent-soft: #e9ecff;
}

:root[data-theme="ocean"] {
  --bg-app: #bfd0dd;
  --bg-panel: #d3e2ed;
  --bg-subtle: #e2edf4;
  --bg-workspace: #a9bfce;
  --ink: #173248;
  --ink-soft: #45677d;
  --ink-faint: #66879a;
  --line: #b4c8d5;
  --line-strong: #91adbe;
  --accent: #2872a9;
  --accent-hover: #1c5e91;
  --accent-soft: #d7ebf8;
}

:root[data-theme="warm"] {
  --bg-app: #d8d0c3;
  --bg-panel: #e3dbcf;
  --bg-subtle: #eee7dc;
  --bg-workspace: #c1b5a3;
  --ink: #3b3228;
  --ink-soft: #6e6255;
  --ink-faint: #908376;
  --line: #c8bcad;
  --line-strong: #ad9f90;
  --accent: #a15d3e;
  --accent-hover: #82462d;
  --accent-soft: #f4ded3;
}

:root[data-theme="graphite"] {
  color-scheme: dark;
  --bg-app: #35383e;
  --bg-panel: #454950;
  --bg-subtle: #535861;
  --bg-workspace: #25282e;
  --ink: #f3f5f8;
  --ink-soft: #d1d6df;
  --ink-faint: #aeb6c4;
  --line: #606772;
  --line-strong: #747c88;
  --accent: #8ba9ff;
  --accent-hover: #b2c5ff;
  --accent-soft: #35436a;
  --danger: #ff8d9b;
}

:root[data-theme="graphite"] select,
:root[data-theme="graphite"] input:not([type="color"]):not([type="range"]),
:root[data-theme="graphite"] textarea {
  color: #172033;
  background: #f7f8fa;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  min-width: 760px;
  overflow: hidden;
  color: var(--ink);
  background: var(--bg-app);
  font-size: 13px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select,
input[type="color"],
input[type="range"] {
  cursor: pointer;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:disabled {
  cursor: default;
  opacity: .38;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
}

.app-header {
  position: relative;
  z-index: 20;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.titlebar {
  display: flex;
  align-items: stretch;
  min-height: 65px;
  padding: 0 14px 0 16px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  flex: 0 0 174px;
  align-items: center;
  gap: 10px;
  margin-right: 12px;
}

button.brand {
  padding: 0;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand:hover .brand-mark {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 7px 15px rgba(79, 99, 233, .34);
}

.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 10px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: white;
  border-radius: 10px;
  background: linear-gradient(145deg, #7182ff, #4557dc);
  box-shadow: 0 5px 12px rgba(79, 99, 233, .27);
  transition: transform .14s ease, box-shadow .14s ease;
}

.brand-icon {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 10px;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 15px;
  font-weight: 730;
  letter-spacing: -.015em;
  white-space: nowrap;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.command-bar,
.command-group {
  display: flex;
  align-items: center;
}

.command-bar {
  min-width: 0;
  flex: 1;
  justify-content: space-between;
  gap: 22px;
}

.command-group {
  gap: 3px;
}

.command-button,
.icon-command,
.mini-button,
.format-button,
.subtle-button,
.align-grid button,
.zoom-controls button,
.segmented-actions button,
.layer-actions button,
.panel-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  background: transparent;
  border-radius: 6px;
  transition: color .14s ease, background-color .14s ease, border-color .14s ease, transform .08s ease;
}

.command-button:hover,
.icon-command:hover:not(:disabled),
.mini-button:hover,
.format-button:hover,
.align-grid button:hover,
.zoom-controls button:hover,
.segmented-actions button:hover,
.layer-actions button:hover,
.panel-add-button:hover {
  color: var(--ink);
  background: #f0f2f7;
}

.command-button:active,
.icon-command:active:not(:disabled),
.mini-button:active,
.format-button:active,
.align-grid button:active,
.zoom-controls button:active,
.segmented-actions button:active,
.layer-actions button:active {
  transform: translateY(1px);
}

.command-button {
  min-width: 51px;
  min-height: 48px;
  flex-direction: column;
  gap: 4px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 620;
}

.command-button svg {
  width: 19px;
  height: 19px;
}

.command-button--primary {
  color: var(--accent);
}

.command-button--compact {
  min-width: 44px;
  padding-inline: 5px;
  border-left: 1px solid var(--line);
  border-radius: 0 6px 6px 0;
}

.export-actions {
  display: flex;
}

.export-actions .command-button:first-child {
  border-radius: 6px 0 0 6px;
}

.icon-command {
  width: 32px;
  height: 32px;
}

.icon-command svg {
  width: 18px;
  height: 18px;
}

.icon-command--danger:hover:not(:disabled) {
  color: var(--danger);
  background: #fff0f2;
}

.command-divider {
  width: 1px;
  height: 26px;
  margin: 0 6px;
  background: var(--line);
}

.document-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: 16px;
}

.theme-control {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.theme-control select {
  width: 118px;
  min-height: 27px;
  padding: 3px 21px 3px 7px;
  border-color: var(--line-strong);
  background-color: var(--bg-subtle);
  font-size: 10px;
}

.save-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-faint);
  font-size: 11px;
}

.save-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #30a46c;
  box-shadow: 0 0 0 3px #e5f7ee;
}

.optionsbar {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 6px 16px;
  scrollbar-width: thin;
}

.options-section {
  display: flex;
  min-height: 34px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-right: 1px solid var(--line);
}

.options-section:first-child {
  padding-left: 0;
}

.options-section:last-child {
  border-right: 0;
}

.options-label,
.field-label {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 730;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.color-stack {
  position: relative;
  width: 38px;
  height: 30px;
}

.color-chip {
  position: absolute;
  width: 24px;
  height: 24px;
  overflow: hidden;
  border: 2px solid white;
  border-radius: 5px;
  box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-sm);
}

.color-chip--stroke {
  top: 0;
  left: 0;
  z-index: 2;
}

.color-chip--fill {
  right: 0;
  bottom: 0;
}

.color-chip input,
.inline-color input {
  width: 160%;
  height: 160%;
  margin: -30%;
  padding: 0;
  border: 0;
}

.mini-button,
.format-button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
}

.mini-button svg {
  width: 16px;
  height: 16px;
}

.canvas-aspect-lock.is-active {
  color: var(--accent);
  border-color: #bfc7ff;
  background: var(--accent-soft);
}

.check-control {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 11px;
  white-space: nowrap;
}

input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

input[type="range"] {
  height: 4px;
  margin: 0;
  accent-color: var(--accent);
}

.compact-range {
  width: 82px;
}

.pixel-options {
  gap: 6px;
}

.pixel-options select {
  min-width: 94px;
  min-height: 29px;
  padding: 4px 24px 4px 7px;
  font-size: 11px;
}

.option-caption {
  color: var(--ink-soft);
  font-size: 11px;
  white-space: nowrap;
}

.retouch-source-hint {
  color: var(--ink-faint);
  font-size: 10px;
  white-space: nowrap;
}

.pixel-option-fields {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.unit-input--tiny input {
  width: 42px;
}

.unit-input--tiny span {
  min-width: 10px;
  padding-right: 5px;
  text-align: center;
}

.value-pill {
  min-width: 43px;
  padding: 4px 6px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg-subtle);
  font-size: 11px;
  text-align: center;
}

select,
input[type="text"],
input[type="number"],
textarea {
  min-height: 29px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  background: white;
}

select:hover,
input[type="text"]:hover,
input[type="number"]:hover,
textarea:hover {
  border-color: #afb7c7;
}

select:focus,
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.font-controls select {
  width: 122px;
}

.unit-input {
  display: flex;
  height: 29px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
}

.unit-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.unit-input input {
  width: 60px;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 4px 2px 4px 7px;
  border: 0;
  border-radius: 0;
  box-shadow: none !important;
}

.unit-input span {
  padding-right: 7px;
  color: var(--ink-faint);
  font-size: 10px;
  font-style: normal;
}

.unit-input--short input {
  width: 46px;
}

.unit-input--dpi input {
  width: 38px;
}

.unit-input--dpi span {
  padding-right: 5px;
}

.format-button {
  font-family: Georgia, serif;
  font-size: 14px;
}

.format-button[aria-pressed="true"],
.format-button.is-active {
  color: var(--accent);
  border-color: #bfc7ff;
  background: var(--accent-soft);
}

.dimension-separator {
  color: var(--ink-faint);
}

.inline-color {
  position: relative;
  display: block;
  width: 27px;
  height: 27px;
  overflow: hidden;
  border: 2px solid white;
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--line-strong);
}

.subtle-button {
  height: 29px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-subtle);
  font-size: 11px;
  font-weight: 650;
}

.subtle-button:hover {
  color: var(--accent);
  border-color: #bfc7ff;
  background: var(--accent-soft);
}

.studio-layout {
  --right-sidebar-width: 306px;
  display: grid;
  min-height: 0;
  grid-template-columns: 118px minmax(320px, 1fr) var(--right-sidebar-width);
}

.tool-sidebar,
.right-sidebar {
  min-height: 0;
  overflow: auto;
  background: var(--bg-panel);
  scrollbar-color: #c2c8d3 transparent;
  scrollbar-width: thin;
}

.tool-sidebar {
  position: relative;
  z-index: 4;
  border-right: 1px solid var(--line-strong);
  box-shadow: 3px 0 12px rgba(23, 32, 51, .035);
}

.tool-section,
.align-section {
  padding: 13px 10px;
}

.tool-section {
  border-bottom: 1px solid var(--line);
}

.tool-sidebar h2 {
  margin: 0 0 9px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.tool-rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-group + .tool-group {
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.tool-group h2 {
  margin-bottom: 6px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.tool-button {
  position: relative;
  display: flex;
  min-width: 0;
  height: 49px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 3px 1px;
  color: var(--ink-soft);
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  transition: .14s ease;
}

.tool-button svg {
  width: 20px;
  height: 20px;
}

.tool-button span {
  max-width: 100%;
  overflow: hidden;
  font-size: 8.5px;
  font-weight: 630;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-button:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--bg-subtle);
}

.tool-button.is-active,
.tool-button[aria-pressed="true"] {
  color: var(--accent);
  border-color: #cbd1ff;
  background: var(--accent-soft);
}

.tool-button.is-active::before,
.tool-button[aria-pressed="true"]::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  content: "";
}

.color-picker-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 7px;
}

.color-picker-controls .color-stack {
  flex: 0 0 auto;
}

.color-picker-no-fill {
  justify-content: center;
  width: 100%;
  margin-top: 5px;
  padding: 3px 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.color-picker-no-fill input {
  margin: 0;
  accent-color: var(--accent);
}

.align-section select {
  width: 100%;
  margin-top: 5px;
  font-size: 11px;
}

.align-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-top: 8px;
}

.align-grid button {
  height: 29px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.align-grid svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.6;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.2;
}

.toggle-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  width: 28px;
  height: 16px;
  flex: 0 0 28px;
  border-radius: 99px;
  background: #c9ced8;
  transition: background .16s ease;
}

.switch::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(10, 20, 40, .22);
  content: "";
  transition: transform .16s ease;
}

.toggle-row input:checked + .switch {
  background: var(--accent);
}

.toggle-row input:checked + .switch::after {
  transform: translateX(12px);
}

.toggle-row input:focus-visible + .switch {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.work-column {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: 34px minmax(0, 1fr) 39px;
  background: var(--bg-workspace);
}

.workspace-topline,
.workspace-status {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  background: #f7f8fa;
}

.workspace-topline {
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid #bbc1cc;
}

.document-tabs {
  display: flex;
  min-width: 0;
  align-self: stretch;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.document-tabs::-webkit-scrollbar {
  display: none;
}

.document-tab {
  display: flex;
  min-width: 0;
  max-width: 265px;
  height: 27px;
  align-items: center;
  margin-top: 7px;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: #eceff3;
  font-size: 11px;
  white-space: nowrap;
}

.document-tab:hover:not(.is-active) {
  color: var(--ink);
  background: #e3e7ee;
}

.document-tab.is-active {
  color: var(--ink);
  background: var(--bg-workspace);
}

.document-tab__select {
  display: grid;
  width: 27px;
  height: 100%;
  flex: 0 0 auto;
  margin-left: 3px;
  padding: 0;
  place-items: center;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.document-tab__close {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  margin-right: 3px;
  padding: 0;
  place-items: center;
  color: var(--ink-faint);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}

.document-tab__close:hover,
.document-tab__close:focus-visible {
  color: var(--ink);
  background: #d4dae4;
}

.document-tab svg {
  flex: 0 0 auto;
  width: 14px;
}

.document-tab__title,
.document-tab__title-input {
  min-width: 0;
  flex: 1 1 auto;
  padding: 0 3px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.document-tab__title {
  overflow: hidden;
  cursor: text;
  text-overflow: ellipsis;
}

.document-tab__title:hover,
.document-tab__title:focus-visible {
  background: rgba(90, 108, 145, .11);
}

.document-tab__title-input {
  height: 20px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  outline: 0;
  background: white;
}

.document-tab__save-state {
  flex: 0 0 auto;
  padding-left: 2px;
  color: var(--ink-faint);
  font-size: 8px;
  font-style: normal;
}

.document-tab__save-state.is-dirty {
  color: #bf6811;
}

.document-tab__save-state.is-saved {
  color: #16885a;
}

.workspace-help {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-faint);
  font-size: 10px;
}

kbd {
  padding: 2px 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: white;
  font: inherit;
  font-size: 9px;
}

.workspace {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background-color: var(--bg-workspace);
  background-image: radial-gradient(circle at 1px 1px, rgba(92, 101, 117, .13) 1px, transparent 0);
  background-size: 20px 20px;
  scrollbar-color: #9ca4b1 #d8dce2;
  scrollbar-width: thin;
}

.workspace::before {
  position: fixed;
  z-index: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15), transparent 40%);
  content: "";
  pointer-events: none;
}

.workspace-ruler {
  position: sticky;
  z-index: 2;
  opacity: .7;
  box-sizing: border-box;
  overflow: hidden;
  pointer-events: auto;
  user-select: none;
}

.workspace-ruler__canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.workspace-ruler--horizontal {
  top: 0;
  left: 0;
  width: 100%;
  height: 24px;
  background: rgba(239,241,244,.9);
  border-bottom: 1px solid rgba(98,106,120,.2);
  cursor: row-resize;
}

.workspace-ruler--vertical {
  position: absolute;
  top: 24px;
  left: 0;
  width: 30px;
  height: calc(100% - 24px);
  background: rgba(239,241,244,.9);
  border-right: 1px solid rgba(98,106,120,.2);
  cursor: col-resize;
  transform-origin: top left;
}

.workspace-ruler:hover,
.workspace-ruler:active {
  opacity: 1;
  background-color: rgba(219, 230, 255, .9);
}

.canvas-shell {
  position: relative;
  width: fit-content;
  min-width: 160px;
  min-height: 120px;
  margin: 56px auto;
  transform-origin: top left;
}

#artboard {
  position: relative;
  z-index: 1;
  display: block;
  overflow: visible;
  touch-action: none;
  background: white;
  box-shadow: 0 0 0 1px rgba(82, 89, 102, .25), 0 10px 36px rgba(42, 49, 61, .20), 0 2px 8px rgba(42, 49, 61, .14);
  shape-rendering: geometricPrecision;
}

#artboard.is-pixelated,
#artboard[data-pixel-grid="true"] {
  image-rendering: pixelated;
}

#artboard.is-transparent-canvas {
  background-color: #ffffff;
  background-image: linear-gradient(45deg, #e1e5eb 25%, transparent 25%), linear-gradient(-45deg, #e1e5eb 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e1e5eb 75%), linear-gradient(-45deg, transparent 75%, #e1e5eb 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.inline-text-editor {
  position: absolute;
  z-index: 5;
  box-sizing: border-box;
  min-width: 52px;
  min-height: 28px;
  padding: 2px 5px;
  overflow: hidden;
  resize: none;
  border: 1px dashed #3158db;
  outline: 1px solid rgba(79, 99, 233, .18);
  outline-offset: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 2px 7px rgba(30, 41, 59, .16);
  line-height: 1.2;
  white-space: pre;
}

.empty-hint {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: flex;
  width: 270px;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 18px;
  color: var(--ink-faint);
  border: 1px solid rgba(205, 211, 223, .8);
  border-radius: 12px;
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.empty-hint-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--accent);
  border-radius: 50%;
  background: var(--accent-soft);
}

.empty-hint-icon svg {
  width: 17px;
}

.empty-hint strong {
  color: var(--ink);
  font-size: 13px;
}

.empty-hint span:last-child {
  font-size: 10px;
}

.workspace-status {
  min-width: 0;
  padding: 0 10px;
  border-top: 1px solid #bfc5cf;
  box-shadow: 0 -1px 5px rgba(35, 42, 54, .04);
}

.status-section {
  display: flex;
  height: 100%;
  align-items: center;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
}

.position-status {
  width: 115px;
}

.position-status svg {
  width: 14px;
  margin-right: 7px;
}

.selection-count {
  flex: 1;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.toggle-row--compact {
  margin: 0 8px 0 0;
  white-space: nowrap;
}

.toggle-row--compact .switch {
  width: 24px;
  height: 14px;
  flex-basis: 24px;
}

.toggle-row--compact .switch::after {
  width: 10px;
  height: 10px;
}

.toggle-row--compact input:checked + .switch::after {
  transform: translateX(10px);
}

.status-divider {
  width: 1px;
  height: 19px;
  margin: 0 4px;
  background: var(--line);
}

.zoom-controls button {
  width: 25px;
  height: 25px;
}

.zoom-controls button svg {
  width: 14px;
}

#zoomRange {
  width: 105px;
}

.zoom-preset {
  width: 68px;
  height: 25px;
  padding: 0 4px 0 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-soft);
  background: white;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.zoom-preset:hover,
.zoom-preset:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  outline: none;
}

#zoomLabel {
  min-width: 50px;
  color: var(--ink-soft);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.zoom-controls .fit-button {
  width: auto;
  margin-left: 4px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: white;
  font-size: 10px;
}

.right-sidebar {
  position: relative;
  z-index: 4;
  border-left: 1px solid var(--line-strong);
  box-shadow: -3px 0 12px rgba(23, 32, 51, .035);
}

.sidebar-resizer {
  position: absolute;
  z-index: 12;
  top: 0;
  bottom: 0;
  left: 0;
  width: 10px;
  cursor: col-resize;
  touch-action: none;
}

.sidebar-resizer::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 2px;
  content: '';
  background: transparent;
  transition: background-color .14s ease, box-shadow .14s ease;
}

.sidebar-resizer:hover::after,
.sidebar-resizer:focus-visible::after,
.sidebar-resizer.is-resizing::after {
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

body.is-resizing-sidebar,
body.is-resizing-sidebar * {
  cursor: col-resize !important;
  user-select: none;
}

.panel {
  padding: 15px 14px;
  border-bottom: 1px solid var(--line-strong);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-heading h2 {
  margin: 1px 0 0;
  font-size: 14px;
  font-weight: 720;
  letter-spacing: -.01em;
}

.eyebrow,
.dialog-kicker {
  color: var(--accent);
  font-size: 8px;
  font-weight: 780;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.count-badge {
  padding: 4px 7px;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--bg-subtle);
  font-size: 9px;
}

.inspector-empty {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 20px 22px;
  text-align: center;
}

.inspector-empty > span {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  place-items: center;
  color: #8490b4;
  border-radius: 13px;
  background: #f0f2fa;
}

.inspector-empty svg {
  width: 23px;
}

.inspector-empty strong {
  font-size: 12px;
}

.inspector-empty p {
  max-width: 230px;
  margin: 6px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
}

.inspector-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-group label,
.dialog-body > label,
.property-fieldset > label {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.property-fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.property-fieldset legend {
  width: 100%;
  padding: 0 8px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.property-section-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
}

.property-section-toggle:hover {
  color: var(--accent);
}

.property-section-toggle svg {
  width: 14px;
  transition: transform .15s ease;
}

.property-section-toggle[aria-expanded="false"] svg {
  transform: rotate(-90deg);
}

.property-fieldset.is-collapsed {
  padding-bottom: 2px;
}

.property-fieldset.is-collapsed > :not(legend) {
  display: none;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.number-field {
  display: grid;
  height: 31px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  color: var(--ink-faint);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  font-size: 10px;
}

.number-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.number-field span {
  min-width: 24px;
  padding-left: 7px;
  color: var(--ink-soft);
  font-weight: 700;
}

.number-field input {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 4px 2px;
  border: 0;
  border-radius: 0;
  box-shadow: none !important;
  font-size: 11px;
}

.number-field em {
  padding-right: 7px;
  font-style: normal;
}

.field-grid--wide {
  grid-column: 1 / -1;
}

.field-grid--wide span {
  min-width: 60px;
}

.style-property-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 39px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.style-property-row label {
  color: var(--ink-soft);
  font-size: 10px;
}

.style-property-row output {
  color: var(--ink-soft);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.glow-toggle {
  margin-top: 0;
  margin-bottom: 10px;
}

.glow-controls {
  display: flex;
  flex-direction: column;
  transition: opacity .14s ease;
}

.glow-controls.is-disabled {
  opacity: .52;
}

.glow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.glow-color-field {
  grid-column: 1 / -1;
}

.color-field {
  position: relative;
  display: flex;
  height: 31px;
  align-items: center;
  justify-content: space-between;
  padding-left: 8px;
  color: var(--ink-soft);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 10px;
}

.color-field input {
  width: 39px;
  height: 38px;
  margin-right: -4px;
  padding: 0;
  border: 0;
  background: none;
}

.color-field.is-transparent::after,
.inline-color.is-transparent::after,
.dialog-color-field.is-transparent::after {
  position: absolute;
  z-index: 2;
  right: 2px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(15,23,42,.2);
  border-radius: 4px;
  background-color: rgba(255,255,255,.86);
  background-image: linear-gradient(135deg, transparent 45%, #e5243b 46%, #e5243b 54%, transparent 55%), linear-gradient(45deg, #d8dbe1 25%, transparent 25%), linear-gradient(-45deg, #d8dbe1 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d8dbe1 75%), linear-gradient(-45deg, transparent 75%, #d8dbe1 75%);
  background-position: 0 0, 0 0, 0 5px, 5px -5px, -5px 0;
  background-size: auto, 10px 10px, 10px 10px, 10px 10px, 10px 10px;
  content: "";
  pointer-events: none;
}

.inline-color.is-transparent::after {
  top: -1px;
  right: -1px;
  width: 25px;
  height: 25px;
}

.dialog-color-field.is-transparent::after {
  right: 8px;
  width: 30px;
  height: 25px;
}

.number-field--standalone {
  grid-column: 1 / -1;
}

#propText {
  width: 100%;
  margin: 5px 0 7px;
  resize: vertical;
}

.text-dialog-button {
  width: 100%;
  margin: 0 0 7px;
  padding: 5px 8px;
  text-align: left;
}

.text-property-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px repeat(4, 29px);
  gap: 5px;
}

.text-property-row select {
  min-width: 0;
  width: 100%;
}

.text-format-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.text-format-grid .field-label,
.text-rendering-row .field-label {
  display: grid;
  gap: 3px;
  margin: 0;
  font-size: 9px;
}

.text-format-grid select,
.text-format-grid input,
.text-rendering-row select {
  min-width: 0;
  width: 100%;
}

.text-format-grid .number-field {
  min-width: 0;
}

.text-format-grid .number-field input {
  min-width: 0;
}

.text-align-row,
.text-rendering-row {
  display: flex;
  min-width: 0;
  align-items: end;
  gap: 5px;
  margin-top: 8px;
}

.text-align-row > span {
  margin-right: auto;
  color: var(--ink-soft);
  font-size: 9px;
}

.text-align-row .format-button {
  width: 29px;
  height: 27px;
  padding: 0;
  font-weight: 700;
  line-height: 1;
}

#propAlignLeft { text-align: left; }
#propAlignCenter { text-align: center; }
#propAlignRight { text-align: right; }

.text-rendering-row .field-label {
  min-width: 0;
  flex: 1 1 auto;
}

.text-rendering-row .toggle-row {
  flex: 0 0 auto;
  margin: 0 0 2px;
}

.property-note {
  margin: 2px 0 8px;
  color: var(--ink-faint);
  font-size: 10px;
}

.text-path-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.text-path-grid .field-label {
  display: grid;
  gap: 3px;
  margin: 0;
  font-size: 9px;
}

.text-path-grid select {
  width: 100%;
  min-width: 0;
}

.text-path-grid .number-field {
  min-width: 0;
}

.text-path-grid .toggle-row {
  margin: 2px 0 0;
}

.text-path-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.text-path-actions .subtle-button {
  min-width: 0;
  padding: 6px 5px;
  font-size: 10px;
}

.group-actions {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.group-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 6px;
}

.group-action-grid button {
  display: inline-flex;
  min-width: 0;
  height: 31px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg-subtle);
  font-size: 9px;
  font-weight: 680;
}

.group-action-grid button:hover:not(:disabled) {
  color: var(--accent);
  border-color: #bfc7ff;
  background: var(--accent-soft);
}

.group-action-grid button:disabled {
  cursor: not-allowed;
  opacity: .46;
}

.group-action-grid svg {
  width: 14px;
  flex: 0 0 auto;
}

.group-action-grid__flatten {
  grid-column: 1 / -1;
}

.arrange-actions {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.segmented-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 6px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.segmented-actions button {
  height: 31px;
  border-right: 1px solid var(--line);
  border-radius: 0;
}

.segmented-actions button:last-child {
  border-right: 0;
}

.segmented-actions svg {
  width: 16px;
}

.wide-button {
  display: flex;
  width: 100%;
  height: 32px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg-subtle);
  font-size: 10px;
  font-weight: 650;
}

.wide-button:hover {
  color: var(--accent);
  border-color: #bfc7ff;
  background: var(--accent-soft);
}

.wide-button svg {
  width: 15px;
}

.layers-panel {
  min-height: 190px;
}

.panel-heading--compact {
  margin-bottom: 10px;
}

.panel-add-button {
  width: 29px;
  height: 29px;
  color: white;
  background: var(--accent);
  box-shadow: 0 3px 8px rgba(79, 99, 233, .22);
}

.panel-add-button:hover {
  color: white;
  background: var(--accent-hover);
}

.panel-add-button svg {
  width: 16px;
}

.layer-list {
  min-height: 80px;
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-subtle);
}

.layer-list:empty::after {
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  content: "Noch keine Ebenen";
  font-size: 10px;
}

.layer-row {
  display: grid;
  min-height: 42px;
  grid-template-columns: 25px 25px 25px minmax(0, 1fr) 25px;
  align-items: center;
  gap: 3px;
  padding: 4px 5px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.layer-entry:last-child .layer-row {
  border-bottom: 0;
}

.layer-entry:not(:last-child) {
  border-bottom: 1px solid var(--line);
}

.layer-row.is-active,
.layer-row[aria-selected="true"] {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 var(--accent);
}

.layer-row button {
  display: grid;
  width: 25px;
  height: 25px;
  padding: 0;
  place-items: center;
  color: var(--ink-faint);
  border-radius: 5px;
  background: transparent;
}

.layer-expand svg {
  width: 14px;
  transition: transform .14s ease;
}

.layer-expand[aria-expanded="false"] svg {
  transform: rotate(-90deg);
}

.layer-row button:hover {
  color: var(--ink);
  background: rgba(255,255,255,.8);
}

.layer-row input,
.layer-row .layer-name {
  min-width: 0;
  overflow: hidden;
  font-size: 10px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-object-list {
  padding: 3px 4px 5px 17px;
  border-top: 1px solid var(--line);
  background: #f7f8fb;
}

.layer-object-list[hidden] {
  display: none;
}

.layer-object-list:empty::after {
  display: block;
  padding: 5px 7px;
  color: var(--ink-faint);
  content: "Keine Objekte auf dieser Ebene";
  font-size: 9px;
}

.layer-object-row {
  display: grid;
  min-height: 29px;
  grid-template-columns: 24px 24px 24px minmax(0, 1fr);
  align-items: center;
  gap: 2px;
  padding: 2px 3px;
  border-radius: 5px;
  color: var(--ink-soft);
  cursor: pointer;
}

.layer-object-row:hover {
  background: #eef1f7;
}

.layer-object-row.is-selected {
  color: var(--ink);
  background: #e6eaff;
  box-shadow: inset 2px 0 var(--accent);
}

.layer-object-row.is-hidden,
.layer-object-row.is-locked {
  color: var(--ink-faint);
}

.layer-object-row.is-hidden .layer-object-name {
  text-decoration: line-through;
}

.layer-object-row button {
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  color: var(--ink-faint);
  border-radius: 4px;
  background: transparent;
}

.layer-object-row button:hover {
  color: var(--ink);
  background: rgba(255,255,255,.9);
}

.layer-object-row svg {
  width: 14px;
}

.layer-object-type {
  display: grid;
  width: 22px;
  height: 18px;
  place-items: center;
  color: var(--accent);
  border: 1px solid #c9d1ff;
  border-radius: 3px;
  background: #f3f5ff;
  font-size: 8px;
  font-weight: 750;
}

.layer-object-name {
  min-width: 0;
  overflow: hidden;
  font-size: 9px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-actions {
  display: flex;
  margin-top: 7px;
  gap: 3px;
}

.layer-actions button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
}

.layer-actions svg {
  width: 15px;
}

.layer-action-spacer {
  flex: 1;
}

.app-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  border: 1px solid rgba(205, 211, 223, .75);
  border-radius: 14px;
  background: white;
  box-shadow: 0 24px 75px rgba(13, 20, 36, .28), 0 5px 18px rgba(13, 20, 36, .16);
}

.app-dialog::backdrop {
  background: rgba(27, 34, 49, .52);
  backdrop-filter: blur(3px);
}

.splash-dialog {
  position: relative;
  width: min(1000px, calc(100vw - 40px));
  max-width: none;
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(205, 211, 223, .9);
  border-radius: 14px;
  background: #d8d8d8;
  box-shadow: 0 24px 75px rgba(13, 20, 36, .34), 0 5px 18px rgba(13, 20, 36, .2);
}

.splash-dialog::backdrop {
  background: rgba(27, 34, 49, .62);
  backdrop-filter: blur(4px);
}

.splash-dialog[open] {
  animation: dialog-in .18s ease-out;
}

.splash-dialog img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 40px);
  object-fit: contain;
}

.splash-dialog__close {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 10px;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  color: #172033;
  border: 1px solid rgba(23, 32, 51, .18);
  border-radius: 7px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 2px 7px rgba(23, 32, 51, .14);
  font-size: 21px;
  line-height: 1;
}

.splash-dialog__close:hover {
  background: white;
}

.app-dialog[open] {
  animation: dialog-in .18s ease-out;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-dialog {
  display: none;
  width: min(720px, calc(100vw - 32px));
  grid-template-columns: 245px minmax(0, 1fr);
}

.welcome-dialog[open] {
  display: grid;
}

.dialog-hero {
  display: grid;
  min-height: 355px;
  place-items: center;
  overflow: hidden;
  background-color: #5367e9;
  background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,.28), transparent 28%), linear-gradient(145deg, transparent 25%, rgba(28,42,150,.3));
}

.dialog-hero::before,
.dialog-hero::after {
  position: absolute;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 32px;
  content: "";
  transform: rotate(28deg) translate(-72px, -95px);
}

.dialog-hero::after {
  width: 100px;
  height: 100px;
  transform: rotate(28deg) translate(105px, 115px);
}

.dialog-hero > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100px;
  height: 100px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 30px;
  background: rgba(255,255,255,.14);
  box-shadow: 0 18px 45px rgba(25, 36, 130, .3);
  backdrop-filter: blur(5px);
}

.dialog-hero svg {
  width: 58px;
  color: white;
  stroke-width: 1.8;
}

.dialog-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 38px;
}

.dialog-content h2 {
  max-width: 340px;
  margin: 6px 0 12px;
  font-size: 27px;
  line-height: 1.12;
  letter-spacing: -.035em;
}

.dialog-content > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.welcome-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0 24px;
}

.welcome-features span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 11px;
}

.welcome-features i {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--accent);
  border-radius: 50%;
  background: var(--accent-soft);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 21px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 3px 0 0;
  font-size: 18px;
  letter-spacing: -.02em;
}

.dialog-close {
  width: 30px;
  height: 30px;
  color: var(--ink-faint);
  border-radius: 6px;
  background: var(--bg-subtle);
  font-size: 20px;
  line-height: 1;
}

.dialog-close:hover {
  color: var(--ink);
  background: #eceff5;
}

.dialog-body {
  padding: 20px 22px;
}

.dialog-body textarea {
  width: 100%;
  margin-top: 6px;
  resize: vertical;
}

.dialog-note,
.dialog-warning {
  margin: 8px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
}

.dialog-warning {
  padding: 9px 11px;
  color: #896725;
  border: 1px solid #ead9b1;
  border-radius: 6px;
  background: #fff9ea;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding: 13px 22px;
  border-top: 1px solid var(--line);
  background: var(--bg-subtle);
}

.dialog-content .dialog-actions {
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
}

.dialog-button {
  min-height: 34px;
  padding: 0 15px;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: white;
  font-size: 11px;
  font-weight: 680;
}

.dialog-button:hover {
  border-color: #afb7c7;
  background: #fafbfc;
}

.dialog-button--primary {
  color: white;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 4px 10px rgba(79, 99, 233, .22);
}

.dialog-button--primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.new-canvas-preview {
  display: grid;
  height: 88px;
  margin-bottom: 16px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #e7eaf0;
  background-image: radial-gradient(circle at 1px 1px, rgba(92,101,117,.15) 1px, transparent 0);
  background-size: 12px 12px;
}

.new-canvas-preview span {
  width: var(--preview-width, 110px);
  height: var(--preview-height, 66px);
  border: 1px solid #c5cad4;
  background: var(--preview-color, white);
  box-shadow: 0 4px 10px rgba(30, 38, 52, .13);
  transition: width .12s ease, height .12s ease, background-color .12s ease;
}

.new-canvas-preview.is-transparent span {
  background-color: white;
  background-image: linear-gradient(45deg, #d8dbe1 25%, transparent 25%), linear-gradient(-45deg, #d8dbe1 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d8dbe1 75%), linear-gradient(-45deg, transparent 75%, #d8dbe1 75%);
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-size: 12px 12px;
}

.dialog-field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(76px, .55fr);
  gap: 10px;
}

.dialog-field-grid > label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.dialog-field-grid .unit-input,
.dialog-field-grid .unit-input input {
  width: 100%;
}

.dialog-color-field {
  position: relative;
  display: grid;
  height: 36px;
  grid-template-columns: 1fr 38px 58px;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 0 6px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.new-background-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px 30px;
  gap: 6px;
  align-items: stretch;
  margin-top: 10px;
}

.new-background-row .dialog-color-field {
  grid-template-columns: minmax(0, 1fr) 34px;
  min-width: 0;
  margin-top: 0;
}

/* Die Schnellschalter brauchen auf schmalen Dialogen den Platz der HEX-Anzeige.
   Der gewählte Farbton bleibt über das Farbfeld eindeutig sichtbar. */
.new-background-row .dialog-color-field em {
  display: none;
}

.new-background-quick {
  min-width: 0;
  height: 36px;
  padding: 0 4px;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  font-size: 9px;
  font-weight: 700;
}

.new-background-quick:hover,
.new-background-quick:focus-visible {
  position: relative;
  z-index: 1;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.new-background-quick--transparent {
  background-color: #ffffff;
  background-image: linear-gradient(135deg, transparent 45%, #e5243b 46%, #e5243b 54%, transparent 55%), linear-gradient(45deg, #d8dbe1 25%, transparent 25%), linear-gradient(-45deg, #d8dbe1 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d8dbe1 75%), linear-gradient(-45deg, transparent 75%, #d8dbe1 75%);
  background-position: 0 0, 0 0, 0 5px, 5px -5px, -5px 0;
  background-size: auto, 10px 10px, 10px 10px, 10px 10px, 10px 10px;
}

.dialog-color-field input {
  width: 34px;
  height: 27px;
  padding: 0;
  border: 0;
  background: none;
}

.dialog-color-field em {
  color: var(--ink-faint);
  font-size: 10px;
  font-style: normal;
}

.pixel-dialog {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
}

.pixel-dialog[hidden] {
  display: none;
}

.pixel-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 34, 49, .57);
  backdrop-filter: blur(3px);
}

.pixel-dialog__surface {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(1000px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  min-height: min(660px, calc(100vh - 40px));
  flex-direction: column;
  overflow: hidden;
  color: var(--ink);
  border: 1px solid rgba(205, 211, 223, .8);
  border-radius: 14px;
  background: white;
  box-shadow: 0 24px 75px rgba(13, 20, 36, .30), 0 5px 18px rgba(13, 20, 36, .16);
  animation: dialog-in .18s ease-out;
}

.pixel-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 17px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.pixel-dialog__header h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 17px;
  letter-spacing: -.015em;
}

.pixel-dialog__close {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  color: var(--ink-faint);
  border-radius: 6px;
  background: transparent;
  font-size: 23px;
  line-height: 1;
}

.pixel-dialog__close:hover {
  color: var(--ink);
  background: var(--bg-subtle);
}

.pixel-dialog__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-subtle);
}

.pixel-dialog__tools > button {
  height: 29px;
  padding: 0 10px;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: white;
  font-size: 10px;
  font-weight: 650;
}

.pixel-dialog__tools > button:hover,
.pixel-dialog__tools > button[aria-pressed="true"] {
  color: var(--accent);
  border-color: #bfc7ff;
  background: var(--accent-soft);
}

.pixel-dialog__separator {
  width: 1px;
  height: 25px;
  margin: 0 2px;
  background: var(--line-strong);
}

.pixel-dialog__color,
.pixel-dialog__zoom {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.pixel-dialog__color input {
  width: 31px;
  height: 29px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: white;
}

.pixel-dialog__zoom input {
  width: 82px;
}

.pixel-dialog__zoom output,
.pixel-dialog__status {
  color: var(--ink-faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.pixel-dialog__grid {
  margin: 0 0 0 2px;
  white-space: nowrap;
}

.pixel-dialog__status {
  min-width: 100px;
  margin-left: auto;
  text-align: right;
}

.pixel-dialog__viewport {
  position: relative;
  min-height: 230px;
  flex: 1;
  overflow: auto;
  padding: 28px;
  background-color: #d7dce4;
  background-image: linear-gradient(45deg, rgba(255,255,255,.36) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.36) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255,255,255,.36) 75%), linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.36) 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.pixel-dialog__stage {
  position: relative;
  width: 1px;
  height: 1px;
  margin: auto;
  box-shadow: 0 0 0 1px rgba(29,38,55,.32), 0 6px 20px rgba(30,38,52,.2);
}

.pixel-dialog__stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.pixel-dialog__grid-overlay {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(30,41,59,.34) 1px, transparent 1px), linear-gradient(to bottom, rgba(30,41,59,.34) 1px, transparent 1px);
  background-size: var(--pixel-cell, 12px) var(--pixel-cell, 12px);
}

.pixel-dialog__grid-overlay.is-visible {
  display: block;
}

.pixel-dialog__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: white;
}

.pixel-dialog__actions > span {
  color: var(--ink-faint);
  font-size: 10px;
}

.pixel-dialog__actions > div {
  display: flex;
  gap: 7px;
}

.crop-dialog {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
}

.crop-dialog[hidden] {
  display: none;
}

.crop-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 34, 49, .57);
  backdrop-filter: blur(3px);
}

.crop-dialog__surface {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(930px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  min-height: min(620px, calc(100vh - 40px));
  flex-direction: column;
  overflow: hidden;
  color: var(--ink);
  border: 1px solid rgba(205, 211, 223, .8);
  border-radius: 14px;
  background: white;
  box-shadow: 0 24px 75px rgba(13, 20, 36, .30), 0 5px 18px rgba(13, 20, 36, .16);
  animation: dialog-in .18s ease-out;
}

.crop-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 17px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.crop-dialog__header h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 17px;
  letter-spacing: -.015em;
}

.crop-dialog__close {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  color: var(--ink-faint);
  border-radius: 6px;
  background: transparent;
  font-size: 23px;
  line-height: 1;
}

.crop-dialog__close:hover {
  color: var(--ink);
  background: var(--bg-subtle);
}

.crop-dialog__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-subtle);
}

.crop-dialog__zoom {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.crop-dialog__zoom input {
  width: 105px;
}

.crop-dialog__zoom output,
.crop-dialog__status {
  color: var(--ink-faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.crop-dialog__status {
  margin-left: auto;
}

.crop-dialog__viewport {
  min-height: 230px;
  flex: 1;
  overflow: auto;
  padding: 28px;
  background-color: #d7dce4;
  background-image: linear-gradient(45deg, rgba(255,255,255,.36) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.36) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255,255,255,.36) 75%), linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.36) 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.crop-dialog__stage {
  position: relative;
  width: 1px;
  height: 1px;
  margin: auto;
  overflow: hidden;
  touch-action: none;
  box-shadow: 0 0 0 1px rgba(29,38,55,.32), 0 6px 20px rgba(30,38,52,.2);
}

.crop-dialog__stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  image-rendering: pixelated;
}

.crop-selection {
  position: absolute;
  z-index: 2;
  min-width: 1px;
  min-height: 1px;
  border: 1px solid #ffffff;
  box-shadow: 0 0 0 9999px rgba(12, 19, 31, .54), 0 0 0 1px rgba(23,32,51,.72);
  cursor: move;
}

.crop-selection span {
  position: absolute;
  z-index: 3;
  width: 9px;
  height: 9px;
  border: 1px solid #3157e8;
  border-radius: 1px;
  background: white;
}

.crop-selection span[data-crop-handle="nw"] { top: -5px; left: -5px; cursor: nwse-resize; }
.crop-selection span[data-crop-handle="n"] { top: -5px; left: calc(50% - 5px); cursor: ns-resize; }
.crop-selection span[data-crop-handle="ne"] { top: -5px; right: -5px; cursor: nesw-resize; }
.crop-selection span[data-crop-handle="e"] { top: calc(50% - 5px); right: -5px; cursor: ew-resize; }
.crop-selection span[data-crop-handle="se"] { right: -5px; bottom: -5px; cursor: nwse-resize; }
.crop-selection span[data-crop-handle="s"] { bottom: -5px; left: calc(50% - 5px); cursor: ns-resize; }
.crop-selection span[data-crop-handle="sw"] { bottom: -5px; left: -5px; cursor: nesw-resize; }
.crop-selection span[data-crop-handle="w"] { top: calc(50% - 5px); left: -5px; cursor: ew-resize; }

.crop-dialog__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: white;
}

.crop-dialog__actions > span {
  color: var(--ink-faint);
  font-size: 10px;
}

.crop-dialog__actions > div {
  display: flex;
  gap: 7px;
}

.color-palette {
  position: fixed;
  z-index: 140;
  inset: auto;
  width: 344px;
  margin: 0;
  padding: 9px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 16px 42px rgba(24, 31, 50, .22), 0 3px 10px rgba(24, 31, 50, .13);
  transform-origin: top right;
  animation: color-palette-in .12s ease-out;
}

.color-palette[hidden] {
  display: none;
}

.color-palette::backdrop {
  background: transparent;
}

.color-palette.is-sampling,
.color-palette.is-sampling::backdrop {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='m14 4 2-2 6 6-2 2M7 19l10-10-2-2L5 17l-1 4 3-2Z' fill='white' stroke='%23172033' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 3 21, crosshair;
}

@keyframes color-palette-in {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.color-palette__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 7px;
  color: var(--ink-soft);
  cursor: grab;
  font-size: 11px;
  touch-action: none;
  user-select: none;
}

.color-palette.is-dragging .color-palette__header {
  cursor: grabbing;
}

.color-palette__header strong {
  font-weight: 720;
}

.color-palette__header button {
  display: grid;
  width: 23px;
  height: 23px;
  padding: 0;
  place-items: center;
  color: var(--ink-faint);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
}

.color-palette__header button:hover {
  color: var(--ink);
  background: var(--bg-subtle);
}

.color-palette__grid,
.color-palette__gray,
.color-palette__quick {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  border: 1px solid #111827;
  background: #111827;
}

.color-palette__gray {
  margin-top: 6px;
}

.color-palette__quick {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin-top: 0;
}

.color-palette__quick-row {
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.color-palette__transparent {
  position: relative;
  min-height: 29px;
  padding: 0;
  border: 1px solid #111827;
  background-color: #ffffff;
  background-image: linear-gradient(135deg, transparent 45%, #e5243b 46%, #e5243b 54%, transparent 55%), linear-gradient(45deg, #d8dbe1 25%, transparent 25%), linear-gradient(-45deg, #d8dbe1 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d8dbe1 75%), linear-gradient(-45deg, transparent 75%, #d8dbe1 75%);
  background-position: 0 0, 0 0, 0 5px, 5px -5px, -5px 0;
  background-size: auto, 10px 10px, 10px 10px, 10px 10px, 10px 10px;
}

.color-palette__transparent:hover,
.color-palette__transparent:focus-visible {
  z-index: 1;
  outline: 2px solid #ffffff;
  outline-offset: -2px;
  box-shadow: 0 0 0 2px #172033;
}

.color-palette__grid button,
.color-palette__gray button,
.color-palette__quick button {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / .82;
  min-height: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--swatch);
}

.color-palette__grid button:hover,
.color-palette__grid button:focus-visible,
.color-palette__gray button:hover,
.color-palette__gray button:focus-visible,
.color-palette__quick button:hover,
.color-palette__quick button:focus-visible {
  z-index: 1;
  outline: 2px solid #ffffff;
  outline-offset: -2px;
  box-shadow: 0 0 0 2px #172033;
}

.color-palette__values {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: 23px 23px;
  align-items: center;
  gap: 4px 8px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.color-palette__preview {
  width: 42px;
  height: 42px;
  grid-row: 1 / -1;
  border: 1px solid rgba(15,23,42,.34);
  border-radius: 3px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);
}

.color-palette__hex {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
}

.color-palette__hex input,
.color-palette__rgb input {
  width: 100%;
  height: 29px;
  padding: 0 7px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: white;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.color-palette__hex input {
  height: 23px;
}

.color-palette__hex input[data-invalid="true"] {
  color: var(--danger);
  border-color: #f3a5ae;
  background: #fff7f8;
}

.color-palette__rgb {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.color-palette__rgb label {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: center;
  gap: 3px;
}

.color-palette__rgb input {
  height: 23px;
  padding: 0 4px;
  font-size: 10px;
  text-transform: none;
}

.color-palette__apply {
  width: 100%;
  height: 31px;
  margin-top: 10px;
  color: white;
  border-radius: 6px;
  background: var(--accent);
  font-size: 11px;
  font-weight: 680;
}

.color-palette__apply:hover {
  background: var(--accent-hover);
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 54px;
  display: flex;
  max-width: 340px;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast,
.toast-region:not(:empty) {
  padding: 10px 13px;
  color: white;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: #253047;
  box-shadow: var(--shadow-md);
  font-size: 11px;
}

@media (max-width: 1180px) {
  .studio-layout {
    --right-sidebar-width: 284px;
    grid-template-columns: 108px minmax(300px, 1fr) var(--right-sidebar-width);
  }

  .brand {
    flex-basis: 156px;
  }

  .brand-copy small,
  .document-meta {
    display: none;
  }

  .command-bar {
    gap: 8px;
  }

  .canvas-controls .options-label,
  .color-controls .check-control span,
  .workspace-help {
    display: none;
  }
}

@media (max-width: 960px) {
  .titlebar {
    padding-left: 10px;
  }

  .brand {
    flex-basis: 46px;
    margin-right: 6px;
  }

  .brand-copy {
    display: none;
  }

  .command-button {
    min-width: 43px;
    padding-inline: 5px;
  }

  .studio-layout {
    --right-sidebar-width: 262px;
    grid-template-columns: 102px minmax(280px, 1fr) var(--right-sidebar-width);
  }

  .font-controls {
    display: none;
  }

  .panel {
    padding-inline: 11px;
  }

  .toggle-row--compact span:last-child,
  .selection-count {
    display: none;
  }
}

@media (max-height: 720px) {
  .tool-button {
    height: 42px;
  }

  .tool-button span {
    display: none;
  }

  .tool-section,
  .align-section {
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .align-section .field-label,
  .align-section select {
    display: none;
  }

  .inspector-empty {
    min-height: 100px;
  }
}

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