/* ============================================================
   MetaPurge — dark, Material-3-flavoured single page
   ============================================================ */

/* Self-hosted Roboto (variable, latin) — no Google Fonts request at runtime. */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/roboto-latin.woff2") format("woff2");
}

/* Material Symbols, subset to 27 glyphs (17 KB). font-display:block avoids a
   raw-codepoint flash while the local font loads. */
@font-face {
  font-family: "Material Symbols Outlined";
  font-style: normal;
  font-weight: 100 700;
  font-display: block;
  src: url("../assets/fonts/material-symbols-subset.woff2") format("woff2");
}

.ms {
  font-family: "Material Symbols Outlined";
  font-weight: 400;
  font-style: normal;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  overflow: hidden;
  letter-spacing: 0;
  white-space: nowrap;
  user-select: none;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
}

:root {
  --bg: #06070a;
  --bg-2: #080a0f;
  --surface: #0c0f15;
  --surface-2: #11151d;
  --surface-3: #171c26;
  --surface-4: #1d232f;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.145);
  --text: #e9edf6;
  --dim: #9aa5b8;
  --faint: #7e899c;
  --violet: #8b5cf6;
  --violet-soft: #a78bfa;
  --indigo: #6366f1;
  --cyan: #22d3ee;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #fb7185;
  --grad: linear-gradient(115deg, #a78bfa 0%, #8b5cf6 38%, #6366f1 66%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(34, 211, 238, 0.14));
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-lg: 0 30px 80px -40px rgba(0, 0, 0, 0.9), 0 8px 30px -20px rgba(139, 92, 246, 0.35);
  --font: "Roboto", "Google Sans", "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, "Cascadia Code", Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  /* Pointer position, kept in sync by src/ui/app.js (0 → 1). */
  --mx: 0.5;
  --my: 0.35;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-dragging { cursor: copy; }

::selection { background: rgba(139, 92, 246, 0.35); color: #fff; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 8px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- backdrop ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(34, 211, 238, 0.07), transparent 60%),
    radial-gradient(1000px 600px at 12% 0%, rgba(139, 92, 246, 0.1), transparent 62%),
    var(--bg);
}

.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: float 22s ease-in-out infinite alternate;
}
.aurora-a {
  width: 520px; height: 520px; top: -180px; left: 8%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.55), transparent 68%);
}
.aurora-b {
  width: 620px; height: 620px; top: -240px; right: 4%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.34), transparent 68%);
  animation-delay: -6s;
}
.aurora-c {
  width: 460px; height: 460px; top: 420px; left: 42%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28), transparent 70%);
  animation-delay: -12s;
}

@keyframes float {
  from { transform: translate3d(-16px, 0, 0) scale(1); }
  to { transform: translate3d(18px, 22px, 0) scale(1.06); }
}

/* Mouse-reactive pattern field. `translate` is used instead of `transform`
   so the aurora keyframe animation keeps working on the same element. */
.pattern-rings,
.pattern-hatch,
.pattern-dots {
  position: absolute;
  inset: -18%;
  pointer-events: none;
  will-change: translate;
}

