/* Imgvx stylesheet.
 *
 * One file, no build step, no framework. Everything below is driven by the
 * tokens in :root, so the dark theme is a second block of values rather than a
 * second set of rules.
 *
 * Light is the default on purpose: the OS preference is deliberately ignored so
 * the site looks the same to everybody until they press the theme button, and
 * an inline script in <head> applies their saved choice before first paint.
 */

/* ---------------------------------------------------------------- tokens -- */
:root {
  color-scheme: light;

  --bg: #ffffff;
  --bg-sunk: #f0f9ff;
  --surface: #ffffff;
  --surface-2: #f0fdfa;
  --fg: #0f172a;
  --fg-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;

  --accent: #8b5cf6; /* Modern Violet */
  --accent-hover: #7c3aed;
  --accent-soft: #f3e8ff;
  --accent-fg: #ffffff;
  

  --ok: #0a7a42;
  --ok-bg: #e9f7ef;
  --ok-line: #bde3cd;
  --ai: #6b3fd0;
  --ai-bg: #f2edfd;
  --ai-line: #d9ccf8;
  --warn: #8a5a00;
  --warn-bg: #fff6e3;
  --warn-line: #f0dcae;
  --danger: #b4231c;
  --danger-bg: #fdeceb;
  --danger-line: #f3c6c3;

  /* One spacing scale. Every gap on the page is a step on it. */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;

  --r1: 6px; --r2: 10px; --r3: 14px; --r4: 20px; --rp: 999px;

  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-2: 0 2px 4px rgba(16, 24, 40, .05), 0 6px 16px -6px rgba(16, 24, 40, .10);
  --shadow-3: 0 8px 28px -8px rgba(16, 24, 40, .18);

  --ease: cubic-bezier(.32, .72, .35, 1);
  --fast: 120ms var(--ease);
  --slow: 240ms var(--ease);

  --head-h: 60px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0f172a;
  --bg-sunk: #020617;
  --surface: #1e293b;
  --surface-2: #334155;
  --fg: #f8fafc;
  --fg-2: #cbd5e1;
  --muted: #94a3b8;
  --line: #334155;
  --line-strong: #475569;

  --accent: #a78bfa; /* Vibrant violet for dark mode */
  --accent-hover: #c4b5fd;
  --accent-soft: #2e1065;
  --accent-fg: #0f172a;
  

  --ok: #4ad68d;
  --ok-bg: #0f2a1d;
  --ok-line: #1d4a33;
  --ai: #b79bff;
  --ai-bg: #211a36;
  --ai-line: #3b2f5f;
  --warn: #f0c065;
  --warn-bg: #2c2312;
  --warn-line: #4a3c1c;
  --danger: #ff8a80;
  --danger-bg: #2c1614;
  --danger-line: #4d2722;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .45), 0 10px 24px -10px rgba(0, 0, 0, .6);
  --shadow-3: 0 12px 34px -10px rgba(0, 0, 0, .7);
}

/* ------------------------------------------------------------- structure -- */
* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.62 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 820px;
  margin: 0 auto;
  padding: var(--s6) var(--s4) var(--s8);
}
body.wide main { max-width: 1280px; }

h1, h2, h3 { line-height: 1.22; letter-spacing: -.018em; margin: 0 0 var(--s3); }
h1 { font-size: clamp(1.7rem, 1.25rem + 1.9vw, 2.4rem); font-weight: 750; }
h2 { font-size: 1.3rem; font-weight: 680; margin-top: var(--s6); }
h3 { font-size: 1.05rem; font-weight: 650; margin-top: var(--s5); }
p { margin: 0 0 var(--s3); }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r1);
}

.lede { font-size: 1.08rem; color: var(--fg-2); max-width: 62ch; margin-bottom: var(--s5); }
.note { font-size: .92rem; color: var(--muted); }
.note a { color: inherit; text-decoration: underline; }
.sep, .arrow { color: var(--muted); }

.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.22em; }

/* ---------------------------------------------------------------- header -- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  height: var(--head-h);
  padding: 0 var(--s4);
  max-width: 100%;
  box-sizing: border-box;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: -.02em;
  color: var(--fg);
  text-decoration: none;
  flex-shrink: 0;
}
.brandmark { color: var(--accent); width: 1.5em; height: 1.5em; }
.brand-logo {
  height: 32px;
  width: 32px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.site-head nav {
  display: flex;
  align-items: center;
  gap: var(--s1);
  flex-shrink: 0;
}
.site-head nav a {
  padding: var(--s2) var(--s3);
  border-radius: var(--r2);
  color: var(--fg-2);
  text-decoration: none;
  font-size: .94rem;
  font-weight: 550;
  transition: background var(--fast), color var(--fast);
  white-space: nowrap;
}
.site-head nav a:hover { background: var(--surface-2); color: var(--fg); }

.navlinks { display: flex; align-items: center; gap: var(--s1); }
.navlinks-admin, .navlinks-admin[hidden] { display: none; }
.menubtn {
  display: none;
  place-items: center;
  width: 38px; height: 38px;
  margin-left: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
}
.menubtn .i-close, .menubtn[aria-expanded="true"] .i-menu { display: none; }
.menubtn[aria-expanded="true"] .i-close { display: block; }

/* Phones and small tablets: the page links move into a menu under the
 * hamburger, so the header only holds the logo, account, theme and menu. */
@media (max-width: 720px) {
  .site-head { padding: 0 var(--s3); gap: var(--s2); }
  .site-head nav { gap: var(--s1); min-width: 0; }
  .menubtn { display: inline-grid; }
  .navlinks {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: var(--s2) var(--s3) var(--s3);
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .08);
  }
  .navlinks.open { display: flex; }
  .site-head nav .navlinks a { padding: 12px var(--s3); font-size: 1rem; }
  .navlinks-admin:not([hidden]) { display: block; color: var(--accent) !important; }
  .header-admin-badge { display: none !important; }
  .user-nav { margin-left: 0; }
  .user-email { display: none; }
  .user-pill { padding: 4px 7px; gap: 4px; }
  .btn-signin { padding: 6px 12px; font-size: .82rem; }
  .themebtn { width: 36px; height: 36px; margin-left: 0; }
  .menubtn { width: 36px; height: 36px; }
}

@media (max-width: 390px) {
  .site-head { padding: 0 10px; gap: 6px; }
  .site-head .brand { gap: 6px; }
  .brand-logo { height: 28px !important; width: 28px !important; }
  .site-head .brand span { font-size: .95rem; }
  .user-pill-chevron { display: none; }
  .themebtn, .menubtn { width: 34px; height: 34px; }
}

.themebtn {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  margin-left: var(--s2);
  border: 1px solid var(--line);
  border-radius: var(--rp);
  background: var(--surface);
  color: var(--fg-2);
  cursor: pointer;
  transition: border-color var(--fast), color var(--fast), transform var(--fast);
}
.themebtn:hover { border-color: var(--line-strong); color: var(--fg); }
.themebtn:active { transform: scale(.94); }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }

/* ---------------------------------------------------------------- footer -- */
.site-foot {
  border-top: 1px solid var(--line);
  margin-top: var(--s8);
  padding: var(--s6) var(--s4);
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  background: var(--bg-sunk);
}
.site-foot p { margin: 0 0 var(--s2); }
.site-foot a { color: var(--fg-2); }

/* --------------------------------------------------------------- badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.8rem;
  padding: 2.5px 8px;
  border-radius: var(--rp);
  border: 1px solid;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  flex: none;
  line-height: 1.25;
}
.b-free {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.08);
}
.b-ai {
  color: #7c3aed;
  background: #f5f3ff;
  border-color: #ddd6fe;
  box-shadow: 0 1px 2px rgba(124, 58, 237, 0.08);
}
.b-soon {
  color: var(--muted);
  background: var(--surface-2);
  border-color: var(--line);
}

:root[data-theme="dark"] .b-free {
  color: #34d399;
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: none;
}
:root[data-theme="dark"] .b-ai {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: none;
}

.legend { color: var(--muted); font-size: .86rem; margin: var(--s6) 0 var(--s4); }
.legend .badge { margin: 0 3px; vertical-align: baseline; }

/* --------------------------------------------------------------- cards ---- */
/* Every card grid is tinted from a single inherited hue, --h, set inline on the
 * section or list by build.mjs from the category's `tint`. It has to be used as
 * hsl(var(--h) ...) inside each rule rather than through an intermediate token:
 * a custom property whose value contains var() is substituted where it is
 * DECLARED, so a --tint-bg defined on :root would freeze at the root's hue and
 * every category would come out the same blue. */

.cats { display: grid; gap: var(--s7); }
.cat { min-width: 0; scroll-margin-top: calc(var(--head-h) + var(--s4)); }

/* ---------------------------------------------------------------- hero ---- */
.hero-wrapper {
  position: relative;
  padding: var(--s8) 0 var(--s6);
  text-align: center;
  overflow: hidden;
  border-radius: var(--r4);
  margin-bottom: var(--s7);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 100%);
  opacity: 0.8;
  z-index: -1;
  border-radius: var(--r4);
}
.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 850;
  line-height: 1.1;
  margin-bottom: var(--s4);
  background: linear-gradient(135deg, var(--accent) 0%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-title span {
  color: var(--fg);
  -webkit-text-fill-color: var(--fg);
}
:root[data-theme="dark"] .hero-title {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
:root[data-theme="dark"] .hero-title span {
  -webkit-text-fill-color: var(--fg);
}
.hero-wrapper .lede {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto;
  color: var(--fg-2);
}

/* Jump bar: eight pills, each in its own colour, so the category you want is
   one click away instead of four screens down. */
.catnav {
  display: flex; flex-wrap: wrap; gap: var(--s2);
  margin: 0 0 var(--s6); padding: 0; list-style: none;
}
.catnav a {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 7px var(--s3) 7px 10px;
  border: 1px solid var(--line); border-radius: var(--rp);
  background: var(--surface); color: var(--fg-2);
  text-decoration: none; font-size: .85rem; font-weight: 560; white-space: nowrap;
  transition: border-color var(--fast), background var(--fast), color var(--fast);
}
.catnav a .ic { width: 17px; height: 17px; color: hsl(var(--h, 214) 64% 42%); }
.catnav a:hover {
  border-color: hsl(var(--h, 214) 58% 72%);
  background: hsl(var(--h, 214) 88% 96%);
  color: var(--fg);
}

.cat-head {
  display: flex; align-items: flex-start; gap: var(--s3);
  margin-bottom: var(--s4); padding-bottom: var(--s3);
  border-bottom: 1px solid var(--line);
}
.cat-badge {
  display: grid; place-items: center; flex: none;
  width: 42px; height: 42px; border-radius: var(--r2);
  background: hsl(var(--h, 214) 88% 94%); color: hsl(var(--h, 214) 64% 38%);
}
.cat-badge .ic { width: 22px; height: 22px; }
.cat-title { flex: 1; min-width: 0; }
.cat-title h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.02em; line-height: 1.25; }
.cat-title h2 a { color: var(--fg); text-decoration: none; }
.cat-title h2 a:hover { color: hsl(var(--h, 214) 62% 40%); }
.cat-title p { margin: 3px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.cat-count {
  flex: none; margin-top: 3px;
  font-size: .68rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase;
  white-space: nowrap; padding: 4px var(--s3); border-radius: var(--rp);
  color: hsl(var(--h, 214) 52% 34%);
  background: hsl(var(--h, 214) 88% 95%);
  border: 1px solid hsl(var(--h, 214) 62% 87%);
}

section > h2 { display: flex; align-items: center; gap: var(--s2); font-size: 1.15rem; }
section > h2 a { color: var(--fg); text-decoration: none; display: inline-flex; align-items: center; gap: var(--s2); }
section > h2 a:hover { color: var(--accent); }
.h1-ic { color: hsl(var(--h, 214) 62% 42%); }
.more { margin-top: var(--s3); font-size: .9rem; }

.tcards {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--s3);
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
}
body.wide .tcards { grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); }

.tcard { min-width: 0; }
.tcard > a, .tcard .tc-inner {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  gap: var(--s2); text-align: center;
  padding: var(--s4) var(--s3) var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  height: 100%;
  box-shadow: var(--shadow-1);
  transition: border-color var(--fast), box-shadow var(--fast), transform var(--fast);
}
.tcard > a:hover {
  border-color: hsl(var(--h, 214) 60% 66%);
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}
.tcard > a:hover .tc-ic { transform: scale(1.07); }
.tc-ic {
  display: grid; place-items: center; flex: none;
  width: 46px; height: 46px;
  border-radius: var(--r2);
  background: hsl(var(--h, 214) 88% 94%);
  color: hsl(var(--h, 214) 64% 38%);
  transition: transform var(--fast);
}
.tc-ic .ic { width: 23px; height: 23px; }
.tc-name { font-weight: 650; font-size: .92rem; letter-spacing: -.01em; line-height: 1.3; }
/* Clamped to two lines so a long blurb cannot make one card in a row twice the
   height of its neighbours. */
.tc-blurb {
  color: var(--muted); font-size: .79rem; line-height: 1.42;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tcard .badge {
  position: absolute; top: 7px; right: 7px;
  min-width: 0; padding: 2px 7px; font-size: .60rem; font-weight: 800; letter-spacing: .05em; border-radius: var(--rp);
}
.tcard.is-soon .tc-inner { background: var(--surface-2); box-shadow: none; opacity: .74; }
.tcard.is-soon .tc-ic { background: var(--bg-sunk); color: var(--muted); }
.tcard.empty { color: var(--muted); font-size: .9rem; padding: var(--s3); }

:root[data-theme="dark"] .tc-ic,
:root[data-theme="dark"] .cat-badge {
  background: hsl(var(--h, 214) 38% 16%);
  color: hsl(var(--h, 214) 76% 70%);
}
:root[data-theme="dark"] .cat-count {
  color: hsl(var(--h, 214) 72% 70%);
  background: hsl(var(--h, 214) 36% 15%);
  border-color: hsl(var(--h, 214) 28% 27%);
}
:root[data-theme="dark"] .catnav a .ic { color: hsl(var(--h, 214) 74% 66%); }
:root[data-theme="dark"] .catnav a:hover {
  background: hsl(var(--h, 214) 34% 16%);
  border-color: hsl(var(--h, 214) 30% 32%);
}
:root[data-theme="dark"] .cat-title h2 a:hover,
:root[data-theme="dark"] .h1-ic { color: hsl(var(--h, 214) 74% 68%); }
:root[data-theme="dark"] .tcard > a:hover { 
  border-color: hsl(var(--h, 214) 70% 60%); 
  box-shadow: 0 4px 18px hsl(var(--h, 214) 70% 60% / 0.15), var(--shadow-2);
}

.wip { margin-top: var(--s4); }
.wip summary { cursor: pointer; color: var(--muted); font-size: .9rem; padding: var(--s2) 0; }
.wip[open] summary { margin-bottom: var(--s2); }

/* Phones. body.wide's 172px minimum leaves room for exactly one 343px card at
   375px, which turns sixty tools into sixty screens; 140px gives two columns
   with the gutters intact. The jump bar becomes a single scrolling row for the
   same reason - wrapped, eight pills cost four rows above the fold. */
@media (max-width: 560px) {
  .tcards, body.wide .tcards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s2); }
  .tcard > a, .tcard .tc-inner { padding: var(--s3) var(--s2) var(--s2); gap: 6px; }
  .tc-ic { width: 40px; height: 40px; }
  .tc-ic .ic { width: 20px; height: 20px; }
  .tc-name { font-size: .86rem; }
  .tc-blurb { font-size: .74rem; }
  .cats { gap: var(--s6); }
  .cat-badge { width: 36px; height: 36px; }
  .cat-title h2 { font-size: 1.08rem; }
  .catnav {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; padding-bottom: 2px; margin-bottom: var(--s5);
  }
  .catnav::-webkit-scrollbar { display: none; }
}

/* ---------------------------------------------------------- breadcrumbs --- */
.breadcrumbs ol {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1);
  list-style: none; margin: 0 0 var(--s3); padding: 0;
  font-size: .85rem; color: var(--muted);
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: var(--s1); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumbs .sep { opacity: .6; }
.breadcrumbs [aria-current] { color: var(--fg-2); }

.toolmark {
  display: flex; align-items: center; gap: var(--s2);
  font-size: .9rem; margin-bottom: var(--s3);
}
.toolmark-ic { color: var(--accent); }
.toolmark a { color: var(--fg-2); text-decoration: none; font-weight: 550; }
.toolmark a:hover { color: var(--accent); }

/* ------------------------------------------------------------ tool page --- */
/* The workbench is one grid. On a wide screen the controls sit beside the
 * result instead of above it, so a slider and the image it changes are visible
 * at the same time - the single biggest usability problem with the old layout
 * was scrolling away from the control to see what it did. */
.tool {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.tool > * {
  min-width: 0;
  width: 100%;
}

.tool-workbench {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  width: 100%;
  margin-bottom: var(--s5);
}

@media (min-width: 1040px) {
  body.tool-page main {
    max-width: 1200px;
  }
  .tool-workbench {
    display: grid;
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    gap: var(--s6);
    align-items: start;
  }
  .tool-workbench:has(> .result[hidden]) {
    grid-template-columns: 1fr;
  }
  .tool-panel {
    position: sticky;
    top: calc(var(--head-h) + var(--s4));
    display: flex;
    flex-direction: column;
    gap: var(--s4);
    min-width: 0;
    z-index: 10;
  }
  .tool-workbench > .result {
    margin-top: 0;
    min-width: 0;
  }
}

/* ------------------------------------------------------------- dropzone --- */
.dropzone {
  position: relative;
  display: block;
  padding: var(--s6) var(--s4);
  margin-bottom: var(--s4);
  border: 2px dashed var(--line-strong);
  border-radius: var(--r4);
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.2), 0 8px 10px -6px rgba(139, 92, 246, 0.1);
  transform: translateY(-2px);
}
.dropzone.over {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(139, 92, 246, 0.3), 0 8px 10px -6px rgba(139, 92, 246, 0.2);
}
.dropzone:focus-within { border-color: var(--accent); }
/* The native file input is the most dated-looking element a browser has, and
 * the whole panel is the click target anyway. */
