/* Copyright 2026 Mattia Piazzalunga
 * SPDX-License-Identifier: Apache-2.0 */

/* ─── Font ─────────────────────────────────────────────────────────────── */
@font-face {
  font-family: Inter;
  src: url('https://cdn.jsdelivr.net/npm/@fontsource-variable/inter@5.3.0/files/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ─── Design tokens ────────────────────────────────────────────────────── */
:root {
  /* Amber, coral and blue from the chosen OneKit cube. */
  --brand:       #2264d9; /* primary actions / blue face */
  --brand-mid:   #428cf2;
  --brand-hi:    #88bdff;
  --brand-dk:    #163f9f;
  --brand-glow:  #2452c5;
  --accent-coral: #f83d8d;
  --accent-coral-ink: #b92288;
  --accent-amber: #ffa347;
  --accent-amber-ink: #99530c;

  /* Neutral scale */
  --ink:     #18181b;
  --ink-2:   #3f3f46;
  --muted:    #71717a;
  --muted-2:  #8f8f9a;
  --subtle:   #a1a1aa;
  --line:     #e4e4e7;
  --line-hi:  #f4f4f5;
  --surface:  #fafafa;
  --surface-2: #f0f0f4;
  --bg:       #ffffff;

  /* Semantic */
  --green:  #16a34a;
  --red:    #dc2626;
  --amber:  #d97706;

  /* Geometry */
  --radius-xs: 2px;
  --radius-sm: 8px;
  --radius:    12px;
  --radius-md: var(--radius);
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm:  0 1px 3px 0 rgb(0 0 0 / .06), 0 1px 2px -1px rgb(0 0 0 / .04);
  --shadow:     0 4px 16px -2px rgb(0 0 0 / .08), 0 2px 6px -2px rgb(0 0 0 / .04);
  --shadow-lg:  0 12px 40px -6px rgb(0 0 0 / .1), 0 4px 12px -4px rgb(0 0 0 / .06);

  /* Typography */
  --font: Inter, ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* ─── Reset & base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
button, input, select, textarea { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 3px; }
[hidden] { display: none !important; }

/* ─── Layout shell ─────────────────────────────────────────────────────── */
.wrap {
  max-width: 1180px;
  width: calc(100% - 80px);
  margin-inline: auto;
}

.skip {
  position: fixed; top: -80px; left: 16px;
  background: var(--bg); color: var(--ink);
  padding: 10px 16px; border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow); z-index: 200;
  font-weight: 600; font-size: 13px;
  transition: top 150ms ease;
}
.skip:focus { top: 12px; }

/* ─── Header / Nav ─────────────────────────────────────────────────────── */
.header {
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / .92);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

.nav {
  height: 100%;
  display: flex; align-items: center;
  justify-content: space-between; gap: 24px;
}

/* Brand */
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 22px; letter-spacing: -0.9px; font-weight: 800;
  flex-shrink: 0;
}
.brand img { object-fit: contain; }
.brand, .brand:hover { color: var(--ink); }
.brand-dot { color: var(--brand); margin-left: -5px; }

/* Nav links */
.nav-links {
  display: flex; align-items: center; gap: 2px;
  font-size: 13px; font-weight: 500;
}
.nav-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  color: var(--muted); transition: color 120ms, background 120ms;
}
.nav-links > a > .tool-glyph, .footer-links > a > .tool-glyph, .footer-links > button > .tool-glyph { width: 16px; height: 16px; }
.footer-links > a, .footer-links > button { display: inline-flex; align-items: center; gap: 6px; }
.nav-links a:hover { color: var(--ink); background: var(--line-hi); }
.nav-links a[aria-current] {
  color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent);
  font-weight: 600;
}
.nav-feedback-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

#tools-nav-trigger { display: inline-flex; align-items: center; gap: 6px; }
.tools-nav-arrow { flex: none; transition: transform 120ms; margin-left: -2px; }
[aria-expanded="true"] > .tools-nav-arrow { transform: rotate(180deg); }

/* Floating tool menus keep their pointers aligned with the active trigger. */
.tools-navigation {
  position: absolute; top: calc(100% + 12px); left: 16px;
  width: min(920px, calc(100vw - 32px));
}
.tools-sections, .tools-section-links {
  position: relative; border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg); box-shadow: 0 12px 36px rgb(0 0 0 / .12);
}
.tools-sections::before, .tools-section-links::before {
  content: ''; position: absolute; top: -7px;
  left: calc(var(--tools-pointer, 50%) - 7px); width: 12px; height: 12px;
  transform: rotate(45deg); background: inherit;
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.tools-sections::after, .tools-section-links::after {
  content: ''; position: absolute; left: 0; right: 0; top: -16px; height: 16px;
}
.tools-navigation .tools-nav-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  width: 100%; max-width: none; margin: 0; padding: 12px;
}
.tools-section, .tools-section-links a {
  display: inline-flex; align-items: center; gap: 8px;
  flex: 0 1 auto; min-width: 0; max-width: 100%; padding: 8px 10px;
  text-align: left; overflow-wrap: anywhere;
  font: inherit; font-size: 13px; font-weight: 500;
  color: var(--muted); background: transparent; border: 0; border-radius: 6px;
}
.tools-section { cursor: pointer; }
.tools-nav-icon {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; width: 26px; height: 26px; border-radius: 6px;
  color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent);
  font-size: 16px; line-height: 1;
}
.tool-glyph { display: block; width: 100%; height: 100%; flex: none; }
.tools-nav-icon .tool-glyph { width: 24px; height: 24px; }
.tools-section:hover, .tools-section[aria-expanded="true"], .tools-section-links a:hover {
  color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, transparent);
}
.tools-section-links { margin-top: 16px; background: #fff; }
.tools-section:focus-visible, .tools-section-links a:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* Nav actions */
.nav-actions { display: flex; gap: 8px; align-items: center; }

.free-badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  color: var(--brand); font-size: 11px; font-weight: 700;
  letter-spacing: .3px; white-space: nowrap;
}

/* GitHub button */
.github-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff; font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  transition: background 150ms, box-shadow 150ms;
}
.github-link:hover { color: #fff; background: var(--ink-2); box-shadow: var(--shadow-sm); }
.github-icon { display: block; flex: none; filter: invert(1); }

/* Donate */
.donate { font-size: 20px; line-height: 1; color: var(--muted); transition: color 120ms; }
.donate:hover { color: var(--red); }

/* Hamburger */
.menu-toggle {
  display: none; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius-sm); padding: 5px 8px;
  font-size: 18px; line-height: 1; color: var(--ink-2);
}

