/*
Theme Name: AI Chỉnh Ảnh Studio Pro (aichinhanh.com - 100% Client-Side Edition)
Theme URI: https://aichinhanh.com
Author: AI Chỉnh Ảnh Team
Author URI: https://aichinhanh.com
Description: Theme WordPress AI Chỉnh Ảnh (aichinhanh.com) thế hệ mới — Xử lý 100% trực tiếp trên trình duyệt (Client-Side WebGPU / WebAssembly / HTML5 Canvas) không cần API ngoài. Tối ưu Top 1 bộ từ khóa keychinhanh.csv: Chỉnh ảnh AI (key chính), AI chỉnh ảnh, AI chỉnh sửa ảnh theo yêu cầu, Xóa vật thể (Inpainting), Tách nền & Đổi màu nền, Làm nét ảnh 4K, Phục chế ảnh cũ, Tạo ảnh thẻ ID, Photo Booth Hàn Quốc, Kiểm tra ảnh AI (ELA), Nén & Đổi đuôi ảnh.
Version: 3.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GPL v2 or later
Text Domain: aichinhanh
Tags: chinh-anh-ai, ai-chinh-anh, ai-photo-editor, background-remover, object-remover, tool-theme, dark-mode, full-width-template, seo-optimized
*/

:root {
  --bg-primary: #090d16;
  --bg-secondary: #111827;
  --bg-surface: rgba(17, 24, 39, 0.78);
  --bg-card: rgba(30, 41, 59, 0.55);
  --bg-card-hover: rgba(30, 41, 59, 0.88);
  --bg-glass: rgba(15, 23, 42, 0.75);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(148, 163, 184, 0.16);
  --border-hover: rgba(99, 102, 241, 0.55);
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --gradient-brand: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.22), transparent 65%);
  --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.35);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Chivo Mono', monospace;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-surface: rgba(255, 255, 255, 0.88);
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: rgba(15, 23, 42, 0.1);
  --border-hover: rgba(79, 70, 229, 0.5);
  --shadow-lg: 0 20px 45px -15px rgba(15, 23, 42, 0.12);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-primary);
  background-image: var(--gradient-glow);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

img, video, canvas, svg {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.se-article-prose a {
  color: var(--accent-cyan);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.se-article-prose a:hover {
  color: var(--accent-emerald);
}

.se-article-prose h2 {
  color: var(--text-primary);
  font-size: 1.32rem;
  font-weight: 800;
  margin: 1.65rem 0 0.75rem;
}

.se-article-prose p,
.se-article-prose ul,
.se-article-prose ol {
  margin-bottom: 1rem;
}

.se-article-prose ul,
.se-article-prose ol {
  padding-left: 1.35rem;
}

.se-article-prose li {
  margin-bottom: 0.45rem;
}

button, input, select, textarea {
  font-family: inherit;
}

.se-container {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ==========================================================================
   HEADER & MEGA NAVIGATION (Sleek Single-Line Capsule Glass Bar)
   ========================================================================== */
.se-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 68px;
  background: rgba(9, 13, 22, 0.84);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
}

[data-theme="light"] .se-header {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.se-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.se-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.se-logo-brand {
  white-space: nowrap;
}

.se-logo-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gradient-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.se-logo-tag {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.se-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.28rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.14);
  flex-shrink: 0;
}

[data-theme="light"] .se-nav {
  background: rgba(241, 245, 249, 0.85);
}

.se-nav-item {
  position: relative;
  flex-shrink: 0;
}

.se-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.se-nav-icon {
  font-size: 0.92rem;
  line-height: 1;
}

.se-nav-caret {
  opacity: 0.6;
  transition: transform 0.2s ease, opacity 0.2s ease;
  flex-shrink: 0;
}

.se-nav-link:hover, .se-nav-item:hover .se-nav-link {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.24), rgba(139, 92, 246, 0.18));
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35);
}

[data-theme="light"] .se-nav-link:hover, [data-theme="light"] .se-nav-item:hover .se-nav-link {
  color: var(--accent-primary);
}

.se-nav-item:hover .se-nav-caret {
  transform: rotate(180deg);
  opacity: 1;
}