.dropzone input[type=file] {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.dropzone p { margin: 0; font-weight: 550; color: var(--fg-2); }
.dropzone p + p { margin-top: var(--s2); font-weight: 400; }
.dropzone label { color: var(--accent); text-decoration: underline; cursor: pointer; }
.dropzone::before {
  content: "";
  display: block;
  width: 40px; height: 40px;
  margin: 0 auto var(--s3);
  border-radius: var(--r2);
  background: var(--accent-soft);
  color: var(--accent);
  /* An upload glyph, inlined so there is nothing extra to fetch. */
  -webkit-mask: center / 22px 22px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='M7 9l5-5 5 5M12 4v12'/%3E%3C/svg%3E");
          mask: center / 22px 22px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='M7 9l5-5 5 5M12 4v12'/%3E%3C/svg%3E");
  background-color: var(--accent);
}
.dropzone.has-file { padding: var(--s4); border-style: solid; border-color: var(--line); }
.dropzone.has-file::before { display: none; }

.picked {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: var(--s2) var(--s3);
  margin: var(--s3) 0 0 !important;
  font-size: .9rem;
}
.pk-name {
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--fg-2); font-weight: 550;
}
.pk-change {
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--fg-2); border-radius: var(--rp);
  padding: 5px var(--s3); font: inherit; font-size: .85rem; cursor: pointer;
  transition: border-color var(--fast), color var(--fast);
}
.pk-change:hover { border-color: var(--accent); color: var(--accent); }

/* ------------------------------------------------------------- controls --- */
.controls {
  display: grid;
  gap: var(--s3);
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  margin-bottom: var(--s4);
}
.controls > label {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px var(--s3);
  font-size: .88rem;
  font-weight: 550;
  color: var(--fg-2);
}
.controls > label > input[type=range] { grid-column: 1 / -1; }
.controls > label > output {
  grid-row: 1;
  grid-column: 2;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--fg);
  font-size: .86rem;
  min-width: 2.6em;
  text-align: right;
}
.controls > label.chk, .controls > label:has(> input[type=checkbox]) {
  grid-template-columns: auto 1fr;
  align-items: center;
}
.controls > label > input[type=checkbox] { grid-column: 1; margin: 0; }
.controls p.note { margin: 0; grid-column: 1 / -1; }

.controls input[type=number],
.controls input[type=text],
.controls select,
.controls textarea {
  grid-column: 1 / -1;
  width: 100%;
  padding: 9px var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r2);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: .92rem;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.controls input:focus, .controls select:focus, .controls textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.controls input[type=color] {
  grid-column: 2; grid-row: 1;
  width: 46px; height: 30px; padding: 2px;
  border: 1px solid var(--line-strong); border-radius: var(--r1);
  background: var(--bg); cursor: pointer;
}
.controls label.focus {
  padding: var(--s2) var(--s3);
  margin: calc(var(--s2) * -1) calc(var(--s3) * -1);
  border: 1px solid var(--accent);
  border-radius: var(--r2);
  background: var(--accent-soft);
}

/* Sliders. The primary interaction on this site was the least designed element
 * on it: a native range wrapped in a border, with no indication of where the
 * value sat along the track. */
.controls input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px;
  background: transparent; cursor: pointer; padding: 0; border: 0;
}
.controls input[type=range]::-webkit-slider-runnable-track {
  height: 5px; border-radius: var(--rp); background: var(--line);
}
.controls input[type=range]::-moz-range-track {
  height: 5px; border-radius: var(--rp); background: var(--line);
}
.controls input[type=range]::-moz-range-progress {
  height: 5px; border-radius: var(--rp); background: var(--accent);
}
.controls input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 17px; height: 17px; margin-top: -6px;
  border-radius: var(--rp);
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-1);
  transition: transform var(--fast);
}
.controls input[type=range]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: var(--rp);
  background: var(--accent); border: 2px solid var(--surface);
}
.controls input[type=range]:active::-webkit-slider-thumb { transform: scale(1.18); }
.controls input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }

/* --------------------------------------------------------------- result --- */
.result { margin-top: var(--s4); }
.preview {
  margin: 0 0 var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  overflow: hidden;
  background:
    conic-gradient(from 90deg at 50% 50%, #e9edf1 25%, #fff 0 50%, #e9edf1 0 75%, #fff 0) 0 0 / 18px 18px;
}
:root[data-theme="dark"] .preview {
  background: conic-gradient(from 90deg at 50% 50%, #1b2128 25%, #131820 0 50%, #1b2128 0 75%, #131820 0) 0 0 / 18px 18px;
}
.preview img, .result > img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}
.preview-inline {
  display: block; max-width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: var(--r2); margin-bottom: var(--s3);
}

.resultbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3);
  justify-content: space-between;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  margin-bottom: var(--s4);
}
.stats { margin: 0; font-size: .95rem; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.stats strong { color: var(--fg); }
.pill {
  display: inline-block; padding: 1px var(--s2); margin-left: var(--s1);
  border-radius: var(--rp); font-size: .78rem; font-weight: 650;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.pill.good { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }

.download {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px;
  padding: 10px var(--s6);
  border: 0; border-radius: var(--rp);
  background: linear-gradient(135deg, var(--accent) 0%, #ec4899 100%);
  color: #fff;
  font: inherit; font-weight: 700; font-size: .95rem;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 14px 0 rgba(139, 92, 246, 0.39);
  transition: all 0.3s ease;
}
.download:hover {
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.23);
  transform: translateY(-2px);
}
.download:active { transform: translateY(1px); }
.download[disabled] { opacity: .55; cursor: progress; }

/* ---------------------------------------------------- busy and failures --- */
.busy {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s5);
  border: 1px solid var(--line); border-radius: var(--r3);
  background: var(--surface-2); color: var(--fg-2);
}
.busy p { margin: 0; font-size: .95rem; }
.spinner {
  width: 20px; height: 20px; flex: none;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: var(--rp);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.errorcard {
  padding: var(--s4);
  border: 1px solid var(--danger-line);
  border-left: 3px solid var(--danger);
  border-radius: var(--r3);
  background: var(--danger-bg);
}
.err-title { margin: 0 0 var(--s1); font-weight: 650; color: var(--danger); }
.err-detail { margin: 0 0 var(--s2); font-size: .92rem; color: var(--fg-2); }
.err-hint { margin: 0; font-size: .9rem; color: var(--fg-2); }
.error { color: var(--danger); }

.warn {
  padding: var(--s3) var(--s4);
  margin-bottom: var(--s4);
  border: 1px solid var(--warn-line);
  border-left: 3px solid var(--warn);
  border-radius: var(--r2);
  background: var(--warn-bg);
  color: var(--warn);
  font-size: .92rem;
}

/* ------------------------------------------------------ AI runs --- */
.aiprog { align-items: flex-start; }
.aiprog-body { flex: 1; min-width: 0; }
.aiprog-t { color: var(--muted); font-variant-numeric: tabular-nums; }
.aibar { height: 6px; margin-top: var(--s2); border-radius: var(--rp); background: var(--line); overflow: hidden; }
.aibar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .2s linear; }

.aicmp {
  position: relative; width: 100%; max-height: 80vh; margin: 0 0 var(--s3);
  border: 1px solid var(--line); border-radius: var(--r3); overflow: hidden;
  background: var(--surface-2); line-height: 0;
}
.aicmp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.aicmp-before { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); }
.aicmp input[type=range] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; touch-action: pan-y;
}
.aicmp::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: var(--cmp, 50%); width: 2px;
  background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); pointer-events: none;
}
.aicmp-tag {
  position: absolute; top: var(--s2); padding: 2px 8px; border-radius: var(--rp);
  background: rgba(0, 0, 0, .55); color: #fff; font-size: .75rem; line-height: 1.6; pointer-events: none;
}
.aicmp-tag.l { left: var(--s2); }
.aicmp-tag.r { right: var(--s2); }
.aicmp.checker, .preview.checker {
  background: conic-gradient(from 90deg at 50% 50%, #e9edf1 25%, #fff 0 50%, #e9edf1 0 75%, #fff 0) 0 0 / 18px 18px;
}
:root[data-theme="dark"] .aicmp.checker, :root[data-theme="dark"] .preview.checker {
  background: conic-gradient(from 90deg at 50% 50%, #1b2128 25%, #131820 0 50%, #1b2128 0 75%, #131820 0) 0 0 / 18px 18px;
}

.aitext { margin-bottom: var(--s3); }
.aitext-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s1); }
.aitext textarea { width: 100%; }

/* ---------------------------------------------- interactive tool stages --- */
.stage {
  position: relative;
  display: block;
  width: 100%;
  line-height: 0;
  touch-action: none;
  border-radius: var(--r3);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.stage canvas { width: 100%; height: auto; display: block; }
.stage .overlay { position: absolute; inset: 0; pointer-events: none; }
.stage.picking { cursor: crosshair; }
/* What to do with the picture, on the picture. Fades on the first touch. */
.stage > .coach {
  position: absolute; top: 12px; left: 50%; z-index: 5; transform: translateX(-50%);
  display: flex; align-items: center; gap: 7px; max-width: calc(100% - 24px);
  padding: 8px 14px; border-radius: 999px; pointer-events: none;
  width: max-content; font-size: .84rem; font-weight: 650; line-height: 1.25; text-align: left; color: #fff;
  background: rgba(17, 17, 22, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 6px 20px -8px rgba(0, 0, 0, .6);
  animation: coach-in .3s ease-out, coach-pulse 2.4s ease-in-out .3s infinite;
  transition: opacity .25s ease, transform .25s ease;
}
.stage > .coach span { min-width: 0; }
.stage > .coach svg { flex: none; }
.stage > .coach.gone { opacity: 0; transform: translate(-50%, -6px); animation: none; }
@keyframes coach-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes coach-pulse { 0%, 100% { box-shadow: 0 6px 20px -8px rgba(0, 0, 0, .6), 0 0 0 0 rgba(182, 156, 255, .55); } 50% { box-shadow: 0 6px 20px -8px rgba(0, 0, 0, .6), 0 0 0 6px rgba(182, 156, 255, 0); } }
@media (prefers-reduced-motion: reduce) { .stage > .coach { animation: none; } }
.stage.checker {
  background: conic-gradient(from 90deg at 50% 50%, #e9edf1 25%, #fff 0 50%, #e9edf1 0 75%, #fff 0) 0 0 / 18px 18px;
}
:root[data-theme="dark"] .stage.checker {
  background: conic-gradient(from 90deg at 50% 50%, #1b2128 25%, #131820 0 50%, #1b2128 0 75%, #131820 0) 0 0 / 18px 18px;
}

.cropbox {
  position: absolute;
  border: 1px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45);
  cursor: move;
}
.cropbox .thirds {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, transparent 33.33%, rgba(255,255,255,.45) 33.33% 33.5%, transparent 33.5% 66.5%, rgba(255,255,255,.45) 66.5% 66.66%, transparent 66.66%),
    linear-gradient(to bottom, transparent 33.33%, rgba(255,255,255,.45) 33.33% 33.5%, transparent 33.5% 66.5%, rgba(255,255,255,.45) 66.5% 66.66%, transparent 66.66%);
  pointer-events: none;
}
.grip {
  position: absolute;
  width: 16px; height: 16px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .35);
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.g-nw { left: -8px; top: -8px; cursor: nwse-resize; }
.g-n  { left: calc(50% - 8px); top: -8px; cursor: ns-resize; }
.g-ne { right: -8px; top: -8px; cursor: nesw-resize; }
.g-e  { right: -8px; top: calc(50% - 8px); cursor: ew-resize; }
.g-se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.g-s  { left: calc(50% - 8px); bottom: -8px; cursor: ns-resize; }
.g-sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.g-w  { left: -8px; top: calc(50% - 8px); cursor: ew-resize; }

.btnrow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: var(--s4) 0; }
.btnrow .spacer { flex: 1 1 auto; }
.btnrow button:not(.download) {
  min-height: 38px;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r2);
  background: var(--surface);
  color: var(--fg-2);
  font: inherit; font-size: .9rem; cursor: pointer;
  transition: border-color var(--fast), color var(--fast);
}
.btnrow button:not(.download):hover:not([disabled]) { border-color: var(--accent); color: var(--accent); }
.btnrow button[disabled] { opacity: .45; cursor: not-allowed; }

.brushbar {
  display: grid; gap: var(--s3);
  padding: var(--s3);
  border: 1px solid var(--line); border-radius: var(--r3);
  background: var(--surface); box-shadow: var(--shadow-1);
  margin-bottom: var(--s3);
}
.toolpicker { display: flex; flex-wrap: wrap; gap: var(--s1); }
.tbtn {
  min-height: 38px;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line); border-radius: var(--r2);
  background: var(--surface-2); color: var(--fg-2);
  font: inherit; font-size: .88rem; font-weight: 550; cursor: pointer;
  transition: all var(--fast);
}
.tbtn:hover { border-color: var(--accent); color: var(--accent); }
.tbtn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.brushopts { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); align-items: center; }
.brushopts label { display: flex; align-items: center; gap: var(--s2); font-size: .86rem; color: var(--fg-2); }
.brushopts input[type=range] { width: 130px; }
.brushopts output { font-variant-numeric: tabular-nums; font-weight: 650; min-width: 2.2em; }
.brushopts input[type=color] { width: 38px; height: 28px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--r1); background: var(--bg); }

/* ------------------------------------------------------------- readouts --- */
.swatches, .tiles {
  list-style: none; padding: 0; margin: var(--s4) 0;
  display: grid; gap: var(--s3);
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.swatch { border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; background: var(--surface); }
.swatch .chip { height: 60px; }
.swatch .vals { padding: var(--s2); font-size: .78rem; line-height: 1.6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.swatch .share { color: var(--muted); }

.tiles li { display: flex; flex-direction: column; gap: var(--s2); }
.tiles img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r2); display: block; }
.tiles .download { padding: 6px var(--s3); font-size: .84rem; min-height: 34px; }

.meta, .spec {
  width: 100%; border-collapse: collapse; margin: var(--s4) 0; font-size: .92rem;
  border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden;
}
.meta th, .meta td, .spec th, .spec td {
  text-align: left; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); vertical-align: top;
}
.meta tr:last-child td, .meta tr:last-child th, .spec tr:last-child td, .spec tr:last-child th { border-bottom: 0; }
.meta th, .spec th { color: var(--muted); font-weight: 550; width: 40%; background: var(--surface-2); }
.spec caption { text-align: left; font-weight: 650; padding-bottom: var(--s2); }

.fieldlist { margin: var(--s3) 0; padding-left: var(--s5); font-size: .92rem; color: var(--fg-2); }
.fieldlist li { margin-bottom: var(--s1); }

.copybox {
  width: 100%;
  padding: var(--s3);
  border: 1px solid var(--line-strong); border-radius: var(--r2);
  background: var(--surface-2); color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem; line-height: 1.55; resize: vertical;
}
img.hist {
  width: 100%; max-width: 560px; height: auto;
  border: 1px solid var(--line); border-radius: var(--r2); background: #0d1117;
}

/* ----------------------------------------------------------------- FAQ ---- */
.faq { margin-top: var(--s6); }
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface);
  margin-bottom: var(--s2);
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: var(--s3) var(--s4);
  font-weight: 600;
  font-size: .96rem;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: var(--s3);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 1.25rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq .answer { padding: var(--s3) var(--s4); color: var(--fg-2); font-size: .94rem; }
.faq .answer p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------- guides ---- */
/* Long-form editorial. The tool pages are an interface; these are something to
   read, so the type gets more room and the measure is held near 70 characters -
   past that the eye loses the line on the way back. */
.guide { max-width: 68ch; }
.guide h2 { margin-top: var(--s7); padding-top: var(--s2); }
.guide h3 { margin-top: var(--s5); font-size: 1.06rem; font-weight: 650; }
.guide p { margin-bottom: var(--s4); color: var(--fg-2); }
.guide p.lede { color: var(--fg); font-size: 1.12rem; }
.guide ul, .guide ol { margin: 0 0 var(--s4); padding-left: var(--s5); color: var(--fg-2); }
.guide li { margin-bottom: var(--s2); }
.guide li:last-child { margin-bottom: 0; }
.guide strong { color: var(--fg); font-weight: 650; }
.guide code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  padding: 1px 5px;
  border-radius: var(--r1);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.guide .byline { color: var(--muted); font-size: .85rem; margin: calc(-1 * var(--s2)) 0 var(--s5); }

/* The comparison tables here are matrices, not the two-column key/value shape
   .spec was written for, so the 40% first column and the row-header colouring
   both have to be undone. */
.guide .spec { margin: 0 0 var(--s5); }
.guide .spec th { width: auto; }
.guide .spec th:first-child { text-align: left; }
.guide .spec tr:first-child th { color: var(--fg); font-weight: 650; text-align: left; }
.guide .spec td { text-align: left; }

/* Guide cards, on the index and at the foot of every guide. */
.gcards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
/* The index is a wide page and gets three across; the foot of a guide is inside
   a 68ch measure and gets two. */
body.wide .gcards { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.gcard a {
  display: flex; flex-direction: column; gap: 6px; height: 100%;
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  background: var(--surface);
  text-decoration: none;
  transition: border-color var(--fast), transform var(--fast);
}
.gcard a:hover { border-color: var(--accent); transform: translateY(-1px); }
.gcard .gc-title { color: var(--fg); font-weight: 650; line-height: 1.3; }
.gcard .gc-desc { color: var(--fg-2); font-size: .9rem; line-height: 1.45; }
.gcard .gc-date { color: var(--muted); font-size: .78rem; margin-top: auto; padding-top: var(--s2); }

@media (max-width: 560px) {
  /* A five-column matrix cannot fit a phone; let it scroll rather than wrap
     every cell onto four lines. */
  .guide .spec { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ---------------------------------------------------------------- gear ---- */
/* Affiliate block at the foot of a guide. Deliberately reads as an aside rather
   than as content: tinted, boxed, and labelled. Anything that could be mistaken
   for editorial recommendation is both dishonest and, for AdSense, dangerous. */
.gear {
  margin-top: var(--s7);
  padding: var(--s4) var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  background: var(--surface-2);
}
.gear h2 { margin-top: 0; font-size: 1.05rem; }
.gear ul { list-style: none; margin: 0; padding: 0; }
.gear li { display: flex; flex-direction: column; gap: 2px; padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.gear li:last-child { border-bottom: 0; padding-bottom: 0; }
.gear .amzn { font-weight: 620; }
.gear .amzn-note { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.gear .disclosure { margin: var(--s3) 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }

/* ------------------------------------------------------------- related ---- */
/* Sideways links out of the long tail. Visually quieter than the hub grids -
   this is a footnote to the tool, not the main event - but still real cards,
   because a row of bare text links reads as boilerplate and gets ignored. */
.crosslinks { margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--line); }
.crosslinks h2 { font-size: 1.05rem; margin-bottom: var(--s3); }
.crosslinks .tcards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.crosslinks .tcard .tc-blurb { display: none; }
@media (min-width: 640px) { .crosslinks .tcard .tc-blurb { display: block; } }

.related { margin-top: var(--s6); }
.related h2 { font-size: 1.05rem; margin-bottom: var(--s3); }
.related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.related a {
  display: inline-block;
  padding: 6px var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--rp);
  background: var(--surface);
  color: var(--fg-2);
  font-size: .87rem;
  text-decoration: none;
  transition: border-color var(--fast), color var(--fast);
}
.related a:hover { border-color: var(--accent); color: var(--accent); }

/* -------------------------------------------------------------- presets --- */
/* One scrolling row per group keeps a tool with 40+ presets from pushing the
   dropzone below the fold. min-width:0 stops the row widening the page. */
.presets { margin: 0 0 var(--s4); min-width: 0; }
.presets h2 { font-size: .95rem; margin: 0 0 var(--s2); }
.preset-group { display: flex; align-items: center; gap: var(--s2); min-width: 0; margin-bottom: var(--s2); }
.preset-group h3 { flex: none; font-size: .8rem; font-weight: 600; color: var(--muted); margin: 0; min-width: 7.5em; }
.preset-group ul {
  list-style: none; margin: 0; padding: 2px 0 6px; display: flex; gap: var(--s2);
  overflow-x: auto; min-width: 0; flex: 1; scrollbar-width: thin;
}
.presets .chip {
  display: inline-block; white-space: nowrap;
  padding: 5px var(--s3);
  border: 1px solid var(--line); border-radius: var(--rp);
  background: var(--surface); color: var(--fg-2);
  font-size: .85rem; text-decoration: none;
  transition: border-color var(--fast), color var(--fast);
}
.presets .chip:hover { border-color: var(--accent); color: var(--accent); }
.presets .chip[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
@media (max-width: 640px) {
  .preset-group { flex-direction: column; align-items: stretch; gap: var(--s1); }
}
.spec-table { margin-top: var(--s6); }
.spec-table h2 { font-size: 1.15rem; }
.table-scroll { overflow-x: auto; max-width: 100%; }
.spec-table .spec { width: 100%; }
.spec-table .spec th { width: auto; text-align: left; }
.spec-table .spec td { white-space: nowrap; }
.spec-table tr[aria-current] td, .spec-table a[aria-current] { font-weight: 650; color: var(--accent); }

/* -------------------------------------------------------------- pricing --- */
.packs { list-style: none; padding: 0; margin: var(--s4) 0; display: grid; gap: var(--s3); }
.packs li {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3);
  padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r3);
  background: var(--surface); box-shadow: var(--shadow-1);
}
.per { color: var(--muted); font-size: .88rem; flex: 1 1 auto; }
.buy {
  min-height: 40px; padding: var(--s2) var(--s5);
  border: 0; border-radius: var(--r2);
  background: var(--accent); color: var(--accent-fg);
  font: inherit; font-weight: 650; cursor: pointer;
}
.buy:hover { background: var(--accent-hover); }

/* ------------------------------------------------------------------ ads --- */
/* Reserving the height stops the page jumping under the pointer when the slot
 * fills, which used to happen directly above the dropzone people were aiming at. */
.ad { min-height: 100px; margin: var(--s5) 0; }
.ad:empty { display: none; }

/* ----------------------------------------------------------- responsive --- */
@media (max-width: 640px) {
  :root { --head-h: 54px; }
  main { padding: var(--s5) var(--s4) var(--s7); }
  .site-head { padding: 0 var(--s3); }
  .site-head nav a { padding: var(--s2); font-size: .88rem; }
  .cats { grid-template-columns: 1fr; }
  .dropzone { padding: var(--s5) var(--s3); }
  .resultbar { flex-direction: column; align-items: stretch; }
  .resultbar .download { width: 100%; }
  /* Comfortable touch targets: 30px controls are a miss on a phone. */
  .controls input[type=number], .controls input[type=text], .controls select { min-height: 44px; }
  .btnrow button:not(.download), .tbtn { min-height: 44px; }
  .grip { width: 22px; height: 22px; }
  .g-nw, .g-w, .g-sw { left: -11px; }
  .g-ne, .g-e, .g-se { right: -11px; }
  .g-nw, .g-n, .g-ne { top: -11px; }
  .g-sw, .g-s, .g-se { bottom: -11px; }
  .g-n, .g-s { left: calc(50% - 11px); }
  .g-e, .g-w { top: calc(50% - 11px); }
}

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

@media print {
  .site-head, .site-foot, .ad, .dropzone, .controls, .presets, .related, .crosslinks, .gear, .btnrow, .themebtn { display: none !important; }
  body { background: #fff; color: #000; }
  main { max-width: none; padding: 0; }
  .meta, .spec { border-color: #999; }
}

/* ----------------------------------------------------------- mxmob footer -- */
.mx-foot {
  background: #ffffff !important;
  color: #334155 !important;
  border-top: 1px solid #e2e8f0 !important;
  padding: 56px 20px 36px !important;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  text-align: left !important;
  margin-top: 60px !important;
  box-sizing: border-box !important;
}
.mx-foot * {
  box-sizing: border-box;
}
.mx-foot-wrap {
  max-width: 1240px;
  margin: 0 auto;
}

/* Top Row */
.mx-foot-top-row {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}
.mx-brand-block {
  flex: 0 0 320px;
  max-width: 340px;
}
.mx-brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.mx-brand-logo {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  border-radius: 10px !important;
  object-fit: cover !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  flex-shrink: 0;
}
.mx-brand-title-wrap {
  display: flex;
  flex-direction: column;
}
.mx-brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mx-brand-name {
  font-size: 1.45rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.mx-badge-pill {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 9999px;
  background: #ede9fe;
  color: #4338ca;
  text-transform: uppercase;
}
.mx-brand-sub {
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 500;
  margin-top: 2px;
}
.mx-brand-desc {
  font-size: 0.82rem;
  line-height: 1.55;
  color: #64748b;
  margin: 0 0 18px 0 !important;
}
.mx-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #3b52d4;
  color: #ffffff !important;
  padding: 10px 20px;
  border-radius: 9999px;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(59, 82, 212, 0.28);
  transition: background 0.15s ease, transform 0.15s ease;
}
.mx-cta-btn:hover {
  background: #2f43b3;
  transform: translateY(-1px);
  color: #ffffff !important;
}
.mx-cta-ic {
  flex-shrink: 0;
}

/* Links Grids */
.mx-top-links-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.mx-bottom-links-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
  width: 100%;
}

.mx-col {
  min-width: 0;
}
.mx-col-title {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.mx-col-title.mx-blue {
  color: #3b52d4; /* Top row: indigo/blue */
}
.mx-col-title.mx-orange {
  color: #ea580c; /* Bottom row: vibrant orange */
}
.mx-col-title.mx-gray {
  color: #475569; /* Company column: slate gray */
}

.mx-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.mx-list li {
  margin: 0 0 7px 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
.mx-list li::before {
  content: none !important;
  display: none !important;
}
.mx-list a {
  display: block;
  font-size: 0.82rem;
  color: #475569 !important;
  text-decoration: none !important;
  line-height: 1.4;
  transition: color 0.15s ease;
}
.mx-list a:hover {
  color: #0f172a !important;
  text-decoration: underline !important;
}
.mx-list a.mx-bold {
  font-weight: 700 !important;
  color: #1e293b !important;
}

/* Dividers */
.mx-hr {
  border: 0 !important;
  border-top: 1px solid #e2e8f0 !important;
  margin: 36px 0 !important;
  height: 0 !important;
}

/* SEO paragraph */
.mx-seo-block {
  font-size: 0.76rem;
  line-height: 1.65;
  color: #64748b;
  margin-bottom: 24px;
}
.mx-seo-block a {
  color: #3b52d4 !important;
  text-decoration: underline !important;
}

/* Bottom Row */
.mx-foot-bot-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.74rem;
  color: #94a3b8;
  padding-top: 4px;
}
.mx-foot-disclaimer {
  max-width: 600px;
}
.mx-foot-copy {
  white-space: nowrap;
}

/* Mobile: Exactly 2 Columns on Mobile screens as requested */
@media (max-width: 960px) {
  .mx-foot-top-row {
    flex-direction: column;
  }
  .mx-brand-block {
    flex: 1 1 100%;
    max-width: 100%;
    margin-bottom: 16px;
  }
  .mx-top-links-grid {
    width: 100%;
    grid-template-columns: repeat(4, 1fr);
  }
  .mx-bottom-links-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .mx-top-links-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px 16px !important;
  }
  .mx-bottom-links-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px 16px !important;
  }
  .mx-foot-bot-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .mx-foot-copy {
    white-space: normal;
  }
}

/* Dark mode overrides */
:root[data-theme="dark"] .mx-foot {
  background: #09090b !important;
  color: #cbd5e1 !important;
  border-top-color: #1e293b !important;
}
:root[data-theme="dark"] .mx-brand-name {
  color: #f8fafc !important;
}
:root[data-theme="dark"] .mx-brand-desc,
:root[data-theme="dark"] .mx-brand-sub,
:root[data-theme="dark"] .mx-seo-block {
  color: #94a3b8 !important;
}
:root[data-theme="dark"] .mx-badge-pill {
  background: #1e1b4b !important;
  color: #a5b4fc !important;
}
:root[data-theme="dark"] .mx-col-title.mx-blue {
  color: #818cf8 !important;
}
:root[data-theme="dark"] .mx-col-title.mx-orange {
  color: #fb923c !important;
}
:root[data-theme="dark"] .mx-col-title.mx-gray {
  color: #94a3b8 !important;
}
:root[data-theme="dark"] .mx-list a {
  color: #94a3b8 !important;
}
:root[data-theme="dark"] .mx-list a:hover {
  color: #f8fafc !important;
}
:root[data-theme="dark"] .mx-list a.mx-bold {
  color: #f1f5f9 !important;
}
:root[data-theme="dark"] .mx-hr {
  border-top-color: #1e293b !important;
}
:root[data-theme="dark"] .mx-seo-block a {
  color: #818cf8 !important;
}
:root[data-theme="dark"] .mx-foot-bot-bar {
  color: #64748b !important;
}


/* Modern Premium UI Overrides */
:root {
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 20px -5px hsl(var(--h, 214) 80% 50% / 0.4);
}

body {
  background: #fcfcfd;
}
:root[data-theme="dark"] body {
  background: #09090b;
}

/* Hero Section */
.hero-wrapper {
  position: relative;
  text-align: center;
  padding: 60px 20px 40px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  top: -50%;
  left: 50%;
  width: 800px;
  height: 400px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, rgba(236,72,153,0.15) 30%, rgba(255,255,255,0) 70%);
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
}
:root[data-theme="dark"] .hero-bg {
  background: radial-gradient(circle, rgba(99,102,241,0.25) 0%, rgba(236,72,153,0.25) 30%, rgba(9,9,11,0) 70%);
}
.hero-title {
  font-size: clamp(2.5rem, 4vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 24px;
  color: var(--fg);
}
.hero-title span {
  background: linear-gradient(135deg, #4f46e5, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-bottom: 0.1em;
}

/* Tool Cards */
.tcard > a, .tcard .tc-inner {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 16px;
}
.tcard > a:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: hsl(var(--h, 214) 80% 60%);
  box-shadow: var(--shadow-glow), var(--shadow-lg);
  background: var(--surface);
}
.tc-ic {
  background: transparent !important;
  color: hsl(var(--h, 214) 80% 55%) !important;
  transform-origin: center;
}
.tcard > a:hover .tc-ic {
  transform: scale(1.1) rotate(-3deg);
  color: hsl(var(--h, 214) 90% 45%) !important;
}
:root[data-theme="dark"] .tc-ic {
  color: hsl(var(--h, 214) 85% 70%) !important;
}

/* Badges */
.cat-badge {
  background: transparent !important;
  color: hsl(var(--h, 214) 85% 55%) !important;
}
:root[data-theme="dark"] .cat-badge {
  color: hsl(var(--h, 214) 90% 70%) !important;
}
.cat-title h2 {
  font-weight: 750;
}

/* -------------------------------------------------------- documentation --- */
.docs-page-wrap {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 var(--s2);
}

.docs-mobile-bar {
  display: flex;
  overflow-x: auto;
  gap: var(--s2);
  padding: var(--s2) 0 var(--s4);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--s3);
}
.docs-mobile-bar::-webkit-scrollbar { display: none; }

.docs-pill {
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--rp);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--fg-2);
  text-decoration: none;
  transition: all var(--fast);
}
.docs-pill:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.docs-container {
  display: block;
}

.docs-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .docs-mobile-bar { display: none; }
  .docs-container {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
  }
  .docs-sidebar {
    display: block;
    position: sticky;
    top: calc(var(--head-h) + 16px);
    max-height: calc(100vh - var(--head-h) - 32px);
    overflow-y: auto;
    padding-right: var(--s3);
    scrollbar-width: thin;
  }
}

.docs-nav-heading {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: var(--s3);
  padding-left: 8px;
}

.docs-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-nav-link {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--fg-2);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--r1);
  transition: all var(--fast);
}
.docs-nav-link:hover, .docs-nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.docs-nav-cat {
  margin-top: 10px;
}
.docs-nav-cat a {
  display: block;
  font-size: 0.8rem;
  font-weight: 750;
  color: var(--fg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 8px 2px 8px;
  text-decoration: none;
}
.docs-nav-cat a:hover {
  color: var(--accent);
}

.docs-nav-sub {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 10px 4px 18px;
  border-radius: var(--r1);
  transition: all var(--fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.docs-nav-sub:hover {
  color: var(--accent);
  background: var(--surface-2);
}

.docs-nav-sep {
  height: 1px;
  background: var(--line);
  margin: 8px 0;
}

/* Documentation Content */
.docs-content {
  min-width: 0;
}

.docs-tag {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: var(--s2);
}

.docs-h1 {
  font-size: clamp(2rem, 1.6rem + 2vw, 3rem);
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: var(--s4);
}

.docs-grad {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.docs-lede {
  font-size: 1.12rem;
  color: var(--fg-2);
  line-height: 1.65;
  max-width: 72ch;
  margin-bottom: var(--s5);
}

.docs-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-bottom: var(--s7);
}

.docs-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 650;
  padding: 10px 18px;
  border-radius: var(--r2);
  text-decoration: none;
  transition: all var(--fast);
}
.docs-btn.primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
}
.docs-btn.primary:hover {
  background: var(--accent-hover);
  color: #fff;
}
.docs-btn.secondary {
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--line);
}
.docs-btn.secondary:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}
.docs-btn.tertiary {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}
.docs-btn.tertiary:hover {
  color: var(--fg);
  background: var(--surface);
}
.docs-btn.large {
  font-size: 1.05rem;
  padding: 14px 28px;
}

/* Stats Grid */
.docs-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s3);
  margin-bottom: var(--s7);
}
@media (min-width: 768px) {
  .docs-stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.docs-stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: var(--s4);
  text-align: center;
  box-shadow: var(--shadow-1);
}
.docs-stat-num {
  font-size: 2.2rem;
  font-weight: 850;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 4px;
}
.docs-stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

/* Section Common */
.docs-section {
  margin-top: var(--s7);
  margin-bottom: var(--s7);
  scroll-margin-top: calc(var(--head-h) + 20px);
}
.docs-section > h2 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--s2);
}
.docs-section-lede {
  font-size: 1.02rem;
  color: var(--fg-2);
  margin-bottom: var(--s5);
  max-width: 70ch;
}

/* Capabilities Grid */
.docs-cap-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s4);
}
@media (min-width: 768px) {
  .docs-cap-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1200px) {
  .docs-cap-grid { grid-template-columns: repeat(3, 1fr); }
}

.docs-cap-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: var(--s5);
  box-shadow: var(--shadow-1);
  transition: all var(--fast);
}
.docs-cap-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
}
.docs-cap-ic {
  display: inline-block;
  font-size: 1.5rem;
  margin-bottom: var(--s3);
}
.docs-cap-card h4 {
  margin: 0 0 var(--s2);
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--fg);
}
.docs-cap-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--fg-2);
  line-height: 1.55;
}

/* Steps List */
.docs-steps-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s6);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.docs-steps-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--s4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: var(--s4);
}
.docs-step-badge {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.docs-step-body strong {
  display: block;
  font-size: 1rem;
  font-weight: 750;
  color: var(--fg);
  margin-bottom: 4px;
}
.docs-step-body p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--fg-2);
  line-height: 1.5;
}

/* Category Sections */
.docs-category-section {
  margin-top: var(--s8);
  scroll-margin-top: calc(var(--head-h) + 20px);
}
.docs-category-header {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--surface-2);
  border-left: 4px solid hsl(var(--h, 214) 80% 55%);
  border-radius: var(--r2);
  margin-bottom: var(--s5);
}
.docs-category-icon {
  font-size: 1.4rem;
  color: hsl(var(--h, 214) 80% 55%);
}
.docs-category-text h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--fg);
}
.docs-category-blurb {
  margin: 2px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Tool Cards */
.docs-category-tools {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}
.docs-tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: var(--s5);
  box-shadow: var(--shadow-1);
  scroll-margin-top: calc(var(--head-h) + 20px);
  transition: border-color var(--fast);
}
.docs-tool-card:hover {
  border-color: var(--line-strong);
}

.docs-tool-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s3);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--line);
}
.docs-tool-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s3);
}
.docs-tool-ic {
  width: 28px;
  height: 28px;
  color: var(--accent);
}
.docs-tool-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}
.docs-tool-title a {
  color: var(--fg);
  text-decoration: none;
}
.docs-tool-title a:hover {
  color: var(--accent);
}
.docs-tool-btn {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--r1);
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
  transition: all var(--fast);
}
.docs-tool-btn:hover {
  background: var(--accent);
  color: #fff;
}

.docs-tool-desc {
  font-size: 0.96rem;
  color: var(--fg-2);
  line-height: 1.6;
  margin-bottom: var(--s4);
}

/* Metadata Box for SEO */
.docs-meta-box {
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: var(--s3) var(--s4);
  margin-bottom: var(--s4);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.docs-meta-item {
  font-size: 0.82rem;
  line-height: 1.45;
}
.docs-meta-label {
  font-weight: 750;
  color: var(--muted);
  margin-right: 6px;
}
.docs-meta-val {
  color: var(--fg-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.docs-sub-block {
  margin-top: var(--s4);
  margin-bottom: var(--s4);
}
.docs-sub-block h4 {
  margin: 0 0 var(--s2);
  font-size: 0.95rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg);
}
.docs-sub-block p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--fg-2);
  line-height: 1.6;
}

/* Tables */
.docs-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  margin-top: var(--s2);
}
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}
.docs-table th, .docs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.docs-table th {
  background: var(--surface-2);
  font-weight: 750;
  color: var(--fg);
  white-space: nowrap;
}
.docs-table tr:last-child td {
  border-bottom: none;
}
.docs-table code {
  background: var(--bg-sunk);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
}

/* IO Grid */
.docs-io-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s3);
  margin: var(--s4) 0;
}
@media (min-width: 640px) {
  .docs-io-grid { grid-template-columns: 1fr 1fr; }
}
.docs-io-card {
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: var(--s3) var(--s4);
}
.docs-io-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 750;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.docs-io-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg);
}

/* Tip Box */
.docs-tip-box {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
  border-radius: var(--r2);
  padding: var(--s3) var(--s4);
  font-size: 0.88rem;
  color: var(--fg-2);
  line-height: 1.5;
}
.docs-tip-icon {
  width: 20px;
  height: 20px;
  color: var(--ok);
  flex-shrink: 0;
  margin-top: 1px;
}

/* Privacy Grid */
.docs-privacy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s4);
}
@media (min-width: 768px) {
  .docs-privacy-grid { grid-template-columns: 1fr 1fr; }
}
.docs-privacy-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: var(--s5);
  box-shadow: var(--shadow-1);
}
.docs-privacy-card h4 {
  margin: 0 0 var(--s2);
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--fg);
}
.docs-privacy-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--fg-2);
  line-height: 1.6;
}

/* FAQ */
.docs-faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.docs-faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: var(--s4) var(--s5);
  box-shadow: var(--shadow-1);
}
.docs-faq-q {
  margin: 0 0 var(--s2);
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--fg);
}
.docs-faq-a p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--fg-2);
  line-height: 1.65;
}

/* Footer CTA */
.docs-footer-cta {
  margin-top: var(--s8);
  padding: var(--s7) var(--s5);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r4);
  text-align: center;
}
.docs-footer-cta h2 {
  font-size: 1.8rem;
  font-weight: 850;
  margin: 0 0 var(--s2);
}
.docs-footer-cta p {
  font-size: 1.05rem;
  color: var(--fg-2);
  margin: 0 0 var(--s5);
}

/* ------------------------------------------------------------- toolmark --- */
.toolmark {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s2);
  font-size: .95rem;
  font-weight: 650;
}
.toolmark .badge {
  padding: 2.5px 8px;
  font-size: .65rem;
}
.toolmark a {
  color: var(--fg);
  text-decoration: none;
}
.toolmark a:hover {
  color: var(--accent);
}

/* -------------------------------------------------------- auth & user nav --- */
.user-nav {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  margin-left: var(--s1);
}

.btn-signin {
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--rp);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all var(--fast);
}

.btn-signin:hover {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 4px 10px;
  border-radius: var(--rp);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color var(--fast), background var(--fast);
}

.user-pill:hover {
  border-color: var(--accent);
  background: var(--bg-sunk);
}

.user-email {
  font-weight: 650;
  color: var(--fg);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-credits-badge {
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 2px 7px;
  border-radius: var(--rp);
  letter-spacing: 0.02em;
}

.btn-signout {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 6px;
  text-decoration: underline;
  transition: color var(--fast);
}

.btn-signout:hover {
  color: var(--danger);
}

/* ------------------------------------------------- user dropdown menu --- */
.user-pill-wrap {
  position: relative;
  display: inline-flex;
}

.user-pill-chevron {
  margin-left: 2px;
  opacity: 0.5;
  transition: transform var(--fast);
}

.user-avatar-sm {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-avatar-img-sm {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-avatar-init-sm {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #8b5cf6, #d946ef);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: 50%;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r3);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  z-index: 1000;
  padding: 4px;
  animation: dropdownPop 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-dropdown[hidden] {
  display: none !important;
}

@keyframes dropdownPop {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 550;
  color: var(--fg);
  background: none;
  border: none;
  border-radius: var(--r2);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--fast);
  text-align: left;
}

.user-dropdown-item:hover {
  background: var(--bg-sunk);
}

.user-dropdown-item svg {
  color: var(--muted);
  flex-shrink: 0;
}

.user-dropdown-logout {
  color: var(--danger);
}

.user-dropdown-logout svg {
  color: var(--danger);
}

.user-dropdown-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 8px;
}

/* ------------------------------------------- account settings modal --- */
.account-settings-card {
  max-width: 460px;
}

.acct-header {
  text-align: center;
  margin-bottom: var(--s5);
}

.acct-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--s3);
}

.acct-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 8px;
  overflow: hidden;
  background: var(--surface-2);
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.acct-avatar-initials {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #8b5cf6, #d946ef);
  border-radius: 50%;
}

.acct-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.acct-avatar-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.acct-btn-avatar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--fg);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--rp);
  cursor: pointer;
  transition: all var(--fast);
}

.acct-btn-avatar:hover {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.acct-btn-avatar-remove {
  background: none;
  border: none;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--danger);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--rp);
  transition: opacity var(--fast);
}

.acct-btn-avatar-remove:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.acct-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--fg);
  margin: 0 0 4px;
}

.acct-subtitle {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}

.acct-section {
  margin-bottom: var(--s4);
}

.acct-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--fg-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.acct-input-row {
  display: flex;
  gap: 8px;
}

.acct-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface);
  color: var(--fg);
  outline: none;
  transition: border-color var(--fast);
}

.acct-input:focus {
  border-color: var(--accent);
}

.acct-btn-save {
  padding: 8px 16px;
  font-size: 0.84rem;
  font-weight: 700;
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: var(--r2);
  cursor: pointer;
  transition: opacity var(--fast);
  white-space: nowrap;
}

.acct-btn-save:hover {
  opacity: 0.9;
}

.acct-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.acct-email-readonly {
  font-size: 0.9rem;
  color: var(--fg);
  margin: 0;
  padding: 8px 12px;
  background: var(--bg-sunk);
  border-radius: var(--r2);
  border: 1px solid var(--line);
}

.acct-credits-display {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
  padding: 8px 12px;
  background: var(--accent-soft);
  border-radius: var(--r2);
  border: 1px solid var(--line);
}

.acct-status {
  font-size: 0.82rem;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: var(--r2);
}

.acct-status-success {
  color: #059669;
  background: #ecfdf5;
}

.acct-status-error {
  color: #dc2626;
  background: #fef2f2;
}

[data-theme="dark"] .acct-status-success {
  color: #34d399;
  background: rgba(5, 150, 105, 0.15);
}

[data-theme="dark"] .acct-status-error {
  color: #f87171;
  background: rgba(220, 38, 38, 0.15);
}

.acct-divider {
  height: 1px;
  background: var(--line);
  margin: var(--s4) 0;
}

.acct-btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--fg);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  cursor: pointer;
  transition: background var(--fast), border-color var(--fast);
}

.acct-btn-logout:hover {
  background: var(--bg-sunk);
  border-color: var(--fg-2);
}

.acct-danger-zone {
  padding: var(--s4);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--r3);
}

[data-theme="dark"] .acct-danger-zone {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.25);
}

.acct-danger-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #dc2626;
  margin: 0 0 4px;
}

.acct-danger-desc {
  font-size: 0.82rem;
  color: #991b1b;
  margin: 0 0 var(--s3);
  line-height: 1.5;
}

[data-theme="dark"] .acct-danger-desc {
  color: #fca5a5;
}

.acct-btn-delete {
  padding: 8px 16px;
  font-size: 0.84rem;
  font-weight: 700;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: var(--r2);
  cursor: pointer;
  transition: background var(--fast);
}

.acct-btn-delete:hover {
  background: #b91c1c;
}

.acct-delete-confirm {
  margin-top: var(--s3);
  padding: var(--s4);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--r3);
}

[data-theme="dark"] .acct-delete-confirm {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.25);
}

.acct-delete-warn {
  font-size: 0.85rem;
  color: #dc2626;
  margin: 0 0 var(--s3);
  line-height: 1.5;
}

[data-theme="dark"] .acct-delete-warn {
  color: #fca5a5;
}

.acct-btn-delete-final {
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: var(--r2);
  cursor: pointer;
  transition: background var(--fast);
  white-space: nowrap;
}

.acct-btn-delete-final:hover {
  background: #b91c1c;
}

.acct-btn-delete-final:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ----------------------------------------------------------------- modals --- */
body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s4);
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  background: var(--surface);
  color: var(--fg);
  border-radius: var(--r4);
  border: 1px solid var(--line-strong);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  max-width: 520px;
  width: 100%;
  position: relative;
  padding: var(--s6);
  max-height: 90vh;
  overflow-y: auto;
  animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-close {
  position: absolute;
  top: var(--s4);
  right: var(--s4);
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: var(--r1);
  transition: color var(--fast), background var(--fast);
}

.modal-close:hover {
  color: var(--fg);
  background: var(--bg-sunk);
}

/* Upgrade Modal */
.upgrade-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--rp);
  background: linear-gradient(135deg, #8b5cf6, #d946ef);
  color: #fff;
  margin-bottom: var(--s3);
}

.upgrade-title {
  font-size: 1.55rem;
  font-weight: 850;
  margin: 0 0 var(--s2);
  line-height: 1.25;
  color: var(--fg);
}

.upgrade-subtitle {
  font-size: 0.92rem;
  color: var(--fg-2);
  line-height: 1.55;
  margin: 0 0 var(--s5);
}

.upgrade-features-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: var(--s4) var(--s5);
  margin-bottom: var(--s5);
}

.upgrade-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.upgrade-features-list li {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  font-size: 0.88rem;
  color: var(--fg-2);
}

.upgrade-features-list li strong {
  color: var(--fg);
}

.feature-bullet {
  font-size: 1.15rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.upgrade-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  margin-bottom: var(--s3);
}

.modal-btn-primary {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 13px 20px;
  font-weight: 750;
  font-size: 1.02rem;
  border-radius: var(--r2);
  border: none;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
  cursor: pointer;
  transition: transform var(--fast), box-shadow var(--fast);
}

.modal-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
}

.modal-btn-secondary {
  background: none;
  border: 1px solid var(--line);
  color: var(--fg-2);
  padding: 10px;
  font-weight: 650;
  font-size: 0.9rem;
  border-radius: var(--r2);
  cursor: pointer;
  transition: background var(--fast), border-color var(--fast);
}

.modal-btn-secondary:hover {
  background: var(--bg-sunk);
  border-color: var(--line-strong);
}

.upgrade-disclaimer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

/* Auth Modal */
.auth-header {
  text-align: center;
  margin-bottom: var(--s4);
}

.auth-logo {
  border-radius: var(--r2);
  object-fit: cover;
  margin-bottom: var(--s2);
}

.auth-title {
  font-size: 1.45rem;
  font-weight: 850;
  margin: 0 0 var(--s1);
  color: var(--fg);
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-sunk);
  padding: 4px;
  border-radius: var(--r2);
  margin-bottom: var(--s4);
}

.auth-tab {
  flex: 1;
  padding: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  background: none;
  border: none;
  border-radius: var(--r1);
  color: var(--muted);
  cursor: pointer;
  transition: all var(--fast);
}

.auth-tab.active {
  background: var(--surface);
  color: var(--fg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.auth-social {
  margin-bottom: var(--s4);
}

.btn-social-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--r2);
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--fg);
  cursor: pointer;
  transition: background var(--fast), border-color var(--fast);
}

.btn-social-google:hover {
  background: var(--bg-sunk);
  border-color: var(--muted);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: var(--s4) 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--line);
}

.auth-divider span {
  padding: 0 10px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.auth-field label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--fg-2);
}

.auth-field input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--fg);
  transition: border-color var(--fast), box-shadow var(--fast);
}

.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-alerts-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--s3);
}

.auth-alert {
  padding: 10px 14px;
  border-radius: var(--r2);
  font-size: 0.85rem;
  line-height: 1.45;
  font-weight: 550;
  text-align: left;
}

.auth-alert[hidden] {
  display: none !important;
}

/* Cloudflare Turnstile; empty until Cloudflare wants a click. */
.auth-ts:empty { display: none; }
.auth-ts { display: flex; justify-content: center; margin-bottom: var(--s3); }

.auth-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #dc2626;
}

[data-theme="dark"] .auth-error {
  color: #f87171;
}

.auth-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #059669;
}

[data-theme="dark"] .auth-success {
  color: #34d399;
}

.auth-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-forgot-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  padding: 0;
  transition: opacity var(--fast);
}

.btn-forgot-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap input {
  width: 100%;
  padding-right: 42px;
}

.btn-toggle-pass {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r1);
  transition: color var(--fast);
}

.btn-toggle-pass:hover {
  color: var(--fg);
}

.btn-auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  font-weight: 750;
  font-size: 0.98rem;
  border: none;
  border-radius: var(--r2);
  background: var(--accent);
  color: var(--accent-fg);
  cursor: pointer;
  transition: background var(--fast), opacity var(--fast);
  margin-top: 4px;
}

.btn-auth-submit:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-auth-submit:disabled,
.btn-social-google:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.auth-reset-switch {
  text-align: center;
  margin-top: var(--s2);
}

.btn-back-signin {
  background: none;
  border: none;
  color: var(--fg-2);
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
  padding: 4px 8px;
  transition: color var(--fast);
}

.btn-back-signin:hover {
  color: var(--accent);
}

.auth-spin-icon {
  animation: authSpin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

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

.auth-footer {
  margin-top: var(--s4);
  text-align: center;
}

.auth-legal {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
}

.auth-legal a {
  color: var(--muted);
  text-decoration: underline;
}

/* Upgrade Banner Prompt in Tool Results */
.upgrade-banner-prompt {
  background: var(--surface-2);
  border: 2px dashed var(--accent);
  border-radius: var(--r3);
  padding: var(--s6) var(--s5);
  text-align: center;
  margin: var(--s4) 0;
}

.upgrade-banner-prompt h3 {
  margin: var(--s2) 0 var(--s2);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--fg);
}

.upgrade-banner-prompt p {
  color: var(--fg-2);
  font-size: 0.95rem;
  max-width: 520px;
  margin: 0 auto var(--s4);
  line-height: 1.55;
}

.upgrade-banner-prompt .ub-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--rp);
  background: linear-gradient(135deg, #8b5cf6, #d946ef);
  color: #fff;
  margin-bottom: var(--s2);
}