/* ─── Hero ─────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: stretch;
  gap: 48px;
  padding-block: 56px 48px;
}

/* Hero copy */
.hero-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hero-brand-badge {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.free-highlight {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid color-mix(in srgb, var(--accent-amber) 25%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent-amber) 7%, transparent);
  color: var(--accent-amber-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.1px;
}
.free-highlight > span { font-size: 15px; line-height: 1; }
.privacy-highlight { border-color: color-mix(in srgb,var(--brand) 25%,transparent); background: color-mix(in srgb,var(--brand) 7%,transparent); color: var(--brand); }

.hero h1 {
  font-size: clamp(38px, 4.4vw, 58px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: clamp(-1.8px, -2.5px, -2.5px);
  margin: 0 0 16px;
  color: var(--ink);
}

.gradient-text {
  color: var(--brand);
}

.hero-copy > p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.hero-actions .button {
  min-height: 40px;
  padding: 9px 18px;
}
.hero-actions .tool-glyph { width: 18px; height: 18px; }
.hero-actions .button:not(.secondary) > .tool-glyph { color: inherit; }

/* Prominent Trust Badges */
.hero-trust {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  margin-top: 0;
}
.trust-badge {
  display: grid;
  grid-template-columns: 32px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  min-height: 62px;
  height: 100%;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.trust-badge:hover {
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.trust-icon-box {
  width: 32px;
  height: 32px;
  color: var(--brand);
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 15%, var(--line));
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.trust-icon-box .tool-glyph { width: 21px; height: 21px; }
.trust-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}
.trust-info strong {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.trust-info span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.25;
}

/* Hero featured on the right side */
.local-processing {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.hero-trust:has(+ .local-processing) { margin-bottom: 26px; }
.local-processing > p:last-child { margin-bottom: 0; }
.local-processing-heading { display: flex; align-items: center; gap: 10px; }
.local-processing-heading > .tool-glyph { width: 22px; height: 22px; flex: none; }
.local-processing h2 { margin: 0; font-size: 17px; line-height: 1.4; letter-spacing: -.3px; }
.local-processing > p { margin: 10px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.7; max-width: 520px; }
.local-processing-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.local-processing-steps li { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: var(--ink); font-size: 12px; font-weight: 500; line-height: 1.4; }
.local-processing-steps li > span { display: grid; place-items: center; width: 30px; height: 28px; border-radius: 7px; border: 1px solid color-mix(in srgb,var(--brand) 18%,var(--line)); background: color-mix(in srgb,var(--brand) 5%,var(--bg)); color: var(--brand); font-size: 11px; font-weight: 700; }
@media (max-width: 1050px) { .local-processing { display: none; } .hero-trust:has(+ .local-processing) { margin-bottom: 0; } }

.hero-featured {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.hero-featured-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.hero-featured-head > .quiet-link { flex: none; white-space: nowrap; margin-bottom: 3px; }
.hero-featured-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.6px;
  margin: 4px 0 0;
}
.favorites-heart { width: 22px; height: 22px; flex: none; color: var(--accent-coral); fill: color-mix(in srgb,var(--accent-coral) 8%,transparent); }
.hero-featured .featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.hero-featured .tool-card {
  padding: 16px;
  background: var(--bg);
}
.hero-featured .tool-card h3 {
  font-size: 13px;
  margin: 10px 0 3px;
}
.hero-featured .tool-card p {
  font-size: 11px;
}
.hero-featured .card-bottom {
  margin-top: 14px;
}

/* ─── Buttons ──────────────────────────────────────────────────────────── */
.button {
  display: inline-flex; justify-content: center; align-items: center;
  gap: 8px; padding: 10px 20px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff; font-size: 13px; font-weight: 600; line-height: 1.4;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--brand) 25%, transparent), inset 0 1px 0 rgb(255 255 255 / .1);
  transition: background 150ms, transform 150ms, box-shadow 150ms;
  white-space: nowrap; cursor: pointer;
}
.button:hover {
  background: var(--brand-dk); color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 35%, transparent), inset 0 1px 0 rgb(255 255 255 / .1);
  transform: translateY(-1px);
}
.button:active:not(:disabled) { transform: translateY(0) scale(.99); box-shadow: none; }

.button.secondary {
  background: var(--bg); border-color: var(--line); color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.button.secondary:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  background: var(--surface); color: var(--brand);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.button[aria-busy=true] { opacity: .7; pointer-events: none; }
.button[aria-busy=true]::before {
  content: '';
  width: 13px; height: 13px; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.quiet-link {
  font-size: 13px; font-weight: 600; color: var(--muted);
  display: inline-flex; gap: 6px; align-items: center;
  transition: color 120ms;
}
.quiet-link:hover { color: var(--brand); }

/* ─── Section headings ─────────────────────────────────────────────────── */
.section-heading {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; margin-bottom: 24px;
}
.section-heading h2 {
  font-size: 26px; font-weight: 700; letter-spacing: -1px;
  line-height: 1.25; margin: 0;
}
.muted { color: var(--muted); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: clamp(0.8px, 1.8px, 1.8px);
  color: var(--muted);
  margin-bottom: 4px;
}
.status-dot {
  display: inline-block; width: 6px; height: 6px;
  background: #22c55e; border-radius: var(--radius-xs); flex-shrink: 0;
}

/* ─── Tool cards ───────────────────────────────────────────────────────── */
.tool-card {
  position: relative; display: block;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; background: var(--bg);
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.tool-card:hover {
  border-color: var(--subtle);
  box-shadow: var(--shadow);
  transform: translateY(-2px); color: var(--ink);
}

.card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
}

.tool-icon {
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  font-size: 20px; font-weight: 500; letter-spacing: -1px;
  flex-shrink: 0;
}
.tool-icon .tool-glyph { width: 44px; height: 44px; }
.tool-icon.pdf        { background: #fff1f2; color: #e11d48; }
.tool-icon.images     { background: #f0fdf4; color: #16a34a; }
.tool-icon.converters { background: #eff6ff; color: #2563eb; }
.tool-icon.developer  { background: #fffbeb; color: #d97706; }
.tool-icon.inspector  { background: #ecfeff; color: #0891b2; }
.tool-icon.security   { background: #fff1f6; color: var(--accent-coral-ink); }
.tool-icon.diff       { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand); }
.tool-icon.ocr        { background: #fef9c3; color: #ca8a04; }
.tool-icon.video      { background: #fff7ed; color: #ea580c; }
.tool-icon.audio      { background: #fdf2f8; color: #db2777; }
.tool-icon.archives   { background: #f8fafc; color: #475569; }
.tool-icon.fonts      { background: #eff6ff; color: var(--brand-dk); }

/* fidelity badge */
.fidelity {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  border: 1px solid #d1fae5; border-radius: 6px;
  font-size: 11px; color: #16a34a;
  background: #f0fdf4; font-weight: 600;
  cursor: help; position: relative; vertical-align: middle;
  transition: box-shadow 120ms;
}
.fidelity.compromise { color: var(--amber); background: #fffbeb; border-color: #fde68a; }
.fidelity:hover, .fidelity:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.fidelity:hover::after, .fidelity:focus::after {
  content: attr(data-tooltip);
  position: absolute; right: 0; top: 30px; z-index: 30;
  background: var(--ink); color: #fff;
  border-radius: var(--radius-sm); padding: 10px 12px;
  width: min(220px, 80vw); max-width: 220px; font-size: 11px; line-height: 1.55;
  box-shadow: var(--shadow-lg); font-weight: 400; cursor: default;
}

.tool-card h3 {
  font-size: 14px; font-weight: 600; letter-spacing: -.2px;
  margin: 14px 0 4px;
}
.tool-card p { font-size: 11px; color: var(--muted); margin: 0; line-height: 1.5; }

.card-bottom {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; color: var(--subtle); margin-top: 20px;
}
.card-bottom > span[aria-hidden] { font-size: 13px; color: var(--subtle); margin-left: auto; }

.tool-card.unavailable {
  background: var(--surface); opacity: .5;
  transform: none !important; box-shadow: none !important;
  cursor: default;
}
.tool-card.unavailable .fidelity { opacity: 1; }

/* ─── Toolkit section ──────────────────────────────────────────────────── */
.toolkit {
  padding-block: 40px 60px;
  border-top: 1px solid var(--line);
}
.toolkit h1 { font-size: 36px; letter-spacing: -1.5px; font-weight: 700; }

/* Search */
.search {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); padding: 8px 12px; min-width: 220px;
  transition: border-color 150ms, box-shadow 150ms;
}
.search > span { font-size: 20px; color: var(--subtle); line-height: 1; }
.search input { border: 0; min-width: 0; width: 100%; font-size: 12px; background: none; outline: 0; }
.search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
}

kbd {
  font-family: var(--font); font-size: 9px;
  border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 5px; color: var(--subtle); background: var(--surface);
}

/* Category tabs */
.category-tabs {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 0 12px; overflow-x: auto; scrollbar-width: none;
  overscroll-behavior-inline: contain; scroll-padding-inline: 48px;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-scroll { position: relative; min-width: 0; margin-bottom: 4px; }
.category-scroll::before, .category-scroll::after { content: ''; position: absolute; top: 0; bottom: 8px; width: 64px; z-index: 1; pointer-events: none; opacity: 0; }
.category-scroll::before { left: 0; background: linear-gradient(to right,var(--bg) 40%,transparent); }
.category-scroll::after { right: 0; background: linear-gradient(to left,var(--bg) 40%,transparent); }
.category-scroll[data-more-left=true]::before, .category-scroll[data-more-right=true]::after { opacity: 1; }
.category-scroll-button { position: absolute; top: calc(50% - 4px); transform: translateY(-50%); z-index: 2; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink-2); box-shadow: 0 2px 8px rgb(0 0 0 / .07); transition: color 120ms, border-color 120ms, background 120ms; }
.category-scroll-button.previous { left: 4px; }.category-scroll-button.next { right: 4px; }
.category-scroll-button:hover { color: var(--brand); border-color: color-mix(in srgb,var(--brand) 35%,var(--line)); background: color-mix(in srgb,var(--brand) 4%,var(--bg)); }
@media (pointer:coarse) { .category-scroll-button { width: 44px; height: 44px; } }
.category {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 7px 14px; background: transparent;
  font-size: 13px; color: var(--muted); white-space: nowrap;
  line-height: 1.4; font-weight: 500;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.category:hover { background: var(--surface); color: var(--ink); border-color: var(--line); }
.category.active {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  color: var(--brand); border-color: color-mix(in srgb, var(--brand) 25%, transparent);
  font-weight: 600;
}
.category span { margin-left: 5px; opacity: .5; font-size: 11px; }

/* Availability row */
#pipeline-form .runtime-status[data-state="ready"] { display: none; }
.availability {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 13px; margin: 0 0 20px; flex-wrap: wrap;
}
.availability label {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  min-height: 38px; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg); transition: border-color 150ms, background 150ms;
}
.availability label:hover { border-color: var(--brand); }
.availability label:has(input:checked) { border-color: color-mix(in srgb,var(--brand) 35%,var(--line)); background: color-mix(in srgb,var(--brand) 5%,var(--bg)); color: var(--brand-dk); }
.availability input[type="checkbox"] {
  appearance: none; position: relative; width: 30px; height: 18px; margin: 0;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  cursor: pointer; flex: none; transition: background 150ms, border-color 150ms;
}
.availability input[type="checkbox"]::before {
  content: ''; position: absolute; width: 12px; height: 12px; top: 2px; left: 2px;
  border-radius: 3px; background: var(--muted); transition: transform 150ms, background 150ms;
}
.availability input[type="checkbox"]:checked { background: var(--brand); border-color: var(--brand); }
.availability input[type="checkbox"]:checked::before { transform: translateX(12px); background: #fff; }
.availability input[type="checkbox"]:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.availability #result-count { margin-left: auto; color: var(--subtle); font-size: 12px; }

/* Tool grid */
.tool-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px;
}
.tool-grid .tool-card { padding: 16px; }
.tool-grid .tool-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); }
.tool-grid .tool-icon .tool-glyph { width: 40px; height: 40px; }
.category .tool-glyph { width: 22px; height: 22px; }
.tool-grid .tool-card h3 { font-size: 13px; }
.tool-grid .tool-card p  { font-size: 11px; }
.tool-grid .card-bottom  { margin-top: 16px; font-size: 10px; }

/* ─── Footer ───────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  padding-block: 40px 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
.footer .brand { font-size: 20px; }
.footer p { font-size: 11px; color: var(--subtle); margin: 6px 0; }

.footer-links {
  display: flex; gap: 18px; align-items: center;
  justify-content: flex-end; flex-wrap: wrap;
  font-size: 11px; color: var(--muted);
}
.footer-links a:hover, .footer-links button:hover { color: var(--brand); }

.footer-bottom {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line-hi); padding-top: 20px;
  font-size: 11px; color: var(--subtle);
}
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--brand); }
.footer-origin { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.footer-europe { display: inline-flex; align-items: center; gap: 7px; }
.footer-europe > .tool-glyph { width: 19px; height: 19px; flex: none; color: var(--brand); }

/* ─── Text button ──────────────────────────────────────────────────────── */
.text-button {
  border: 0; background: none; padding: 0;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
a:hover, button.text-button:hover { color: var(--brand); }

/* ─── Workspace / tool pages ───────────────────────────────────────────── */
.page-intro { padding-block: 64px 40px; }
.page-intro h1 {
  font-size: clamp(36px, 5vw, 60px); font-weight: 800;
  line-height: 1.1; letter-spacing: -2.5px; margin: 16px 0;
}
.page-intro p { color: var(--muted); font-size: 15px; max-width: 600px; }
.workflow-intro { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 48px; align-items: center; padding-block: 40px 32px; }
.workflow-intro > div { min-width: 0; }
.workflow-intro > div > p { line-height: 1.7; }
.workflow-local-note { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.workflow-local-note > .tool-glyph { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.workflow-guide { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--bg); box-shadow: var(--shadow-sm); }
.workflow-guide h2 { margin: 0 0 12px; font-size: 17px; letter-spacing: -.4px; }
.workflow-guide ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: workflow-guide; }
.workflow-guide li { --step-color: var(--brand); position: relative; display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 10px; align-items: center; padding: 9px 30px 9px 10px; border: 1px solid color-mix(in srgb,var(--step-color) 18%,var(--line)); border-radius: 10px; background: color-mix(in srgb,var(--step-color) 4%,var(--bg)); counter-increment: workflow-guide; }
.workflow-guide li:nth-child(2) { --step-color: var(--accent-coral); }
.workflow-guide li:nth-child(3) { --step-color: var(--accent-amber); }
.workflow-guide li::before { content: counter(workflow-guide,decimal-leading-zero); position: absolute; top: 12px; right: 12px; font-size: 10px; font-weight: 700; color: color-mix(in srgb,var(--step-color) 65%,var(--ink)); }
.workflow-guide li:not(:last-child)::after { content: ''; position: absolute; left: 24px; top: 100%; height: 9px; border-left: 2px dotted color-mix(in srgb,var(--step-color) 45%,var(--line)); }
.workflow-guide-icon { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid color-mix(in srgb,var(--step-color) 22%,var(--line)); border-radius: 8px; background: var(--bg); }
.workflow-guide .workflow-guide-icon > .tool-glyph { color: var(--step-color); }
.workflow-guide-icon > .tool-glyph { width: 20px; height: 20px; }
.workflow-guide strong { font-size: 13px; }
.workflow-guide li p { margin: 2px 0 0; font-size: 12px; line-height: 1.4; }
.workflow-guide .workflow-guide-tip { margin: 18px 0 0; padding: 10px 12px; border: 1px solid color-mix(in srgb,var(--brand) 15%,var(--line)); border-radius: 8px; background: color-mix(in srgb,var(--brand) 5%,var(--bg)); color: var(--brand-dk); font-size: 12px; line-height: 1.6; }
@media (max-width: 1050px) { .workflow-intro { gap: 24px; } }
@media (max-width: 760px) { .workflow-intro { grid-template-columns: 1fr; } .workflow-guide { padding: 16px; } }

.workspace { padding-block: 36px 72px; }

.back-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--muted); font-weight: 500;
  transition: color 120ms;
}
.back-link:hover { color: var(--brand); }
.tool-breadcrumbs span[aria-hidden] { color: var(--line); font-size: 14px; }

.workspace-heading {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px; margin: 24px 0;
}
.workspace-heading h1 {
  font-size: 36px; letter-spacing: -1.5px; font-weight: 800;
  margin: 6px 0; display: flex; align-items: center; gap: 10px;
}
.workspace-heading h1 .fidelity { flex: none; margin-left: 0; letter-spacing: 0; }
.workspace-heading p { color: var(--muted); max-width: 680px; font-size: 13px; }

.privacy-pill, .runtime-status[data-state=ready] {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  background: #f0fdf4; color: #16a34a;
  border: 1px solid #bbf7d0;
  font-size: 11px; font-weight: 600; white-space: nowrap; flex-shrink: 0;
}

/* Work panel */
.work-panel {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; background: var(--bg); box-shadow: var(--shadow-sm);
}
.work-panel h2 { font-size: 20px; font-weight: 700; letter-spacing: -.4px; margin-top: 0; margin-bottom: 6px; }
.work-panel > p { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Tool card panel */
.tool-card-panel {
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Input mode switcher (Segmented control) */
.input-mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.mode-header-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted-2);
}
.segmented-control {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  gap: 3px;
}
.segment-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: color 150ms, background 150ms, box-shadow 150ms;
}
.segment-btn:hover {
  color: var(--ink);
}
.segment-btn.active {
  color: var(--ink);
  font-weight: 600;
  background: var(--bg);
  box-shadow: 0 1px 4px rgb(0 0 0 / .12), 0 0 0 1px color-mix(in srgb, var(--brand) 30%, transparent);
}
.segment-icon {
  font-size: 13px;
  line-height: 1;
}

/* Input panels layout */
.input-panels-wrap {
  position: relative;
}
.input-panel {
  transition: opacity 120ms ease;
}
.input-panel[data-state="active"] {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}
#panel-file[data-state="inactive"] {
  display: none;
}
#panel-text[data-state="inactive"] {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

/* Dropzone */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 44px 20px;
  background: var(--surface);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: background 150ms, border-color 150ms, box-shadow 150ms;
}
.dropzone:hover {
  background: color-mix(in srgb, var(--brand) 4%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 50%, var(--line));
}
.dropzone:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}
.dropzone.drag-over {
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}

/* Visually hide native file picker widget while keeping full drag, click, and accessibility functionality */
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.dropzone-icon-box {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 10%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  color: var(--brand);
  font-size: 24px;
  transition: transform 160ms ease, background 160ms ease;
}
.dropzone:hover .dropzone-icon-box {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--brand) 16%, var(--surface-2));
}

.dropzone-content strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.dropzone-prompt {
  font-size: 13px;
  color: var(--muted);
}
.dropzone-browse-btn {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 150ms;
}
.dropzone:hover .dropzone-browse-btn {
  color: var(--brand-glow);
}
.dropzone-footer {
  margin-top: 4px;
}
.dropzone-hint {
  font-size: 12px;
  color: var(--muted-2);
}

/* Selected files container */
#selected-files {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 10px;
  line-height: 1.5;
}
#selected-files:empty {
  display: none;
}
.folder-option-row {
  margin-top: 12px;
}

/* Text editor box */
.text-editor-box {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 150ms, box-shadow 150ms;
}
.text-editor-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}
.text-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.editor-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 8px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
}
.editor-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.editor-count {
  font-size: 11px;
  color: var(--muted-2);
  font-family: var(--font-mono);
}
.editor-clear-btn {
  font-size: 11px;
  padding: 2px 6px;
  color: var(--muted);
}
.editor-clear-btn:hover {
  color: var(--ink);
}
#text-input {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: none;
  padding: 14px 16px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  min-height: 200px;
  outline: none;
}
#text-input::placeholder {
  color: var(--muted-2);
}

