:root {
  --bg: #0d1017;
  --bg-2: #111622;
  --panel: rgba(22, 27, 39, 0.88);
  --card: rgba(31, 37, 52, 0.82);
  --card-2: rgba(39, 47, 65, 0.76);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f7f9ff;
  --muted: #a7b0c2;
  --muted-2: #7c879d;
  --primary: #2ee6ff;
  --primary-2: #3c8cff;
  --accent: #ffb13d;
  --danger: #ff6270;
  --ok: #53e39d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 0%, rgba(46, 230, 255, 0.14), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(255, 177, 61, 0.13), transparent 24%),
    linear-gradient(135deg, #080a10 0%, #121827 50%, #0d1017 100%);
  overflow: hidden;
}

.activation-body {
  overflow: auto;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px;
  gap: 16px;
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(22, 27, 39, 0.92), rgba(15, 19, 29, 0.76));
  box-shadow: var(--shadow);
  padding: 14px 18px;
  backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 1 auto;
  min-width: 0;
}

.logo-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #031016;
  font-weight: 900;
  letter-spacing: -1px;
  box-shadow: 0 16px 32px rgba(46, 230, 255, 0.22);
  overflow: hidden;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.brand-block p,
.small-note {
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 3px;
}

.top-actions,
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions {
  flex: 0 0 auto;
}

.gear-btn {
  width: 40px;
  min-width: 40px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.workspace {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 360px minmax(420px, 1fr) 310px;
  gap: 16px;
}

.panel,
.preview-panel {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.panel {
  padding: 14px;
  overflow-y: auto;
}

.left-panel,
.right-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.left-card-design {
  order: 1;
}

.batch-settings-card {
  order: 2;
}

.left-card-font {
  order: 3;
}

.color-settings-card {
  order: 4;
}

.left-card-main {
  order: 5;
}

.left-card-keyring {
  order: 6;
}

.left-card-custom-artwork {
  order: 6;
}

.left-card-symbol {
  order: 7;
}

.card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--card), rgba(25, 30, 43, 0.72));
  border-radius: 20px;
  padding: 16px;
}

.collapsible-card.is-collapsed > :not(.card-title-row) {
  display: none;
}

.collapse-toggle {
  min-width: 58px;
}

.hero-card {
  background:
    linear-gradient(135deg, rgba(46, 230, 255, 0.13), rgba(255, 177, 61, 0.08)),
    linear-gradient(180deg, var(--card), rgba(25, 30, 43, 0.72));
}

.section-label {
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 8px;
}

.field-label,
label {
  display: block;
  color: #cbd3e3;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 7px;
}

.text-input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(8, 10, 16, 0.72);
  color: var(--text);
  padding: 0 14px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.01em;
  outline: none;
}

.font-select-stack {
  min-width: 0;
  flex: 1;
}

.font-search-input {
  width: 100%;
  max-width: 190px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(8, 10, 16, 0.72);
  color: var(--text);
  padding: 0 11px;
  font-size: 13px;
  font-weight: 750;
  outline: none;
  margin-bottom: 8px;
}

.font-search-input::placeholder {
  color: var(--muted-2);
}

.select-input {
  width: 100%;
  max-width: 190px;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(8, 10, 16, 0.72);
  color: var(--text);
  padding: 0 34px 0 12px;
  font-size: 14px;
  font-weight: 850;
  outline: none;
}

.select-input option {
  background: #111622;
  color: var(--text);
}

.text-input:focus,
.select-input:focus,
.input-with-unit input:focus {
  border-color: rgba(46, 230, 255, 0.62);
  box-shadow: 0 0 0 4px rgba(46, 230, 255, 0.08);
}

.card-title-row,
.control-row,
.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid var(--border);
}

.status-pill.warning {
  color: #2b1c00;
  background: var(--accent);
}

.status-pill.ok {
  color: #022416;
  background: var(--ok);
}

.upload-zone {
  margin-top: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 14px;
  background: rgba(7, 9, 14, 0.4);
}

.upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(46, 230, 255, 0.08);
}

.upload-zone p {
  color: var(--muted-2);
  font-size: 12px;
  margin-top: 8px;
  line-height: 1.45;
}

.image-logo-preview {
  width: 100%;
  max-height: 160px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.06);
}

.custom-artwork-preview-box {
  min-height: 132px;
  margin: 12px 0;
  border: 1px solid rgba(46, 230, 255, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(220, 232, 238, 0.78)),
    repeating-linear-gradient(45deg, rgba(15, 23, 42, 0.05) 0 8px, rgba(15, 23, 42, 0.09) 8px 16px);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.custom-artwork-preview {
  width: 100%;
  max-height: 132px;
  object-fit: contain;
  padding: 10px;
}

.custom-artwork-placeholder {
  padding: 18px;
  color: #273241;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.compact-toggle {
  margin: 10px 0 12px;
}

.background-toggle {
  margin: 10px 0 0;
  width: 100%;
}

.quality-toggle {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 10px 0 0;
  width: 100%;
}

.image-logo-option-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 9, 14, 0.24);
}

.image-logo-option-panel label {
  margin-top: 10px;
}

.image-logo-option-panel > label:first-child {
  margin-top: 0;
}

.image-logo-processing {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid rgba(46, 230, 255, 0.26);
  border-radius: 14px;
  background: rgba(6, 11, 18, 0.82);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
  color: var(--text);
}

.image-logo-processing strong,
.image-logo-processing span {
  display: block;
}

.image-logo-processing strong {
  font-size: 12px;
  line-height: 1.2;
}

.image-logo-processing span {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.35;
}

.image-logo-spinner {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: rk3d-spin 0.8s linear infinite;
}

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

.color-field-wide {
  width: 100%;
  height: 38px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(7, 9, 14, 0.34);
}

.compact-color-field {
  margin-top: 6px;
}

.simple-color-picker {
  margin-top: 8px;
}

.native-color-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.simple-color-control {
  position: relative;
}

.simple-color-trigger {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(7, 9, 14, 0.34);
  color: var(--text);
  cursor: pointer;
  padding: 7px 10px;
  text-align: left;
}

.simple-color-control.disabled .simple-color-trigger {
  cursor: not-allowed;
  opacity: 0.55;
}

