@import url('seo-hub.css');

/**
 * dopic.app - Universal Mobile Tool Base Stylesheet (Apple iOS Native Design System)
 * Used across all mobile sub-tools (tools/{tool}/m/) and synchronized with template-mobile.html.
 */

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --bg-page: #f4f7fc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-sub: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 25px -4px rgba(15, 23, 42, 0.12);
  --tab-height: 60px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: #f4f7fc !important;
  color-scheme: light !important;
  overflow-x: hidden !important;
}

a {
  text-decoration: none;
  color: inherit;
}

body, body.dark-theme {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  background: linear-gradient(180deg, #eef4ff 0%, #f6f9fd 240px, var(--bg-page) 100%) !important;
  color: var(--text) !important;
  line-height: 1.4 !important;
  padding-bottom: calc(var(--tab-height) + env(safe-area-inset-bottom, 20px) + 24px) !important;
  min-height: 100vh !important;
  -webkit-font-smoothing: antialiased !important;
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

/* Force Light Surface Tokens inside Mobile App */
.m-app-container,
.m-workspace-wrap {
  --surface: #ffffff !important;
  --surface-subtle: #f8fafc !important;
  --bg: #f4f7fc !important;
  --bg-page: #f4f7fc !important;
  --text: #0f172a !important;
  --text-sub: #64748b !important;
  --text-muted: #94a3b8 !important;
  --border: #e2e8f0 !important;
  --border-subtle: #f1f5f9 !important;
  --radius-lg: 16px !important;
  --radius-md: 12px !important;
}

/* Always hide desktop headers and desktop navigation in mobile */
#siteHeader,
header.desktop-header,
.navbar,
.desktop-nav,
.pc-only,
.m-workspace-wrap .hero-sec,
.m-workspace-wrap .hero-title,
.m-workspace-wrap .hero-sub,
.m-workspace-wrap .hero-badge {
  display: none !important;
}

/* App Container */
.m-app-container {
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}

/* Top App Bar Header (iOS Frosted Glass) */
.m-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(238, 244, 255, 0.92) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.m-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.m-brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent !important;
  border-radius: 7px;
  text-decoration: none;
  border: none !important;
  box-shadow: none !important;
  flex-shrink: 0;
  user-select: none;
  overflow: hidden;
}

.m-brand-badge img,
.m-brand-badge .brand-logo-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 7px;
}

.m-header-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.2px;
  margin: 0;
  white-space: nowrap;
}

/* Country Selector Pill Button */
.m-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 9999px;
  padding: 0.25rem 0.6rem;
  height: 28px;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e293b;
  transition: all 0.15s ease;
  flex-shrink: 0;
  line-height: 1;
}

.m-lang-btn:active {
  transform: scale(0.96);
  background: #f1f5f9;
}

.m-lang-flag {
  font-size: 0.85rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 14px;
  max-width: 18px;
  max-height: 14px;
  overflow: hidden;
  vertical-align: middle;
  flex-shrink: 0;
}

.m-lang-code {
  font-family: monospace;
  letter-spacing: 0.5px;
  font-size: 0.8rem;
}

.m-lang-arrow {
  color: #64748b;
}

/* iOS Hero Section */
.m-hero {
  padding: 1rem 1rem 0.5rem 1rem;
}

.m-hero-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 0.25rem;
}

.m-hero-sub {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.45;
}

.m-hero-text .highlight {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.08);
  padding: 3px 10px;
  border-radius: 9999px;
  margin-top: 4px;
  border: 1px solid rgba(79, 70, 229, 0.12);
}

.m-hero-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.m-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
}

/* Tool Workspace Responsive Wrapper */
.m-workspace-wrap {
  padding: 0 1rem 1rem 1rem;
}

/* =========================================================================
   Universal Mobile Preview-First Architecture (Apple iOS Style)
   ========================================================================= */
