/* ProFlow Tools — layout: dark teal app shell (header + left rail) around a light work surface, matching the Canva mockup */
:root {
  /* Brand palette: #41436A indigo · #974063 plum · #F54768 coral · #FF9678 peach */
  --shell: #41436a;        /* header + sidebar */
  --shell-2: #4d4f7c;      /* active rail item, hero */
  --shell-fg: #f8eff3;
  --shell-mute: #cbc2d6;
  --mint: #f54768;         /* accent (buttons) */
  --mint-ink: #26132b;     /* text on accent */
  --plum: #974063;
  --peach: #ff9678;
  --accent-text: #974063;  /* accent-coloured text on light surfaces */
  --bg: #faf6f7;           /* page */
  --surface: #ffffff;
  --sunk: #f3eaed;
  --fg: #26223b;
  --mute: #675f78;
  --line: #e8dbe1;
  --good: #1d8a5c; --warn: #b7791f; --bad: #c2413a;
  --focus: #f54768;
  --f-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --f-body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --r: 10px;
  --side-w: 248px;
  --head-h: 60px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1a2c; --surface: #25243b; --sunk: #201f34; --fg: #f3ecf1; --mute: #b5abc2; --line: #3b3958;
    --shell: #2b2c47; --shell-2: #3a3c62; --accent-text: #ff9678; --good: #4cc38a; --warn: #e2a948; --bad: #ff7a7a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1a2c; --surface: #25243b; --sunk: #201f34; --fg: #f3ecf1; --mute: #b5abc2; --line: #3b3958;
  --shell: #2b2c47; --shell-2: #3a3c62; --accent-text: #ff9678; --good: #4cc38a; --warn: #e2a948; --bad: #ff7a7a; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 var(--f-body); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--shell); }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100; background: var(--mint); color: var(--mint-ink); padding: 8px 14px; border-radius: 6px; font-weight: 600; }
.skip:focus { top: 8px; }
.muted { color: var(--mute); }
.tnum, .stat b, .big b, table td { font-variant-numeric: tabular-nums; }
h1, h2, h3 { text-wrap: balance; line-height: 1.15; }

/* ---------- header ---------- */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; height: var(--head-h);
  display: flex; align-items: center; gap: 14px; background: var(--shell); color: var(--shell-fg);
  padding-block: 0; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 17px; white-space: nowrap; }
.brand i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--mint); color: var(--mint-ink); font: 700 16px var(--f-display); font-style: normal; }
.top .search { flex: 1; max-width: 460px; margin-inline-start: auto; }
.top-links { display: flex; align-items: center; gap: 14px; }
.top-links a { text-decoration: none; color: var(--shell-mute); font-size: 14px; white-space: nowrap; }
.top-links a:hover { color: var(--shell-fg); }
.lang { display: flex; align-items: center; gap: 8px; color: var(--shell-mute); font-size: 14px; }
.lang select { background: var(--shell-2); color: var(--shell-fg); border: 1px solid rgba(255,255,255,.14); border-radius: 6px; padding: 6px 8px; font: inherit; }
.icon-btn-top { display: none; background: none; border: 1px solid rgba(255,255,255,.18); color: var(--shell-fg); border-radius: 8px; width: 40px; height: 36px; font-size: 18px; cursor: pointer; }

/* search */
.search { position: relative; }
.search input { width: 100%; padding: 9px 12px 9px 36px; border-radius: 8px; border: 1px solid rgba(255,255,255,.14); background: var(--shell-2); color: var(--shell-fg); font: inherit; font-size: 14px; }
[dir="rtl"] .search input { padding: 9px 36px 9px 12px; }
.search input::placeholder { color: var(--shell-mute); }
.search::before { content: "⌕"; position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-52%); color: var(--shell-mute); font-size: 17px; pointer-events: none; }
.search-results { position: absolute; inset-inline: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 14px 40px rgba(38,19,43,.22); z-index: 70; max-height: 70vh; overflow: auto; }
.search-results a { display: grid; gap: 1px; padding: 8px 10px; border-radius: 7px; text-decoration: none; }
.search-results a:hover, .search-results a:focus { background: var(--sunk); outline: none; }
.search-results b { font-weight: 600; font-size: 14px; }
.search-results span { font-size: 13px; color: var(--mute); }
.search.big-search input { background: var(--surface); color: var(--fg); border-color: var(--line); padding-block: 13px; font-size: 16px; }
.search.big-search input::placeholder { color: var(--mute); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - var(--head-h)); }
.side { background: var(--shell); color: var(--shell-fg); padding: 14px 10px 24px; position: sticky; top: calc(var(--head-h) + env(safe-area-inset-top, 0px)); height: calc(100vh - var(--head-h) - env(safe-area-inset-top, 0px)); overflow-y: auto; }
.side nav { display: grid; gap: 2px; }
.side a { display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 7px; text-decoration: none; color: var(--shell-fg); font-size: 14.5px; }
.side a small { color: var(--shell-mute); font-variant-numeric: tabular-nums; }
.side a:hover { background: rgba(255,255,255,.05); }
.side a[aria-current="page"] { background: var(--shell-2); box-shadow: inset 3px 0 0 var(--mint); }
[dir="rtl"] .side a[aria-current="page"] { box-shadow: inset -3px 0 0 var(--mint); }
.side .side-cta { margin-top: 18px; padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.08); display: grid; gap: 8px; }
.side .side-cta button, .side .side-cta a.btn { justify-content: center; }
.scrim { display: none; }

