:root[data-theme="dark"] {
  scrollbar-color: #3f3f3f #101010;
}

:root[data-theme="dark"] .app-header,
:root[data-theme="dark"] .app-tabs-bar,
:root[data-theme="dark"] .app-tabs {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
}

:root[data-theme="dark"] .brand-mark {
  background: #f4f4f5;
  color: #080808;
  box-shadow: none;
}

:root[data-theme="dark"] .gen-section,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .sidebar-panel,
:root[data-theme="dark"] .prompt-panel,
:root[data-theme="dark"] .gen-modal-dialog,
:root[data-theme="dark"] .slide-image-config-panel,
:root[data-theme="dark"] .slide-image-queue-panel,
:root[data-theme="dark"] .promo-preview-section {
  background: var(--surface-panel);
  border-color: var(--line);
  box-shadow: none;
}

:root[data-theme="dark"] .gen-section-head,
:root[data-theme="dark"] .gen-modal-head,
:root[data-theme="dark"] .gen-modal-foot,
:root[data-theme="dark"] .promo-step-summary,
:root[data-theme="dark"] .promo-preview-topbar,
:root[data-theme="dark"] .promo-aux-summary {
  background: var(--surface-alt);
  border-color: var(--line);
}

:root[data-theme="dark"] .gen-content,
:root[data-theme="dark"] .promo-step-body,
:root[data-theme="dark"] .promo-aux-area,
:root[data-theme="dark"] .promo-aux-body {
  background: transparent;
}

:root[data-theme="dark"] .gen-config-group,
:root[data-theme="dark"] .gen-stat,
:root[data-theme="dark"] .gen-lint-panel,
:root[data-theme="dark"] .gen-slide-list,
:root[data-theme="dark"] .gen-config-note,
:root[data-theme="dark"] .gen-split-manage,
:root[data-theme="dark"] .gen-split-live,
:root[data-theme="dark"] .gen-filebox,
:root[data-theme="dark"] .option-group,
:root[data-theme="dark"] .page-type-card,
:root[data-theme="dark"] .template-chip,
:root[data-theme="dark"] .option-card,
:root[data-theme="dark"] .summary-card,
:root[data-theme="dark"] .promo-control-block,
:root[data-theme="dark"] .promo-template-card,
:root[data-theme="dark"] .promo-lint-shell,
:root[data-theme="dark"] .promo-validation-item,
:root[data-theme="dark"] .promo-data-item,
:root[data-theme="dark"] .promo-data-empty,
:root[data-theme="dark"] .promo-guidance-item,
:root[data-theme="dark"] .anti-ai-preset-panel,
:root[data-theme="dark"] .anti-ai-preset-btn,
:root[data-theme="dark"] .promo-size-preset-panel,
:root[data-theme="dark"] .promo-size-preset-apply-btn,
:root[data-theme="dark"] .slide-image-preview,
:root[data-theme="dark"] .slide-image-job,
:root[data-theme="dark"] .slide-image-status,
:root[data-theme="dark"] .slide-image-result-meta,
:root[data-theme="dark"] .slide-image-step,
:root[data-theme="dark"] .prompt-block-body {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .gen-textarea,
:root[data-theme="dark"] .gen-input-text,
:root[data-theme="dark"] .gen-select,
:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select {
  background-color: #0d0d0d;
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .gen-textarea::placeholder,
:root[data-theme="dark"] .gen-input-text::placeholder,
:root[data-theme="dark"] textarea::placeholder,
:root[data-theme="dark"] input::placeholder {
  color: #697892;
}

:root[data-theme="dark"] .promo-mode-toggle {
  background: #1e2028;
}

:root[data-theme="dark"] .promo-mode-toggle-btn.active {
  background: #2c2f3a;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .promo-stats-bar {
  background: var(--surface-1);
  border-color: rgba(255,255,255,0.07);
}

:root[data-theme="dark"] .promo-stat-chip {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}

:root[data-theme="dark"] .promo-stat-tokens.is-warn {
  color: #fbbf24;
  border-color: rgba(251,191,36,0.4);
  background: rgba(251,191,36,0.1);
}

:root[data-theme="dark"] .promo-stat-tokens.is-over {
  color: #f87171;
  border-color: rgba(248,113,113,0.4);
  background: rgba(248,113,113,0.1);
}

:root[data-theme="dark"] .promo-token-gauge {
  background: rgba(255,255,255,0.08);
}

:root[data-theme="dark"] .btn.secondary,
:root[data-theme="dark"] .gen-btn.secondary,
:root[data-theme="dark"] .theme-toggle,
:root[data-theme="dark"] .promo-type-tab,
:root[data-theme="dark"] .promo-segment-btn,
:root[data-theme="dark"] .btn-quick,
:root[data-theme="dark"] .promo-quick-action-btn,
:root[data-theme="dark"] .promo-reset-field-btn,
:root[data-theme="dark"] .promo-size-preset-save-btn {
  background: var(--surface-alt);
  border-color: var(--line-strong);
  color: var(--ink);
  box-shadow: none;
}

:root[data-theme="dark"] .btn.primary,
:root[data-theme="dark"] .gen-btn:not(.secondary):not(.ghost),
:root[data-theme="dark"] .save-btn,
:root[data-theme="dark"] .copy-btn,
:root[data-theme="dark"] .promo-quick-action-btn.is-primary,
:root[data-theme="dark"] .promo-ai-mode-btn.active {
  background: #f4f4f5;
  border-color: #f4f4f5;
  color: #080808;
  box-shadow: none;
  filter: none;
}

:root[data-theme="dark"] .btn.primary:hover,
:root[data-theme="dark"] .gen-btn:not(.secondary):not(.ghost):hover,
:root[data-theme="dark"] .save-btn:hover,
:root[data-theme="dark"] .copy-btn:hover,
:root[data-theme="dark"] .promo-quick-action-btn.is-primary:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #050505;
  box-shadow: none;
  filter: none;
}

:root[data-theme="dark"] .btn.ghost,
:root[data-theme="dark"] .gen-btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.11);
  color: var(--ink-soft);
}

