/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f2f8;
  --line: #e3e5ef;
  --ink: #12142b;
  --ink-2: #4a4e6a;
  --ink-3: #7c809c;
  --accent: #4f46e5;
  --accent-2: #06b6d4;
  --accent-ink: #ffffff;
  --accent-soft: #eef0ff;
  --ok: #059669;
  --danger: #dc2626;
  --ad-bg: repeating-linear-gradient(135deg, #f3f4f8 0 12px, #eceef5 12px 24px);
  --ad-line: #c9ccdc;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(18,20,43,.05), 0 12px 32px -12px rgba(18,20,43,.14);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f1c;
    --surface: #161933;
    --surface-2: #1e2240;
    --line: #2b2f52;
    --ink: #eef0ff;
    --ink-2: #b7bbd8;
    --ink-3: #8a8fb2;
    --accent: #7c74ff;
    --accent-soft: #23264a;
    --ad-bg: repeating-linear-gradient(135deg, #1a1d38 0 12px, #1e2240 12px 24px);
    --ad-line: #3a3f68;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 16px 36px -14px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
body.has-sticky { padding-bottom: 76px; }
img, svg, video, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select { font: inherit; color: inherit; }
a { color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; line-height: 1.12; letter-spacing: -0.02em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent); color: #fff; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: 1320px; margin-inline: auto; padding-inline: var(--gutter); }
.skip-link { position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem; background: var(--accent); color: #fff; z-index: 9999; border-radius: 8px; }
.skip-link:focus { top: 1rem; }

/* =============================================================
   4. Header
   ============================================================= */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.28rem; letter-spacing: -.03em; }
.logo svg { stroke: none; }
.logo b { color: var(--accent); }
.main-nav { display: none; gap: 22px; font-size: .92rem; font-weight: 500; color: var(--ink-2); }
.main-nav a { text-decoration: none; }
.main-nav a:hover { color: var(--accent); }

/* =============================================================
   5. Layout
   ============================================================= */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 18px; }
.side-col { display: none; }

.hero { padding: 6px 0 14px; }
.hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(1.45rem, 4.6vw, 2.45rem); }
.hero-sub { color: var(--ink-2); margin-top: 8px; font-size: clamp(.92rem, 2.2vw, 1.05rem); max-width: 68ch; }

/* =============================================================
   6. Tool card
   ============================================================= */
.tool-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; background: var(--surface-2); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { display: flex; align-items: center; gap: 7px; white-space: nowrap; padding: 9px 13px; border-radius: 10px; font-size: .9rem; font-weight: 600; color: var(--ink-2); transition: background .2s var(--ease-out), color .2s; }
.tabs button svg { width: 18px; height: 18px; flex: none; }
.tabs button:hover { color: var(--ink); background: var(--surface); }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -8px var(--accent); }