.pattern-rings {
  background:
    repeating-radial-gradient(circle at 50% 12%, rgba(167, 139, 250, 0.16) 0 1.6px, transparent 1.6px 62px),
    repeating-radial-gradient(circle at 84% 82%, rgba(34, 211, 238, 0.1) 0 1.6px, transparent 1.6px 88px);
  -webkit-mask-image: radial-gradient(ellipse 78% 62% at 50% 8%, #000 4%, transparent 74%);
  mask-image: radial-gradient(ellipse 78% 62% at 50% 8%, #000 4%, transparent 74%);
  translate: calc((var(--mx) - 0.5) * -42px) calc((var(--my) - 0.5) * -26px);
}

.pattern-hatch {
  background: repeating-linear-gradient(115deg,
    rgba(255, 255, 255, 0.075) 0 1.6px,
    transparent 1.6px 28px);
  -webkit-mask-image: radial-gradient(ellipse 62% 54% at 50% 30%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 62% 54% at 50% 30%, #000 0%, transparent 72%);
  opacity: 0.55;
  translate: calc((var(--mx) - 0.5) * 34px) calc((var(--my) - 0.5) * 22px);
}

.pattern-dots {
  background-image: radial-gradient(rgba(255, 255, 255, 0.26) 1.6px, transparent 1.7px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 68% 56% at 50% 42%, #000 0%, transparent 76%);
  mask-image: radial-gradient(ellipse 68% 56% at 50% 42%, #000 0%, transparent 76%);
  opacity: 0.36;
  translate: calc((var(--mx) - 0.5) * 26px) calc((var(--my) - 0.5) * 20px);
}

.cursor-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(680px circle at calc(var(--mx) * 100%) calc(var(--my) * 100%),
    rgba(139, 92, 246, 0.16),
    rgba(34, 211, 238, 0.055) 42%,
    transparent 70%);
  mix-blend-mode: screen;
  opacity: 0.9;
}

.grid-veil {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 10%, transparent 72%);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(6, 7, 10, 0.92), rgba(6, 7, 10, 0.6));
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}
.brand-mark { display: grid; place-items: center; filter: drop-shadow(0 6px 18px rgba(139, 92, 246, 0.35)); }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }

.topbar-right { display: flex; align-items: center; gap: 18px; }

.secure-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #c8f7e5;
  border: 1px solid rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.08);
  border-radius: 999px;
}
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse-dot 2.4s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.ghost-link {
  font-size: 13.5px;
  color: var(--dim);
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}
.ghost-link:hover { color: var(--text); border-color: var(--line-strong); }

/* ---------- shared type ---------- */

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
.eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.8);
}

/* ---------- hero ---------- */

main { position: relative; z-index: 1; }

.hero {
  max-width: 980px;
  margin: 0 auto;
  padding: 76px 32px 26px;
  text-align: center;
  animation: rise 0.7s var(--ease) both;
}

.hero h1 {
  margin: 22px 0 20px;
  font-size: clamp(2.6rem, 6.2vw, 4.55rem);
  line-height: 1.02;
  letter-spacing: -0.042em;
  font-weight: 700;
}

.lede {
  max-width: 640px;
  margin: 0 auto;
  color: var(--dim);
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.65;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- dropzone ---------- */

.dropzone-wrap {
  position: relative;
  max-width: 820px;
  margin: 42px auto 0;
}

.dropzone {
  position: relative;
  margin: 0;
  padding: 46px 28px 38px;
  border-radius: var(--radius-xl);
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(17, 21, 29, 0.9), rgba(10, 13, 19, 0.92)) padding-box,
    linear-gradient(140deg, rgba(167, 139, 250, 0.72), rgba(99, 102, 241, 0.3) 42%, rgba(34, 211, 238, 0.6)) border-box;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.dropzone::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(520px 220px at 50% 0%, rgba(139, 92, 246, 0.16), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.dropzone:hover { transform: translateY(-2px); box-shadow: 0 40px 90px -46px rgba(139, 92, 246, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.dropzone:hover::after,
.dropzone.is-over::after { opacity: 1; }
.dropzone.is-over {
  transform: translateY(-3px) scale(1.006);
  box-shadow: 0 40px 100px -40px rgba(34, 211, 238, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dz-glow {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from 180deg, rgba(139, 92, 246, 0.7), rgba(34, 211, 238, 0.65), rgba(139, 92, 246, 0.7));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  animation: spin 6s linear infinite;
  pointer-events: none;
}
.dropzone.is-over .dz-glow { opacity: 1; }
@keyframes spin { to { transform: rotate(1turn); } }

.dz-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 18px;
  color: #d9d1ff;
  background: var(--grad-soft);
  border: 1px solid rgba(167, 139, 250, 0.28);
  box-shadow: 0 12px 34px -18px rgba(139, 92, 246, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dz-title { font-size: clamp(17px, 2.2vw, 20px); font-weight: 600; letter-spacing: -0.015em; }
.dz-sub { margin-top: 7px; color: var(--dim); font-size: 13.5px; }
.dz-link { color: #c7b8ff; border-bottom: 1px dashed rgba(199, 184, 255, 0.45); }
.dz-sub kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
}

/* tiny metadata cards that float around the dropzone */
.meta-float {
  position: absolute;
  z-index: 2;
  width: 214px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(155deg, rgba(20, 25, 35, 0.92), rgba(9, 12, 18, 0.88));
  box-shadow: 0 24px 50px -32px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
  animation: bob 8s ease-in-out infinite;
}
.meta-float .mf-ic {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: #c9bfff;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.24);
}
.mf-copy { min-width: 0; }
.mf-k {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
}
.mf-v {
  display: block;
  margin-top: 1px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: line-through;
  text-decoration-color: rgba(251, 113, 133, 0.75);
  text-decoration-thickness: 1.5px;
}
.mf-x {
  position: absolute;
  top: -9px;
  right: 10px;
  padding: 2px 7px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #ffd7dc;
  background: rgba(251, 113, 133, 0.18);
  border: 1px solid rgba(251, 113, 133, 0.32);
  border-radius: 999px;
}
.float-a { top: 44px; left: -158px; }
.float-b { top: 142px; right: -168px; animation-delay: -2.7s; }
.float-c { bottom: 52px; left: -120px; animation-delay: -5.1s; }

@keyframes bob {
  0%, 100% { transform: translateY(-5px) rotate(-0.5deg); }
  50% { transform: translateY(6px) rotate(0.5deg); }
}

.format-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
}
.format-chips li {
  padding: 4px 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.015);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 26px;
  margin-top: 26px;
  color: var(--faint);
  font-size: 12.5px;
}
.trust-row li { display: inline-flex; align-items: center; gap: 8px; }
.tick {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.8);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
}

/* ---------- workspace ---------- */

.workspace {
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px 32px 20px;
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  animation: rise 0.45s var(--ease) both;
}

.rail {
  position: sticky;
  top: 84px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.012));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 12px;
}
.rail-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}
.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: #d8ceff;
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 999px;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.mini-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.24); }
.mini-plus { font-size: 14px; line-height: 1; color: var(--violet-soft); }