:root[data-theme="dark"] .btn.secondary:hover,
:root[data-theme="dark"] .gen-btn.secondary:hover,
:root[data-theme="dark"] .btn.ghost:hover,
:root[data-theme="dark"] .gen-btn.ghost:hover,
:root[data-theme="dark"] .btn-quick:hover,
:root[data-theme="dark"] .promo-type-tab:hover,
:root[data-theme="dark"] .promo-segment-btn:hover {
  background: var(--surface-soft);
  border-color: #5a5a5a;
  color: #f1f1f1;
}

:root[data-theme="dark"] .gen-config-change-summary,
:root[data-theme="dark"] .gen-config-compact-field,
:root[data-theme="dark"] .gen-config-toggle-field,
:root[data-theme="dark"] .gen-config-inline-select,
:root[data-theme="dark"] .gen-config-override-item,
:root[data-theme="dark"] .gen-config-override-item textarea,
:root[data-theme="dark"] .gen-config-preview {
  background: var(--surface-soft);
  border-color: #5a5a5a;
  color: var(--ink);
}

:root[data-theme="dark"] .gen-config-change-summary.is-changed {
  background: rgba(59, 130, 246, 0.14);
  border-color: #3b82f6;
  color: #bfdbfe;
}

:root[data-theme="dark"] .app-tab-btn:hover {
  color: var(--ink);
}

:root[data-theme="dark"] .gen-badge,
:root[data-theme="dark"] .gen-config-chip,
:root[data-theme="dark"] .promo-inline-badge,
:root[data-theme="dark"] .gen-lint-metric,
:root[data-theme="dark"] .gen-lint-chip,
:root[data-theme="dark"] .promo-helper-chip,
:root[data-theme="dark"] .promo-helper-chip-inline {
  background: rgba(255, 255, 255, 0.08);
  color: #e8e8e8;
}

:root[data-theme="dark"] .btn-quick.active,
:root[data-theme="dark"] .option-card.active,
:root[data-theme="dark"] .page-type-card.active,
:root[data-theme="dark"] .template-chip.active,
:root[data-theme="dark"] .gen-slide-item.active,
:root[data-theme="dark"] .promo-template-card.active,
:root[data-theme="dark"] .promo-type-tab.active,
:root[data-theme="dark"] .promo-segment-btn.active {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: none;
}

:root[data-theme="dark"] .app-tab-btn.active {
  color: #ffffff;
}

:root[data-theme="dark"] .app-tab-btn::after {
  background: #ffffff;
}