.m-workspace-wrap .stage-card,
.m-workspace-wrap .preview-card,
.m-workspace-wrap .preview-panel,
.m-workspace-wrap .preview-box,
.m-workspace-wrap .preview-stage,
.m-workspace-wrap .canvas-wrap,
.m-workspace-wrap .preview-container,
.m-workspace-wrap .preview-col,
.m-workspace-wrap .right-col,
.m-workspace-wrap .preview-area,
.m-workspace-wrap .preview-section,
.m-workspace-wrap .right-workspace-stage,
.m-workspace-wrap .viewport-card,
.m-workspace-wrap .stage-slices,
.m-workspace-wrap .preview-showcase,
.m-workspace-wrap .preview-board-wrap,
.m-workspace-wrap .video-preview-box,
.m-workspace-wrap .preview-canvas-wrap,
.m-workspace-wrap #previewCard,
.m-workspace-wrap #previewPanel,
.m-workspace-wrap #stageCard,
.m-workspace-wrap #previewBox {
  order: -1 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 0 1rem 0 !important;
  position: static !important;
  top: auto !important;
  min-height: auto !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.08) !important;
  padding: 1.15rem 1rem !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Ensure canvas-wrap stays hidden when not active */
.m-workspace-wrap .canvas-wrap[style*="display: none"],
.m-workspace-wrap .canvas-wrap[style*="display:none"],
.m-workspace-wrap .canvas-wrap.is-hidden {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

/* Explicit isolation for inner canvas positioning stages */
.m-workspace-wrap .viewport-stage {
  position: relative !important;
  display: inline-block !important;
  padding: 0 !important;
  margin: 0 auto !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  order: 0 !important;
  max-width: 100% !important;
  box-sizing: content-box !important;
}

/* Minimal AI Practical Toolbox Section on Mobile (Matches Homepage) */
.m-toolbox-sec {
  padding: 0 1rem 1.75rem 1rem;
  margin-top: 1.25rem;
}

.m-sec-header {
  padding: 0.75rem 0.25rem 0.45rem 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m-sec-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.m-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}

@media (max-width: 320px) {
  .m-tools-grid {
    grid-template-columns: 1fr;
  }
}

.m-tool-pill {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.55rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  min-height: 52px;
  height: 52px;
  overflow: hidden;
  box-sizing: border-box;
}

.m-tool-pill:active {
  transform: scale(0.98);
  border-color: var(--primary);
  background: #fafbff;
}

.m-tool-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.m-tool-icon-box svg {
  width: 17px;
  height: 17px;
}

.icon-blue { background: #eff6ff; color: #2563eb; }
.icon-cyan { background: #ecfeff; color: #0891b2; }
.icon-rose { background: #fff1f2; color: #e11d48; }
.icon-purple { background: #faf5ff; color: #9333ea; }
.icon-red { background: #fef2f2; color: #dc2626; }
.icon-amber { background: #fffbeb; color: #d97706; }
.icon-indigo { background: #eef2ff; color: #4f46e5; }
.icon-emerald { background: #ecfdf5; color: #059669; }

.m-tool-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  justify-content: center;
  overflow: hidden;
}

.m-tool-name {
  font-size: 0.74rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-tool-desc {
  font-size: 0.62rem;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.2;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Collapse Desktop Multi-Column Grids and Panels into Mobile Vertical Flow */
.m-workspace-wrap .studio-grid,
.m-workspace-wrap .studio-container,
.m-workspace-wrap .app-box,
.m-workspace-wrap .main-card,
.m-workspace-wrap .editor-grid,
.m-workspace-wrap .layout-grid,
.m-workspace-wrap .two-col-grid,
.m-workspace-wrap .panel-grid,
.m-workspace-wrap .container,
.m-workspace-wrap .suit-studio-container {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 100% !important;
  gap: 1rem !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

/* Apple iOS Card Architecture for all Panels */
.m-workspace-wrap .panel-card,
.m-workspace-wrap .sec-card,
.m-workspace-wrap .tool-panel,
.m-workspace-wrap .control-panel,
.m-workspace-wrap .sidebar-panel,
.m-workspace-wrap .preview-panel,
.m-workspace-wrap .preview-card,
.m-workspace-wrap .card,
.m-workspace-wrap .box,
.m-workspace-wrap .sec-box,
.m-workspace-wrap .editor-panel {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.08) !important;
  color: #0f172a !important;
  padding: 1.15rem 1rem !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-bottom: 0.85rem !important;
}

/* Headings and Titles inside Cards */
.m-workspace-wrap .sec-head,
.m-workspace-wrap .sec-title,
.m-workspace-wrap .panel-title,
.m-workspace-wrap h2,
.m-workspace-wrap h3,
.m-workspace-wrap h4 {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  letter-spacing: -0.2px !important;
  margin-bottom: 0.45rem !important;
}

.m-workspace-wrap label:not([class*="btn"]),
.m-workspace-wrap .label,
.m-workspace-wrap .field-label {
  color: #475569 !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 0.35rem !important;
}

.m-workspace-wrap .text-muted,
.m-workspace-wrap .hint,
.m-workspace-wrap .help-text,
.m-workspace-wrap small {
  color: #64748b !important;
  font-size: 0.78rem !important;
}

/* Apple iOS Form Inputs, Textareas & Selects */
.m-workspace-wrap input[type="text"],
.m-workspace-wrap input[type="number"],
.m-workspace-wrap input[type="password"],
.m-workspace-wrap input[type="search"],
.m-workspace-wrap select,
.m-workspace-wrap textarea {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  color: #0f172a !important;
  font-size: 0.88rem !important;
  padding: 0.65rem 0.85rem !important;
  box-sizing: border-box !important;
  width: 100% !important;
  outline: none !important;
  transition: all 0.15s ease !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

.m-workspace-wrap input[type="text"]:focus,
.m-workspace-wrap input[type="number"]:focus,
.m-workspace-wrap input[type="password"]:focus,
.m-workspace-wrap select:focus,
.m-workspace-wrap textarea:focus {
  border-color: #4f46e5 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

/* Apple iOS Range Sliders */
.m-workspace-wrap input[type="range"] {
  accent-color: #4f46e5 !important;
  height: 6px !important;
  background: #e2e8f0 !important;
  border-radius: 999px !important;
  width: 100% !important;
  outline: none !important;
  margin: 0.4rem 0 !important;
}

/* Apple iOS Buttons */
.m-workspace-wrap .btn-primary,
.m-workspace-wrap .btn-download,
.m-workspace-wrap #btnDownload,
.m-workspace-wrap button.primary:not(.ribbon-btn),
.m-workspace-wrap .action-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 14px !important;
  padding: 0.85rem 1.25rem !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.32) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 46px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
}

.m-workspace-wrap .btn-primary:active,
.m-workspace-wrap .btn-download:active {
  transform: scale(0.98) !important;
  opacity: 0.92 !important;
}

.m-workspace-wrap .btn-sm,
.m-workspace-wrap .btn-secondary,
.m-workspace-wrap .btn-outline,
.m-workspace-wrap button.secondary,
.m-workspace-wrap .btn-ghost {
  background: #f8fafc !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  padding: 0.5rem 0.85rem !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  min-height: 38px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
}

.m-workspace-wrap .btn-sm:active,
.m-workspace-wrap .btn-secondary:active {
  background: #eef2ff !important;
  border-color: #4f46e5 !important;
}

/* Universal Mobile Action Button Group (Stacked Top-and-Bottom 82% Centered) */
.btn-action-group,
.m-workspace-wrap .btn-action-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: 82% !important;
  max-width: 320px !important;
  box-sizing: border-box !important;
  margin: 1rem auto 0 auto !important;
}

.btn-action-group .btn-lg,
.btn-action-group > button,
.btn-action-group > a,
.m-workspace-wrap .btn-action-group .btn-lg,
.m-workspace-wrap .btn-action-group > button,
.m-workspace-wrap .btn-action-group > a {
  width: 100% !important;
  min-height: 46px !important;
  height: 46px !important;
  padding: 0 1rem !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  cursor: pointer !important;
  text-align: center !important;
  white-space: nowrap !important;
  text-decoration: none !important;
}

.btn-action-group .btn-outline,
.m-workspace-wrap .btn-action-group .btn-outline {
  background: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #475569 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.2s ease !important;
}

.btn-action-group .btn-outline:active,
.m-workspace-wrap .btn-action-group .btn-outline:active {
  background: #e2e8f0 !important;
}

.btn-action-group .btn-download,
.btn-action-group .btn-primary,
.m-workspace-wrap .btn-action-group .btn-download,
.m-workspace-wrap .btn-action-group .btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3) !important;
  transition: all 0.2s ease !important;
}

.btn-action-group .btn-download:active,
.btn-action-group .btn-primary:active,
.m-workspace-wrap .btn-action-group .btn-download:active,
.m-workspace-wrap .btn-action-group .btn-primary:active {
  opacity: 0.92 !important;
  transform: scale(0.99) !important;
}

/* Apple iOS Dropzones & File Uploads */
.m-workspace-wrap .dropzone,
.m-workspace-wrap .upload-box,
.m-workspace-wrap .avatar-upload-box,
.m-workspace-wrap .file-drop-area {
  background: #f8fafc !important;
  border: 2px dashed #cbd5e1 !important;
  border-radius: 16px !important;
  color: #475569 !important;
  padding: 1.5rem 1rem !important;
  text-align: center !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

.m-workspace-wrap .dropzone:active,
.m-workspace-wrap .upload-box:active {
  border-color: #4f46e5 !important;
  background: #eef2ff !important;
}

/* Responsive Canvases and Previews */
.m-workspace-wrap canvas,
.m-workspace-wrap img.preview-img,
.m-workspace-wrap .canvas-wrap,
.m-workspace-wrap .preview-box,
.m-workspace-wrap .preview-canvas-box {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.1) !important;
  box-sizing: border-box !important;
  margin: 0 auto !important;
  display: block !important;
}

/* Color palettes & presets */
.m-workspace-wrap .color-dot,
.m-workspace-wrap .swatch {
  border: 2px solid #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
  border-radius: 50% !important;
}

.m-workspace-wrap .avatar-upload-box {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  padding: 0.75rem 0.85rem !important;
  border-radius: 14px !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.85rem !important;
}

.m-workspace-wrap .avatar-actions div {
  color: #0f172a !important;
}

.m-workspace-wrap .color-picker-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
}

.m-workspace-wrap .color-indicator {
  border: 1.5px solid rgba(0, 0, 0, 0.15) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}


/* =========================================================================
   SEO Hub styles are managed exclusively in shared/seo-hub.css (Single Source of Truth)
   Imported at top via: @import url('seo-hub.css');
   ========================================================================= */

/* Mobile Legal Footer */
.m-site-footer {
  padding: 1.5rem 1rem 0.5rem 1rem;
  text-align: center;
  font-size: 0.72rem;
  color: #94a3b8;
}

.m-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.m-footer-link {
  color: #64748b;
  text-decoration: none;
  font-weight: 600;
}

.m-footer-link:hover, .m-footer-link:active {
  color: var(--primary);
}

.m-footer-copy {
  color: #94a3b8;
  font-size: 0.68rem;
}

/* Fixed Bottom Tab Bar (iOS Native Style & Desktop Preview Adaptation) */
.m-tabbar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  margin: 0 auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: 520px !important;
  height: calc(var(--tab-height, 60px) + env(safe-area-inset-bottom, 20px)) !important;
  padding-bottom: env(safe-area-inset-bottom, 20px) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-top: 1px solid rgba(226, 232, 240, 0.85) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-around !important;
  z-index: 9999 !important;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.05) !important;
  box-sizing: border-box !important;
}

.m-tab-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  color: #64748b !important;
  text-decoration: none !important;
  flex: 1 1 0 !important;
  min-width: 0 !important;
  padding: 0 2px !important;
  height: 100% !important;
  cursor: pointer !important;
  transition: color 0.15s ease !important;
}

.m-tab-item.active {
  color: var(--primary) !important;
}

.m-tab-item svg {
  width: 22px !important;
  height: 22px !important;
  stroke-width: 2 !important;
  flex-shrink: 0 !important;
}

.m-tab-item span {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: clamp(10px, 2.5vw, 11px) !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  line-height: 1.2 !important;
}

/* Clean iPhone preview frame when viewing mobile page on PC / wide screens */
@media (min-width: 521px) {
  body {
    background: #f1f5f9 !important;
  }
  .m-app-container {
    border-left: 1px solid #e2e8f0 !important;
    border-right: 1px solid #e2e8f0 !important;
    box-shadow: 0 0 50px rgba(15, 23, 42, 0.08) !important;
    min-height: 100vh !important;
    background: #ffffff !important;
  }
  .m-tabbar {
    border-left: 1px solid #e2e8f0 !important;
    border-right: 1px solid #e2e8f0 !important;
  }
}

/* Country & Language Drawer */
.m-lang-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.m-lang-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.m-lang-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 20px)) 1.25rem;
  z-index: 350;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.18);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.m-lang-drawer.active {
  transform: translateY(0);
}

