:root {
  /* Warm, bright, friendly consumer palette (Apple / Notion / Canva vibe) */
  --bg: #f5f7fb;
  --bg-elevated: #ffffff;
  --bg-soft: #edf1f8;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: #ffffff;
  --border: rgba(15, 23, 42, 0.085);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --accent: #2563eb;
  --accent-bright: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-magenta: #d946ef;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --accent-cyan: #00d4ff;
  --danger: #e11d48;
  --warning: #d97706;
  --stage-bg: #e9eef6;
  --input-bg: #f8fafc;
  --shadow-sm: 0 4px 14px -4px rgba(15, 23, 42, 0.07);
  --shadow-md: 0 14px 34px -14px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 24px 50px -18px rgba(15, 23, 42, 0.16);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --font-display: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --mobile-nav-h: 72px;
}

/* Optional Dark Mode */
body.theme-dark {
  --bg: #0b0f1f;
  --bg-elevated: #12172b;
  --bg-soft: #1a213d;
  --bg-card: rgba(18, 23, 43, 0.86);
  --bg-card-hover: rgba(26, 33, 61, 0.96);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #06b6d4;
  --accent-bright: #38bdf8;
  --accent-soft: rgba(6, 182, 212, 0.16);
  --stage-bg: #070a16;
  --input-bg: rgba(11, 17, 32, 0.85);
  --shadow-sm: 0 4px 16px -4px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 16px 36px -14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 54px -18px rgba(0, 0, 0, 0.65);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Soft, welcoming pastel mesh background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(ellipse 65% 45% at 15% -5%, rgba(6, 182, 212, 0.18), transparent 65%),
    radial-gradient(ellipse 60% 45% at 88% 0%, rgba(139, 92, 246, 0.16), transparent 65%),
    radial-gradient(ellipse 55% 42% at 50% 25%, rgba(37, 99, 235, 0.12), transparent 70%),
    radial-gradient(ellipse 50% 40% at 10% 90%, rgba(217, 70, 239, 0.1), transparent 70%);
}

body.theme-dark::before {
  background:
    radial-gradient(ellipse 65% 45% at 15% -5%, rgba(6, 182, 212, 0.22), transparent 65%),
    radial-gradient(ellipse 60% 45% at 88% 0%, rgba(139, 92, 246, 0.2), transparent 65%),
    radial-gradient(ellipse 55% 42% at 50% 25%, rgba(217, 70, 239, 0.14), transparent 70%);
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  transition: max-width 0.25s var(--ease);
}

body.studio-wide .container {
  max-width: 1460px;
}

/* =========================================================================
   HEADER (CLEAN & FRIENDLY)
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(245, 247, 251, 0.82);
  border-bottom: 1px solid var(--border);
}

body.theme-dark .site-header {
  background: rgba(11, 17, 32, 0.8);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 66px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.025em;
  cursor: pointer;
  flex-shrink: 0;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.28));
}

.brand span.tld {
  background: linear-gradient(95deg, #06b6d4 0%, #2563eb 48%, #9333ea 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--accent-soft);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: var(--accent-bright);
  white-space: nowrap;
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  animation: pulse 2.2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.84); }
}

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s var(--ease);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: var(--shadow-md);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

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

.btn-primary {
  background: linear-gradient(135deg, #06b6d4 0%, #2563eb 52%, #7c3aed 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 10px 22px -8px rgba(37, 99, 235, 0.55);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0891b2 0%, #1d4ed8 52%, #6d28d9 100%);
  color: #ffffff;
  box-shadow: 0 14px 28px -8px rgba(124, 58, 237, 0.62);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.82rem;
}

.btn-danger {
  border-color: rgba(225, 29, 72, 0.28);
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(225, 29, 72, 0.08);
  border-color: var(--danger);
}

/* =========================================================================
   WELCOMING LAUNCHER HERO
   ========================================================================= */
.hero {
  padding: 36px 0 22px;
  text-align: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 6px 15px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.95rem, 4.6vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 auto 12px;
  max-width: 760px;
}