.dropzone { margin: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; min-height: 270px; padding: 26px 18px; border: 2px dashed color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 14px; background: linear-gradient(180deg, var(--accent-soft), transparent 80%); cursor: pointer; transition: border-color .2s, background .2s, transform .2s var(--ease-out); }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.is-over { transform: scale(.995); }
.dz-icon { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 16px; background: var(--surface); color: var(--accent); box-shadow: var(--shadow); margin-bottom: 6px; }
.dz-icon svg { width: 36px; height: 36px; }
.dz-title { font-family: var(--display); font-size: 1.3rem; font-weight: 800; }
.dz-sub { color: var(--ink-2); font-size: .92rem; }
.dz-btn { margin-top: 10px; }
.dz-formats { font-size: .78rem; color: var(--ink-3); margin-top: 8px; }
.noscript { padding: 16px; color: var(--danger); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px; font-weight: 600; font-size: .95rem; text-decoration: none; transition: transform .15s var(--ease-out), background .2s, box-shadow .2s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -10px var(--accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.btn-big { min-height: 52px; font-size: 1.05rem; width: 100%; }
.link-btn { font-size: .86rem; color: var(--ink-3); text-decoration: underline; padding: 6px 0; align-self: flex-start; }
.link-btn:hover { color: var(--accent); }

/* Workspace */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr); }
.ws-view { padding: 12px; min-width: 0; }
.ws-panel { border-top: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.view-bar { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { padding: 6px 11px; border-radius: 8px; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg-block { display: flex; }
.seg-block button { flex: 1; }
.busy { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--ink-3); }
.busy i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }

.stage { position: relative; height: clamp(240px, 46vh, 520px); display: grid; place-items: center; background: var(--surface-2); border-radius: 12px; overflow: hidden; }
.stage-inner { position: relative; width: 100px; height: 100px; touch-action: none; }
.checker { background-color: #fff; background-image: linear-gradient(45deg, #e6e7ee 25%, transparent 25%), linear-gradient(-45deg, #e6e7ee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e6e7ee 75%), linear-gradient(-45deg, transparent 75%, #e6e7ee 75%); background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; box-shadow: 0 6px 22px -10px rgba(0,0,0,.35); }
.layer, .after-layer canvas, .after-layer img { position: absolute; inset: 0; width: 100%; height: 100%; }
.after-layer { clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 0; pointer-events: none; }
.compare-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1.5px; width: 3px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.18), 0 0 12px rgba(0,0,0,.25); }
.compare-handle span { position: absolute; top: 50%; left: 0; width: 38px; height: 38px; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.compare-handle span::before, .compare-handle span::after { content: ""; position: absolute; top: 50%; width: 0; height: 0; border: 6px solid transparent; transform: translateY(-50%); }
.compare-handle span::before { left: 5px; border-right-color: var(--accent); }
.compare-handle span::after { right: 5px; border-left-color: var(--accent); }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; -webkit-appearance: none; appearance: none; }
.tag { position: absolute; top: 8px; padding: 3px 8px; border-radius: 6px; font-size: .72rem; font-weight: 700; background: rgba(18,20,43,.72); color: #fff; pointer-events: none; }
.tag-before { left: 8px; } .tag-after { right: 8px; background: var(--accent); }
.stage[data-view="before"] .after-layer, .stage[data-view="before"] .compare-handle, .stage[data-view="before"] .tag-after, .stage[data-view="before"] .compare-range { display: none; }
.stage[data-view="after"] .after-layer { clip-path: none; }
.stage[data-view="after"] .compare-handle, .stage[data-view="after"] .tag-before, .stage[data-view="after"] .compare-range, .stage[data-view="after"] #cv-before { display: none; }
.stage[data-view="crop"] .after-layer, .stage[data-view="crop"] .compare-handle, .stage[data-view="crop"] .tag, .stage[data-view="crop"] .compare-range { display: none; }

.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(10,12,30,.55); cursor: move; outline: 1px solid rgba(0,0,0,.3); background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px); background-size: 33.333% 33.333%; background-position: -1px -1px; }
.crop-box .h { position: absolute; width: 22px; height: 22px; background: #fff; border-radius: 50%; box-shadow: 0 1px 6px rgba(0,0,0,.4); }
.crop-box .nw { left: -11px; top: -11px; cursor: nwse-resize; } .crop-box .ne { right: -11px; top: -11px; cursor: nesw-resize; }
.crop-box .sw { left: -11px; bottom: -11px; cursor: nesw-resize; } .crop-box .se { right: -11px; bottom: -11px; cursor: nwse-resize; }

.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.thumb { position: relative; flex: none; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--surface-2); padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb[aria-current="true"] { border-color: var(--accent); }
.thumb .x { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; font-size: 14px; line-height: 20px; text-align: center; }
.thumb .done { position: absolute; left: 3px; bottom: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ok); }
.thumb-add { flex: none; width: 64px; height: 64px; border-radius: 10px; border: 2px dashed var(--line); display: grid; place-items: center; color: var(--ink-3); font-size: 1.6rem; cursor: pointer; }
.thumb-add:hover { border-color: var(--accent); color: var(--accent); }