.m-lang-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.m-lang-drawer-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.m-lang-drawer-close {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #475569;
  font-size: 1.2rem;
  transition: background 0.15s;
}

.m-lang-drawer-close:active {
  background: #e2e8f0;
}

.m-lang-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 0.85rem;
}

.m-lang-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.88rem;
  width: 100%;
  color: #0f172a;
}

.m-lang-list {
  overflow-y: auto;
  flex: 1;
  padding-right: 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  -webkit-overflow-scrolling: touch;
}

.m-picker-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  padding: 8px 6px 4px 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.m-picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  color: #1e293b;
  transition: background 0.15s;
}

.m-picker-item:hover, .m-picker-item:active {
  background: #f8fafc;
}

.m-picker-item.active {
  background: #eef2ff;
  color: var(--primary);
  font-weight: 700;
}

.m-picker-flag {
  font-size: 1.05rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  flex-shrink: 0;
}

.m-picker-quick-box {
  padding: 8px 6px 8px 6px;
  background: #f8fafc;
  border-radius: 12px;
  margin-bottom: 6px;
  border: 1px solid #f1f5f9;
}

.m-picker-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 4px 6px;
  border: none;
}

.m-picker-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

@media (max-width: 360px) {
  .m-picker-quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.m-picker-quick-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #1e293b;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: all 0.15s ease;
}

