/* Shared design system for the PaintLasso AI tool pages (hub + batch tools + generator).
   Matches the main landing brand: Poppins type + the lasso-mark lockup + brand gradient. */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');
:root {
  --bg: #090b12;
  --panel: #10131f;
  --panel2: #0c0e16;
  --line: rgba(255, 255, 255, 0.1);
  --ink: #f4f5fa;
  --muted: rgba(255, 255, 255, 0.55);
  --muted2: rgba(255, 255, 255, 0.4);
  --grad: linear-gradient(90deg, #ff8a00, #ff2d8d, #7b2cfb);
  --pink: #ff2d8d;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(circle at 50% -10%, rgba(123, 44, 251, 0.18), transparent 45%), var(--bg);
  color: var(--ink);
  font: 15px/1.5 'Poppins', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  min-height: 100%;
}
a { color: inherit; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 18px 18px 72px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 20px; }
/* Match the landing Wordmark exactly: Poppins 700, text-xl (1.25rem), tracking-tight. */
.brand { display: inline-flex; align-items: center; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.025em; text-decoration: none; }
/* The same lasso-mark lockup the main landing uses (bare gradient lasso + brush, no tile),
   so the AI pages read as the same product. margin-right (not flex gap) keeps the logo spaced
   from the text WITHOUT inserting a gap between "Paint" and "Lasso". */
.brand .dot { width: 30px; height: 30px; margin-right: 8px; background: url('/brand/lasso-mark.svg') center / contain no-repeat; }
/* "Lasso" gradient matches the landing wordmark (pink -> purple). */
.brand .px { background: linear-gradient(90deg, #ff2d8d, #7b2cfb); -webkit-background-clip: text; background-clip: text; color: transparent; }
.navlinks { display: flex; gap: 16px; font-size: 13px; font-weight: 600; color: var(--muted); align-items: center; flex-wrap: wrap; }
.navlinks a { text-decoration: none; transition: 0.15s; }
.navlinks a:hover, .navlinks a.active { color: var(--ink); }

h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.04; margin: 6px 0 8px; font-weight: 800; letter-spacing: -0.02em; }
h1 .px, .brand-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { color: var(--muted); max-width: 56ch; margin: 0 0 18px; }
.credits { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); padding: 6px 14px; border-radius: 999px; margin: 2px 0 18px; }
.credits b { color: var(--ink); }

/* drop zone */
.drop { border: 1.5px dashed var(--line); border-radius: 18px; background: rgba(255, 255, 255, 0.025); padding: 46px 24px; text-align: center; cursor: pointer; transition: 0.15s; }
.drop:hover, .drop.over { border-color: rgba(255, 45, 141, 0.5); background: rgba(255, 45, 141, 0.06); }
.drop.compact { padding: 20px 24px; }
.drop .big { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.drop .small { color: var(--muted); font-size: 13px; }
.drop svg { opacity: 0.7; margin-bottom: 10px; }

/* controls + buttons */
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 18px; font-size: 14px; font-weight: 800; cursor: pointer; color: #fff; text-decoration: none; }
.btn.primary { background: var(--grad); box-shadow: 0 10px 30px -12px rgba(255, 45, 141, 0.8); }
.btn.primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--ink); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn.ghost:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.sm { padding: 7px 12px; font-size: 12px; border-radius: 9px; }
.muted { color: var(--muted); font-size: 13px; }
label.fld { display: inline-flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted2); }
select, input[type=text], textarea { font: inherit; color: var(--ink); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; outline: none; }
select:focus, input:focus, textarea:focus { border-color: rgba(255, 45, 141, 0.5); }
textarea { resize: vertical; min-height: 84px; width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--muted); padding: 9px 14px; font-weight: 700; cursor: pointer; }
.seg button.on { background: var(--grad); color: #fff; }

/* batch / result grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin-top: 6px; }
.card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.thumb {
  position: relative; aspect-ratio: 1; display: grid; place-items: center;
  --c: rgba(255, 255, 255, 0.07); background-color: #0c0e16;
  background-image: linear-gradient(45deg, var(--c) 25%, transparent 25%), linear-gradient(-45deg, var(--c) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--c) 75%), linear-gradient(-45deg, transparent 75%, var(--c) 75%);
  background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}
.thumb img { max-width: 100%; max-height: 100%; display: block; }
.thumb.empty { color: var(--muted2); font-size: 12px; }
.card .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; }
.card .name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.badge { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.done { color: #9be15d; border-color: rgba(155, 225, 93, 0.3); background: rgba(155, 225, 93, 0.08); }
.badge.err { color: #ffb4c8; border-color: rgba(255, 45, 141, 0.3); background: rgba(255, 45, 141, 0.08); }
.badge.run { color: #7cc6ff; border-color: rgba(0, 150, 255, 0.3); background: rgba(0, 150, 255, 0.08); }
.thumb .ring { position: absolute; width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: var(--pink); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.thumb .x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 7px; border: 0; background: rgba(9, 11, 18, 0.7); color: #fff; cursor: pointer; font-size: 12px; display: grid; place-items: center; }
.thumb .x:hover { background: rgba(255, 45, 141, 0.85); }
.card .acts { display: flex; gap: 6px; padding: 0 10px 10px; }
.card .acts .btn { flex: 1; justify-content: center; }
.card .acts .emsg { font-size: 11px; color: #ffb4c8; padding: 2px 2px 0; line-height: 1.35; }
.err { margin-top: 14px; border: 1px solid rgba(255, 45, 141, 0.3); background: rgba(255, 45, 141, 0.08); color: #ffd9e6; border-radius: 12px; padding: 11px 14px; font-size: 13px; display: none; }
.err.on { display: block; }
.err::before { content: '⚠ '; font-weight: 700; }
@media (max-width: 480px) { .thumb .x { width: 28px; height: 28px; } }

/* hub cards */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(244px, 1fr)); gap: 14px; margin-top: 8px; }
.tool { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: var(--panel); text-decoration: none; transition: 0.15s; min-height: 196px; }
.tool:hover { transform: translateY(-3px); border-color: rgba(255, 45, 141, 0.5); box-shadow: 0 18px 50px -30px rgba(255, 45, 141, 0.8); }
.tool .ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--grad); color: #fff; margin-bottom: 14px; }
.tool h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.tool p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; flex: 1; }
.tool .tag { margin-top: 14px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--pink); }
.tool.soon { opacity: 0.72; }
.tool.soon:hover { transform: none; border-color: var(--line); box-shadow: none; cursor: default; }
.tool.soon .tag { color: var(--muted2); }