.gradient-text {
  background: linear-gradient(120deg, #06b6d4 0%, #2563eb 45%, #8b5cf6 78%, #d946ef 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.theme-dark .gradient-text {
  background: linear-gradient(120deg, #22d3ee 0%, #60a5fa 45%, #a78bfa 78%, #e879f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  font-size: clamp(0.96rem, 1.6vw, 1.08rem);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 22px;
}

.telemetry-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.telemetry-value {
  font-weight: 700;
  color: var(--accent-bright);
}

/* =========================================================================
   SEARCH & CATEGORY PILLS
   ========================================================================= */
.catalog-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 22px 0 20px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}

.filter-pills::-webkit-scrollbar { display: none; }

.filter-pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.filter-pill:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.filter-pill.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg-elevated);
}

.catalog-search {
  position: relative;
  min-width: 240px;
  flex: 0 1 320px;
}

.catalog-search input {
  width: 100%;
  padding: 10px 16px 10px 38px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.catalog-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}

.catalog-search .search-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.9rem;
}

/* =========================================================================
   FRIENDLY SUPER-APP LAUNCHER GRID (VIBRANT 3D SQUIRCLE ICONS)
   ========================================================================= */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 42px;
}

.tool-card {
  --app-grad: linear-gradient(135deg, #10b981, #059669);
  --app-glow: rgba(16, 185, 129, 0.3);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 22px;
  border-radius: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.26s var(--spring), box-shadow 0.24s ease, border-color 0.24s ease;
  overflow: hidden;
}

.tool-card:hover, .tool-card:focus-visible {
  transform: translateY(-5px) scale(1.015);
  background: var(--bg-card-hover);
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 22px 42px -18px var(--app-glow), var(--shadow-md);
  outline: none;
}

body.theme-dark .tool-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.tool-card:active {
  transform: scale(0.96);
}

.tool-card.featured {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(255, 65, 108, 0.08), var(--bg-card) 55%, rgba(255, 140, 66, 0.08));
  border-color: rgba(255, 65, 108, 0.22);
}

.tool-card.featured h3 {
  font-size: 1.32rem;
}

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feature-tag {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
}

.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Toolityy-style Fun, Bright Glossy 3D Squircle Icon + Sparkle */
.tool-icon {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 19px;
  display: grid;
  place-items: center;
  background: var(--app-grad);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 12px 26px -6px var(--app-glow),
    inset 0 3px 5px rgba(255, 255, 255, 0.55),
    inset 0 -4px 8px rgba(0, 0, 0, 0.16);
  flex-shrink: 0;
  transition: transform 0.28s var(--spring), box-shadow 0.28s var(--ease);
}

.tool-icon::before {
  content: "";
  position: absolute;
  inset: 3px 4px auto 4px;
  height: 45%;
  border-radius: 14px 14px 20px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.04) 100%);
  pointer-events: none;
  z-index: 1;
}

.tool-icon::after {
  content: "✦";
  position: absolute;
  top: -6px;
  right: -5px;
  font-size: 14px;
  line-height: 1;
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.85), 0 1px 2px rgba(15, 23, 42, 0.35);
  z-index: 3;
  pointer-events: none;
  transition: transform 0.28s var(--spring);
}

.tool-card:hover .tool-icon {
  transform: scale(1.1) rotate(-4deg) translateY(-2px);
  box-shadow:
    0 18px 34px -6px var(--app-glow),
    inset 0 3px 6px rgba(255, 255, 255, 0.7);
}

.tool-card:hover .tool-icon::after {
  transform: scale(1.3) rotate(20deg);
  color: #38bdf8;
}

.tool-icon svg {
  position: relative;
  z-index: 2;
  width: 28px;
  height: 28px;
  stroke-width: 2.3;
  color: #ffffff;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.22));
}

.tool-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.tool-badge.hot {
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.tool-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0;
  letter-spacing: -0.015em;
}

.tool-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  flex: 1;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-bright);
}

