:root {
  color-scheme: dark;
  --bg: #0c131b;
  --bar: #111b26;
  --panel: #141e29;
  --raised: #1a2735;
  --edge: #293a4b;
  --edge-strong: #3c5166;
  --text: #ebf1f6;
  --muted: #a1b2c2;
  --subtle: #8297aa;
  --accent: #68ded1;
  --accent-ink: #0a2826;
  --accent-bg: #1c3a3b;
  --grid: #1e2c3a;
  --warn: #ffc785;
  --danger: #ffaba2;
  --shadow: 0 20px 45px #0005;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 16px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e9eff3;
  --bar: #f5f8fa;
  --panel: #fff;
  --raised: #edf3f7;
  --edge: #cfdae2;
  --edge-strong: #a8b9c6;
  --text: #192b3b;
  --muted: #455b6c;
  --subtle: #546d7e;
  --accent: #006b60;
  --accent-ink: #fff;
  --accent-bg: #d6eeea;
  --grid: #dce6ec;
  --warn: #80500c;
  --danger: #ab2c25;
  --shadow: 0 20px 45px #3b58652b;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  touch-action: manipulation;
}
button {
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
p {
  margin: 0;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
svg {
  display: block;
}
button svg,
.display-icon svg,
.step svg,
.project svg,
.statusbar svg,
.symbol svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.topbar {
  height: 72px;
  padding-inline: 27px;
  display: flex;
  align-items: center;
  gap: 23px;
  background: var(--bar);
  border-bottom: 1px solid var(--edge);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  white-space: nowrap;
}
.emblem {
  width: 37px;
  height: 37px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--edge));
  background: var(--accent-bg);
  border-radius: 9px;
  color: var(--accent);
  display: grid;
  place-items: center;
}
.emblem svg {
  width: 26px;
  height: 26px;
  fill: var(--accent-bg);
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brandtext {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.65px;
}
.brandtext strong {
  color: var(--accent);
  font-weight: 700;
}
.project {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline-start: 19px;
  border-inline-start: 1px solid var(--edge);
  font-size: 0.84rem;
  color: var(--muted);
  min-width: 0;
}
.project span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 35vw;
}
.global-actions {
  margin-inline-start: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.global-actions button,
.api-link {
  height: 35px;
}
.language,
.api-link {
  font: 600 0.8rem var(--mono);
}
.api-link {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.api-link[hidden] {
  display: none;
}
.steps {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  overflow: auto;
  gap: 7px;
  padding: 11px 25px;
  background: var(--bar);
  border-bottom: 1px solid var(--edge);
}
.step {
  border: 1px solid transparent;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  min-width: max-content;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--muted);
  white-space: nowrap;
}
.step[aria-current="step"] {
  color: var(--accent);
  background: var(--accent-bg);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--edge));
  font-weight: 700;
}
.step:not(:disabled):hover {
  border-color: var(--edge-strong);
  color: var(--text);
}
.step.complete:not([aria-current]) svg {
  color: var(--accent);
}
.step:disabled {
  opacity: 0.58;
}
.workbench {
  flex: 1;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 660px;
  padding: 20px 24px;
  gap: 16px;
}
.inspector,
.display {
  min-width: 0;
  border: 1px solid var(--edge);
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 4px 18px #0001;
}
.inspector {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 580px;
}
.inspector-head {
  display: grid;
  gap: 6px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--edge);
}
.inspector-head h1 {
  font-size: 1.18rem;
  line-height: 1.4;
  font-weight: 720;
}
.inspector-head p,
.helper,
.inspector p {
  line-height: 1.6;
  color: var(--muted);
  font-size: 0.875rem;
}
.inspector-controls {
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.inspector-actions {
  margin-top: auto;
  display: grid;
  gap: 9px;
  padding-top: 11px;
}
.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.button-row > * {
  flex: 1;
}
.primary,
.quiet,
.secondary,
.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 7px;
  min-height: 37px;
  padding: 7px 11px;
  border: 1px solid var(--edge);
  background: var(--raised);
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.3;
}
.quiet {
  background: transparent;
  color: var(--muted);
}
.quiet:hover,
.secondary:hover {
  color: var(--text);
  border-color: var(--edge-strong);
  background: var(--raised);
}
.quiet.active,
.secondary.active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--edge));
  background: var(--accent-bg);
}
.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  min-height: 42px;
  font-weight: 750;
}
.primary:not(:disabled):hover {
  filter: brightness(1.13);
}
.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--edge));
  background: transparent;
}
.danger:not(:disabled):hover {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}
.icon {
  width: 37px;
  padding: 0;
  min-height: 35px;
}
.icon svg {
  width: 17px;
  height: 17px;
}
.stack,
.control-group {
  display: grid;
  gap: 9px;
}
.horizontal-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.horizontal-list button {
  flex: 1 0 auto;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.form-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.form-field > span,
.form-field > label,
.range-label,
.toggle,
.field-label {
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 570;
}
.form-field input:not([type="range"]),
select {
  border: 1px solid var(--edge);
  color: var(--text);
  border-radius: 7px;
  background: var(--bg);
  padding: 8px 10px;
  width: 100%;
  min-width: 0;
  min-height: 40px;
}
.form-field input[type="number"],
.number,
.zoom-readout {
  font: 500 0.82rem var(--mono);
  direction: ltr;
}
.form-field input[type="color"] {
  padding: 4px;
  min-height: 35px;
}
.form-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23899eaf' stroke-width='1.5'/%3E%3C/svg%3E");
  background-position: right 10px center;
  background-size: 16px;
  background-repeat: no-repeat;
  padding-inline-end: 30px;
}
[dir="rtl"] .form-field select {
  background-position: left 10px center;
}
.range-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
input[type="range"] {
  accent-color: var(--accent);
  width: 100%;
  margin: 3px 0;
}
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 17px;
  height: 17px;
  margin: 0;
  flex: none;
}
.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
  cursor: pointer;
}
.advanced {
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 10px 11px;
}
.advanced summary {
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 650;
}
.advanced .control-group {
  padding-top: 12px;
}
.rule {
  height: 1px;
  background: var(--edge);
  border: 0;
  margin: 4px 0;
}
.notice {
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--edge);
  background: var(--raised);
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--muted);
}
.notice.warn {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 38%, var(--edge));
}
.notice.error {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--edge));
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0;
}
.stats div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--edge);
  border-radius: 7px;
  padding: 9px;
  background: var(--bg);
}
.stats dt {
  font-size: 0.77rem;
  color: var(--muted);
}
.stats dd {
  margin: 0;
  font: 600 0.9rem var(--mono);
  color: var(--accent);
  direction: ltr;
  text-align: start;
}
.format {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  width: 100%;
  min-height: 63px;
  text-align: start;
}
.format span {
  display: grid;
  gap: 4px;
}
.format small {
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--muted);
}
.display {
  display: grid;
  grid-template-rows: auto minmax(500px, 1fr) auto;
  overflow: hidden;
}
.display-header {
  min-height: 66px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--edge);
  flex-wrap: wrap;
}
.display-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.display-title h2 {
  font-size: 1rem;
  font-weight: 700;
}
.display-title p {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.35;
}
.display-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--edge);
  border-radius: 8px;
  flex: none;
}
.view-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.zoom-readout {
  min-width: 51px;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
}
.surface {
  min-width: 0;
  min-height: 0;
  position: relative;
  isolation: isolate;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
  overflow: hidden;
}
.surface.dragging {
  outline: 3px dashed var(--accent);
  outline-offset: -7px;
}
.display-footer {
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  color: var(--muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--edge);
  flex-wrap: wrap;
}
.display-footer input[type="range"] {
  width: min(240px, 55vw);
}
.compare-slider {
  display: flex;
  align-items: center;
  gap: 9px;
}
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 39px;
  padding: 6px 25px;
  border-top: 1px solid var(--edge);
  background: var(--bar);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: auto;
}
.statusbar #status {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.statusbar [role="alert"] {
  color: var(--danger);
}
.statusbar progress {
  height: 7px;
  width: 100px;
  accent-color: var(--accent);
}
.status-engine {
  font-size: 0.78rem;
  text-align: end;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  flex: none;
}
.dot.unavailable {
  background: var(--muted);
}
.drop-area,
.waiting {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 17px;
}
.drop-card {
  width: min(520px, 90%);
  padding: 37px 22px;
  background: var(--panel);
  border: 1px dashed var(--edge-strong);
  border-radius: 14px;
  text-align: center;
  box-shadow: var(--shadow);
  display: grid;
  justify-items: center;
  gap: 13px;
}
.drop-card .symbol {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 33%, var(--edge));
  border-radius: 13px;
}
.drop-card .symbol svg {
  width: 28px;
  height: 28px;
  stroke-width: 1.4;
}
.drop-card h2 {
  font-size: 1.22rem;
}
.drop-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}
.drop-card .primary {
  min-width: 148px;
  margin-top: 4px;
}
.waiting {
  color: var(--muted);
  text-align: center;
  padding: 25px;
}
.guides {
  position: absolute;
  inset: 14px;
  pointer-events: none;
  opacity: 0.55;
  background:
    linear-gradient(var(--edge-strong), var(--edge-strong)) left top/18px 1px
      no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) left top/1px 18px
      no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) right top/18px 1px
      no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) right top/1px 18px
      no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) left bottom/18px 1px
      no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) left bottom/1px 18px
      no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) right bottom/18px
      1px no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) right bottom/1px
      18px no-repeat;
}
.panes {
  position: absolute;
  inset: 0;
  display: flex;
  direction: ltr;
}
.pane {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.pane + .pane {
  border-left: 1px solid var(--edge-strong);
}
.pane-label {
  position: absolute;
  top: 12px;
  left: 12px;
  pointer-events: none;
  background: var(--panel);
  border: 1px solid var(--edge);
  padding: 4px 8px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 0.74rem;
  z-index: 2;
}
.pane canvas,
.viewport {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  touch-action: none;
  user-select: none;
}
.viewport.pan-mode {
  cursor: grab;
}
.viewport.panning {
  cursor: grabbing;
}
.viewport.crop-mode {
  cursor: crosshair;
}
.artboard {
  fill: #f8faf9;
}
.draft-board {
  fill: #102030;
  stroke: #526a7d;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.crop-shade {
  fill: #071320b8;
  fill-rule: evenodd;
  pointer-events: none;
}
.crop-boundary {
  stroke: #45cbb7;
  stroke-width: 1.7;
  fill: transparent;
  vector-effect: non-scaling-stroke;
  cursor: move;
}
.crop-grid {
  stroke: #76dece;
  stroke-opacity: 0.59;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.crop-handle {
  fill: #e1fff8;
  stroke: #156b64;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.crop-handle.n,
.crop-handle.s {
  cursor: ns-resize;
}
.crop-handle.w,
.crop-handle.e {
  cursor: ew-resize;
}
.crop-handle.nw,
.crop-handle.se {
  cursor: nwse-resize;
}
.crop-handle.ne,
.crop-handle.sw {
  cursor: nesw-resize;
}
.crop-mode .crop-boundary,
.crop-mode .crop-handle {
  cursor: crosshair;
}
.vector-path {
  fill: none;
  stroke: #70ddce;
  stroke-width: 1.05;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}
.vector-path.hole {
  stroke: #85b4ed;
}
.vector-path.open {
  stroke: #f5c783;
}
.vector-path.duplicate {
  stroke: #ff8fd7;
  stroke-dasharray: 3 2;
}
.vector-path.selected {
  stroke: #ffe083;
  stroke-width: 2.3;
}
.vector-path.over-raster {
  stroke: #087970;
  stroke-width: 1.5;
}
.vector-path.over-raster.selected {
  stroke: #a44d00;
}
.hit-path {
  fill: none;
  stroke: transparent;
  stroke-width: 10;
  vector-effect: non-scaling-stroke;
  pointer-events: stroke;
  cursor: pointer;
}
.hit-path:hover + .vector-path {
  stroke-width: 2.2;
}
.path-bounds,
.missing-box {
  fill: none;
  stroke: #ffc785;
  stroke-width: 1.2;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.missing-box {
  stroke: #cf583d;
  stroke-width: 2;
}
.crop-preview {
  width: 100%;
  max-height: 139px;
  display: block;
  background: #f2f6f8;
  object-fit: contain;
  border: 1px solid var(--edge);
  border-radius: 7px;
}
.path-list {
  max-height: 160px;
  overflow: auto;
  padding: 2px;
  display: grid;
  gap: 3px;
}
.path-list button {
  justify-content: space-between;
  text-align: start;
  min-height: 31px;
}
.path-list button small {
  color: var(--muted);
}
.path-list button.restorable {
  opacity: 0.65;
}
.inspector .path-inspection {
  margin-top: 4px;
}
.busy {
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}
dialog {
  width: min(470px, calc(100% - 30px));
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--edge);
  border-radius: 11px;
  padding: 19px;
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #071320a8;
}
dialog h2 {
  font-size: 1.12rem;
}
dialog p {
  color: var(--muted);
  line-height: 1.6;
  margin: 10px 0 18px;
}
@media (min-width: 1230px) {
  .workbench {
    grid-template-columns: 340px minmax(0, 1fr);
  }
  .step {
    gap: 10px;
  }
}
@media (max-width: 1050px) {
  .steps {
    padding-inline: 14px;
    display: flex;
  }
  .step {
    flex: 1;
  }
  .workbench {
    padding: 14px;
    gap: 11px;
    grid-template-columns: 285px minmax(0, 1fr);
  }
  .inspector {
    padding: 15px;
  }
  .topbar {
    padding-inline: 17px;
  }
  .display {
    grid-template-rows: auto minmax(450px, 1fr) auto;
  }
}
@media (max-width: 730px) {
  .workbench {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .display {
    order: -1;
    grid-template-rows: auto 355px auto;
  }
  .inspector {
    min-height: 0;
  }
  .topbar {
    height: 60px;
    gap: 10px;
  }
  .project {
    display: none;
  }
  .steps {
    padding: 7px 10px;
  }
  .step {
    min-height: 39px;
  }
  .statusbar {
    padding-inline: 12px;
  }
  .display-header {
    padding-inline: 10px;
  }
  .drop-card {
    padding: 24px 14px;
  }
}
.primary svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.inspector-head,
.inspector-actions {
  flex-shrink: 0;
}
.crop-coordinates {
  display: flex;
  gap: 6px;
  justify-content: flex-start;
  align-items: center;
}
@media (min-width: 731px) {
  .workbench {
    height: calc(100dvh - 178px);
    min-height: 595px;
    flex: none;
  }
  .inspector {
    min-height: 0;
    overflow: hidden;
  }
  .inspector-controls {
    min-height: 0;
    overflow: auto;
    padding: 2px;
    scrollbar-width: thin;
  }
  .inspector-controls > * {
    flex-shrink: 0;
  }
  .display {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