:root[data-theme="dark"] .gen-textarea:focus,
:root[data-theme="dark"] .gen-input-text:focus,
:root[data-theme="dark"] .option-card:focus,
:root[data-theme="dark"] .page-type-card:focus,
:root[data-theme="dark"] .template-chip:focus {
  border-color: #6a6a6a;
  box-shadow: none;
}

:root[data-theme="dark"] .btn:focus-visible,
:root[data-theme="dark"] .gen-btn:focus-visible,
:root[data-theme="dark"] .theme-toggle:focus-visible,
:root[data-theme="dark"] .option-card:focus-visible,
:root[data-theme="dark"] .page-type-card:focus-visible,
:root[data-theme="dark"] .template-chip:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.34);
  outline-offset: 2px;
  box-shadow: none;
}

:root[data-theme="dark"] [style*="linear-gradient"],
:root[data-theme="dark"] .promo-advanced-disclosure-unused,
:root[data-theme="dark"] .promo-template-card.active,
:root[data-theme="dark"] .promo-lint-shell,
:root[data-theme="dark"] .prompt-group-card,
:root[data-theme="dark"] .process-status-card {
  background-image: none !important;
}

:root[data-theme="dark"] .panel-card,
:root[data-theme="dark"] .panel-intro-card,
:root[data-theme="dark"] .prompt-banner {
  background: var(--surface-panel) !important;
  background-image: none !important;
  border-color: var(--line);
  box-shadow: none;
}

