:root {
  color-scheme: light;
  --bg: #eef2f7;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --panel-3: #edf1f6;
  --line: #e1e6ed;
  --line-strong: #c8d1dd;
  --text: #182234;
  --muted: #697487;
  --quiet: #9099a8;
  --accent: #2f7ff0;
  --accent-2: #1769d2;
  --accent-soft: #eaf2ff;
  --danger: #d73a49;
  --radius: 10px;
  --shadow: 0 22px 70px rgba(32, 49, 76, 0.18);
  font-family: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

body {
  user-select: none;
  font-size: 13px;
}

button, input, select {
  font: inherit;
}

button {
  color: inherit;
}

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

button:disabled {
  opacity: 0.38;
  cursor: default;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
}

.titlebar {
  height: 58px;
  display: flex;
  align-items: center;
  padding-left: 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  -webkit-app-region: drag;
}

.brand-block,
.title-actions,
.window-controls {
  display: flex;
  align-items: center;
}

.brand-block {
  min-width: 0;
  flex: 1;
  gap: 11px;
}

.brand-mark {
  width: 31px;
  height: 31px;
  color: var(--accent);
}

.brand-mark svg {
  width: 31px;
  height: 31px;
}

.brand-name {
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: -0.02em;
}

.brand-name img {
  display: block;
  width: auto;
  height: 23px;
  max-width: 126px;
}

.brand-name span {
  color: #8b95a5;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

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

.document-title {
  min-width: 0;
  max-width: 360px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-actions {
  gap: 7px;
  margin: 0 14px;
  -webkit-app-region: no-drag;
}

.icon-action,
.text-action,
.window-controls button,
.tool-button,
.square-button,
.quiet-button,
.wide-button,
.reset-link,
.ratio-grid button,
.transform-grid button,
.filter-tile,
.segmented button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.icon-action {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #657082;
}

.icon-action:hover:not(:disabled) {
  color: var(--text);
  background: #f0f3f7;
}

.text-action {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border-radius: 8px;
  color: #4e5a6d;
}

.text-action svg {
  width: 17px;
  height: 17px;
}

.text-action:hover:not(:disabled) {
  background: #f0f3f7;
}

.text-action.default-action {
  border: 1px solid #dce2ea;
  background: #f8fafc;
  color: #596578;
}

.text-action.default-action:hover:not(:disabled) {
  border-color: #a9c8ef;
  color: var(--accent-2);
}

.text-action.primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 5px 15px rgba(47, 127, 240, 0.2);
}

.text-action.primary:hover:not(:disabled) {
  background: #1f70df;
}

.window-controls {
  height: 100%;
  align-self: stretch;
  -webkit-app-region: no-drag;
}

.window-controls button {
  position: relative;
  width: 48px;
  height: 100%;
  color: #566174;
}

.window-controls button:hover {
  background: #eef1f5;
}

.window-controls button.close:hover {
  background: #c42b1c;
  color: white;
}

.window-controls span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 1px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.window-controls [data-window="maximize"] span {
  width: 10px;
  height: 10px;
  background: transparent;
  border: 1px solid currentColor;
}

.window-controls button.maximized [data-window="maximize"] span,
.window-controls #maximizeBtn.maximized span {
  box-shadow: 2px -2px 0 -1px #ffffff, 2px -2px 0 0 currentColor;
}

.window-controls .close span,
.window-controls .close span::after {
  width: 12px;
  height: 1px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.window-controls .close span::after {
  content: "";
  display: block;
  background: currentColor;
  transform: rotate(90deg);
}

.app-shell {
  height: calc(100% - 58px);
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr) 320px;
}

.tool-sidebar {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #ffffff;
  scrollbar-width: thin;
  scrollbar-color: #d5dbe4 transparent;
}

.tool-sidebar::-webkit-scrollbar { width: 6px; }
.tool-sidebar::-webkit-scrollbar-thumb { border-radius: 999px; background: #d5dbe4; }

.tool-mode-switch {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 14px 12px 5px;
  padding: 4px;
  border: 1px solid #e1e6ed;
  border-radius: 12px;
  background: #e7edf5;
}

.tool-mode-switch button {
  min-width: 0;
  height: 43px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #ffffff;
  color: #536176;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.tool-mode-switch button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.tool-mode-switch button:hover {
  color: #27364d;
  border-color: #d7e2ef;
}

.tool-mode-switch button.is-active {
  border-color: #2f7ff0;
  background: linear-gradient(135deg, #2f7ff0, #1769d2);
  color: #ffffff;
  box-shadow: 0 5px 14px rgba(47, 127, 240, .28);
}

.tool-mode-pane {
  flex: 0 0 auto;
  min-height: 0;
}

.format-nav {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 13px 14px;
}

.format-nav__summary {
  margin: 0 2px 3px;
  color: #7b8798;
  font-size: 9px;
  line-height: 1.55;
}

.format-nav__item {
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #f8fafc;
  color: #657184;
  text-align: left;
}

.format-nav__item svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.format-nav__item strong,
.format-nav__item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.format-nav__item strong { font-size: 10px; }
.format-nav__item small { margin-top: 2px; color: #929baa; font-size: 8px; }

.format-workspace {
  grid-column: 2 / -1;
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 0;
  background: #f3f6fa;
}

.tool-section-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #3b475a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

.tool-section-head {
  padding: 3px 3px 10px;
}

.tool-section-head small {
  margin-left: auto;
  color: #a2aab7;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .13em;
}

.tool-rail {
  flex: 0 0 auto;
  padding: 14px 13px 12px;
  background: #ffffff;
}

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

.tool-button {
  min-width: 0;
  min-height: 58px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 4px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #657184;
  transition: background 120ms ease, color 120ms ease;
}

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

.tool-button span {
  font-size: 10px;
  letter-spacing: 0.01em;
}

.tool-button:hover:not(:disabled) {
  background: #f4f6f9;
  color: var(--text);
}

.tool-button.active {
  border-color: #c8ddfb;
  background: var(--accent-soft);
  color: var(--accent-2);
}

.tool-button--export {
  grid-column: 1 / -1;
  min-height: 42px;
  flex-direction: row;
  gap: 8px;
  border-color: #dce3ec;
  background: #f8fafc;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0,1fr) 27px;
  background: #e8edf3;
}

.workspace-icon {
  width: 30px;
  height: 30px;
}

.workspace-export {
  height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.workspace-export svg {
  width: 16px;
  height: 16px;
}

.quiet-button,
.square-button,
.zoom-label {
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #667286;
}

.quiet-button {
  padding: 0 9px;
  font-size: 11px;
}

.quiet-button:hover:not(:disabled),
.square-button:hover:not(:disabled),
.zoom-label:hover {
  background: #eef2f7;
  color: var(--text);
}

.square-button {
  width: 30px;
  font-size: 17px;
}

.zoom-label {
  min-width: 52px;
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.canvas-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background-color: #e9edf3;
  background-image: radial-gradient(circle at 1px 1px, rgba(95, 111, 134, 0.16) 1px, transparent 1px);
  background-size: 20px 20px;
}

.canvas-actions {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px;
  border: 1px solid rgba(209, 219, 232, 0.96);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(43, 61, 87, 0.14);
  backdrop-filter: blur(14px);
}

.canvas-action-divider {
  width: 1px;
  height: 20px;
  margin: 0 3px;
  background: var(--line);
}

.drop-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(450px, calc(100% - 80px));
  padding: 46px 38px 36px;
  border: 1px solid #dce3ec;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 65px rgba(48, 63, 86, 0.14);
  text-align: center;
  transform: translate(-50%, -50%);
}

.drop-glow {
  position: absolute;
  inset: -80px 60px auto;
  height: 150px;
  background: rgba(47,127,240,0.1);
  filter: blur(42px);
  pointer-events: none;
}

.drop-icon {
  position: relative;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border: 1px solid #cfdff5;
  border-radius: 18px;
  background: #eef5ff;
  color: var(--accent);
}

.drop-icon svg {
  width: 33px;
  height: 33px;
}

.drop-card h1 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.035em;
}

.drop-card p {
  max-width: 330px;
  margin: 0 auto 22px;
  color: var(--muted);
  line-height: 1.65;
}

.large-button,
.wide-button {
  min-height: 36px;
  border-radius: 8px;
  cursor: pointer;
}

.large-button {
  min-width: 132px;
  padding: 0 20px;
  border: 0;
  color: white;
  background: var(--accent);
  font-weight: 650;
  box-shadow: 0 8px 22px rgba(47,140,255,0.25);
}

.large-button:hover {
  background: #489aff;
}

.format-line {
  display: block;
  margin-top: 20px;
  color: #8a95a7;
  font-size: 10px;
  letter-spacing: 0.055em;
}

.default-link {
  display: block;
  margin: 12px auto 0;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--accent-2);
  cursor: pointer;
  font-size: 11px;
}

.default-link:hover { color: #0f5fbe; }

.canvas-scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 38px;
}

.canvas-scroll.tool-mosaic #previewCanvas,
.canvas-scroll.tool-annotate #previewCanvas {
  cursor: crosshair;
}

.canvas-mat {
  min-width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#previewCanvas {
  max-width: none;
  display: block;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #dfe2e7 25%, transparent 25%),
    linear-gradient(-45deg, #dfe2e7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #dfe2e7 75%),
    linear-gradient(-45deg, transparent 75%, #dfe2e7 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  box-shadow: 0 20px 55px rgba(48, 63, 86, 0.25);
}

.drop-overlay {
  position: absolute;
  inset: 14px;
  z-index: 10;
  display: none;
  place-items: center;
  border: 2px dashed #4f97ff;
  border-radius: 16px;
  background: rgba(238, 245, 255, 0.94);
  color: #145ba8;
  font-size: 20px;
  font-weight: 650;
}

.drop-overlay.visible { display: grid; }

.busy-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(244, 247, 251, 0.82);
  backdrop-filter: blur(4px);
}

.busy-overlay[hidden],
.modal-backdrop[hidden],
.canvas-scroll[hidden] {
  display: none;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid #d7dee8;
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.statusbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 15px;
  color: #7a8597;
  border-top: 1px solid var(--line);
  background: #ffffff;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.status-spacer { flex: 1; }

.inspector {
  position: relative;
  min-width: 0;
  overflow-y: auto;
  padding: 20px 18px 24px;
  border-left: 1px solid var(--line);
  background: #ffffff;
}

.inspector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: #8d97a7;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.inspector h2,
.crop-dialog h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.reset-link {
  margin-top: 14px;
  padding: 3px 0;
  color: var(--accent-2);
  font-size: 11px;
}

.reset-link:hover:not(:disabled) { color: #0f5fbe; }

.tool-panel {
  display: none;
  animation: panel-in 140ms ease-out;
}

.tool-panel.active { display: block; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

.panel-copy {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.62;
  font-size: 11px;
}

.slider-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  margin: 0 0 17px;
}

.slider-row label {
  color: #c9cfd9;
  font-size: 11px;
}

.slider-row output {
  color: #8791a2;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.slider-row input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  height: 14px;
  margin: 0;
  appearance: none;
  background: transparent;
}

.slider-row input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: #333b49;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  margin-top: -5px;
  appearance: none;
  border: 2px solid #dceaff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 6px rgba(0,0,0,0.35);
}

.field-label {
  display: block;
  margin: 17px 0 8px;
  color: #aeb6c4;
  font-size: 10px;
}

.ratio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.ratio-grid button,
.segmented button {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #1b2029;
  color: #8e98a9;
  font-size: 10px;
}

.ratio-grid button:hover,
.segmented button:hover {
  border-color: var(--line-strong);
  color: #d2d8e1;
}

.ratio-grid button.selected,
.segmented button.selected {
  border-color: #3776c8;
  background: var(--accent-soft);
  color: #8abbff;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0;
}

.metric-grid > div {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #191e26;
}

.metric-grid span {
  display: block;
  margin-bottom: 4px;
  color: #6d7788;
  font-size: 9px;
}

.metric-grid strong {
  color: #dfe4ec;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.wide-button {
  width: 100%;
  padding: 0 14px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 580;
}

.wide-button + .wide-button { margin-top: 8px; }

.wide-button.primary {
  background: var(--accent);
  color: white;
}

.wide-button.primary:hover:not(:disabled) { background: #4598ff; }

.wide-button.subtle {
  border-color: var(--line);
  background: #1a1f27;
  color: #b4bdcb;
}

.wide-button.subtle:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: #202632;
}

.wide-button.large {
  min-height: 42px;
  margin-top: 18px;
  font-size: 12px;
}

.dimension-row {
  display: grid;
  grid-template-columns: 1fr 15px 1fr;
  align-items: end;
  gap: 7px;
}

.dimension-row > span {
  padding-bottom: 11px;
  color: #626d7f;
  text-align: center;
}

.dimension-row label,
.inline-field,
.crop-values label {
  color: #7e8899;
  font-size: 9px;
}

.dimension-row input,
.inline-field input,
.crop-values input,
.crop-toolbar select {
  width: 100%;
  height: 35px;
  margin-top: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #11151b;
  color: #e6eaf1;
  font-variant-numeric: tabular-nums;
}

.inline-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px;
}

.inline-field input { margin-top: 0; }

.inline-field span {
  padding-right: 10px;
  color: #727d8f;
}

.check-row {
  min-height: 35px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 0;
  color: #a7b0be;
  font-size: 11px;
}

.check-row input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.transform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 22px;
}

.transform-grid button {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #191e26;
  color: #aeb7c5;
  font-size: 10px;
}

.transform-grid button span {
  display: block;
  margin-bottom: 5px;
  color: #e4e9f0;
  font-size: 22px;
  line-height: 1;
}

.transform-grid button:hover {
  border-color: var(--line-strong);
  background: #202632;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.annotation-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.annotation-mode-grid button {
  height: 33px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #191e26;
  color: #909aaa;
  cursor: pointer;
  font-size: 10px;
}

.annotation-mode-grid button:hover {
  border-color: var(--line-strong);
  color: #d7dde6;
}

.annotation-mode-grid button.selected {
  border-color: #3776c8;
  background: var(--accent-soft);
  color: #9cc7ff;
}

.text-input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: #11151b;
  color: #e7ebf2;
  user-select: text;
}