.m-picker-quick-chip:active, .m-picker-quick-chip.active {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
  font-weight: 700;
}

.m-quick-chip-flag {
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
}

.m-quick-chip-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-picker-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.m-picker-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.m-picker-code {
  font-size: 0.72rem;
  color: #94a3b8;
  font-family: monospace;
}

/* =========================================================================
/* Mascot avatar display controlled per-template */
.m-hero-avatar-wrap {
  display: none;
}
/* Tools grid shows all items by default on homepage unless explicitly marked collapsible */
body.is-tool-subpage .m-tools-grid:not(.is-expanded) .m-tool-pill:nth-child(n+5) {
  display: none !important;
}

.m-btn-expand-tools {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.m-btn-expand-tools:active {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: scale(0.98);
}


/* Universal Suite Tabs for Mobile (2-column pill cards) */
.suite-tabs-wrap {
  order: -10 !important;
  width: 100% !important;
  margin-bottom: 0.85rem !important;
  border-bottom: none !important;
  padding: 0 !important;
  display: flex !important;
  justify-content: stretch !important;
}
.suite-tabs-nav {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 8px 10px !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.suite-tab-item {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 0.6rem 0.5rem !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: #475569 !important;
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
  text-align: center !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
  user-select: none !important;
}
.suite-tab-item.active {
  background: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18) !important;
}
.suite-tab-item.active svg {
  color: #ffffff !important;
  opacity: 1 !important;
}

/* =========================================================================
   Unified Mobile Canvas Floating Upload Button (Standardized Pill Button)
   ========================================================================= */
.canvas-floating-upload {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: auto !important;
  max-width: 86% !important;
  pointer-events: auto;
}
.btn-cutout-minimal {
  position: relative;
  overflow: hidden;
  padding: 7px 18px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
  width: auto !important;
  white-space: nowrap;
}
.btn-upload-svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  flex-shrink: 0;
}
.upload-specs-hint {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 2px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
}

