/*
 * 123TinyTools - Digital Signature Maker
 * Version: 1.1.2
 * All selectors scoped under .tia-ds-wrap
 * Category: Generators — purple accent #8B5CF6
 */

/* ── TOKENS ──────────────────────────────────────────────────── */
.tia-ds-wrap {
  --ds-accent:        #8B5CF6;
  --ds-accent-h:      #7C3AED;
  --ds-accent-rgb:    139,92,246;
  --ds-accent-light:  #EDE9FE;
  --ds-accent-border: #C4B5FD;
  --ds-accent-dark:   #4C1D95;
  --ds-surface:       #FFFFFF;
  --ds-bg:            #F8FAFD;
  --ds-border:        #E4EAF4;
  --ds-border-s:      #CBD5E1;
  --ds-text:          #1E293B;
  --ds-body:          #475569;
  --ds-muted:         #64748B;
  --ds-r-sm:          6px;
  --ds-r-md:          10px;
  --ds-r-lg:          12px;
  --ds-r-xl:          22px;
  --ds-r-pill:        9999px;
  --ds-sh-card:       0 2px 20px rgba(0,0,0,.07), 0 1px 4px rgba(0,0,0,.04);
  --ds-sh-sm:         0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.06);
  --ds-sh-md:         0 4px 8px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --ds-font-h:        'Plus Jakarta Sans', system-ui, sans-serif;
  --ds-font-b:        'Inter', system-ui, sans-serif;

  font-family: var(--ds-font-b);
  color: var(--ds-text);
  padding: 24px 0 64px;
}

/* ── DARK MODE (all 7 signals) ───────────────────────────────── */
html[data-theme="dark"] .tia-ds-wrap,
html.wp-dark-mode-active .tia-ds-wrap,
body.wp-dark-mode-active .tia-ds-wrap,
body.kt-dark-mode .tia-ds-wrap,
body.dark-mode .tia-ds-wrap,
body[data-theme="dark"] .tia-ds-wrap,
.is-dark .tia-ds-wrap {
  --ds-surface: #1E293B;
  --ds-bg:      #0F172A;
  --ds-border:  #334155;
  --ds-border-s:#475569;
  --ds-text:    #F1F5F9;
  --ds-body:    #CBD5E1;
  --ds-muted:   #94A3B8;
}

/* ── HEADER ──────────────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-header { margin-bottom: 20px; }

.tia-ds-wrap .tia-ds-title {
  font-family: var(--ds-font-h);
  font-size: clamp(22px, 3.5vw, 28px);
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--ds-text);
  margin: 0 0 6px;
  line-height: 1.2;
}

.tia-ds-wrap .tia-ds-tagline {
  font-size: 14px;
  color: var(--ds-muted);
  line-height: 1.55;
  margin: 0 0 12px;
}

.tia-ds-wrap .tia-ds-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tia-ds-wrap .tia-ds-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: var(--ds-r-pill);
  padding: 3px 10px;
  color: var(--ds-accent-dark);
  background: var(--ds-accent-light);
  border: 1px solid var(--ds-accent-border);
}

/* Dark mode badge — light purple bg jarring on dark surface; text-only override was 1.55:1 fail */
html[data-theme="dark"] .tia-ds-wrap .tia-ds-badge,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-badge,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-badge,
body.kt-dark-mode .tia-ds-wrap .tia-ds-badge,
body.dark-mode .tia-ds-wrap .tia-ds-badge,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-badge,
.is-dark .tia-ds-wrap .tia-ds-badge {
  background: rgba(139,92,246,.15);
  border-color: rgba(139,92,246,.30);
  color: #C4B5FD;
}

/* ── PRIVACY NOTICE ──────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ds-body);
  background: #EFF4FF;
  border: 1px solid #B8D0FF;
  border-radius: var(--ds-r-md);
  padding: 10px 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

html[data-theme="dark"] .tia-ds-wrap .tia-ds-notice,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-notice,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-notice,
body.kt-dark-mode .tia-ds-wrap .tia-ds-notice,
body.dark-mode .tia-ds-wrap .tia-ds-notice,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-notice,
.is-dark .tia-ds-wrap .tia-ds-notice {
  background: rgba(91,141,239,.12);
  border-color: rgba(91,141,239,.30);
  color: #CBD5E1;
}

/* ── CARDS ───────────────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-card {
  background: var(--ds-surface);
  border-radius: var(--ds-r-xl);
  box-shadow: var(--ds-sh-card);
  overflow: hidden;
  margin-bottom: 16px;
}

/* ── CANVAS WRAP ─────────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-canvas-wrap {
  position: relative;
  background: var(--ds-surface);
  border-bottom: 1px solid var(--ds-border);
  cursor: crosshair;
}

.tia-ds-wrap .tia-ds-canvas {
  display: block;
  width: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Signature guide line */
