/* ==========================================================================
   Creator Studio AI — Core stylesheet
   Theme tokens, layout, components. Pure CSS, no build step.
   ========================================================================== */

:root,
:root[data-theme="dark"] {
  --bg: #0a0a12;
  --bg-2: #10101b;
  --bg-3: #161624;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-3: rgba(255, 255, 255, 0.11);
  --surface-solid: #14141f;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f4fa;
  --text-2: #b4b4c8;
  --muted: #7d7d94;
  --primary: #8b5cf6;
  --primary-2: #a78bfa;
  --accent: #3b82f6;
  --cyan: #22d3ee;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
  --grad-soft: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(59, 130, 246, 0.14));
  --grad-text: linear-gradient(120deg, #c4b5fd 0%, #a78bfa 30%, #60a5fa 70%, #22d3ee 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);
  --glow: 0 0 0 1px rgba(139, 92, 246, 0.35), 0 10px 40px rgba(99, 102, 241, 0.25);
  --glass-blur: blur(16px) saturate(140%);
  --header-bg: rgba(10, 10, 18, 0.72);
  --input-bg: rgba(255, 255, 255, 0.05);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --header-h: 64px;
  --sidebar-w: 264px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Telugu", sans-serif;
  --font-display: "Poppins", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f5f5fb;
  --bg-2: #ffffff;
  --bg-3: #eef0f8;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-2: rgba(20, 20, 50, 0.04);
  --surface-3: rgba(20, 20, 50, 0.08);
  --surface-solid: #ffffff;
  --border: rgba(20, 20, 60, 0.1);
  --border-strong: rgba(20, 20, 60, 0.2);
  --text: #15151f;
  --text-2: #4a4a62;
  --muted: #74748c;
  --primary: #7c3aed;
  --primary-2: #6d28d9;
  --accent: #2563eb;
  --grad-text: linear-gradient(120deg, #7c3aed 0%, #6366f1 45%, #2563eb 100%);
  --shadow-sm: 0 2px 8px rgba(30, 30, 80, 0.06);
  --shadow: 0 10px 30px rgba(30, 30, 80, 0.08);
  --shadow-lg: 0 24px 60px rgba(30, 30, 80, 0.12);
  --glow: 0 0 0 1px rgba(124, 58, 237, 0.25), 0 10px 40px rgba(99, 102, 241, 0.15);
  --header-bg: rgba(255, 255, 255, 0.78);
  --input-bg: #ffffff;
  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 10% -10%, rgba(139, 92, 246, 0.16), transparent 60%),
    radial-gradient(800px 600px at 100% 0%, rgba(59, 130, 246, 0.12), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(34, 211, 238, 0.06), transparent 60%);
}
:root[data-theme="light"] body::before {
  background:
    radial-gradient(900px 600px at 10% -10%, rgba(139, 92, 246, 0.10), transparent 60%),
    radial-gradient(800px 600px at 100% 0%, rgba(59, 130, 246, 0.08), transparent 60%);
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: var(--primary-2); text-decoration: none; }
a:hover { color: var(--text); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 600; }
p { margin: 0 0 1em; color: var(--text-2); }
ul, ol { color: var(--text-2); }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
::selection { background: rgba(139, 92, 246, 0.35); }
:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 10px; }
.skip-link:focus { top: 12px; color: #fff; }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hidden, [hidden] { display: none !important; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: var(--header-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45); }
.brand-mark svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2.2; }
.brand small { font-size: 0.7rem; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: var(--grad-soft); color: var(--primary-2); margin-left: 2px; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 18px; }
.main-nav a { color: var(--text-2); font-size: 0.92rem; font-weight: 500; padding: 8px 12px; border-radius: 10px; transition: background 0.2s, color 0.2s; }
.main-nav a:hover { background: var(--surface-2); color: var(--text); }
.main-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; transition: background 0.2s, transform 0.2s, border-color 0.2s;
}
.icon-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(0.96); }
.menu-btn { display: none; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.app.no-sidebar { grid-template-columns: minmax(0, 1fr); }
.content { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; }
.container-narrow { max-width: 860px; margin: 0 auto; }
.section { padding: 72px 0; }
.section-sm { padding: 40px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.section-head p { font-size: 1.02rem; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary-2); margin-bottom: 12px; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: var(--header-h); align-self: start;
  height: calc(100vh - var(--header-h)); overflow-y: auto;
  border-right: 1px solid var(--border); background: var(--bg-2);
  padding: 18px 14px 40px; scrollbar-width: thin;
}
:root[data-theme="dark"] .sidebar { background: rgba(16, 16, 27, 0.6); }
.sidebar-mobile-nav { display: none; }
.sidebar-search { position: relative; margin-bottom: 14px; }
.sidebar-search input { padding-left: 36px; height: 38px; font-size: 0.88rem; }
.sidebar-search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.side-group { margin-bottom: 14px; }
.side-group h4 { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 10px 10px 6px; font-family: var(--font); font-weight: 600; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-size: 0.9rem; transition: background 0.2s, color 0.2s; }
.side-link .icon { width: 18px; height: 18px; color: var(--muted); transition: color 0.2s; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link:hover .icon { color: var(--primary-2); }
.side-link[aria-current="page"] { background: var(--grad-soft); color: var(--text); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.3); }
.side-link[aria-current="page"] .icon { color: var(--primary-2); }
.sidebar-backdrop { display: none; }

/* Sidebar as a drawer (pages without a fixed sidebar, and on mobile) */
.app.no-sidebar .sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; width: min(320px, 86vw);
  z-index: 300; transform: translateX(-105%); transition: transform 0.3s var(--ease);
  background: var(--surface-solid); box-shadow: var(--shadow-lg);
}
.drawer-head { display: none; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.app.no-sidebar .drawer-head { display: flex; }
body.nav-open .app .sidebar { transform: translateX(0); }
body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 250; backdrop-filter: blur(2px); }
.app.no-sidebar ~ .all-tools-fab, .all-tools-fab { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: 600 0.92rem/1 var(--font);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s, border-color 0.2s, opacity 0.2s;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35); }
.btn-primary:hover { color: #fff; background: var(--grad); box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5); transform: translateY(-1px); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-danger { color: #fca5a5; border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.08); }
:root[data-theme="light"] .btn-danger { color: #b91c1c; }
.btn-danger:hover { background: rgba(239, 68, 68, 0.16); border-color: rgba(239, 68, 68, 0.5); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 0.84rem; border-radius: 10px; gap: 6px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 0.78rem; border-radius: 8px; gap: 5px; }
.btn-xs .icon, .btn-sm .icon { width: 15px; height: 15px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn.is-copied { border-color: rgba(34, 197, 94, 0.5); color: var(--success); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Cards / glass ---------- */
.card, .glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-sm);
}
.card { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.08rem; }
.card-sub { font-size: 0.85rem; color: var(--muted); margin: 2px 0 0; }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.badge .icon { width: 13px; height: 13px; }
.badge-primary { background: var(--grad-soft); color: var(--primary-2); border-color: rgba(139, 92, 246, 0.3); }
.badge-success { background: rgba(34, 197, 94, 0.12); color: #4ade80; border-color: rgba(34, 197, 94, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
:root[data-theme="light"] .badge-success { color: #15803d; }
:root[data-theme="light"] .badge-warning { color: #b45309; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font: 500 0.85rem/1.2 var(--font); cursor: pointer; transition: all 0.2s;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.is-active, .chip[aria-pressed="true"] { background: var(--grad); color: #fff; border-color: transparent; }
.chip .count { font-size: 0.72rem; opacity: 0.75; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 0.84rem; font-weight: 600; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field .hint { font-size: 0.78rem; color: var(--muted); }
.field .error-msg { font-size: 0.78rem; color: var(--danger); display: none; }
.field.has-error .error-msg { display: block; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--input-bg); color: var(--text);
  font: 400 0.95rem/1.4 var(--font); transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.textarea { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239a9ab0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.select option, .select optgroup { background: var(--surface-solid); color: var(--text); }
.input-sm, .select-sm { height: 36px; font-size: 0.86rem; border-radius: 10px; padding: 0 10px; }
.select-sm { padding-right: 30px; background-position: right 8px center; }
input[type="color"] { -webkit-appearance: none; appearance: none; width: 44px; height: 36px; padding: 3px; border-radius: 10px; border: 1px solid var(--border); background: var(--input-bg); cursor: pointer; flex: none; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 7px; }
input[type="color"]::-moz-color-swatch { border: none; border-radius: 7px; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: var(--surface-3); outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.9rem; color: var(--text-2); user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.input-group { display: flex; gap: 8px; align-items: center; }
.input-group .input { flex: 1; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row output, .range-val { min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 0.85rem; }
.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; color: var(--text-2); font: 600 0.84rem/1 var(--font); padding: 9px 14px; border-radius: 9px; cursor: pointer; transition: all 0.2s; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"], .segmented button.is-active { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35); }

/* ---------- Page hero (tool pages) ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--muted); margin-bottom: 18px; list-style: none; padding: 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; opacity: 0.6; }
.page-hero { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 28px; }
.page-hero .hero-icon { width: 56px; height: 56px; flex: none; border-radius: 16px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4); }
.page-hero .hero-icon .icon { width: 28px; height: 28px; color: #fff; }
.page-hero h1 { margin-bottom: 6px; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.page-hero p { margin: 0 0 12px; max-width: 760px; }
.page-hero .chips { gap: 6px; }

/* ---------- Tool layout ---------- */
.tool-grid { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 22px; align-items: start; }
.tool-grid.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tool-grid > .card:first-child { position: sticky; top: calc(var(--header-h) + 20px); }
.tool-grid.no-sticky > .card:first-child { position: static; }
.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px;
  background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--text-2); font-size: 0.88rem; line-height: 1.5;
}
.notice .icon { color: var(--accent); margin-top: 1px; width: 18px; height: 18px; }
.notice strong { color: var(--text); }
.notice-warning { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.3); }
.notice-warning .icon { color: var(--warning); }
.notice-success { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.3); }
.notice-success .icon { color: var(--success); }
.notice p { margin: 0; }

/* Output blocks */
.output-list { display: flex; flex-direction: column; gap: 10px; }
.output-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border); transition: border-color 0.2s, transform 0.2s, background 0.2s;
  animation: fadeUp 0.35s var(--ease) both;
}
.output-item:hover { border-color: var(--border-strong); background: var(--surface-3); }
.output-item .out-text { flex: 1; min-width: 0; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.output-item .out-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 0.76rem; color: var(--muted); }
.output-item .num { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--grad-soft); color: var(--primary-2); display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; }
.char-ok { color: var(--success); }
.char-warn { color: var(--warning); }
.char-bad { color: var(--danger); }
.output-block { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.output-block h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 10px; font-family: var(--font); }
.output-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.output-head h3 { margin: 0; }
.gen-label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 600; color: var(--warning); background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.28); padding: 3px 9px; border-radius: 999px; }
:root[data-theme="light"] .gen-label { color: #b45309; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); }
.empty-state .empty-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; background: var(--grad-soft); display: grid; place-items: center; }
.empty-state .empty-icon .icon { width: 30px; height: 30px; color: var(--primary-2); }
.empty-state h3 { color: var(--text); margin-bottom: 6px; }
.empty-state p { margin: 0 auto; max-width: 380px; font-size: 0.9rem; }