.file-list { display: flex; flex-direction: column; gap: 7px; }

.file-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.file-card:hover { background: rgba(255, 255, 255, 0.035); }
.file-card.is-active {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.file-card img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-3);
}
.fc-thumb {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--faint);
}

.fc-body { min-width: 0; }
.fc-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-meta {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-status { display: grid; place-items: center; color: var(--faint); }
.fc-status.is-clean { color: var(--green); }
.fc-status.is-busy { color: var(--violet-soft); }
.fc-status.is-error { color: var(--red); }

.rail-note {
  margin-top: 14px;
  padding: 10px 4px 2px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--faint);
  border-top: 1px solid var(--line);
}

/* ---------- inspector ---------- */

.inspector {
  min-width: 0;
  min-height: 540px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.008));
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  overflow: hidden;
}

.inspector-pad { padding: 20px 22px; }

.insp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.file-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.insp-head > div:first-child { min-width: 0; }
.file-title h2 {
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--faint);
}
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); opacity: 0.7; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--dim);
  background: rgba(255, 255, 255, 0.03);
}
.chip-format { color: #cfc4ff; border-color: rgba(139, 92, 246, 0.35); background: rgba(139, 92, 246, 0.12); }
.chip-reader { color: #a5f3fc; border-color: rgba(34, 211, 238, 0.28); background: rgba(34, 211, 238, 0.08); }
.chip-lossless { color: #b8f5dd; border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.09); }
.chip-planned { color: var(--faint); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}
.icon-btn:hover { color: var(--red); background: rgba(251, 113, 133, 0.08); border-color: rgba(251, 113, 133, 0.25); }

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 22px;
  padding: 20px 22px;
}

.preview-col { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.preview-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  max-height: 430px;
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(400px 200px at 50% 0%, rgba(139, 92, 246, 0.14), transparent 70%),
    repeating-conic-gradient(rgba(255, 255, 255, 0.018) 0% 25%, transparent 0% 50%) 50% / 22px 22px,
    var(--bg-2);
  overflow: hidden;
}
.preview-frame img {
  max-width: 100%;
  max-height: 396px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 22px 50px -30px rgba(0, 0, 0, 0.95);
  transition: opacity 0.3s var(--ease), filter 0.3s var(--ease);
}
.preview-placeholder {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 40px 24px;
  text-align: center;
  color: var(--faint);
}
.preview-placeholder p { font-size: 13px; color: var(--dim); }
.preview-placeholder span { font-family: var(--mono); font-size: 11.5px; }
.preview-frame.is-busy img { opacity: 0.45; filter: saturate(0.6); }

.sweep {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(34, 211, 238, 0.16) 50%, transparent 60%);
  transform: translateX(-100%);
}
.preview-frame.is-sweeping .sweep { animation: sweep 1.1s var(--ease); }
@keyframes sweep { to { transform: translateX(100%); } }

.gps-card {
  padding: 13px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(251, 191, 36, 0.22);
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.07), rgba(251, 113, 133, 0.035));
}
.gps-top { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--amber); }
.gps-map {
  position: relative;
  height: 132px;
  margin: 11px 0 12px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(220px 120px at 50% 50%, rgba(34, 211, 238, 0.1), transparent 72%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 26px),
    #0a0d13;
}
.gps-pin {
  position: absolute;
  width: 13px; height: 13px;
  margin: -6.5px 0 0 -6.5px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #fb7185);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.18), 0 0 22px rgba(251, 191, 36, 0.7);
}
.gps-pin::after {
  content: "";
  position: absolute;
  inset: -13px;
  border-radius: 50%;
  border: 1px solid rgba(251, 191, 36, 0.45);
  animation: ping 2.4s ease-out infinite;
}
@keyframes ping {
  0% { transform: scale(0.5); opacity: 0.9; }
  100% { transform: scale(1.5); opacity: 0; }
}
.gps-label { font-size: 13px; font-weight: 600; font-family: var(--mono); letter-spacing: -0.01em; }
.gps-alt { margin-top: 3px; font-size: 11.5px; color: var(--faint); }
.gps-actions { display: flex; gap: 8px; margin-top: 11px; }
.gps-actions a,
.gps-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.18s, background 0.18s;
}
.gps-actions a:hover,
.gps-actions button:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }

.file-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.fact {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.fact dt { font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); }
.fact dd { margin: 3px 0 0; font-size: 13px; font-weight: 600; }

/* ---------- metadata panel ---------- */

.meta-col { min-width: 0; display: flex; flex-direction: column; }

.meta-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.meta-head h3 { font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
.meta-head .muted { color: var(--faint); font-weight: 500; }
.meta-head > div:first-child { min-width: 0; }
.meta-sub {
  margin-top: 4px;
  max-width: 440px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--faint);
}
.meta-head-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}
.tool-btn {
  padding: 4px 9px;
  font-size: 10.5px;
  font-weight: 650;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.16s, background 0.16s, border-color 0.16s;
}
.tool-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); border-color: var(--line-strong); }

.meta-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.ms-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  font-size: 11px;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.ms-pill strong { font-size: 12px; font-weight: 700; color: var(--text); }
.ms-remove { border-color: rgba(139, 92, 246, 0.28); background: rgba(139, 92, 246, 0.08); }
.ms-remove strong { color: #dcd2ff; }
.ms-keep { border-color: rgba(251, 191, 36, 0.22); background: rgba(251, 191, 36, 0.05); }
.ms-keep strong { color: #fde68a; }

.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.preset-btn {
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.16s, background 0.16s, border-color 0.16s;
}
.preset-btn:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); }
.preset-btn[aria-pressed="true"] { color: #dcd2ff; border-color: rgba(139, 92, 246, 0.45); background: rgba(139, 92, 246, 0.14); }

.meta-scroll {
  flex: 1;
  max-height: clamp(300px, 48vh, 480px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
.meta-notes {
  margin: 0 0 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.2);
  background: rgba(251, 191, 36, 0.05);
  font-size: 11.5px;
  line-height: 1.5;
  color: #e8d8a8;
}
.meta-notes li + li { margin-top: 3px; }
.notice-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px !important;
  font-size: 12px !important;
  color: #ffb4bd !important;
}
.meta-scroll::-webkit-scrollbar { width: 7px; }
.meta-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 99px; }

.meta-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.017);
  overflow: hidden;
}
.meta-group + .meta-group { margin-top: 8px; }
.meta-group.is-locked {
  border-color: rgba(251, 191, 36, 0.18);
  background: rgba(251, 191, 36, 0.025);
}
.meta-group.has-selection { border-color: rgba(139, 92, 246, 0.26); background: rgba(139, 92, 246, 0.05); }