main { min-width: 0; padding-block: 18px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap-in { max-width: 1060px; margin: 0 auto; }
.crumbs { font-size: 14px; color: var(--mute); margin-bottom: 14px; }
.crumbs a { color: var(--mute); }

/* ---------- hero (home) ---------- */
.hero { background: linear-gradient(135deg, #41436a 0%, #6a4268 45%, #974063 75%, #c9455f 100%); color: var(--shell-fg); border-radius: 18px; padding: clamp(24px, 4vw, 44px); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: center; overflow: hidden; position: relative; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12.5px; font-weight: 700; color: #ffb7a1; margin: 0 0 12px; }
.hero h1 { font: 600 clamp(30px, 4.4vw, 46px)/1.08 var(--f-display); margin: 0 0 16px; letter-spacing: -.01em; }
.hero p { color: #f1dde6; max-width: 52ch; margin: 0 0 22px; }
.hero .badges { font-size: 14px; color: var(--shell-mute); margin: 16px 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hero-art a { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 14px 12px; text-decoration: none; display: grid; gap: 6px; transition: transform .15s, background .15s; }
.hero-art a:hover { background: rgba(245,71,104,.14); transform: translateY(-2px); }
.hero-art b { font: 600 22px var(--f-display); color: var(--peach); }
.hero-art span { font-size: 12.5px; color: #f1dde6; line-height: 1.3; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 44px 0 16px; flex-wrap: wrap; }
.section-head h2 { font: 600 clamp(24px, 3vw, 32px) var(--f-display); margin: 0; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; color: var(--accent-text); margin: 34px 0 6px; }
.home-h2 { font: 600 clamp(28px, 3.6vw, 40px)/1.1 var(--f-display); margin: 0 0 10px; }
.big-search { margin-top: 18px; }
.cat-block h3 a { text-decoration: none; }
.lede { font-size: 17px; color: var(--mute); max-width: 68ch; margin: 0; }
.note-band { margin-top: 20px; border-inline-start: 3px solid var(--mint); background: var(--surface); padding: 14px 18px; border-radius: 0 var(--r) var(--r) 0; color: var(--mute); font-size: 15px; }

/* ---------- tool cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-decoration: none; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 12px; align-items: start; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--mint); transform: translateY(-1px); }
.card .ico { grid-row: span 2; width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; background: var(--sunk); color: var(--accent-text); font: 700 12px var(--f-mono); letter-spacing: -.02em; }
.card b { font-weight: 650; font-size: 15.5px; }
.card span { color: var(--mute); font-size: 13.5px; line-height: 1.4; }
.cat-block { margin-top: 30px; }
.cat-block h3 { font: 600 20px var(--f-display); margin: 0 0 12px; display: flex; gap: 10px; align-items: baseline; }
.cat-block h3 small { font: 500 13px var(--f-body); color: var(--mute); }

.why { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.why div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.why b { display: block; font: 600 18px var(--f-display); margin-bottom: 6px; }
.why p { margin: 0; color: var(--mute); font-size: 14.5px; }

.promo { margin-top: 28px; background: var(--shell); color: var(--shell-fg); border-radius: 16px; padding: 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.promo h2 { font: 600 24px var(--f-display); margin: 0 0 4px; }
.promo p { margin: 0; color: var(--shell-mute); }
.install-help { margin-top: 12px; font-size: 14px; color: var(--shell-mute); max-width: 70ch; }
.install-help li { margin: 4px 0; }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 8px; padding: 10px 16px; font: 600 15px var(--f-body); border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn.primary { background: linear-gradient(135deg, var(--mint), var(--peach)); color: var(--mint-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: inherit; border-color: var(--line); }
.btn.ghost:hover { border-color: var(--focus); }
.btn.on-dark { border-color: rgba(255,255,255,.22); color: var(--shell-fg); background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: progress; }
.icon-btn { background: var(--sunk); border: 1px solid var(--line); color: var(--fg); border-radius: 6px; width: 30px; height: 30px; cursor: pointer; font-size: 14px; }

/* ---------- tool page ---------- */
.tool-head h1 { font: 600 clamp(28px, 3.6vw, 40px)/1.1 var(--f-display); margin: 0 0 8px; }
.tool-head p { margin: 0; color: var(--mute); max-width: 70ch; font-size: 17px; }
.local { display: inline-flex; gap: 8px; align-items: center; margin-top: 12px; font-size: 13.5px; color: var(--good); background: color-mix(in srgb, var(--good) 10%, transparent); padding: 5px 10px; border-radius: 99px; }
.tool-panel { margin-top: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: clamp(16px, 3vw, 26px); display: grid; gap: 16px; min-width: 0; }
.tool-panel > * { min-width: 0; }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; min-width: 0; }
.field small { font-weight: 400; color: var(--mute); }
.field output { font-variant-numeric: tabular-nums; }
input[type="text"], input[type="number"], input[type="date"], input[type="password"], input:not([type]), select, textarea {
  width: 100%; font: 400 15px var(--f-body); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
textarea { resize: vertical; line-height: 1.5; }
.mono, textarea.mono { font-family: var(--f-mono); font-size: 13.5px; }
input[type="range"] { width: 100%; accent-color: var(--focus); }
input[type="color"] { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 3px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.span2 { grid-column: 1 / -1; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; cursor: pointer; }
.stack { display: grid; gap: 10px; }

.drop { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 30px 16px; border: 2px dashed var(--line); border-radius: 14px; background: var(--bg); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--mint); background: color-mix(in srgb, var(--mint) 7%, var(--bg)); }
.drop strong { font-size: 16px; }
.drop-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: var(--mint-ink); font-size: 22px; font-weight: 700; margin-bottom: 6px; }

.filelist { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; counter-reset: f; }
.filelist li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-actions { display: flex; gap: 4px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.preview { display: grid; gap: 12px; justify-items: start; }
.preview img { max-height: 360px; border-radius: 10px; border: 1px solid var(--line); background: repeating-conic-gradient(var(--sunk) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; }

.status { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 14.5px; background: var(--sunk); }
.status[data-kind="ok"] { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); }
.status[data-kind="error"] { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }

.result { display: grid; gap: 14px; }
.big { background: var(--bg); border-radius: 12px; padding: 16px 18px; display: grid; gap: 4px; border: 1px solid var(--line); }
.big span { font-size: 13.5px; color: var(--mute); }
.big b { font: 600 clamp(24px, 3.4vw, 32px)/1.15 var(--f-display); overflow-wrap: anywhere; }
.big small { color: var(--mute); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
.stat b { font: 600 22px var(--f-display); overflow-wrap: anywhere; }
.stat span { font-size: 13px; color: var(--mute); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; }
.pill.good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.meter { height: 8px; background: var(--sunk); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; transition: width .2s; }
.meter.good i { background: var(--good); } .meter.warn i { background: var(--warn); } .meter.bad i { background: var(--bad); }
.tips { margin: 0; padding-inline-start: 20px; color: var(--mute); font-size: 14.5px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 12px; text-align: start; border-bottom: 1px solid var(--line); }
th { background: var(--sunk); font-weight: 600; font-size: 13px; color: var(--mute); }
tr:last-child td { border-bottom: 0; }
.items input { padding: 7px 8px; font-size: 14px; }
.items td:first-child { min-width: 180px; }
.hash { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.hash span { font: 600 12px var(--f-mono); color: var(--mute); }
.hash code { font: 13px var(--f-mono); overflow-wrap: anywhere; }
.hash:not(:has(span)) { grid-template-columns: minmax(0, 1fr) auto; }
.kw h3 { font: 600 16px var(--f-body); margin: 0 0 8px; }
.kw ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.kw li { display: flex; justify-content: space-between; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; font-size: 14px; }
.pct { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 15px; }
.pct input { width: 110px; }
.pct output { font: 600 20px var(--f-display); color: var(--accent-text); }
.swatches { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.sw { height: 64px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; display: flex; align-items: flex-end; padding: 4px; }
.sw span { font: 11px var(--f-mono); background: rgba(255,255,255,.85); color: #142427; padding: 1px 4px; border-radius: 4px; }
.qr { display: grid; place-items: start; }
.qr img, .qr canvas { border-radius: 8px; border: 1px solid var(--line); padding: 10px; background: #fff; max-width: 100%; height: auto; }
.serp { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 3px; font-family: Arial, sans-serif; }
.serp-url { font-size: 13px; color: var(--mute); overflow-wrap: anywhere; }
.serp-title { font-size: 19px; color: #1a4fbf; }
:root[data-theme="dark"] .serp-title { color: #8ab4f8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .serp-title { color: #8ab4f8; } }
.serp-desc { font-size: 14px; color: var(--mute); }
.ai-out { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-height: 80px; font-size: 15.5px; }
.ai-out:empty::before { content: "The AI result will appear here."; color: var(--mute); }

/* content below tool */
.content { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; margin-top: 34px; }
.content h2 { font: 600 24px var(--f-display); margin: 0 0 12px; }
.content ol.steps { padding-inline-start: 22px; margin: 0 0 28px; display: grid; gap: 6px; }
.content p { max-width: 68ch; }
details { border-bottom: 1px solid var(--line); padding: 12px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; color: var(--mute); }
.aside-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; align-self: start; position: sticky; top: calc(var(--head-h) + 16px); }
.aside-box h2 { font-size: 18px; }
.aside-box a { display: block; padding: 7px 0; text-decoration: none; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.aside-box a:last-child { border-bottom: 0; }
.aside-box a:hover { color: var(--accent-text); }
.prose { max-width: 72ch; }
.prose h1 { font: 600 clamp(28px, 3.6vw, 40px) var(--f-display); }
.prose h2 { font: 600 22px var(--f-display); margin-top: 28px; }

/* ---------- footer ---------- */
footer.foot { background: var(--shell); color: var(--shell-mute); padding-block: 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); font-size: 14px; }
.foot-in { max-width: 1060px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 24px; }
.foot h3 { color: var(--shell-fg); font: 600 15px var(--f-body); margin: 0 0 10px; }
.foot a { display: block; color: var(--shell-mute); text-decoration: none; padding: 3px 0; }
.foot a:hover { color: var(--shell-fg); }
.foot-bottom { max-width: 1060px; margin: 24px auto 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* ---------- helper bot ---------- */
.bot-fab { position: fixed; inset-inline-end: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 80; background: var(--mint); color: var(--mint-ink); border: 0; border-radius: 99px; padding: 12px 18px; font: 700 15px var(--f-body); box-shadow: 0 10px 30px rgba(38,19,43,.28); cursor: pointer; display: flex; gap: 8px; align-items: center; }
.bot { position: fixed; inset-inline-end: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(78px + env(safe-area-inset-bottom, 0px)); z-index: 80; width: min(360px, calc(100vw - 32px)); max-height: min(520px, 70vh); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px rgba(38,19,43,.3); overflow: hidden; }
.bot header { background: var(--shell); color: var(--shell-fg); padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.bot-close { background: none; border: 0; color: var(--shell-fg); font-size: 18px; cursor: pointer; }
.bot-log { padding: 12px; overflow-y: auto; display: grid; gap: 8px; flex: 1; align-content: start; }
.bot-msg { padding: 9px 12px; border-radius: 12px; font-size: 14.5px; max-width: 92%; }
.bot-msg.them { background: var(--sunk); justify-self: start; }
.bot-msg.me { background: var(--mint); color: var(--mint-ink); justify-self: end; }
.bot-msg.links { display: grid; gap: 6px; padding: 8px; }
.bot-msg.links a { display: grid; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.bot-msg.links span { font-size: 12.5px; color: var(--mute); }
.bot form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.bot form input { flex: 1; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .content { grid-template-columns: minmax(0, 1fr); }
  .aside-box { position: static; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .foot-in { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .icon-btn-top { display: block; }
  .side { position: fixed; z-index: 90; top: 0; bottom: 0; height: auto; inset-inline-start: 0; width: min(290px, 84vw); transform: translateX(-105%); transition: transform .22s ease; padding-top: calc(16px + env(safe-area-inset-top, 0px)); padding-inline-start: max(10px, env(safe-area-inset-left, 0px)); }
  [dir="rtl"] .side { transform: translateX(105%); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 85; background: rgba(24,14,32,.5); }
  .top .search { display: none; }
  .top-links .hide-sm { display: none; }
  .brand { margin-inline-end: auto; }
}
@media (max-width: 560px) {
  .grid2, .why { grid-template-columns: minmax(0, 1fr); }
  .hero-art { grid-template-columns: repeat(2, 1fr); }
  .lang span { display: none; }
  .foot-in { grid-template-columns: minmax(0, 1fr); }
  .swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bot-fab span.label { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
.cat-grid { margin-top: 22px; }

/* ---------- questionnaires & checklists ---------- */
.quiz { display: grid; gap: 12px; }
.quiz-intro { margin: 0; font-size: 16px; max-width: 70ch; }
.q { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0; background: var(--bg); min-width: 0; }
.q legend { padding: 0 6px; font-weight: 600; font-size: 15.5px; display: flex; gap: 10px; align-items: baseline; float: left; width: 100%; margin-bottom: 10px; }
.q legend + * { clear: both; }
.qn { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--sunk); color: var(--accent-text); font: 700 13px var(--f-body); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts label { position: relative; cursor: pointer; }
.opts input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opts span { display: block; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 14.5px; transition: background .12s, border-color .12s; }
.opts label:hover span { border-color: var(--focus); }
.opts input:checked + span { background: var(--mint); border-color: var(--mint); color: var(--mint-ink); font-weight: 600; }
.opts input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.check.block { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); line-height: 1.45; }
.check.block:last-child { border-bottom: 0; }
.check.block input { margin-top: 4px; flex: none; accent-color: var(--focus); width: 17px; height: 17px; }
.crisis { border: 2px solid var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); border-radius: 12px; padding: 14px 16px; }
.crisis b:first-child { color: var(--bad); font-size: 16px; }
.crisis p { margin: 8px 0 0; }
.cite { font-size: 12.5px; color: var(--mute); margin: 0; }
.side-search { margin-bottom: 12px; display: none; }
@media (max-width: 860px) { .side-search { display: block; } .side-search .search-results { position: static; margin-top: 6px; box-shadow: none; } }
.preview-note { margin: 0; font-size: 14px; }

/* ---------- album maker ---------- */
.photo-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-strip li { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: grid; gap: 6px; min-width: 0; }
.photo-strip img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; }
.photo-strip input { padding: 6px 8px; font-size: 13px; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; align-items: start; }
.album-page { position: relative; width: 100%; max-width: 100%; overflow: hidden; border-radius: 4px; box-shadow: 0 6px 18px rgba(38, 19, 43, .18); container-type: inline-size; }
.ap-slot { position: absolute; overflow: visible; }
.ap-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-cap { position: absolute; top: 100%; left: 0; right: 0; font-size: 3.4cqw; font-style: italic; line-height: 1.3; padding-top: 1cqw; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-cover-shade { position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,0) 35%, rgba(0,0,0,0) 75%, rgba(0,0,0,.55)); }
.ap-mast { position: absolute; left: 6%; right: 6%; top: 5%; color: #fff; display: grid; gap: 1cqw; }
.ap-mast small { font: 700 2.6cqw var(--f-body); letter-spacing: .12em; text-transform: uppercase; }
.ap-mast b { font-size: 11cqw; line-height: .95; font-weight: 700; }
.ap-sub { position: absolute; left: 6%; right: 6%; bottom: 6%; color: #fff; font-size: 3.6cqw; }
.ap-feature { position: absolute; left: 62%; right: 5%; top: 28%; display: grid; gap: 3cqw; }
.ap-feature i { display: block; width: 8cqw; height: 0.8cqw; }
.ap-feature b { font-size: 6cqw; line-height: 1.1; }
.ap-feature small { font: 2.8cqw var(--f-body); opacity: .75; }
.ap-band { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.55); color: #fff; font-style: italic; font-size: 3.6cqw; padding: 2.5cqw 6%; }
.ap-num { position: absolute; bottom: 2%; left: 0; right: 0; text-align: center; font-size: 2.6cqw; opacity: .6; }
.ap-back { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 3cqw; padding: 10%; }
.ap-back b { font-size: 7cqw; }
.ap-back span { font-size: 3.8cqw; font-style: italic; }
.ap-back small { font: 2.8cqw var(--f-body); opacity: .7; }

/* ---------- ebook maker ---------- */
.eb-top { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 20px; align-items: start; }
.eb-cover { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 10px 28px rgba(38, 19, 43, .25); position: sticky; top: calc(var(--head-h) + 16px); }
.eb-chapters { display: grid; gap: 8px; }
.eb-ch { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 0; }
.eb-ch summary { padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.eb-ct { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.eb-body { display: grid; gap: 8px; padding: 0 14px 14px; }
.eb-body .ct { font-weight: 600; }
@media (max-width: 700px) { .eb-top { grid-template-columns: minmax(0, 1fr); } .eb-cover { position: static; max-width: 220px; justify-self: center; } }

/* ---------- keyword ideas ---------- */
.kw-group h3 { font: 600 16px var(--f-body); margin: 0 0 8px; }
.kw-group h3 small { color: var(--mute); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 99px; padding: 5px 12px; font: 14px var(--f-body); cursor: pointer; }
.chip:hover { border-color: var(--focus); }
.related-searches { margin-top: 26px; }
.related-searches h2 { font: 600 20px var(--f-display); margin: 0 0 10px; }
.related-searches .chips a { border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; text-decoration: none; font-size: 14px; background: var(--surface); }
.related-searches .chips a:hover { border-color: var(--focus); }
.home-searches a { text-decoration: none; background: var(--surface); }
.home-faq { max-width: 820px; }

/* ================= MOTION LAYER =================
   Everything here is decoration: content is fully visible without it,
   and the global prefers-reduced-motion rule switches it all off. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

/* hero: drifting light + floating tiles */
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; filter: blur(40px); opacity: .5; z-index: 0; }
.hero::before { width: 340px; height: 340px; background: radial-gradient(circle, rgba(245,71,104,.55), transparent 70%); top: -120px; right: 18%; animation: pf-drift 14s ease-in-out infinite alternate; }
.hero::after { width: 260px; height: 260px; background: radial-gradient(circle, rgba(245,71,104,.25), transparent 70%); bottom: -120px; left: -60px; animation: pf-drift 18s ease-in-out infinite alternate-reverse; }
.hero > * { position: relative; z-index: 1; }
@keyframes pf-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-60px, 40px) scale(1.15); } }
.hero h1 { animation: pf-rise .7s cubic-bezier(.2,.7,.2,1) both; }
.hero p, .hero .hero-actions { animation: pf-rise .7s .12s cubic-bezier(.2,.7,.2,1) both; }
@keyframes pf-rise { from { transform: translateY(14px); } to { transform: none; } }
.hero-art a { animation: pf-float 6s ease-in-out infinite; }
.hero-art a:nth-child(2) { animation-delay: -1s; } .hero-art a:nth-child(3) { animation-delay: -2s; }
.hero-art a:nth-child(4) { animation-delay: -3s; } .hero-art a:nth-child(5) { animation-delay: -4s; } .hero-art a:nth-child(6) { animation-delay: -5s; }
@keyframes pf-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.hero-art a:hover { animation-play-state: paused; transform: translateY(-4px) scale(1.04); }
.hero-art b { transition: transform .3s; display: inline-block; }
.hero-art a:hover b { transform: rotate(-6deg) scale(1.12); }

/* cards: lift, icon tilt, light sweep */
.card { position: relative; overflow: hidden; transition: border-color .2s, transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(38,19,43,.12); }
.card .ico { transition: transform .3s cubic-bezier(.2,.7,.2,1), background .2s, color .2s; }
.card:hover .ico { transform: rotate(-8deg) scale(1.1); background: var(--mint); color: var(--mint-ink); }
.card::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 50%; background: linear-gradient(100deg, transparent, rgba(245,71,104,.14), transparent); transform: skewX(-18deg); transition: left .6s ease; pointer-events: none; }
.card:hover::after { left: 120%; }
.why div, .aside-box, .tool-panel { transition: transform .25s, box-shadow .25s; }
.why div:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(38,19,43,.1); }

/* scroll reveal: JS adds .pf-pre only to elements that start below the screen */
.pf-pre { opacity: 0; transform: translateY(18px); }
.pf-in { opacity: 1; transform: none; transition: opacity .55s ease, transform .6s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }

/* buttons, chips, inputs */
.btn { transition: transform .12s, filter .15s, border-color .15s, box-shadow .2s; }
.btn:active { transform: scale(.97); }
.btn.primary:hover { box-shadow: 0 6px 16px rgba(245,71,104,.35); }
.chip, .home-searches a, .related-searches .chips a { transition: transform .15s, border-color .15s, background .15s; }
.chip:hover, .home-searches a:hover { transform: translateY(-2px); }
.opts span { transition: background .15s, border-color .15s, transform .15s; }
.opts input:checked + span { animation: pf-pop .25s ease; }
@keyframes pf-pop { 50% { transform: scale(1.06); } }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 25%, transparent); transition: box-shadow .15s, border-color .15s; }

/* drop zone */
.drop-icon { transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.drop:hover .drop-icon { transform: rotate(90deg) scale(1.08); }
.drop.over { animation: pf-breathe 1s ease-in-out infinite; }
@keyframes pf-breathe { 50% { transform: scale(1.01); } }

/* results appear */
.quiz ~ .result > *, .status:not([hidden]) { animation: pf-in .35s ease both; }
@keyframes pf-in { from { transform: translateY(6px); } to { transform: none; } }
.crisis { animation: pf-in .35s ease both, pf-glow 2.2s ease-in-out 2; }
@keyframes pf-glow { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--bad) 15%, transparent); } }

/* album pages: lift like paper */
.album-page { transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s; transform-origin: left center; }
.album-page:hover { transform: perspective(900px) rotateY(-8deg) translateY(-4px); box-shadow: 10px 14px 28px rgba(38,19,43,.25); }
.eb-cover { transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s; }
.eb-cover:hover { transform: perspective(900px) rotateY(-10deg) translateX(6px); box-shadow: 16px 18px 34px rgba(38,19,43,.3); }

/* helper bot: one gentle nudge, panel springs open */
.bot-fab { transition: transform .2s; }
.bot-fab:hover { transform: translateY(-2px) scale(1.03); }
.bot-fab.nudge { animation: pf-nudge 1.2s ease 2; }
@keyframes pf-nudge { 0%, 100% { transform: none; } 30% { transform: translateY(-6px); } 60% { transform: translateY(0); } 75% { transform: translateY(-3px); } }
.bot:not([hidden]) { animation: pf-pop-in .25s cubic-bezier(.2,.7,.2,1); transform-origin: bottom right; }
@keyframes pf-pop-in { from { transform: scale(.92) translateY(10px); } to { transform: none; } }
.bot-msg { animation: pf-in .25s ease both; }

/* sidebar */
.side a { transition: background .15s, padding .2s; }
.side a:hover { padding-inline-start: 16px; }

/* page top progress while a new page loads */
.pf-loading::after { content: ""; position: fixed; top: env(safe-area-inset-top, 0px); left: 0; height: 3px; z-index: 200; background: var(--mint); animation: pf-load 1.2s ease-out forwards; }
@keyframes pf-load { from { width: 0; } to { width: 85%; } }

/* ---------- languages ---------- */
:root:lang(ar), :root:lang(ur) { --f-body: "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif; --f-display: "Noto Naskh Arabic", Georgia, serif; }
:root:lang(hi) { --f-body: "Noto Sans Devanagari", "Nirmala UI", sans-serif; --f-display: "Noto Sans Devanagari", Georgia, serif; }
:root:lang(ar) body, :root:lang(ur) body { line-height: 1.75; }
.lang-suggest { position: fixed; z-index: 85; inset-inline-start: calc(16px + env(safe-area-inset-left, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 4px; background: var(--shell); color: var(--shell-fg); border-radius: 99px; padding: 4px 4px 4px 14px; box-shadow: 0 10px 28px rgba(38,19,43,.28); animation: pf-pop-in .3s ease; }
.lang-suggest a { color: var(--peach); font-weight: 700; text-decoration: none; padding: 6px 4px; }
.lang-suggest button { background: none; border: 0; color: var(--shell-mute); font-size: 15px; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }

/* ---------- added: PDF page viewer (sign, edit), signature pad, crop, OCR, media ---------- */
.pv-nav { align-items: center; }
.pv-stage { position: relative; display: inline-block; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 6px 20px rgb(15 43 49 / .08); }
.pv-stage canvas { display: block; max-width: 100%; }
.pv-layer { position: absolute; left: 0; top: 0; cursor: crosshair; touch-action: none; }
.pv-mark { position: absolute; cursor: pointer; outline: 1px dashed rgb(42 168 140 / .7); }
.pv-text { position: absolute; white-space: pre; line-height: 1; font-family: Helvetica, Arial, sans-serif; pointer-events: none; }
.pv-box { position: absolute; pointer-events: none; }
.pv-box.white { background: #fff; outline: 1px dashed #cbc2d6; }
.sig-box { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs .chip { cursor: pointer; border: 1px solid var(--line); background: var(--surface); font: inherit; }
.tabs .chip.on { background: var(--mint); color: var(--mint-ink); border-color: var(--mint); }
.sig-pad { width: 100%; max-width: 600px; aspect-ratio: 3 / 1; height: auto; background: #fff; border: 1px dashed var(--mute); border-radius: 8px; touch-action: none; cursor: crosshair; }
.field.inline { display: inline-flex; align-items: center; gap: 8px; }
.field.inline input[type=color] { width: 44px; height: 36px; padding: 2px; }
.crop-stage { position: relative; display: inline-block; max-width: 100%; user-select: none; touch-action: none; cursor: crosshair; line-height: 0; border-radius: 8px; overflow: hidden; }
.crop-stage img { display: block; max-width: 100%; max-height: 70vh; width: auto; }
.crop-box { position: absolute; box-shadow: 0 0 0 9999px rgb(0 0 0 / .5); outline: 2px solid #fff; cursor: move; background-image: linear-gradient(rgb(255 255 255 / .35) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .35) 1px, transparent 1px); background-size: 33.34% 33.34%; }
.crop-h { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; background: var(--mint); border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; }
.ocr-out { width: 100%; font: 15px/1.55 var(--f-body); padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); resize: vertical; }
.doc-preview { max-height: 420px; overflow: auto; padding: 18px 22px; background: #fff; color: #111; border: 1px solid var(--line); border-radius: 10px; font: 15px/1.6 Georgia, serif; }
.doc-preview img { max-width: 100%; }
.doc-preview table { border-collapse: collapse; } .doc-preview td, .doc-preview th { border: 1px solid #bbb; padding: 4px 6px; }
.preview .vid, .preview video { max-width: 100%; max-height: 380px; border-radius: 10px; background: #000; }
.preview audio { width: min(100%, 520px); }
.preview .tablewrap { max-width: 100%; }

/* ================= TRUST, SUBSCRIBE, 3D LAYER ================= */
/* trust badge */
.trust { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--good) 35%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--good) 11%, var(--surface)), var(--surface) 70%); margin-top: 16px; position: relative; }
.trust svg { width: 30px; height: 30px; flex: none; fill: color-mix(in srgb, var(--good) 14%, transparent); stroke: var(--good); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.trust b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.trust span { font-size: 14px; color: var(--mute); line-height: 1.45; }
.hero + .trust { margin: 14px 0 0; }
.foot .trust { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); margin: 12px 0 14px; padding: 12px 14px; }
.foot .trust b { color: var(--shell-fg); } .foot .trust span { color: var(--shell-mute); font-size: 13px; }
.foot .trust svg { stroke: var(--mint); fill: rgba(245,71,104,.12); width: 26px; height: 26px; }
.foot .btn + .btn { margin-inline-start: 8px; }

/* header subscribe + english */
.sub-btn { background: var(--mint); color: var(--mint-ink); border: 0; border-radius: 8px; padding: 8px 14px; font: 650 14px var(--f-body); cursor: pointer; white-space: nowrap; min-height: 36px; box-shadow: 0 4px 14px rgba(245,71,104,.25); transition: transform .2s, box-shadow .2s; }
.sub-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(245,71,104,.35); }
.en-switch { background: transparent; color: var(--shell-fg); border: 1px solid rgba(255,255,255,.22); border-radius: 99px; padding: 5px 11px; font: 500 13px var(--f-body); cursor: pointer; min-height: 32px; }
.en-switch:hover { background: rgba(255,255,255,.08); }
@media (max-width: 600px) { .sub-btn { padding: 7px 10px; font-size: 13px; } .en-switch { padding: 4px 8px; } }

/* subscribe dialog */
body.modal-open { overflow: hidden; }
.sub-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgb(6 20 23 / .55); backdrop-filter: blur(4px); perspective: 1200px; }
.sub-card { position: relative; width: min(100%, 440px); background: var(--surface); color: var(--fg); border-radius: 20px; padding: 28px 24px 20px; box-shadow: 0 30px 80px rgb(0 0 0 / .35); animation: pf-flipin .45s cubic-bezier(.2,.8,.2,1) both; text-align: center; }
@keyframes pf-flipin { from { transform: rotateX(-24deg) translateY(30px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.sub-card h2 { font: 600 24px/1.2 var(--f-display); margin: 6px 0 6px; }
.sub-card p { color: var(--mute); margin: 0 0 16px; font-size: 15px; }
.sub-ico { width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center; font-size: 26px; color: var(--mint-ink); background: linear-gradient(135deg, #ff9678, #f54768); transform: rotate(-8deg); box-shadow: 0 10px 24px rgba(151,64,99,.35); }
.sub-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sub-row input { flex: 1 1 200px; min-height: 44px; font: 16px var(--f-body); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); }
.sub-row .btn { min-height: 44px; flex: 0 0 auto; }
.sub-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--sunk); color: var(--fg); cursor: pointer; font-size: 15px; }
.sub-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.sub-msg { min-height: 22px; margin: 12px 0 4px !important; font-size: 14px !important; }
.sub-msg[data-kind=ok] { color: var(--good) !important; } .sub-msg[data-kind=error] { color: var(--bad) !important; }
.sub-fine { font-size: 12.5px !important; margin: 0 !important; } .sub-fine a { color: inherit; }

/* 3D cube beside every page title */
.tool-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; }
.cube3d { width: 96px; height: 96px; perspective: 520px; margin-inline-end: 12px; filter: drop-shadow(0 18px 18px rgb(15 43 49 / .18)); }
.cube { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(-20deg) rotateY(-32deg); animation: pf-spin 16s linear infinite; }
.cube i { position: absolute; inset: 0; display: grid; place-items: center; font: 700 17px var(--f-mono); font-style: normal; letter-spacing: -.02em; color: var(--mint-ink); border-radius: 14px; border: 1px solid rgba(255,255,255,.45); background: linear-gradient(140deg, #ff9678, #f54768); backface-visibility: hidden; }
.cube i:nth-child(1) { transform: translateZ(48px); }
.cube i:nth-child(2) { transform: rotateY(90deg) translateZ(48px); background: linear-gradient(140deg, #f54768, #974063); }
.cube i:nth-child(3) { transform: rotateY(180deg) translateZ(48px); }
.cube i:nth-child(4) { transform: rotateY(-90deg) translateZ(48px); background: linear-gradient(140deg, #f54768, #974063); }
.cube i:nth-child(5) { transform: rotateX(90deg) translateZ(48px); background: linear-gradient(140deg, #ffc2a8, #ff9678); }
.cube i:nth-child(6) { transform: rotateX(-90deg) translateZ(48px); background: #16383f; }
@keyframes pf-spin { from { transform: rotateX(-20deg) rotateY(-32deg); } to { transform: rotateX(-20deg) rotateY(328deg); } }
.tool-head:hover .cube { animation-duration: 4s; }
@media (max-width: 600px) { .tool-head { grid-template-columns: minmax(0, 1fr) 64px; gap: 12px; } .cube3d { width: 56px; height: 56px; margin: 0; } .cube i { font-size: 11px; border-radius: 9px; } .cube i:nth-child(1) { transform: translateZ(28px); } .cube i:nth-child(2) { transform: rotateY(90deg) translateZ(28px); } .cube i:nth-child(3) { transform: rotateY(180deg) translateZ(28px); } .cube i:nth-child(4) { transform: rotateY(-90deg) translateZ(28px); } .cube i:nth-child(5) { transform: rotateX(90deg) translateZ(28px); } .cube i:nth-child(6) { transform: rotateX(-90deg) translateZ(28px); } }

/* tool panel rises in with depth */
.tool-panel { animation: pf-panel .7s cubic-bezier(.2,.7,.2,1) both; transform-origin: 50% 0; box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgb(15 43 49 / .35); }
@keyframes pf-panel { from { transform: perspective(1400px) rotateX(9deg) translateY(22px); opacity: .25; } to { transform: none; opacity: 1; } }

/* 3D tilt + light glare (JS sets --rx/--ry/--mx/--my) */
.card.tilt, .hero-art a.tilt, .why > div.tilt, .aside-box.tilt, .trust.tilt { transform: perspective(800px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) translateZ(8px); transition: transform .08s linear, box-shadow .2s, border-color .2s; box-shadow: 0 18px 34px -12px rgb(6 24 27 / .25); }
.tool-panel.tilt { transform: perspective(1600px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)); transition: transform .12s linear; }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .2s; background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(245,71,104,.16), transparent 60%); }
.card.tilt::before { opacity: 1; }

/* hero: real 3D floating tile wall with pointer parallax */
.hero-art { perspective: 1000px; transform-style: preserve-3d; }
.hero-art { transform: rotateX(calc(14deg - var(--py, 0) * 10deg)) rotateY(calc(-14deg + var(--px, 0) * 14deg)); transition: transform .25s ease-out; }
.hero-art a { transform-style: preserve-3d; box-shadow: 0 16px 30px -14px rgb(0 0 0 / .5); backdrop-filter: blur(2px); }
.hero-art a:nth-child(odd) { animation-name: pf-float3d; }
.hero-art a:nth-child(even) { animation-name: pf-float3d-b; }
@keyframes pf-float3d { 0%, 100% { transform: translateZ(10px) translateY(0); } 50% { transform: translateZ(34px) translateY(-6px); } }
@keyframes pf-float3d-b { 0%, 100% { transform: translateZ(26px) translateY(-3px); } 50% { transform: translateZ(4px) translateY(3px); } }
.hero-art a b { transform: translateZ(18px); }
@media (max-width: 600px) { .hero-art { transform: none; } }
@media (prefers-reduced-motion: reduce) { .hero-art, .card.tilt, .tool-panel.tilt { transform: none !important; } }
/* compact header on phones so Subscribe, English and Language always fit */
@media (max-width: 600px) {
  .top { gap: 8px; }
  .top-links { gap: 6px; min-width: 0; }
  .lang select { max-width: 92px; padding: 5px 4px; }
}
@media (max-width: 440px) {
  .brand span { display: none; }
  .sub-btn { padding: 7px 9px; }
}
.lang span { white-space: nowrap; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 95; background: var(--shell); color: var(--shell-fg); padding: 12px 18px; border-radius: 12px; box-shadow: 0 14px 40px rgb(0 0 0 / .3); font-weight: 600; max-width: calc(100% - 32px); animation: pf-flipin .4s both; }