.tia-ds-wrap .tia-ds-canvas-line {
  position: absolute;
  bottom: 25%;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(to right, transparent, #CBD5E1 15%, #CBD5E1 85%, transparent);
  pointer-events: none;
}

html[data-theme="dark"] .tia-ds-wrap .tia-ds-canvas-line,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-canvas-line,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-canvas-line,
body.kt-dark-mode .tia-ds-wrap .tia-ds-canvas-line,
body.dark-mode .tia-ds-wrap .tia-ds-canvas-line,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-canvas-line,
.is-dark .tia-ds-wrap .tia-ds-canvas-line {
  background: linear-gradient(to right, transparent, #334155 15%, #334155 85%, transparent);
}

/* Canvas wrap: must stay white in dark mode — pen ink is always dark, dark bg = invisible signature */
html[data-theme="dark"] .tia-ds-wrap .tia-ds-canvas-wrap,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-canvas-wrap,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-canvas-wrap,
body.kt-dark-mode .tia-ds-wrap .tia-ds-canvas-wrap,
body.dark-mode .tia-ds-wrap .tia-ds-canvas-wrap,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-canvas-wrap,
.is-dark .tia-ds-wrap .tia-ds-canvas-wrap { background: #FFFFFF !important; }

/* Canvas placeholder text */
.tia-ds-wrap .tia-ds-canvas-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--ds-muted);
  opacity: .5;
  pointer-events: none;
  transition: opacity .2s;
  font-style: italic;
  letter-spacing: .02em;
}

.tia-ds-wrap .tia-ds-canvas-placeholder.hidden { opacity: 0; }

/* ── TAB BAR ─────────────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-tab-bar {
  display: flex;
  background: var(--ds-bg);
  border-bottom: 1px solid var(--ds-border);
  overflow-x: auto;
  scrollbar-width: none;
}

.tia-ds-wrap .tia-ds-tab-bar::-webkit-scrollbar { display: none; }

.tia-ds-wrap .tia-ds-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  font-family: var(--ds-font-b);
  font-size: 13px;
  font-weight: 500;
  color: var(--ds-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, background .15s;
}

.tia-ds-wrap .tia-ds-tab:hover {
  color: var(--ds-body);
  background: rgba(139,92,246,.04);
}

.tia-ds-wrap .tia-ds-tab.active {
  color: var(--ds-accent);
  border-bottom-color: var(--ds-accent);
  background: var(--ds-surface);
  font-weight: 600;
}

/* Dark mode tab hover */
html[data-theme="dark"] .tia-ds-wrap .tia-ds-tab:hover,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-tab:hover,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-tab:hover,
body.kt-dark-mode .tia-ds-wrap .tia-ds-tab:hover,
body.dark-mode .tia-ds-wrap .tia-ds-tab:hover,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-tab:hover,
.is-dark .tia-ds-wrap .tia-ds-tab:hover {
  background: #334155;
  color: #CBD5E1;
}

/* ── TAB PANELS ──────────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-panel { padding: 16px 18px 18px; }
.tia-ds-wrap .tia-ds-panel--hidden { display: none; }

/* ── DRAW TOOLS ──────────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-draw-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.tia-ds-wrap .tia-ds-tool-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tia-ds-wrap .tia-ds-tool-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ds-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

/* Range slider */
.tia-ds-wrap .tia-ds-range {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 4px;
  border-radius: 99px;
  background: var(--ds-border);
  outline: none;
  cursor: pointer;
}

.tia-ds-wrap .tia-ds-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ds-accent);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(var(--ds-accent-rgb), .4);
}

.tia-ds-wrap .tia-ds-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ds-accent);
  border: none;
  cursor: pointer;
}

