/* ==========================================================
   Pixora — design system
   ========================================================== */
:root {
  --bg: #f6f7fb;
  --bg-soft: #eef0f8;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --text: #0e1124;
  --text-2: #3a3f5c;
  --muted: #6b7091;
  --border: #e4e6f0;
  --border-strong: #d2d5e4;
  --primary: #5145f5;
  --primary-hover: #4136e0;
  --primary-soft: #eceafe;
  --primary-ink: #ffffff;
  --grad: linear-gradient(135deg, #5145f5 0%, #8b3cf0 55%, #d946ef 100%);
  --success: #0f9f6e;
  --success-soft: #e3f7ef;
  --warn: #b7791f;
  --warn-soft: #fdf3e1;
  --danger: #d33b4c;
  --c-compress: #0ea5a4;
  --c-compress-soft: #dcf6f5;
  --c-resize: #e0861b;
  --c-resize-soft: #fdefdc;
  --c-convert: #5145f5;
  --c-convert-soft: #eceafe;
  --shadow-sm: 0 1px 2px rgba(16, 20, 50, .06);
  --shadow: 0 1px 2px rgba(16, 20, 50, .05), 0 8px 24px -8px rgba(16, 20, 50, .12);
  --shadow-lg: 0 2px 4px rgba(16, 20, 50, .04), 0 24px 48px -16px rgba(40, 30, 120, .22);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --checker: #e9ebf3;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090b16; --bg-soft: #0f1224; --surface: #121530; --surface-2: #161a38;
    --text: #eceefb; --text-2: #c4c8e4; --muted: #9096bb; --border: #232850; --border-strong: #31376a;
    --primary: #7b71ff; --primary-hover: #8f87ff; --primary-soft: #221f55; --primary-ink: #ffffff;
    --success: #34d399; --success-soft: #0f2e27; --warn: #f2b25c; --warn-soft: #33260f; --danger: #ff6b7d;
    --c-compress: #2dd4bf; --c-compress-soft: #0d2e30; --c-resize: #f6a845; --c-resize-soft: #33240e;
    --c-convert: #8f87ff; --c-convert-soft: #221f55;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -10px rgba(0,0,0,.6);
    --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.7); --checker: #1c2045;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #090b16; --bg-soft: #0f1224; --surface: #121530; --surface-2: #161a38;
  --text: #eceefb; --text-2: #c4c8e4; --muted: #9096bb; --border: #232850; --border-strong: #31376a;
  --primary: #7b71ff; --primary-hover: #8f87ff; --primary-soft: #221f55; --primary-ink: #ffffff;
  --success: #34d399; --success-soft: #0f2e27; --warn: #f2b25c; --warn-soft: #33260f; --danger: #ff6b7d;
  --c-compress: #2dd4bf; --c-compress-soft: #0d2e30; --c-resize: #f6a845; --c-resize-soft: #33240e;
  --c-convert: #8f87ff; --c-convert-soft: #221f55;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -10px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.7); --checker: #1c2045;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 800; letter-spacing: -.035em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 860px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-display); font-weight: 800; font-size: 1.22rem; letter-spacing: -.03em; }
.logo:hover { color: var(--text); }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 6px 16px -6px rgba(81,69,245,.7); }
.logo-mark svg { width: 20px; height: 20px; stroke: #fff; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav > a, .nav-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px;
  color: var(--text-2); font-weight: 550; font-size: .95rem; background: none; border: 0; cursor: pointer;
}
.nav > a:hover, .nav-btn:hover, .has-menu:focus-within .nav-btn { background: var(--bg-soft); color: var(--text); }
.has-menu { position: relative; }
.chev { width: 14px; height: 14px; transition: transform .2s; }
.has-menu:hover .chev, .has-menu.open .chev { transform: rotate(180deg); }
.mega {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(6px);
  width: min(760px, 92vw); padding: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transition: opacity .18s, transform .18s, visibility .18s;
}
.has-menu::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 12px; }
.has-menu:hover .mega, .has-menu.open .mega { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.mega h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 4px 10px 6px; font-family: var(--font); font-weight: 700; }
.mega a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); font-size: .92rem; font-weight: 500; }
.mega a:hover { background: var(--bg-soft); }
.mega .dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.mega .dot svg { width: 15px; height: 15px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
.menu-toggle { display: none; }
@media (max-width: 860px) {
  .menu-toggle { display: grid; }
  .header-inner { gap: 10px; }
  .theme-toggle { margin-left: auto; }
  .nav {
    position: fixed; inset: 66px 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px 16px 20px;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
    max-height: calc(100vh - 66px); overflow-y: auto; display: none; margin: 0;
  }
  .nav.open { display: flex; }
  .nav-btn { display: none; }
  .mega { position: static; transform: none; opacity: 1; visibility: visible; width: auto; grid-template-columns: 1fr; box-shadow: none; border: 0; padding: 0 0 8px; background: none; }
  .has-menu:hover .mega, .has-menu.open .mega { transform: none; }
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 12px;
  font-weight: 650; font-size: .95rem; border: 1px solid transparent; cursor: pointer; transition: transform .12s, background .15s, box-shadow .15s, border-color .15s;
  white-space: nowrap; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 8px 20px -10px rgba(81,69,245,.9); }
.btn-primary:hover { background: var(--primary-hover); color: var(--primary-ink); }
.btn-grad { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(139,60,240,.9); }
.btn-grad:hover { color: #fff; filter: brightness(1.06); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); }
.btn-sm { padding: 7px 12px; font-size: .86rem; border-radius: 10px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------------- Hero (home) ---------------- */
.hero { position: relative; padding: 72px 0 40px; text-align: center; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -66px 0 0; z-index: -1;
  background:
    radial-gradient(600px 300px at 18% 10%, color-mix(in srgb, #8b3cf0 22%, transparent), transparent 70%),
    radial-gradient(520px 280px at 82% 0%, color-mix(in srgb, #0ea5a4 18%, transparent), transparent 70%),
    radial-gradient(700px 360px at 50% 100%, color-mix(in srgb, #5145f5 14%, transparent), transparent 70%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; margin-bottom: 22px;
  background: var(--surface); border: 1px solid var(--border); font-size: .86rem; color: var(--text-2); box-shadow: var(--shadow-sm);
}
.hero-badge b { background: var(--success-soft); color: var(--success); padding: 2px 9px; border-radius: 999px; font-size: .78rem; }
.hero h1 { max-width: 900px; margin: 0 auto 18px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--muted); max-width: 640px; margin: 0 auto 30px; }
.search { position: relative; max-width: 560px; margin: 0 auto; }
.search svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input {
  width: 100%; padding: 16px 20px 16px 50px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface);
  box-shadow: var(--shadow); font-size: 1rem; outline: none;
}
.search input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft), var(--shadow); }
.trust { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center; margin-top: 26px; color: var(--muted); font-size: .9rem; }
.trust span { display: inline-flex; align-items: center; gap: 7px; }
.trust svg { color: var(--success); width: 17px; height: 17px; }

/* ---------------- Tool grid ---------------- */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head p { color: var(--muted); margin: 0; }
.cat-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; font-size: 1.05rem; }
.cat-title .dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.cat-title .dot svg { width: 17px; height: 17px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tool-card-link {
  position: relative; display: flex; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.tool-card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); color: var(--text); }
.tool-card-link .ti { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tool-card-link .ti svg { width: 22px; height: 22px; }
.tool-card-link h3 { font-size: 1rem; margin: 2px 0 4px; letter-spacing: -.01em; }
.tool-card-link p { margin: 0; font-size: .87rem; color: var(--muted); line-height: 1.5; }
.tool-card-link .go { position: absolute; right: 16px; top: 18px; width: 18px; height: 18px; color: var(--muted); opacity: 0; transform: translateX(-4px); transition: .18s; }
.tool-card-link:hover .go { opacity: 1; transform: none; }
.c-compress { background: var(--c-compress-soft); color: var(--c-compress); }
.c-resize { background: var(--c-resize-soft); color: var(--c-resize); }
.c-convert { background: var(--c-convert-soft); color: var(--c-convert); }
.no-results { display: none; text-align: center; color: var(--muted); padding: 30px; }

/* ---------------- Features ---------------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feature { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.feature .fi { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 14px; }
.feature h3 { margin-bottom: 6px; }
.feature p { margin: 0; color: var(--muted); font-size: .93rem; }

/* ---------------- Tool page ---------------- */
.tool-hero { padding: 36px 0 22px; text-align: center; position: relative; isolation: isolate; }
.tool-hero::before {
  content: ""; position: absolute; inset: -66px 0 0; z-index: -1;
  background: radial-gradient(640px 260px at 50% 0%, color-mix(in srgb, var(--cat, #5145f5) 18%, transparent), transparent 72%);
}
.tool-hero[data-cat="compress"] { --cat: #0ea5a4; }
.tool-hero[data-cat="resize"] { --cat: #e0861b; }
.tool-hero[data-cat="convert"] { --cat: #5145f5; }
.tool-hero h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); max-width: 820px; margin: 0 auto 12px; }
.tool-hero .lead { color: var(--muted); font-size: 1.08rem; max-width: 640px; margin: 0 auto; }
.crumbs { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; font-size: .84rem; color: var(--muted); margin-bottom: 14px; padding: 0; list-style: none; }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: .78rem; font-weight: 650; }

.workspace {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 22px; margin: 10px auto 0; max-width: 980px;
}
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 230px; padding: 30px 20px; border-radius: 18px; cursor: pointer;
  border: 2px dashed var(--border-strong); background:
    radial-gradient(400px 160px at 50% 0%, var(--primary-soft), transparent 75%), var(--surface-2);
  transition: border-color .18s, background .18s, transform .18s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); }
.dropzone.drag { transform: scale(1.01); background: radial-gradient(500px 200px at 50% 0%, var(--primary-soft), transparent 80%), var(--primary-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dz-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--grad); color: #fff; margin-bottom: 16px; box-shadow: 0 14px 30px -12px rgba(139,60,240,.8); }
.dz-icon svg { width: 30px; height: 30px; }
.dz-title { font-family: var(--font-display); font-weight: 750; font-size: 1.22rem; margin-bottom: 4px; }
.dz-sub { color: var(--muted); font-size: .92rem; }
.dz-sub kbd { font-family: var(--mono); font-size: .8rem; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); background: var(--surface); }
.dz-btn { margin-top: 16px; pointer-events: none; }
.dz-privacy { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: .82rem; color: var(--success); font-weight: 600; }
.dz-privacy svg { width: 15px; height: 15px; }
.dropzone.compact { min-height: 0; padding: 16px; flex-direction: row; gap: 14px; text-align: left; }
.dropzone.compact .dz-icon { width: 44px; height: 44px; margin: 0; border-radius: 12px; }
.dropzone.compact .dz-icon svg { width: 22px; height: 22px; }
.dropzone.compact .dz-title { font-size: 1rem; margin: 0; }
.dropzone.compact .dz-btn, .dropzone.compact .dz-privacy { display: none; }

/* options */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 18px; margin-top: 18px; padding: 18px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.options:empty { display: none; }
.opt { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.opt.wide { grid-column: 1 / -1; }
.opt[hidden] { display: none; }
.opt label, .opt .lbl { font-size: .8rem; font-weight: 650; color: var(--text-2); display: flex; justify-content: space-between; gap: 8px; }
.opt .val { color: var(--primary); font-variant-numeric: tabular-nums; }
.opt input[type="number"], .opt input[type="text"], .opt select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); outline: none; min-height: 42px;
}
.opt input:focus, .opt select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input-suffix { position: relative; }
.input-suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; pointer-events: none; }
.input-suffix input { padding-right: 44px !important; }
.seg { display: flex; padding: 3px; gap: 3px; border-radius: 11px; background: var(--bg-soft); border: 1px solid var(--border); flex-wrap: wrap; }
.seg button { flex: 1; padding: 7px 10px; border: 0; border-radius: 8px; background: none; cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
input[type="range"] { width: 100%; accent-color: var(--primary); height: 24px; }
input[type="color"] { width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 10px; padding: 4px; background: var(--surface); cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--text-2); }
.chips button:hover { border-color: var(--primary); color: var(--primary); }
.chips button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }

/* results */
.results { display: grid; gap: 12px; margin-top: 18px; }
.results:empty { display: none; }
.result {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 16px; align-items: center; padding: 12px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--surface); animation: pop .25s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.thumb {
  width: 92px; height: 92px; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  background-color: var(--surface-2);
  background-image: linear-gradient(45deg, var(--checker) 25%, transparent 25%), linear-gradient(-45deg, var(--checker) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker) 75%), linear-gradient(-45deg, transparent 75%, var(--checker) 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.r-name { font-weight: 650; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: .84rem; color: var(--muted); margin-top: 4px; }
.r-meta .arrow { opacity: .6; }
.badge { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.badge.good { background: var(--success-soft); color: var(--success); }
.badge.info { background: var(--primary-soft); color: var(--primary); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.r-note { font-size: .82rem; color: var(--warn); margin-top: 5px; }
.r-actions { display: flex; gap: 8px; align-items: center; }
.r-actions .icon-btn { width: 38px; height: 38px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result.error .r-meta { color: var(--danger); }
.results.single .result { grid-template-columns: 1fr; text-align: center; }
.results.single .thumb { width: 100%; height: auto; min-height: 200px; max-height: 460px; aspect-ratio: auto; padding: 14px; }
.results.single .thumb img { max-height: 430px; width: auto; height: auto; max-width: 100%; }
.results.single .r-meta, .results.single .r-actions { justify-content: center; }
.results.single .r-actions .btn { min-width: 220px; }
.b64-out { width: 100%; min-height: 150px; resize: vertical; font-family: var(--mono); font-size: .78rem; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); word-break: break-all; }
.result.b64 { grid-template-columns: 92px 1fr; }
.result.b64 .b64-wrap { grid-column: 1 / -1; display: grid; gap: 8px; }
.results.single .result.b64 { grid-template-columns: 1fr; }
.results-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.results-bar[hidden] { display: none; }
.results-bar .count { color: var(--muted); font-size: .9rem; }
.results-bar .count b { color: var(--text); }
.results-bar .acts { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .workspace { padding: 14px; border-radius: 20px; }
  .result { grid-template-columns: 64px 1fr; }
  .thumb { width: 64px; height: 64px; }
  .r-actions { grid-column: 1 / -1; }
  .r-actions .btn { flex: 1; }
  .result.b64 { grid-template-columns: 64px 1fr; }
}

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-size: .9rem; font-weight: 600; opacity: 0; transition: .25s; z-index: 99; pointer-events: none; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; counter-reset: step; }
.step { position: relative; padding: 22px 22px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.step::before {
  counter-increment: step; content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad); color: #fff; font-weight: 800; margin-bottom: 12px; font-family: var(--font-display);
}
.step h3 { margin-bottom: 4px; font-size: 1.02rem; }
.step p { margin: 0; color: var(--muted); font-size: .92rem; }

/* prose */
.prose { color: var(--text-2); font-size: 1.02rem; line-height: 1.75; }
.prose h2 { color: var(--text); margin: 1.8em 0 .6em; }
.prose h3 { color: var(--text); margin: 1.5em 0 .5em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--primary); }
.prose strong { color: var(--text); }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.3em; font-size: .94rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.prose th { color: var(--text); font-weight: 700; background: var(--surface-2); }
.prose .callout { padding: 16px 18px; border-radius: 14px; background: var(--primary-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); margin: 0 0 1.2em; }
.card-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(22px, 4vw, 44px); }

/* FAQ */
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 20px; transition: border-color .15s; }
.faq details[open] { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.faq summary { cursor: pointer; list-style: none; padding: 17px 0; font-weight: 650; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary); transition: transform .2s; flex: none; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .ans { padding: 0 0 18px; color: var(--text-2); }
.faq .ans p:last-child { margin: 0; }

/* ads */
.ad-slot { margin: 32px auto; max-width: 980px; text-align: center; min-height: 0; }
.ad-slot .ad-label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 6px; }
.ad-placeholder { display: grid; place-items: center; height: 100px; border: 1px dashed var(--border-strong); border-radius: 12px; color: var(--muted); font-size: .8rem; }

/* guides */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.guide-card { display: flex; flex-direction: column; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: transform .18s, box-shadow .18s; }
.guide-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--text); }
.guide-card .kicker { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); margin-bottom: 10px; }
.guide-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.guide-card p { color: var(--muted); font-size: .92rem; margin: 0 0 14px; }
.guide-card .more { margin-top: auto; font-weight: 650; font-size: .9rem; color: var(--primary); display: inline-flex; gap: 6px; align-items: center; }
.article-head { text-align: center; padding: 40px 0 26px; }
.article-head .meta { color: var(--muted); font-size: .9rem; }

/* CTA band */
.cta-band { margin: 20px 0 10px; padding: clamp(28px, 5vw, 48px); border-radius: var(--radius-lg); background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; position: relative; overflow: hidden; }
.cta-band h2 { color: #fff; margin: 0 0 6px; }
.cta-band p { margin: 0; opacity: .9; }
.cta-band .btn { background: #fff; color: #3b2fd9; }
.cta-band .btn:hover { color: #3b2fd9; filter: brightness(.96); }

/* footer */
.site-footer { margin-top: 60px; border-top: 1px solid var(--border); background: var(--surface); padding: 48px 0 28px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 28px; }
.footer-grid h4 { font-family: var(--font); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--text-2); }
.footer-grid a:hover { color: var(--primary); }
.footer-about p { color: var(--muted); margin: 12px 0 0; max-width: 300px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }

/* contact */
.contact-card { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); margin: 0 0 1.2em; flex-wrap: wrap; }
.contact-card .fi { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