:root[data-theme="dark"] .step-index,
:root[data-theme="dark"] .section-index {
  background: #f4f4f5 !important;
  background-image: none !important;
  color: #080808 !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .panel-badge.accent,
:root[data-theme="dark"] .option-card-icon,
:root[data-theme="dark"] .option-mode.multi,
:root[data-theme="dark"] .option-mode.single {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e8e8e8 !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .option-card.selected,
:root[data-theme="dark"] .option-card[aria-pressed="true"],
:root[data-theme="dark"] .page-type-card.selected,
:root[data-theme="dark"] .page-type-card[aria-pressed="true"] {
  border-color: rgba(255, 255, 255, 0.28) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .color-preview-box div[style*="box-shadow"] {
  box-shadow: none !important;
}

:root[data-theme="dark"] .preview-badge,
:root[data-theme="dark"] .lang-btn.active,
:root[data-theme="dark"] .prompt-block-head {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f1f1f1 !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .promo-lint-item,
:root[data-theme="dark"] .promo-lint-item.is-neutral,
:root[data-theme="dark"] .promo-lint-item.is-info,
:root[data-theme="dark"] .promo-lint-item.is-warning,
:root[data-theme="dark"] .promo-validation-item,
:root[data-theme="dark"] .promo-validation-item.is-ok,
:root[data-theme="dark"] .promo-validation-item.is-error,
:root[data-theme="dark"] .promo-validation-item.is-warning,
:root[data-theme="dark"] .gen-lint-item,
:root[data-theme="dark"] .gen-lint-item.ok,
:root[data-theme="dark"] .gen-lint-item.warning,
:root[data-theme="dark"] .gen-lint-item.error,
:root[data-theme="dark"] .gen-lint-diff-item,
:root[data-theme="dark"] .gen-lint-diff-empty,
:root[data-theme="dark"] .promo-data-item,
:root[data-theme="dark"] .promo-data-empty,
:root[data-theme="dark"] .promo-guidance-item {
  background: #202020 !important;
  border: 1px solid #303030 !important;
  color: #d6d6d6 !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .promo-lint-item.is-warning,
:root[data-theme="dark"] .promo-validation-item.is-warning,
:root[data-theme="dark"] .gen-lint-item.warning {
  border-color: #4a3a24 !important;
  color: #e3d0ad !important;
}

:root[data-theme="dark"] .promo-validation-item.is-error,
:root[data-theme="dark"] .gen-lint-item.error {
  border-color: #563030 !important;
  color: #e7b9b9 !important;
}

:root[data-theme="dark"] .promo-validation-item.is-ok,
:root[data-theme="dark"] .gen-lint-item.ok {
  border-color: #284634 !important;
  color: #bfe3c9 !important;
}

:root[data-theme="dark"] .promo-validation-detail {
  background: #181818 !important;
  border-color: #303030 !important;
  color: #d6d6d6 !important;
}

:root[data-theme="dark"] .promo-lint-chip.is-info,
:root[data-theme="dark"] .promo-lint-chip.is-neutral,
:root[data-theme="dark"] .gen-lint-chip.is-info,
:root[data-theme="dark"] .gen-lint-chip.is-neutral {
  background: #242424 !important;
  color: #e0e0e0 !important;
  border: 1px solid #343434 !important;
}

:root[data-theme="dark"] .gen-pre,
:root[data-theme="dark"] .promo-pre {
  background: #050505;
  color: #ededed;
}

:root[data-theme="dark"] .gen-modal-backdrop {
  background: var(--overlay-bg);
}

:root[data-theme="dark"] .promo-warning-modal-card {
  background: #171717 !important;
  border-color: #343434 !important;
  color: #e5e5e5 !important;
}

:root[data-theme="dark"] .promo-warning-modal-head {
  border-color: #303030 !important;
}

:root[data-theme="dark"] .promo-warning-modal-head strong,
:root[data-theme="dark"] .promo-warning-modal-body {
  color: #ededed !important;
}

:root[data-theme="dark"] .promo-warning-modal-close {
  background: #202020 !important;
  border-color: #343434 !important;
  color: #ededed !important;
}

:root[data-theme="dark"] .promo-quickfill-modal-card {
  background: #171717 !important;
  border-color: #343434 !important;
  color: #e5e5e5 !important;
}

:root[data-theme="dark"] .promo-quickfill-modal-head {
  border-color: #303030 !important;
}

:root[data-theme="dark"] .promo-quickfill-modal-head strong,
:root[data-theme="dark"] .promo-quickfill-guide,
:root[data-theme="dark"] .promo-quickfill-result {
  color: #ededed !important;
}

:root[data-theme="dark"] .promo-quickfill-close,
:root[data-theme="dark"] .promo-quickfill-modal-close {
  background: #202020 !important;
  border-color: #343434 !important;
  color: #ededed !important;
}

:root[data-theme="dark"] .promo-quickfill-textarea {
  background: #1f1f1f !important;
  border-color: #343434 !important;
  color: #ededed !important;
}

:root[data-theme="dark"] .promo-quickfill-preview-row {
  border-color: #343434 !important;
}

:root[data-theme="dark"] .promo-quickfill-compress-row {
  color: #ededed !important;
}

:root[data-theme="dark"] .promo-quickfill-preview-field {
  color: #ededed !important;
}

:root[data-theme="dark"] .promo-quickfill-preview-value {
  color: #b3b3b3 !important;
}

:root[data-theme="dark"] .promo-color-picker {
  background: var(--surface-alt);
  border-color: var(--line);
}

:root[data-theme="dark"] .promo-color-swatch {
  border-color: var(--line-strong);
}

:root[data-theme="dark"] .promo-field-disabled,
:root[data-theme="dark"] .promo-manual-color-area.is-disabled .gen-config-group,
:root[data-theme="dark"] .promo-color-row.is-disabled,
:root[data-theme="dark"] #promotionBackgroundSection.is-disabled {
  opacity: 0.55;
}

:root[data-theme="dark"] .slide-image-preview img {
  background: #fff;
}

:root[data-theme="dark"] option,
:root[data-theme="dark"] optgroup {
  background: #0d0d0d;
  color: var(--ink);
}

:root[data-theme="dark"] .gen-split-live-head,
:root[data-theme="dark"] .gen-split-preview-item,
:root[data-theme="dark"] .gen-split-preview-more {
  background: var(--surface-alt);
  border-color: var(--line);
}

:root[data-theme="dark"] .gen-split-preview-item span {
  background: #151f33;
  color: #9bbcff;
}

/* Concept suggestion dark-mode polish */
:root[data-theme="dark"] .concept-suggest-wrap {
  background: #080808;
}

:root[data-theme="dark"] .concept-filter-bar {
  background: #171d28;
  border-bottom-color: #303746;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .concept-filter-btn {
  background: #10151f;
  border-color: #3a4658;
  color: #d7dfec;
}

:root[data-theme="dark"] .concept-filter-btn:hover {
  background: #1b2432;
  border-color: #6b7b96;
  color: #ffffff;
}

:root[data-theme="dark"] .concept-filter-btn.active {
  background: #f4f4f5;
  border-color: #f4f4f5;
  color: #090909;
}

:root[data-theme="dark"] .concept-card {
  background: #111418;
  border-color: #303a4a;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .concept-card:hover {
  border-color: #6f819d;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] .concept-card-header {
  background: #1d2634 !important;
  background-image: linear-gradient(135deg, #2b3648 0%, #151c29 100%) !important;
  border-bottom: 1px solid #303a4a;
}

:root[data-theme="dark"] .concept-card-name-en {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

:root[data-theme="dark"] .concept-card-name-ko {
  color: #d9e2f0 !important;
  opacity: 1;
}

:root[data-theme="dark"] .concept-card-cat-badge {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #eef3fb !important;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

:root[data-theme="dark"] .concept-card-desc {
  color: #b9c7da;
}

:root[data-theme="dark"] .concept-palette-dot {
  border-color: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .concept-tag {
  background: #1e2938;
  border-color: #344255;
  color: #d3ddea;
}

:root[data-theme="dark"] .concept-prompt-text {
  background: #080b10;
  border-color: #344255;
  color: #edf4ff;
}

:root[data-theme="dark"] .concept-copy-btn {
  background: #151b25;
  border-color: #3a4658;
  color: #dce6f4;
}

:root[data-theme="dark"] .concept-copy-btn:hover {
  background: #202a39;
  border-color: #7688a3;
  color: #ffffff;
}

:root[data-theme="dark"] .concept-copy-btn.copied {
  background: rgba(100, 210, 143, 0.16);
  border-color: rgba(100, 210, 143, 0.44);
  color: #9ff0bc;
}

:root[data-theme="dark"] .concept-apply-btn {
  background: #e9edf3;
  border-color: #e9edf3;
  color: #0b0f16;
}

:root[data-theme="dark"] .concept-apply-btn:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #050505;
  opacity: 1;
}

:root[data-theme="dark"] .concept-mixer-btn {
  background: #151b25;
  border-color: #3a4658;
  color: #dce6f4;
}

:root[data-theme="dark"] .concept-mixer-btn:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: #38bdf8;
  color: #38bdf8;
}

:root[data-theme="dark"] .form-image-panel {
  background: var(--surface-panel);
  border-color: var(--line);
  box-shadow: none;
}

:root[data-theme="dark"] .form-image-step-card {
  background: var(--surface-alt);
}

:root[data-theme="dark"] .form-image-step-card.active {
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: none;
}

:root[data-theme="dark"] .form-image-step-card.done {
  border-color: rgba(52, 211, 153, 0.3);
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.07), var(--surface-alt) 34%);
}

:root[data-theme="dark"] .form-image-step-head b {
  color: #0b0f16;
}

:root[data-theme="dark"] .form-image-segment button.active,
:root[data-theme="dark"] .form-image-result-tabs button.active,
:root[data-theme="dark"] .form-image-strength-row button.active {
  background: #e9edf3;
  border-color: #e9edf3;
  color: #0b0f16;
  box-shadow: none;
}

:root[data-theme="dark"] .form-image-target-grid button.active,
:root[data-theme="dark"] .form-image-map-items button.active,
:root[data-theme="dark"] .form-image-set-overview button.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.55);
  color: #ffffff;
}

:root[data-theme="dark"] .form-image-map-items button {
  background: var(--surface-soft);
}

:root[data-theme="dark"] .form-image-result-hero {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    var(--surface-alt);
}

:root[data-theme="dark"] .form-image-type-card {
  background: rgba(255, 255, 255, 0.03);
}

:root[data-theme="dark"] .form-image-type-card.active {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .form-image-signboard {
  background: rgba(255, 255, 255, 0.03);
}

:root[data-theme="dark"] .form-image-purpose-card {
  background: var(--surface-alt);
  border-color: rgba(255, 255, 255, 0.16);
}

:root[data-theme="dark"] .form-image-tone-chips button:hover,
:root[data-theme="dark"] .form-image-tone-chips button.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

:root[data-theme="dark"] .form-image-mixer-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
}

:root[data-theme="dark"] .form-image-palette span {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}

:root[data-theme="dark"] .form-image-status.is-ok {
  color: #34d399;
}

:root[data-theme="dark"] .form-image-status.is-error {
  color: #f87171;
}