/* Tool options section */
.tool-options-section {
  margin-top: 6px;
}

/* Form fields */
.field {
  display: flex; flex-direction: column; gap: 6px;
  margin: 16px 0; color: var(--muted); font-size: 12px; font-weight: 500;
}
.field.inline { flex-direction: row; align-items: center; margin: 0; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); padding: 9px 12px;
  color: var(--ink); font-size: 13px; min-width: 0;
  transition: border-color 150ms, box-shadow 150ms;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
}
.field textarea {
  resize: vertical; line-height: 1.65;
  font-family: var(--font-mono);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 0 20px;
}

/* Run row */
.run-row {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 12px; margin-top: 24px;
}
.run-action-btn {
  min-height: 40px;
  padding: 10px 20px;
  font-size: 14px;
}

#processing-status { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; }
#processing-status:empty { display: none; }

/* Result panel */
.result-panel {
  margin-top: 24px;
  border: 1px solid color-mix(in srgb, #22c55e 30%, var(--line));
  border-radius: var(--radius-lg);
  padding: 24px;
  background: color-mix(in srgb, #22c55e 4%, var(--surface));
  box-shadow: var(--shadow-sm);
}
.result-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.result-icon-check {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, #22c55e 16%, transparent);
  color: #22c55e;
  font-weight: 700;
  font-size: 14px;
}
.result-panel h2 {
  font-size: 18px;
  margin: 0 0 4px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--ink);
}
.result-panel pre {
  margin-top: 14px;
  max-height: 380px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--ink-2);
}

.download-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* Notice / warning */
.notice {
  border: 1px solid #fde68a; background: #fffbeb;
  border-radius: var(--radius-lg); padding: 24px; color: #92400e;
}
.notice h2 { font-size: 20px; margin: 0 0 10px; font-weight: 700; letter-spacing: -.4px; }
.notice a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.notice p  { font-size: 13px; margin: 0 0 16px; }

.warning {
  font-size: 12px; color: #92400e; background: #fffbeb;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid #fde68a; margin-block: 8px;
}

/* ─── Tool explainer ───────────────────────────────────────────────────── */
.tool-explainer {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 48px; margin-top: 48px; padding-top: 32px;
  border-top: 1px solid var(--line);
}
.tool-explainer h2 { font-size: 17px; font-weight: 700; }
.tool-explainer p, .tool-explainer li { color: var(--muted); font-size: 13px; }
.tool-explainer ol { padding-left: 18px; }
.tool-explainer a { color: var(--brand); font-size: 13px; font-weight: 500; }

/* ─── Diff editor ──────────────────────────────────────────────────────── */
.diff-toolbar {
  display: flex; align-items: center; gap: 16px; margin: 0 0 20px;
}
.diff-toolbar > span { margin-right: auto; color: var(--muted); font-size: 13px; font-weight: 500; }

.diff-editors {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.diff-side:first-child { border-right: 1px solid var(--line); }

.diff-side-heading {
  display: flex; gap: 12px; align-items: center;
  background: var(--surface); padding: 12px 16px;
  font-size: 12px; border-bottom: 1px solid var(--line);
}
.diff-side-heading > label:first-child { font-weight: 600; margin-right: auto; color: var(--ink); }

.file-button {
  position: relative; overflow: hidden;
  color: var(--brand); cursor: pointer; font-weight: 500;
}
.file-button input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }

.diff-side textarea {
  display: block; border: 0; width: 100%; height: 380px;
  padding: 16px; resize: vertical; background: var(--bg);
  font: 12px/1.85 var(--font-mono);
  color: var(--ink);
}
.diff-display {
  height: 380px; overflow: auto; padding-block: 12px;
  font: 12px/1.85 var(--font-mono); background: var(--bg);
}
.diff-line {
  white-space: pre-wrap; overflow-wrap: anywhere;
  padding: 0 16px; min-height: 22px;
  content-visibility: auto; contain-intrinsic-size: auto 22px;
}
.diff-line.remove { background: #fff1f2; color: #9f1239; border-left: 3px solid #fda4af; }
.diff-line.add    { background: #f0fdf4; color: #15803d; border-left: 3px solid #86efac; }

.diff-actions { display: flex; gap: 12px; align-items: center; margin-block: 16px; }

.merge-block {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 12px;
}
.merge-block > span { margin-right: auto; color: var(--muted); }
.merge-block button {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); padding: 6px 12px;
  color: var(--brand); font-size: 12px; font-weight: 500;
  transition: background 120ms, border-color 120ms;
}
.merge-block button:hover { background: color-mix(in srgb, var(--brand) 6%, var(--bg)); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }

/* ─── Download page ────────────────────────────────────────────────────── */
.download-hero {
  padding-block: 48px 28px;
}
.download-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.terminal-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.terminal-badge-pill .badge-icon {
  color: var(--brand);
}
.platform-chips {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.platform-chip .chip-icon {
  font-size: 13px;
  color: var(--ink-2);
}

.download-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 36px;
  margin-bottom: 56px;
  align-items: stretch;
}
.download-layout > *, .requests-layout > * { min-width: 0; }

/* Download Package Picker Card */
.download-picker-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
}
.download-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.download-card-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.download-icon-box {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  font-size: 20px;
  flex-shrink: 0;
}
.download-card-title-group h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.6px;
  margin: 0 0 2px;
}
.download-security-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, #10b981 10%, transparent);
  border: 1px solid color-mix(in srgb, #10b981 25%, transparent);
  color: #059669;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.download-status-box {
  margin-top: 20px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.download-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
#download-status {
  overflow-wrap: anywhere;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  flex: 1 1 200px;
}
#download-status:empty {
  display: none;
}
#download-link {
  margin-left: auto;
  min-height: 40px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.download-card-footnote {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.footnote-icon {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}
.download-card-footnote p {
  margin: 0;
  line-height: 1.5;
}

/* Terminal Card */
.download-terminal-card {
  display: flex;
  flex-direction: column;
}
.terminal-window {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 36px -10px rgb(0 0 0 / .3);
  overflow: hidden;
}
.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  user-select: none;
}
.terminal-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}
.terminal-dots .dot {
  width: 11px;
  height: 11px;
  border-radius: var(--radius-xs);
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #eab308; }
.dot-green { background: #22c55e; }
.terminal-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: .2px;
}
.terminal-lang {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #0f172a;
  padding: 2px 8px;
  border-radius: 4px;
}
.terminal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  gap: 16px;
}
.terminal-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.terminal-comment {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #64748b;
}
.terminal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  overflow-x: auto;
}
.terminal-prompt {
  color: #38bdf8;
  font-family: var(--font-mono);
  font-weight: 700;
  user-select: none;
  font-size: 13px;
}
.terminal-row code {
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: nowrap;
  flex: 1;
}
.copy-cmd-btn {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 140ms, color 140ms, border-color 140ms;
  flex-shrink: 0;
}
.copy-cmd-btn:hover {
  background: #334155;
  color: #fff;
  border-color: #475569;
}
.copy-cmd-btn.copied {
  background: color-mix(in srgb, #10b981 20%, #1e293b);
  color: #34d399;
  border-color: #10b981;
}
.terminal-footer {
  padding: 14px 20px;
  background: #090d16;
  border-top: 1px solid #1e293b;
}
.terminal-gh-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #93c5fd;
  text-decoration: none;
  transition: color 150ms;
}
.terminal-gh-link:hover {
  color: #bfdbfe;
  text-decoration: underline;
}

/* Feature Grid */
.download-features-section {
  margin-bottom: 80px;
}
.download-features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform 160ms, box-shadow 160ms;
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--subtle);
}
.feature-icon-box {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--brand) 8%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  font-size: 20px;
  margin-bottom: 16px;
}
.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -.3px;
}
.feature-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

pre {
  padding: 16px 20px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface);
  overflow: auto; font: 12.5px/1.85 var(--font-mono); color: var(--ink-2);
}

/* ─── n8n-Style Workflow Canvas & Nodes ───────────────────────────────── */
.pipeline-canvas-wrap {
  margin-bottom: 72px;
}

.canvas-panel {
  background-color: #f9fafb;
  background-image: radial-gradient(circle, #d4d4d8 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 28px 24px 44px;
  box-shadow: inset 0 2px 12px rgb(0 0 0 / .03);
}

.canvas-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 1px dashed var(--line);
}
.canvas-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--bg);
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.canvas-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgb(34 197 94 / .2);
}
.canvas-info-pills {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.canvas-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

/* Canvas Action Controls */
.canvas-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.canvas-reset-btn:hover {
  background: var(--surface);
  border-color: var(--line);
  color: var(--brand);
}
.canvas-pill > .tool-glyph, .canvas-reset-btn > .tool-glyph { width: 18px; height: 18px; flex: none; }
.canvas-pill > .tool-glyph { color: var(--brand); }
.canvas-reset-btn { min-height: 36px; gap: 8px; }
#reset-canvas-layout { border-left-color: var(--line); border-top-left-radius: 0; border-bottom-left-radius: 0; }
.canvas-reset-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* Graph Flow */
.pipeline-graph {
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Node Cards */
.pipeline-node, .pipeline-step {
  position: relative;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px -2px rgb(0 0 0 / .05), 0 1px 3px 0 rgb(0 0 0 / .03);
  width: 380px;
  max-width: calc(100% - 16px);
  margin-inline: auto;
  transition: width 240ms cubic-bezier(.2,.8,.2,1), transform 240ms cubic-bezier(.2,.8,.2,1), border-color 160ms, box-shadow 240ms;
}
.pipeline-node:hover, .pipeline-step:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  box-shadow: 0 8px 24px -4px color-mix(in srgb, var(--brand) 12%, transparent), 0 2px 6px -1px rgb(0 0 0 / .04);
}

/* Enlarged State ("si ingrandiscono al click") */
.pipeline-node.is-enlarged, .pipeline-step.is-enlarged {
  width: 560px;
  max-width: calc(100% - 8px);
  border-color: var(--brand);
  box-shadow: 0 20px 48px -10px color-mix(in srgb, var(--brand) 25%, transparent), 0 0 0 2px var(--brand);
  z-index: 25;
}
.pipeline-node.is-enlarged .node-head,
.pipeline-step.is-enlarged .pipeline-step-head {
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 6%, var(--surface)), color-mix(in srgb, var(--brand) 12%, var(--surface)));
}
.pipeline-step.is-enlarged .step-options {
  padding: 10px 20px 18px;
}
.pipeline-node.is-enlarged .node-content {
  padding: 20px 22px;
}
.pipeline-node.is-enlarged .node-desc,
.pipeline-step.is-enlarged .node-desc {
  padding: 0 20px 12px;
  font-size: 12px;
}

/* Dragging State ("si possano spostare") */
.pipeline-node.is-dragging, .pipeline-step.is-dragging {
  z-index: 50 !important;
  box-shadow: 0 24px 50px -10px rgb(0 0 0 / .28), 0 0 0 2px var(--brand) !important;
  cursor: grabbing !important;
  transition: none !important;
}

/* Node Port Pins (n8n style) */
.node-port {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-xs);
  background: var(--bg);
  border: 2.5px solid var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
  z-index: 5;
}
.node-port-top {
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
}
.node-port-bottom {
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
}

/* Drag Handle */
.node-drag-handle {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: grab;
  user-select: none;
  touch-action: none;
  border-radius: 4px;
  transition: color 120ms, background 120ms;
  flex-shrink: 0;
}
.node-drag-handle:hover {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}
.is-dragging .node-drag-handle {
  cursor: grabbing;
  color: var(--brand);
}

/* Enlarge Badge */
.node-enlarge-badge {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms, color 140ms, border-color 140ms, transform 140ms;
  user-select: none;
  flex-shrink: 0;
}
.node-enlarge-badge:hover {
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  transform: scale(1.08);
}
.is-enlarged .node-enlarge-badge {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Node Header */
.node-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-top-left-radius: 11px;
  border-top-right-radius: 11px;
  cursor: grab;
}
.node-icon {
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  color: var(--brand);
  flex-shrink: 0;
}
.node-icon .tool-glyph { width: 24px; height: 24px; }
.node-title-group {
  display: flex;
  flex-direction: column;
  margin-right: auto;
}
.node-subtitle {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
}
.node-title-group strong {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}
.node-badge {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: #ecfeff;
  color: #0891b2;
  border: 1px solid #cffafe;
}

/* Node Content */
.node-content {
  padding: 12px 14px;
  transition: padding 200ms ease;
}

/* Pipeline Dropzone */
.pipeline-dropzone {
  background: var(--surface);
  border: 1.5px dashed color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  transition: background 140ms, border-color 140ms;
}
.pipeline-dropzone strong {
  font-size: 13px;
}
.pipeline-dropzone span {
  font-size: 12px;
}
.pipeline-dropzone small {
  font-size: 10.5px;
}
.pipeline-dropzone:hover {
  background: color-mix(in srgb, var(--brand) 4%, var(--bg));
  border-color: var(--brand);
}

/* Connectors */
.pipeline-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 34px;
  position: relative;
}
.connector-line {
  width: 2px;
  height: 100%;
  background: repeating-linear-gradient(to bottom, var(--brand) 0, var(--brand) 4px, transparent 4px, transparent 8px);
  opacity: .6;
}
.connector-arrow {
  position: absolute;
  bottom: 0;
  font-size: 8px;
  color: var(--brand);
  background: var(--bg);
  border-radius: var(--radius-xs);
  padding: 1px;
}