.tia-ds-wrap .tia-ds-range-val {
  font-size: 12px;
  color: var(--ds-muted);
  min-width: 28px;
  font-variant-numeric: tabular-nums;
}

/* Pen color swatches */
.tia-ds-wrap .tia-ds-pen-colors {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tia-ds-wrap .tia-ds-pen-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
  padding: 0;
  flex-shrink: 0;
}

.tia-ds-wrap .tia-ds-pen-swatch:hover { transform: scale(1.15); }

.tia-ds-wrap .tia-ds-pen-swatch--active {
  border-color: var(--ds-accent) !important;
  box-shadow: 0 0 0 2px var(--ds-surface), 0 0 0 4px var(--ds-accent);
}

.tia-ds-wrap .tia-ds-pen-swatch--custom {
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
}

.tia-ds-wrap .tia-ds-pen-swatch--custom input[type="color"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Draw action buttons */
.tia-ds-wrap .tia-ds-draw-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

/* ── TYPE TOOLS ──────────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-type-tools { display: flex; flex-direction: column; gap: 14px; }

.tia-ds-wrap .tia-ds-type-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tia-ds-wrap .tia-ds-type-input {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  font-family: var(--ds-font-b);
  font-size: 14px;
  color: var(--ds-text);
  background: var(--ds-bg);
  border: 1.5px solid var(--ds-border);
  border-radius: var(--ds-r-md);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.tia-ds-wrap .tia-ds-type-input:focus {
  border-color: var(--ds-accent);
  box-shadow: 0 0 0 3px rgba(var(--ds-accent-rgb), .14);
  background: var(--ds-surface);
}

.tia-ds-wrap .tia-ds-type-input::placeholder { color: var(--ds-muted); }

.tia-ds-wrap .tia-ds-type-size {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Font picker */
.tia-ds-wrap .tia-ds-font-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tia-ds-wrap .tia-ds-font-btn {
  padding: 8px 16px;
  font-size: 17px;
  line-height: 1.2;
  color: var(--ds-body);
  background: var(--ds-bg);
  border: 1.5px solid var(--ds-border);
  border-radius: var(--ds-r-md);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.tia-ds-wrap .tia-ds-font-btn:hover {
  border-color: var(--ds-accent-border);
  color: var(--ds-accent);
  background: var(--ds-accent-light);
}

.tia-ds-wrap .tia-ds-font-btn.active {
  border-color: var(--ds-accent);
  color: var(--ds-accent);
  background: var(--ds-accent-light);
  font-weight: 600;
}

/* Dark mode font btn hover */
html[data-theme="dark"] .tia-ds-wrap .tia-ds-font-btn:hover,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-font-btn:hover,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-font-btn:hover,
body.kt-dark-mode .tia-ds-wrap .tia-ds-font-btn:hover,
body.dark-mode .tia-ds-wrap .tia-ds-font-btn:hover,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-font-btn:hover,
.is-dark .tia-ds-wrap .tia-ds-font-btn:hover {
  background: #334155;
  border-color: var(--ds-accent-border);
  color: var(--ds-accent);
}

/* ── UPLOAD ZONE ─────────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-upload-zone {
  border: 2px dashed var(--ds-accent-border);
  border-radius: var(--ds-r-lg);
  background: var(--ds-accent-light);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}

.tia-ds-wrap .tia-ds-upload-zone:hover,
.tia-ds-wrap .tia-ds-upload-zone.drag-over {
  border-color: var(--ds-accent);
  background: rgba(var(--ds-accent-rgb), .1);
}

html[data-theme="dark"] .tia-ds-wrap .tia-ds-upload-zone,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-upload-zone,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-upload-zone,
body.kt-dark-mode .tia-ds-wrap .tia-ds-upload-zone,
body.dark-mode .tia-ds-wrap .tia-ds-upload-zone,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-upload-zone,
.is-dark .tia-ds-wrap .tia-ds-upload-zone {
  background: rgba(var(--ds-accent-rgb), .08);
  border-color: rgba(var(--ds-accent-rgb), .3);
}

.tia-ds-wrap .tia-ds-upload-zone svg {
  display: block;
  margin: 0 auto 12px;
  color: var(--ds-accent);
}

.tia-ds-wrap .tia-ds-upload-label {
  font-size: 14px;
  color: var(--ds-body);
  margin: 0 0 6px;
  line-height: 1.6;
}

.tia-ds-wrap .tia-ds-upload-link {
  color: var(--ds-accent);
  font-weight: 600;
  text-decoration: underline;
}

.tia-ds-wrap .tia-ds-upload-hint {
  font-size: 12px;
  color: var(--ds-muted);
  margin: 0;
}

.tia-ds-wrap .tia-ds-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* ── EXPORT CARD ─────────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-card--export { padding: 20px; }

/* Preview */
.tia-ds-wrap .tia-ds-preview-wrap { margin-bottom: 20px; }

.tia-ds-wrap .tia-ds-preview-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ds-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}

.tia-ds-wrap .tia-ds-preview-canvas-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  padding: 16px;
  border-radius: var(--ds-r-lg);
  border: 1.5px solid var(--ds-border);
  background: repeating-conic-gradient(#f0f0f0 0% 25%, #ffffff 0% 50%) 0 0 / 14px 14px;
  width: 100%;
  box-sizing: border-box;
}

/* White bg preview */
.tia-ds-wrap .tia-ds-preview-canvas-wrap.bg-white {
  background: #fff;
}

html[data-theme="dark"] .tia-ds-wrap .tia-ds-preview-canvas-wrap,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-preview-canvas-wrap,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-preview-canvas-wrap,
body.kt-dark-mode .tia-ds-wrap .tia-ds-preview-canvas-wrap,
body.dark-mode .tia-ds-wrap .tia-ds-preview-canvas-wrap,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-preview-canvas-wrap,
.is-dark .tia-ds-wrap .tia-ds-preview-canvas-wrap {
  background: repeating-conic-gradient(#1e293b 0% 25%, #162032 0% 50%) 0 0 / 14px 14px;
  border-color: #334155;
}

html[data-theme="dark"] .tia-ds-wrap .tia-ds-preview-canvas-wrap.bg-white,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-preview-canvas-wrap.bg-white,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-preview-canvas-wrap.bg-white,
body.kt-dark-mode .tia-ds-wrap .tia-ds-preview-canvas-wrap.bg-white,
body.dark-mode .tia-ds-wrap .tia-ds-preview-canvas-wrap.bg-white,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-preview-canvas-wrap.bg-white,
.is-dark .tia-ds-wrap .tia-ds-preview-canvas-wrap.bg-white {
  background: #ffffff;
}

.tia-ds-wrap .tia-ds-preview-canvas {
  display: block;
  max-width: 100%;
  max-height: 140px;
  width: auto;
  height: auto;
}

/* ── BEAUTIFY SECTION ────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-section {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ds-border);
}

.tia-ds-wrap .tia-ds-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tia-ds-wrap .tia-ds-section-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ds-font-h);
  font-size: 14px;
  font-weight: 700;
  color: var(--ds-text);
}

.tia-ds-wrap .tia-ds-section-hint {
  font-size: 12px;
  color: var(--ds-muted);
  font-style: italic;
}

/* Level picker — underline tab style */
.tia-ds-wrap .tia-ds-level-picker {
  display: flex;
  gap: 0;
  border: none;
  border-radius: 0;
  overflow: visible;
  border-bottom: 1px solid var(--ds-border);
}

.tia-ds-wrap .tia-ds-level-btn {
  flex: 1;
  padding: 9px 8px;
  font-family: var(--ds-font-b);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ds-muted);
  background: none;
  border: none;
  border-right: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}

.tia-ds-wrap .tia-ds-level-btn:last-child { border-right: none; }

.tia-ds-wrap .tia-ds-level-btn:hover:not([aria-pressed="true"]) {
  background: var(--ds-bg);
  color: var(--ds-body);
  border-bottom-color: rgba(var(--ds-accent-rgb), .3);
}

.tia-ds-wrap .tia-ds-level-btn[aria-pressed="true"] {
  background: var(--ds-surface);
  color: var(--ds-accent);
  font-weight: 600;
  border-bottom-color: var(--ds-accent);
}

/* Dark mode level picker hover */
html[data-theme="dark"] .tia-ds-wrap .tia-ds-level-btn:hover:not([aria-pressed="true"]),
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-level-btn:hover:not([aria-pressed="true"]),
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-level-btn:hover:not([aria-pressed="true"]),
body.kt-dark-mode .tia-ds-wrap .tia-ds-level-btn:hover:not([aria-pressed="true"]),
body.dark-mode .tia-ds-wrap .tia-ds-level-btn:hover:not([aria-pressed="true"]),
body[data-theme="dark"] .tia-ds-wrap .tia-ds-level-btn:hover:not([aria-pressed="true"]),
.is-dark .tia-ds-wrap .tia-ds-level-btn:hover:not([aria-pressed="true"]) {
  background: #334155;
  color: #CBD5E1;
  border-bottom-color: rgba(139,92,246,.4);
}

/* ── OPTIONS ROW ─────────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 16px;
}

.tia-ds-wrap .tia-ds-option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tia-ds-wrap .tia-ds-option-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ds-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Color swatches (export ink color) */
.tia-ds-wrap .tia-ds-color-swatches {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tia-ds-wrap .tia-ds-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  padding: 0;
  flex-shrink: 0;
}

.tia-ds-wrap .tia-ds-color-swatch:hover { transform: scale(1.12); }

.tia-ds-wrap .tia-ds-color-swatch--active {
  border-color: var(--ds-accent) !important;
  box-shadow: 0 0 0 2px var(--ds-surface), 0 0 0 4px var(--ds-accent);
}

.tia-ds-wrap .tia-ds-color-swatch--custom {
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
}

.tia-ds-wrap .tia-ds-color-swatch--custom input[type="color"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Toggle groups (background / padding) — underline tab style */
.tia-ds-wrap .tia-ds-toggle-group {
  display: flex;
  gap: 0;
  border: none;
  border-radius: 0;
  overflow: visible;
  border-bottom: 1px solid var(--ds-border);
}

.tia-ds-wrap .tia-ds-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 12px;
  font-family: var(--ds-font-b);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ds-muted);
  background: none;
  border: none;
  border-right: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}