.se-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 310px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 16px;
  padding: 0.6rem;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.7), 0 0 25px rgba(99, 102, 241, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1100;
}

[data-theme="light"] .se-dropdown {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.18);
}

.se-dropdown::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.se-nav-item:hover .se-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.se-dropdown-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #38bdf8;
  padding: 0.35rem 0.65rem 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  margin-bottom: 0.35rem;
}

.se-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.16s ease;
}

.se-dropdown-item:hover, .se-dropdown-item.is-active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.32);
  transform: translateX(2px);
}

.se-dropdown-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.se-dropdown-body {
  min-width: 0;
  flex: 1;
}

.se-dropdown-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.se-dropdown-desc {
  font-size: 0.73rem;
  color: var(--text-secondary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.se-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.se-cmd-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  height: 36px;
  padding: 0 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.se-cmd-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.14);
}

.se-kbd {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.16);
  color: var(--text-primary);
}

.se-icon-btn {
  height: 36px;
  min-width: 36px;
  padding: 0 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.se-icon-btn:hover {
  border-color: var(--border-hover);
  background: rgba(99, 102, 241, 0.15);
}

.se-lang-dropdown {
  right: 0;
  left: auto;
  min-width: 280px;
  max-height: 400px;
  overflow-y: auto;
}

.se-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0.52rem 1rem;
  border-radius: 999px;
  background: var(--gradient-brand);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.84rem;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.38);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.se-header-cta {
  height: 36px;
  padding: 0 0.95rem;
}

/* Sample Thumbnails Strip */
.se-sample-thumb {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

/* Bento Card & Knowledge Base Card Visual Preview Banner */
.se-tool-preview-wrap,
.se-tool-card-thumb {
  width: 100%;
  height: 165px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: #0b0f19;
  position: relative;
  display: block;
}

.se-tool-preview-img,
.se-tool-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.se-tool-card:hover .se-tool-preview-img,
.se-tool-card:hover .se-tool-card-thumb img {
  transform: scale(1.04);
}

.se-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(99, 102, 241, 0.5);
}

.se-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.58rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.se-btn-outline:hover {
  border-color: var(--border-hover);
  background: rgba(99, 102, 241, 0.12);
}

/* ==========================================================================
   HERO SECTION & INTERACTIVE DROPZONE + BEFORE/AFTER SLIDER
   ========================================================================== */
.se-hero {
  padding: 3.5rem 0 2.5rem;
  position: relative;
}

.se-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.se-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
}

[data-theme="light"] .se-pill-badge {
  color: #4f46e5;
}

.se-hero-title {
  font-size: clamp(2.1rem, 4vw, 3.35rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.se-gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.se-hero-subtitle {
  font-size: 1.08rem;
  color: var(--text-secondary);
  margin-bottom: 1.65rem;
  max-width: 600px;
}

/* Interactive Upload Dropzone */
.se-dropzone {
  background: var(--bg-card);
  border: 2px dashed rgba(99, 102, 241, 0.45);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
}

.se-dropzone:hover, .se-dropzone.drag-over {
  border-color: var(--accent-cyan);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: var(--shadow-glow);
}

.se-dropzone-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.se-sample-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.se-sample-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.se-sample-btn:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.15);
}

/* Before / After Interactive Comparison Card */
.se-ba-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  background: var(--bg-secondary);
  user-select: none;
}

.se-ba-canvas-wrap {
  position: relative;
  width: 100%;
  height: 390px;
  overflow: hidden;
}

.se-ba-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.se-ba-label {
  position: absolute;
  top: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  backdrop-filter: blur(8px);
  z-index: 5;
}

.se-ba-label.before { left: 14px; }
.se-ba-label.after { right: 14px; background: rgba(79, 70, 229, 0.85); }

.se-ba-modes {
  display: flex;
  gap: 0.4rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  overflow-x: auto;
}

.se-ba-mode-btn {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.se-ba-mode-btn.active, .se-ba-mode-btn:hover {
  background: var(--gradient-brand);
  color: #fff;
  border-color: transparent;
}

/* ==========================================================================
   UNIFIED AI STUDIO WORKSPACE (100% CLIENT-SIDE ENGINE)
   ========================================================================== */
.se-studio-section {
  padding: 1.5rem 0 3rem;
}

.se-studio-shell {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.se-studio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: rgba(15, 23, 42, 0.65);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.se-studio-status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.se-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
}

.se-studio-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.se-studio-body {
  display: grid;
  grid-template-columns: 250px 1fr 310px;
  min-height: 620px;
}

/* Left Tool Rail */
.se-studio-rail {
  border-right: 1px solid var(--border-color);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
  max-height: 680px;
}

.se-rail-group-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 800;
  padding: 0.6rem 0.65rem 0.25rem;
}

.se-rail-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.62rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}

.se-rail-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
}

.se-rail-btn.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.45);
  color: var(--text-primary);
}

.se-rail-btn-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.se-rail-btn.active .se-rail-btn-icon {
  background: var(--gradient-brand);
  color: #fff;
}

/* Center Interactive Canvas Viewport */
.se-studio-viewport {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #0b0f19;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.04) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  padding: 1.25rem;
  overflow: hidden;
}

.se-canvas-stage {
  position: relative;
  display: inline-block;
  line-height: 0;
  max-width: 100%;
  max-height: 520px;
  border-radius: var(--radius-md);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

#seMainCanvas {
  max-width: 100%;
  max-height: 500px;
  width: auto;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
}

#seMaskCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.se-brush-cursor-ring {
  position: absolute;
  pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: rgba(244, 63, 94, 0.28);
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.85), 0 2px 8px rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  transition: width 0.08s ease, height 0.08s ease;
}

.se-canvas-floating-bar {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  z-index: 20;
}

/* Right Inspector Panel */
.se-studio-inspector {
  border-left: 1px solid var(--border-color);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  overflow-y: auto;
  max-height: 680px;
}

.se-inspector-title {
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.se-inspector-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.se-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.se-control-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.se-range {
  width: 100%;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.se-input, .se-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.86rem;
}

/* Color Swatches for Background Remover */
.se-swatch-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.45rem;
}

.se-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.se-swatch:hover, .se-swatch.active {
  transform: scale(1.1);
  border-color: var(--accent-primary);
}

.se-swatch.transparent {
  background-image:
    linear-gradient(45deg, #ccc 25%, transparent 25%),
    linear-gradient(-45deg, #ccc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ccc 75%),
    linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 10px 10px;
  background-color: #fff;
}

/* ==========================================================================
   BENTO GRID TOOL DIRECTORY & CATEGORY FILTERS
   ========================================================================== */
.se-section {
  padding: 3.5rem 0;
}

.se-section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2.25rem;
}

.se-section-title {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.65rem;
}

.se-filter-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.se-filter-tab {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.se-filter-tab.active, .se-filter-tab:hover {
  background: var(--gradient-brand);
  color: #fff;
  border-color: transparent;
}

.se-bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}

.se-tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}

.se-tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-lg);
}

.se-tool-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.se-tool-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.se-tool-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.se-tool-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.se-tool-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.se-tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* ==========================================================================
   COMMAND PALETTE (CTRL + K) MODAL
   ========================================================================== */
.se-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.78);
  backdrop-filter: blur(8px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  z-index: 2000;
}

.se-modal-backdrop.open {
  display: flex;
}

.se-cmd-modal {
  width: 92%;
  max-width: 600px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.se-cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.se-cmd-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
}

.se-cmd-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 0.5rem;
}

.se-cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.se-cmd-item:hover {
  background: rgba(99, 102, 241, 0.15);
}

/* ==========================================================================
   FAQ & SEO CONTENT BLOCKS
   ========================================================================== */
.se-faq-grid {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.se-faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
}