/* Step Node Specifics */
.pipeline-step {
  margin-top: 0;
  padding: 0;
}
.pipeline-step-head {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 14px 6px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-top-left-radius: 11px;
  border-top-right-radius: 11px;
  cursor: grab;
}
.pipeline-step-head .field {
  flex: 1;
  margin: 0;
}
.pipeline-step-head select {
  font-weight: 600;
  font-size: 13px;
  background-color: var(--bg);
  border-color: color-mix(in srgb, var(--brand) 25%, var(--line));
  cursor: pointer;
}
.node-badge-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
}
.node-step-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .3px;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  padding: 2px 7px;
  border-radius: 6px;
}
.step-number {
  font-weight: 800;
}
.node-close-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: var(--subtle);
  font-size: 12px;
  transition: background 120ms, color 120ms;
  margin-bottom: 4px;
}
.node-close-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}
.node-desc {
  display: block;
  padding: 0 14px 8px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
  transition: padding 200ms ease;
}
.step-options {
  padding: 4px 14px 12px;
  transition: padding 200ms ease;
}

/* Step Flow Connectors */
.pipeline-steps-flow {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}
.pipeline-steps-flow .pipeline-step:not(:first-child)::before {
  content: '▼';
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  color: var(--brand);
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(to bottom, var(--brand) 0, var(--brand) 4px, transparent 4px, transparent 8px);
  width: 2px;
  text-indent: -9999px;
  opacity: .6;
}

/* Action Node */
.action-node-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}
.action-node-content > .button { width: 100%; min-width: 0; padding: 10px 8px; gap: 6px; font-size: 12px; line-height: 1.4; white-space: normal; }
.action-node-content > #cancel-tool { grid-column: 1 / -1; }
.add-step-btn {
  border-style: dashed;
}
.run-pipeline-btn {
  padding: 10px 24px;
  font-weight: 700;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 30%, transparent);
}
.node-footer-status {
  padding: 0 20px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Result Node */
.pipeline-result-node {
  max-width: 620px;
  margin: 32px auto 0;
  border: 1.5px solid #86efac;
  background: #f0fdf4;
}

/* ─── Requests page ────────────────────────────────────────────────────── */
.requests-intro { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); align-items: start; gap: 40px; padding-block: 40px 32px; }
.requests-intro > div > p { line-height: 1.7; max-width: 520px; }
.requests-intro .quiet-link { font-size: 12px; color: var(--brand); }
.requests-guide { padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.requests-guide h2 { margin: 0 0 18px; font-size: 18px; letter-spacing: -.4px; }
.requests-guide > div { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.requests-guide > div > .tool-glyph { width: 27px; height: 27px; flex: none; }
.requests-guide > div:nth-of-type(2) > .tool-glyph { color: var(--accent-coral-ink); }
.requests-guide > div:nth-of-type(3) > .tool-glyph { color: var(--accent-amber-ink); }
.requests-guide strong, .requests-guide small { display: block; }
.requests-guide strong { font-size: 13px; }
.requests-guide small { font-size: 12px; line-height: 1.6; color: var(--muted); margin-top: 3px; }
.requests-layout > div:first-child { display: flex; flex-direction: column; }
.requests-layout > div:first-child > #requests-list { flex: 1; display: flex; }
.requests-empty { width: 100%; box-sizing: border-box; padding: 32px 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.requests-empty-icon { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid color-mix(in srgb,var(--brand) 20%,var(--line)); border-radius: 12px; background: color-mix(in srgb,var(--brand) 6%,var(--bg)); }
.requests-empty-icon > .tool-glyph { width: 30px; height: 30px; }
.requests-empty h3 { font-size: 20px; margin: 0; letter-spacing: -.5px; }
.requests-empty p { font-size: 13px; line-height: 1.7; color: var(--muted); max-width: 390px; margin: 0; }
.requests-empty .button { margin-top: 4px; }
#feedback-compose { scroll-margin-top: 90px; }
.feedback-compose-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.feedback-compose-title > .tool-glyph { width: 25px; height: 25px; flex: none; }
.feedback-compose-title h2 { margin: 0; }
.feedback-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); list-style: none; padding: 0; margin: 20px 0; gap: 10px; }
.feedback-steps li { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; font-size: 11px; line-height: 1.4; font-weight: 600; color: var(--ink); }
.feedback-steps li > .tool-glyph { width: 22px; height: 22px; color: var(--brand); }
.feedback-steps li > span { display: block; }
.feedback-privacy { display: flex; align-items: flex-start; gap: 10px; padding: 13px; margin-bottom: 22px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; font-size: 12px; line-height: 1.65; color: var(--muted); }
.feedback-privacy > .tool-glyph { width: 21px; height: 21px; flex: none; margin-top: 2px; }
.feedback-privacy strong { color: #15803d; }
#feedback-compose form > .button { width: 100%; }
#change-feedback-email { display: block; margin-top: 12px; }
.feedback-alternative { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 20px; }
.feedback-alternative summary { font-size: 11px; color: var(--muted); cursor: pointer; }
.feedback-alternative p, .feedback-alternative a { font-size: 12px; line-height: 1.6; }
.feedback-alternative p { color: var(--muted); }
.feedback-alternative a { color: var(--brand); }
@media (max-width: 760px) { .requests-intro { grid-template-columns: 1fr; gap: 22px; } .requests-guide { padding: 18px; } .requests-empty { min-height: 260px; } }
.requests-layout {
  display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr);
  gap: 40px; margin-bottom: 80px;
}
.requests-layout .work-panel { align-self: start; position: sticky; top: 80px; }
.requests-layout .section-heading { flex-wrap: wrap; }
.requests-layout .search { max-width: 100%; flex: 1; min-width: 160px; }

.request-item {
  border: 1px solid var(--line); padding: 16px;
  border-radius: var(--radius); margin-bottom: 12px;
  display: flex; align-items: flex-start; gap: 14px;
  transition: border-color 120ms, box-shadow 120ms;
}
.request-item:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); box-shadow: var(--shadow); }

.vote {
  display: flex; flex-direction: column; align-items: center;
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
  border-radius: var(--radius-sm); padding: 6px 12px; font-size: 12px; font-weight: 600;
  flex-shrink: 0; min-width: 52px; text-align: center;
  transition: background 120ms, border-color 120ms;
}
.vote:hover:not(:disabled) { background: color-mix(in srgb, var(--brand) 14%, transparent); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }

.request-item h3 { font-size: 14px; margin: 0 0 5px; font-weight: 600; }
.request-item p  { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }
.request-meta    { font-size: 10px; color: var(--subtle); }

/* ─── Prose pages ──────────────────────────────────────────────────────── */
.prose { max-width: 780px; padding-block: 56px 80px; }
.prose h1 { font-size: 40px; font-weight: 800; letter-spacing: -2px; line-height: 1.15; }
.prose h2 { font-size: 20px; font-weight: 700; margin-top: 36px; line-height: 1.3; }
.prose p  { font-size: 14px; color: var(--muted); line-height: 1.75; }
.prose a  { color: var(--brand); font-weight: 500; }