/* Panels */
.panel { display: flex; flex-direction: column; gap: 12px; }
.panel-title { font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; }
.panel-title.mt { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.panel-help { font-size: .86rem; color: var(--ink-2); }
.note { font-size: .8rem; color: var(--ink-3); }
.note:empty { display: none; }
.note.warn { color: #b45309; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.row { flex-direction: row; align-items: center; gap: 10px; }
.field label, .label { font-size: .85rem; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.field output { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; }
input[type="color"] { width: 44px; height: 36px; border: 1px solid var(--line); border-radius: 9px; padding: 2px; background: var(--surface); cursor: pointer; }
input[type="number"], select { height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--surface); min-width: 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .84rem; color: var(--ink-2); }
.check input { margin-top: 4px; accent-color: var(--accent); }

.fmt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fmt-grid button { padding: 10px 4px; border-radius: 10px; border: 1px solid var(--line); font-weight: 700; font-size: .85rem; background: var(--surface); transition: border-color .15s, background .15s; }
.fmt-grid button:hover { border-color: var(--accent); }
.fmt-grid button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.fmt-grid button:disabled { opacity: .4; cursor: not-allowed; }
.fmt-grid-sm button { padding: 7px 4px; font-size: .8rem; }

.chip { padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.chip-check input { accent-color: var(--accent); }
.presets, .ratio-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 36px; height: 36px; border-radius: 10px; border: 2px solid var(--line); background: var(--c); position: relative; }
.sw[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.sw-transparent { background-color: #fff; background-image: linear-gradient(45deg, #ddd 25%, transparent 25%), linear-gradient(-45deg, #ddd 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ddd 75%), linear-gradient(-45deg, transparent 75%, #ddd 75%); background-size: 10px 10px; background-position: 0 0, 0 5px, 5px -5px, -5px 0; }
.sw-custom { overflow: hidden; cursor: pointer; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.sw-custom input { opacity: 0; width: 100%; height: 100%; cursor: pointer; }

.wh { display: flex; align-items: flex-end; gap: 8px; }
.wh label { flex: 1; display: flex; flex-direction: column; align-items: stretch; font-size: .8rem; gap: 4px; }
.lock { width: 42px; height: 42px; flex: none; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-3); }
.lock svg { width: 18px; height: 18px; }
.lock[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.input-unit { display: flex; gap: 6px; }
.input-unit input { flex: 1; }
.icon-row { display: flex; gap: 8px; }
.icon-btn { width: 48px; height: 44px; border-radius: 11px; border: 1px solid var(--line); display: grid; place-items: center; background: var(--surface); }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }

.progress { display: flex; flex-direction: column; gap: 5px; }
.progress .bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.progress .bar i { display: block; height: 100%; width: var(--p, 0%); background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .25s; }
.progress.indeterminate .bar i { width: 35%; animation: indet 1.2s ease-in-out infinite; }
.progress-label { font-size: .8rem; color: var(--ink-2); }

.export { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.stats { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.stats span { display: block; font-size: .72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stats b { font-variant-numeric: tabular-nums; font-size: .98rem; }
.stats .arrow { color: var(--ink-3); }
.saving { font-weight: 800; font-size: .9rem; color: var(--ok); text-align: right; }
.saving.up { color: #b45309; }
.error-msg { margin: 0 14px 14px; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); font-size: .9rem; font-weight: 500; }

.privacy { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: var(--ink-2); margin: 14px 4px 0; }
.privacy svg { width: 18px; height: 18px; flex: none; color: var(--ok); margin-top: 2px; }

/* =============================================================
   7. Ad placeholders
   ============================================================= */
.ad-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--ad-bg); border: 2px dashed var(--ad-line); border-radius: 12px; color: var(--ink-3); text-align: center; }
.ad-slot span { font-weight: 800; letter-spacing: .18em; font-size: .85rem; }
.ad-slot small { font-size: .7rem; opacity: .8; }
.ad-leaderboard { min-height: 100px; margin: 24px auto 0; max-width: 728px; }
.ad-incontent { min-height: 280px; max-width: 336px; margin: 8px auto 36px; }
.ad-sidebar { position: sticky; top: 76px; width: 300px; height: 600px; }
.sticky-ad { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; justify-content: center; padding: 6px 44px 6px 8px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -16px rgba(0,0,0,.35); animation: slideUp .4s var(--ease-out); }
.ad-sticky { width: 320px; height: 50px; border-radius: 8px; flex-direction: row; gap: 10px; }
.sticky-close { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); font-size: 1.1rem; line-height: 1; }
.ad-modal { margin: auto; border: 0; border-radius: 20px; padding: 22px 20px 18px; width: min(360px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); text-align: center; }
.ad-modal[open] { display: flex; flex-direction: column; gap: 14px; align-items: center; animation: pop .3s var(--ease-out); }
.ad-modal::backdrop { background: rgba(10,12,30,.55); backdrop-filter: blur(2px); }
.modal-x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); font-size: 1.3rem; line-height: 1; }
.modal-ok { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ok); padding-right: 28px; }
.modal-ok svg { width: 22px; height: 22px; stroke-width: 3; }
.ad-modal-slot { width: 300px; max-width: 100%; height: 250px; }

/* =============================================================
   8. Content sections
   ============================================================= */
.section { padding: 44px 0 8px; }
.section-title { font-family: var(--display); font-weight: 800; font-size: clamp(1.45rem, 3.6vw, 2rem); }
.section-sub { color: var(--ink-2); margin-top: 6px; }
.steps { list-style: none; padding: 0; display: grid; gap: 14px; margin-top: 22px; counter-reset: s; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step-num { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 800; font-family: var(--display); margin-bottom: 12px; }
.steps h3 { font-size: 1.08rem; margin-bottom: 6px; }
.steps p, .use p { color: var(--ink-2); font-size: .93rem; }
.prose { max-width: 76ch; }
.prose h2 { font-family: var(--display); font-weight: 800; font-size: clamp(1.25rem, 3vw, 1.6rem); margin: 24px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--ink-2); }
.prose strong { color: var(--ink); }
.uses { display: grid; gap: 12px; margin-top: 22px; }
.use { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.use-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); margin-bottom: 10px; }
.use-ico svg { width: 22px; height: 22px; }
.use h3 { font-size: 1.02rem; margin-bottom: 4px; }
.faq { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 18px; }
.faq details[open] { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.faq summary { cursor: pointer; list-style: none; font-weight: 600; padding: 16px 28px 16px 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--accent); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding-bottom: 16px; color: var(--ink-2); font-size: .95rem; }