.simple-color-selected {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: var(--simple-color);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.simple-color-label {
  font-weight: 800;
  font-size: 12px;
}

.simple-color-hex {
  color: var(--muted-2);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.simple-color-menu {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(15, 19, 30, 0.98);
  box-shadow: var(--shadow);
  padding: 10px;
}

.simple-color-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.simple-color-option {
  min-width: 0;
  min-height: 30px;
  padding: 0;
}

.simple-color-custom {
  width: 100%;
  margin-top: 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(46, 230, 255, 0.08);
  color: var(--primary);
  cursor: pointer;
  font-weight: 800;
  padding: 8px 10px;
}

.image-logo-slot-picker {
  min-width: 0;
  position: relative;
}

.image-logo-color-slots {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.image-logo-color-row {
  display: grid;
  grid-template-columns: 34px minmax(72px, 0.85fr) minmax(138px, 1.15fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 9, 14, 0.28);
}

.image-logo-color-swatch {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.image-logo-color-meta {
  min-width: 0;
}

.image-logo-color-meta strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.image-logo-color-meta span {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
  margin-top: 2px;
}

.image-logo-color-row input[type="color"] {
  width: 42px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
}

.warning-note {
  color: #ffd166;
}

code {
  color: var(--primary);
  background: rgba(46, 230, 255, 0.07);
  padding: 2px 5px;
  border-radius: 6px;
}

.control-row {
  margin-top: 15px;
}

.control-row:first-of-type {
  margin-top: 0;
}

.option-row {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(7, 9, 14, 0.28);
}

.option-row label {
  margin-bottom: 2px;
}

.option-row .small-note {
  margin-top: 0;
}

.input-with-unit {
  width: 118px;
  height: 38px;
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(8, 10, 16, 0.66);
  overflow: hidden;
}

.input-with-unit input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 0 8px 0 11px;
  font-weight: 800;
}

.input-with-unit span {
  color: var(--muted-2);
  font-size: 11px;
  padding-right: 10px;
  font-weight: 800;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  margin: 8px 0 4px;
}

.split-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.split-controls .input-with-unit {
  width: 100%;
}

.switch {
  position: relative;
  width: 52px;
  height: 30px;
  margin: 0;
}

.switch input {
  display: none;
}

.switch span {
  position: absolute;
  inset: 0;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(8, 10, 16, 0.74);
  transition: 0.2s ease;
}

.switch span::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  top: 3px;
  left: 4px;
  border-radius: 50%;
  background: var(--muted-2);
  transition: 0.2s ease;
}

.switch input:checked + span {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.switch input:checked + span::before {
  transform: translateX(20px);
  background: white;
}

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

.btn {
  border: 0;
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  height: 40px;
  padding: 0 14px;
  font-weight: 850;
  font-size: 13px;
  letter-spacing: -0.01em;
  transition: transform 0.15s ease, border 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  color: #061017;
  background: linear-gradient(135deg, var(--accent), #ffe067);
  box-shadow: 0 14px 28px rgba(255, 177, 61, 0.2);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #ff6270, #d9364a);
  box-shadow: 0 14px 28px rgba(255, 98, 112, 0.2);
}

.btn-secondary {
  color: #061017;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.btn-ghost,
.btn-small {
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.055);
}

.btn-small {
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.btn-small.active {
  color: #061017;
  background: var(--primary);
}

.btn-wide {
  width: 100%;
  margin-top: 12px;
}

.two-button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.three-button-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  width: 100%;
}

.two-button-row .btn,
.three-button-row .btn {
  width: 100%;
}

.image-logo-action-row .btn {
  padding-left: 10px;
  padding-right: 10px;
}

.color-settings-card[hidden] {
  display: none !important;
}

.color-control-group[hidden] {
  display: none !important;
}

.color-control-group {
  margin-top: 16px;
}

.color-control-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.color-control-title label {
  margin: 0;
}

.color-input {
  width: 44px;
  height: 34px;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.color-chip-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.color-chip {
  width: 100%;
  aspect-ratio: 1;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: var(--chip-color);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.color-chip.active {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.color-count-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.color-chip-grid-summary {
  grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
}

.color-chip-summary {
  display: block;
}

.color-summary-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.symbol-status-row {
  margin: 6px 0 12px;
}


.symbol-layer-row {
  margin: 8px 0 12px;
}

.symbol-layer-select {
  max-width: 100%;
}

.symbol-rotate-buttons {
  margin-top: 12px;
}

.symbol-mirror-buttons {
  margin-top: 8px;
}

.symbol-rotate-note {
  margin-top: 10px;
  color: var(--muted);
}

.symbol-move-wrap .btn-wide {
  margin-top: 0;
}

.preview-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  position: relative;
}

.preview-toolbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.preview-toolbar .toolbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.viewer {
  flex: 1;
  min-height: 0;
  position: relative;
  background:
    radial-gradient(circle at 50% 35%, rgba(46, 230, 255, 0.10), transparent 34%),
    linear-gradient(180deg, rgba(15, 19, 30, 0.94), rgba(7, 9, 14, 0.98));
}

.viewer canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.viewer-footer {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 8px;
}

.legend-dot:first-child {
  margin-left: 0;
}

.base-dot {
  background: #56606b;
}

.text-dot {
  background: #a7adb4;
}

.ring-dot {
  background: var(--accent);
}

.symbol-dot {
  background: var(--primary);
}


.viewer canvas.keyring-hover,
.viewer canvas.symbol-hover,
.viewer canvas.impact-circle-hover,
.viewer canvas.batch-name-hover,
.viewer canvas.clicker-part-hover {
  cursor: grab;
}

.viewer canvas.symbol-rotate-hover {
  cursor: alias;
}

.viewer canvas.dragging-keyring,
.viewer canvas.dragging-symbol,
.viewer canvas.dragging-impact-circle,
.viewer canvas.dragging-batch-name {
  cursor: grabbing;
}

.viewer canvas.keyring-place-mode,
.viewer canvas.symbol-place-mode,
.viewer canvas.move-keyhole-mode,
.viewer canvas.move-symbol-mode {
  cursor: crosshair;
}

#moveKeyholeBtn.active,
#moveSymbolBtn.active,
#mirrorSymbolHorizontalBtn.active,
#mirrorSymbolVerticalBtn.active {
  color: #061017;
  background: linear-gradient(135deg, var(--accent), #ffe067);
  box-shadow: 0 14px 28px rgba(255, 177, 61, 0.2);
}

.export-card {
  background:
    linear-gradient(135deg, rgba(255, 177, 61, 0.12), rgba(46, 230, 255, 0.07)),
    linear-gradient(180deg, var(--card), rgba(25, 30, 43, 0.72));
}

.export-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.metrics div {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: rgba(7, 9, 14, 0.35);
}

.metrics span {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 19px;
  letter-spacing: -0.03em;
}

.warnings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.warning-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.052);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.warning-item.ok .warning-icon {
  color: var(--ok);
}

.warning-item.warn .warning-icon {
  color: var(--accent);
}

.warning-item.bad .warning-icon {
  color: var(--danger);
}

.warning-icon {
  font-weight: 900;
}

.tool-selector-card {
  position: relative;
}

.left-card-tool {
  order: 0;
  background:
    linear-gradient(135deg, rgba(46, 230, 255, 0.12), rgba(255, 177, 61, 0.07)),
    linear-gradient(180deg, var(--card), rgba(25, 30, 43, 0.72));
}

.left-card-tool h2 {
  margin-bottom: 10px;
}

.tool-selector-toggle {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(46, 230, 255, 0.14), rgba(255, 177, 61, 0.09)),
    rgba(7, 10, 16, 0.64);
  color: var(--text);
  padding: 12px;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045);
}

.tool-selector-toggle:focus-visible,
.tool-menu-item:focus-visible {
  outline: none;
  border-color: rgba(46, 230, 255, 0.68);
  box-shadow: 0 0 0 4px rgba(46, 230, 255, 0.10);
}

.tool-selector-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 900;
}

.tool-selector-main span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-selector-menu-icon {
  grid-column: 1;
}

#activeToolName {
  grid-column: 2;
}

#paracordActiveToolNewBadge {
  grid-column: 3;
}

#paracordActiveToolNewBadge[hidden] {
  display: none !important;
}

.tool-selector-caret {
  grid-column: 4;
}

.tool-selector-menu-icon,
.tool-selector-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--primary);
  font-size: 13px;
  line-height: 1;
}

.tool-selector-description {
  display: block;
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-selector-menu {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.tool-selector-menu[hidden] {
  display: none;
}

.tool-menu-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  padding: 10px 11px;
  text-align: left;
  cursor: pointer;
}

.tool-menu-item:hover {
  border-color: rgba(46, 230, 255, 0.38);
  background: rgba(255, 255, 255, 0.07);
}

.tool-menu-item.active {
  border-color: rgba(46, 230, 255, 0.62);
  background:
    linear-gradient(135deg, rgba(46, 230, 255, 0.16), rgba(89, 255, 169, 0.08)),
    rgba(255, 255, 255, 0.06);
}

.tool-menu-item strong,
.tool-menu-item small {
  display: block;
}

.tool-menu-item strong {
  font-size: 13px;
  line-height: 1.2;
}

.tool-menu-item small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.35;
}

.tool-menu-item em {
  display: none;
  align-self: center;
  border-radius: 999px;
  padding: 5px 7px;
  background: rgba(89, 255, 169, 0.12);
  color: var(--ok);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tool-menu-item.active em {
  display: inline-flex;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 5, 12, 0.68);
  backdrop-filter: blur(12px);
}

.modal-backdrop[hidden] {
  display: none;
}

.settings-modal {
  width: min(620px, 96vw);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(31, 37, 52, 0.98), rgba(18, 23, 35, 0.98));
  box-shadow: var(--shadow);
  padding: 18px;
}

.export-modal {
  width: min(520px, 94vw);
}

.license-settings-modal {
  width: min(760px, 96vw);
}

.custom-editor-modal {
  width: min(1120px, 96vw);
  max-height: min(860px, 92vh);
  overflow: auto;
}

.symbol-picker-modal {
  width: min(620px, 94vw);
}

.symbol-picker-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.symbol-category-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.symbol-category-chip:hover,
.symbol-category-chip:focus-visible {
  border-color: rgba(46, 230, 255, 0.52);
  color: var(--text);
  outline: none;
}

.symbol-category-chip.active {
  border-color: rgba(46, 230, 255, 0.72);
  background: rgba(46, 230, 255, 0.13);
  color: var(--primary);
}

.symbol-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  margin-top: 14px;
  max-height: min(460px, 54vh);
  overflow: auto;
  padding-right: 4px;
}

.my-symbols-panel {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
}

.my-symbols-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.custom-symbol-draft {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.custom-symbol-draft-preview {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.custom-symbol-draft-preview img {
  width: 68px;
  height: 68px;
  display: block;
  object-fit: contain;
}

.custom-symbol-draft-preview span {
  color: rgba(17, 24, 39, 0.6);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.custom-symbol-draft-form {
  min-width: 0;
}

.custom-symbol-draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.symbol-picker-item {
  min-height: 116px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  padding: 10px;
  cursor: pointer;
}

.symbol-picker-item:hover,
.symbol-picker-item:focus-visible {
  border-color: rgba(46, 230, 255, 0.58);
  background: rgba(255, 255, 255, 0.075);
  outline: none;
}

.symbol-picker-preview {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.symbol-picker-preview img {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
}

.symbol-picker-name {
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.symbol-picker-item.custom-symbol {
  position: relative;
}

.symbol-picker-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 98, 112, 0.5);
  border-radius: 999px;
  background: rgba(13, 16, 24, 0.88);
  color: var(--danger);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.symbol-picker-remove:hover,
.symbol-picker-remove:focus-visible {
  border-color: var(--danger);
  background: rgba(255, 98, 112, 0.14);
  outline: none;
}

.symbol-picker-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  margin-top: 18px;
}

.settings-preview-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(7, 9, 14, 0.35);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 164px;
}

.settings-logo-preview {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #031016;
  font-weight: 900;
  font-size: 24px;
  overflow: hidden;
}

.settings-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-fields label {
  margin-top: 12px;
}

.settings-fields label:first-child {
  margin-top: 0;
}

.custom-editor-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-weight: 900;
  margin-bottom: 10px;
}

.custom-editor-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 12px;
}

.custom-editor-composer-modal {
  width: min(1540px, 99.5vw);
  max-height: min(960px, 97vh);
  padding-inline: 12px;
}

.custom-editor-composer {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.custom-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(7, 9, 14, 0.28);
  padding: 10px;
}