/* ─── Cookie banner ────────────────────────────────────────────────────── */
.cookie-banner {
  position: fixed; left: 50%;
  transform: translateX(-50%);
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(720px, calc(100% - 32px)); z-index: 50;
  padding: 20px 24px; background: var(--bg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  display: flex; align-items: center; gap: 24px;
  max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
}
.cookie-banner strong { font-size: 14px; font-weight: 700; }
.cookie-banner p { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.cookie-banner label { margin-right: 16px; font-size: 12px; cursor: pointer; }
.cookie-banner input { accent-color: var(--brand); }
.consent-actions { display: flex; flex-direction: column; gap: 7px; min-width: 130px; }
.consent-actions .button { font-size: 11px; padding: 8px 14px; }
.cookie-banner a { color: var(--brand); font-weight: 500; }

/* ─── Toast ────────────────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 90px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  border-radius: var(--radius-sm); z-index: 200;
  padding: 10px 18px; font-size: 13px; font-weight: 500;
  pointer-events: none; box-shadow: var(--shadow-lg);
}
#toast:empty { display: none; }

/* ─── Runtime status ───────────────────────────────────────────────────── */
.docs-page { padding-block: 42px 70px; }
.docs-intro { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding-bottom: 32px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.docs-intro h1 { font-size: clamp(32px,4vw,48px); letter-spacing: -1.8px; line-height: 1.1; margin: 12px 0 16px; }
.docs-intro p { max-width: 600px; margin: 0; font-size: 15px; color: var(--muted); line-height: 1.7; }
.docs-intro > .button { flex: none; }
.docs-intro .button > svg { width: 18px; height: 18px; color: inherit; }
.docs-layout { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 40px; align-items: start; }
.docs-index { position: sticky; top: 90px; display: grid; gap: 3px; }
.docs-index > strong { font-size: 11px; color: var(--subtle); text-transform: uppercase; letter-spacing: 1px; padding: 0 10px 12px; }
.docs-index a { border-radius: 7px; padding: 9px 10px; color: var(--muted); font-size: 12px; }
.docs-index a:hover, .docs-index a[aria-current] { background: color-mix(in srgb,var(--brand) 7%,var(--bg)); color: var(--brand); }
.docs-content { min-width: 0; }
.docs-section { --docs-accent: var(--brand); margin-bottom: 40px; padding-bottom: 36px; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.docs-section:has(#docs-workflow), .docs-section:has(#docs-open-source) { --docs-accent: var(--accent-coral-ink); }
.docs-section:has(#docs-cli), .docs-section:has(#docs-help) { --docs-accent: var(--accent-amber-ink); }
.docs-section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.docs-section-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 9px; background: color-mix(in srgb,var(--docs-accent,var(--brand)) 7%,var(--bg)); border: 1px solid color-mix(in srgb,var(--docs-accent,var(--brand)) 18%,var(--line)); }
.docs-section-icon > .tool-glyph { width: 24px; height: 24px; color: var(--docs-accent,var(--brand)); }
.docs-section-title .eyebrow { font-size: 9px; color: var(--docs-accent); }
.docs-section h2 { margin: 4px 0 0; font-size: 24px; line-height: 1.25; letter-spacing: -.7px; scroll-margin-top: 100px; }
.docs-section h3 { font-size: 14px; margin: 0 0 10px; }
.docs-section p, .docs-checklist { font-size: 14px; line-height: 1.75; color: var(--muted); }
.docs-section a:not(.button):not(.docs-path):not(.docs-resource-grid a) { color: var(--brand); font-weight: 600; }
.docs-section strong { color: var(--ink); }
.docs-paths { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 22px; }
.docs-path { --path-color: var(--brand); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px; border: 1px solid color-mix(in srgb,var(--path-color) 20%,var(--line)); border-radius: 12px; background: color-mix(in srgb,var(--path-color) 3%,var(--bg)); color: var(--ink); }
.docs-path:nth-child(2) { --path-color: var(--accent-coral-ink); }
.docs-path:nth-child(3) { --path-color: var(--accent-amber-ink); }
.docs-path:hover { border-color: var(--path-color); }
.docs-page .docs-path > .tool-glyph { width: 25px; height: 25px; color: var(--path-color); }
.docs-path strong { font-size: 14px; }
.docs-path > span { color: var(--muted); font-size: 12px; line-height: 1.6; }
.docs-path b { font-size: 12px; color: var(--path-color); margin-top: auto; padding-top: 4px; }
.docs-checklist { display: grid; gap: 12px; padding-left: 22px; margin-block: 20px; }
.docs-checklist li { padding-left: 5px; }
.docs-checklist li::marker { color: var(--docs-accent); font-weight: 700; }
.docs-callout { display: flex; gap: 12px; padding: 16px; border-radius: 10px; border: 1px solid #bbf7d0; background: #f0fdf4; margin-block: 20px; }
.docs-callout > .tool-glyph { width: 22px; height: 22px; flex: none; }
.docs-callout strong { font-size: 13px; }
.docs-callout p { font-size: 12px; margin: 5px 0 0; }
.docs-detail { border: 1px solid var(--line); border-radius: 9px; margin-top: 10px; background: var(--bg); }
.docs-detail summary { cursor: pointer; padding: 14px 16px; font-size: 13px; font-weight: 600; color: var(--ink); }
.docs-detail summary::marker { color: var(--docs-accent); }
.docs-detail[open] { border-color: color-mix(in srgb,var(--docs-accent) 35%,var(--line)); }
.docs-detail p { margin: 0; padding: 0 16px 16px; font-size: 13px; }
.docs-workflow-demo { padding: 20px; border: 1px solid color-mix(in srgb,var(--accent-coral) 20%,var(--line)); border-radius: 12px; background: color-mix(in srgb,var(--accent-coral) 2%,var(--bg)); margin-top: 20px; }
.docs-demo-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.docs-demo-head > strong { font-size: 14px; }
.docs-example-choices { display: flex; gap: 4px; flex-wrap: wrap; }
.docs-example-choices button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; }
.docs-example-choices button[aria-pressed=true] { color: var(--accent-coral-ink); border-color: color-mix(in srgb,var(--accent-coral) 45%,var(--line)); background: color-mix(in srgb,var(--accent-coral) 7%,var(--bg)); font-weight: 600; }
.docs-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 20px 0 12px; }
.docs-flow > span { position: relative; padding: 8px 10px; font-size: 11px; border: 1px solid var(--line); background: var(--bg); border-radius: 7px; display: inline-flex; align-items: center; gap: 6px; }
.docs-flow > span:not(:last-child)::after { content: '→'; position: absolute; left: calc(100% + 1px); width: 10px; color: var(--subtle); text-align: center; }
.docs-flow .docs-flow-step { border-color: color-mix(in srgb,var(--brand) 25%,var(--line)); color: var(--brand-dk); }
.docs-flow .tool-glyph { width: 16px; height: 16px; }
.docs-workflow-demo [data-example-panel] > p { font-size: 13px; }
.docs-demo-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 18px; font-size: 12px; }
.docs-demo-actions .tool-glyph { width: 17px; height: 17px; }
.docs-workflow-demo .docs-caption { font-size: 11px; margin: 14px 0 0; line-height: 1.6; }
.docs-command { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #101828; margin: 16px 0; }
.docs-command > div { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; background: #1d2939; color: #cbd5e1; font-size: 10px; }
.docs-command .text-button { color: #cbd5e1; font-size: 11px; padding: 4px 8px; border: 1px solid #475467; border-radius: 5px; }
.docs-command pre { background: transparent; color: #e4e7ec; margin: 0; padding: 16px; font-size: 12px; line-height: 1.7; overflow-x: auto; border: 0; border-radius: 0; }
.docs-command code { background: transparent; color: inherit; padding: 0; }
.docs-cli-grid { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: 16px; }
.docs-cli-grid > div { min-width: 0; }
.docs-cli-grid .docs-command { margin-top: 0; }
.docs-inline-links { display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: 12px; margin-top: 16px; }
.docs-open-card { display: flex; align-items: flex-start; gap: 16px; padding: 20px; border: 1px solid color-mix(in srgb,var(--accent-coral) 20%,var(--line)); border-radius: 12px; background: color-mix(in srgb,var(--accent-coral) 3%,var(--bg)); }
.docs-open-card p { font-size: 13px; margin: 0 0 12px; }
.docs-open-card a { font-size: 13px; }
.docs-resource-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.docs-resource-grid a { display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); }
.docs-resource-grid a:hover { background: var(--surface); border-color: color-mix(in srgb,var(--brand) 35%,var(--line)); }
.docs-resource-grid .tool-glyph { width: 23px; height: 23px; flex: none; }
.docs-resource-grid a > span:first-of-type { flex: 1; }
.docs-resource-grid strong, .docs-resource-grid small { display: block; }
.docs-resource-grid strong { font-size: 13px; }
.docs-resource-grid small { color: var(--muted); font-size: 11px; line-height: 1.5; margin-top: 4px; }
.docs-resource-grid a > span:last-child { color: var(--subtle); }
@media (max-width: 1050px) { .docs-layout { grid-template-columns: 150px minmax(0,1fr); gap: 24px; } .docs-paths { grid-template-columns: 1fr; } .docs-path { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 5px 12px; } .docs-path > svg { grid-row: 1 / 4; } .docs-path b { margin: 0; } }
@media (max-width: 760px) { .docs-page { padding-top: 28px; } .docs-intro { flex-direction: column; align-items: flex-start; gap: 18px; } .docs-layout { grid-template-columns: 1fr; gap: 24px; } .docs-index { position: static; display: flex; flex-wrap: wrap; gap: 4px; } .docs-index > strong { width: 100%; padding-left: 0; } .docs-index a { border: 1px solid var(--line); padding: 7px 9px; } .docs-section h2 { font-size: 21px; } .docs-cli-grid, .docs-resource-grid { grid-template-columns: 1fr; } .docs-workflow-demo { padding: 15px; } .docs-flow { flex-direction: column; align-items: stretch; gap: 13px; } .docs-flow > span:not(:last-child)::after { content: '↓'; left: 16px; top: 100%; height: 13px; } }

.runtime-status {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--muted); font-size: 12px; min-height: 24px;
}
.runtime-status:empty { display: none; }
.runtime-status[data-state=ready]::before {
  content: ''; width: 6px; height: 6px; flex: none;
  border-radius: var(--radius-xs); background: currentColor;
}
.runtime-status[data-state=loading]::before {
  content: ''; width: 11px; height: 11px; flex: none;
  border: 1.5px solid var(--line); border-right-color: var(--brand);
  border-radius: 50%; animation: spin 1s linear infinite;
}

/* ─── Small utilities ──────────────────────────────────────────────────── */
.small { font-size: 11px; }

/* overflow safety */
.tool-grid, .featured-grid, .diff-editors, .options-grid, .tool-explainer { min-width: 0; }
.tool-grid > *, .featured-grid > *, .diff-side, .pipeline-step .field, .request-item > div { min-width: 0; }
#processing-status, #selected-files, .workspace-heading h1,
.request-item > div, .download-actions .button { overflow-wrap: anywhere; }
.download-actions .button { max-width: 100%; white-space: normal; text-align: left; }

/* ─── Animations ───────────────────────────────────────────────────────── */
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes spin   { to { rotate: 360deg; } }
@keyframes surface-in { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }

/* Animated states */
.result-panel:not([hidden]),
.cookie-banner:not([hidden]),
#toast:not(:empty) { animation: surface-in 200ms ease-out both; }

/* Page navigation swaps content directly, without snapshots or fades. */
@view-transition { navigation: none; }
:root, #main { view-transition-name: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Navigation progress bar */
.header::after {
  content: ''; position: absolute; inset: auto 0 -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-amber), var(--accent-coral), var(--brand));
  opacity: 0; transition: opacity 120ms ease; pointer-events: none;
}
html[data-navigating=true] .header::after { opacity: 1; }
html[data-navigating=true] { cursor: progress; }

/* Focus for main */
#main:focus { outline: none; }

/* ─── Mobile nav menu ──────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .nav-links {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 12px 16px; box-shadow: var(--shadow);
    flex-wrap: wrap; gap: 4px; transform-origin: top;
  }
  .nav.menu-open .nav-links {
    display: flex; justify-content: center;
    animation: surface-in 150ms ease-out both;
  }
  .nav-links a { font-size: 14px; padding: 8px 14px; min-height: 40px; }
}

/* ─── Responsive breakpoints ───────────────────────────────────────────── */

/* Large screens */
@media (min-width: 1500px) {
  .wrap { max-width: 1280px; }
  .hero h1 { font-size: 64px; }
}

/* Medium: tablet landscape */
@media (max-width: 1050px) {
  .wrap { width: calc(100% - 48px); }
  .nav { gap: 16px; }
  .nav-links { gap: 2px; }
  .hero h1 { font-size: 46px; }
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-links { gap: 12px; }
  .download-features-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Small: tablet portrait & mobile */
@media (min-width: 761px) and (max-width: 900px) {
  .nav { gap: 12px; }
  .nav-links a { padding-inline: 6px; gap: 5px; font-size: 12px; }
  .nav-links > a > .tool-glyph { width: 14px; height: 14px; }
}

@media (max-width: 760px) {
  .wrap { width: calc(100% - 36px); }
  .header { height: 60px; }
  .brand { font-size: 21px; }
  .brand img { width: 34px; height: 34px; }
  .menu-toggle { display: block; }
  .nav { gap: 8px; }
  .nav-actions { gap: 6px; }
  .free-badge { padding: 4px 8px; font-size: 10px; }

  /* Hero */
  .hero { grid-template-columns: 1fr; gap: 28px; padding-block: 36px 16px; }
  .hero h1 { font-size: clamp(34px, 8.5vw, 48px); letter-spacing: -2px; }
  .hero-copy > p { font-size: 14.5px; max-width: none; }
  .hero-trust { grid-template-columns: 1fr; gap: 8px; }
  .trust-badge { min-height: 56px; }
  .trust-info strong { min-height: 0; }
  .hero-featured { padding: 18px; }
  .hero-featured .featured-grid { grid-template-columns: 1fr; gap: 10px; }

  /* Pipeline Canvas */
  .canvas-panel { padding: 18px 14px 28px; }
  .canvas-top-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .canvas-info-pills { flex-wrap: wrap; gap: 6px; }
  .action-node-content { flex-direction: column; align-items: stretch; }
  .action-node-content .button { width: 100%; justify-content: center; }

  /* Cards */
  .section-heading { align-items: flex-start; }
  .section-heading h2 { font-size: 22px; }
  .section-heading > .quiet-link { font-size: 11px; white-space: nowrap; margin-top: 6px; align-self: flex-start; }
  .featured { padding-top: 24px; }
  .featured-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .featured .tool-card { padding: 16px; }
  .featured .tool-card h3 { font-size: 13px; }

  /* Toolkit */
  .toolkit { padding-top: 28px; }
  .toolkit > .section-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  .search { width: 100%; min-width: 0; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tool-grid .tool-card { padding: 14px; }
  .tool-grid .tool-card p { font-size: 10px; line-height: 1.5; }
  .availability { gap: 12px; font-size: 12px; flex-wrap: wrap; }
  .availability #result-count { margin-left: 0; }
  .availability input { width: 14px; height: 14px; }
  .category { font-size: 12px; padding: 6px 11px; }
  .category span { font-size: 10px; }

  /* Footer */
  .footer { grid-template-columns: 1fr; gap: 20px; }
  .footer-links { justify-content: flex-start; flex-wrap: wrap; gap: 12px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; font-size: 11px; }

  /* Workspace */
  .workspace-heading { flex-direction: column; align-items: flex-start; gap: 6px; }
  .workspace-heading h1 { font-size: clamp(26px, 6.5vw, 34px); letter-spacing: -1px; }
  .work-panel { padding: clamp(16px, 4.5vw, 28px); }

  /* Tool explainer */
  .tool-explainer { grid-template-columns: 1fr; gap: 16px; margin-top: 32px; }

  /* Diff */
  .diff-editors { grid-template-columns: 1fr; }
  .diff-side:first-child { border-right: 0; border-bottom: 1px solid var(--line); }
  .diff-side textarea, .diff-display { height: 260px; }
  .diff-toolbar { flex-wrap: wrap; gap: 10px; }
  .diff-toolbar > span { width: 100%; }
  .diff-side-heading { gap: 10px; padding: 10px 12px; font-size: 11px; }
  .diff-actions { flex-wrap: wrap; gap: 10px; }
  .diff-actions #processing-status, .run-row #processing-status { flex-basis: 100%; }
  .diff-toolbar .field.inline { min-width: 0; flex-wrap: wrap; }
  .diff-toolbar .field select { width: auto; max-width: 100%; }

  /* Download / requests */
  .download-layout, .requests-layout { grid-template-columns: 1fr; gap: 20px; margin-bottom: 48px; }
  .download-layout .work-panel { min-width: 0; }
  .requests-layout > .work-panel { grid-row: 1; }
  .download-features-grid { grid-template-columns: 1fr; gap: 14px; }
  .download-card-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .platform-chips { gap: 6px; }
  .platform-chip { font-size: 11px; padding: 4px 10px; }

  /* Page intro */
  .page-intro { padding-block: 40px 24px; }
  .page-intro h1 { letter-spacing: -1.8px; }
  .page-intro p { font-size: 14px; }

  /* Cookie banner */
  .cookie-banner { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px 18px; width: min(720px, calc(100% - 24px)); }
  .consent-actions { flex-direction: row; justify-content: flex-end; }

  /* Prose */
  .prose h1 { font-size: 34px; }
  .prose { padding-top: 36px; }

  /* Pipeline */
  .pipeline-node, .pipeline-step { width: 100%; max-width: 100%; }
  .pipeline-node.is-enlarged, .pipeline-step.is-enlarged { width: 100%; max-width: 100%; }
  .pipeline-step { padding: 0; }
  .pipeline-step-head { gap: 8px; }
  .pipeline-step-head > .text-button { flex: none; justify-content: center; min-width: 32px; }

  /* Dropzone */
  .dropzone { padding: 28px 12px; }

  /* Request item */
  .request-item { padding: 12px; }

  /* Run row */
  .run-row > .button { max-width: 100%; white-space: normal; }
}

/* Very small phones */
@media (max-width: 380px) {
  .tool-facts > div { grid-template-columns: 1fr; gap: 4px; }
  .brand { font-size: 19px; gap: 6px; }
  .brand img { width: 26px; height: 26px; }
  .nav { gap: 6px; }
  .nav-actions { gap: 5px; }
  .github-link { gap: 6px; padding: 6px 9px; font-size: 12px; }
  .github-icon { width: 18px; height: 18px; }
  .menu-toggle { padding: 4px 7px; font-size: 17px; }
  .tool-grid, .featured-grid { grid-template-columns: 1fr; }
  .section-heading { gap: 10px; }
  .hero-trust { flex-wrap: wrap; gap: 6px 14px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .button { text-align: center; justify-content: center; }
  .free-badge { display: none; }
  .diff-side-heading { flex-wrap: wrap; }
  .consent-actions .button { white-space: normal; flex: 1; }
  .privacy-pill { white-space: normal; }
  .runtime-status[data-state=ready] { white-space: normal; }
  .terminal-row { padding: 8px 10px; }
  .terminal-row code { font-size: 11px; }
  .download-picker-card { padding: 14px; }
  .terminal-bar { padding: 10px 14px; }
  .terminal-body { padding: 14px; gap: 12px; }
}

/* Touch device optimisations */
@media (hover: none) {
  .button:hover, .tool-card:hover { transform: none; box-shadow: none; }
  .hero-logo, .floating-label { animation: none; }
  .header { backdrop-filter: none; background: rgb(255 255 255 / .97); }
}

@media (pointer: coarse) {
  button, .button, .nav-links a, .file-button, .footer-links a { min-height: 44px; }
  .text-button, .file-button, .nav-links a, .footer-links a { display: inline-flex; align-items: center; }
  .category { min-height: 44px; }
  .field input, .field select, .field textarea, #text-input, .search input, .diff-side textarea { font-size: 16px; }
  .search { min-height: 44px; }
  .menu-toggle, .pipeline-step-head > .text-button { min-width: 44px; }
}

/* Compact workflow cards and connections that follow each block. */
.canvas-panel { overflow: auto; }
.pipeline-graph { max-width: none; width: 100%; padding: 12px 0 48px; gap: 36px; isolation: isolate; }
.pipeline-node, .pipeline-step { width: 320px; max-width: calc(100% - 16px); z-index: 1; transition: border-color 160ms, box-shadow 160ms; }
.pipeline-node.is-enlarged, .pipeline-step.is-enlarged { width: 520px; max-width: calc(100% - 16px); }
.pipeline-steps-flow { gap: 36px; }
.pipeline-connector, .pipeline-steps-flow .pipeline-step::before { display: none; }
.workflow-links { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 0; overflow: visible; }
.workflow-links path { fill: none; stroke: var(--brand); stroke-width: 2; stroke-dasharray: 5 4; }
.node-head, .pipeline-step-head { touch-action: none; }
.node-drag-handle { touch-action: none; flex-shrink: 0; }
.node-enlarge-badge { cursor: pointer; flex-shrink: 0; padding: 0; width: 28px; height: 28px; }
.pipeline-step-head { flex-wrap: wrap; align-items: center; }
.pipeline-step-head .field { flex: 1 1 140px; }
.pipeline-step-head .node-badge-group { padding: 0; }
.pipeline-step:not(.is-enlarged) .node-desc, .pipeline-step:not(.is-enlarged) .step-options { display: none; }
.pipeline-node:not(.is-enlarged) .node-content { padding: 10px; }
.pipeline-node:not(.is-enlarged) .pipeline-dropzone { padding: 12px; min-height: 0; }
.pipeline-node:not(.is-enlarged) .pipeline-dropzone .upload-icon,
.pipeline-node:not(.is-enlarged) .pipeline-dropzone small { display: none; }
@media(max-width:600px) { .canvas-top-bar { flex-direction: column; align-items: flex-start; } .canvas-panel { padding-inline: 10px; } }

/* Selected inputs are explicit, replaceable objects, rather than upload overlays. */
.chosen-file-list { display: grid; gap: 8px; }
.chosen-file { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); min-width: 0; }
.chosen-file-icon { color: var(--brand); flex: none; display: grid; place-items: center; width: 40px; height: 44px; border-radius: 6px; background: color-mix(in srgb,var(--brand) 7%,transparent); }
.chosen-file-info { flex: 1; min-width: 0; display: grid; gap: 3px; }
.chosen-file-info strong { font-size: 13px; overflow-wrap: anywhere; }
.chosen-file-info > span { font-size: 11px; color: var(--muted); }
.file-selection-action { font-size: 11px; padding: 7px 10px; }
.chosen-file-actions, .file-order-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.reorderable-file { cursor: grab; }
.selection-error { color: var(--red); font-size: 12px; }
.diff-side .chosen-file { flex-wrap: wrap; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.diff-side .chosen-file-icon { width: 28px; height: 32px; }
.pipeline-node .chosen-file { flex-wrap: wrap; padding: 10px; gap: 8px; }
.pipeline-node .chosen-file-icon { width: 28px; height: 32px; }

/* Visual tool workspaces load their renderer only after a file is selected. */
.visual-workbench { margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.visual-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.visual-toolbar > strong { margin-right: auto; font-size: 13px; }
.visual-selection-summary { font-size: 12px; color: var(--muted); }
.visual-hint, .visual-loading { font-size: 12px; color: var(--muted); line-height: 1.6; }
.compact-button { font-size: 11px; padding: 6px 10px; }
.pdf-page-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(132px,1fr)); gap: 12px; }
.pdf-page-card { padding: 8px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pdf-page-select { border: 0; background: transparent; color: var(--ink); display: grid; gap: 10px; justify-items: center; padding: 0; width: 100%; font: inherit; font-size: 12px; }
.pdf-page-select canvas { max-width: 100%; height: auto; max-height: 190px; object-fit: contain; background: white; border: 1px solid var(--line); }
.pdf-page-card.selected-page { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
[data-action=remove] .pdf-page-card.selected-page { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); background: #fff1f2; }
[data-action=extract] .pdf-page-card.selected-page, [data-action=split] .pdf-page-card.selected-page { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.page-order-controls { display: flex; gap: 4px; justify-content: center; }
.page-grip { touch-action: none; cursor: grab; }
.page-order-button { padding-inline: 12px; }
.pdf-page-dialog { width: min(850px,calc(100vw - 24px)); max-height: calc(100dvh - 32px); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--bg); }
.pdf-page-dialog::backdrop { background: rgb(24 24 27 / .5); }
.pdf-large-stage { max-height: 76dvh; overflow: auto; background: var(--surface); text-align: center; }
.pdf-large-stage canvas { max-width: 100%; height: auto; }
.visual-file-picker { margin-bottom: 16px; }
.image-preview-stage { position: relative; width: fit-content; max-width: 100%; margin-inline: auto; overflow: hidden; background: repeating-conic-gradient(#e4e4e7 0% 25%,#fff 0% 50%) 50% / 16px 16px; }
.image-source-preview { display: block; max-width: 100%; max-height: 600px; width: auto; height: auto; user-select: none; -webkit-user-drag: none; }
.crop-stage { touch-action: none; cursor: crosshair; }
.crop-selection { position: absolute; border: 2px solid var(--brand); box-shadow: 0 0 0 1000px rgb(0 0 0 / .4); cursor: move; background: linear-gradient(90deg,transparent 32.9%,rgb(255 255 255 / .5) 33.1%,transparent 33.3%,transparent 66.5%,rgb(255 255 255 / .5) 66.7%,transparent 66.9%),linear-gradient(transparent 32.9%,rgb(255 255 255 / .5) 33.1%,transparent 33.3%,transparent 66.5%,rgb(255 255 255 / .5) 66.7%,transparent 66.9%); }
.crop-handle { position: absolute; width: 16px; height: 16px; border: 2px solid var(--brand); background: white; border-radius: 2px; }
.crop-handle-nw { left: -6px; top: -6px; cursor: nwse-resize; }.crop-handle-ne { right: -6px; top: -6px; cursor: nesw-resize; }
.crop-handle-sw { left: -6px; bottom: -6px; cursor: nesw-resize; }.crop-handle-se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.crop-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.crop-presets [aria-pressed=true] { border-color: var(--brand); color: var(--brand); }
.crop-dimensions { display: block; margin-top: 12px; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.quality-slider { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 12px; }
.quality-slider input { flex: 1; accent-color: var(--brand); }
.input-text-preview pre { max-height: 260px; white-space: pre-wrap; overflow-wrap: anywhere; }
.image-result-preview { display: block; max-width: 100%; max-height: 420px; margin-block: 16px; object-fit: contain; }

/* Aligned comparisons with explicit per-line merge controls. */
.diff-row { display: flex; min-height: 28px; height: 28px; align-items: stretch; position: relative; width: max-content; min-width: 100%; }
.diff-row > .diff-line { flex: 1; padding: 3px 10px; white-space: pre; min-height: 28px; }
.diff-line-number { position: sticky; left: 0; width: 46px; flex: none; color: var(--subtle); background: var(--surface); text-align: right; padding: 3px 8px; user-select: none; font-size: 10px; }
.diff-placeholder { background: repeating-linear-gradient(135deg,#fafafa,#fafafa 4px,#f4f4f5 4px,#f4f4f5 8px) !important; border-color: transparent !important; }
.merge-line-action { position: sticky; right: 0; flex: none; width: 30px; border: 0; border-left: 1px solid var(--line); background: var(--bg); color: var(--brand); font-size: 16px; line-height: 1; font-weight: 700; cursor: pointer; }
.merge-line-action:hover { background: color-mix(in srgb,var(--brand) 10%,white); }
.diff-review-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 12px 0; font-size: 12px; }
.diff-review-toolbar label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.diff-review-toolbar input { accent-color: var(--brand); }
.diff-hide-equal .diff-row:not(.changed-row) { display: none; }
.diff-wrap .diff-row { height: auto; min-height: 28px; }
.diff-wrap .diff-row > .diff-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-editors { min-width: 0; }.diff-side { min-width: 0; }.diff-display { scroll-behavior: auto; padding-block: 8px; }
@media (pointer:coarse) {
  .diff-row, .diff-row > .diff-line { height: 44px; min-height: 44px; }
  .diff-row > .diff-line, .diff-line-number { padding-block: 11px; }
  .diff-row .merge-line-action { width: 44px; min-height: 44px; }
}
@media (max-width:600px) {
  .chosen-file { flex-wrap: wrap; gap: 8px; }.chosen-file-info { flex-basis: calc(100% - 60px); }
  .visual-workbench { padding: 10px; }.pdf-page-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .diff-toolbar, .diff-actions { flex-wrap: wrap; gap: 8px; }.diff-line-number { width: 30px; padding-inline: 3px; }
  .merge-line-action { width: 26px; min-height: 28px; }.diff-side-heading { padding: 10px; gap: 8px; }
}

/* Category colors carry through every choice menu without tinting its text. */
[data-filter=all] { --choice-color: var(--brand); }
[data-filter=pdf], [data-group=pdf] { --choice-color: #e11d48; }
[data-filter=images], [data-group=images] { --choice-color: #16a34a; }
[data-filter=converters], [data-group=converters] { --choice-color: #2563eb; }
[data-filter=diff], [data-group=diff] { --choice-color: var(--brand); }
[data-filter=developer], [data-group=developer] { --choice-color: #d97706; }
[data-filter=inspector], [data-group=inspector] { --choice-color: #0891b2; }
[data-filter=security], [data-group=security] { --choice-color: var(--accent-coral-ink); }
[data-filter=ocr], [data-group=ocr] { --choice-color: #a16207; }
[data-filter=video], [data-group=video] { --choice-color: #ea580c; }
[data-filter=audio], [data-group=audio] { --choice-color: #db2777; }
[data-filter=archives], [data-group=archives] { --choice-color: #475569; }
[data-filter=fonts], [data-group=fonts] { --choice-color: var(--brand-dk); }
.category > .tool-glyph { color: var(--choice-color,var(--brand)); }
.tools-nav-icon { color: var(--choice-color,var(--brand)); background: color-mix(in srgb,var(--choice-color,var(--brand)) 8%,transparent); }
.tool-glyph[data-icon-kind="navigation:tools"], .tool-glyph[data-icon-kind="navigation:workflows"] { color: var(--brand); }
.tool-glyph[data-icon-kind="navigation:download"] { color: #2563eb; }
.tool-glyph[data-icon-kind="navigation:docs"] { color: #d97706; }
.tool-glyph[data-icon-kind="navigation:feedback"] { color: #0891b2; }
.tool-glyph[data-icon-kind="navigation:privacy"] { color: #16a34a; }
.tool-glyph[data-icon-kind="navigation:licenses"], .tool-glyph[data-icon-kind="navigation:settings"] { color: var(--brand-dk); }
.tools-navigation .tools-nav-row { max-height: min(40dvh,420px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--subtle) var(--surface); }
.tools-navigation .tools-nav-row::-webkit-scrollbar { width: 6px; }
.tools-navigation .tools-nav-row::-webkit-scrollbar-thumb { background: var(--subtle); border-radius: 3px; }

/* Tool documentation is useful before and without loading its processing engine. */
.tool-breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 12px; margin-bottom: 28px; }
.tool-breadcrumbs .back-link { margin: 0; }
.tool-breadcrumbs a:hover { color: var(--brand); }
.tool-breadcrumbs [aria-current] { color: var(--ink-2); }
.tool-guide { row-gap: 28px; }
.tool-guide h2, .related-tools h2 { font-size: 20px; letter-spacing: -.5px; }
.tool-guide li { margin-bottom: 8px; line-height: 1.7; }
.tool-guide pre { max-width: 100%; overflow: auto; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 12px; }
.tool-facts { margin: 0; }
.tool-facts > div { display: grid; grid-template-columns: minmax(100px,1fr) minmax(0,2fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.tool-facts dt { color: var(--muted); }.tool-facts dd { margin: 0; overflow-wrap: anywhere; }
.related-tools { padding-bottom: 36px; }.related-tool-links { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,240px),1fr)); gap: 12px; }
.related-tool-links a { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; }
.related-tool-links a:hover { border-color: var(--brand); }.related-tool-links .tool-icon { width: 36px; height: 36px; }.related-tool-links .tool-glyph { width: 30px; height: 30px; }
.unavailable .card-bottom { flex-wrap: wrap; gap: 10px; }.cli-tool-link { color: var(--brand); font-size: 11px; }