.text-input:focus {
  border-color: #397ccc;
  box-shadow: 0 0 0 2px rgba(47, 140, 255, 0.14);
}

.color-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.color-row button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid #303746;
  border-radius: 50%;
  background: var(--swatch);
  cursor: pointer;
}

.color-row button.selected {
  border-color: #8fc1ff;
  box-shadow: 0 0 0 3px rgba(47, 140, 255, 0.2);
}

.panel-select {
  width: 100%;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #11151b;
  color: #e6eaf1;
}

.target-field {
  margin-bottom: 9px;
}

.compression-presets {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 18px;
}

.compression-presets button:nth-child(4),
.compression-presets button:nth-child(5) {
  grid-column: span 1;
}

.watermark-options {
  display: grid;
  grid-template-columns: 1fr 66px;
  gap: 10px;
  margin: 14px 0 18px;
  color: #7e8899;
  font-size: 9px;
}

.watermark-options select {
  width: 100%;
  height: 35px;
  margin-top: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #11151b;
  color: #e6eaf1;
}

.watermark-options input[type="color"] {
  width: 100%;
  height: 35px;
  margin-top: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #11151b;
}

.filter-tile {
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #191e26;
  color: #9da7b6;
  text-align: left;
  font-size: 10px;
}

.filter-tile.selected {
  border-color: #397ccc;
  color: #a9ceff;
  box-shadow: inset 0 0 0 1px rgba(47,140,255,0.25);
}