/* Upload dropzone */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 36px 20px; border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface); text-align: center; cursor: pointer; transition: all 0.25s var(--ease);
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--primary); background: var(--grad-soft); }
.dropzone.is-dragover { transform: scale(1.01); }
.dropzone .dz-icon { width: 58px; height: 58px; border-radius: 16px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35); }
.dropzone .dz-icon .icon { color: #fff; width: 26px; height: 26px; }
.dropzone strong { font-size: 1rem; }
.dropzone span { color: var(--muted); font-size: 0.85rem; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone.compact { padding: 18px; flex-direction: row; gap: 14px; text-align: left; }
.dropzone.compact .dz-icon { width: 42px; height: 42px; border-radius: 12px; }
.dropzone.compact .dz-icon .icon { width: 20px; height: 20px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.stat .stat-label { font-size: 0.76rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat .stat-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; word-break: break-word; }
.stat .stat-note { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.stat.highlight { background: var(--grad-soft); border-color: rgba(139, 92, 246, 0.35); }
.stat.highlight .stat-value { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); }
table.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--surface-2); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table td { color: var(--text-2); }
.table td strong { color: var(--text); }

/* ---------- Tool cards ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px;
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border);
  color: var(--text); overflow: hidden; isolation: isolate;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.tool-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grad-soft); opacity: 0; transition: opacity 0.3s; }
.tool-card:hover { transform: translateY(-4px); border-color: rgba(139, 92, 246, 0.45); box-shadow: var(--glow); color: var(--text); }
.tool-card:hover::before { opacity: 1; }
.tool-card .tc-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid rgba(139, 92, 246, 0.25); transition: all 0.3s; }
.tool-card .tc-icon .icon { width: 22px; height: 22px; color: var(--primary-2); transition: color 0.3s; }
.tool-card:hover .tc-icon { background: var(--grad); border-color: transparent; transform: rotate(-6deg) scale(1.05); }
.tool-card:hover .tc-icon .icon { color: #fff; }
.tool-card h3 { margin: 4px 0 0; font-size: 1.02rem; }
.tool-card p { margin: 0; font-size: 0.87rem; color: var(--text-2); flex: 1; }
.tool-card .tc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.tool-card .tc-cat { font-size: 0.72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.tool-card .tc-open { display: inline-flex; align-items: center; gap: 6px; font-size: 0.84rem; font-weight: 600; color: var(--primary-2); }
.tool-card .tc-open .icon { width: 16px; height: 16px; transition: transform 0.25s; }
.tool-card:hover .tc-open .icon { transform: translateX(4px); }
.tools-toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.search-box { position: relative; flex: 1; min-width: 240px; max-width: 460px; }
.search-box .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .input { padding-left: 44px; height: 48px; border-radius: 14px; }
.result-count { font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }

/* Related tools */
.related { margin-top: 56px; }
.related .tools-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ---------- Home ---------- */
.hero { position: relative; padding: 70px 0 60px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); line-height: 1.05; margin-bottom: 18px; letter-spacing: -0.025em; }
.hero .lead { font-size: 1.12rem; max-width: 560px; margin-bottom: 28px; }
.hero-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 0.82rem; color: var(--text-2); margin-bottom: 22px; }
.hero-pill b { background: var(--grad); color: #fff; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 36px; }
.hero-facts div { display: flex; flex-direction: column; }
.hero-facts strong { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; }
.hero-facts span { font-size: 0.82rem; color: var(--muted); }
.hero-visual { position: relative; }
.mock-window { border-radius: 20px; overflow: hidden; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg), var(--glow); transform: perspective(1400px) rotateY(-8deg) rotateX(4deg); transition: transform 0.6s var(--ease); }
.hero-visual:hover .mock-window { transform: perspective(1400px) rotateY(-2deg) rotateX(1deg); }
.mock-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mock-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ef4444; }
.mock-bar i:nth-child(2) { background: #f59e0b; }
.mock-bar i:nth-child(3) { background: #22c55e; }
.mock-bar span { margin-left: 10px; font-size: 0.75rem; color: var(--muted); }
.mock-body { display: grid; grid-template-columns: 54px 1fr; }
.mock-tools { display: flex; flex-direction: column; gap: 10px; padding: 14px 10px; border-right: 1px solid var(--border); }
.mock-tools i { height: 32px; border-radius: 9px; background: var(--surface-3); }
.mock-tools i:first-child { background: var(--grad); }
.mock-canvas { padding: 18px; }
.mock-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #1e1b4b, #6d28d9 55%, #2563eb); display: flex; align-items: center; padding: 6%; }
.mock-thumb .mt-text { position: relative; z-index: 2; font-family: "Anton", "Bebas Neue", Impact, sans-serif; color: #fde047; font-size: clamp(1.4rem, 3.4vw, 2.6rem); line-height: 0.95; text-transform: uppercase; text-shadow: 0 4px 0 #000, 0 0 30px rgba(0, 0, 0, 0.5); -webkit-text-stroke: 1.5px #000; max-width: 58%; }
.mock-thumb .mt-text span { display: block; color: #fff; font-size: 0.62em; margin-top: 6px; }
.mock-thumb .mt-face { position: absolute; right: 6%; bottom: 0; width: 34%; aspect-ratio: 3 / 4; border-radius: 50% 50% 0 0; background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08)); border: 2px dashed rgba(255, 255, 255, 0.5); display: grid; place-items: center; color: rgba(255, 255, 255, 0.8); font-size: 0.72rem; }
.mock-thumb .mt-badge { position: absolute; top: 8%; right: 6%; z-index: 3; background: #ef4444; color: #fff; font: 800 0.72rem/1 var(--font-display); padding: 6px 10px; border-radius: 8px; transform: rotate(4deg); }
.mock-thumb .mt-arrow { position: absolute; left: 50%; bottom: 14%; width: 16%; z-index: 2; }
.mock-row { display: flex; gap: 10px; margin-top: 14px; }
.mock-row i { flex: 1; height: 46px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.mock-row i:nth-child(1) { background: linear-gradient(135deg, #052e16, #16a34a); }
.mock-row i:nth-child(2) { background: linear-gradient(135deg, #450a0a, #dc2626); }
.mock-row i:nth-child(3) { background: linear-gradient(135deg, #0c4a6e, #22d3ee); }
.mock-row i:nth-child(4) { background: linear-gradient(135deg, #fef3c7, #f59e0b); }
.float-chip { position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 0.82rem; font-weight: 600; animation: float 6s ease-in-out infinite; white-space: nowrap; }
.float-chip .icon { width: 16px; height: 16px; color: var(--primary-2); }
.float-chip.fc-1 { top: -18px; left: -22px; }
.float-chip.fc-2 { bottom: 40px; left: -36px; animation-delay: -2s; }
.float-chip.fc-3 { bottom: -18px; right: 10px; animation-delay: -4s; }
.featured-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature-card { position: relative; padding: 28px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; color: var(--text); display: flex; flex-direction: column; gap: 12px; transition: transform 0.35s var(--ease), box-shadow 0.35s, border-color 0.35s; }
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--glow); border-color: rgba(139, 92, 246, 0.45); color: var(--text); }
.feature-card .fc-art { height: 150px; border-radius: 14px; margin-bottom: 6px; position: relative; overflow: hidden; display: grid; place-items: center; }
.feature-card .fc-art.art-yt { background: linear-gradient(135deg, #312e81, #7c3aed 50%, #db2777); }
.feature-card .fc-art.art-ig { background: linear-gradient(135deg, #f97316, #db2777 45%, #7c3aed); }
.feature-card .fc-art.art-plan { background: linear-gradient(135deg, #0f172a, #1d4ed8 60%, #22d3ee); }
.feature-card .fc-art .icon { width: 54px; height: 54px; color: #fff; stroke-width: 1.6; filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.35)); transition: transform 0.4s var(--ease); }
.feature-card:hover .fc-art .icon { transform: scale(1.12) rotate(-4deg); }
.feature-card h3 { font-size: 1.2rem; margin: 0; }
.feature-card p { margin: 0; flex: 1; }
.feature-card ul { margin: 0; padding-left: 18px; font-size: 0.88rem; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.cat-tile { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: all 0.3s var(--ease); }
.cat-tile:hover { border-color: rgba(139, 92, 246, 0.45); transform: translateY(-3px); color: var(--text); background: var(--surface-2); }
.cat-tile .ct-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; flex: none; }
.cat-tile .ct-icon .icon { color: #fff; }
.cat-tile strong { display: block; font-size: 0.95rem; }
.cat-tile span { font-size: 0.8rem; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; counter-reset: step; }
.step { position: relative; padding: 28px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.step::before { counter-increment: step; content: "0" counter(step); position: absolute; top: 18px; right: 22px; font: 800 2.6rem/1 var(--font-display); background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: 0.5; }
.step .step-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--grad-soft); display: grid; place-items: center; margin-bottom: 16px; }
.step .step-icon .icon { color: var(--primary-2); }
.step p { margin: 0; }
.why-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.why { padding: 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); transition: border-color 0.3s, transform 0.3s var(--ease); }
.why:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.why .icon { width: 26px; height: 26px; color: var(--primary-2); margin-bottom: 14px; }
.why p { margin: 0; font-size: 0.9rem; }
.cta-band { position: relative; border-radius: 28px; padding: 56px 32px; text-align: center; overflow: hidden; background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(59, 130, 246, 0.2)); border: 1px solid rgba(139, 92, 246, 0.35); }
.cta-band h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.cta-band p { max-width: 560px; margin: 0 auto 24px; }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq details { border-radius: 16px; background: var(--surface); border: 1px solid var(--border); transition: border-color 0.2s, background 0.2s; }
.faq details[open] { border-color: rgba(139, 92, 246, 0.4); background: var(--surface-2); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary-2); transition: transform 0.25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-body { padding: 0 22px 18px; }
.faq .faq-body p { margin: 0; }

/* Prose pages */
.prose { max-width: 820px; }
.prose h2 { margin-top: 1.8em; font-size: 1.4rem; }
.prose h3 { margin-top: 1.4em; }
.prose li { margin-bottom: 0.4em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 56px 20px 28px; }
:root[data-theme="dark"] .site-footer { background: rgba(12, 12, 20, 0.85); }
.footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.footer-grid h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-family: var(--font); margin-bottom: 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-grid a { color: var(--text-2); font-size: 0.9rem; }
.footer-grid a:hover { color: var(--text); }
.footer-about p { font-size: 0.9rem; margin-top: 14px; max-width: 320px; }
.footer-bottom { max-width: 1200px; margin: 40px auto 0; padding-top: 22px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 0.84rem; color: var(--muted); }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; max-width: calc(100vw - 40px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: 0.9rem; color: var(--text); animation: toastIn 0.35s var(--ease) both; max-width: 380px; }
.toast .icon { width: 18px; height: 18px; }
.toast.success .icon { color: var(--success); }
.toast.error .icon { color: var(--danger); }
.toast.info .icon { color: var(--accent); }
.toast.is-leaving { animation: toastOut 0.3s var(--ease) forwards; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 900; background: rgba(5, 5, 12, 0.65); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fadeIn 0.2s both; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 22px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); animation: modalIn 0.3s var(--ease) both; }
.modal.modal-lg { width: min(900px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 1.1rem; margin: 0; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* ---------- Animations ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes spin { to { transform: rotate(360deg); } }
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: #fff; animation: spin 0.8s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Misc tool widgets ---------- */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; background: none; border: 0; color: var(--text-2); font: 500 0.74rem var(--mono); padding: 0; }
.swatch i { width: 54px; height: 54px; border-radius: 14px; border: 1px solid var(--border-strong); box-shadow: var(--shadow-sm); transition: transform 0.2s; }
.swatch:hover i { transform: translateY(-2px) scale(1.04); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 0.85rem; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; transition: all 0.2s; user-select: none; }
.tag-pill:hover { border-color: var(--border-strong); }
.tag-pill.is-off { opacity: 0.4; text-decoration: line-through; }
.tag-pill .x { opacity: 0.6; font-size: 0.9em; }
.preview-box { border-radius: 16px; border: 1px solid var(--border); background-color: var(--surface-2); background-image: linear-gradient(45deg, rgba(128, 128, 128, 0.12) 25%, transparent 25%), linear-gradient(-45deg, rgba(128, 128, 128, 0.12) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(128, 128, 128, 0.12) 75%), linear-gradient(-45deg, transparent 75%, rgba(128, 128, 128, 0.12) 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; display: grid; place-items: center; overflow: hidden; min-height: 240px; padding: 12px; }
.preview-box img, .preview-box canvas { max-height: 520px; width: auto; max-width: 100%; border-radius: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 0.88rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); font-variant-numeric: tabular-nums; }
.divider-label { display: flex; align-items: center; gap: 12px; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin: 6px 0; }
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }
