/* ==========================================================================
   PixelShield — Main Stylesheet
   Modern, sophisticated, minimalist SaaS interface
   ========================================================================== */

@import './variables.css';

/* CSS Reset & Global Baseline */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Typography Hierarchy & Advanced Font Rendering */
body, input, button, select, textarea {
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  letter-spacing: -0.025em;
}

p {
  color: var(--text-secondary);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--accent-primary-hover);
}

/* ==========================================================================
   PIXELSHIELD DESKTOP STUDIO SHELL (PixorAI Architecture)
   Collapsible Left Sidebar + Top Command Bar + Viewport Layout
   ========================================================================== */

/* Locked App Viewport on Desktop (zero gaps, full height pinned sidebar) */
@media (min-width: 901px) {
  html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  .studio-shell {
    display: flex;
    height: 100vh;
    max-height: 100vh;
    width: 100%;
    background: var(--stage-bg);
    color: var(--text-primary);
    overflow: hidden;
    position: relative;
  }

  .studio-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0.85rem;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    flex-shrink: 0;
    transition: width 240ms cubic-bezier(0.16, 1, 0.3, 1), min-width 240ms cubic-bezier(0.16, 1, 0.3, 1), padding 240ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sm);
  }

  .studio-main-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--stage-bg);
    position: relative;
  }

  .studio-topbar {
    position: sticky;
    top: 0;
    z-index: 90;
  }
}

/* Fallback base styles for shell & sidebar */
.studio-shell {
  display: flex;
  height: 100vh;
  max-height: 100vh;
  width: 100%;
  background: var(--stage-bg);
  color: var(--text-primary);
  overflow: hidden;
  position: relative;
}

/* 1. Left Sidebar */
.studio-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.85rem;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  flex-shrink: 0;
  transition: width 240ms cubic-bezier(0.16, 1, 0.3, 1), min-width 240ms cubic-bezier(0.16, 1, 0.3, 1), padding 240ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.15rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  min-width: 0;
}

.brand-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #329A78 0%, #1E664F 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 8px rgba(42, 127, 98, 0.35);
}

.brand-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.brand-title {
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.sidebar-footer {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
  width: 100%;
  display: flex;
  align-items: center;
}

.sidebar-collapse-btn {
  width: 100%;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 0.75rem;
  gap: 0.6rem;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 550;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-collapse-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.sidebar-collapse-btn .collapse-icon {
  flex-shrink: 0;
  transition: transform 200ms ease;
}

.sidebar-collapse-btn .collapse-btn-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding: 0 0.35rem;
  user-select: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.sidebar-nav .nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.58rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.nav-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 160ms ease;
}

.nav-btn-text {
  flex: 1;
  white-space: nowrap;
  letter-spacing: -0.01em;
  font-size: 0.86rem;
  line-height: 1.25;
}

.nav-badge-pill {
  display: none;
}

.nav-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  transition: all 160ms ease;
  flex-shrink: 0;
  margin-left: auto;
}

.sidebar-nav .nav-tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  transform: translateX(2px);
}

.sidebar-nav .nav-tab-btn:hover .nav-btn-icon,
.sidebar-nav .nav-tab-btn:hover .nav-btn-text {
  color: var(--text-primary);
}

.sidebar-nav .nav-tab-btn.active {
  background: var(--accent-primary-subtle);
  color: var(--accent-primary);
  border-color: var(--accent-primary-border);
  font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.sidebar-nav .nav-tab-btn.active .nav-btn-icon {
  color: var(--accent-primary);
}

.sidebar-nav .nav-tab-btn.active .nav-btn-text {
  color: var(--accent-primary);
  font-weight: 650;
}

.sidebar-nav .nav-tab-btn.active .nav-active-dot {
  background: var(--accent-primary);
  box-shadow: 0 0 6px var(--accent-primary);
}

/* Quick Test Presets (PixorAI Mockup Feature) */
.sidebar-presets-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.75rem 0.85rem;
  margin-top: auto;
  margin-bottom: 0.85rem;
  transition: all 160ms ease;
}

.presets-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.5rem;
}

.presets-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.presets-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.presets-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.preset-chip-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.4rem 0.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.preset-chip-btn:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xs);
}

.preset-avatar {
  font-size: 1.15rem;
}

.preset-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Zero-Server Privacy Engine Card */
.sidebar-privacy-card {
  background: var(--bg-card-secondary);
  border: 1px solid var(--accent-primary-border);
  border-radius: var(--radius-lg);
  padding: 0.8rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.privacy-engine-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.privacy-engine-icon-wrap {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  background: var(--accent-primary-subtle);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.privacy-engine-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
}

.privacy-engine-name {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-primary);
}

.privacy-engine-status {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--accent-primary-subtle);
  padding: 0.08rem 0.35rem;
  border-radius: var(--radius-full);
}

.privacy-engine-text {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Collapsed Sidebar State */
.studio-shell.sidebar-collapsed .studio-sidebar {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
  max-width: var(--sidebar-collapsed-width);
  padding: 1.25rem 0.5rem;
  align-items: center;
}

.studio-shell.sidebar-collapsed .sidebar-top {
  justify-content: center;
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  width: 100%;
}

.studio-shell.sidebar-collapsed .brand-wrapper {
  justify-content: center;
  width: 100%;
}

.studio-shell.sidebar-collapsed .brand-info,
.studio-shell.sidebar-collapsed .sidebar-section-title,
.studio-shell.sidebar-collapsed .nav-btn-text,
.studio-shell.sidebar-collapsed .nav-badge-pill,
.studio-shell.sidebar-collapsed .nav-active-dot,
.studio-shell.sidebar-collapsed .sidebar-presets-card,
.studio-shell.sidebar-collapsed .privacy-engine-meta,
.studio-shell.sidebar-collapsed .privacy-engine-text {
  display: none !important;
}

.studio-shell.sidebar-collapsed .sidebar-nav .nav-tab-btn {
  justify-content: center;
  padding: 0.65rem;
}

.studio-shell.sidebar-collapsed .sidebar-privacy-card {
  padding: 0.45rem;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  margin-top: auto;
  margin-bottom: 0;
}

.studio-shell.sidebar-collapsed .privacy-engine-header {
  justify-content: center;
  width: 100%;
}

.studio-shell.sidebar-collapsed .sidebar-footer {
  justify-content: center;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  width: 100%;
}

.studio-shell.sidebar-collapsed .sidebar-collapse-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: var(--radius-md);
}

.studio-shell.sidebar-collapsed .sidebar-collapse-btn .collapse-btn-text {
  display: none !important;
}

.studio-shell.sidebar-collapsed .sidebar-collapse-btn .collapse-icon {
  transform: rotate(180deg);
}

/* 2. Studio Main Column & Topbar */
.studio-main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--stage-bg);
  position: relative;
}

.studio-topbar {
  min-height: var(--topbar-height);
  height: auto;
  padding: 0.9rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-xs);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  max-width: 380px;
}

.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 160ms ease;
}

.mobile-menu-btn svg,
.sidebar-close-btn svg,
.sidebar-collapse-btn svg,
.topbar-btn svg {
  pointer-events: none;
}

.mobile-menu-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.sidebar-close-btn {
  display: none;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 160ms ease;
}

.sidebar-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.topbar-search-wrap {
  flex: 1;
  max-width: 360px;
}

.topbar-search-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.38rem 0.95rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.topbar-search-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.search-placeholder {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.topbar-center {
  display: flex;
  align-items: center;
}

.studio-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.crumb-app {
  color: var(--text-secondary);
  font-weight: 500;
}

.crumb-sep {
  color: var(--border-strong);
  font-size: 0.75rem;
}

.crumb-tool {
  color: var(--text-primary);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.topbar-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

/* 3. Studio Viewport & Canvas Stage */
.studio-viewport {
  flex: 1;
  padding: 1.5rem 1.75rem 3rem;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.studio-stage-wrap {
  scroll-margin-top: calc(var(--topbar-height) + 1.25rem);
  margin-bottom: 2rem;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  position: relative;
}

.workspace-grid,
.editor-workspace,
.cards-grid,
.batch-actions-bar {
  scroll-margin-top: calc(var(--topbar-height) + 1.25rem);
}

.studio-stage-inner {
  position: relative;
  width: 100%;
}

.stage-split-canvas {
  position: relative;
  width: 100%;
  height: 520px;
  max-height: calc(100vh - 270px);
  min-height: 380px;
  overflow: hidden;
  user-select: none;
  background: #0B1113;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
}

.stage-pill-tag {
  position: absolute;
  top: 1rem;
  z-index: 25;
  padding: 0.32rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  background: rgba(15, 23, 25, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.stage-pill-tag.tag-before {
  left: 1rem;
}

.stage-pill-tag.tag-after {
  right: 1rem;
}

.stage-img-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.stage-img-layer img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

.stage-layer-before {
  clip-path: polygon(0 0, var(--split-pos, 50%) 0, var(--split-pos, 50%) 100%, 0 100%);
  will-change: clip-path;
  z-index: 10;
}

.stage-layer-after {
  z-index: 5;
}

.stage-divider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split-pos, 50%);
  width: 2px;
  background: #FFFFFF;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 15;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

.stage-handle-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2.5px solid var(--accent-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  gap: 1px;
  cursor: grab;
  pointer-events: auto;
  transition: transform 140ms ease;
}

.stage-handle-knob:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.1);
}

/* 4. Floating Export Dock (PixorAI Mockup Feature) */
.studio-export-dock {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2.5rem);
  max-width: 640px;
  background: var(--dock-glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--dock-glass-border);
  border-radius: var(--radius-xl);
  padding: 0.95rem 1.25rem;
  box-shadow: var(--dock-glass-shadow);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: all 200ms ease;
}

.dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.45rem;
}

.dock-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.dock-active-filename {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dock-segment-group {
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px;
  gap: 2px;
}

.dock-pill-btn {
  padding: 0.24rem 0.75rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 140ms ease;
}

.dock-pill-btn:hover {
  color: var(--text-primary);
}

.dock-pill-btn.active {
  background: var(--bg-card);
  color: var(--accent-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: 700;
}

.dock-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.35rem;
}

.dock-stat-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.76rem;
}

.dock-stat-label {
  color: var(--text-muted);
}

.dock-stat-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

.dock-savings-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-success);
}

.dock-btns-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dock-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 160ms ease;
}