.group-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
}
.group-toggle {
  flex: 1;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 4px 0;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.group-toggle:hover .group-title { color: #fff; }

.group-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #c9bfff;
  background: rgba(139, 92, 246, 0.13);
  border: 1px solid rgba(139, 92, 246, 0.18);
}
.group-icon.sev-high { color: #ffd0a8; background: rgba(251, 146, 60, 0.13); border-color: rgba(251, 146, 60, 0.2); }
.group-icon.sev-medium { color: #fde68a; background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.18); }
.group-icon.sev-low { color: #bcd3ff; background: rgba(96, 165, 250, 0.12); border-color: rgba(96, 165, 250, 0.18); }
.group-icon.sev-locked { color: #fde68a; background: rgba(251, 191, 36, 0.09); border-color: rgba(251, 191, 36, 0.2); }

.group-text { min-width: 0; }
.group-title { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 13px; font-weight: 600; }
.group-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-sub {
  display: -webkit-box;
  margin-top: 1px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--faint);
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.group-sub strong { font-weight: 650; color: var(--dim); }
.meta-group.is-locked .group-sub strong { color: #fde68a; }
.group-count { display: inline-flex; align-items: center; gap: 7px; color: var(--faint); }
.chip-keep {
  gap: 3px;
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.08);
}
.chip-keep .ic { color: #fbbf24; }

.group-lock-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #e8d8a8;
  background: rgba(251, 191, 36, 0.055);
  border-bottom: 1px solid rgba(251, 191, 36, 0.16);
}
.group-lock-note .ic { flex: 0 0 auto; margin-top: 1px; color: #fbbf24; }
.group-lock-note strong { color: #fde68a; }

.sev-dot { width: 6px; height: 6px; border-radius: 50%; }
.sev-dot.sev-high { background: #fb923c; box-shadow: 0 0 8px rgba(251, 146, 60, 0.7); }
.sev-dot.sev-medium { background: var(--amber); }
.sev-dot.sev-low { background: #60a5fa; }
.sev-dot.sev-locked { background: var(--amber); box-shadow: 0 0 8px rgba(251, 191, 36, 0.6); }

.chev {
  color: var(--faint);
  transition: transform 0.2s var(--ease);
}
.group-head[aria-expanded="true"] .chev { transform: rotate(90deg); }

.group-fields { border-top: 1px solid var(--line); }

.field-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 44px;
  padding: 9px 12px;
  font-size: 12px;
  cursor: pointer;
}
.field-row > .cb,
.field-row > .lock-ic { margin-top: 2px; }
.field-main { display: block; min-width: 0; }
.field-line {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.field-row.is-locked { cursor: default; }
.field-row.is-locked:hover { background: rgba(251, 191, 36, 0.03); }
.field-row:not(.is-locked):active { background: rgba(255, 255, 255, 0.045); }
.field-row + .field-row { border-top: 1px solid rgba(255, 255, 255, 0.035); }
.field-row:hover { background: rgba(255, 255, 255, 0.022); }
.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-weight: 550;
  color: #d5dbe8;
}
.field-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.field-value {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.field-row.is-locked .field-label,
.field-row.is-locked .field-value { color: var(--faint); }
.keep-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  padding: 1px 5px;
  font-family: var(--font);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #fde68a;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.26);
  border-radius: 999px;
}
.lock-ic { color: var(--faint); display: grid; place-items: center; }

/* native checkbox, restyled */
input.cb {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 0;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
input.cb:hover { border-color: rgba(255, 255, 255, 0.4); }
input.cb:active { transform: scale(0.92); }
input.cb:checked {
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 4px 12px -4px rgba(139, 92, 246, 0.7);
}
input.cb:checked::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #08060f;
  border-bottom: 2px solid #08060f;
  transform: rotate(-45deg) translate(0.5px, -1px);
}
input.cb:indeterminate {
  background: rgba(139, 92, 246, 0.3);
  border-color: rgba(167, 139, 250, 0.6);
}
input.cb:indeterminate::after {
  content: "";
  width: 8px;
  height: 2px;
  border-radius: 1px;
  background: #dcd2ff;
}
input.cb:disabled { cursor: not-allowed; opacity: 0.45; }

/* 44px hit area around the compact group checkbox without widening the row */
.cb-tap {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -13px;
  border-radius: 10px;
  cursor: pointer;
}
.cb-tap:has(input:disabled) { cursor: not-allowed; }

/* ---------- action bar ---------- */

.actionbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(23, 28, 38, 0.92), rgba(13, 17, 24, 0.92));
  box-shadow: 0 -12px 40px -30px #000, inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.ab-summary { font-size: 12.5px; color: var(--dim); line-height: 1.45; }
.ab-summary strong { color: var(--text); font-size: 14px; }
.ab-hint { display: block; font-size: 11px; color: var(--faint); }
.ab-blocked {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.4;
  color: #fde68a;
}
.ab-blocked .ic { flex: 0 0 auto; margin-top: 1px; }
.actionbar.is-blocked { border-color: rgba(251, 191, 36, 0.24); }
.ab-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #08060f;
  background: var(--grad);
  background-size: 160% 160%;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 14px 34px -16px rgba(139, 92, 246, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.18s var(--ease), box-shadow 0.18s, background-position 0.4s;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); background-position: 100% 0; box-shadow: 0 18px 40px -16px rgba(34, 211, 238, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(0.99); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.16s, background 0.16s;
}
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.24); }

/* ---------- states ---------- */

.empty-note,
.avif-note {
  padding: 26px 24px;
  text-align: center;
  color: var(--dim);
}
.avif-note { text-align: left; }
.avif-note .big-icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  margin-bottom: 14px;
  border-radius: 15px;
  color: #c9bfff;
  background: var(--grad-soft);
  border: 1px solid rgba(167, 139, 250, 0.25);
}
.avif-note h3 { font-size: 16px; margin-bottom: 6px; }
.avif-note p { font-size: 13px; line-height: 1.6; color: var(--dim); max-width: 520px; }
.avif-note ul { margin: 12px 0 0; display: grid; gap: 7px; }
.avif-note li { display: flex; gap: 8px; font-size: 12.5px; color: var(--dim); }
.avif-note li .ic { color: var(--green); flex: 0 0 auto; margin-top: 2px; }

.error-box {
  margin: 22px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(251, 113, 133, 0.3);
  background: rgba(251, 113, 133, 0.07);
}
.error-box h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #ffc2cb; }
.error-box p { margin-top: 6px; font-size: 12.5px; color: var(--dim); }

/* ---------- result ---------- */

.result {
  padding: 34px 30px 30px;
  text-align: center;
  animation: rise 0.4s var(--ease) both;
}
.result-badge {
  position: relative;
  width: 78px;
  height: 78px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #06231a;
  background: linear-gradient(145deg, #6ee7b7, #34d399);
  box-shadow: 0 0 0 10px rgba(52, 211, 153, 0.1), 0 20px 50px -22px rgba(52, 211, 153, 0.9);
}
.result-badge::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(52, 211, 153, 0.35);
  animation: ping 2.8s ease-out infinite;
}
.result h2 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.03em; }
.result-sub { margin-top: 8px; color: var(--dim); font-size: 13.5px; }

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 560px;
  margin: 24px auto 0;
}
.rstat {
  padding: 14px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}
.rstat .num { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.rstat .num.green { color: var(--green); }
.rstat .lbl { margin-top: 2px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); }

.verify-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 620px;
  margin: 18px auto 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(52, 211, 153, 0.22);
  background: rgba(52, 211, 153, 0.06);
  color: #b8f5dd;
  font-size: 12px;
}
.verify-strip.is-warn {
  border-color: rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.07);
  color: #fde68a;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}
.result-notes {
  max-width: 560px;
  margin: 20px auto 0;
  text-align: left;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.result-notes li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12px;
  color: var(--dim);
  padding: 3px 0;
}
.result-notes li::before {
  content: "";
  flex: 0 0 auto;
  width: 4px;
  height: 4px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
}

/* ---------- explainer / roadmap ---------- */

.explainer,
.roadmap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 74px 32px 0;
}
.section-head { max-width: 620px; margin-bottom: 26px; }
.section-head h2 {
  margin-top: 14px;
  font-size: clamp(1.65rem, 3.4vw, 2.35rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.section-sub { margin-top: 10px; color: var(--dim); font-size: 14px; }

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.step-card {
  position: relative;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.01));
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.step-card:hover { border-color: rgba(139, 92, 246, 0.3); transform: translateY(-2px); }
.step-num {
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.08em;
}
.step-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border-radius: 12px;
  color: #cfc4ff;
  background: rgba(139, 92, 246, 0.13);
  border: 1px solid rgba(139, 92, 246, 0.2);
}
.step-card h3 { font-size: 15.5px; letter-spacing: -0.015em; }
.step-card p { margin-top: 7px; font-size: 12.8px; line-height: 1.62; color: var(--dim); }