/* ------------------------------------------------------------- pricing page --- */
.pricing-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--s4) 0 var(--s8);
}

.pricing-head {
  text-align: center;
  margin-bottom: var(--s7);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s5);
  align-items: stretch;
  margin-bottom: var(--s7);
}

@media (max-width: 860px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
}

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r4);
  padding: var(--s6);
  box-shadow: var(--shadow-1);
  transition: transform var(--fast), box-shadow var(--fast), border-color var(--fast);
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
  border-color: var(--line-strong);
}

.pricing-card.popular {
  border: 2px solid var(--accent);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.15);
}

.pricing-badge-popular {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  padding: 4px 14px;
  border-radius: var(--rp);
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
  white-space: nowrap;
}

.pricing-badge-value {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  padding: 4px 14px;
  border-radius: var(--rp);
  white-space: nowrap;
}

.pricing-card-header {
  margin-bottom: var(--s5);
}

.pricing-card-header h3 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--fg);
}

.pricing-desc {
  font-size: 0.88rem;
  color: var(--muted);
  min-height: 42px;
  margin: 0 0 var(--s3);
  line-height: 1.5;
}

.pricing-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.pricing-amount {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--fg);
  line-height: 1;
}

.pricing-period {
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 600;
}

.pricing-unit {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: var(--rp);
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s6);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}

.pricing-features li {
  font-size: 0.88rem;
  color: var(--fg-2);
}

.btn-plan {
  width: 100%;
  padding: 13px;
  font-weight: 750;
  font-size: 0.98rem;
  border-radius: var(--r2);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  transition: all var(--fast);
}

.btn-plan:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-sunk);
}

.btn-plan.primary {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff !important;
  border: none;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.btn-plan.primary:hover {
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
  transform: translateY(-1px);
}

.pricing-sub-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r4);
  padding: var(--s6);
  margin-bottom: var(--s6);
}

.pricing-sub-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
}

.pricing-sub-content h3 {
  margin: 0 0 6px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--fg);
}

.pricing-sub-content p {
  margin: 0;
  color: var(--fg-2);
  font-size: 0.95rem;
  max-width: 580px;
  line-height: 1.55;
}

.pricing-sub-action {
  display: flex;
  align-items: center;
  gap: var(--s4);
  flex-shrink: 0;
}

.sub-price {
  font-size: 1.6rem;
  font-weight: 850;
  color: var(--fg);
}

.sub-price span {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
}

.pricing-guarantee {
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ----------------------------------------------------- header admin badge --- */
.header-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #ffffff !important;
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all var(--fast);
  white-space: nowrap;
}

.header-admin-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.55);
  filter: brightness(1.1);
  text-decoration: none;
  color: #ffffff !important;
}

.admin-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
  animation: adminDotPulse 2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes adminDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

/* ---------------------------------------------------------- admin console --- */
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--s5) var(--s4) var(--s8);
}

.admin-gate-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 55vh;
}

.admin-gate-card {
  max-width: 520px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r4);
  padding: var(--s6);
  text-align: center;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.2);
}

.admin-gate-shield {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(79, 70, 229, 0.15));
  color: #7c3aed;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--s4);
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.admin-gate-title {
  margin: 0 0 var(--s2);
  font-size: 1.6rem;
  font-weight: 850;
  color: var(--fg);
}

.admin-gate-desc {
  color: var(--fg-2);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 var(--s5);
}

.admin-code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: var(--rs);
  border: 1px solid var(--line);
  font-weight: 700;
  color: var(--accent);
}

.admin-gate-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.admin-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #ffffff;
  border: none;
  border-radius: var(--rp);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--fast);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

.admin-btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  color: #ffffff;
}

.admin-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--rp);
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--fast);
}

.admin-btn-secondary:hover {
  background: var(--bg-sunk);
  border-color: var(--fg-3);
  color: var(--fg);
}

.admin-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--rp);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--fast);
}

.admin-btn-danger:hover {
  background: #ef4444;
  color: #ffffff;
}

.admin-gate-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

/* Dashboard Header Row */
.admin-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--s4);
  padding-bottom: var(--s5);
  margin-bottom: var(--s5);
  border-bottom: 1px solid var(--line);
}

.admin-brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(124, 58, 237, 0.12);
  color: #8b5cf6;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.admin-page-h1 {
  font-size: 2rem;
  font-weight: 850;
  margin: 0 0 6px;
  color: var(--fg);
}

.admin-subtitle {
  color: var(--fg-2);
  font-size: 0.95rem;
  margin: 0;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

/* KPI Cards Grid */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s4);
  margin-bottom: var(--s6);
}

.admin-kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: var(--s4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s2);
}

.kpi-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 850;
  color: var(--fg);
  line-height: 1.1;
  margin-bottom: 6px;
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.trend-badge {
  font-weight: 800;
  color: #10b981;
}

.trend-text {
  color: var(--fg-2);
}

.kpi-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.status-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  display: inline-block;
  flex-shrink: 0;
}

/* Two-column layout */
.admin-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s5);
}

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

.admin-col {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: var(--s5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.admin-card-head {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.admin-card-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.admin-card-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--fg);
}

.admin-card-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--fg-2);
  line-height: 1.4;
}

/* Forms */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-form-group label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--fg);
}

.admin-input, .admin-textarea {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--rs);
  color: var(--fg);
  font-size: 0.9rem;
  font-family: inherit;
  box-sizing: border-box;
}

.admin-input:focus, .admin-textarea:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.admin-credit-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.preset-chip {
  padding: 8px 12px;
  border-radius: var(--rs);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--fast);
  text-align: center;
}

.preset-chip:hover {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
}

.preset-chip.active {
  background: #7c3aed;
  color: #ffffff;
  border-color: #7c3aed;
}

.admin-form-actions {
  display: flex;
  gap: var(--s3);
  flex-wrap: wrap;
}

.admin-alert {
  padding: 10px 14px;
  border-radius: var(--rs);
  font-size: 0.85rem;
  line-height: 1.45;
}

.admin-alert.success {
  background: rgba(16, 185, 129, 0.12);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .admin-alert.success {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.admin-alert.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.admin-alert.error {
  background: rgba(239, 68, 68, 0.12);
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Tables & Progress */
.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

.admin-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
}

.speed-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--rp);
  background: var(--surface-2);
  color: var(--fg-2);
}

.speed-pill.fast {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.table-progress {
  width: 90px;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.table-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #3b82f6);
  border-radius: 999px;
}

/* Health status list */
.admin-health-list {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.health-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--rs);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.health-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.health-info strong {
  font-size: 0.86rem;
  color: var(--fg);
}

.health-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.health-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--rp);
  text-transform: uppercase;
}