.se-faq-item summary {
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.se-faq-item p {
  margin-top: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.se-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0 2rem;
  margin-top: 3rem;
}

.se-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.se-footer-col h3,
.se-footer-col h4 {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 0.9rem;
  color: var(--text-primary);
}

.se-footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.se-footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.se-footer-links a:hover {
  color: var(--accent-primary);
}

.se-footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Toast Notification */
.se-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.se-toast {
  background: var(--bg-secondary);
  border: 1px solid var(--accent-primary);
  color: var(--text-primary);
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.86rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: seSlideIn 0.25s ease;
}

@keyframes seSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   GLOBAL RESPONSIVE ARCHITECTURE & ZERO-OVERFLOW GUARD (v2.9.9)
   Covers Desktop (1440px+), Laptop (1141–1340px), Tablet (641–1140px),
   Mobile (381–640px), and Small Mobile (320–380px)
   ========================================================================== */

/* WordPress Admin Bar Sticky Header Offset */
body.admin-bar .se-header {
  top: 32px;
}

@media (max-width: 782px) {
  body.admin-bar .se-header {
    top: 46px;
  }
}

@media (max-width: 600px) {
  body.admin-bar .se-header {
    top: 0;
  }
}

/* Enforce min-width: 0 on all flex & grid containers/children to prevent horizontal blowout */
.se-container,
.se-header-inner,
.se-hero-grid > *,
.se-bento-grid > *,
.se-studio-shell,
.se-studio-body > *,
.se-tool-card,
.se-tool-card > *,
.se-article-prose,
.se-footer-grid > * {
  min-width: 0;
  max-width: 100%;
}

/* Click-to-open state for Language Dropdown on Touch / Mobile / Tablet */
.se-lang-wrap.is-open > .se-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Mobile & Tablet Hamburger Menu Button (Hidden on Large Desktops > 1140px) */
.se-mobile-menu-btn {
  display: none;
}

/* Mobile & Tablet Slide-Down Navigation Drawer */
.se-mobile-nav-drawer {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  max-height: calc(100vh - 68px);
  overflow-y: auto;
  background: rgba(11, 16, 28, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.72);
  z-index: 1100;
  padding: 1rem 0 1.35rem;
}

[data-theme="light"] .se-mobile-nav-drawer {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
}

.se-mobile-nav-drawer.is-open {
  display: block;
}

.se-mobile-nav-top {
  display: none;
  margin-bottom: 0.9rem;
}

.se-mobile-studio-cta {
  width: 100%;
  justify-content: center;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
}

.se-mobile-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.se-mobile-cat-block {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}

[data-theme="light"] .se-mobile-cat-block {
  background: rgba(241, 245, 249, 0.8);
}

.se-mobile-cat-title {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-color);
}

.se-mobile-tool-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.se-mobile-tool-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.5rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: background 0.15s ease;
}

.se-mobile-tool-link:hover {
  background: rgba(99, 102, 241, 0.18);
}

/* Responsive Scrollable Tables inside Cards & Articles */
.se-tool-card table,
.se-article-prose table,
main table {
  width: 100%;
  max-width: 100%;
}

/* 1. COMPACT LAPTOP BREAKPOINT (1141px – 1340px, e.g. 1280px & 1366px Laptops) */
@media (max-width: 1340px) {
  .se-logo-tag {
    display: none;
  }
  .se-nav-link {
    padding: 0.36rem 0.52rem;
    font-size: 0.76rem;
    gap: 0.25rem;
  }
  .se-cmd-label,
  .se-kbd {
    display: none;
  }
  .se-cmd-btn {
    padding: 0;
    width: 36px;
    justify-content: center;
  }
  .se-header-cta {
    padding: 0 0.78rem;
    font-size: 0.78rem;
  }
}

/* 2. TABLET LANDSCAPE & SMALL LAPTOP BREAKPOINT (<= 1140px, e.g. iPad Pro 1024px) */
@media (max-width: 1140px) {
  .se-nav {
    display: none;
  }
  .se-mobile-menu-btn {
    display: inline-flex;
  }
  .se-hero-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 1.5rem;
  }
  .se-studio-body {
    grid-template-columns: minmax(0, 1fr) 290px;
  }
  .se-studio-rail {
    grid-column: 1 / -1;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 0.55rem 0.75rem;
    gap: 0.4rem;
  }
  .se-rail-group-label {
    display: none;
  }
  .se-rail-btn {
    width: auto;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.45rem 0.75rem;
  }
  .se-bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .se-footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 3. TABLET PORTRAIT BREAKPOINT (<= 900px, e.g. iPad Mini / Air 768px & 820px) */