.swatch {
  display: block;
  height: 53px;
  margin-bottom: 7px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 72% 30%, rgba(255,235,170,.9), transparent 24%),
    linear-gradient(135deg, #506a9f, #d6a575 55%, #293b4f);
}

.swatch.vivid { filter: saturate(1.7) contrast(1.12); }
.swatch.warm { filter: sepia(.25) saturate(1.45) brightness(1.08); }
.swatch.cool { filter: hue-rotate(15deg) saturate(.82) brightness(1.03); }
.swatch.mono { filter: grayscale(1) contrast(1.15); }
.swatch.fade { filter: saturate(.6) brightness(1.13) contrast(.82); }
.swatch.dramatic { filter: contrast(1.5) saturate(.86) brightness(.78); }
.swatch.film { filter: sepia(.25) saturate(.86) contrast(1.14) brightness(1.03); }

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.export-metrics { margin-bottom: 8px; }

.inspector-empty {
  padding: 34px 12px;
  text-align: center;
}

.inspector-empty[hidden] { display: none; }

.empty-mini-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin: 0 auto 13px;
  border-radius: 11px;
  background: #19202a;
  color: #7198cb;
}

.inspector-empty h3 {
  margin: 0 0 7px;
  font-size: 13px;
}

.inspector-empty p {
  margin: 0;
  color: #6f798a;
  line-height: 1.65;
  font-size: 10px;
}