/* =========================================================================
   Universal Mobile Tool Workbench Components
   ========================================================================= */

/* Mobile Hero Banner */
.m-hero {
  text-align: center;
  padding: 1rem 0.5rem 0.75rem 0.5rem;
}
.m-hero h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.m-hero p {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 5px;
  line-height: 1.45;
}

/* Universal Mobile Upload Dropzone */
.m-dropzone {
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 16px;
  padding: 2.25rem 1rem;
  text-align: center;
  margin: 0.5rem 0 1rem 0;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.m-dropzone:hover,
.m-dropzone.dragover {
  border-color: var(--primary, #4f46e5);
  background: #eff2fe;
}
.m-dropzone-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.75rem auto;
  color: var(--primary, #4f46e5);
  display: block;
}
.m-dropzone-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.25rem;
}
.m-dropzone-sub {
  font-size: 0.78rem;
  color: #64748b;
}

/* Universal Mobile Canvas Containers */
.m-canvas-box,
.m-canvas-wrap {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  position: relative;
}
.m-canvas-box canvas,
.m-canvas-box img,
.m-canvas-wrap canvas,
.m-canvas-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Universal Mobile Sticky Bottom Action Bar */
.m-bottom-action {
  position: sticky;
  bottom: calc(var(--tab-height, 60px) + env(safe-area-inset-bottom, 20px) + 8px);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 80;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  padding: 0.75rem 0.5rem;
  border-radius: 16px;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.05);
  margin-top: 1rem;
}