.health-badge.ok {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   SongUp AI Admin Command Center Styles (ImgVX)
   ========================================================================== */

.songup-dark-admin {
  background: #000000 !important;
  color: #ffffff !important;
}

.songup-dark-admin .admin-container {
  position: relative;
  min-height: 100vh;
  padding: 32px 16px 64px 16px;
  max-width: 1600px;
  margin: 0 auto;
}

.songup-ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.songup-ambient-bg .glow-purple {
  position: absolute;
  top: 0;
  left: 25%;
  width: 600px;
  height: 600px;
  background: rgba(168, 85, 247, 0.05);
  border-radius: 9999px;
  filter: blur(128px);
}

.songup-ambient-bg .glow-cyan {
  position: absolute;
  bottom: 0;
  right: 25%;
  width: 500px;
  height: 500px;
  background: rgba(6, 182, 212, 0.05);
  border-radius: 9999px;
  filter: blur(128px);
}

.admin-dashboard-wrap {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.admin-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-header-icon-badge {
  padding: 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.admin-page-h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.025em;
  color: #ffffff;
}

.admin-subtitle {
  font-size: 0.875rem;
  color: #71717a;
  margin: 2px 0 0 0;
}

.admin-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #a1a1aa;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* 8 KPI Cards Grid */
.songup-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 768px) {
  .songup-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1280px) {
  .songup-kpi-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

.songup-kpi-card {
  position: relative;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(24, 24, 27, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  transition: all 0.2s;
}

.songup-kpi-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.songup-kpi-card::before {
  content: '';
  position: absolute;
  top: -24px;
  right: -24px;
  width: 70px;
  height: 70px;
  background: var(--glow, rgba(255, 255, 255, 0.05));
  border-radius: 9999px;
  filter: blur(20px);
}

.kpi-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #71717a;
}

.kpi-num {
  font-size: 1.85rem;
  font-weight: 900;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.kpi-sub {
  font-size: 0.75rem;
  color: #52525b;
}

/* SongUp Sections */
.songup-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.songup-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.songup-sec-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.songup-sec-h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
}

.songup-sec-sub {
  font-size: 0.75rem;
  color: #71717a;
  margin: 2px 0 0 0;
}

/* Free Users Card */
.songup-free-users-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(24, 24, 27, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.free-users-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.free-users-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #27272a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.free-users-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #d4d4d8;
  margin: 0;
}

.free-users-desc {
  font-size: 0.75rem;
  color: #52525b;
  margin: 2px 0 0 0;
}

.free-users-right {
  text-align: right;
}

.free-users-count {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.free-users-pct {
  font-size: 0.65rem;
  color: #52525b;
  font-weight: 600;
  margin: 0;
}

/* 12 Plans Grid */
.songup-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.songup-plan-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(24, 24, 27, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.songup-plan-card.tier-starter {
  border-color: rgba(20, 184, 166, 0.2);
}

.songup-plan-card.tier-starter .plan-name {
  color: #2dd4bf;
}

.songup-plan-card.tier-growth {
  border-color: rgba(14, 165, 233, 0.2);
}

.songup-plan-card.tier-growth .plan-name {
  color: #38bdf8;
}

.songup-plan-card.tier-pro {
  border-color: rgba(139, 92, 246, 0.2);
}

.songup-plan-card.tier-pro .plan-name {
  color: #a78bfa;
}

.songup-plan-card.tier-vip {
  border-color: rgba(236, 72, 153, 0.2);
}

.songup-plan-card.tier-vip .plan-name {
  color: #f472b6;
}

.plan-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-name {
  font-size: 0.875rem;
  font-weight: 700;
}

.plan-cycle {
  font-size: 0.625rem;
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  color: #71717a;
  font-weight: 600;
}

.plan-price {
  font-size: 0.72rem;
  color: #52525b;
}

.plan-bottom {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
}

.plan-count {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.plan-unit {
  font-size: 0.65rem;
  color: #52525b;
}

/* 8 Neural Engine Cards */
.songup-engines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.songup-engine-card {
  position: relative;
  padding: 20px;
  border-radius: 16px;
  background: rgba(24, 24, 27, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.songup-engine-card::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 100px;
  height: 100px;
  background: var(--eng-glow, rgba(255, 255, 255, 0.05));
  border-radius: 9999px;
  filter: blur(30px);
}

.engine-top {
  display: flex;
  justify-content: flex-end;
}

.engine-tag {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.engine-name {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.engine-sub {
  font-size: 0.75rem;
  color: #71717a;
  margin: 0 0 8px 0;
}

.engine-count-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.engine-count {
  font-size: 1.6rem;
  font-weight: 900;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.engine-unit {
  font-size: 0.72rem;
  color: #52525b;
}

.engine-progress {
  height: 6px;
  width: 100%;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  margin-top: 4px;
}

.engine-bar {
  height: 100%;
  border-radius: 9999px;
}

/* Split Row */
.songup-split-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.songup-box {
  padding: 20px;
  border-radius: 16px;
  background: rgba(24, 24, 27, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.songup-box-h3 {
  font-size: 0.875rem;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
}

.songup-ministats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.ministat {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  text-align: center;
}

.ministat-num {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
}

.ministat-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  color: #71717a;
  letter-spacing: 0.05em;
}

.songup-ministats-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ministat-card {
  padding: 14px;
  border-radius: 12px;
  text-align: center;
}

.ministat-card.feedback {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.1);
}

.ministat-card.contacts {
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.ministat-card-num {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
}

.ministat-card-lbl {
  font-size: 0.625rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.05em;
}

/* Modules Grid */
.songup-modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.songup-module-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(24, 24, 27, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
  transition: all 0.2s;
}

.songup-module-card:hover {
  background: rgba(39, 39, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.songup-module-card.border-emerald:hover { border-color: rgba(16, 185, 129, 0.4); }
.songup-module-card.border-purple:hover { border-color: rgba(168, 85, 247, 0.4); }
.songup-module-card.border-green:hover { border-color: rgba(34, 197, 94, 0.4); }
.songup-module-card.border-indigo:hover { border-color: rgba(99, 102, 241, 0.4); }
.songup-module-card.border-amber:hover { border-color: rgba(245, 158, 11, 0.4); }
.songup-module-card.border-pink:hover { border-color: rgba(236, 72, 153, 0.4); }
.songup-module-card.border-rose:hover { border-color: rgba(244, 63, 94, 0.4); }
.songup-module-card.border-red:hover { border-color: rgba(239, 68, 68, 0.4); }
.songup-module-card.border-cyan:hover { border-color: rgba(6, 182, 212, 0.4); }

.module-icon {
  font-size: 1.25rem;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.module-info {
  flex: 1;
  min-width: 0;
}

.module-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-desc {
  font-size: 0.75rem;
  color: #71717a;
  margin: 2px 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-arrow {
  color: #52525b;
  font-size: 1.1rem;
  transition: transform 0.2s;
}

.songup-module-card:hover .module-arrow {
  color: #ffffff;
  transform: translateX(2px);
}

/* ------------------------------------------- Amazon Associates Styling --- */
.disclosure {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
  margin: var(--s3) 0 0;
  opacity: 0.85;
}

a.amzn {
  color: var(--accent);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}
a.amzn:hover {
  color: var(--accent-hover);
}

aside.gear {
  margin: var(--s6) 0;
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--r3);
  box-shadow: var(--shadow-1);
}
aside.gear h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 var(--s3);
}
aside.gear ul {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s3);
  display: grid;
  gap: var(--s3);
}
aside.gear li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
aside.gear li a {
  font-size: 0.96rem;
  font-weight: 650;
  color: var(--accent);
}
aside.gear .amzn-note {
  font-size: 0.86rem;
  color: var(--fg-2);
  line-height: 1.4;
}

/* Tool page contextual recommendation card */
aside.amzn-pick {
  margin: var(--s6) 0 var(--s4);
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--card-tint-border, var(--line));
  border-radius: var(--r3);
  box-shadow: var(--shadow-1);
  position: relative;
  overflow: hidden;
  transition: all var(--fast);
}
aside.amzn-pick::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-tint, var(--accent));
  opacity: 0.95;
}
aside.amzn-pick:hover {
  border-color: var(--card-tint, var(--accent));
  box-shadow: 0 8px 24px -4px var(--card-tint-soft, rgba(0, 0, 0, 0.12)), var(--shadow-2);
  transform: translateY(-2px);
}
.amzn-pick-head {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s3);
  flex-wrap: wrap;
}
.amzn-pick-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--card-tint-soft, var(--accent-soft));
  color: var(--card-cta-color, var(--accent));
  border: 1px solid var(--card-tint-border, transparent);
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: var(--rp);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.amzn-pick-for {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 550;
}
.amzn-pick-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
}
.amzn-pick-info {
  flex: 1;
  min-width: 0;
}
.amzn-pick-title {
  display: inline-block;
  font-size: 1.08rem;
  font-weight: 750;
  color: var(--fg);
  text-decoration: none;
  margin-bottom: var(--s1);
  transition: color var(--fast);
}
.amzn-pick-title:hover {
  color: var(--card-cta-color, var(--accent));
  text-decoration: underline;
}
.amzn-pick-note {
  font-size: 0.88rem;
  color: var(--fg-2);
  line-height: 1.5;
  margin-bottom: var(--s3);
}
.amzn-pick-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: var(--card-cta-bg, rgba(217, 119, 6, 0.12));
  color: var(--card-cta-color, #d97706);
  border: 1px solid var(--card-tint-border, transparent);
  font-size: 0.84rem;
  font-weight: 750;
  border-radius: var(--r2);
  text-decoration: none;
  transition: all var(--fast);
}
.amzn-pick-cta:hover {
  background: var(--card-cta-hover-bg, var(--accent));
  color: var(--card-cta-hover-color, #ffffff);
  border-color: transparent;
  transform: translateX(2px);
}

/* Inline article callouts */
aside.amzn-inline {
  margin: var(--s5) 0;
  padding: var(--s3) var(--s4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid #ff9900;
  border-radius: var(--r2);
  font-size: 0.92rem;
}
.amzn-inline-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #d97706;
  margin-bottom: var(--s1);
}
:root[data-theme="dark"] .amzn-inline-badge {
  color: #fbbf24;
}
.amzn-inline-content p {
  margin: 0 0 var(--s1);
  line-height: 1.5;
  color: var(--fg-2);
}
.amzn-inline-content strong a {
  color: var(--fg);
  font-weight: 700;
}
.amzn-inline-content strong a:hover {
  color: var(--accent);
}
.amzn-inline-cta {
  display: inline-block;
  font-weight: 650;
  color: var(--accent);
  margin-left: var(--s1);
  text-decoration: none;
  white-space: nowrap;
}
.amzn-inline-cta:hover {
  text-decoration: underline;
}
.amzn-inline-disc {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.85;
}

/* Horizontal product strips */
aside.amzn-strip {
  margin: var(--s6) 0 var(--s7);
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  box-shadow: var(--shadow-1);
}
aside.amzn-strip h2 {
  font-size: 1.12rem;
  font-weight: 700;
  margin: 0 0 var(--s4);
  color: var(--fg);
}
.amzn-strip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s3);
}
/* Dynamic Amazon Card Themes */
.amzn-theme-violet {
  --card-tint: #8b5cf6;
  --card-tint-soft: rgba(139, 92, 246, 0.12);
  --card-tint-border: rgba(139, 92, 246, 0.28);
  --card-cta-color: #6d28d9;
  --card-cta-bg: rgba(124, 58, 237, 0.12);
  --card-cta-hover-bg: #7c3aed;
  --card-cta-hover-color: #ffffff;
}
:root[data-theme="dark"] .amzn-theme-violet {
  --card-tint: #a78bfa;
  --card-tint-soft: rgba(167, 139, 250, 0.18);
  --card-tint-border: rgba(167, 139, 250, 0.35);
  --card-cta-color: #c4b5fd;
  --card-cta-bg: rgba(167, 139, 250, 0.16);
  --card-cta-hover-bg: #8b5cf6;
  --card-cta-hover-color: #0f172a;
}

.amzn-theme-emerald {
  --card-tint: #10b981;
  --card-tint-soft: rgba(16, 185, 129, 0.12);
  --card-tint-border: rgba(16, 185, 129, 0.28);
  --card-cta-color: #047857;
  --card-cta-bg: rgba(5, 150, 105, 0.12);
  --card-cta-hover-bg: #059669;
  --card-cta-hover-color: #ffffff;
}
:root[data-theme="dark"] .amzn-theme-emerald {
  --card-tint: #34d399;
  --card-tint-soft: rgba(52, 211, 153, 0.18);
  --card-tint-border: rgba(52, 211, 153, 0.35);
  --card-cta-color: #6ee7b7;
  --card-cta-bg: rgba(52, 211, 153, 0.16);
  --card-cta-hover-bg: #10b981;
  --card-cta-hover-color: #0f172a;
}

.amzn-theme-coral {
  --card-tint: #f43f5e;
  --card-tint-soft: rgba(244, 63, 94, 0.12);
  --card-tint-border: rgba(244, 63, 94, 0.28);
  --card-cta-color: #be123c;
  --card-cta-bg: rgba(225, 29, 72, 0.12);
  --card-cta-hover-bg: #e11d48;
  --card-cta-hover-color: #ffffff;
}
:root[data-theme="dark"] .amzn-theme-coral {
  --card-tint: #fb7185;
  --card-tint-soft: rgba(251, 113, 133, 0.18);
  --card-tint-border: rgba(251, 113, 133, 0.35);
  --card-cta-color: #fda4af;
  --card-cta-bg: rgba(251, 113, 133, 0.16);
  --card-cta-hover-bg: #f43f5e;
  --card-cta-hover-color: #0f172a;
}

.amzn-theme-amber {
  --card-tint: #f59e0b;
  --card-tint-soft: rgba(245, 158, 11, 0.12);
  --card-tint-border: rgba(245, 158, 11, 0.28);
  --card-cta-color: #b45309;
  --card-cta-bg: rgba(217, 119, 6, 0.12);
  --card-cta-hover-bg: #d97706;
  --card-cta-hover-color: #ffffff;
}
:root[data-theme="dark"] .amzn-theme-amber {
  --card-tint: #fbbf24;
  --card-tint-soft: rgba(251, 191, 36, 0.18);
  --card-tint-border: rgba(251, 191, 36, 0.35);
  --card-cta-color: #fde68a;
  --card-cta-bg: rgba(251, 191, 36, 0.16);
  --card-cta-hover-bg: #f59e0b;
  --card-cta-hover-color: #0f172a;
}

.amzn-theme-cyan {
  --card-tint: #06b6d4;
  --card-tint-soft: rgba(6, 182, 212, 0.12);
  --card-tint-border: rgba(6, 182, 212, 0.28);
  --card-cta-color: #0369a1;
  --card-cta-bg: rgba(2, 132, 199, 0.12);
  --card-cta-hover-bg: #0284c7;
  --card-cta-hover-color: #ffffff;
}
:root[data-theme="dark"] .amzn-theme-cyan {
  --card-tint: #38bdf8;
  --card-tint-soft: rgba(56, 189, 248, 0.18);
  --card-tint-border: rgba(56, 189, 248, 0.35);
  --card-cta-color: #7dd3fc;
  --card-cta-bg: rgba(56, 189, 248, 0.16);
  --card-cta-hover-bg: #0ea5e9;
  --card-cta-hover-color: #0f172a;
}

.amzn-theme-indigo {
  --card-tint: #6366f1;
  --card-tint-soft: rgba(99, 102, 241, 0.12);
  --card-tint-border: rgba(99, 102, 241, 0.28);
  --card-cta-color: #4338ca;
  --card-cta-bg: rgba(79, 70, 229, 0.12);
  --card-cta-hover-bg: #4f46e5;
  --card-cta-hover-color: #ffffff;
}
:root[data-theme="dark"] .amzn-theme-indigo {
  --card-tint: #818cf8;
  --card-tint-soft: rgba(129, 140, 248, 0.18);
  --card-tint-border: rgba(129, 140, 248, 0.35);
  --card-cta-color: #a5b4fc;
  --card-cta-bg: rgba(129, 140, 248, 0.16);
  --card-cta-hover-bg: #6366f1;
  --card-cta-hover-color: #0f172a;
}

.amzn-theme-fuchsia {
  --card-tint: #d946ef;
  --card-tint-soft: rgba(217, 70, 239, 0.12);
  --card-tint-border: rgba(217, 70, 239, 0.28);
  --card-cta-color: #a21caf;
  --card-cta-bg: rgba(192, 38, 211, 0.12);
  --card-cta-hover-bg: #c026d3;
  --card-cta-hover-color: #ffffff;
}
:root[data-theme="dark"] .amzn-theme-fuchsia {
  --card-tint: #e879f9;
  --card-tint-soft: rgba(232, 121, 249, 0.18);
  --card-tint-border: rgba(232, 121, 249, 0.35);
  --card-cta-color: #f0abfc;
  --card-cta-bg: rgba(232, 121, 249, 0.16);
  --card-cta-hover-bg: #d946ef;
  --card-cta-hover-color: #0f172a;
}

.amzn-strip-card {
  background: var(--bg);
  border: 1px solid var(--card-tint-border, var(--line));
  border-radius: var(--r2);
  transition: all var(--fast);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.amzn-strip-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-tint, var(--accent));
  opacity: 0.9;
}
.amzn-strip-card:hover {
  border-color: var(--card-tint, var(--accent));
  box-shadow: 0 8px 24px -4px var(--card-tint-soft, rgba(0,0,0,0.12)), var(--shadow-2);
  transform: translateY(-3px);
}
.amzn-strip-card a {
  display: flex;
  flex-direction: column;
  padding: var(--s3) var(--s4) var(--s4);
  text-decoration: none;
  height: 100%;
}
.amzn-strip-top {
  display: flex;
  align-items: center;
  margin-bottom: var(--s2);
}
.amzn-card-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2.5px 8px;
  border-radius: var(--rp);
  background: var(--card-tint-soft, var(--accent-soft));
  color: var(--card-cta-color, var(--accent));
  border: 1px solid var(--card-tint-border, transparent);
  line-height: 1.25;
}
.amzn-strip-label {
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--fg);
  margin-bottom: var(--s1);
  line-height: 1.35;
  transition: color var(--fast);
}
.amzn-strip-card:hover .amzn-strip-label {
  color: var(--card-cta-color, var(--accent));
}
.amzn-strip-note {
  font-size: 0.81rem;
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
  margin-bottom: var(--s3);
}
.amzn-strip-cta {
  font-size: 0.80rem;
  font-weight: 700;
  color: var(--card-cta-color, #d97706);
  background: var(--card-cta-bg, rgba(217, 119, 6, 0.08));
  border: 1px solid var(--card-tint-border, transparent);
  padding: 6px 12px;
  border-radius: var(--r1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all var(--fast);
  text-decoration: none;
  width: fit-content;
}
.amzn-strip-card:hover .amzn-strip-cta {
  background: var(--card-cta-hover-bg, var(--accent));
  color: var(--card-cta-hover-color, #ffffff);
  border-color: transparent;
  transform: translateX(2px);
}

/* Sitewide sticky bottom banner disabled for AdSense policy compliance */
.amzn-sticky {
  display: none !important;
}

/* AdSense unit container & labeling (Prevents accidental clicks & layout shift) */
.ad {
  display: block;
  margin: 28px auto;
  text-align: center;
  min-height: 90px;
  max-width: 100%;
  position: relative;
  background: var(--card-bg, rgba(0, 0, 0, 0.02));
  border-radius: var(--r1, 8px);
  padding: 8px 12px;
  box-sizing: border-box;
}
.ad-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #94a3b8);
  margin-bottom: 6px;
  user-select: none;
}
.ad.ad-top {
  margin-top: 16px;
  margin-bottom: 24px;
}
.ad.ad-mid,
.ad.ad-bottom {
  margin-top: 36px;
  margin-bottom: 36px;
}

/* Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--bg-elevated, #ffffff);
  border-top: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  padding: 14px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.cookie-banner[hidden] {
  display: none !important;
}
.cookie-content {
  max-width: 1100px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cookie-text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--fg, #1e293b);
  line-height: 1.5;
  flex: 1 1 300px;
}
.cookie-text a {
  color: var(--accent, #1763d6);
  text-decoration: underline;
  font-weight: 600;
}
.cookie-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cookie-btn {
  background: var(--accent, #1763d6);
  color: #ffffff;
  border: none;
  border-radius: var(--r1, 6px);
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.cookie-btn:hover {
  opacity: 0.9;
}

/* Contact Us Page */
.contact-grid {
  margin: 24px 0 36px 0;
}
.contact-card.primary-card {
  background: var(--bg-elevated, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--r2, 12px);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}
.contact-card-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}
.contact-email-highlight {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 12px 0;
}
.contact-email-highlight a {
  color: var(--accent, #1763d6);
  text-decoration: underline;
}
.contact-note {
  font-size: 0.9rem;
  color: var(--muted, #64748b);
  margin: 0;
}
.contact-topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 20px 0 32px 0;
}
.topic-item {
  background: var(--card-bg, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--r1, 8px);
  padding: 18px 20px;
}
.topic-item h3 {
  font-size: 1rem;
  margin: 0 0 8px 0;
  color: var(--fg, #0f172a);
}
.topic-item p {
  font-size: 0.86rem;
  color: var(--muted, #475569);
  line-height: 1.5;
  margin: 0;
}




/* ------------------------------------------------------ amazon geo gate ---- */
/* The Associates tag (imgvx-20) only earns on amazon.com, i.e. US visitors.
   Every Amazon block is hidden until app.js confirms the visitor is in the US
   (Cloudflare country, timezone fallback) and adds .amzn-us to <html>. Outside
   the US app.js removes the blocks from the DOM entirely. */
html:not(.amzn-us) .gear,
html:not(.amzn-us) .amzn-pick,
html:not(.amzn-us) .amzn-strip,
html:not(.amzn-us) .amzn-inline,
html:not(.amzn-us) a.amzn { display: none !important; }
/* A returning US visitor gets .amzn-us from the <head> script straight away, so
   the space is reserved; the blocks stay invisible until app.js has rotated in
   this visit's products, so nobody sees the server-rendered set swap out. */
html.amzn-us:not(.amzn-ready) :is(.gear, .amzn-pick, .amzn-strip, .amzn-inline) { visibility: hidden; }

/* ------------------------------------------------------ section cards ---- */
/* Each category on the home page and /tools/ is one big card in its own hue
   (--h, set from the category's tint), with a gradient top bar, so it is clear
   where one section ends and the next begins while scrolling. */
.cats > .cat {
  position: relative;
  padding: var(--s6) var(--s5) var(--s5);
  border-radius: 22px;
  border: 1px solid hsl(var(--h, 214) 62% 86%);
  background:
    radial-gradient(120% 60% at 0% 0%, hsl(var(--h, 214) 95% 93% / .9) 0%, transparent 60%),
    linear-gradient(180deg, hsl(var(--h, 214) 90% 97%) 0%, hsl(var(--h, 214) 60% 99%) 100%);
  box-shadow: 0 1px 2px hsl(var(--h, 214) 40% 30% / .06), 0 18px 40px -18px hsl(var(--h, 214) 70% 45% / .35);
  overflow: hidden;
}
.cats > .cat::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 6px;
  background: linear-gradient(90deg, hsl(var(--h, 214) 85% 55%), hsl(calc(var(--h, 214) + 45) 90% 62%));
}
.cats > .cat .cat-head { border-bottom-color: hsl(var(--h, 214) 55% 84%); }
.cats > .cat .cat-badge {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, hsl(var(--h, 214) 85% 55%), hsl(calc(var(--h, 214) + 45) 90% 60%)) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px -8px hsl(var(--h, 214) 80% 45% / .7);
}
.cats > .cat .cat-badge .ic { width: 24px; height: 24px; }
.cats > .cat .cat-title h2 { font-size: 1.35rem; }
.cats > .cat .cat-title h2 a { color: hsl(var(--h, 214) 60% 26%); }
.cats > .cat .cat-count {
  color: #fff; background: hsl(var(--h, 214) 70% 48%); border-color: transparent;
}
.cats > .cat .tcard > a { background: var(--surface); border-color: hsl(var(--h, 214) 45% 88%); }

:root[data-theme="dark"] .cats > .cat {
  border-color: hsl(var(--h, 214) 35% 26%);
  background:
    radial-gradient(120% 60% at 0% 0%, hsl(var(--h, 214) 60% 22% / .55) 0%, transparent 60%),
    linear-gradient(180deg, hsl(var(--h, 214) 32% 13%) 0%, hsl(var(--h, 214) 22% 10%) 100%);
  box-shadow: 0 18px 40px -20px hsl(var(--h, 214) 80% 40% / .35);
}
:root[data-theme="dark"] .cats > .cat .cat-head { border-bottom-color: hsl(var(--h, 214) 30% 24%); }
:root[data-theme="dark"] .cats > .cat .cat-badge { color: #fff !important; }
:root[data-theme="dark"] .cats > .cat .cat-title h2 a { color: hsl(var(--h, 214) 85% 82%); }
:root[data-theme="dark"] .cats > .cat .cat-count { color: #fff; background: hsl(var(--h, 214) 55% 40%); }
:root[data-theme="dark"] .cats > .cat .tcard > a { border-color: hsl(var(--h, 214) 25% 24%); }

@media (max-width: 560px) {
  .cats > .cat { padding: var(--s5) var(--s3) var(--s3); border-radius: 18px; }
  .cats > .cat .cat-badge { width: 40px; height: 40px; }
  .cats > .cat .cat-title h2 { font-size: 1.12rem; }
}

/* ------------------------------------------------------ ImgVX AI Studio --- */
/* Three panes around one canvas: tools on the left, the stage in the middle,
 * the picked tool's settings on the right. Under 900px it becomes one pane at
 * a time behind a tab bar. Tints come from each category's --h. */
.b-pro {
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 55%, #f59e0b 100%);
  border-color: transparent;
  box-shadow: 0 2px 8px -2px rgba(236, 72, 153, .55);
  min-width: 0;
  padding: 2.5px 7px;
}
.navlinks-studio { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.navlinks-studio .b-pro { font-size: .58rem; }

/* home + /tools banner */
.studio-promo {
  display: flex; align-items: center; gap: var(--s4);
  margin: var(--s5) 0;
  padding: var(--s4) var(--s5);
  border-radius: var(--r4);
  color: var(--fg); text-decoration: none;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(139, 92, 246, .16), transparent 55%),
    radial-gradient(120% 160% at 100% 100%, rgba(236, 72, 153, .14), transparent 55%),
    var(--surface);
  border: 1px solid rgba(139, 92, 246, .28);
  box-shadow: var(--shadow-2);
  transition: transform var(--slow), box-shadow var(--slow);
}
.studio-promo:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }
.studio-promo-ic, .studio-logo {
  flex: none; display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #ec4899 60%, #f59e0b);
  box-shadow: 0 8px 20px -8px rgba(139, 92, 246, .8);
}
.studio-promo-ic .ic, .studio-logo .ic { width: 28px; height: 28px; }
.studio-promo-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.studio-promo-text strong { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.studio-promo-text > span { color: var(--fg-2); font-size: .92rem; }
.studio-promo-cta { flex: none; font-weight: 700; color: var(--accent); white-space: nowrap; }
@media (max-width: 560px) {
  .studio-promo { flex-wrap: wrap; padding: var(--s4); }
  .studio-promo-cta { width: 100%; }
}

body.studio-page main { max-width: 1520px; padding-top: var(--s4); }
.studio {
  --st-h: clamp(580px, calc(100vh - var(--head-h) - 118px), 1000px);
  --st-stage-h: calc(var(--st-h) - 150px);
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r4);
  background: var(--surface);
  box-shadow: var(--shadow-3);
}
.studio-grid { position: relative; z-index: 1; border-radius: 0 0 var(--r4) var(--r4); overflow: hidden; }
.studio.dragging::after {
  content: 'Drop to open'; position: absolute; inset: 0; z-index: 40;
  display: grid; place-items: center;
  font-size: 1.3rem; font-weight: 700; color: #fff;
  background: rgba(88, 28, 135, .55); backdrop-filter: blur(3px);
  border: 3px dashed rgba(255, 255, 255, .7); border-radius: inherit;
}

.studio-top {
  position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s3);
  padding: 10px var(--s4);
  border-bottom: 1px solid var(--line);
  border-radius: var(--r4) var(--r4) 0 0;
  background:
    linear-gradient(90deg, rgba(139, 92, 246, .10), rgba(236, 72, 153, .07) 50%, rgba(245, 158, 11, .06)),
    var(--surface);
}
.studio-brand { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.studio-logo { width: 42px; height: 42px; border-radius: 13px; }
.studio-logo .ic { width: 23px; height: 23px; }
.studio-brand h1 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.3rem; letter-spacing: -.01em; }
.studio-brand p { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }
.studio-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); }
.st-credits {
  font-size: .8rem; color: var(--muted); white-space: nowrap;
  padding: 6px 12px; border-radius: var(--rp);
  border: 1px solid var(--line); background: var(--surface);
}
.st-credits.is-open { color: var(--ai); border-color: var(--ai-line); background: var(--ai-bg); }
.st-credits a, .st-link { color: var(--accent); font-weight: 650; }
.st-link { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.st-group-btns { display: inline-flex; }
.st-group-btns .st-btn:first-child { border-radius: var(--rp) 0 0 var(--rp); }
.st-group-btns .st-btn:last-child { border-radius: 0 var(--rp) var(--rp) 0; margin-left: -1px; }

.st-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 7px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--rp);
  background: var(--surface); color: var(--fg);
  font: inherit; font-size: .88rem; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: border-color var(--fast), background var(--fast), color var(--fast), transform var(--fast), box-shadow var(--fast);
}
.st-btn.st-icon { width: 40px; padding: 0; }
.st-btn .ic { width: 17px; height: 17px; }
.st-btn:hover:not([disabled]) { border-color: var(--accent); color: var(--accent); position: relative; }
.st-btn[disabled] { opacity: .45; cursor: default; }
.st-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.st-primary, .st-primary:hover:not([disabled]) {
  border-color: transparent; color: #fff;
  background: linear-gradient(135deg, var(--accent), #ec4899);
  box-shadow: 0 4px 14px -4px rgba(139, 92, 246, .6);
}
.st-primary:hover:not([disabled]) { color: #fff; transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(139, 92, 246, .7); }
.st-primary[disabled] { opacity: .5; box-shadow: none; }

/* Save & Download menu */
.st-dl { position: relative; }
.st-dlmenu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  width: 260px; padding: 8px;
  border: 1px solid var(--line); border-radius: var(--r3);
  background: var(--surface); box-shadow: var(--shadow-3);
}
.st-dlmenu p { margin: 4px 8px 6px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.st-dlmenu button {
  display: grid; gap: 1px; width: 100%; padding: 9px 10px;
  border: 0; border-radius: var(--r2); background: none; color: var(--fg);
  font: inherit; text-align: left; cursor: pointer;
}
.st-dlmenu button strong { font-size: .92rem; }
.st-dlmenu button span { font-size: .78rem; color: var(--muted); }
.st-dlmenu button:hover, .st-dlmenu button:focus-visible { background: var(--accent-soft); outline: 0; }
.st-dlmenu button[aria-checked="true"] strong::after { content: " \2713"; color: var(--accent); }

.studio [hidden] { display: none !important; }

.studio-grid {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr) 336px;
  height: var(--st-h);
}

/* rail */
.studio-rail {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--bg-sunk);
}
.st-search {
  display: flex; align-items: center; gap: 8px; flex: none;
  margin: var(--s3); padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--rp); background: var(--surface);
}
.st-search .ic { width: 16px; height: 16px; color: var(--muted); flex: none; }
.st-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--fg); font: inherit; font-size: .88rem; padding: 9px 0; }
.st-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.st-groups {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: 0 var(--s2) var(--s5);
  scrollbar-width: thin; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent);
          mask-image: linear-gradient(#000 calc(100% - 28px), transparent);
}
.st-group { margin-bottom: 4px; }
.st-group > summary {
  display: flex; align-items: center; gap: 8px;
  position: sticky; top: 0; z-index: 1;
  padding: 8px 10px; border-radius: var(--r2);
  font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: hsl(var(--h) 60% 40%); background: var(--bg-sunk);
  cursor: pointer; list-style: none; user-select: none;
}
.st-group > summary::-webkit-details-marker { display: none; }
.st-group > summary .ic { width: 16px; height: 16px; }
.st-group > summary span { flex: 1; }
.st-group > summary em { font-style: normal; font-weight: 700; color: var(--muted); }
.st-group > summary::after { content: ''; width: 6px; height: 6px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); margin: -3px 2px 0 0; transition: transform var(--fast); }
.st-group:not([open]) > summary::after { transform: rotate(-45deg); margin-top: 0; }
.st-group > summary:hover { background: color-mix(in srgb, hsl(var(--h) 80% 50%) 8%, var(--bg-sunk)); }
/* One column that never grows past the rail, so every badge lines up. */
.st-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; padding: 2px 0 6px; }
.st-tool {
  display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0;
  padding: 6px 8px; border: 1px solid transparent; border-radius: var(--r2);
  background: none; color: var(--fg-2); font: inherit; font-size: .86rem; text-align: left; cursor: pointer;
  transition: background var(--fast), border-color var(--fast), color var(--fast);
}
.st-tool-ic {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  color: hsl(var(--h) 65% 42%); background: hsl(var(--h) 85% 55% / .12);
}
.st-tool-ic .ic { width: 16px; height: 16px; }
.st-tool-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-tool:hover { background: var(--surface); color: var(--fg); }
.st-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.st-tool.on {
  background: var(--surface); color: var(--fg); font-weight: 650;
  border-color: hsl(var(--h) 70% 55% / .45);
  box-shadow: 0 2px 10px -4px hsl(var(--h) 70% 45% / .45);
}
.st-tool.on .st-tool-ic { color: #fff; background: hsl(var(--h) 70% 52%); }
.st-free, .st-cost { flex: none; min-width: 42px; text-align: center; font-size: .64rem; font-weight: 800; letter-spacing: .04em; padding: 2px 6px; border-radius: var(--rp); }
.st-free { color: #047857; background: #ecfdf5; }
.st-cost { color: #7c3aed; background: #f5f3ff; }
.st-none { margin: var(--s3); color: var(--muted); font-size: .88rem; }

/* stage */
.studio-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.st-stagebar {
  display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; flex: none;
  min-height: 52px; padding: 7px var(--s4); border-bottom: 1px solid var(--line); background: var(--surface);
}
.st-status { margin: 0; font-size: .8rem; color: var(--muted); }
.st-status.warn { color: #b45309; font-weight: 650; padding: 4px 11px; border: 1px solid #fcd34d; border-radius: var(--rp); background: #fffbeb; }
.st-meta { margin: 0 0 0 auto; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-meta .sep { margin: 0 4px; }
.st-seg { display: inline-flex; padding: 3px; border-radius: var(--rp); background: var(--surface-2); border: 1px solid var(--line); }
.st-seg button {
  position: relative;
  border: 0; background: none; color: var(--fg-2); font: inherit; font-size: .84rem; font-weight: 650;
  padding: 6px 16px; border-radius: var(--rp); cursor: pointer;
  transition: background var(--fast), color var(--fast), box-shadow var(--fast);
}
.st-seg button:hover { color: var(--fg); }
.st-seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-1); }
.st-dot { display: none; position: absolute; top: 5px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 2px var(--surface); }
.studio.is-pending .st-dot { display: block; }

.st-canvas {
  position: relative; flex: 1; min-height: 0; overflow: auto;
  padding: var(--s4);
  background:
    radial-gradient(circle at 1px 1px, rgba(100, 116, 139, .16) 1px, transparent 0) 0 0 / 18px 18px,
    var(--bg);
}
.st-canvas:not([data-mode="result"]) > .result { display: none !important; }
.st-canvas > .result { margin: 0 auto; max-width: 1100px; }
.st-canvas > .result .preview img, .st-canvas > .result > img, .st-canvas > .result .aicmp { max-height: var(--st-stage-h); }
.st-canvas > .result .stage { margin-left: auto; margin-right: auto; width: min(100%, calc((var(--st-stage-h) - var(--st-extra, 0px)) * var(--ar, 100))); }
/* The studio saves through Save & Download and commits through Apply. */
.studio #result a[data-apply], .studio #aiagain, .studio #airun, .studio #docrop, .studio #bsave, .studio #pgo { display: none !important; }
/* The AI run button lives in the studio's own bar, so its empty row goes too. */
.studio #result .resultbar:has(> #airun) { display: none; }
.studio #result > p.note { font-size: 13px; text-align: center; margin: 8px auto 0; max-width: 46ch; }
.studio #result:has(#aiout .aicmp, #aiout .preview) #aistage { display: none; }
/* An interactive tool's own picker, sliders and buttons, moved into the panel. */
/* Pinch or wheel zoom around a drawing stage. The frame clips the scaled
   picture; the pill shows the zoom and puts it back to fit. */
.zoomclip { position: relative; overflow: hidden; border-radius: var(--r3); touch-action: none; }
.zoomclip > .stage { transform-origin: 0 0; transition: none !important; }
.zoomclip.zoomed > .stage { will-change: transform; }
.zoomclip > .stage.pinching { cursor: grabbing; }
.zoompill {
  position: absolute; right: 10px; bottom: 10px; z-index: 6;
  min-height: 30px; padding: 0 12px; border: 0; border-radius: 999px;
  font: inherit; font-size: .78rem; font-weight: 650; color: #fff;
  background: rgba(17, 17, 22, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  pointer-events: none; opacity: .85; transition: opacity .2s ease;
}
.zoompill b { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .2); }
.zoomclip.zoomed .zoompill { pointer-events: auto; cursor: pointer; opacity: 1; }
.zoomclip:not(.zoomed) .zoompill { display: none; }
@media (hover: none) and (pointer: coarse) {
  .zoomclip:not(.zoomed) .zoompill { display: block; animation: zoom-hint 4s ease 1.2s forwards; }
}
@keyframes zoom-hint { 0%, 80% { opacity: .85; } 100% { opacity: 0; } }
/* More settings below the fold: a fade on the panel's bottom edge and a pill
   that scrolls to them. Placed over the panel by the studio script. */
.studio-inspector { position: relative; }
.st-more {
  position: absolute; left: 0; z-index: 4; height: 56px; pointer-events: none;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px;
  background: linear-gradient(to bottom, transparent, var(--st-more-bg, var(--bg-sunk)) 78%);
}
.st-more[hidden] { display: none; }
.st-more button {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  font: inherit; font-size: .8rem; font-weight: 650; color: var(--fg); background: var(--surface);
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .5); -webkit-tap-highlight-color: transparent;
}
.st-more svg { animation: st-more-nudge 1.6s ease-in-out infinite; }
@keyframes st-more-nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .st-more svg { animation: none; } }
@media (max-width: 900px) {
  .st-more { --st-more-bg: #000; }
  .st-more button { color: #fff; background: #26262e; border-color: #3a3a44; }
}
.st-dock:empty { display: none; }
.st-dock { display: grid; gap: 12px; margin-bottom: 14px; }
.st-dock .brushbar { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.st-dock .btnrow { margin: 0; }
.st-dock .resultbar { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; justify-content: flex-start; }
.st-dock #aiclear { width: auto; min-height: 38px; padding: 0 16px; border-radius: 999px; }
.st-dock .btnrow .spacer { display: none; }
.st-dock > p.note { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.st-dock .brushopts { display: grid; gap: 10px; }
.st-dock .brushopts label:not(.chk) { display: grid; grid-template-columns: 5.2em minmax(0, 1fr) 2.4em; gap: 10px; }
.st-dock .brushopts input[type=range] { width: 100%; }
.st-dock .brushopts output { text-align: right; }

.st-view { display: grid; place-items: center; min-height: 100%; }
.st-frame {
  position: relative; width: 100%;
  border-radius: var(--r3); overflow: hidden;
  box-shadow: 0 18px 50px -20px rgba(15, 23, 42, .45);
  background: conic-gradient(from 90deg at 50% 50%, #e9edf1 25%, #fff 0 50%, #e9edf1 0 75%, #fff 0) 0 0 / 18px 18px;
  animation: st-in .22s ease-out;
}
@keyframes st-in { from { opacity: .4; transform: scale(.985); } to { opacity: 1; transform: none; } }
.st-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.st-tag {
  position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: var(--rp);
  font-size: .72rem; font-weight: 700; color: #fff; background: rgba(15, 23, 42, .62); pointer-events: none;
  backdrop-filter: blur(4px);
}
.studio[data-view="original"] .st-tag { background: rgba(124, 58, 237, .85); }

.st-empty { display: grid; place-items: center; min-height: 100%; cursor: pointer; }
.st-empty-card {
  max-width: 460px; text-align: center; padding: var(--s6) var(--s5);
  border-radius: var(--r4); border: 2px dashed var(--line-strong);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(6px);
  transition: border-color var(--fast), transform var(--fast);
}
.st-empty:hover .st-empty-card { border-color: var(--accent); transform: translateY(-2px); }
.st-empty-card h2 { margin: var(--s3) 0 var(--s2); font-size: 1.25rem; }
.st-empty-card p { margin: 0 0 var(--s4); color: var(--fg-2); font-size: .92rem; }
.st-empty-ic {
  display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #ec4899 60%, #f59e0b);
  box-shadow: 0 12px 30px -10px rgba(139, 92, 246, .8);
}
.st-empty-ic .ic { width: 30px; height: 30px; }
.st-empty-actions { display: flex; justify-content: center; gap: var(--s2); flex-wrap: wrap; }
.studio[data-locked="1"] .st-if-open, .studio[data-locked="0"] .st-if-locked { display: none; }
.studio[data-locked="1"] .st-empty-card { border-color: rgba(139, 92, 246, .45); }

/* inspector */
.studio-inspector {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  border-left: 1px solid var(--line); background: var(--bg-sunk);
}
.st-insp-head {
  display: flex; align-items: center; gap: var(--s3); flex: none;
  padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); background: var(--surface);
}
.st-insp-head:empty { display: none; }
.st-insp-ic {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  color: #fff; background: hsl(var(--h, 262) 70% 52%);
  box-shadow: 0 8px 18px -8px hsl(var(--h, 262) 70% 45%);
}
.st-insp-ic .ic { width: 21px; height: 21px; }
.st-insp-head > div { flex: 1; min-width: 0; }
.st-insp-head h2 { margin: 0; font-size: 1rem; line-height: 1.25; }
.st-insp-head p { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: .76rem; color: var(--muted); white-space: nowrap; }
.st-full {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: .9rem;
}
.st-full:hover { color: var(--accent); border-color: var(--accent); }
.st-insp-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4);
}
.studio-inspector .tool-panel { display: flex; flex-direction: column; gap: var(--s3); position: static; }
.studio-inspector .tool-panel:empty { display: none; }
.studio-inspector .controls { margin: 0; }
.st-extra, .st-applied {
  padding: var(--s3); border-radius: var(--r3); border: 1px solid var(--line); background: var(--surface);
}
.st-extra .note, .st-applied .note { margin: 6px 0 0; font-size: .82rem; }
.st-ok { margin: 0; font-weight: 700; color: var(--ok); font-size: .98rem; }
.st-applied .warn { margin: 0; }
.st-applied-actions { margin-top: var(--s3); }
.st-next-h { margin: var(--s4) 0 6px; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.st-next { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chip {
  border: 1px solid var(--line); border-radius: var(--rp); background: var(--bg-sunk); color: var(--fg-2);
  font: inherit; font-size: .8rem; font-weight: 600; padding: 5px 11px; cursor: pointer;
}
.st-chip:hover { border-color: var(--accent); color: var(--accent); }

.st-applybar {
  flex: none; display: flex; flex-wrap: wrap; gap: 8px;
  padding: var(--s3) var(--s4); border-top: 1px solid var(--line); background: var(--surface);
  box-shadow: 0 -10px 24px -18px rgba(15, 23, 42, .35);
}
.st-apply {
  flex: 1; min-width: 0; min-height: 46px; font-size: .95rem; font-weight: 700;
  border-color: transparent; color: #fff;
  background: linear-gradient(135deg, var(--accent), #ec4899);
  box-shadow: 0 6px 18px -6px rgba(139, 92, 246, .65);
  overflow: hidden; text-overflow: ellipsis;
}
.st-apply:hover:not([disabled]) { color: #fff; border-color: transparent; transform: translateY(-1px); }
.st-apply[disabled] { opacity: 1; color: var(--muted); background: var(--surface-2); border-color: var(--line); box-shadow: none; }
.st-apply[data-mode="upgrade"] { background: linear-gradient(135deg, #8b5cf6, #ec4899 60%, #f59e0b); }
.st-ghost { flex: none; min-height: 46px; }
.st-applyhint { flex-basis: 100%; margin: 0; font-size: .76rem; color: var(--muted); text-align: center; }
.st-applyhint:empty { display: none; }
.studio.is-pending .st-apply:not([disabled]) { animation: st-pulse 2.4s ease-in-out infinite; }
@keyframes st-pulse { 0%, 100% { box-shadow: 0 6px 18px -6px rgba(139, 92, 246, .65); } 50% { box-shadow: 0 6px 26px -2px rgba(236, 72, 153, .75); } }

.studio-about { margin-top: var(--s7); }
.studio-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--s4); }
.studio-feats > div { padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r3); background: var(--surface); }
.studio-feats h3 { font-size: 1rem; margin-bottom: 6px; }
.studio-feats p { margin: 0; font-size: .9rem; color: var(--fg-2); }

:root[data-theme="dark"] .st-group > summary { color: hsl(var(--h) 80% 72%); }
:root[data-theme="dark"] .st-tool-ic { color: hsl(var(--h) 85% 75%); background: hsl(var(--h) 70% 55% / .18); }
:root[data-theme="dark"] .st-free { color: #34d399; background: rgba(16, 185, 129, .16); }
:root[data-theme="dark"] .st-cost { color: #c4b5fd; background: rgba(139, 92, 246, .2); }
:root[data-theme="dark"] .st-status.warn { color: #fbbf24; background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .35); }
:root[data-theme="dark"] .st-frame { background: conic-gradient(from 90deg at 50% 50%, #1b2128 25%, #131820 0 50%, #1b2128 0 75%, #131820 0) 0 0 / 18px 18px; }

@media (prefers-reduced-motion: reduce) {
  .st-frame, .studio.is-pending .st-apply:not([disabled]) { animation: none; }
}
@media (max-width: 1240px) {
  .studio-grid { grid-template-columns: 230px minmax(0, 1fr) 310px; }
  .studio-brand p { display: none; }
}
/* Phone-only parts of the studio. */
.st-exit, .st-float, .st-mobile, .st-pbar, .st-toast, .st-sheetx { display: none; }

/* Phones and small tablets: a full-screen editor in the style of the phone
   photo apps. The picture fills the screen; at the thumb sits a category bar
   with that category's tools in a row above it. An open tool swaps both rows
   for its settings, with a cancel / name / apply bar underneath. */
@media (max-width: 900px) {
  html:has(body.studio-page), body.studio-page { overflow: hidden; overscroll-behavior: none; }
  body.studio-page main { max-width: none; padding: 0; }
  .studio {
    --bg: #000; --bg-sunk: #0b0b0e; --surface: #16161b; --surface-2: #23232a;
    --fg: #f5f5f7; --fg-2: #c9c9d2; --muted: #8d8d98; --line: #2a2a32; --line-strong: #3c3c46;
    --accent: #b69cff; --accent-hover: #cbb8ff; --accent-soft: rgba(139, 92, 246, .22); --accent-fg: #0b0b0e;
    --ok: #34d399; --ok-bg: rgba(16, 185, 129, .14); --ok-line: rgba(16, 185, 129, .35);
    --ai: #c4b5fd; --ai-bg: rgba(139, 92, 246, .18); --ai-line: rgba(139, 92, 246, .4);
    --warn: #fbbf24; --warn-bg: rgba(245, 158, 11, .12); --warn-line: rgba(245, 158, 11, .35);
    --danger: #f87171; --danger-bg: rgba(239, 68, 68, .14); --danger-line: rgba(239, 68, 68, .35);
    color-scheme: dark;
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; flex-direction: column;
    height: 100vh; height: 100svh; height: var(--st-vh, 100svh);
    border: 0; border-radius: 0; box-shadow: none;
    background: #000; color: var(--fg);
  }
  .st-wide { display: none; }

  /* top bar: close, credits, new image, save */
  .studio-top {
    flex: none; flex-wrap: nowrap; gap: 8px;
    padding: max(8px, env(safe-area-inset-top)) 10px 8px 6px;
    border: 0; border-radius: 0; background: #000;
  }
  .st-exit {
    display: grid; place-items: center; flex: none; width: 44px; height: 44px;
    border: 0; border-radius: 50%; background: none; color: #fff; cursor: pointer;
  }
  .st-exit .ic { width: 26px; height: 26px; stroke-width: 1.8; }
  .studio-brand { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .studio-actions { flex: 1; min-width: 0; flex-wrap: nowrap; justify-content: flex-end; gap: 8px; }
  .st-group-btns { display: none; }
  .st-credits {
    flex: 0 1 auto; min-width: 0; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding: 7px 12px; font-size: .78rem; background: var(--surface-2); border-color: transparent; color: var(--fg-2);
  }
  .st-btn { min-height: 40px; }
  #st-open { width: 40px; padding: 0; border: 0; border-radius: 10px; background: var(--surface-2); color: #fff; }
  #st-open span { display: none; }
  .st-dl > .st-primary { min-height: 40px; padding: 0 18px; border-radius: 10px; font-weight: 750; }
  .st-dl > .st-primary .ic { display: none; }
  .st-dlmenu {
    position: fixed; left: 12px; right: 12px; top: auto; width: auto; z-index: 70;
    bottom: max(12px, calc(env(safe-area-inset-bottom) + 8px));
    padding: 10px; border-radius: 18px; box-shadow: 0 -10px 60px rgba(0, 0, 0, .6);
  }
  .st-dlmenu button { padding: 13px 12px; }
  .st-dl:has(> .st-dlmenu:not([hidden]))::before {
    content: ''; position: fixed; inset: 0; z-index: 69; background: rgba(0, 0, 0, .55); animation: st-fade .2s ease-out;
  }

  /* the picture */
  .studio-grid { flex: 1; min-height: 0; display: flex; flex-direction: column; height: auto; z-index: auto; border-radius: 0; background: #000; }
  .studio-rail { display: none; }
  .studio-stage { position: relative; flex: 1; min-height: 0; background: #000; }
  .st-stagebar { display: none !important; }
  .st-canvas { container-type: size; --st-stage-h: calc(100cqh - 2px); padding: 8px; background: #000; }
  /* Interactive tools (crop, paint) keep their handles clear of the buttons. */
  .studio[data-panel="tool"] .st-canvas[data-mode="result"] { padding-bottom: 60px; }
  .st-canvas > .result .resultbar:not(:has(a:not([hidden]), button:not([hidden]))) { display: none; }
  /* A tool's live preview sits on the black like the picture itself. */
  .st-canvas > .result { display: flex; flex-direction: column; min-height: 100%; margin: 0 auto; }
  .st-canvas > .result > :first-child { margin-top: auto; }
  .st-canvas > .result > :last-child { margin-bottom: auto; }
  .st-canvas > .result .preview { display: flex; justify-content: center; margin: 0; border: 0; border-radius: 0; background: none; }
  .st-canvas > .result .preview img, .st-canvas > .result > img {
    width: auto; max-width: 100%;
    background: conic-gradient(from 90deg at 50% 50%, #1b1b20 25%, #111114 0 50%, #1b1b20 0 75%, #111114 0) 0 0 / 16px 16px;
  }
  .st-frame { border-radius: 2px; box-shadow: none; }
  .studio[data-view="edited"] .st-tag { display: none; }
  .st-empty-card { max-width: 330px; padding: var(--s5) var(--s4); border: 1.5px dashed var(--line-strong); background: var(--bg-sunk); backdrop-filter: none; }
  .st-empty-card h2 { font-size: 1.12rem; margin-top: var(--s3); }
  .st-empty-card p { font-size: .88rem; margin-bottom: var(--s4); }
  .st-empty-ic { width: 52px; height: 52px; border-radius: 16px; }
  .st-empty-ic .ic { width: 26px; height: 26px; }
  .st-empty-actions .st-btn { min-height: 46px; padding: 0 20px; }

  /* undo, redo and compare, floating on the picture */
  .st-float {
    display: flex; gap: 8px; position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 4;
    pointer-events: none;
  }
  .st-fbtn {
    display: grid; place-items: center; width: 42px; height: 42px; pointer-events: auto;
    border: 0; border-radius: 50%; color: #fff; cursor: pointer;
    background: rgba(20, 20, 24, .62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    -webkit-tap-highlight-color: transparent; touch-action: none; user-select: none; -webkit-user-select: none;
    transition: opacity var(--fast), transform var(--fast);
  }
  .st-fbtn .ic { width: 22px; height: 22px; }
  .st-fbtn:active:not([disabled]) { transform: scale(.92); }
  .st-fbtn[disabled] { opacity: 0; pointer-events: none; }
  .st-cmp { margin-left: auto; }
  .studio[data-view="original"] .st-cmp { background: var(--accent); color: #0b0b0e; }
  .studio[data-panel="tool"] #st-undo2, .studio[data-panel="tool"] #st-redo2 { display: none; }

  .st-toast {
    display: block; position: absolute; top: 12px; left: 50%; z-index: 6; transform: translateX(-50%);
    max-width: calc(100% - 32px); margin: 0; padding: 9px 16px; border-radius: 999px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: .86rem; font-weight: 650; color: #fff; background: rgba(32, 32, 38, .94);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .8); pointer-events: none;
  }
  .st-toast.show { animation: st-toast 2.6s ease forwards; }

  /* tool bar: a row of tools above the categories */
  .st-mobile { display: flex; flex-direction: column; flex: none; background: #000; padding-bottom: env(safe-area-inset-bottom); }
  .studio[data-panel="tool"] .st-mobile { display: none; }
  .st-mtools { border-bottom: 1px solid #1d1d23; }
  .st-mrow {
    display: flex; gap: 0; overflow-x: auto; overscroll-behavior-x: contain; padding: 14px 4px 10px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; animation: st-fade .18s ease-out;
  }
  .st-mrow::-webkit-scrollbar, .st-mcats::-webkit-scrollbar { display: none; }
  .st-mtool {
    flex: none; display: grid; justify-items: center; align-content: start; gap: 7px; width: 76px; padding: 2px;
    border: 0; background: none; color: #ececf1; cursor: pointer;
    font: inherit; font-size: .74rem; font-weight: 550; line-height: 1.2; text-align: center;
    -webkit-tap-highlight-color: transparent;
  }
  .st-mic { position: relative; display: grid; place-items: center; width: 44px; height: 40px; transition: transform var(--fast); }
  .st-mic .ic { width: 30px; height: 30px; stroke-width: 1.35; }
  .st-mtool:active .st-mic { transform: scale(.88); }
  .st-mtool.on { color: var(--accent); }
  .st-mlabel { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-height: 2.4em; }
  .st-mai {
    position: absolute; top: -3px; right: -9px; padding: 1px 4px; border-radius: 5px;
    font-style: normal; font-size: .52rem; font-weight: 800; letter-spacing: .03em; line-height: 1.3; color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
  }
  .st-mcats { display: flex; overflow-x: auto; padding: 0 6px 4px; scrollbar-width: none; }
  .st-mcat {
    flex: none; position: relative; padding: 13px 14px 15px;
    border: 0; background: none; color: #fff; cursor: pointer;
    font: inherit; font-size: 1rem; font-weight: 650; white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
  }
  .st-mcat[aria-selected="true"] { color: var(--accent); }
  .st-mcat[aria-selected="true"]::after {
    content: ''; position: absolute; left: 50%; bottom: 5px; width: 26px; height: 3px; margin-left: -13px;
    border-radius: 2px; background: var(--accent);
  }
  .st-mcat.is-ai { color: #c4b5fd; }
  .st-mcat.is-ai i { font-style: normal; margin-left: 5px; color: #f472b6; }

  /* an open tool: its settings, then cancel / name / apply */
  .studio-inspector { display: none; flex: none; border: 0; background: #000; }
  .studio[data-panel="tool"] .studio-inspector {
    position: relative; display: flex; flex-direction: column; max-height: 46%;
    border-top: 1px solid #1d1d23; animation: st-up .22s cubic-bezier(.2, .8, .3, 1);
  }
  .st-insp-head { display: none !important; }
  /* A plain close on the sheet itself, as well as the one in the bar below. */
  .studio[data-panel="tool"] .st-sheetx {
    display: grid; place-items: center; position: absolute; top: 8px; right: 10px; z-index: 3;
    width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer;
    background: var(--surface-2); color: #fff; -webkit-tap-highlight-color: transparent;
  }
  .st-sheetx .ic { width: 18px; height: 18px; stroke-width: 2.2; }
  .studio[data-panel="tool"] .st-insp-body { padding-right: 56px; }
  .st-insp-body { flex: 0 1 auto; padding: 14px 18px 10px; overflow-y: auto; background: #000; }
  .studio-inspector .controls { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; margin: 0; }
  .st-dock .toolpicker { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 0 4px; }
  .st-dock .toolpicker::-webkit-scrollbar, .st-dock .btnrow::-webkit-scrollbar { display: none; }
  .st-dock .tbtn, .st-dock .btnrow button:not(.download) { flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; white-space: nowrap; }
  .st-dock .btnrow { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .st-canvas > .result > .stats { text-align: center; font-size: .8rem; color: var(--muted); }
  .st-applybar { flex: none; padding: 0 16px 10px; border: 0; background: #000; box-shadow: none; }
  .st-apply { min-height: 48px; }
  /* ✓ applies; the big button stays only to run AI or to unlock. */
  .st-apply[data-mode="apply"] { display: none; }
  .st-apply[data-mode="apply"]:not([disabled]) ~ .st-applyhint { display: none; }
  .st-applybar:has(> .st-apply[data-mode="apply"]:not([disabled])):has(> .st-ghost[hidden]) { display: none; }
  .st-pbar {
    display: flex; align-items: center; gap: 8px; flex: none;
    padding: 4px 8px max(6px, env(safe-area-inset-bottom));
    border-top: 1px solid #1d1d23; background: #000;
  }
  .st-pbtn {
    display: grid; place-items: center; flex: none; width: 48px; height: 48px;
    border: 0; border-radius: 50%; background: none; color: #fff; cursor: pointer;
    -webkit-tap-highlight-color: transparent; transition: background var(--fast), transform var(--fast);
  }
  .st-pbtn .ic { width: 26px; height: 26px; stroke-width: 1.9; }
  .st-pbtn:active { transform: scale(.9); background: var(--surface-2); }
  .studio.is-pending .st-pok { background: linear-gradient(135deg, #8b5cf6, #ec4899); box-shadow: 0 6px 18px -6px rgba(236, 72, 153, .8); }
  .st-ptitle { flex: 1; min-width: 0; display: grid; justify-items: center; gap: 1px; text-align: center; }
  .st-ptitle strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; color: #fff; }
  .st-ptitle span { font-size: .7rem; color: var(--muted); }
}
@keyframes st-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes st-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes st-toast { 0% { opacity: 0; transform: translate(-50%, -6px); } 10%, 82% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
@media (max-width: 360px) {
  .st-mtool { width: 68px; }
  .st-mcat { padding-left: 11px; padding-right: 11px; font-size: .94rem; }
  .st-dl > .st-primary { padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .studio[data-panel="tool"] .studio-inspector, .st-mrow, .st-toast.show { animation: none; }
}
.st-stagebar:has(> .st-seg[hidden]):has(> .st-status:empty):has(> .st-meta:empty) { display: none; }

/* ---------------------------------------------------------------- blog ---- */
.post { max-width: 74ch; }
.post-fig { margin: var(--s5) 0 var(--s6); }
.post-fig img {
  display: block; width: 100%; height: auto; border-radius: 14px;
  border: 1px solid var(--line); box-shadow: 0 18px 50px -28px rgba(20, 16, 40, .45); background: var(--bg-sunk);
}
.post-fig figcaption { margin-top: var(--s2); font-size: .85rem; line-height: 1.5; color: var(--muted); }
.post-phones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); margin: var(--s5) 0 var(--s6); }
.post-phones .post-fig { margin: 0; }
.post-phones .post-fig img { border-radius: 22px; border: 6px solid #111; }
.post-key, .post-toc, .post-cta {
  margin: var(--s5) 0; padding: var(--s4) var(--s5); border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.post-key { border-color: var(--ai-line, var(--line)); background: linear-gradient(135deg, rgba(139, 92, 246, .08), rgba(236, 72, 153, .06)); }
.guide .post-key h2 { margin-top: 0; padding-top: 0; font-size: 1.1rem; }
.post-key ul { margin-bottom: 0; }
.post-toc p { margin: 0 0 var(--s2); font-weight: 650; color: var(--fg); }
.guide .post-toc ol { margin: 0; }
.post-toc li { margin-bottom: 4px; }
.post-table { width: 100%; font-size: .9rem; }
.guide h2[id], .guide h3[id] { scroll-margin-top: calc(var(--head-h, 64px) + 12px); }
.post-cta { text-align: center; }
.guide .post-cta h2 { margin-top: 0; padding-top: 0; }
.post-cta-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s3); margin: 0; }
.post-btn {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; border-radius: 999px;
  font-weight: 700; text-decoration: none; color: #fff; background: linear-gradient(135deg, #8b5cf6, #ec4899);
}
.post-btn.is-ghost { color: var(--fg); background: none; border: 1px solid var(--line-strong); }
.post-btn:hover { filter: brightness(1.06); text-decoration: none; }
.pcards { list-style: none; margin: 0 0 var(--s5); padding: 0; display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.pcard a {
  display: flex; flex-direction: column; height: 100%; overflow: hidden; text-decoration: none;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  transition: border-color var(--fast), transform var(--fast);
}
.pcard a:hover { border-color: var(--accent); transform: translateY(-2px); }
.pcard img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border-bottom: 1px solid var(--line); }
.pc-body { display: flex; flex-direction: column; gap: 6px; padding: var(--s4); }
.pc-title { color: var(--fg); font-weight: 700; line-height: 1.3; }
.pc-desc { color: var(--fg-2); font-size: .9rem; line-height: 1.5; }
.pc-date { color: var(--muted); font-size: .78rem; }
@media (max-width: 640px) {
  .post-phones { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
  .post-phones .post-fig img { border-width: 3px; border-radius: 12px; }
  .post-phones figcaption { font-size: .72rem; }
  .post-table { display: block; overflow-x: auto; white-space: nowrap; }
  .post-key, .post-toc, .post-cta { padding: var(--s4); }
}