/* ---------------------------------------------------------- light controls */

.panel-copy {
  color: #6f7a8c;
}

.slider-row label { color: #445064; }
.slider-row output { color: #7a8597; }

.slider-row input[type="range"]::-webkit-slider-runnable-track {
  background: #d9e0e9;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
  border-color: #ffffff;
  background: var(--accent);
  box-shadow: 0 1px 6px rgba(34, 73, 123, 0.26);
}

.field-label { color: #637085; }

.ratio-grid button,
.segmented button,
.transform-grid button,
.annotation-mode-grid button,
.filter-tile {
  border-color: #dce3ec;
  background: #ffffff;
  color: #5f6b7e;
}

.ratio-grid button:hover,
.segmented button:hover,
.transform-grid button:hover,
.annotation-mode-grid button:hover {
  border-color: #b7c5d6;
  background: #f7f9fc;
  color: #263348;
}

.ratio-grid button.selected,
.segmented button.selected,
.annotation-mode-grid button.selected,
.filter-tile.selected {
  border-color: #8db9ef;
  background: var(--accent-soft);
  color: var(--accent-2);
}

.metric-grid > div {
  border-color: #e0e6ee;
  background: #f7f9fc;
}

.metric-grid span { color: #818c9d; }
.metric-grid strong { color: #263349; }

.wide-button.subtle {
  border-color: #dbe2eb;
  background: #f7f9fc;
  color: #536074;
}

.wide-button.subtle:hover:not(:disabled) {
  border-color: #b7c5d6;
  background: #eef2f7;
}

.wide-button.primary:hover:not(:disabled) { background: #1f70df; }

.dimension-row > span,
.dimension-row label,
.inline-field,
.crop-values label,
.watermark-options {
  color: #7f8a9b;
}

.dimension-row input,
.inline-field input,
.crop-values input,
.crop-toolbar select,
.text-input,
.panel-select,
.watermark-options select,
.watermark-options input[type="color"] {
  border-color: #dce3ec;
  background: #ffffff;
  color: #263349;
}

.text-input::placeholder { color: #a6afbc; }

.text-input:focus {
  border-color: #72a7e8;
  box-shadow: 0 0 0 3px rgba(47, 127, 240, 0.11);
}

.inline-field span { color: #8792a3; }
.check-row { color: #5b677a; }

.transform-grid button span { color: #263349; }

.color-row button {
  border-color: #d3dbe5;
}

.color-row button.selected {
  border-color: #6fa5e8;
  box-shadow: 0 0 0 3px rgba(47, 127, 240, 0.14);
}

.filter-tile { color: #657184; }

.inspector-empty {
  border: 1px dashed #dbe2eb;
  border-radius: 12px;
  background: #fafbfd;
}

.empty-mini-icon {
  background: #edf4ff;
  color: var(--accent);
}

.inspector-empty p { color: #7c8798; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 34px;
  background: rgba(26, 38, 55, 0.34);
  backdrop-filter: blur(8px);
}

.crop-dialog {
  width: min(1120px, 94vw);
  height: min(820px, 90vh);
  display: grid;
  grid-template-rows: auto auto minmax(0,1fr) auto;
  overflow: hidden;
  border: 1px solid #dbe2eb;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.default-dialog {
  width: min(520px, calc(100vw - 48px));
  overflow: hidden;
  border: 1px solid #dbe2eb;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

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

.default-dialog-body p {
  margin: 0 0 14px;
  color: #687487;
  line-height: 1.65;
  font-size: 11px;
}

.default-dialog-body .default-hint {
  margin: 17px 0 0;
  padding: 11px 13px;
  border: 1px solid #e0e6ee;
  border-radius: 8px;
  background: #f7f9fc;
  color: #6f7b8d;
}

.default-hint strong { color: #263349; }

.format-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.format-pills span {
  padding: 4px 8px;
  border: 1px solid #dce3ec;
  border-radius: 6px;
  background: #f7f9fc;
  color: #536074;
  font-size: 9px;
  font-weight: 650;
}

.default-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.default-dialog-actions .wide-button {
  width: auto;
  min-width: 116px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 21px 13px;
  border-bottom: 1px solid var(--line);
}

.dialog-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #748094;
  cursor: pointer;
  font-size: 22px;
}

.dialog-close:hover { background: #eef2f7; color: var(--text); }

.crop-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--line);
  color: #748094;
  font-size: 9px;
}

.crop-toolbar select { width: 134px; }

.crop-values {
  display: grid;
  grid-template-columns: repeat(4, 78px);
  gap: 7px;
}

.crop-values input {
  height: 31px;
  margin-top: 4px;
}

.crop-workspace {
  position: relative;
  overflow: hidden;
  background-color: #e9edf3;
  background-image: radial-gradient(circle at 1px 1px, rgba(95, 111, 134, 0.16) 1px, transparent 1px);
  background-size: 18px 18px;
}

#cropCanvas {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  transform: translate(-50%, -50%);
}

.crop-shade {
  position: absolute;
  pointer-events: none;
}

.crop-box {
  position: absolute;
  border: 1px solid rgba(255,255,255,.94);
  box-shadow: 0 0 0 9999px rgba(0,0,0,.56);
  pointer-events: auto;
  cursor: move;
}

.crop-grid-line {
  position: absolute;
  background: rgba(255,255,255,.22);
  pointer-events: none;
}

.crop-grid-line.v1 { top: 0; bottom: 0; left: 33.333%; width: 1px; }
.crop-grid-line.v2 { top: 0; bottom: 0; left: 66.666%; width: 1px; }
.crop-grid-line.h1 { left: 0; right: 0; top: 33.333%; height: 1px; }
.crop-grid-line.h2 { left: 0; right: 0; top: 66.666%; height: 1px; }

.crop-handle {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 2px solid white;
  border-radius: 3px;
  background: var(--accent);
}

.crop-handle.nw { left: -7px; top: -7px; cursor: nwse-resize; }
.crop-handle.ne { right: -7px; top: -7px; cursor: nesw-resize; }
.crop-handle.sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.crop-handle.se { right: -7px; bottom: -7px; cursor: nwse-resize; }

.dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 19px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.dialog-actions .wide-button { width: auto; min-width: 102px; }
.dialog-spacer { flex: 1; }

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 42px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: 370px;
  padding: 10px 14px;
  border: 1px solid #d9e1eb;
  border-radius: 9px;
  background: #ffffff;
  color: #344156;
  box-shadow: 0 12px 30px rgba(48, 63, 86, 0.18);
  animation: toast-in 160ms ease-out;
}

.toast.error { border-color: #efc8cd; color: #b42335; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

@media (max-height: 760px) {
  .tool-rail { padding: 10px; }
  .tool-section-head { padding-bottom: 7px; }
  .tool-grid { gap: 5px; }
  .tool-button { min-height: 49px; gap: 3px; padding: 4px; }
  .tool-button svg { width: 19px; height: 19px; }
  .tool-button span { font-size: 9px; }
  .tool-button--export { min-height: 36px; }
}

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 196px minmax(0, 1fr) 288px; }
  .tool-rail { padding-left: 11px; padding-right: 11px; }
  .document-title { max-width: 210px; }
  .canvas-scroll { padding: 25px; }
  .workspace-icon { width: 28px; height: 28px; }
  .workspace-export { padding: 0 8px; }
  .quiet-button { padding: 0 6px; font-size: 10px; }
  .zoom-label { min-width: 42px; }
}

@media (max-width: 880px) {
  .app-shell { grid-template-columns: 178px minmax(0, 1fr) 250px; }
  .title-actions .text-action:not(.primary) { display: none; }
  .brand-name span, .title-divider { display: none; }
  .tool-button { min-height: 54px; }
  .tool-button span { font-size: 9px; }
}