/* Universal Mobile Toolbars */
.m-toolbar {
  background: #ffffff;
  border-radius: 14px;
  padding: 0.85rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.m-brush-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}
.m-brush-row input[type="range"] {
  flex: 1;
}

/* ==========================================================================
   Universal In-Canvas Minimalist Processing Overlay (Mobile Optimization)
   GPU hardware-accelerated, zero-jank, responsive from 320px to 4K
   ========================================================================== */
.stage-loading-overlay,
.canvas-processing-overlay,
.workbench-processing-overlay,
.m-stage-loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: auto;
  user-select: none;
}

.stage-loading-overlay.is-hidden,
.canvas-processing-overlay.is-hidden,
.workbench-processing-overlay.is-hidden,
.m-stage-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.stage-loading-card,
.workbench-processing-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  max-width: 88%;
  width: auto;
  min-width: 180px;
}

.stage-loading-spinner,
.workbench-processing-spinner,
.loading-spinner,
.processing-spinner,
.m-processing-spinner,
.m-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(2, 132, 199, 0.14);
  border-top-color: #0284c7;
  border-radius: 50%;
  animation: spinMinimal 0.85s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  will-change: transform;
  transform: translateZ(0);
}

@keyframes spinMinimal {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.stage-loading-title,
.workbench-processing-title,
.loading-text,
.processing-title,
.m-processing-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.stage-loading-tip,
.workbench-processing-tip,
.loading-sub,
.processing-tip,
.m-processing-tip {
  font-size: 0.74rem;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
  max-width: 240px;
}

/* =========================================================================
   Universal Mobile Before / After Comparison Slider (Remove.bg Style)
   ========================================================================= */
.ba-compare-container,
.ba-slider-stage {
  position: relative;
  overflow: hidden;
  width: 100% !important;
  max-width: 350px !important;
  aspect-ratio: 1 / 1 !important;
  margin: 0 auto 0.75rem auto;
  border-radius: 14px;
  user-select: none;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  touch-action: none;
  cursor: ew-resize;
  --slider-pos: 50%;
}

.ba-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ba-layer img,
.ba-layer canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ba-before-layer {
  clip-path: inset(0 calc(100% - var(--slider-pos, 50%)) 0 0);
  z-index: 2;
  will-change: clip-path;
}

.ba-after-layer {
  z-index: 1;
}

.ba-slider-divider,
.ba-handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--slider-pos, 50%);
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
  will-change: left;
}

