/* Layout only — colors/controls come from Xel themes (https://xel-toolkit.org/) */
html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body {
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.app-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--foreground-color);
}
.app-header h1 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}
.app-header .subtitle {
  margin: 0;
  font-size: 0.8125rem;
  opacity: 0.7;
}
.app-header .actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.app-main {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}
.sidebar {
  width: 380px;
  min-width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  background: var(--foreground-color);
  overflow: hidden;
}
.sidebar x-tabs {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
}
.sidebar-panels {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px 16px;
}
.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tab-panel[hidden] {
  display: none !important;
}
/* Xel card sections */
.panel-card {
  margin: 0 !important;
  padding: 12px 14px !important;
  min-height: 0 !important;
  box-sizing: border-box;
}
.panel-card-title {
  margin: 0 0 12px;
  padding-bottom: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  opacity: 0.92;
}
.panel-hint {
  margin: 0 0 12px;
  font-size: 0.75rem;
  opacity: 0.72;
  line-height: 1.45;
}
.panel-hint a {
  color: var(--accent-color);
}
.panel-actions {
  margin-top: 2px;
}
.panel-actions x-button,
.panel-actions x-box {
  width: 100%;
}
.field {
  margin-bottom: 12px;
}
.field:last-child {
  margin-bottom: 0;
}
.field > label,
.field-label {
  display: block;
  font-size: 0.75rem;
  margin-bottom: 6px;
  opacity: 0.8;
}
.quality-hint {
  font-size: 0.6875rem;
  opacity: 0.65;
  font-weight: normal;
}
/* 两列表单：等宽列，标签顶对齐，控件等高底对齐 */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 12px;
  align-items: stretch;
  margin-bottom: 0;
}
.form-grid-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.form-grid-cell .field-label {
  margin: 0;
  line-height: 1.35;
  min-height: 1.35em;
}
.form-grid-cell x-select,
.form-grid-cell x-numberinput,
.form-grid-cell x-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-top: auto;
  min-height: 36px;
}
.field-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.field-row .field {
  flex: 1;
  min-width: 0;
}
/* 裁剪宽高锁定：未锁定描边 / 锁定强调色，图标随状态切换 */
.field-row x-box x-numberinput {
  flex: 1;
  min-width: 0;
}
.lock-ratio-btn {
  flex: 0 0 40px !important;
  width: 40px !important;
  min-width: 40px !important;
  height: 36px !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
  align-self: flex-end;
  border-radius: 6px !important;
  border: 1px solid var(--border-color) !important;
  background: var(--background-color) !important;
  color: var(--text-color, inherit) !important;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.lock-ratio-btn .lock-ratio-icon {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0 auto;
  background-color: currentColor;
  opacity: 0.88;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 11V7a5 5 0 0 1 9.9-1'/%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 11V7a5 5 0 0 1 9.9-1'/%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3C/svg%3E");
}
.lock-ratio-btn.is-locked,
.lock-ratio-btn[toggled].is-locked {
  border-color: var(--accent-color) !important;
  background: var(--accent-color) !important;
  color: #fff !important;
}
.lock-ratio-btn.is-locked .lock-ratio-icon,
.lock-ratio-btn[toggled].is-locked .lock-ratio-icon {
  opacity: 1;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
}
.field x-select,
.field x-slider,
.field x-numberinput,
.field x-input {
  width: 100%;
  max-width: 100%;
}

/* 可折叠分块 */
.panel-card.collapsible {
  padding: 0 !important;
  overflow: hidden;
}
.collapsible-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 11px 14px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.collapsible-head:hover {
  background: color-mix(in srgb, var(--accent-color) 8%, transparent);
}
.collapsible-title {
  font-size: 0.8125rem;
  font-weight: 600;
  opacity: 0.92;
}
.collapsible-chev {
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.6;
  transition: transform 0.18s ease;
  margin-right: 2px;
}
.panel-card.collapsed .collapsible-chev {
  transform: rotate(-45deg);
}
.collapsible-body {
  padding: 2px 14px 14px;
}
.panel-card.collapsed .collapsible-body {
  display: none;
}

/* 调整页：色调预设 */
.tone-preset-card {
  padding-bottom: 10px !important;
}
.tone-preset-card .field {
  margin-bottom: 0;
}
.auto-enhance-hint {
  margin: 10px 0 0;
  font-size: 0.6875rem;
  line-height: 1.5;
  opacity: 0.72;
}
.auto-enhance-hint[hidden] {
  display: none;
}
.preset-select-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.preset-select-row x-select {
  flex: 1;
  min-width: 0;
}
.preset-save-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* 保存本地预设弹层 */
.preset-dialog {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  width: min(360px, 92vw);
  background: var(--foreground-color);
  color: var(--text-color, inherit);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}
.preset-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
.preset-dialog-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.preset-dialog-label {
  display: block;
  font-size: 0.75rem;
  opacity: 0.8;
  margin-bottom: 6px;
}
.preset-dialog-input {
  width: 100%;
  box-sizing: border-box;
}
.preset-dialog-hint {
  margin: 8px 0 0;
  font-size: 0.6875rem;
  opacity: 0.65;
}
.preset-dialog-existing-wrap {
  margin-top: 14px;
}
.preset-dialog-existing-wrap[hidden] {
  display: none;
}
.preset-dialog-existing-title {
  font-size: 0.6875rem;
  opacity: 0.7;
  margin-bottom: 6px;
}
.preset-dialog-existing {
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}
.preset-existing-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-color);
}
.preset-existing-row:last-child {
  border-bottom: none;
}
.preset-existing-name {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 4px;
  border-radius: 4px;
}
.preset-existing-name:hover {
  background: color-mix(in srgb, var(--accent-color) 12%, transparent);
}
.preset-existing-del {
  flex: 0 0 auto;
  border: 1px solid var(--border-color);
  background: transparent;
  color: inherit;
  font-size: 0.6875rem;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  opacity: 0.8;
}
.preset-existing-del:hover {
  border-color: #d9534f;
  color: #d9534f;
  opacity: 1;
}
.preset-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.preset-dialog-primary {
  border-color: var(--accent-color) !important;
  color: var(--accent-color) !important;
  font-weight: 600;
}
.tone-preset-card x-select {
  width: 100%;
}
#tonePresetMenu x-menuitem[tone-preset-group] {
  pointer-events: none;
  opacity: 0.72;
  font-size: 0.6875rem;
}
.slider-field {
  margin-bottom: 16px;
}
.slider-field:last-child {
  margin-bottom: 0;
}
.slider-field > x-slider {
  display: block;
  margin-bottom: 6px;
}
.slider-hint {
  display: grid;
  grid-template-columns: minmax(4.8em, auto) 1fr minmax(4.8em, auto);
  gap: 6px;
  align-items: center;
}
.slider-hint-side {
  font-size: 0.625rem;
  line-height: 1.25;
  opacity: 0.72;
  text-align: center;
  color: var(--text-color, inherit);
}
.slider-hint-bar {
  position: relative;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
.slider-hint-bar[data-default-pct]::before {
  content: "";
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: calc(var(--default-pct, 50) * 1%);
  width: 2px;
  margin-left: -1px;
  background: var(--foreground-color);
  border: 1px solid var(--border-color);
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
  z-index: 2;
  pointer-events: none;
  opacity: 0.95;
}
.slider-hint-bar[data-default-pct="0"]::before,
.slider-hint-bar[data-default-pct="100"]::before {
  display: none;
}

[data-slider-hint="brightness"] .slider-hint-bar,
[data-slider-hint="exposure"] .slider-hint-bar {
  background: linear-gradient(
    to right,
    #0d0d0d 0%,
    #3d3d3d 22%,
    #8a8a8a 50%,
    #d4d4d4 78%,
    #fafafa 100%
  );
}
[data-slider-hint="highlights"] .slider-hint-bar {
  background: linear-gradient(
    to right,
    #6a6a6a 0%,
    #b8b8b8 50%,
    #ffffff 100%
  );
}
[data-slider-hint="shadows"] .slider-hint-bar {
  background: linear-gradient(
    to right,
    #050505 0%,
    #3a3a3a 50%,
    #8a8a8a 100%
  );
}
[data-slider-hint="temperature"] .slider-hint-bar {
  background: linear-gradient(
    to right,
    #2f6cf0 0%,
    #6fb0ff 28%,
    #d9d9d9 50%,
    #ffd479 72%,
    #ff9b1e 100%
  );
}
[data-slider-hint="tint"] .slider-hint-bar {
  background: linear-gradient(
    to right,
    #36c25a 0%,
    #bfe6c6 30%,
    #dddddd 50%,
    #eabfe6 70%,
    #d63bbf 100%
  );
}
[data-slider-hint="vibrance"] .slider-hint-bar {
  background: linear-gradient(
    to right,
    #9aa0a2 0%,
    #b7b0a0 32%,
    #d6b46a 55%,
    #f0913c 78%,
    #ff5d3b 100%
  );
}
[data-slider-hint="clarity"] .slider-hint-bar {
  background:
    linear-gradient(to right, rgba(255,255,255,0.25), transparent 50%),
    linear-gradient(
      to right,
      #8a8a8a 0%,
      #9a9a9a 48%,
      #2a2a2a 56%,
      #f0f0f0 64%,
      #4a4a4a 100%
    );
}
[data-slider-hint="vignette"] .slider-hint-bar {
  background:
    radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,0.65) 100%),
    linear-gradient(to right, #d8d8d8, #d8d8d8);
}
[data-slider-hint="grain"] .slider-hint-bar {
  background:
    radial-gradient(rgba(0,0,0,0.5) 0.5px, transparent 0.6px) 0 0 / 3px 3px,
    radial-gradient(rgba(255,255,255,0.5) 0.5px, transparent 0.6px) 1.5px 1.5px / 4px 4px,
    linear-gradient(to right, #efefef 0%, #9a9a9a 100%);
}
[data-slider-hint="contrast"] .slider-hint-bar {
  background:
    linear-gradient(to right, #8a8a8a 0%, #8a8a8a 28%, transparent 28%),
    repeating-linear-gradient(
      90deg,
      #1a1a1a 0px,
      #1a1a1a 5px,
      #f0f0f0 5px,
      #f0f0f0 10px
    );
  background-size: 100% 100%, auto;
  background-position: 0 0, 28% 0;
}
[data-slider-hint="hue"] .slider-hint-bar {
  background: linear-gradient(
    to right,
    hsl(200, 85%, 52%) 0%,
    hsl(260, 85%, 55%) 18%,
    hsl(320, 85%, 55%) 36%,
    hsl(20, 90%, 55%) 54%,
    hsl(80, 85%, 48%) 72%,
    hsl(140, 80%, 45%) 88%,
    hsl(200, 85%, 52%) 100%
  );
}
[data-slider-hint="saturation"] .slider-hint-bar {
  background: linear-gradient(
    to right,
    #9a9a9a 0%,
    #9a9a9a 22%,
    #e74c3c 38%,
    #f39c12 52%,
    #2ecc71 66%,
    #3498db 80%,
    #9b59b6 100%
  );
}
[data-slider-hint="level-black"] .slider-hint-bar {
  background: linear-gradient(
    to right,
    #2a2a2a 0%,
    #1a1a1a 45%,
    #080808 100%
  );
}
[data-slider-hint="level-white"] .slider-hint-bar {
  background: linear-gradient(
    to right,
    #6a6a6a 0%,
    #a8a8a8 40%,
    #e8e8e8 70%,
    #ffffff 100%
  );
}
[data-slider-hint="gamma"] .slider-hint-bar {
  background: linear-gradient(
    to right,
    #1f1f1f 0%,
    #4a4a4a 35%,
    #9a9a9a 65%,
    #e0e0e0 100%
  );
}
[data-slider-hint="blur"] .slider-hint-bar {
  background: repeating-linear-gradient(
    90deg,
    #3a3a3a 0 4px,
    #c5c5c5 4px 8px
  );
}
[data-slider-hint="blur"] .slider-hint-bar::after {
  content: "";
  position: absolute;
  inset: -2px -4px -2px 35%;
  border-radius: 0 4px 4px 0;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  background: rgba(128, 128, 128, 0.15);
  pointer-events: none;
}
[data-slider-hint="sharpen"] .slider-hint-bar {
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.35), transparent 55%),
    repeating-linear-gradient(
      90deg,
      #2a2a2a 0 2px,
      #e8e8e8 2px 4px
    );
}
[data-slider-hint="sharpen"] .slider-hint-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    #111 0 1px,
    #f5f5f5 1px 2px
  );
  mask-image: linear-gradient(to right, transparent 40%, black 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 40%, black 100%);
  pointer-events: none;
}
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.checkbox-group x-checkbox {
  margin: 0;
}
/* 变换：四个选项 2×2，节省纵向空间 */
.checkbox-group-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
  row-gap: 8px;
  margin-top: 2px;
}
.checkbox-group-2x2 x-checkbox {
  margin: 0;
  min-width: 0;
  width: 100%;
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.info-grid x-card.stat-card {
  margin: 0 !important;
  padding: 10px 12px !important;
  min-height: 0 !important;
}
.info-grid .label {
  font-size: 0.6875rem;
  opacity: 0.7;
}
.info-grid .value {
  font-size: 0.875rem;
  font-weight: 600;
}
.preset-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.preset-row x-button {
  width: 100%;
  justify-content: center;
}
.preview-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.preview-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-color);
  background: var(--foreground-color);
  font-size: 0.8125rem;
}
.preview-toolbar .muted {
  opacity: 0.7;
}
#wasmStatus.wasm-ok {
  color: var(--accent-color);
}
#wasmStatus.wasm-err {
  opacity: 0.85;
}
.preview-toolbar .spacer {
  flex: 1;
}
.preview-container {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: auto;
  background: var(--background-color);
}
.preview-pane {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  min-width: 0;
}
#resultImg {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
.preview-label {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.6875rem;
  background: var(--foreground-color);
  border: 1px solid var(--border-color);
  z-index: 5;
}
.preview-divider {
  width: 1px;
  flex-shrink: 0;
  background: var(--border-color);
}
.preview-empty {
  text-align: center;
  opacity: 0.6;
  font-size: 0.875rem;
}
.preview-empty .icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  opacity: 0.35;
}
#resultPane {
  position: relative;
}
.process-status {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 8px 12px;
  background: var(--foreground-color);
  border-bottom: 1px solid var(--border-color);
}
.process-status.active {
  display: block;
}
.process-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}
.process-status-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.process-status x-progressbar {
  margin-top: 6px;
  width: 100%;
}
.batch-list {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--background-color);
}
.batch-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  gap: 8px;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}
.batch-item:last-child {
  border-bottom: none;
}
.batch-item .name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.batch-item .status {
  font-size: 0.6875rem;
  padding: 2px 6px;
  border-radius: 4px;
}
.batch-item .status.ok {
  color: var(--accent-color);
}
.batch-item .status.err {
  opacity: 0.9;
}
.batch-item .status.pending {
  opacity: 0.65;
}
#batchProgress[hidden] {
  display: none !important;
}
#batchProgress {
  margin-top: 8px;
  width: 100%;
}
#fileInput,
#fileInputBatch {
  display: none;
}
#resultImg[hidden],
#origLabel[hidden],
#resultLabel[hidden],
.crop-wrap[hidden] {
  display: none !important;
}
.crop-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 100%;
  vertical-align: middle;
}
.crop-stage {
  position: relative;
  display: block;
  overflow: hidden;
  line-height: 0;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  /* 宽高由 layoutCropCanvas() 设置 */
}
.crop-stage img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  object-fit: fill;
  vertical-align: top;
}
.crop-canvas {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  margin: 0;
  padding: 0;
  border: none;
  box-sizing: border-box;
  pointer-events: auto;
  cursor: crosshair;
}
.crop-tool[hidden] {
  display: none !important;
}
.crop-tool {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  padding: 6px 10px;
  gap: 6px;
  align-items: center;
  font-size: 0.75rem;
  background: var(--foreground-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.crop-tool x-numberinput {
  width: 72px;
}
/* Accent color picker — swatch buttons in grid, no x-radio overlap */
.accent-swatch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}
.accent-swatch-grid x-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 56px;
  padding: 8px 4px !important;
  box-sizing: border-box;
}
.accent-swatch-grid x-swatch {
  flex-shrink: 0;
  width: 28px !important;
  height: 28px !important;
}
.accent-swatch-grid x-label {
  font-size: 0.625rem;
  text-transform: capitalize;
  opacity: 0.85;
  line-height: 1.2;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.8125rem;
  background: var(--foreground-color);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(120px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
  max-width: 360px;
}
#toast.show {
  transform: translateY(0);
  opacity: 1;
}