.section-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted2); margin: 34px 0 12px; }
footer { margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: center; }
footer a { font-weight: 600; }

/* Desktop: the top nav becomes a fixed left sidebar (matches the studio app shell). */
@media (min-width: 880px) {
  body { padding-left: 212px; }
  header.top {
    position: fixed;
    inset: 0 auto 0 0;
    width: 212px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    margin: 0;
    padding: 24px 16px;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.015);
    backdrop-filter: blur(8px);
    z-index: 5;
  }
  header.top .brand { margin-bottom: 16px; }
  .navlinks { flex-direction: column; align-items: stretch; gap: 2px; font-size: 14px; }
  .navlinks a { padding: 9px 11px; border-radius: 9px; color: var(--muted); }
  .navlinks a:hover, .navlinks a.active { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
}
/* Mobile: drop the cramped wrapping nav (links live in the footer); keep just the brand.
   Add bottom clearance so the footer isn't cut off under the iOS Safari toolbar / home bar. */
@media (max-width: 879px) {
  header.top .navlinks { display: none; }
  .wrap { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
}
footer { line-height: 1.7; }

/* ─────────────────────────────────────────────────────────────────────
   Tool page: product on the left (next to the sidebar), before/after demo
   on the right half, plus a plain-English description, a 3-step how-to,
   and the credit cost. Shared by every AI tool page.
   ───────────────────────────────────────────────────────────────────── */
.wrap.wide { max-width: 1200px; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; align-items: start; }
@media (min-width: 1060px) {
  .tool-grid { grid-template-columns: minmax(0, 1fr) minmax(330px, 410px); gap: 48px; }
}
.tool-main { min-width: 0; }

/* plain-English lead under the H1 */
.lead { color: var(--muted); font-size: 16px; line-height: 1.62; max-width: 60ch; margin: 0 0 16px; }
.lead strong { color: var(--ink); font-weight: 600; }

/* credit cost pill */
.cost { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); padding: 8px 15px; border-radius: 999px; margin: 0 0 22px; }
.cost b { color: var(--ink); font-weight: 800; }
.cost .star { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 900; font-size: 15px; }

/* before/after demo (sticky on desktop) */
.tool-demo { margin: 0; }
@media (min-width: 1060px) { .tool-demo { position: sticky; top: 24px; } }
.tool-demo img { width: 100%; height: auto; display: block; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 40px 90px -50px rgba(123, 44, 251, 0.75); }
.tool-demo figcaption { color: var(--muted2); font-size: 12px; margin-top: 11px; text-align: center; }

/* 3-step how-to */
.howto { margin-top: 34px; }
.howto h2 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted2); margin: 0 0 16px; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; position: relative; padding-left: 46px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -1px; width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; background: var(--grad); }
.steps li b { color: var(--ink); font-weight: 700; }

/* "Open in Studio" CTA for the canvas-based tools */
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 8px; }
.note { color: var(--muted2); font-size: 13px; line-height: 1.55; border-left: 2px solid var(--line); padding: 2px 0 2px 14px; margin: 18px 0 0; }