@media (max-width: 900px) {
  .se-hero {
    padding: 2rem 0 1.5rem;
  }
  .se-hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
  .se-studio-topbar {
    height: auto;
    min-height: 54px;
    padding: 0.6rem 0.85rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .se-studio-topbar > div {
    flex-wrap: wrap;
  }
  .se-studio-body {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .se-studio-viewport {
    min-height: 360px;
    padding: 0.85rem;
  }
  .se-studio-inspector {
    border-left: none;
    border-top: 1px solid var(--border-color);
    max-height: none;
  }
  .se-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .se-tool-card table,
  .se-article-prose table,
  main table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* 4. MOBILE PHONES BREAKPOINT (<= 640px, e.g. 430px, 412px, 400px, 390px, 375px, 360px) */
@media (max-width: 640px) {
  .se-container {
    padding: 0 0.85rem;
  }
  .se-header {
    height: 60px;
  }
  .se-header-inner {
    gap: 0.4rem;
  }
  .se-brand-svg {
    width: 112px;
    height: 28px;
  }
  .se-header-actions {
    gap: 0.35rem;
  }
  .se-header-cta {
    display: none;
  }
  .se-mobile-nav-top {
    display: block;
  }
  .se-cmd-btn,
  .se-icon-btn,
  .se-mobile-menu-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
  }
  .se-lang-btn {
    width: auto;
    height: 34px;
    padding: 0 0.48rem;
    font-size: 0.74rem;
    gap: 0.22rem;
  }
  .se-lang-dropdown {
    position: fixed;
    top: 64px;
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    min-width: 0;
    max-width: calc(100vw - 1.5rem);
    max-height: 70vh;
  }
  .se-mobile-cat-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .se-hero {
    padding: 1.35rem 0 1.15rem;
  }
  .se-pill-badge {
    font-size: 0.72rem;
    padding: 0.28rem 0.65rem;
    max-width: 100%;
    white-space: normal;
    line-height: 1.35;
  }
  .se-hero-title {
    font-size: clamp(1.5rem, 6.4vw, 2rem) !important;
    line-height: 1.22;
    word-break: break-word;
  }
  .se-hero-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.15rem;
  }
  .se-dropzone {
    padding: 1.05rem 0.85rem;
  }
  .se-dropzone-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.55rem;
  }
  .se-dropzone-actions > * {
    width: 100%;
    justify-content: center;
  }
  .se-ba-canvas-wrap {
    height: 235px;
  }
  .se-ba-modes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .se-section {
    padding: 2.25rem 0;
  }
  .se-bento-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1rem;
  }
  /* Override large inline paddings & multi-column inline grids on mobile */
  .se-tool-card,
  article.se-tool-card {
    padding: 1.15rem !important;
  }
  main [style*="grid-template-columns"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .se-crop-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .se-swatch-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }
  .se-canvas-floating-bar {
    bottom: 8px;
    width: calc(100% - 1rem);
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 14px;
    padding: 0.45rem 0.65rem;
    gap: 0.4rem;
  }
  .se-studio-viewport {
    min-height: 300px;
    padding: 0.65rem 0.65rem 3.5rem;
  }
  .se-footer {
    padding: 2.5rem 0 1.5rem;
  }
  .se-footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
  .se-toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
}

/* 5. EXTRA SMALL MOBILE BREAKPOINT (<= 380px, e.g. 320px iPhone SE & 360px Galaxy) */
@media (max-width: 380px) {
  .se-container {
    padding: 0 0.65rem;
  }
  .se-brand-svg {
    width: 98px;
    height: 25px;
  }
  .se-header-actions {
    gap: 0.25rem;
  }
  .se-cmd-btn,
  .se-icon-btn,
  .se-mobile-menu-btn {
    width: 31px;
    height: 31px;
  }
  .se-lang-btn {
    height: 31px;
    padding: 0 0.38rem;
    font-size: 0.7rem;
  }
}
