/* Color Palette Generator — mobile editor (max-width 1199px). Desktop untouched. */

@media (max-width: 1199px) {
  html.cpg-mobile-boot body.cpg-mobile-editor-active .cpg-mobile-next-btn {
    width: 100% !important;
    min-height: 48px !important;
    border: 0 !important;
    border-radius: 14px !important;
    background: var(--cpg-accent) !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    -webkit-text-fill-color: #fff !important;
  }

  main[data-tool="color-palette-generator"].color-palette-seo-page {
    --cpg-font: Inter, "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --cpg-heading: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
    --cpg-text: #172033;
    --cpg-label: #334155;
    --cpg-accent: #2563eb;
    --cpg-border: #dbe3ef;
  }

  html.cpg-mobile-boot body.flux-tool-body main[data-tool="color-palette-generator"] .color-palette-legacy-mobile,
  html.cpg-mobile-boot body.flux-tool-body main[data-tool="color-palette-generator"] #tool-workspace,
  html.cpg-mobile-boot body.flux-tool-body main[data-tool="color-palette-generator"] .tool-workspace-note {
    visibility: hidden !important;
    pointer-events: none !important;
    max-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }

  body.cpg-mobile-editor-active .site-header,
  body.cpg-mobile-editor-active .site-footer,
  body.cpg-mobile-editor-active main[data-tool="color-palette-generator"] .color-palette-legacy-mobile,
  body.cpg-mobile-editor-active main[data-tool="color-palette-generator"] .color-palette-desktop-only,
  body.cpg-mobile-editor-active main[data-tool="color-palette-generator"] #tool-workspace,
  body.cpg-mobile-editor-active main[data-tool="color-palette-generator"] .tool-workspace-note,
  body.cpg-mobile-editor-active main[data-tool="color-palette-generator"] .tool-content-stack,
  body.cpg-mobile-editor-active .breadcrumb {
    display: none !important;
  }

  html:has(body.cpg-mobile-editor-active),
  body.cpg-mobile-editor-active {
    overflow: hidden !important;
    height: 100dvh !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-editor[data-c100kb-portaled="true"] {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #f3f5f8 !important;
    font-family: var(--cpg-font) !important;
    color: var(--cpg-text) !important;
    -webkit-text-fill-color: currentColor !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-editor *,
  body.cpg-mobile-editor-active .cpg-mobile-editor *::before,
  body.cpg-mobile-editor-active .cpg-mobile-editor *::after {
    box-sizing: border-box;
  }

  body.cpg-mobile-editor-active .cpg-mobile-label,
  body.cpg-mobile-editor-active .cpg-mobile-helper,
  body.cpg-mobile-editor-active .cpg-mobile-range-badge,
  body.cpg-mobile-editor-active .cpg-mobile-stepper-label,
  body.cpg-mobile-editor-active .cpg-mobile-preview-meta,
  body.cpg-mobile-editor-active .cpg-mobile-trust li,
  body.cpg-mobile-editor-active .cpg-mobile-card-title {
    color: var(--cpg-label) !important;
    opacity: 1 !important;
    -webkit-text-fill-color: currentColor !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-header {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) 44px !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
    min-height: 56px !important;
    padding: 8px 12px 6px !important;
    background: #fff !important;
    border-bottom: 1px solid var(--cpg-border) !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-back {
    width: 40px !important;
    height: 40px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: #f1f5f9 !important;
    color: var(--cpg-text) !important;
    display: grid !important;
    place-items: center !important;
    cursor: pointer !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-title {
    margin: 0 !important;
    font-family: var(--cpg-heading) !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    text-align: center !important;
    color: var(--cpg-text) !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-stepper {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
    flex: 0 0 auto !important;
    padding: 8px 12px !important;
    background: #fff !important;
    border-bottom: 1px solid var(--cpg-border) !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-stepper-item {
    position: relative !important;
    display: grid !important;
    gap: 4px !important;
    justify-items: center !important;
    border: 0 !important;
    background: transparent !important;
    padding: 0 4px !important;
    cursor: pointer !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-stepper-dot {
    z-index: 1 !important;
    display: grid !important;
    place-items: center !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 999px !important;
    background: #e2e8f0 !important;
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 800 !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-stepper-item.is-active .cpg-mobile-stepper-dot {
    background: var(--cpg-accent) !important;
    color: #fff !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-stepper-label {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #94a3b8 !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-stepper-item.is-active .cpg-mobile-stepper-label {
    color: var(--cpg-accent) !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-preview {
    flex: 0 0 auto !important;
    padding: 12px 12px 8px !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-preview-stage {
    border-radius: 16px !important;
    border: 1px solid var(--cpg-border) !important;
    background: #fff !important;
    padding: 12px !important;
    display: grid !important;
    gap: 8px !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-palette-strip {
    display: grid !important;
    grid-template-columns: repeat(var(--cpg-strip-count, 5), minmax(0, 1fr)) !important;
    gap: 6px !important;
    min-height: 72px !important;
  }

  body.cpg-mobile-editor-active .cpg-strip-cell {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    min-width: 0 !important;
  }

  body.cpg-mobile-editor-active .cpg-strip-swatch {
    flex: 1 1 auto !important;
    min-height: 56px !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    border-radius: 10px !important;
    padding: 0 !important;
    cursor: pointer !important;
    position: relative !important;
  }

  body.cpg-mobile-editor-active .cpg-strip-hex {
    position: absolute !important;
    left: 50% !important;
    bottom: 4px !important;
    transform: translateX(-50%) !important;
    max-width: calc(100% - 6px) !important;
    padding: 2px 4px !important;
    border-radius: 4px !important;
    background: rgba(15, 23, 42, 0.82) !important;
    color: #f8fafc !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    opacity: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.cpg-mobile-editor-active .cpg-strip-lock {
    min-height: 32px !important;
    border: 1px solid #d7e1ef !important;
    border-radius: 8px !important;
    background: #f8fafc !important;
    color: #475569 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
  }

  body.cpg-mobile-editor-active .cpg-strip-lock.is-locked {
    border-color: #2563eb !important;
    background: #eff6ff !important;
    color: #1d4ed8 !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 0 12px 8px !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-card {
    width: 100% !important;
    max-width: calc(100vw - 24px) !important;
    margin: 0 auto !important;
    padding: 14px !important;
    border-radius: 18px !important;
    border: 1px solid var(--cpg-border) !important;
    background: #fff !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06) !important;
    display: grid !important;
    gap: 12px !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-field {
    display: grid !important;
    gap: 6px !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-label {
    font-size: 14px !important;
    font-weight: 700 !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-input,
  body.cpg-mobile-editor-active .cpg-mobile-select {
    width: 100% !important;
    min-height: 44px !important;
    padding: 10px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: var(--cpg-text) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    -webkit-text-fill-color: currentColor !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-helper {
    margin: 0 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.45 !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-color-open-row {
    display: grid !important;
    grid-template-columns: 52px minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: end !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-swatch-trigger {
    width: 52px !important;
    height: 52px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 14px !important;
    padding: 0 !important;
    cursor: pointer !important;
  }

  body.cpg-mobile-editor-active .cpg-native-picker,
  body.cpg-mobile-editor-active .cpg-mobile-color-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-range {
    width: 100% !important;
    min-height: 32px !important;
    accent-color: var(--cpg-accent) !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-range-badge {
    justify-self: end !important;
    min-width: 44px !important;
    padding: 4px 10px !important;
    border-radius: 999px !important;
    background: #eff6ff !important;
    color: var(--cpg-accent) !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    text-align: center !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-presets,
  body.cpg-mobile-editor-active .cpg-mobile-recent-grid {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-swatch-btn {
    min-height: 44px !important;
    aspect-ratio: 1 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    padding: 0 !important;
    cursor: pointer !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-trust {
    list-style: none !important;
    margin: 10px 0 0 !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-trust li {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 44px !important;
    padding: 8px 10px !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    background: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-center-tabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-center-tab {
    min-height: 44px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: var(--cpg-label) !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-center-tab.is-active {
    border-color: var(--cpg-accent) !important;
    background: #eff6ff !important;
    color: var(--cpg-accent) !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 44px !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    border: 1px solid #cbd5e1 !important;
    background: #fff !important;
    color: var(--cpg-label) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    visibility: visible !important;
    opacity: 1 !important;
    appearance: none !important;
  }

  body.cpg-mobile-editor-active label.cpg-mobile-btn,
  body.cpg-mobile-editor-active label.cpg-mobile-upload-label {
    display: flex !important;
    width: 100% !important;
    cursor: pointer !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-btn span {
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
    opacity: 1 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-btn-primary,
  body.cpg-mobile-editor-active .cpg-mobile-btn-primary span {
    border-color: #2563eb !important;
    background: #2563eb !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-btn-secondary,
  body.cpg-mobile-editor-active .cpg-mobile-btn-secondary span {
    background: #fff !important;
    color: #334155 !important;
    -webkit-text-fill-color: #334155 !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-regenerate-btn {
    width: 100% !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-image-empty {
    display: grid !important;
    gap: 12px !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-image-empty.is-dragover {
    border: 2px dashed var(--cpg-accent) !important;
    border-radius: 12px !important;
    padding: 8px !important;
    background: #eff6ff !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-image-thumb-wrap {
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
    padding: 8px !important;
    display: flex !important;
    justify-content: center !important;
    max-height: 140px !important;
    overflow: hidden !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-image-thumb {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-image-toolbar {
    display: grid !important;
    gap: 8px !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-count-group {
    display: grid !important;
    gap: 6px !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-count-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-count-btn {
    min-height: 44px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: var(--cpg-label) !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-count-btn.is-active {
    border-color: var(--cpg-accent) !important;
    background: #eff6ff !important;
    color: var(--cpg-accent) !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-image-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-values-header {
    display: grid !important;
    gap: 10px !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-format-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-format-btn {
    min-height: 44px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: var(--cpg-label) !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-format-btn.is-active {
    border-color: var(--cpg-accent) !important;
    background: #eff6ff !important;
    color: var(--cpg-accent) !important;
  }

  body.cpg-mobile-editor-active .cpg-label {
    color: var(--cpg-label) !important;
    opacity: 1 !important;
    -webkit-text-fill-color: currentColor !important;
    font-size: 13px !important;
    font-weight: 700 !important;
  }

  body.cpg-mobile-editor-active .cpg-input {
    width: 100% !important;
    min-height: 44px !important;
    padding: 10px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: var(--cpg-text) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    -webkit-text-fill-color: currentColor !important;
  }

  body.cpg-mobile-editor-active .cpg-value-row {
    display: grid !important;
    grid-template-columns: 36px minmax(0, 1fr) 44px !important;
    gap: 8px !important;
    align-items: end !important;
  }

  body.cpg-mobile-editor-active .cpg-palette-mini {
    width: 36px !important;
    height: 44px !important;
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
  }

  body.cpg-mobile-editor-active .cpg-value-field {
    display: grid !important;
    gap: 4px !important;
    min-width: 0 !important;
  }

  body.cpg-mobile-editor-active .cpg-copy-btn {
    width: 44px !important;
    height: 44px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: var(--cpg-accent) !important;
    display: grid !important;
    place-items: center !important;
    cursor: pointer !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-actions {
    display: grid !important;
    gap: 8px !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-footer {
    flex: 0 0 auto !important;
    padding: 10px 12px 14px !important;
    background: #fff !important;
    border-top: 1px solid var(--cpg-border) !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-next-btn {
    width: 100% !important;
    min-height: 48px !important;
    border: 0 !important;
    border-radius: 14px !important;
    background: var(--cpg-accent) !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    -webkit-text-fill-color: #fff !important;
  }

  body.cpg-mobile-editor-active .cpg-mobile-next-btn[hidden] {
    display: none !important;
  }
}