.site-footer { margin-top: 56px; border-top: 1px solid var(--line); padding: 28px 0 32px; font-size: .88rem; color: var(--ink-2); }
.footer-inner { display: flex; flex-direction: column; gap: 10px; }
.footer-inner nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-inner nav a { text-decoration: none; font-weight: 600; }
.footer-inner nav a:hover { color: var(--accent); }
.credits { font-size: .76rem; color: var(--ink-3); }

/* Legal pages */
.legal { max-width: 760px; padding: 32px var(--gutter) 40px; margin: 0 auto; }
.legal h1 { font-family: var(--display); font-size: 2rem; margin-bottom: 16px; }
.legal h2 { font-size: 1.2rem; margin: 22px 0 8px; }
.legal p, .legal li { color: var(--ink-2); margin-bottom: 8px; }
.todo { background: #fff7d6; color: #7a5a00; padding: 1px 6px; border-radius: 5px; font-weight: 600; }

/* =============================================================
   9. Effects
   ============================================================= */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
@keyframes slideUp { from { transform: translateY(100%); } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }

/* =============================================================
   10. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .uses { grid-template-columns: repeat(2, 1fr); }
  .fmt-grid { grid-template-columns: repeat(7, 1fr); }
  .fmt-grid-sm { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 720px) {
  :root { --gutter: 24px; }
  .main-nav { display: flex; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .uses { grid-template-columns: repeat(3, 1fr); }
  .ad-sticky { width: 728px; height: 90px; }
  body.has-sticky { padding-bottom: 116px; }
  .footer-inner { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; }
  .credits { flex-basis: 100%; }
}
@media (min-width: 960px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 340px; }
  .ws-panel { border-top: 0; border-left: 1px solid var(--line); max-height: 720px; overflow-y: auto; }
  .ws-view { padding: 16px; }
  .stage { height: 520px; }
  .fmt-grid { grid-template-columns: repeat(4, 1fr); }
  .dropzone { min-height: 340px; }
}
@media (min-width: 1280px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .side-col { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .sticky-ad, .ad-modal[open] { animation: none; }
}