.tia-ds-wrap .tia-ds-toggle-btn:last-child { border-right: none; }

.tia-ds-wrap .tia-ds-toggle-btn:hover:not(.tia-ds-toggle-btn--active) {
  background: var(--ds-bg);
  color: var(--ds-body);
  border-bottom-color: rgba(var(--ds-accent-rgb), .3);
}

.tia-ds-wrap .tia-ds-toggle-btn--active {
  background: var(--ds-surface);
  color: var(--ds-accent);
  font-weight: 600;
  border-bottom-color: var(--ds-accent);
}

/* Dark mode toggle hover */
html[data-theme="dark"] .tia-ds-wrap .tia-ds-toggle-btn:hover:not(.tia-ds-toggle-btn--active),
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-toggle-btn:hover:not(.tia-ds-toggle-btn--active),
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-toggle-btn:hover:not(.tia-ds-toggle-btn--active),
body.kt-dark-mode .tia-ds-wrap .tia-ds-toggle-btn:hover:not(.tia-ds-toggle-btn--active),
body.dark-mode .tia-ds-wrap .tia-ds-toggle-btn:hover:not(.tia-ds-toggle-btn--active),
body[data-theme="dark"] .tia-ds-wrap .tia-ds-toggle-btn:hover:not(.tia-ds-toggle-btn--active),
.is-dark .tia-ds-wrap .tia-ds-toggle-btn:hover:not(.tia-ds-toggle-btn--active) {
  background: #334155;
  color: #CBD5E1;
  border-bottom-color: rgba(139,92,246,.4);
}