.dock-btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.dock-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 650;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(42, 127, 98, 0.35);
  transition: all 160ms ease;
}

.dock-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(42, 127, 98, 0.45);
}

/* 5. Batch Thumbnail Filmstrip */
.studio-filmstrip {
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.filmstrip-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.filmstrip-label .badge {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.filmstrip-track {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.2rem 0;
  flex: 1;
}

.filmstrip-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-subtle);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--bg-tertiary);
}

.filmstrip-thumb:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.filmstrip-thumb.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-subtle);
}

.filmstrip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 6. Command Palette Modal (⌘K) */
.command-palette-dialog {
  max-width: 560px;
  width: 90%;
  border-radius: var(--radius-2xl);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  padding: 0;
}

.command-palette-search-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.cmd-search-icon {
  color: var(--text-muted);
}

.cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.96rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.cmd-input::placeholder {
  color: var(--text-muted);
}

.esc-kbd {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.command-palette-results {
  max-height: 340px;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 120ms ease;
}

.cmd-item:hover,
.cmd-item.selected {
  background: var(--accent-primary-subtle);
  color: var(--accent-primary);
  font-weight: 600;
}

.cmd-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.cmd-item-label {
  flex: 1;
}

.cmd-item-badge {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-xs);
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.command-palette-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.4rem;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cmd-keys-hint {
  display: flex;
  gap: 0.75rem;
}

.cmd-keys-hint kbd {
  font-family: var(--font-mono);
  padding: 0.05rem 0.3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
}

.cmd-privacy-badge {
  color: var(--accent-primary);
  font-weight: 600;
}



/* ==========================================================================
   Main Content Layout
   ========================================================================== */

.app-main {
  flex: 1;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Tab Panes with Silky Fade-In Transition */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: tabFadeIn 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Tool Header */
.tool-header {
  margin-bottom: 1.75rem;
}

.tool-title-row,
.tool-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.tool-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.15;
}

.tool-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.5;
}

/* ==========================================================================
   Segmented Controls (Linear / macOS Style)
   ========================================================================== */

.pill-toggle-group {
  display: inline-flex;
  padding: 3px;
  background-color: var(--segmented-bg);
  border: 1px solid var(--segmented-border);
  border-radius: var(--radius-md);
  gap: 2px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.pill-btn {
  padding: 0.42rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--segmented-inactive-text);
  cursor: pointer;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.pill-btn:hover {
  color: var(--text-primary);
}

.pill-btn:active {
  transform: scale(0.97);
}

.pill-btn.active {
  background-color: var(--segmented-active-bg);
  color: var(--segmented-active-text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Drag & Drop Upload Zone (Interactive & Animated)
   ========================================================================== */

.dropzone {
  border: 1.5px dashed var(--border-strong);
  background-color: var(--dropzone-bg);
  border-radius: var(--radius-xl);
  padding: 2.25rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  outline: none;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-xs);
}

.dropzone:hover {
  border-color: var(--accent-primary);
  background-color: rgba(42, 127, 98, 0.02);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.dropzone.dragover {
  border-color: var(--accent-primary);
  background-color: rgba(42, 127, 98, 0.06);
  transform: scale(1.008);
  box-shadow: 0 0 0 4px rgba(42, 127, 98, 0.12);
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  pointer-events: none;
}

.dropzone-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: rgba(42, 127, 98, 0.08);
  border: 1px solid rgba(42, 127, 98, 0.2);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.4rem;
  transition: all 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.dropzone:hover .dropzone-icon-box {
  transform: translateY(-3px) scale(1.05);
  background: rgba(42, 127, 98, 0.14);
  box-shadow: 0 4px 14px rgba(42, 127, 98, 0.25);
}
.dropzone-heading {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.dropzone-subtext {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.dropzone-cta-btn {
  pointer-events: auto;
  margin-top: 0.5rem;
  padding: 0.5rem 1.15rem;
  font-size: 0.83rem;
  font-weight: 550;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.dropzone-cta-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1.5px);
  box-shadow: var(--shadow-sm);
}

.dropzone-cta-btn:active {
  transform: translateY(0) scale(0.98);
}

.file-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* ==========================================================================
   Settings Card & Controls (Elevated Boutique Panel)
   ========================================================================== */

.toolbar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.6rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-xs);
  transition: border-color 200ms ease, box-shadow 200ms ease;
  position: relative;
  overflow: hidden;
}

.toolbar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary) 0%, var(--pine-blue) 50%, transparent 100%);
  opacity: 0.85;
}

.toolbar-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.toolbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--border-subtle);
}

.toolbar-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.toolbar-icon-squircle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-primary-subtle);
  border: 1px solid var(--accent-primary-border);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toolbar-title {
  font-size: 0.96rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  line-height: 1.25;
}

.toolbar-subtitle {
  font-size: 0.77rem;
  font-weight: 450;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.toolbar-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--accent-primary-subtle);
  border: 1px solid var(--accent-primary-border);
  color: var(--accent-primary);
  white-space: nowrap;
}