.custom-editor-toolbar .btn {
  min-height: 40px;
}

.custom-editor-toolbar .btn-primary {
  margin-left: auto;
}

.custom-editor-commit-status {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.35;
  max-width: 280px;
  text-align: right;
}

.custom-editor-commit-status.is-pending {
  color: #a5f3fc;
}

.custom-editor-commit-status + .btn-primary {
  margin-left: 0;
}

.custom-editor-history-button:not(:disabled) {
  border-color: rgba(46, 230, 255, 0.38);
  background: rgba(46, 230, 255, 0.08);
}

.custom-editor-composer-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 270px);
  gap: 10px;
}

.custom-editor-canvas-panel,
.custom-editor-inspector {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(7, 9, 14, 0.34);
  padding: 8px;
}

.custom-editor-canvas {
  position: relative;
  min-height: min(70vh, 680px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 42%, rgba(46, 230, 255, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045));
  overflow: auto;
  display: grid;
  place-items: start center;
  padding: 6px;
  overscroll-behavior: contain;
}

.custom-editor-stage {
  position: relative;
  width: 720px;
  height: 420px;
  flex: 0 0 auto;
  transform-origin: top left;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(46, 230, 255, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(238, 248, 255, 0.17), rgba(130, 151, 166, 0.10));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.105);
}

.custom-editor-canvas-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.115) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.115) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.58;
}

.custom-editor-object-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  touch-action: none;
}

.custom-editor-object {
  position: absolute;
  left: 0;
  top: 0;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(244, 250, 255, 0.14);
  color: #111111;
  padding: 0;
  font: 900 24px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
  white-space: pre;
  cursor: grab;
  user-select: none;
  transform-origin: center center;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.24),
    0 0 0 1px rgba(4, 10, 16, 0.10);
}

.custom-editor-object::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 14px;
}

.custom-editor-object-preview {
  position: relative;
  z-index: 1;
  display: block;
  line-height: 1;
  pointer-events: none;
}

.custom-editor-object-text-hit {
  position: absolute;
  z-index: 3;
  inset: 0;
  border-radius: inherit;
  cursor: text;
}

.custom-editor-object-preview.fallback {
  padding: 0 1px;
}

.custom-editor-object-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.custom-editor-object-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.custom-editor-object-label {
  pointer-events: none;
}

.custom-editor-object:hover {
  border-color: rgba(46, 230, 255, 0.52);
  background: rgba(244, 250, 255, 0.20);
}

.custom-editor-object.selected {
  border-color: rgba(46, 230, 255, 0.78);
  background: rgba(244, 250, 255, 0.18);
  box-shadow:
    0 0 0 1px rgba(46, 230, 255, 0.22),
    0 8px 18px rgba(0, 0, 0, 0.18);
}

/* Phase 9C-FIX2: every Ctrl+clicked object stays visibly selected. The
   primary object keeps the solid outline and owns the single-object handles. */
.custom-editor-object.selected:not(.primary-selected) {
  border-style: dashed;
  border-color: rgba(255, 177, 61, 0.92);
  box-shadow:
    0 0 0 2px rgba(255, 177, 61, 0.18),
    0 8px 18px rgba(0, 0, 0, 0.16);
}

.custom-editor-object.primary-selected {
  border-color: rgba(46, 230, 255, 0.96);
  box-shadow:
    0 0 0 2px rgba(46, 230, 255, 0.24),
    0 9px 20px rgba(0, 0, 0, 0.20);
}

#customEditorObjectExtrude[data-mixed="true"] {
  border-color: rgba(255, 177, 61, 0.78);
  box-shadow: 0 0 0 3px rgba(255, 177, 61, 0.10);
}

.custom-editor-object.editing {
  cursor: text;
  background: rgba(244, 250, 255, 0.24);
}

.custom-editor-inline-editor {
  position: relative;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 2px 4px;
  border: 1px solid rgba(46, 230, 255, 0.72);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.78);
  color: currentColor;
  line-height: 1;
  white-space: pre;
  cursor: text;
  user-select: text;
  box-shadow:
    0 0 0 2px rgba(46, 230, 255, 0.12),
    0 8px 18px rgba(0, 0, 0, 0.20);
}

.custom-editor-inline-editor:focus {
  border-color: var(--primary);
}

.custom-editor-object-handle {
  position: absolute;
  z-index: 4;
  display: none;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(3, 8, 14, 0.9);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.custom-editor-object-handle::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 999px;
}

.custom-editor-object.selected .custom-editor-object-handle {
  display: block;
}

.custom-editor-object-handle.scale {
  right: -7px;
  bottom: -7px;
  cursor: nwse-resize;
}

.custom-editor-object-handle.rotate {
  right: -7px;
  top: -22px;
  cursor: alias;
}

.custom-editor-object-handle.rotate::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 10px;
  width: 1px;
  height: 11px;
  transform: translateX(-50%);
  background: rgba(46, 230, 255, 0.58);
}

.custom-editor-object.dragging {
  cursor: grabbing;
}

.custom-editor-canvas-empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 26px;
  text-align: center;
  pointer-events: none;
}

.custom-editor-canvas-empty[hidden] {
  display: none;
}

.custom-editor-canvas-empty h3 {
  margin: 0;
  font-size: 22px;
}