.ba-slider-handle,
.ba-handle-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  z-index: 12;
  border: 2px solid #ffffff;
  pointer-events: auto;
  cursor: ew-resize;
  user-select: none;
}

.ba-label-before,
.ba-label-after {
  position: absolute;
  top: 10px;
  padding: 3px 9px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 16px;
  pointer-events: none;
  z-index: 8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.ba-label-before { left: 10px; }
.ba-label-after { right: 10px; }

.ba-sample-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.5rem auto 0.75rem auto;
  width: 100%;
  flex-wrap: wrap;
}

.ba-sample-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ba-sample-pills {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.ba-sample-pill {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
  user-select: none;
}

.ba-sample-pill.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

/* Universal Finished Product Mode (Zero Split Line, Full Clean Canvas Showcase) */
.finished-mode .ba-handle-line,
.finished-mode .ba-slider-divider,
.finished-mode .ba-handle-btn,
.finished-mode .ba-slider-handle,
.finished-mode #baHandleLine,
.finished-mode #baHandleBtn,
.finished-mode .ba-label-before,
.finished-mode .ba-label-after,
.finished-mode .ba-before-layer,
.finished-mode #sliderBeforeLayer,
.finished-mode .canvas-floating-upload,
#baSliderContainer.finished-mode .ba-handle-line,
#baSliderContainer.finished-mode #baHandleLine,
#baSliderContainer.finished-mode .ba-handle-btn,
#baSliderContainer.finished-mode #baHandleBtn,
#baSliderContainer.finished-mode .ba-label-before,
#baSliderContainer.finished-mode .ba-label-after,
#baSliderContainer.finished-mode .ba-before-layer,
#baSliderContainer.finished-mode #sliderBeforeLayer,
#baSliderContainer.finished-mode .canvas-floating-upload,
.ba-slider-stage.finished-mode .ba-handle-line,
.ba-slider-stage.finished-mode #baHandleLine,
.ba-slider-stage.finished-mode .ba-handle-btn,
.ba-slider-stage.finished-mode #baHandleBtn,
.ba-slider-stage.finished-mode .ba-label-before,
.ba-slider-stage.finished-mode .ba-label-after,
.ba-slider-stage.finished-mode .ba-before-layer,
.ba-slider-stage.finished-mode #sliderBeforeLayer,
.ba-slider-stage.finished-mode .canvas-floating-upload {
  display: none !important;
}

.finished-mode .ba-after-layer,
.finished-mode #sliderAfterLayer,
#baSliderContainer.finished-mode .ba-after-layer,
#baSliderContainer.finished-mode #sliderAfterLayer,
.ba-slider-stage.finished-mode .ba-after-layer,
.ba-slider-stage.finished-mode #sliderAfterLayer {
  clip-path: none !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 1 !important;
}

/* =========================================================================
   Universal Sub-Tool Minimalist Upload Dropzone (Mobile SSOT)
   ========================================================================= */
.sub-dropzone-box {
  background: #ffffff;
  border: 2px dashed #93c5fd;
  border-radius: 14px;
  padding: 2.25rem 1rem;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.05);
  transition: all 0.2s ease;
  user-select: none;
  margin: 0.5rem 0.75rem 1rem;
}
.sub-dropzone-box:active {
  background: #eff6ff;
  border-color: #2563eb;
  transform: scale(0.99);
}
.sub-dropzone-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.sub-dropzone-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.35rem;
}
.sub-dropzone-sub {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}
.sub-dropzone-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 10px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.sub-dropzone-specs {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: #94a3b8;
}