.status-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 0 0 rgba(42, 127, 98, 0.4);
  animation: pulse-dot 2.2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(42, 127, 98, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(42, 127, 98, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(42, 127, 98, 0); }
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.15rem;
  align-items: stretch;
  width: 100%;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.setting-box {
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.setting-box:hover {
  border-color: var(--border-strong);
  background: var(--bg-secondary);
}

.setting-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 24px;
}

.setting-title {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.84rem;
}

.setting-value-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent-primary);
  background: var(--accent-primary-subtle);
  border: 1px solid var(--accent-primary-border);
  padding: 0.14rem 0.5rem;
  border-radius: var(--radius-xs);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.format-pill-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-xs);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
}

.setting-helper-caption {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: auto;
}

/* Range Slider with Dynamic Gradient Track & Glowing Tactile Thumb */
.slider-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.35rem 0;
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: linear-gradient(
    to right,
    var(--accent-primary) 0%,
    var(--accent-primary) var(--range-progress, 80%),
    var(--bg-active) var(--range-progress, 80%),
    var(--bg-active) 100%
  );
  outline: none;
  cursor: pointer;
  transition: background 60ms linear;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2.5px solid var(--accent-primary);
  box-shadow: 0 1px 4px rgba(21, 36, 39, 0.2), 0 0 0 2px rgba(42, 127, 98, 0.12);
  cursor: grab;
  transition: transform 140ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 140ms ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(21, 36, 39, 0.25), 0 0 0 5px var(--accent-primary-subtle);
}

.range-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.08);
  box-shadow: 0 1px 4px rgba(21, 36, 39, 0.3), 0 0 0 7px var(--accent-primary-subtle);
}

.range-slider::-moz-range-track {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-active);
}

.range-slider::-moz-range-progress {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2.5px solid var(--accent-primary);
  box-shadow: 0 1px 4px rgba(21, 36, 39, 0.2);
  cursor: grab;
  transition: transform 140ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 140ms ease;
}

.range-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(21, 36, 39, 0.25), 0 0 0 5px var(--accent-primary-subtle);
}

.range-slider::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(1.08);
  box-shadow: 0 1px 4px rgba(21, 36, 39, 0.3), 0 0 0 7px var(--accent-primary-subtle);
}

/* Dark mode range thumb */
[data-theme="dark"] .range-slider::-webkit-slider-thumb {
  background: var(--bg-card);
  border: 2.5px solid var(--accent-primary);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(52, 156, 120, 0.22);
}

[data-theme="dark"] .range-slider::-moz-range-thumb {
  background: var(--bg-card);
  border: 2.5px solid var(--accent-primary);
}

.slider-ticks-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.69rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 500;
  user-select: none;
}

/* Precision Dimension Controls */
.dimension-input-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
}

.dimension-field {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 0.65rem;
  height: 38px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.dimension-field:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-subtle);
}

.dimension-field .dim-badge {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-muted);
  user-select: none;
  padding-right: 0.45rem;
  border-right: 1px solid var(--border-subtle);
  margin-right: 0.45rem;
}

.dimension-field .input-dim {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-primary);
  font-size: 0.86rem;
  font-family: var(--font-mono);
  padding: 0;
}

.dimension-field .input-dim::placeholder {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
}

.dimension-field .dim-unit {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
  padding-left: 0.25rem;
}

.dim-separator {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  user-select: none;
}

/* Aspect Ratio Pill */
.aspect-lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.aspect-lock-pill:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-card);
}

.aspect-lock-pill.active {
  background: var(--accent-primary-subtle);
  border-color: var(--accent-primary-border);
  color: var(--accent-primary);
}

/* Custom Vector Select Dropdown */
.select-dropdown {
  width: 100%;
  height: 38px;
  padding: 0 2.2rem 0 0.85rem;
  font-size: 0.86rem;
  font-weight: 500;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23538083' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 13px;
  transition: all 160ms ease;
}

[data-theme="dark"] .select-dropdown {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A0BFC2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.select-dropdown:hover {
  border-color: var(--border-strong);
}

.select-dropdown:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-subtle);
}

/* Target KB Mode Engine Callout */
.target-engine-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 650;
  color: var(--accent-primary);
}

.target-engine-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

/* Inputs & Dropdowns */
.input-text,
.input-number {
  width: 100%;
  padding: 0.5rem 0.8rem;
  font-size: 0.86rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  outline: none;
  transition: all 160ms ease;
}

.input-text:hover,
.input-number:hover {
  border-color: var(--border-strong);
}

.input-text:focus,
.input-number:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-primary-subtle);
  background: var(--bg-card);
}

/* Quick Chips */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.chip-btn {
  padding: 0.28rem 0.72rem;
  font-size: 0.76rem;
  font-weight: 550;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.chip-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.chip-btn:active {
  transform: scale(0.96);
}

.chip-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(42, 127, 98, 0.35);
}

/* Collapsible Details */
.info-details {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  background: var(--bg-card-secondary);
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.info-details summary {
  font-weight: 500;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

.info-details p {
  margin-top: 0.4rem;
  line-height: 1.4;
  font-size: 0.8rem;
}

/* Toggle Switches */
.toggle-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text-primary);
  user-select: none;
}

.switch-input {
  position: relative;
  width: 34px;
  height: 20px;
  appearance: none;
  background-color: var(--bg-active);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  flex-shrink: 0;
}

.switch-input::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: transform var(--transition-fast);
}

.switch-input:checked {
  background-color: var(--accent-primary);
}

.switch-input:checked::before {
  transform: translateX(14px);
}

/* ==========================================================================
   Buttons System (Tactile Linear / Raycast Style)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.48rem 1.05rem;
  font-size: 0.84rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none !important;
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
}

.btn-primary {
  background: linear-gradient(180deg, #329A78 0%, #24755A 100%);
  color: #FFFFFF;
  border-color: rgba(22, 70, 54, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 1px 2px rgba(0, 0, 0, 0.08), 0 3px 8px -2px rgba(42, 127, 98, 0.4);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #38A883 0%, #298063 100%);
  border-color: rgba(22, 70, 54, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 14px -2px rgba(42, 127, 98, 0.5);
  transform: translateY(-1.5px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .btn-primary {
  background: linear-gradient(180deg, #3CB38A 0%, #2F9471 100%);
  border-color: rgba(34, 105, 80, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 14px -2px rgba(52, 156, 120, 0.4);
}

[data-theme="dark"] .btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #43C699 0%, #35A37D 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 18px -2px rgba(52, 156, 120, 0.55);
}

.btn-outline {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--color-danger);
}

.btn-danger-ghost:hover:not(:disabled) {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.32rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 550;
}

.btn-lg {
  padding: 0.7rem 1.4rem;
  font-size: 0.94rem;
  font-weight: 600;
}

/* ==========================================================================
   Batch Actions Bar
   ========================================================================== */

.batch-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.batch-stats {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.batch-savings-highlight {
  font-family: var(--font-mono);
  color: var(--color-success);
  font-weight: 600;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Image Cards Grid (Interactive & Elevated)
   ========================================================================== */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1.15rem;
  width: 100%;
}

.image-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), border-color 200ms ease, box-shadow 200ms ease;
  position: relative;
  min-width: 0;
  box-sizing: border-box;
}

.image-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--border-strong);
}

.card-preview-box {
  width: 100%;
  height: 165px;
  background-color: var(--bg-tertiary);
  background-image: 
    linear-gradient(45deg, var(--bg-hover) 25%, transparent 25%), 
    linear-gradient(-45deg, var(--bg-hover) 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, var(--bg-hover) 75%), 
    linear-gradient(-45deg, transparent 75%, var(--bg-hover) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
}

.card-preview-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.image-card:hover .card-preview-img {
  transform: scale(1.035);
}

.card-badge-status {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.card-badge-status.badge-pending {
  background: var(--lavender-grey);
  color: #FFFFFF;
}

.card-badge-status.badge-processing {
  background: var(--pine-blue);
  color: #FFFFFF;
}

.card-badge-status.badge-done {
  background: var(--jungle-teal);
  color: #FFFFFF;
}

.card-badge-status.badge-error {
  background: rgba(220, 38, 38, 0.9);
  color: #FFFFFF;
}

.card-body {
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.65rem;
  min-width: 0;
  box-sizing: border-box;
}

.card-filename {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.file-ext {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  padding: 0.08rem 0.4rem;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
}

.card-size-comparison {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.8rem;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
}

.size-values {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
}

.size-original {
  color: var(--text-muted);
  text-decoration: line-through;
}

.size-arrow {
  color: var(--text-muted);
}

.size-result {
  color: var(--text-primary);
  font-weight: 600;
}

.savings-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  color: var(--color-success-text);
  font-family: var(--font-mono);
}

.savings-badge.negative {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: var(--color-danger-text);
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  width: 100%;
  box-sizing: border-box;
}

.card-action-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.card-actions .btn {
  padding: 0.32rem 0.58rem;
  font-size: 0.76rem;
  font-weight: 550;
  gap: 0.3rem;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 360px) {
  .card-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .card-action-group {
    width: 100%;
    display: flex;
    gap: 0.35rem;
  }
  .card-action-group .btn {
    flex: 1;
    justify-content: center;
  }
  .card-actions .remove-btn {
    width: 100%;
    justify-content: center;
  }
}

/* EXIF Tag Badges */
.exif-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.exif-status-stripped {
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border: 1px solid var(--color-success-border);
}

.exif-status-found {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  border: 1px solid var(--color-warning-border);
}

/* ==========================================================================
   Tool 3: Passport & ID Studio Layout & Tool 7: Social Crop Studio
   ========================================================================== */

.passport-studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.5rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  scroll-margin-top: calc(var(--topbar-height) + 1.25rem);
}

@media (max-width: 960px) {
  .passport-studio-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.passport-canvas-workspace {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.passport-sidebar-panel {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.canvas-viewport-container {
  width: 100%;
  height: 480px;
  min-height: 340px;
  max-height: 62vh;
  background: #0B111E;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
  cursor: grab;
  border: 1px solid var(--border-subtle);
  padding: 1.25rem;
  box-sizing: border-box;
}

.canvas-viewport-container.is-dragging {
  cursor: grabbing;
}

.canvas-viewport-container canvas,
#social-preview-canvas,
#passport-editor-canvas {
  max-width: 96%;
  max-height: 94%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  background-color: #FFFFFF;
  border-radius: var(--radius-xs);
  transition: aspect-ratio 200ms ease;
}

.canvas-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.zoom-pan-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  max-width: 280px;
}

.passport-sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sheet-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow-xs);
}