/* Upload option (remove white bg) */
.tia-ds-wrap .tia-ds-upload-opt {
  margin-bottom: 16px;
}

.tia-ds-wrap .tia-ds-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ds-body);
  cursor: pointer;
}

.tia-ds-wrap .tia-ds-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ds-accent);
  cursor: pointer;
}

/* ── EXPORT ACTIONS ──────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-export-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

/* ── BUTTONS ─────────────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--ds-accent);
  color: #fff;
  border: none;
  border-radius: var(--ds-r-pill);
  padding: 11px 22px;
  font-family: var(--ds-font-b);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 2px 12px rgba(var(--ds-accent-rgb), .4);
  white-space: nowrap;
}

.tia-ds-wrap .tia-ds-btn-primary:hover {
  background: var(--ds-accent-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(var(--ds-accent-rgb), .5);
}

.tia-ds-wrap .tia-ds-btn-primary:active { transform: translateY(0); }

.tia-ds-wrap .tia-ds-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--ds-surface);
  color: var(--ds-body);
  border: 1.5px solid var(--ds-border);
  border-radius: var(--ds-r-pill);
  padding: 9px 20px;
  font-family: var(--ds-font-b);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  white-space: nowrap;
}

.tia-ds-wrap .tia-ds-btn-secondary:hover {
  border-color: var(--ds-accent-border);
  color: var(--ds-accent);
  background: var(--ds-accent-light);
}

html[data-theme="dark"] .tia-ds-wrap .tia-ds-btn-secondary:hover,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-btn-secondary:hover,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-btn-secondary:hover,
body.kt-dark-mode .tia-ds-wrap .tia-ds-btn-secondary:hover,
body.dark-mode .tia-ds-wrap .tia-ds-btn-secondary:hover,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-btn-secondary:hover,
.is-dark .tia-ds-wrap .tia-ds-btn-secondary:hover {
  background: #334155;
  border-color: var(--ds-accent-border);
  color: var(--ds-accent);
}

.tia-ds-wrap .tia-ds-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--ds-muted);
  border: none;
  border-radius: var(--ds-r-md);
  padding: 6px 10px;
  font-family: var(--ds-font-b);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.tia-ds-wrap .tia-ds-btn-ghost:hover:not(:disabled) { background: var(--ds-bg); color: var(--ds-body); }
.tia-ds-wrap .tia-ds-btn-ghost:disabled { opacity: .4; cursor: not-allowed; }

html[data-theme="dark"] .tia-ds-wrap .tia-ds-btn-ghost:hover:not(:disabled),
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-btn-ghost:hover:not(:disabled),
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-btn-ghost:hover:not(:disabled),
body.kt-dark-mode .tia-ds-wrap .tia-ds-btn-ghost:hover:not(:disabled),
body.dark-mode .tia-ds-wrap .tia-ds-btn-ghost:hover:not(:disabled),
body[data-theme="dark"] .tia-ds-wrap .tia-ds-btn-ghost:hover:not(:disabled),
.is-dark .tia-ds-wrap .tia-ds-btn-ghost:hover:not(:disabled) {
  background: #334155;
  color: #CBD5E1;
}

/* ── LOGIN GATE ──────────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-gate {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tia-ds-wrap .tia-ds-gate-modal {
  background: var(--ds-surface);
  border-radius: var(--ds-r-xl);
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  padding: 40px 36px;
  max-width: 420px;
  width: 90%;
  text-align: center;
}

.tia-ds-wrap .tia-ds-gate-icon {
  width: 56px;
  height: 56px;
  background: var(--ds-accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--ds-accent);
}

.tia-ds-wrap .tia-ds-gate-title {
  font-family: var(--ds-font-h);
  font-size: 18px;
  font-weight: 800;
  color: var(--ds-text);
  margin: 0 0 8px;
}

.tia-ds-wrap .tia-ds-gate-sub {
  font-size: 14px;
  color: var(--ds-body);
  margin: 0 0 24px;
  line-height: 1.6;
}

.tia-ds-wrap .tia-ds-gate-btn {
  display: block;
  background: var(--ds-accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--ds-r-pill);
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  transition: background .15s;
}

.tia-ds-wrap .tia-ds-gate-btn:hover { background: var(--ds-accent-h); }

.tia-ds-wrap .tia-ds-gate-link {
  display: block;
  font-size: 13px;
  color: var(--ds-muted);
  text-decoration: none;
}

.tia-ds-wrap .tia-ds-gate-link:hover { color: var(--ds-accent); }

/* ── SEO CONTENT ─────────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-seo-content {
  margin-top: 32px;
  padding: 28px;
  background: var(--ds-surface);
  border-radius: var(--ds-r-xl);
  box-shadow: var(--ds-sh-card);
}

.tia-ds-wrap .tia-ds-seo-content h2,
.tia-ds-wrap .tia-ds-seo-content h3 {
  font-family: var(--ds-font-h);
  font-weight: 800;
  color: var(--ds-text);
  margin: 0 0 10px;
}

.tia-ds-wrap .tia-ds-seo-content h2 { font-size: 20px; }
.tia-ds-wrap .tia-ds-seo-content h3 { font-size: 16px; margin-top: 22px; }

.tia-ds-wrap .tia-ds-seo-content p,
.tia-ds-wrap .tia-ds-seo-content li {
  font-size: 14px;
  color: var(--ds-body);
  line-height: 1.75;
  margin: 0 0 10px;
}

.tia-ds-wrap .tia-ds-seo-content ol,
.tia-ds-wrap .tia-ds-seo-content ul { padding-left: 20px; margin: 0 0 12px; }
.tia-ds-wrap .tia-ds-seo-content a { color: var(--ds-accent); }

html[data-theme="dark"] .tia-ds-wrap .tia-ds-seo-content h2,
html[data-theme="dark"] .tia-ds-wrap .tia-ds-seo-content h3,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-seo-content h2,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-seo-content h3,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-seo-content h2,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-seo-content h3,
body.kt-dark-mode .tia-ds-wrap .tia-ds-seo-content h2,
body.kt-dark-mode .tia-ds-wrap .tia-ds-seo-content h3,
body.dark-mode .tia-ds-wrap .tia-ds-seo-content h2,
body.dark-mode .tia-ds-wrap .tia-ds-seo-content h3,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-seo-content h2,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-seo-content h3,
.is-dark .tia-ds-wrap .tia-ds-seo-content h2,
.is-dark .tia-ds-wrap .tia-ds-seo-content h3 { color: #F1F5F9; }

html[data-theme="dark"] .tia-ds-wrap .tia-ds-seo-content p,
html[data-theme="dark"] .tia-ds-wrap .tia-ds-seo-content li,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-seo-content p,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-seo-content li,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-seo-content p,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-seo-content li,
body.kt-dark-mode .tia-ds-wrap .tia-ds-seo-content p,
body.kt-dark-mode .tia-ds-wrap .tia-ds-seo-content li,
body.dark-mode .tia-ds-wrap .tia-ds-seo-content p,
body.dark-mode .tia-ds-wrap .tia-ds-seo-content li,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-seo-content p,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-seo-content li,
.is-dark .tia-ds-wrap .tia-ds-seo-content p,
.is-dark .tia-ds-wrap .tia-ds-seo-content li { color: #CBD5E1; }

/* ── FAQ ─────────────────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-faq-section { margin-top: 32px; }

.tia-ds-wrap .tia-ds-faq-heading {
  font-family: var(--ds-font-h);
  font-size: 18px;
  font-weight: 800;
  color: var(--ds-text);
  margin: 0 0 16px;
}

.tia-ds-wrap .tia-ds-faq-list { display: flex; flex-direction: column; gap: 8px; }

.tia-ds-wrap .tia-ds-faq-item {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-lg);
  overflow: hidden;
}

.tia-ds-wrap .tia-ds-faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ds-text);
  cursor: pointer;
  list-style: none;
  transition: background .15s, color .15s;
}

.tia-ds-wrap .tia-ds-faq-q::-webkit-details-marker { display: none; }
.tia-ds-wrap .tia-ds-faq-q::after { content: '+'; font-size: 18px; font-weight: 400; color: var(--ds-muted); }
.tia-ds-wrap .tia-ds-faq-item[open] .tia-ds-faq-q::after { content: '−'; }
.tia-ds-wrap .tia-ds-faq-q:hover { background: var(--ds-accent-light); color: var(--ds-accent); }

html[data-theme="dark"] .tia-ds-wrap .tia-ds-faq-q,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-faq-q,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-faq-q,
body.kt-dark-mode .tia-ds-wrap .tia-ds-faq-q,
body.dark-mode .tia-ds-wrap .tia-ds-faq-q,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-faq-q,
.is-dark .tia-ds-wrap .tia-ds-faq-q { color: #F1F5F9 !important; }
html[data-theme="dark"] .tia-ds-wrap .tia-ds-faq-q:hover,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-faq-q:hover,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-faq-q:hover,
body.kt-dark-mode .tia-ds-wrap .tia-ds-faq-q:hover,
body.dark-mode .tia-ds-wrap .tia-ds-faq-q:hover,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-faq-q:hover,
.is-dark .tia-ds-wrap .tia-ds-faq-q:hover { background: rgba(139,92,246,.20) !important; color: #C4B5FD !important; }

.tia-ds-wrap .tia-ds-faq-a {
  padding: 14px 18px 18px;
  font-size: 14px;
  color: var(--ds-body);
  line-height: 1.7;
  background: var(--ds-bg);
  border-top: 1px solid var(--ds-border);
}

html[data-theme="dark"] .tia-ds-wrap .tia-ds-faq-a,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-faq-a,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-faq-a,
body.kt-dark-mode .tia-ds-wrap .tia-ds-faq-a,
body.dark-mode .tia-ds-wrap .tia-ds-faq-a,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-faq-a,
.is-dark .tia-ds-wrap .tia-ds-faq-a {
  background: #0F172A !important;
  color: #CBD5E1 !important;
  border-color: #334155 !important;
}

/* ── RELATED TOOLS ───────────────────────────────────────────── */
.tia-ds-wrap .tia-ds-related { margin-top: 32px; }