.custom-editor-canvas-empty p {
  max-width: 420px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.custom-editor-inspector {
  align-self: stretch;
}

.custom-editor-inspector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.custom-editor-text-field {
  margin-top: 12px;
}

.custom-editor-font-field {
  margin-top: 12px;
  border: 1px dashed transparent;
  border-radius: 14px;
  padding: 8px;
}

.custom-editor-font-field.dragover {
  border-color: rgba(46, 230, 255, 0.75);
  background: rgba(46, 230, 255, 0.08);
}

.custom-editor-curve-panel {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.custom-editor-curve-panel[hidden] {
  display: none !important;
}

.custom-editor-curve-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.custom-editor-curve-title small {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

.custom-editor-curve-toggle {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 9px;
  width: 100%;
}

.custom-editor-curve-toggle .mode-btn {
  min-width: 0;
  padding-left: 8px;
  padding-right: 8px;
}

.custom-editor-curve-amount-field {
  margin-top: 10px;
}

.custom-editor-curve-amount-field span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.custom-editor-curve-amount-field strong {
  color: var(--primary);
  font-size: 12px;
}

.custom-editor-curve-amount-field input[type="range"] {
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.custom-editor-font-search {
  width: 100%;
  max-width: none;
  height: 40px;
  margin: 0;
}

.select-input.font-preview-select,
.custom-editor-font-field select {
  font-size: 14px;
}

.custom-editor-object-name {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 9, 14, 0.28);
  color: var(--text);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 850;
  word-break: break-word;
}

.custom-editor-inspector-field {
  display: grid;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.custom-editor-inspector-field input,
.custom-editor-inspector-field select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(3, 8, 14, 0.55);
  color: var(--muted);
  padding: 0 10px;
  font-weight: 900;
}

.custom-editor-inspector-field input:disabled,
.custom-editor-inspector-field select:disabled {
  opacity: 0.68;
}

.custom-editor-scale-warning {
  grid-column: 1 / -1;
  margin: 5px 0 0;
  color: #ffd166;
  line-height: 1.35;
}

.custom-editor-extrude-field {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.custom-editor-extrude-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.custom-editor-extrude-control strong {
  color: var(--muted);
  font-size: 11px;
}

.custom-editor-extrude-field input[type="range"] {
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.custom-editor-extrude-field .small-note {
  margin: 2px 0 0;
}

.custom-editor-color-preview {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  padding: 10px;
}

.custom-editor-color-preview label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

.custom-editor-color-preview span {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: #111111;
}

.custom-editor-color-preview strong {
  color: var(--text);
  font-size: 13px;
}

.custom-editor-object-color-swatches {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  margin-top: 2px;
}

.custom-editor-object-color-swatch {
  width: 100%;
  aspect-ratio: 1;
  min-height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  background: var(--swatch-color);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.custom-editor-object-color-swatch.active {
  border-color: rgba(46, 230, 255, 0.92);
  box-shadow: 0 0 0 2px rgba(46, 230, 255, 0.24), inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}

.custom-editor-object-color-swatch:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.clicker-scaffold-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.clicker-scaffold-card[hidden] {
  display: none;
}

.clicker-mode-toggle {
  width: 100%;
}

.clicker-mode-panel {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.28);
}

.clicker-mode-panel[hidden] {
  display: none;
}

.clicker-design-preview-card {
  border: 1px solid rgba(46, 230, 255, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: rgba(7, 9, 14, 0.28);
}

.clicker-design-preview-box {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 126px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.clicker-design-preview-box.is-empty {
  min-height: 132px;
  border: 1px solid rgba(46, 230, 255, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(220, 232, 238, 0.78)),
    repeating-linear-gradient(45deg, rgba(15, 23, 42, 0.05) 0 8px, rgba(15, 23, 42, 0.09) 8px 16px);
}

.clicker-design-preview {
  display: block;
  max-width: 100%;
  max-height: 156px;
  object-fit: contain;
}

.clicker-design-preview[hidden],
.clicker-design-preview-placeholder[hidden] {
  display: none !important;
}

.clicker-design-preview-placeholder {
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.clicker-design-preview-box.is-empty .clicker-design-preview-placeholder {
  color: #273241;
  font-size: 12px;
}

.clicker-design-meta {
  display: grid;
  gap: 3px;
  margin: 10px 0;
}

.clicker-design-meta span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.clicker-design-meta small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.clicker-design-scale-control {
  margin: 10px 0 12px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.22);
}

.clicker-design-scale-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.clicker-design-scale-header label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.clicker-design-scale-header .btn-small {
  min-width: 58px;
}

.clicker-design-width-input {
  width: 100%;
  margin-top: 8px;
}

.clicker-design-scale-control input[type="range"] {
  width: 100%;
  margin-top: 10px;
}

.clicker-design-scale-control .small-note {
  margin-top: 6px;
}

.clicker-artwork-offset-header {
  margin-top: 12px;
}

.clicker-inline-value {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.clicker-sub-settings-card .card-title-row {
  margin-bottom: 0;
}

.clicker-sub-settings-card:not(.is-collapsed) .card-title-row {
  margin-bottom: 10px;
}

.clicker-active-colors-block {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.clicker-active-colors-block label {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.clicker-active-colors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
  gap: 8px;
  align-items: center;
}

.clicker-active-color-chip {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 9px;
  background: var(--chip-color);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.clicker-active-color-chip.active {
  border-color: rgba(46, 230, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(46, 230, 255, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.clicker-active-color-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.clicker-preview-view-card,
.clicker-shape-card,
.clicker-keyring-card,
.clicker-edge-card {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.22);
}

.clicker-preview-view-card .compact-toggle,
.clicker-shape-card .compact-toggle,
.clicker-edge-card .compact-toggle {
  margin-top: 8px;
  margin-bottom: 8px;
}

.clicker-edge-size-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 8px;
}

.clicker-edge-size-row[hidden],
.clicker-edge-card input[type="range"][hidden],
.clicker-edge-card .small-note[hidden] {
  display: none !important;
}

.clicker-edge-size-row label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.clicker-edge-size-row .input-with-unit {
  max-width: 110px;
}

.clicker-edge-card input[type="range"] {
  width: 100%;
}

.clicker-shape-toggle {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.clicker-shape-radius-group[hidden] {
  display: none !important;
}

.clicker-shape-radius-group input[type="range"] {
  width: 100%;
}

.clicker-selected-part-card {
  border: 1px solid rgba(46, 230, 255, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: rgba(7, 9, 14, 0.28);
}

.clicker-keyring-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.clicker-keyring-meta strong {
  color: var(--text);
  font-size: 13px;
}

.clicker-selected-part-details {
  display: grid;
  gap: 8px;
}

.clicker-selected-part-details div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.clicker-selected-part-details .clicker-selected-color-swatches {
  display: grid;
  grid-template-columns: repeat(7, 24px);
  gap: 6px;
  justify-content: start;
  align-items: center;
  max-width: 100%;
  overflow: visible;
}

.clicker-selected-part-details .clicker-selected-color-swatch {
  width: 24px;
  height: 24px;
  min-width: 24px;
}

.clicker-selected-part-details strong {
  color: var(--text);
  font-size: 13px;
  text-align: right;
}

.clicker-selected-color-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 6px;
}

.clicker-selected-color-row label {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.clicker-selected-color-row input[type="color"] {
  width: 42px;
  height: 32px;
  padding: 2px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.clicker-selected-color-swatches {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 28px));
  gap: 8px;
  justify-content: start;
}

.clicker-selected-color-swatch {
  width: 28px;
  aspect-ratio: 1;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  cursor: pointer;
}

.clicker-selected-color-swatch.active {
  border-color: rgba(46, 230, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(46, 230, 255, 0.2);
}

.clicker-selected-height-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: center;
  gap: 10px;
  margin: 2px 0 0;
}

.clicker-selected-height-row.disabled {
  opacity: 0.56;
}

.clicker-selected-height-row > span:first-child {
  display: grid;
  gap: 3px;
}

.clicker-selected-height-row strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

.clicker-selected-height-row small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.clicker-selected-height-row .input-with-unit {
  width: 100%;
}

.clicker-selected-height-range {
  margin-top: 0;
}

.clicker-selected-height-range:disabled {
  opacity: 0.5;
}

.clicker-quick-customize-popover {
  position: fixed;
  top: 156px;
  left: 50%;
  z-index: 48;
  width: min(274px, calc(100vw - 28px));
  border: 1px solid rgba(46, 230, 255, 0.22);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(31, 37, 52, 0.96), rgba(14, 19, 30, 0.96));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
  padding: 8px;
  max-height: min(520px, calc(100vh - 28px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.clicker-quick-customize-panel {
  display: grid;
  gap: 6px;
  margin-top: 0;
}

.clicker-quick-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(90px, 1.2fr);
  align-items: center;
  gap: 8px;
}

.clicker-quick-field label {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.clicker-quick-color-preview {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: var(--simple-color);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.clicker-quick-color-hex {
  width: 100%;
  min-width: 0;
  height: 32px;
  text-transform: uppercase;
}

.clicker-quick-color-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.clicker-quick-color-actions .btn {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
}

.clicker-quick-color-picker {
  display: grid;
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(7, 10, 17, 0.82);
}

.clicker-quick-color-picker[hidden] {
  display: none !important;
}

.clicker-quick-color-square {
  position: relative;
  height: 108px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 7px;
  background:
    linear-gradient(to top, #000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #fff, rgba(255, 255, 255, 0)),
    var(--selector-hue);
  cursor: crosshair;
  overflow: hidden;
  touch-action: none;
}

.clicker-quick-color-square-handle {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.78), 0 2px 6px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.clicker-quick-hue-slider {
  width: 100%;
  height: 16px;
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  background: linear-gradient(90deg, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.clicker-quick-hue-slider::-webkit-slider-runnable-track {
  height: 16px;
  border-radius: 999px;
  background: transparent;
}

.clicker-quick-hue-slider::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -1px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: rgba(7, 9, 14, 0.92);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.72);
  appearance: none;
  -webkit-appearance: none;
}

.clicker-quick-hue-slider::-moz-range-track {
  height: 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%);
}

.clicker-quick-hue-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: rgba(7, 9, 14, 0.92);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.72);
}

.clicker-quick-swatches {
  grid-template-columns: repeat(6, 24px);
  gap: 6px;
}

.clicker-quick-swatches .clicker-selected-color-swatch {
  width: 24px;
  min-height: 24px;
  border-radius: 7px;
}

.clicker-quick-height-row {
  grid-template-columns: minmax(0, 1fr) 104px;
  margin-top: 2px;
}


/* Phase 13H-S-FIX1: shared quick popup rows are labels, so force hidden rows to stay hidden. */
.clicker-quick-customize-popover #clickerQuickCustomizeDetailBoostRow[hidden],
.clicker-quick-customize-popover #clickerQuickCustomizeDetailBoostRange[hidden],
.clicker-quick-customize-popover #clickerQuickCustomizeHeightRow[hidden],
.clicker-quick-customize-popover #clickerQuickCustomizeHeightRange[hidden] {
  display: none !important;
}

.compact-input {
  height: 42px;
  font-size: 15px;
}

.modal-actions {
  margin-top: 18px;
  justify-content: flex-end;
}

.license-status-message {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 9, 14, 0.32);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  padding: 12px;
}

.license-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.license-info-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(7, 9, 14, 0.34);
  padding: 13px;
}

.license-info-card span,
.license-info-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.license-info-card strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.license-info-card small {
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.license-device-card,
.license-countdown-card {
  background: linear-gradient(135deg, rgba(46, 230, 255, 0.14), rgba(60, 140, 255, 0.08));
}

.license-support-link {
  display: inline-flex;
  margin-top: 6px;
  color: var(--primary);
  font-weight: 850;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.license-support-link:hover {
  color: var(--accent);
}

.license-settings-actions {
  flex-wrap: wrap;
}

.modal-note {
  margin-top: 16px;
}

.image-background-actions {
  flex-wrap: wrap;
}

.image-preprocess-modal {
  width: min(1280px, 98vw);
  max-height: 94vh;
  overflow: auto;
}

.image-preprocess-modal [hidden] {
  display: none !important;
}

.image-preprocess-header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.image-preprocess-history-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.image-preprocess-history-actions .btn:not(:disabled) {
  border-color: rgba(46, 230, 255, 0.38);
  background: rgba(46, 230, 255, 0.08);
}

.image-preprocess-steps {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(7, 9, 14, 0.45);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.image-preprocess-steps span.active {
  color: var(--primary);
}

.image-preprocess-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
  align-items: stretch;
  margin-top: 12px;
}

.image-preprocess-crop-panel {
  grid-template-columns: minmax(0, 1fr) 250px;
}

.image-preprocess-process-panel {
  grid-template-columns: minmax(420px, 1fr) minmax(430px, 500px);
  align-items: start;
}

.image-preprocess-preview-shell {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 8px;
}

.image-preprocess-view-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(8, 12, 20, 0.96);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.image-preprocess-edit-tools,
.image-preprocess-zoom-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.image-preprocess-edit-tools {
  flex: 0 0 auto;
}

.image-preprocess-zoom-tools {
  justify-content: flex-end;
  min-width: 0;
}

.image-preprocess-view-toolbar .btn {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
}

.image-preprocess-view-toolbar .btn.active {
  border-color: rgba(46, 230, 255, 0.46);
  background: rgba(46, 230, 255, 0.14);
  color: var(--primary);
}

.image-preprocess-view-toolbar .image-preprocess-view-icon-btn {
  width: 30px;
  min-width: 30px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.image-preprocess-zoom-value {
  min-width: 52px;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.image-preprocess-stage {
  min-height: clamp(300px, 48vh, 420px);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: rgba(4, 7, 12, 0.58);
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.24);
}

.image-preprocess-viewport {
  position: relative;
  user-select: none;
  touch-action: none;
  cursor: default;
}

.image-preprocess-viewport.pannable {
  cursor: grab;
}

.image-preprocess-viewport.panning {
  cursor: grabbing;
}

.image-preprocess-canvas-transform {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: center center;
  will-change: transform, left, top;
}

.image-preprocess-canvas-transform .image-preprocess-canvas {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
}

.checkerboard-bg {
  background-color: rgba(4, 7, 12, 0.72);
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.12) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.12) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.12) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.12) 75%);
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.image-preprocess-canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 58vh;
}

.image-preprocess-controls {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(7, 9, 14, 0.36);
  padding: 14px;
}

.image-preprocess-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.image-preprocess-preset-grid .btn {
  width: 100%;
  min-height: 40px;
  padding-inline: 10px;
}

.image-preprocess-process-controls {
  display: grid;
  gap: 12px;
}

.image-preprocess-process-controls label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.image-preprocess-process-controls input[type="range"] {
  width: 100%;
}

.image-preprocess-process-controls .toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
}

.image-preprocess-color-mode {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.image-preprocess-color-mode-toggle {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mode-toggle.image-preprocess-color-mode-toggle {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.image-preprocess-color-mode-toggle button {
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 850;
  min-height: 38px;
  padding: 8px 10px;
  white-space: normal;
  cursor: pointer;
}

.image-preprocess-color-mode-toggle button.active {
  border-color: rgba(46, 230, 255, 0.42);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #031016;
}

.image-preprocess-color-warning {
  margin: 0;
  color: var(--accent);
  line-height: 1.35;
}

.image-preprocess-color-helper {
  margin: 0;
  line-height: 1.35;
}

.image-preprocess-actions {
  flex-wrap: wrap;
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.image-preprocess-detected-colors {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.image-preprocess-detected-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.image-preprocess-detected-header .small-note {
  margin: 4px 0 0;
}

.image-preprocess-detected-header .btn {
  min-height: 34px;
  padding: 7px 10px;
}

.image-preprocess-print-summary {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(3, 7, 13, 0.3);
}

.image-preprocess-print-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
}

.image-preprocess-print-summary .small-note {
  margin: 0;
  line-height: 1.35;
}

.image-preprocess-print-color-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.image-preprocess-print-color-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.image-preprocess-print-color-row span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preprocess-print-color-swatch {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.24);
}

.image-preprocess-color-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
  overflow-anchor: none;
}

.image-preprocess-color-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 38px;
  gap: 7px;
  align-items: center;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(3, 7, 13, 0.34);
  padding: 6px;
}

.image-preprocess-color-row.selected {
  border-color: rgba(46, 230, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(46, 230, 255, 0.24), 0 0 18px rgba(46, 230, 255, 0.08);
}

.image-preprocess-color-swatch {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.24);
}

.image-preprocess-color-meta {
  min-width: 0;
}

.image-preprocess-color-meta strong,
.image-preprocess-color-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preprocess-color-meta strong {
  color: var(--text);
  font-size: 12px;
}

.image-preprocess-color-meta span {
  color: var(--muted);
  font-size: 11px;
}

.image-preprocess-color-input {
  width: 38px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.image-preprocess-slot-picker {
  position: relative;
  display: grid;
  place-items: center;
}

.image-preprocess-color-trigger {
  width: 38px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
}

.image-preprocess-slot-picker.open .image-preprocess-color-trigger,
.image-preprocess-color-trigger:hover {
  border-color: rgba(46, 230, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(46, 230, 255, 0.08);
}

.image-preprocess-output-swatch {
  width: 28px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.30);
  border-radius: 7px;
  background: var(--simple-color);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}

.image-preprocess-slot-menu {
  position: absolute;
  z-index: 35;
  right: 0;
  top: calc(100% + 7px);
  width: min(190px, calc(100vw - 40px));
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(15, 19, 30, 0.98);
  box-shadow: var(--shadow);
}

.image-preprocess-slot-menu[hidden] {
  display: none !important;
}

.image-preprocess-slot-menu-label {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.image-preprocess-basic-color-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.image-preprocess-basic-color-chip {
  min-height: 25px;
  padding: 0;
}

.image-preprocess-custom-color-btn {
  width: 100%;
  margin-top: 9px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(46, 230, 255, 0.08);
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.image-preprocess-slot-hex-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.image-preprocess-slot-hex {
  min-width: 0;
  height: 32px;
  text-transform: uppercase;
}

.image-preprocess-slot-apply,
.image-preprocess-slot-cancel {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 11px;
}

.image-preprocess-color-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.image-preprocess-color-popover {
  position: fixed;
  z-index: 80;
  width: min(340px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid rgba(46, 230, 255, 0.34);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(24, 30, 44, 0.98), rgba(8, 12, 20, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  padding: 14px;
}

.image-preprocess-color-popover[hidden] {
  display: none !important;
}

.image-preprocess-popover-header,
.image-preprocess-popover-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.image-preprocess-popover-header {
  justify-content: space-between;
  margin-bottom: 12px;
}

.image-preprocess-popover-header strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
}

.image-preprocess-popover-header .btn {
  min-height: 32px;
  padding: 6px 10px;
}

.image-preprocess-region-info {
  margin: -4px 0 10px;
  color: var(--primary);
}

.image-preprocess-popover-row {
  min-height: 38px;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.image-preprocess-popover-row code {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.image-preprocess-popover-hex {
  width: 92px;
  height: 34px;
  text-transform: uppercase;
}

.image-preprocess-visual-picker {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(7, 10, 17, 0.82);
}

.image-preprocess-color-square {
  position: relative;
  height: 132px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 9px;
  background:
    linear-gradient(to top, #000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #fff, rgba(255, 255, 255, 0)),
    var(--selector-hue);
  cursor: crosshair;
  overflow: hidden;
  touch-action: none;
}

.image-preprocess-color-square-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.78), 0 2px 6px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.image-preprocess-hue-slider {
  width: 100%;
  height: 17px;
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  background: linear-gradient(90deg, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.image-preprocess-hue-slider::-webkit-slider-runnable-track {
  height: 17px;
  border-radius: 999px;
  background: transparent;
}

.image-preprocess-hue-slider::-webkit-slider-thumb {
  width: 19px;
  height: 19px;
  margin-top: -1px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.62);
  appearance: none;
  -webkit-appearance: none;
}

.image-preprocess-hue-slider::-moz-range-track {
  height: 17px;
  border-radius: 999px;
  background: transparent;
}

.image-preprocess-hue-slider::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.62);
}

.image-preprocess-popover-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.image-preprocess-popover-apply,
.image-preprocess-popover-cancel {
  width: 100%;
  min-height: 34px;
}

.image-preprocess-popover-quick {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.image-preprocess-popover-chip {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 9px;
  background: var(--chip-color);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}

.image-preprocess-popover-chip:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .image-preprocess-modal {
    width: min(96vw, 620px);
    padding: 14px;
  }

  .image-preprocess-modal .modal-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .image-preprocess-header-tools {
    width: 100%;
    justify-content: space-between;
  }

  .image-preprocess-panel {
    grid-template-columns: 1fr;
  }

  .image-preprocess-color-slots {
    grid-template-columns: 1fr;
  }

  .image-preprocess-print-color-list {
    grid-template-columns: 1fr;
  }

  .image-preprocess-stage {
    min-height: 300px;
  }

  .image-preprocess-view-toolbar {
    position: static;
    justify-content: center;
    flex-wrap: wrap;
  }

  .image-preprocess-preset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.image-logo-custom-color-modal {
  width: min(430px, 94vw);
}

.image-logo-custom-color-body {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 18px;
}

.image-logo-custom-color-visual {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.image-logo-color-square {
  position: relative;
  height: 170px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background:
    linear-gradient(to top, #000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #fff, rgba(255, 255, 255, 0)),
    var(--selector-hue);
  cursor: crosshair;
  overflow: hidden;
  touch-action: none;
}

.image-logo-color-square-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.75), 0 2px 8px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.image-logo-hue-control {
  display: grid;
}

.image-logo-hue-slider {
  width: 100%;
  height: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #ff0000 0%,
    #ffff00 16.66%,
    #00ff00 33.33%,
    #00ffff 50%,
    #0000ff 66.66%,
    #ff00ff 83.33%,
    #ff0000 100%
  );
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.image-logo-hue-slider:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.image-logo-hue-slider::-webkit-slider-runnable-track {
  height: 18px;
  border-radius: 999px;
  background: transparent;
}

.image-logo-hue-slider::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -1px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: rgba(7, 9, 14, 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.72), 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.image-logo-hue-slider::-moz-range-track {
  height: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #ff0000 0%,
    #ffff00 16.66%,
    #00ff00 33.33%,
    #00ffff 50%,
    #0000ff 66.66%,
    #ff00ff 83.33%,
    #ff0000 100%
  );
}

.image-logo-hue-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: rgba(7, 9, 14, 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.72), 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.image-logo-custom-color-swatch {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 16px;
  background: var(--simple-color);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.image-logo-custom-color-field {
  display: grid;
  gap: 5px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.image-logo-custom-color-hex-field {
  min-width: 0;
  width: 100%;
}

.image-logo-custom-color-hex-field input {
  width: 100%;
  min-width: 150px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.04em;
}

.image-logo-custom-color-rgb {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.saved-path-box {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 9, 14, 0.44);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  padding: 12px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(15, 19, 30, 0.92);
  color: var(--text);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.activation-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.activation-panel {
  width: min(520px, 100%);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(31, 37, 52, 0.98), rgba(18, 23, 35, 0.98));
  box-shadow: var(--shadow);
  padding: 28px;
}

.activation-logo {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #031016;
  font-weight: 900;
  font-size: 18px;
  margin-bottom: 18px;
}

.activation-panel h1 {
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 12px;
}

.activation-copy,
.activation-status {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.activation-form {
  margin-top: 22px;
}

.activation-option,
.activation-section-heading {
  margin-top: 18px;
}

.activation-option {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(7, 9, 14, 0.26);
  padding: 14px;
}

.activation-option h2,
.activation-section-heading h2 {
  margin: 0 0 6px;
  font-size: 15px;
}

.activation-option p,
.activation-section-heading p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.activation-buy-option {
  background: rgba(255, 183, 74, 0.08);
}

.activation-input {
  margin-bottom: 14px;
}

.activation-token-input {
  min-height: 116px;
  padding-top: 12px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.4;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.device-code-box {
  margin-top: 20px;
}

.device-code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.device-code-input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(8, 10, 16, 0.72);
  color: var(--text);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.activation-status {
  min-height: 46px;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 9, 14, 0.35);
  padding: 12px 14px;
}

.activation-status.ok {
  color: var(--ok);
}

.activation-status.bad {
  color: var(--danger);
}

.activation-status.working {
  color: var(--primary);
}

.activation-version-label {
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.activation-support-footer {
  margin-top: 14px;
  letter-spacing: 0;
  text-transform: none;
}

.activation-support-link {
  color: var(--primary);
  text-decoration: none;
}

.activation-support-link:hover,
.activation-support-link:focus-visible {
  color: #ffffff;
  text-decoration: underline;
}

@media (max-width: 1240px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
  }

  .workspace {
    grid-template-columns: 330px minmax(420px, 1fr);
  }

  .right-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .topbar,
  .preview-toolbar {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .viewer {
    height: 480px;
    flex: none;
  }

  .right-panel {
    display: flex;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .license-settings-grid {
    grid-template-columns: 1fr;
  }

  .license-settings-actions .btn {
    flex: 1 1 180px;
  }

  .custom-editor-composer-body {
    grid-template-columns: 1fr;
  }

  .custom-editor-toolbar .btn-primary {
    margin-left: 0;
  }

  .custom-editor-canvas {
    min-height: 380px;
  }
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 9, 14, 0.34);
}

.mode-btn {
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.mode-btn.active {
  color: #061017;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.mode-toggle.three-mode {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mode-toggle.three-mode .mode-btn {
  min-width: 0;
  height: auto;
  min-height: 40px;
  padding: 5px 6px;
  line-height: 1.12;
}

.two-line-name-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ui9-two-line-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ui9-two-line-field .text-input {
  min-width: 0;
}

.batch-textarea {
  height: 138px;
  min-height: 138px;
  padding-top: 12px;
  padding-bottom: 12px;
  resize: vertical;
  line-height: 1.35;
  font-size: 17px;
}

.batch-settings-card .control-row {
  margin-top: 14px;
}

.batch-settings-card[hidden],
#singleTextBlock[hidden],
#twoLineTextBlock[hidden],
#batchTextBlock[hidden],
#svgDesignBlock[hidden],
#imageDesignBlock[hidden],
#imageLogoColorSlots[hidden],
#imageLogoStlColorWarning[hidden],
#imageLogoProcessingOverlay[hidden],
#imageLogoBaseCornerRadiusGroup[hidden],
#modeToggle[hidden],
#fontCard[hidden],
#symbolCard[hidden],
.control-row[hidden],
.option-row[hidden],
.split-controls > div[hidden] {
  display: none !important;
}


.my-designs-modal {
  width: min(980px, 96vw);
  max-height: min(840px, 92vh);
  overflow: auto;
}

.my-designs-controls {
  margin-top: 16px;
}

.my-designs-search {
  width: 100%;
  height: 42px;
  font-size: 14px;
  font-weight: 750;
}

.my-designs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.my-design-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(7, 9, 14, 0.34);
}

.my-design-thumb {
  height: 128px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(215, 228, 238, 0.76)),
    repeating-linear-gradient(45deg, rgba(15, 23, 42, 0.05) 0 8px, rgba(15, 23, 42, 0.09) 8px 16px);
  border-bottom: 1px solid var(--border);
}

.my-design-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 8px;
}

.my-design-thumb span {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #031016;
  font-weight: 950;
}

.my-design-card-body {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.my-design-title {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-design-meta,
.my-design-updated {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

#myDesignsModal {
  z-index: 72;
}

#premiumConfirmModal {
  z-index: 88;
}

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

.my-design-actions .btn {
  min-width: 0;
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border-radius: 11px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.my-design-load-btn {
  grid-column: 1 / -1;
  height: 40px !important;
  border: 1px solid rgba(46, 230, 255, 0.46) !important;
  background: linear-gradient(135deg, rgba(46, 230, 255, 0.92), rgba(60, 140, 255, 0.92)) !important;
  color: #f7fbff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.38);
  box-shadow: 0 12px 24px rgba(46, 230, 255, 0.18);
}

.my-design-rename-btn,
.my-design-duplicate-btn {
  background: rgba(255, 255, 255, 0.075);
}

.my-design-delete-btn {
  grid-column: 1 / -1;
  color: #fff;
  box-shadow: 0 12px 24px rgba(255, 98, 112, 0.13);
}

.premium-confirm-modal {
  border-color: rgba(46, 230, 255, 0.22);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
}

.premium-confirm-input-group {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(7, 9, 14, 0.28);
}

.premium-confirm-input-group[hidden] {
  display: none !important;
}

.premium-confirm-input-group label {
  margin-bottom: 8px;
}

.premium-confirm-input {
  height: 44px;
  font-size: 16px;
}

.premium-confirm-actions {
  margin-top: 20px;
  flex-wrap: wrap;
}

.premium-confirm-actions .btn {
  min-width: 132px;
}

.my-design-empty,
.my-designs-empty {
  margin-top: 14px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: rgba(7, 9, 14, 0.28);
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

.my-designs-empty h3 {
  margin: 0 0 6px;
  color: var(--text);
}

.my-designs-footer {
  margin-top: 14px;
}


.image-logo-color-row {
  grid-template-columns: 34px minmax(92px, 1fr) minmax(148px, 1.15fr);
}

.image-preprocess-color-warning {
  margin-top: 8px;
}


.name-tag-design-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.compact-text-input {
  height: 42px;
  font-size: 16px;
  font-weight: 800;
}

/* Phase 13H-L: Impact per-name quick popup */
.impact-name-popover {
  position: fixed;
  z-index: 80;
  width: 258px;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: rgba(17, 22, 34, 0.98);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(16px);
}

.impact-name-popover[hidden] {
  display: none !important;
}

.impact-name-popover-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.impact-name-popover-header strong,
.impact-name-popover-header span {
  display: block;
}

.impact-name-popover-header strong {
  font-size: 13px;
  line-height: 1.2;
}

.impact-name-popover-header span {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.3;
}

.impact-name-color-input {
  width: 100%;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(8, 10, 16, 0.72);
  cursor: pointer;
}

.impact-name-swatch-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  margin: 10px 0 12px;
}

.impact-name-swatch {
  width: 100%;
  aspect-ratio: 1;
  min-height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: var(--chip-color);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.impact-name-swatch.active {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.impact-name-popover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.impact-name-popover-row label {
  margin-bottom: 0;
}

.impact-name-popover-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.impact-name-popover-actions {
  margin-top: 10px;
}

.impact-name-popover-actions .btn {
  width: 100%;
}


/* Phase 13K-E2: slot custom colors now open the shared visual picker. */
.image-preprocess-custom-color-btn {
  width: 100%;
  margin-top: 8px;
}


/* Phase 13K-E4-F: compact Image / Logo active-color interface. */
.image-logo-compact-colors {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.image-logo-compact-color-header,
.image-logo-compact-title-row,
.image-logo-selected-color-header,
.image-logo-support-color-chip {
  display: flex;
  align-items: center;
}

.image-logo-compact-title-row {
  justify-content: space-between;
  gap: 10px;
}

.image-logo-compact-title-row label {
  margin: 0;
}

.image-logo-active-colors-grid {
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
}

.image-logo-active-color-chip {
  position: relative;
  min-height: 34px;
}

.image-logo-active-color-chip span {
  position: absolute;
  right: 3px;
  bottom: 2px;
  min-width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(4, 8, 14, 0.78);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.image-logo-compact-material-note {
  margin-top: 0;
}

.image-logo-selected-color-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 9, 14, 0.28);
}

.image-logo-selected-color-header {
  gap: 10px;
}

.image-logo-selected-output-swatch {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: var(--chip-color);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.image-logo-selected-color-header strong,
.image-logo-selected-color-header span {
  display: block;
}

.image-logo-selected-color-header strong {
  font-size: 13px;
}

.image-logo-selected-color-header span {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 11px;
}

.image-logo-selected-color-facts {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.image-logo-selected-color-facts > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.image-logo-selected-color-facts span {
  color: var(--muted-2);
  font-size: 11px;
}

.image-logo-selected-color-facts strong {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.image-logo-selected-color-facts i {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 5px;
  background: var(--chip-color);
}

.image-logo-compact-quick-label {
  margin-top: 10px;
  margin-bottom: 6px;
}

.image-logo-compact-quick-colors {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.image-logo-compact-quick-chip {
  min-height: 28px;
}

.image-logo-compact-color-actions {
  margin-top: 10px;
}

.image-logo-support-colors {
  padding-top: 2px;
}

.image-logo-support-color-list {
  display: grid;
  gap: 7px;
}

.image-logo-support-color-chip {
  width: 100%;
  justify-content: flex-start;
  gap: 8px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(7, 9, 14, 0.28);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.image-logo-support-color-chip:hover {
  border-color: rgba(46, 230, 255, 0.42);
}

.image-logo-support-color-swatch {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 7px;
  background: var(--chip-color);
}

.image-logo-support-color-chip > span:nth-child(2) {
  flex: 1;
  font-size: 12px;
  font-weight: 800;
}

.image-logo-support-color-chip code {
  font-size: 10px;
}


/* Phase 13K-E4-G-FIX1: fixed preview + no-scroll color workflow. */
.image-preprocess-modal {
  display: flex;
  flex-direction: column;
  height: min(94vh, 900px);
  max-height: 94vh;
  overflow: hidden;
}

.image-preprocess-modal > .modal-header,
.image-preprocess-modal > .image-preprocess-actions {
  flex: 0 0 auto;
}

.image-preprocess-modal > .modal-header {
  position: relative;
  z-index: 8;
}

.image-preprocess-crop-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.image-preprocess-process-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

.image-preprocess-preview-shell {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  align-self: stretch;
}

.image-preprocess-process-panel .image-preprocess-stage {
  min-height: 0;
  height: 100%;
}

.image-preprocess-process-controls {
  position: relative;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  align-content: start;
  padding: 0 10px 14px;
  scrollbar-gutter: stable;
}

.image-preprocess-adjustments {
  display: grid;
  gap: 12px;
  padding: 12px 4px 0;
}

.image-preprocess-adjustments label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.image-preprocess-adjustments .toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
}

.image-preprocess-detected-colors {
  position: sticky;
  top: 0;
  z-index: 7;
  margin: 0;
  padding: 10px 4px 10px;
  border-top: 0;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13, 18, 29, 0.99), rgba(13, 18, 29, 0.96));
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.image-preprocess-print-summary {
  padding: 6px 8px;
  margin-top: 6px;
}

.image-preprocess-print-summary .small-note,
.image-preprocess-print-color-list {
  display: none;
}

.image-preprocess-print-counts {
  justify-content: space-between;
  gap: 6px 10px;
  font-size: 11px;
}

.image-preprocess-color-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  overflow: visible;
}

.image-preprocess-detected-colors .image-preprocess-color-mode {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.image-preprocess-detected-colors .image-preprocess-color-mode .field-label {
  margin-bottom: 6px;
}

.image-preprocess-detected-colors .image-preprocess-color-mode-toggle {
  margin: 0;
}

.image-preprocess-detected-colors .image-preprocess-color-helper {
  display: none;
}

.image-preprocess-detected-colors .image-preprocess-color-warning {
  margin: 6px 0 0;
}

.image-preprocess-color-chip-button {
  position: relative;
  flex: 0 0 50px;
  width: 50px;
  height: 48px;
  display: grid;
  grid-template-columns: repeat(2, 19px);
  grid-template-rows: 12px 19px;
  justify-content: center;
  align-content: center;
  gap: 4px 5px;
  padding: 4px 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(3, 7, 13, 0.48);
  cursor: pointer;
}

.image-preprocess-color-chip-button:hover,
.image-preprocess-color-chip-button.selected {
  border-color: rgba(46, 230, 255, 0.82);
  box-shadow: 0 0 0 2px rgba(46, 230, 255, 0.14);
}

.image-preprocess-color-chip-number {
  grid-column: 1 / 3;
  grid-row: 1;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
  text-align: center;
}

.image-preprocess-color-chip-source,
.image-preprocess-color-chip-button .image-preprocess-output-swatch {
  width: 19px;
  height: 19px;
  border: 1px solid rgba(255, 255, 255, 0.30);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}

.image-preprocess-color-chip-source {
  opacity: 0.72;
}

.image-preprocess-color-popover {
  width: min(310px, calc(100vw - 28px));
  padding: 12px;
}

.image-preprocess-popover-header {
  margin-bottom: 8px;
}

.image-preprocess-region-info {
  margin: -2px 0 8px;
}

.image-preprocess-tool-icon-btn {
  flex: 0 0 auto;
  width: 36px;
  min-width: 36px;
  height: 32px;
  padding: 6px;
  display: inline-grid;
  place-items: center;
}

.image-preprocess-tool-icon-btn svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.image-preprocess-paintbrush-btn {
  width: auto;
  min-width: 112px;
  padding-inline: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.image-preprocess-paintbrush-btn span {
  font-size: 11px;
  line-height: 1;
  font-weight: 850;
  white-space: nowrap;
}

.image-preprocess-eyedropper-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 118px;
}

.image-preprocess-eyedropper-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.image-preprocess-eyedropper-btn.active {
  border-color: rgba(46, 230, 255, 0.82);
  box-shadow: 0 0 0 2px rgba(46, 230, 255, 0.14);
  color: var(--primary);
}

.image-preprocess-tool-icon-btn.active {
  border-color: rgba(46, 230, 255, 0.82);
  box-shadow: 0 0 0 2px rgba(46, 230, 255, 0.14);
  color: var(--primary);
  background: rgba(46, 230, 255, 0.10);
}

.image-preprocess-brush-workspace {
  position: absolute;
  z-index: 14;
  top: 46px;
  left: 46px;
  width: min(360px, calc(100% - 58px));
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgba(46, 230, 255, 0.38);
  border-radius: 12px;
  background: rgba(8, 12, 20, 0.98);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42);
}

.image-preprocess-brush-workspace[hidden] {
  display: none;
}

.image-preprocess-brush-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.image-preprocess-brush-current {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.image-preprocess-brush-current strong {
  font-size: 12px;
}

.image-preprocess-brush-colors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 2px;
}

.image-preprocess-brush-color-chip {
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 7px;
  background: var(--simple-color, #000000);
  cursor: pointer;
}

.image-preprocess-brush-color-chip.selected {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.image-preprocess-brush-size-row {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.image-preprocess-brush-size-row input {
  width: 100%;
}

.image-preprocess-brush-size-row output {
  min-width: 42px;
  color: var(--primary);
  font-weight: 850;
  text-align: right;
}

.image-preprocess-brush-workspace .small-note {
  margin: 0;
}

.image-preprocess-brush-cursor {
  position: absolute;
  z-index: 12;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.88), 0 0 5px rgba(0, 0, 0, 0.75);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.image-preprocess-brush-cursor[hidden] {
  display: none;
}

.image-preprocess-detected-row {
  min-height: 32px;
  margin-top: 0;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(3, 7, 13, 0.34);
}

.image-preprocess-quick-color-section {
  margin-top: 10px;
}

.image-preprocess-popover-quick {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
}

.image-preprocess-popover-chip {
  width: 27px;
  height: 27px;
}

.image-preprocess-advanced-color {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(3, 7, 13, 0.30);
  overflow: hidden;
}

.image-preprocess-advanced-color summary {
  padding: 9px 10px;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.image-preprocess-advanced-color[open] {
  padding: 0 9px 9px;
}

.image-preprocess-advanced-color[open] summary {
  margin: 0 -9px 2px;
  border-bottom: 1px solid var(--border);
}

.image-preprocess-color-square {
  height: 112px;
}

.image-preprocess-instant-note {
  margin: 9px 0 0;
  text-align: center;
}

.image-preprocess-viewport:not(.panning) {
  cursor: crosshair;
}

.image-preprocess-viewport.eyedropper-active:not(.panning) {
  cursor: copy;
}

.image-preprocess-viewport.pannable:not(.panning) {
  cursor: grab;
}

.image-preprocess-viewport.eyedropper-active.pannable:not(.panning) {
  cursor: copy;
}

.image-preprocess-viewport.brush-active:not(.panning) {
  cursor: none;
}

@media (max-width: 760px) {
  .image-preprocess-modal {
    height: auto;
    max-height: 94vh;
    overflow: auto;
  }

  .image-preprocess-process-panel {
    overflow: visible;
  }

  .image-preprocess-process-controls {
    max-height: none;
    overflow: visible;
  }

  .image-preprocess-detected-colors {
    position: static;
  }
}


/* Phase 13K-E5-A-FIX2: shared RK3D color controls replace native browser pickers. */
.rk3d-global-color-picker {
  min-width: 150px;
  max-width: 230px;
  margin: 0;
}

.rk3d-global-color-picker .simple-color-trigger {
  min-height: 36px;
  grid-template-columns: 24px 1fr auto;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 9px;
}

.rk3d-global-color-picker .simple-color-selected {
  width: 24px;
  height: 24px;
}

.color-control-title .rk3d-global-color-picker {
  margin-left: auto;
}

.clicker-selected-color-row .rk3d-global-color-picker {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
}

.clicker-selected-color-row .simple-color-trigger {
  min-width: 0;
  grid-template-columns: 24px minmax(0, 1fr) auto;
}

.clicker-selected-color-row .simple-color-label,
.clicker-selected-color-row .simple-color-hex {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-editor-color-preview .rk3d-global-color-picker {
  width: min(210px, 100%);
}

@media (max-width: 980px) {
  .image-preprocess-view-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .image-preprocess-zoom-tools {
    margin-left: auto;
  }
  .image-preprocess-brush-workspace {
    left: 6px;
    width: calc(100% - 12px);
  }
}


/* Phase 13K-E6-A — grouped Switch Assembly Position */
.clicker-switch-position-actions {
  margin-top: 12px;
}

.clicker-switch-position-status {
  margin-top: 10px;
  color: var(--accent);
  font-weight: 800;
}

.clicker-mx-fit-control {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 9, 14, 0.28);
}

.clicker-mx-fit-header {
  margin-top: 0;
}

.clicker-mx-fit-header label {
  margin: 0;
}

.clicker-mx-fit-control input[type="range"] {
  width: 100%;
  margin: 10px 0 2px;
}

.clicker-mx-fit-scale {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
}

.clicker-mx-fit-scale span:nth-child(2) {
  text-align: center;
}

.clicker-mx-fit-scale span:last-child {
  text-align: right;
}

.clicker-mx-fit-status {
  margin-top: 8px;
  font-weight: 850;
}

.clicker-mx-fit-status[data-fit-state="caution"] {
  color: #fbbf24;
}

#clickerMoveSwitchBtn.active {
  color: #061017;
  background: linear-gradient(135deg, var(--accent), #ffe067);
  box-shadow: 0 14px 28px rgba(255, 177, 61, 0.2);
}

.viewer canvas.move-switch-assembly-mode {
  cursor: grab;
}

.viewer canvas.switch-assembly-hover {
  cursor: grab;
}

.viewer canvas.dragging-switch-assembly {
  cursor: grabbing !important;
}

/* Phase 13K-E7-A: adjustable Clicker body wall thickness. */
.clicker-body-wall-control {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 9, 14, 0.28);
}

.clicker-body-wall-header {
  margin-top: 0;
}

.clicker-body-wall-header label {
  margin: 0;
}

.clicker-body-wall-control input[type="range"] {
  width: 100%;
  margin: 10px 0 2px;
}

.clicker-body-wall-scale {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
}

.clicker-body-wall-scale span:nth-child(2) {
  text-align: center;
}

.clicker-body-wall-scale span:last-child {
  text-align: right;
}

.clicker-body-wall-status {
  margin-top: 8px;
  font-weight: 850;
}

.mode-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

/* Phase 14 Gate 7: bounded, accessible batch progress and 0/90 item rotation. */
.gate7-batch-rotation,
.gate7-batch-progress {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 9, 14, 0.28);
  min-width: 0;
}

.gate7-batch-progress[hidden] {
  display: none;
}

.gate7-batch-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.gate7-batch-progress-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.gate7-batch-progress progress {
  width: 100%;
  max-width: 100%;
  accent-color: var(--accent);
}

.gate7-batch-progress.is-compact {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(7, 9, 14, 0.18);
}

.gate7-batch-progress.is-compact .gate7-batch-progress-row {
  display: block;
}

.gate7-batch-progress.is-success {
  border-color: rgba(34, 197, 94, 0.42);
}

.gate7-batch-progress.is-error {
  border-color: rgba(248, 113, 113, 0.52);
}

.gate7-batch-progress.is-error .gate7-batch-progress-row span {
  color: #fecaca;
}

@media (max-width: 620px) {
  .gate7-batch-progress-row {
    align-items: stretch;
    flex-direction: column;
  }

  .gate7-batch-progress-row .btn {
    width: 100%;
  }
}


/* Studio2 UI1 — clicker selected color stays inside the narrow control panel. */

/* Studio2 UI2-FIX1 — keep the Clicker selected-part color editor inside the narrow panel. */
.clicker-selected-part-card,
.clicker-selected-part-card *,
.clicker-selected-part-details,
.clicker-selected-color-row,
.clicker-selected-color-row .rk3d-global-color-picker,
.clicker-selected-color-row .simple-color-trigger,
#clickerSelectedPartColorSwatches {
  box-sizing: border-box;
}

.clicker-selected-part-card,
.clicker-selected-part-details,
.clicker-selected-color-row {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.clicker-selected-part-card {
  overflow: hidden;
}

.clicker-selected-part-details {
  overflow: hidden;
}

.clicker-selected-color-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 6px !important;
  align-items: stretch !important;
  overflow: hidden;
}

.clicker-selected-color-row .rk3d-global-color-picker,
.clicker-selected-color-row .simple-color-trigger {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.clicker-selected-color-row .simple-color-trigger {
  grid-template-columns: 24px minmax(0, 1fr) auto !important;
}

.clicker-selected-part-details #clickerSelectedPartColorSwatches,
.clicker-selected-part-details .clicker-selected-color-swatches {
  display: flex !important;
  flex-flow: row wrap !important;
  grid-template-columns: none !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  padding: 0 2px 0 0 !important;
  overflow: hidden !important;
}

.clicker-selected-part-details #clickerSelectedPartColorSwatches .clicker-selected-color-swatch,
.clicker-selected-part-details .clicker-selected-color-swatches .clicker-selected-color-swatch {
  flex: 0 0 24px !important;
  width: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  height: 24px !important;
  min-height: 24px !important;
  aspect-ratio: 1 !important;
}

@media (max-width: 1180px) {
  .clicker-selected-part-details #clickerSelectedPartColorSwatches,
  .clicker-selected-part-details .clicker-selected-color-swatches {
    gap: 5px !important;
  }
}



/* UI9 — two-line keychain responsive controls */
@media (max-width: 760px) {
  .two-line-name-grid {
    grid-template-columns: 1fr;
  }

  .mode-toggle.three-mode .mode-btn {
    font-size: 11px;
  }
}


.ui9-two-line-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.ui9-two-line-actions .secondary-btn {
  min-height: 40px;
  width: 100%;
}

.ui9-two-line-connection {
  margin-top: 10px;
  border: 1px solid rgba(78, 232, 154, 0.5);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(22, 104, 70, 0.18);
  color: #8ff5bd;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.ui9-two-line-connection[data-status="weak"] {
  border-color: rgba(255, 188, 76, 0.58);
  background: rgba(134, 82, 12, 0.2);
  color: #ffd07a;
}

.ui9-two-line-connection[data-status="disconnected"] {
  border-color: rgba(255, 92, 104, 0.58);
  background: rgba(128, 28, 39, 0.2);
  color: #ff9ba4;
}

#previewCanvas.dragging-two-line-row,
canvas.dragging-two-line-row {
  cursor: grabbing !important;
}

#ui7MonogramName {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}


@media (max-width: 520px) {
  .ui9-two-line-actions {
    grid-template-columns: 1fr;
  }
}

/* UI9 shared keychain font picker: browser-rendered rows preserve actual uploaded font styles. */
.rk3d-main-font-picker {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 190px;
}

.rk3d-main-font-picker .font-search-input {
  width: 100%;
  max-width: none;
  margin: 0;
}

.rk3d-main-font-trigger {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(8, 10, 16, 0.72);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  outline: none;
}

.rk3d-main-font-trigger:focus-visible {
  border-color: rgba(46, 230, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(46, 230, 255, 0.1);
}

.rk3d-main-font-trigger-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 400;
  transition: opacity 120ms ease;
}

.rk3d-main-font-trigger-label.is-loading {
  opacity: 0.72;
}

.rk3d-main-font-caret {
  flex: 0 0 auto;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  opacity: 0.78;
  transition: transform 140ms ease;
}

.rk3d-main-font-picker.open .rk3d-main-font-caret {
  transform: rotate(180deg);
}

.rk3d-custom-editor-font-picker {
  max-width: none;
}

.rk3d-custom-editor-font-picker .rk3d-main-font-menu {
  width: min(360px, calc(100vw - 48px));
}

.rk3d-main-font-menu {
  position: absolute;
  z-index: 180;
  top: calc(100% + 6px);
  left: 0;
  width: min(330px, calc(100vw - 36px));
  max-height: min(390px, 56vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 7px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 14px;
  background: #101621;
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.54);
  scrollbar-gutter: stable;
}

.rk3d-main-font-option {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #f8fafc;
  text-align: left;
  cursor: pointer;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 400;
  opacity: 1;
  transition: background 120ms ease, opacity 120ms ease;
}

.rk3d-main-font-option.is-loading {
  opacity: 0.45;
}

.rk3d-main-font-option:hover,
.rk3d-main-font-option:focus-visible,
.rk3d-main-font-option[aria-selected='true'] {
  background: rgba(46, 230, 255, 0.14);
  outline: none;
}

.rk3d-main-font-option[aria-selected='true'] {
  box-shadow: inset 3px 0 0 var(--primary);
}

.rk3d-main-font-option.is-unavailable::after {
  content: 'Preview unavailable';
  margin-left: auto;
  padding-left: 10px;
  color: #fbbf24;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 800;
}

.rk3d-main-font-empty {
  padding: 14px 10px;
  color: var(--muted);
  text-align: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}

@media (max-width: 720px) {
  .rk3d-main-font-picker {
    max-width: none;
  }

  .rk3d-main-font-menu {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 12px;
    width: auto;
    max-height: 58vh;
  }
}