.sheet-preview-canvas-box {
  width: 100%;
  height: 220px;
  background: var(--bg-card-secondary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.5rem;
  border: 1px solid var(--border-subtle);
}

.sheet-preview-canvas-box canvas {
  max-width: 100%;
  max-height: 100%;
  box-shadow: var(--shadow-xs);
  background: #FFFFFF;
}

/* Color Swatches */
.color-swatches-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.color-swatch-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  position: relative;
}

.color-swatch-btn:hover {
  transform: scale(1.1);
}

.color-swatch-btn.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary-subtle);
}

.color-swatch-btn.active::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.7rem;
  font-weight: 800;
  color: #17233B;
}

.color-swatch-btn.swatch-dark.active::after {
  color: #FFFFFF;
}

/* ==========================================================================
   Modals & Drawers
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(13, 20, 34, 0.6);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  transform: scale(0.98);
  transition: transform var(--transition-normal);
  overflow: hidden;
}

.modal-backdrop.active .modal-dialog {
  transform: scale(1);
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.metadata-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.metadata-table th,
.metadata-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.metadata-table th {
  color: var(--text-secondary);
  font-weight: 500;
  width: 40%;
}

.metadata-table td {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 380px;
  width: calc(100% - 3rem);
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.8rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.16), 0 4px 12px -2px rgba(0, 0, 0, 0.08);
  font-size: 0.85rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  animation: toast-slide-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all var(--transition-normal);
  backdrop-filter: blur(12px);
}

.toast.toast-success {
  border-left: 3.5px solid var(--accent-primary);
}
.toast.toast-error {
  border-left: 3.5px solid var(--color-danger);
}
.toast.toast-info {
  border-left: 3.5px solid var(--pine-blue);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem;
}
.toast-close:hover {
  color: var(--text-primary);
}

@keyframes toast-slide-in {
  from {
    transform: translateY(15px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ==========================================================================
   Spin & Utility Keyframes
   ========================================================================== */

.spin-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.app-footer {
  margin-top: auto;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
}

/* GitHub Star Callout Strip — PixelShield Nordic Botanical Theme */
.footer-star-strip {
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.65rem 1.75rem;
  background: var(--accent-primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

[data-theme="dark"] .footer-star-strip {
  background: rgba(52, 156, 120, 0.08);
}

.footer-star-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-size: 0.83rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  text-align: center;
}

.footer-star-inner .star-icon {
  flex-shrink: 0;
  color: var(--accent-primary);
  fill: var(--accent-primary);
  filter: drop-shadow(0 0 5px rgba(42, 127, 98, 0.4));
  animation: starGlowPulse 2.8s ease-in-out infinite;
}

[data-theme="dark"] .footer-star-inner .star-icon {
  color: #34D399;
  fill: #34D399;
  filter: drop-shadow(0 0 7px rgba(52, 211, 153, 0.5));
}

@keyframes starGlowPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 3px rgba(42, 127, 98, 0.3)); }
  50% { transform: scale(1.18) rotate(8deg); filter: drop-shadow(0 0 8px rgba(42, 127, 98, 0.7)); }
}

.footer-star-link {
  color: var(--accent-primary);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}

[data-theme="dark"] .footer-star-link {
  color: #34D399;
}

.footer-star-link:hover {
  color: var(--accent-primary-hover);
  text-decoration-color: var(--accent-primary-hover);
}

[data-theme="dark"] .footer-star-link:hover {
  color: #6EE7B7;
  text-decoration-color: #6EE7B7;
}

.footer-github-star-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  text-decoration: none;
  margin-left: 0.35rem;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-xs);
}

.footer-github-star-btn:hover {
  background: var(--accent-primary-subtle);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(42, 127, 98, 0.2);
  text-decoration: none;
}

[data-theme="dark"] .footer-github-star-btn:hover {
  border-color: #34D399;
  color: #34D399;
  box-shadow: 0 3px 10px rgba(52, 211, 153, 0.25);
}

.star-count-badge {
  color: var(--accent-primary);
  font-size: 0.82rem;
}

[data-theme="dark"] .star-count-badge {
  color: #34D399;
}

.footer-container {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 1.15rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  box-sizing: border-box;
}

.footer-note {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.footer-meta-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.footer-bullet {
  opacity: 0.4;
}

.footer-developer {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.developer-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.25rem;
}

.developer-link:hover {
  color: var(--accent-primary-hover);
  background: var(--accent-primary-subtle);
  text-decoration: none;
}

.developer-link svg {
  opacity: 0.75;
  transition: transform 160ms ease, opacity 160ms ease;
}

.developer-link:hover svg {
  opacity: 1;
  transform: translate(1px, -1px);
}


/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-muted);
  text-align: center;
  gap: 0.5rem;
}

.empty-state-icon {
  font-size: 2rem;
  opacity: 0.35;
}

/* ==========================================================================
   Tool 4: Multi-Image to PDF Studio
   ========================================================================== */

.pdf-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pdf-page-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms ease, border-color 200ms ease;
}

.pdf-page-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.pdf-page-card.dragging {
  opacity: 0.4;
  border-style: dashed;
}

.pdf-thumb-box {
  width: 100%;
  height: 150px;
  background: var(--bg-card-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
}

.pdf-thumb-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.pdf-page-card:hover .pdf-thumb-box img {
  transform: scale(1.03);
}

.pdf-page-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(15, 23, 42, 0.75);
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  backdrop-filter: blur(4px);
}