.roadmap-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.roadmap-list li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}
.rm-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.roadmap-list strong { font-size: 13.5px; font-weight: 600; }
.roadmap-list p { margin-top: 2px; font-size: 11.5px; color: var(--faint); line-height: 1.45; }

/* ---------- footer ---------- */

.footer {
  max-width: 1180px;
  margin: 80px auto 0;
  padding: 26px 32px 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
}
.footer-left { display: flex; align-items: center; gap: 10px; }
.footer-tech { font-size: 11.5px; }
.footer-tech strong { color: var(--dim); font-weight: 600; }

/* ---------- toasts ---------- */

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: min(380px, calc(100vw - 40px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: rgba(19, 24, 33, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.9);
  font-size: 12.5px;
  color: var(--text);
  animation: toast-in 0.28s var(--ease) both;
}
.toast.is-leaving { animation: toast-out 0.22s var(--ease) forwards; }
.toast .ic { flex: 0 0 auto; margin-top: 1px; }
.toast.tone-success .ic { color: var(--green); }
.toast.tone-error .ic { color: var(--red); }
.toast.tone-info .ic { color: var(--cyan); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px) scale(0.98); }
}

/* ---------- drop overlay ---------- */

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  background: rgba(6, 7, 10, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
body.is-dragging .drop-overlay { opacity: 1; }
.drop-overlay-inner {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 46px 64px;
  border-radius: 26px;
  border: 1.5px dashed rgba(167, 139, 250, 0.7);
  background: rgba(139, 92, 246, 0.07);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .meta-float { display: none; }
}

@media (max-width: 1080px) {
  .editor-grid { grid-template-columns: 1fr; }
  .preview-frame { max-height: 340px; }
  .preview-frame img { max-height: 310px; }
  .meta-scroll { max-height: clamp(320px, 58vh, 560px); }
  .step-grid { grid-template-columns: 1fr; }
  .roadmap-list { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; padding: 20px 18px; }
  .rail { position: static; }
  .file-list { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .file-card { min-width: 232px; }
  .rail-note { display: none; }
  .topbar-inner { padding: 14px 18px; }
  .hero { padding: 44px 18px 10px; }
  .explainer, .roadmap { padding: 52px 18px 0; }
  .footer { padding: 22px 18px 34px; margin-top: 56px; }
  .ghost-link { display: none; }
}

@media (max-width: 600px) {
  .secure-pill span:not(.pulse-dot) { display: none; }
  .secure-pill { padding: 8px; }
  .dropzone { padding: 34px 18px 28px; }
  .insp-head { align-items: flex-start; }
  .preview-frame { min-height: 170px; max-height: 210px; }
  .preview-frame img { max-height: 184px; }
  .gps-map { height: 104px; }
  .actionbar { flex-direction: column; align-items: stretch; }
  .actionbar .btn-primary { width: 100%; }
  .result-stats { grid-template-columns: 1fr; }
  .file-facts { display: none; }
  .meta-head { flex-direction: column; }
  .meta-head-tools { align-self: flex-start; }
  .group-count .chip-keep { display: none; }
  .field-line { grid-template-columns: 1fr; gap: 2px; }
  .field-value { text-align: left; }
  .ab-actions { flex-direction: column; align-items: stretch; width: 100%; }
  .actionbar .btn-ghost { width: 100%; }
}

/* ---------- motion ---------- */

@media (pointer: coarse) {
  .preset-btn,
  .mini-btn,
  .btn-ghost,
  .btn-secondary,
  .gps-actions button,
  .gps-actions a { min-height: 44px; }
  .icon-btn { min-width: 44px; min-height: 44px; }
  .field-row { min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.noscript {
  position: fixed;
  inset: auto 0 0 0;
  padding: 16px;
  text-align: center;
  background: #2b1216;
  color: #ffd7dc;
  font-size: 13px;
  z-index: 300;
}

/* utility */
.spin { animation: spin 0.9s linear infinite; }
[hidden] { display: none !important; }