.tia-ds-wrap .tia-ds-related-title {
  font-family: var(--ds-font-h);
  font-size: 16px;
  font-weight: 700;
  color: var(--ds-text);
  margin-bottom: 12px;
}

.tia-ds-wrap .tia-ds-related-list { display: flex; flex-wrap: wrap; gap: 10px; }

.tia-ds-wrap .tia-ds-related-tool {
  display: inline-flex;
  align-items: center;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-r-pill);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ds-body);
  text-decoration: none;
  transition: border-color .2s, color .2s, box-shadow .2s;
  box-shadow: var(--ds-sh-sm);
}

.tia-ds-wrap .tia-ds-related-tool:hover {
  border-color: var(--ds-accent-border);
  color: var(--ds-accent);
  box-shadow: var(--ds-sh-md);
}

html[data-theme="dark"] .tia-ds-wrap .tia-ds-related-tool,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-related-tool,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-related-tool,
body.kt-dark-mode .tia-ds-wrap .tia-ds-related-tool,
body.dark-mode .tia-ds-wrap .tia-ds-related-tool,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-related-tool,
.is-dark .tia-ds-wrap .tia-ds-related-tool {
  background: #1E293B;
  border-color: #334155;
  color: #CBD5E1;
}

html[data-theme="dark"] .tia-ds-wrap .tia-ds-related-tool:hover,
html.wp-dark-mode-active .tia-ds-wrap .tia-ds-related-tool:hover,
body.wp-dark-mode-active .tia-ds-wrap .tia-ds-related-tool:hover,
body.kt-dark-mode .tia-ds-wrap .tia-ds-related-tool:hover,
body.dark-mode .tia-ds-wrap .tia-ds-related-tool:hover,
body[data-theme="dark"] .tia-ds-wrap .tia-ds-related-tool:hover,
.is-dark .tia-ds-wrap .tia-ds-related-tool:hover {
  border-color: var(--ds-accent-border);
  color: var(--ds-accent);
}