.pdf-page-meta {
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pdf-page-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border-subtle);
}

.btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-icon:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
  transform: scale(1.08);
}

.btn-icon:active:not(:disabled) {
  transform: scale(0.95);
}

.btn-icon:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ==========================================================================
   Tool 5: Privacy Redactor / Blur & Censor
   ========================================================================== */

.redactor-workspace {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.redactor-viewport {
  width: 100%;
  min-height: 480px;
  max-height: 70vh;
  background: #0B111E;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  user-select: none;
}

.redactor-canvas-wrapper {
  position: relative;
  display: inline-block;
  cursor: crosshair;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.redactor-canvas-wrapper canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.redactor-selection-rect {
  position: absolute;
  border: 1.5px dashed var(--accent-primary);
  background: var(--accent-primary-subtle);
  pointer-events: none;
  display: none;
}

/* ==========================================================================
   Tool 6: Signature Cleaner & Watermark Studio
   ========================================================================== */

.signature-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

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

.signature-pad-container {
  width: 100%;
  height: 220px;
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  position: relative;
  touch-action: none;
  cursor: crosshair;
  overflow: hidden;
}

.signature-pad-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.signature-preview-box {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-tertiary);
  background-image: 
    linear-gradient(45deg, var(--bg-hover) 25%, transparent 25%), 
    linear-gradient(-45deg, var(--bg-hover) 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, var(--bg-hover) 75%), 
    linear-gradient(-45deg, transparent 75%, var(--bg-hover) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1rem;
}

.signature-preview-box canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ==========================================================================
   Tool 7: Favicon & Social Asset Generator
   ========================================================================== */

.favicon-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.favicon-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), border-color 180ms ease, box-shadow 180ms ease;
}