/* Individual Joyful App Icon Colors */
.tool-card[data-tool="pdf-editor"] { --app-grad: linear-gradient(135deg, #ff416c, #ff4b2b); --app-glow: rgba(255, 65, 108, 0.45); }
.tool-card[data-tool="watermark"]  { --app-grad: linear-gradient(135deg, #10b981, #059669); --app-glow: rgba(16, 185, 129, 0.45); }
.tool-card[data-tool="pdf"]        { --app-grad: linear-gradient(135deg, #fb923c, #ea580c); --app-glow: rgba(249, 115, 22, 0.45); }
.tool-card[data-tool="compress"]   { --app-grad: linear-gradient(135deg, #06b6d4, #0284c7); --app-glow: rgba(6, 182, 212, 0.45); }
.tool-card[data-tool="blur"]       { --app-grad: linear-gradient(135deg, #f43f5e, #db2777); --app-glow: rgba(244, 63, 94, 0.45); }
.tool-card[data-tool="exif"]       { --app-grad: linear-gradient(135deg, #14b8a6, #0d9488); --app-glow: rgba(20, 184, 166, 0.45); }
.tool-card[data-tool="qr"]         { --app-grad: linear-gradient(135deg, #38bdf8, #2563eb); --app-glow: rgba(37, 99, 235, 0.45); }
.tool-card[data-tool="mail-check"] { --app-grad: linear-gradient(135deg, #ef4444, #b91c1c); --app-glow: rgba(239, 68, 68, 0.45); }
.tool-card[data-tool="crypto"]     { --app-grad: linear-gradient(135deg, #8b5cf6, #4f46e5); --app-glow: rgba(124, 58, 237, 0.45); }
.tool-card[data-tool="crop"]       { --app-grad: linear-gradient(135deg, #f59e0b, #d97706); --app-glow: rgba(245, 158, 11, 0.45); }
.tool-card[data-tool="audio"]      { --app-grad: linear-gradient(135deg, #a855f7, #ec4899); --app-glow: rgba(192, 38, 211, 0.45); }
.tool-card[data-tool="video"]       { --app-grad: linear-gradient(135deg, #6366f1, #2563eb); --app-glow: rgba(99, 102, 241, 0.45); }
.tool-card[data-tool="pdf-to-img"]  { --app-grad: linear-gradient(135deg, #f97316, #ec4899); --app-glow: rgba(249, 115, 22, 0.45); }
.tool-card[data-tool="doc-scanner"] { --app-grad: linear-gradient(135deg, #0ea5e9, #10b981); --app-glow: rgba(14, 165, 233, 0.45); }
.tool-card[data-tool="invoice"]     { --app-grad: linear-gradient(135deg, #10b981, #0d9488); --app-glow: rgba(16, 185, 129, 0.45); }
.tool-card[data-tool="word-counter"]{ --app-grad: linear-gradient(135deg, #8b5cf6, #06b6d4); --app-glow: rgba(139, 92, 246, 0.45); }
.tool-card[data-tool="gif-studio"]  { --app-grad: linear-gradient(135deg, #ec4899, #f59e0b); --app-glow: rgba(236, 72, 153, 0.48); }
.tool-card[data-tool="cv-builder"]  { --app-grad: linear-gradient(135deg, #0f766e, #0ea5e9); --app-glow: rgba(14, 165, 233, 0.48); }
.tool-card[data-tool="pdf-compress"]{ --app-grad: linear-gradient(135deg, #ef4444, #f97316); --app-glow: rgba(239, 68, 68, 0.48); }
.tool-card[data-tool="heic-convert"]{ --app-grad: linear-gradient(135deg, #3b82f6, #06b6d4); --app-glow: rgba(59, 130, 246, 0.48); }
.tool-card[data-tool="receipt-doc"] { --app-grad: linear-gradient(135deg, #059669, #14b8a6); --app-glow: rgba(5, 150, 105, 0.48); }
.tool-card[data-tool="bg-remover"]  { --app-grad: linear-gradient(135deg, #9333ea, #f43f5e); --app-glow: rgba(147, 51, 234, 0.48); }
.tool-card[data-tool="photo-studio"]{ --app-grad: linear-gradient(135deg, #2563eb, #06b6d4); --app-glow: rgba(37, 99, 235, 0.5); }
.tool-card[data-tool="screen-rec"]  { --app-grad: linear-gradient(135deg, #f43f5e, #fb923c); --app-glow: rgba(244, 63, 94, 0.48); }
.tool-card[data-tool="zip-tool"]    { --app-grad: linear-gradient(135deg, #f59e0b, #eab308); --app-glow: rgba(245, 158, 11, 0.48); }
.tool-card[data-tool="collage"]     { --app-grad: linear-gradient(135deg, #ec4899, #8b5cf6); --app-glow: rgba(236, 72, 153, 0.48); }
.tool-card[data-tool="diff-tool"]   { --app-grad: linear-gradient(135deg, #0ea5e9, #4f46e5); --app-glow: rgba(14, 165, 233, 0.48); }
.tool-card[data-tool="link-cleaner"]{ --app-grad: linear-gradient(135deg, #10b981, #06b6d4); --app-glow: rgba(16, 185, 129, 0.48); }
.tool-card[data-tool="palette"]     { --app-grad: linear-gradient(135deg, #f97316, #db2777); --app-glow: rgba(249, 115, 22, 0.48); }
.tool-card[data-tool="ocr"]         { --app-grad: linear-gradient(135deg, #14b8a6, #2563eb); --app-glow: rgba(20, 184, 166, 0.48); }
.tool-card[data-tool="media-convert"]{ --app-grad: linear-gradient(135deg, #6366f1, #ec4899); --app-glow: rgba(99, 102, 241, 0.5); }
.tool-card[data-tool="pdf-text"]    { --app-grad: linear-gradient(135deg, #059669, #3b82f6); --app-glow: rgba(5, 150, 105, 0.48); }
.tool-card[data-tool="svg-favicon"] { --app-grad: linear-gradient(135deg, #f43f5e, #8b5cf6); --app-glow: rgba(244, 63, 94, 0.48); }
.tool-card[data-tool="csv-json"]    { --app-grad: linear-gradient(135deg, #0ea5e9, #10b981); --app-glow: rgba(14, 165, 233, 0.48); }
.tool-card[data-tool="special-chars"]{ --app-grad: linear-gradient(135deg, #f59e0b, #ef4444); --app-glow: rgba(245, 158, 11, 0.48); }
.tool-card[data-tool="pdf-unlock"]  { --app-grad: linear-gradient(135deg, #ef4444, #f97316); --app-glow: rgba(239, 68, 68, 0.48); }
.tool-card[data-tool="shot-mockup"] { --app-grad: linear-gradient(135deg, #8b5cf6, #ec4899); --app-glow: rgba(139, 92, 246, 0.48); }
.tool-card[data-tool="signature-png"]{ --app-grad: linear-gradient(135deg, #0f172a, #3b82f6); --app-glow: rgba(59, 130, 246, 0.48); }
.tool-card[data-tool="hardware-test"]{ --app-grad: linear-gradient(135deg, #06b6d4, #2563eb); --app-glow: rgba(6, 182, 212, 0.48); }
.tool-card[data-tool="speaker-water"]{ --app-grad: linear-gradient(135deg, #0284c7, #38bdf8); --app-glow: rgba(2, 132, 199, 0.48); }
.tool-card[data-tool="teleprompter"] { --app-grad: linear-gradient(135deg, #dc2626, #f59e0b); --app-glow: rgba(220, 38, 38, 0.48); }
.tool-card[data-tool="pfp-maker"]    { --app-grad: linear-gradient(135deg, #10b981, #0ea5e9); --app-glow: rgba(16, 185, 129, 0.48); }
.tool-card[data-tool="sms-mockup"]   { --app-grad: linear-gradient(135deg, #25d366, #007aff); --app-glow: rgba(37, 211, 102, 0.48); }

/* =========================================================================
   WORKSPACE VIEW
   ========================================================================= */
.workspace-view {
  display: none;
  padding: 22px 0 60px;
  animation: fadeUp 0.25s var(--ease);
}

.workspace-view.active { display: block; }
.home-view.hidden { display: none; }

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

.workspace-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.workspace-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.workspace-title h2 {
  font-family: var(--font-display);
  margin: 0;
  font-size: 1.48rem;
  letter-spacing: -0.02em;
}

.workspace-title p {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.workspace-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-md);
}

.workspace-panel.studio-mode {
  padding: 14px;
}

.split-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* =========================================================================
   DROPZONE & FORM CONTROLS
   ========================================================================= */
.dropzone {
  position: relative;
  border: 2px dashed rgba(16, 185, 129, 0.45);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  background: rgba(16, 185, 129, 0.05);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.11);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 4px 0;
}

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

.controls-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.field label span.val {
  font-family: var(--font-mono);
  color: var(--accent-bright);
}

.input, .select, .textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}

.chip:hover, .chip.active {
  border-color: var(--accent);
  color: var(--accent-bright);
  background: var(--accent-soft);
}

.tabs {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  gap: 4px;
  margin-bottom: 16px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.preview-stage {
  background: var(--stage-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.preview-stage canvas {
  max-width: 100%;
  max-height: 540px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}

.preview-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.92rem;
  max-width: 380px;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.file-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.file-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-sub {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.savings-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.exif-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.exif-box {
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.exif-box .k {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  font-weight: 600;
}

.exif-box .v {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-top: 3px;
  word-break: break-word;
}

.exif-box.warn {
  border-color: rgba(217, 119, 6, 0.45);
  background: rgba(245, 158, 11, 0.1);
}

.exif-box.safe {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.1);
}

.actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* =========================================================================
   PDF STUDIO PRO
   ========================================================================= */
.pdf-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}

.pdf-tool-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.pdf-tool-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-bright);
}

.pdf-toolbar-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 3px;
  flex-shrink: 0;
}

.pdf-canvas-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.pdf-canvas-wrap canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0;
  box-shadow: none;
}

.pdf-canvas-wrap canvas.overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.sig-drawer {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  border: 1px solid var(--accent);
}

.sig-pad-canvas {
  width: 100%;
  max-width: 460px;
  height: 150px;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  cursor: crosshair;
  touch-action: none;
  display: block;
}

.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s;
}

.color-swatch.active {
  border-color: var(--accent);
  transform: scale(1.16);
  box-shadow: 0 0 0 2px var(--bg-elevated);
}

.studio-shell { display: flex; flex-direction: column; gap: 10px; }

.studio-ribbon, .studio-tools-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.studio-tools-bar { justify-content: flex-start; gap: 6px; }
.studio-ribbon-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.studio-mobile-tabs { display: none; }

.studio-body {
  display: grid;
  grid-template-columns: 175px minmax(0, 1fr) 275px;
  gap: 12px;
  align-items: start;
}

.studio-thumbs, .studio-inspector {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  max-height: 740px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.studio-thumbs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.thumb-card {
  padding: 7px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.thumb-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.thumb-card canvas {
  width: 100%;
  max-width: 124px;
  height: auto;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.thumb-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.thumb-actions { display: flex; gap: 3px; }

.thumb-mini-btn {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-muted);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  font-size: 0.72rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.thumb-mini-btn:hover { color: var(--text); border-color: var(--accent); }

.studio-viewport {
  background: var(--stage-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-height: 620px;
  max-height: 740px;
  overflow: auto;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
}

.inspector-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.inspector-section:last-child { border-bottom: none; padding-bottom: 0; }

.inspector-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-bright);
}

.stamp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.stamp-btn {
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px dashed var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.stamp-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-bright); }

.inline-text-editor {
  position: absolute;
  z-index: 30;
  min-width: 130px;
  padding: 4px 7px;
  border: 2px solid var(--accent);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  outline: none;
  box-shadow: var(--shadow-md);
}

.search-bar-inline { display: flex; align-items: center; gap: 6px; }
.search-bar-inline input { width: 150px; padding: 6px 10px; font-size: 0.82rem; }

.pw-output {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  font-weight: 700;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--accent-bright);
  word-break: break-all;
}

.strength-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
  overflow: hidden;
  margin-top: 8px;
}

body.theme-dark .strength-bar { background: rgba(255, 255, 255, 0.1); }

.strength-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #0ea5e9);
  transition: width 0.25s var(--ease);
}

/* =========================================================================
   OFFLINE PROOF, FAQ & FOOTER
   ========================================================================= */
.offline-proof {
  margin-bottom: 42px;
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(14, 165, 233, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.24);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.offline-proof h3 { font-family: var(--font-display); margin: 0 0 4px; font-size: 1.12rem; }
.offline-proof p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

.seo-faq { margin-bottom: 42px; }
.seo-faq h2 { font-family: var(--font-display); font-size: 1.3rem; margin: 0 0 14px; }

.faq-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.faq-item {
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.94rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--font-mono); color: var(--accent-bright); font-size: 1.15rem; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 10px 0 0; color: var(--text-muted); font-size: 0.88rem; }

.footer-seo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.footer-seo-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.83rem;
}

.footer-seo-links a:hover { color: var(--accent-bright); }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 36px;
  color: var(--text-dim);
  font-size: 0.84rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Mobile Dock hidden on desktop */
.mobile-bottom-nav { display: none; }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 95;
  padding: 12px 18px;
  border-radius: 14px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s var(--ease);
  max-width: calc(100vw - 32px);
}

.toast.show { transform: translateY(0); opacity: 1; }

/* =========================================================================
   RESPONSIVE TABLET & MOBILE APP LAUNCHER
   ========================================================================= */
@media (max-width: 1120px) {
  .tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .studio-body { grid-template-columns: 150px minmax(0, 1fr) 240px; }
}

@media (max-width: 900px) {
  .split-layout { grid-template-columns: 1fr; }
  .studio-mobile-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 4px;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    border: 1px solid var(--border);
  }
  .studio-body { grid-template-columns: 1fr; }
  .studio-body[data-mobile-pane="editor"] .studio-thumbs,
  .studio-body[data-mobile-pane="editor"] .studio-inspector { display: none; }
  .studio-body[data-mobile-pane="pages"] .studio-viewport,
  .studio-body[data-mobile-pane="pages"] .studio-inspector { display: none; }
  .studio-body[data-mobile-pane="props"] .studio-viewport,
  .studio-body[data-mobile-pane="props"] .studio-thumbs { display: none; }
  .studio-tools-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .studio-tools-bar::-webkit-scrollbar { display: none; }
  .studio-viewport { min-height: 430px; max-height: 68vh; padding: 10px; }
}

@media (max-width: 720px) {
  body { padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 18px); }
  .container { padding: 0 14px; }
  .header-inner { height: 60px; }
  #shareSiteBtn { display: none; }
  .status-pill { padding: 5px 10px; font-size: 0.72rem; }
  .hero { padding: 20px 0 14px; }
  .hero-kicker, .hero p.lead { display: none; }
  .hero h1 { font-size: 1.55rem; margin-bottom: 12px; }
  .telemetry-bar { border-radius: 16px; padding: 8px 12px; gap: 6px 14px; font-size: 0.76rem; }
  .catalog-controls { flex-direction: column; align-items: stretch; margin: 14px 0 16px; gap: 10px; }
  .catalog-search { flex: 1 1 auto; min-width: 0; }

  /* 3-Column Friendly Mobile App Launcher */
  .tools-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 10px;
    padding-bottom: 26px;
  }
  .tool-card, .tool-card.featured {
    grid-column: span 1;
    padding: 13px 6px 11px;
    border-radius: 22px;
    align-items: center;
    text-align: center;
    gap: 8px;
    background: var(--bg-card);
  }
  .tool-card-top { justify-content: center; width: 100%; }
  .tool-icon { width: 62px; height: 62px; border-radius: 18px; }
  .tool-icon svg { width: 29px; height: 29px; }
  .tool-card .tool-badge, .tool-card p, .tool-card .feature-tags, .tool-card .tool-card-footer { display: none; }
  .tool-card[data-tool="screen-rec"] { display: none !important; }
  .tool-card h3, .tool-card.featured h3 { font-size: 0.78rem; line-height: 1.22; font-weight: 600; }

  .faq-list, .exif-grid { grid-template-columns: 1fr; }
  .workspace-panel { padding: 16px; }
  .workspace-panel.studio-mode { padding: 10px; }
  .search-bar-inline { width: 100%; }
  .search-bar-inline input { flex: 1; width: auto; }
  .toast { bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 18px); left: 14px; right: 14px; text-align: center; }

  /* Floating Frosted-Glass Mobile Dock */
  .mobile-bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    padding: 7px 8px;
  }
  body.theme-dark .mobile-bottom-nav {
    background: rgba(15, 23, 42, 0.84);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  }
  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.18s;
  }
  .mobile-nav-btn svg { width: 20px; height: 20px; }
  .mobile-nav-btn.active {
    color: var(--accent-bright);
    background: var(--accent-soft);
  }
}