/* ── TOOL LAYOUT — side-by-side on desktop ───────────────────── */
@media (min-width: 900px) {
  .tia-ds-wrap .tia-ds-tool-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }
  .tia-ds-wrap .tia-ds-tool-layout .tia-ds-card {
    margin-bottom: 0;
  }
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .tia-ds-wrap .tia-ds-header  { text-align: center; }
  .tia-ds-wrap .tia-ds-tagline { text-align: center; }
  .tia-ds-wrap .tia-ds-badges  { justify-content: center; }
  .tia-ds-wrap .tia-ds-draw-tools { flex-wrap: wrap; gap: 12px; }
  .tia-ds-wrap .tia-ds-options-row { flex-direction: column; gap: 14px; }
}

@media (max-width: 540px) {
  .tia-ds-wrap { overflow-x: hidden; padding: 16px 0 48px; }
  .tia-ds-wrap .tia-ds-card { min-width: 0; overflow: hidden; }
  .tia-ds-wrap .tia-ds-export-actions { flex-wrap: wrap; }
  .tia-ds-wrap .tia-ds-btn-primary { width: 100%; justify-content: center; }
  .tia-ds-wrap .tia-ds-font-picker { gap: 6px; }
  .tia-ds-wrap .tia-ds-font-btn { padding: 6px 10px; font-size: 15px; }
  .tia-ds-wrap .tia-ds-gate-modal { padding: 28px 20px; }
}

/* ── REDUCED MOTION ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