.favicon-item-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.favicon-icon-preview {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.favicon-icon-preview img {
  image-rendering: pixelated;
  max-width: 100%;
  max-height: 100%;
}

.favicon-meta-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.favicon-meta-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.code-snippet-box {
  background: #0B111E;
  color: #E2E8F0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  line-height: 1.5;
  position: relative;
  user-select: all;
}

/* ==========================================================================
   Before / After Split-Screen Compare Modal
   ========================================================================== */

.compare-modal-dialog {
  max-width: 900px !important;
  width: 95vw;
}

.compare-slider-container {
  width: 100%;
  height: 500px;
  max-height: 70vh;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background-color: #0F172A;
  background-image: 
    linear-gradient(45deg, #1E293B 25%, transparent 25%), 
    linear-gradient(-45deg, #1E293B 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #1E293B 75%), 
    linear-gradient(-45deg, transparent 75%, #1E293B 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  user-select: none;
  cursor: ew-resize;
  border: 1px solid var(--border-subtle);
  touch-action: none;
}

.compare-img-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.compare-img-layer img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.compare-img-after {
  z-index: 1;
}

.compare-img-before {
  z-index: 2;
  width: 100% !important;
  height: 100% !important;
  border-right: none;
  clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
  -webkit-clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
}

.compare-divider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #FFFFFF;
  z-index: 5;
  transform: translateX(-50%);
  cursor: ew-resize;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.75);
}

.compare-handle-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.8);
  pointer-events: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.compare-slider-container:hover .compare-handle-knob {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(255, 255, 255, 0.25);
}

.compare-tag-badge {
  position: absolute;
  top: 14px;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: #FFFFFF;
  background: rgba(14, 23, 25, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 4;
  letter-spacing: -0.01em;
}

.compare-tag-before {
  left: 12px;
}

.compare-tag-after {
  right: 12px;
}

/* Batch Rename Input Styling */
.batch-rename-input {
  max-width: 170px;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

/* Sub-tabs for tools with multiple modes */
.subtabs-nav {
  display: inline-flex;
  gap: 0.25rem;
  padding: 2px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  max-width: 100%;
  flex-wrap: wrap;
}

.subtab-btn {
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.subtab-btn:hover {
  color: var(--text-primary);
}

.subtab-btn.active {
  background: var(--bg-card);
  color: var(--accent-primary);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* ==========================================================================
   Comprehensive Responsive Breakpoints (All Screen Form Factors)
   ========================================================================== */

/* 1. Tablet & Mobile Drawer Breakpoint (<= 900px) */
@media (max-width: 900px) {
  html, body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .studio-shell {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .sidebar-close-btn {
    display: inline-flex;
  }

  .sidebar-collapse-btn,
  .sidebar-footer {
    display: none !important;
  }

  .sidebar-backdrop {
    display: block;
  }

  .studio-shell.sidebar-mobile-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* Off-canvas mobile/tablet drawer */
  .studio-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 290px !important;
    min-width: 290px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    z-index: 1000 !important;
    transform: translateX(-100%);
    transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
  }

  .studio-shell.sidebar-mobile-open .studio-sidebar {
    transform: translateX(0) !important;
  }

  .studio-main-col {
    width: 100%;
    min-height: 100vh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .studio-topbar {
    padding: 0.65rem 1rem;
    min-height: 60px;
    height: auto;
    gap: 0.75rem;
  }

  .studio-viewport {
    padding: 1.25rem 1rem 2.5rem;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .app-main {
    padding: 0;
    max-width: 100%;
    width: 100%;
    margin: 0;
  }

  .footer-container {
    padding: 0 1rem;
    max-width: 100%;
    width: 100%;
    margin: 0;
  }

  .topbar-left {
    max-width: 240px;
  }

  .search-placeholder {
    display: none;
  }

  .topbar-search-btn {
    padding: 0.4rem;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    justify-content: center;
  }

  .search-kbd {
    display: none;
  }

  .topbar-right .topbar-btn {
    width: 34px;
    height: 34px;
  }

  .passport-studio-layout {
    grid-template-columns: 1fr;
  }

  .signature-workspace {
    grid-template-columns: 1fr;
  }
}

/* 2. Mobile Phones (<= 640px) */
@media (max-width: 640px) {
  .tool-title-row,
  .tool-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .tool-title {
    font-size: 1.45rem;
  }

  .pill-toggle-group {
    width: 100%;
    display: flex;
  }

  .pill-toggle-group .pill-btn {
    flex: 1;
    text-align: center;
    font-size: 0.74rem;
    padding: 0.45rem 0.4rem;
  }

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

  .stage-split-canvas {
    height: 320px;
    min-height: 260px;
  }

  .stage-pill-tag {
    font-size: 0.68rem;
    padding: 0.25rem 0.6rem;
  }

  /* Place export dock neatly below stage on narrow screens to avoid obstructing the image */
  .studio-export-dock {
    position: relative;
    transform: none;
    left: auto;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    margin-top: 0.85rem;
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
  }

  .dock-controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .dock-segment-group {
    justify-content: center;
  }

  .dock-actions-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .dock-btns-group {
    flex-direction: column;
    width: 100%;
  }

  .dock-btns-group .btn {
    width: 100%;
    justify-content: center;
  }

  .batch-actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
  }

  .batch-actions-bar .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .batch-actions-bar .btn {
    width: 100%;
    justify-content: center;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .pdf-pages-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: 0 1rem;
  }

  .footer-note {
    justify-content: center;
    text-align: center;
    font-size: 0.78rem;
  }

  .footer-meta-right {
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.78rem;
  }

  .footer-bullet {
    display: none;
  }

  .command-palette-dialog {
    width: calc(100vw - 20px);
    max-height: 85vh;
  }

  .redactor-viewport {
    min-height: 300px;
  }

  .crumb-sep,
  .crumb-tool {
    font-size: 0.75rem;
  }

  .crumb-app {
    display: none;
  }
}

/* 3. Small Smart Phones (<= 380px) */
@media (max-width: 380px) {
  .topbar-left {
    max-width: 180px;
  }

  .studio-breadcrumb {
    display: none;
  }

  .dock-pill-btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
  }
}

/* ==========================================================================
   Tool 8: Background Remover & Backdrop Studio Styles
   ========================================================================== */

/* Checkerboard Pattern for True Transparency */
.bg-checkerboard {
  background-color: var(--bg-surface);
  background-image: 
    linear-gradient(45deg, rgba(120, 130, 140, 0.12) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(120, 130, 140, 0.12) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(120, 130, 140, 0.12) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(120, 130, 140, 0.12) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

[data-theme="dark"] .bg-checkerboard {
  background-color: #121820;
  background-image: 
    linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%);
}

.bgrem-workspace {
  width: 100%;
}

.bgrem-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1.5rem;
  align-items: start;
  width: 100%;
}

.bgrem-viewport-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  overflow: hidden;
}

.bgrem-viewport {
  position: relative;
  width: 100%;
  min-height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  user-select: none;
}

.bgrem-canvas-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 65vh;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

#bgrem-canvas {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  height: auto;
  object-fit: contain;
}

.bgrem-brush-cursor {
  position: fixed;
  border: 1.5px solid #2A7F62;
  background: rgba(42, 127, 98, 0.15);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 9999;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.bgrem-viewport-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0.25rem;
}

.bgrem-controls-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
}

.bgrem-setting-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
}

.bgrem-setting-group:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.bgrem-progress-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
}

.bgrem-progress-track {
  width: 100%;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.bgrem-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2A7F62, #34D399);
  transition: width 0.3s ease;
}

.bgrem-progress-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.bgrem-color-preview-box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bgrem-backdrop-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.bgrem-backdrop-btn.active {
  background: var(--color-primary);
  color: #FFFFFF !important;
  border-color: var(--color-primary);
}

.bgrem-color-palette {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bgrem-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.bgrem-color-swatch:hover {
  transform: scale(1.15);
}

.bgrem-color-swatch.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--color-primary);
}

.bgrem-custom-color-picker-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.bgrem-custom-color-picker-wrap input[type="color"] {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 44px;
  height: 44px;
  border: none;
  cursor: pointer;
  background: transparent;
}

/* Responsive Adaptations for Tool 8 */
@media (max-width: 1024px) {
  .bgrem-studio-grid {
    grid-template-columns: 1fr;
  }

  .bgrem-viewport {
    min-height: 380px;
  }
}

@media (max-width: 768px) {
  .bgrem-viewport {
    min-height: 300px;
  }

  .bgrem-controls-card {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .bgrem-viewport {
    min-height: 240px;
  }

  .bgrem-backdrop-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Motion Safety */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
