/* ==========================================================================
   MeinConventer – Design System "The Conversion Universe"
   ========================================================================== */

@font-face {
  font-family: "InterVar";
  src: local("Inter Variable"), local("Inter"), url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* colour */
  --bg: #070B14;
  --bg-2: #0C1220;
  --card: #111A2B;
  --raised: #172338;
  --cyan: #45E6FF;
  --violet: #8B7CFF;
  --mint: #54F0BC;
  --text: #F4F7FF;
  --text-2: #9BAAC2;
  --text-3: #7787A0;
  --line: rgba(166, 192, 230, .13);
  --line-2: rgba(166, 192, 230, .22);
  --danger: #FF6B81;
  --warn: #FFC56B;
  --glass: rgba(17, 26, 43, .72);
  --cyan-soft: rgba(69, 230, 255, .12);
  --violet-soft: rgba(139, 124, 255, .14);
  --light: linear-gradient(90deg, var(--cyan), var(--violet));

  /* type */
  --font: "InterVar", "Inter", "Manrope", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --fs-xs: .75rem;
  --fs-sm: .875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-h3: 1.25rem;
  --fs-h2: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  --fs-h1: clamp(2.5rem, 1.4rem + 4.6vw, 5rem);

  /* space & shape */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;
  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-xl: 26px;
  --wrap: 1200px;
  --gutter: 16px;

  /* motion system */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --t-fast: 140ms;
  --t-base: 240ms;
  --t-slow: 420ms;

  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .7), 0 2px 0 rgba(255, 255, 255, .02) inset;
  color-scheme: dark;
}
@media (min-width: 720px) { :root { --gutter: 28px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--fs-md); line-height: 1.6;
  font-feature-settings: "cv11", "ss01", "ss03"; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--cyan); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; font-weight: 650; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.mono { font-family: var(--mono); font-feature-settings: normal; letter-spacing: 0; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; flex: none; }
kbd { font-family: var(--mono); font-size: .72em; padding: 1px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; color: var(--text-2); background: var(--bg-2); }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: var(--r); background: var(--text); color: var(--bg); font-weight: 600; transition: top var(--t-base) var(--ease); }
.skip:focus { top: 12px; }

/* ---------- backdrop: matte base, fine grid, a single soft light ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bd-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px; opacity: .35;
  mask-image: radial-gradient(ellipse 70% 55% at 60% 0%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 60% 0%, #000 0%, transparent 70%);
}
.bd-light {
  position: absolute; width: 900px; height: 900px; right: -240px; top: -420px;
  background: radial-gradient(circle, rgba(69, 230, 255, .10), rgba(139, 124, 255, .07) 40%, transparent 68%);
}
body::after { /* subtle grain */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .045;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- buttons ---------- */
.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--h); padding: 0 18px; border-radius: var(--r); border: 1px solid transparent;
  font-weight: 600; font-size: var(--fs-sm); letter-spacing: .005em; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-base) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn-sm { --h: 36px; padding: 0 12px; border-radius: 10px; }
.btn-lg { --h: 52px; padding: 0 24px; font-size: var(--fs-md); }
.btn-primary { background: var(--cyan); color: #04121A; box-shadow: 0 0 0 0 rgba(69, 230, 255, 0); }
.btn-primary:hover { background: #6BECFF; box-shadow: 0 8px 28px -10px rgba(69, 230, 255, .6); }
.btn-ghost { background: rgba(244, 247, 255, .03); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: rgba(69, 230, 255, .5); background: var(--cyan-soft); }
.btn-danger { background: transparent; border-color: rgba(255, 107, 129, .4); color: var(--danger); }
.btn-danger:hover { background: rgba(255, 107, 129, .1); }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; color: var(--cyan); font-weight: 600; font-size: var(--fs-sm); text-decoration: none; }
.link-arrow .ic { transition: transform var(--t-base) var(--ease); }
.link-arrow:hover .ic { transform: translateX(3px); }

/* ---------- header ---------- */
.hdr { position: sticky; top: 0; z-index: 40; transition: background-color var(--t-base) var(--ease), border-color var(--t-base) var(--ease); border-bottom: 1px solid transparent; }
.hdr.is-scrolled { background: rgba(7, 11, 20, .82); border-bottom-color: var(--line); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); }
.hdr-in { display: flex; align-items: center; gap: var(--s5); height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.wordmark { font-size: 1.12rem; letter-spacing: -.025em; line-height: 1; }
.wm-light { font-weight: 380; color: var(--text-2); }
.wm-strong { font-weight: 720; color: var(--text); }
.nav { flex: 1; display: flex; justify-content: center; }
.nav ul { display: flex; gap: 2px; }
.nav a { display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 10px; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); text-decoration: none; transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.nav a:hover { color: var(--text); background: rgba(244, 247, 255, .04); }
.nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--cyan); border-radius: 10px 10px 2px 2px; }
.nav-mobile-extra { display: none; }
.hdr-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.hdr-icon { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text-2); cursor: pointer; text-decoration: none; transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast); }
.hdr-icon:hover, .hdr-icon[aria-current="page"] { color: var(--text); border-color: var(--line-2); background: rgba(244, 247, 255, .04); }
.hdr-icon kbd { padding: 0 5px; }
.nav-toggle { display: none; }

@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; }
  .hdr-icon kbd { display: none; }
  .nav {
    position: fixed; left: 0; right: 0; top: 68px; bottom: 0; display: block; padding: var(--s5) var(--gutter);
    background: rgba(7, 11, 20, .97); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease), visibility 0s linear var(--t-base);
    overflow-y: auto;
  }
  body.nav-open .nav { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  body.nav-open { overflow: hidden; }
  .nav ul { flex-direction: column; gap: 4px; }
  .nav a { height: 56px; font-size: var(--fs-lg); padding: 0 var(--s4); border: 1px solid var(--line); background: var(--bg-2); }
  .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--cyan); border-radius: 10px; }
  .nav-mobile-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: var(--s4); }
  .nav-mobile-extra a { justify-content: center; gap: 8px; }
}
@media (max-width: 560px) { .hdr-cta { display: none; } }

/* ---------- eyebrow / headings ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--cyan); }
.eb-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px var(--cyan-soft); }
.sec { padding: var(--s9) 0 0; }
.sec-tight { padding-top: var(--s7); }
.sec-head { max-width: 720px; margin-bottom: var(--s7); }
.sec-head-row { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.sec-title { font-size: var(--fs-h2); font-weight: 680; letter-spacing: -.03em; margin-top: var(--s3); }
.sec-title-sm { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); margin: 0 0 var(--s3); display: flex; align-items: center; gap: 10px; }
.sec-sub { color: var(--text-2); font-size: var(--fs-lg); margin-top: var(--s4); max-width: 60ch; }
.h-small { font-size: var(--fs-md); font-weight: 650; margin: var(--s5) 0 var(--s2); }

/* ---------- hero ---------- */
.hero { padding: var(--s7) 0 var(--s4); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: var(--s6); }
.hero-title { font-size: var(--fs-h1); font-weight: 720; letter-spacing: -.045em; line-height: 1.02; margin: var(--s5) 0 var(--s5); }
.hero-title .hl { color: transparent; background: linear-gradient(95deg, var(--text) 0%, var(--cyan) 55%, var(--violet) 100%); -webkit-background-clip: text; background-clip: text; }
.hero-sub { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); color: var(--text-2); max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s6); }
.hero-facts { display: flex; flex-wrap: wrap; gap: var(--s6); margin: var(--s7) 0 0; padding-top: var(--s5); border-top: 1px solid var(--line); }
.hero-facts dt { font-size: var(--fs-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }
.hero-facts dd { margin: 2px 0 0; font-size: var(--fs-h3); font-weight: 600; }
.hero-core { position: relative; aspect-ratio: 1; max-width: 560px; justify-self: end; width: 100%; }
.core-stage { width: 100%; height: auto; overflow: visible; }
.cs-tag { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; fill: var(--text-3); }
.cs-tag-out { fill: var(--cyan); opacity: .8; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-core { order: -1; max-width: 340px; justify-self: center; margin-bottom: -30px; }
  .hero-facts { gap: var(--s5); }
}

/* ---------- conversion stage ---------- */
.stage {
  position: relative; margin-top: var(--s7); border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(23, 35, 56, .92), rgba(17, 26, 43, .96));
  border: 1px solid var(--line-2); box-shadow: var(--shadow), 0 0 0 1px rgba(7, 11, 20, .6);
}
.stage::before { /* precise light edge on top */
  content: ""; position: absolute; left: 10%; right: 10%; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), transparent); opacity: .8;
}
.stage-bar { display: flex; align-items: center; gap: var(--s4); padding: 14px var(--s5); border-bottom: 1px solid var(--line); }
.stage-dots { display: flex; gap: 6px; }
.stage-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--raised); border: 1px solid var(--line-2); }
.stage-steps { display: flex; gap: 4px; margin: 0 auto; }
.st { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; color: var(--text-3); padding: 4px 10px; border-radius: 99px; transition: color var(--t-base), background-color var(--t-base); }
.st.is-on { color: var(--text); background: rgba(244, 247, 255, .06); }
.st.is-done { color: var(--mint); }
.stage-meta { font-size: var(--fs-xs); color: var(--text-3); }
@media (max-width: 720px) { .stage-steps { display: none; } .stage-meta { margin-left: auto; } }

.dz {
  position: relative; display: grid; justify-items: center; text-align: center; gap: var(--s4);
  margin: var(--s4); padding: var(--s7) var(--s5); border-radius: var(--r-lg);
  border: 1.5px dashed var(--line-2); background: rgba(7, 11, 20, .35); cursor: pointer;
  transition: border-color var(--t-base) var(--ease), background-color var(--t-base) var(--ease);
}
.dz:hover { border-color: rgba(69, 230, 255, .45); }
.dz.is-over { border-color: var(--cyan); border-style: solid; background: rgba(69, 230, 255, .06); }
.dz.is-compact { padding: var(--s5); grid-template-columns: auto 1fr auto; text-align: left; justify-items: start; align-items: center; }
.dz.is-compact .dz-hint, .dz.is-compact .dz-sub { display: none; }
.dz.is-compact .dz-visual { width: 52px; height: 52px; }
.dz.is-compact .dz-visual .core-mark { width: 30px; height: 30px; }
.dz.is-compact .btn-lg { --h: 44px; }
.dz-visual { position: relative; width: 104px; height: 104px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, rgba(69, 230, 255, .12), transparent 70%); }
.dz-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line-2); }
.dz-ring::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid transparent; border-top-color: var(--cyan); transition: transform var(--t-slow) var(--ease); }
.dz:hover .dz-ring::after, .dz.is-over .dz-ring::after { transform: rotate(180deg); }
.dz-title { font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); font-weight: 650; letter-spacing: -.02em; }
.dz-sub, .dz-hint { color: var(--text-2); font-size: var(--fs-sm); }
.dz-hint { color: var(--text-3); max-width: 60ch; }
@media (max-width: 560px) {
  .dz { padding: var(--s6) var(--s4); margin: var(--s3); }
  .dz.is-compact { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .dz .btn-lg { width: 100%; }
}

/* work mode */
.work { padding: 0 var(--s4) var(--s4); animation: rise var(--t-slow) var(--ease); }
.work-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; padding: var(--s3) var(--s2) var(--s4); }
.work-title { font-size: var(--fs-h3); font-weight: 650; }
.work-sub { color: var(--text-2); font-size: var(--fs-sm); }
.work-tools { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.bulk { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-2); }
.work-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; padding: var(--s5) var(--s2) var(--s2); border-top: 1px solid var(--line); margin-top: var(--s4); }
.work-note { display: flex; gap: 8px; align-items: flex-start; color: var(--text-3); font-size: var(--fs-xs); max-width: 52ch; }
.work-note .ic { width: 16px; height: 16px; margin-top: 1px; }
.work-actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-left: auto; }
@media (max-width: 560px) { .work-actions { width: 100%; } .work-actions .btn { flex: 1 1 auto; } .work-actions [data-start] { width: 100%; order: -1; } }

/* file rows with Format Flow */
.files { display: grid; gap: var(--s3); }
.file {
  position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: var(--s4); align-items: center;
  padding: var(--s4); border-radius: var(--r-lg); background: rgba(7, 11, 20, .5); border: 1px solid var(--line);
  animation: rise var(--t-base) var(--ease) both; transition: border-color var(--t-base) var(--ease);
}
.file.is-done { border-color: rgba(84, 240, 188, .35); }
.file.is-error { border-color: rgba(255, 107, 129, .4); }
.f-thumb { width: 56px; height: 56px; border-radius: var(--r); background: var(--raised) center/cover no-repeat; display: grid; place-items: center; font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--text-2); border: 1px solid var(--line); overflow: hidden; }
.f-main { min-width: 0; display: grid; gap: 6px; }
.f-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-meta { font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-3); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.f-side { display: flex; align-items: center; gap: 6px; }
.f-x { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--text-3); cursor: pointer; transition: color var(--t-fast), border-color var(--t-fast); }
.f-x:hover { color: var(--text); border-color: var(--line-2); }
.f-x.is-fav { color: var(--warn); }
.f-x.is-fav .ic { fill: currentColor; }

.flow { display: grid; grid-template-columns: auto minmax(28px, 1fr) auto minmax(28px, 1fr) auto; align-items: center; gap: 8px; margin-top: 2px; }
.flow-node { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 12px; font-weight: 600; background: var(--bg-2); white-space: nowrap; }
.flow-proc { color: var(--text-3); font-weight: 500; font-size: 11px; }
.flow-proc .core-mark { width: 16px; height: 16px; }
.flow-line { position: relative; height: 2px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.flow-line i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0)); background: var(--light); transition: transform var(--t-base) linear; }
.file.is-converting .flow-line.l2 i { transform: none; background: linear-gradient(90deg, transparent, var(--cyan), transparent); width: 40%; animation: travel 1.3s var(--ease-io) infinite; }
.file.is-converting .flow-proc { color: var(--cyan); border-color: rgba(69, 230, 255, .5); }
.file.is-converting .flow-proc .core-mark { animation: spin 2.4s linear infinite; }
.file.is-done .flow-line i { transform: scaleX(1); background: var(--mint); }
.file.is-done .flow-proc { color: var(--mint); border-color: rgba(84, 240, 188, .4); }
.file.is-error .flow-proc { color: var(--danger); border-color: rgba(255, 107, 129, .45); }
.fmt-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 10px; border-radius: 8px; cursor: pointer;
  font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--cyan); background: var(--cyan-soft); border: 1px solid rgba(69, 230, 255, .45);
  transition: background-color var(--t-fast), border-color var(--t-fast);
}
.fmt-btn:hover { background: rgba(69, 230, 255, .2); }
.fmt-btn .ic { width: 14px; height: 14px; }
.fmt-btn.is-swapped { animation: swap var(--t-slow) var(--ease); }
.fmt-btn[disabled] { cursor: default; color: var(--text); background: var(--bg-2); border-color: var(--line-2); }
.f-note { font-size: var(--fs-xs); color: var(--text-2); display: flex; gap: 6px; align-items: flex-start; }
.f-note .ic { width: 14px; height: 14px; margin-top: 2px; color: var(--violet); }
.f-status { font-size: var(--fs-xs); font-family: var(--mono); }
.f-status.ok { color: var(--mint); }
.f-status.err { color: var(--danger); font-family: var(--font); font-size: var(--fs-sm); }
.f-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
@media (max-width: 640px) {
  .file { grid-template-columns: 44px minmax(0, 1fr); gap: var(--s3); padding: var(--s3); }
  .f-thumb { width: 44px; height: 44px; }
  .f-side { position: absolute; right: 6px; top: 6px; }
  .f-name { padding-right: 70px; }
  .flow { grid-template-columns: auto minmax(14px, 1fr) auto minmax(14px, 1fr) auto; gap: 4px; }
  .flow-proc span { display: none; }
  .f-main { grid-column: 1 / -1; }
  .f-thumb { grid-row: 1; }
  .file > .f-main { grid-column: 2; }
  .f-flow-wrap { grid-column: 1 / -1; }
}

/* format picker */
.picker {
  position: fixed; z-index: 60; width: min(420px, calc(100vw - 24px)); max-height: min(460px, 70vh); display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
  animation: pop var(--t-base) var(--ease);
}
.picker-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.picker-search input { flex: 1; min-width: 0; height: 36px; border: 0; background: none; outline: none; color: var(--text); }
.picker-body { overflow-y: auto; padding: 8px 12px 14px; overscroll-behavior: contain; }
.picker-group { margin-top: 10px; }
.picker-group h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); font-weight: 600; margin-bottom: 6px; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.picker-grid button { min-height: 40px; padding: 4px 6px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; font-family: var(--mono); font-size: 12px; font-weight: 600; transition: border-color var(--t-fast), background-color var(--t-fast), color var(--t-fast); }
.picker-grid button:hover, .picker-grid button:focus-visible { border-color: rgba(69, 230, 255, .6); color: var(--cyan); }
.picker-grid button[aria-pressed="true"] { background: var(--cyan); color: #04121A; border-color: var(--cyan); }
.picker-empty { padding: 18px 4px; color: var(--text-3); font-size: var(--fs-sm); }
@media (max-width: 560px) {
  .picker { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100%; max-height: 75vh; border-radius: var(--r-xl) var(--r-xl) 0 0; animation: sheet var(--t-slow) var(--ease); }
  .picker-grid button { min-height: 46px; }
}

/* options */
.opts { margin-top: var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: rgba(7, 11, 20, .35); }
.opts-toggle { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px var(--s4); border: 0; background: none; cursor: pointer; font-weight: 600; font-size: var(--fs-sm); text-align: left; }
.opts-toggle small { color: var(--text-3); font-weight: 400; font-family: var(--mono); margin-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opts-toggle .chev { margin-left: auto; transition: transform var(--t-base) var(--ease); }
.opts-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.opts-body { padding: 0 var(--s4) var(--s4); display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); animation: rise var(--t-base) var(--ease); }
.opt-group { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); background: var(--bg-2); display: grid; gap: var(--s4); align-content: start; }
.opt-group h4 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--cyan); font-weight: 600; }
.opt-row { display: grid; gap: 8px; }
.opt-row > label, .opt-label { font-size: var(--fs-sm); color: var(--text-2); display: flex; justify-content: space-between; gap: 8px; }
.opt-label output { font-family: var(--mono); color: var(--text); }
.opt-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* form controls */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label { font-size: var(--fs-sm); color: var(--text-2); font-weight: 500; }
input[type="text"], input[type="number"], input[type="email"], input[type="search"], input[type="password"], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
textarea { resize: vertical; line-height: 1.5; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239BAAC2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") right 12px center no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(69, 230, 255, .18); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input[type="range"] { width: 100%; height: 28px; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--cyan) var(--fill, 50%), var(--raised) var(--fill, 50%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--raised); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--cyan); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: var(--text); border: 3px solid var(--cyan); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 3px solid var(--cyan); }
.seg { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 3px; border-radius: 11px; background: var(--bg); border: 1px solid var(--line); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: 8px; font-size: var(--fs-sm); color: var(--text-2); transition: background-color var(--t-fast), color var(--t-fast); }
.seg input:checked + span { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 1px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 99px; background: var(--raised); border: 1px solid var(--line-2); position: relative; cursor: pointer; transition: background-color var(--t-base); flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform var(--t-base) var(--ease), background-color var(--t-base); }
.switch input:checked { background: rgba(69, 230, 255, .3); border-color: var(--cyan); }
.switch input:checked::after { transform: translateX(16px); background: var(--cyan); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); color: var(--text-2); }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--cyan); flex: none; }

/* trust row */
.trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); margin-top: var(--s5); }
.trust li { display: flex; gap: 12px; align-items: flex-start; font-size: var(--fs-sm); color: var(--text-2); padding: var(--s4); }
.trust .ic { color: var(--cyan); margin-top: 2px; }
.trust strong { display: block; color: var(--text); font-weight: 600; }
@media (max-width: 820px) { .trust { grid-template-columns: 1fr; gap: 0; } .trust li { padding: var(--s3) 0; } }

/* ---------- categories ---------- */
.cats { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s4); }
.cat {
  --accent: var(--cyan);
  position: relative; grid-column: span 4; min-height: 270px; display: flex; flex-direction: column; overflow: hidden;
  padding: var(--s5); border-radius: var(--r-xl); background: var(--card); border: 1px solid var(--line); text-decoration: none;
  transition: border-color var(--t-base) var(--ease), transform var(--t-base) var(--ease), background-color var(--t-base) var(--ease);
}
.cat:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: #131E31; }
.cat:focus-visible { outline-offset: 4px; }
.cat-wide { grid-column: span 8; }
.cat-image { --accent: #45E6FF; } .cat-document { --accent: #8B7CFF; } .cat-pdf { --accent: #A89BFF; } .cat-audio { --accent: #54F0BC; }
.cat-video { --accent: #45E6FF; } .cat-archive { --accent: #8B7CFF; } .cat-data { --accent: #54F0BC; } .cat-ebook { --accent: #A89BFF; } .cat-units { --accent: #9BAAC2; }
.cat-motif { height: 110px; margin: -6px -6px var(--s4); display: flex; align-items: center; }
.cat-wide .cat-motif { position: absolute; right: var(--s5); top: var(--s5); width: 46%; height: auto; margin: 0; }
.motif { width: 160px; height: 107px; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.cat-wide .motif { width: 100%; height: auto; }
.motif * { transition: transform var(--t-slow) var(--ease), opacity var(--t-slow) var(--ease), fill var(--t-slow) var(--ease); transform-box: fill-box; transform-origin: center; }
.motif .mo-fill { fill: color-mix(in srgb, var(--accent) 22%, transparent); }
.motif .mo-light { stroke: var(--line-2); }
.motif .mo-rail, .motif .mo-lines { stroke: var(--line-2); }
.motif .w2 { opacity: .4; }
.cat-body { margin-top: auto; position: relative; }
.cat-title { display: flex; align-items: center; gap: 10px; font-size: var(--fs-h3); font-weight: 650; }
.cat-title .ic { color: var(--accent); }
.cat-desc { color: var(--text-2); font-size: var(--fs-sm); margin-top: 6px; max-width: 46ch; }
.cat-pairs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s4); }
.cat-pairs li { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text-2); }
.cat-count { position: absolute; top: var(--s5); right: var(--s5); font-size: 11px; color: var(--text-3); }
.cat-wide .cat-count { top: auto; bottom: var(--s5); }
/* hover characters */
.cat:hover .mo-grid rect:nth-child(odd) { transform: translateY(-3px); }
.cat:hover .mo-grid .mo-fill { fill: color-mix(in srgb, var(--accent) 45%, transparent); }
.cat:hover .mo-light { stroke: var(--accent); opacity: .6; }
.cat:hover .mo-pages .p3 { transform: translate(8px, -4px); } .cat:hover .mo-pages .p2 { transform: translate(4px, -2px); }
.cat:hover .mo-planes .l3 { transform: translateY(-6px); } .cat:hover .mo-planes .l2 { transform: translateY(-3px); }
.cat:hover .mo-wave { transform: translateX(-6px) scaleY(1.12); }
.cat:hover .mo-frames rect { transform: translateX(-6px); }
.cat:hover .mo-blocks .b1 { transform: translate(4px, 3px); } .cat:hover .mo-blocks .b3 { transform: translate(-4px, 3px); }
.cat:hover .mo-blocks .b4 { transform: translate(3px, -3px); } .cat:hover .mo-blocks .b5 { transform: translate(-3px, -3px); }
.cat:hover .mo-net circle { transform: scale(1.25); } .cat:hover .mo-net path { stroke: var(--text); opacity: .7; }
.cat:hover .mo-turn { transform: scaleX(-1) translateX(14px); opacity: .5; }
.cat:hover .mo-math circle { transform: scale(.85); } .cat:hover .mo-math path:first-of-type { transform: rotate(8deg); }
@media (max-width: 980px) { .cat, .cat-wide { grid-column: span 6; } .cat-wide .cat-motif { position: static; width: auto; margin: -6px -6px var(--s4); } .cat-wide .motif { width: 160px; } .cat-wide .cat-count { top: var(--s5); bottom: auto; } }
@media (max-width: 620px) { .cat, .cat-wide { grid-column: span 12; min-height: 0; } .cat-motif { height: 86px; } .motif { width: 128px; height: 86px; } }

/* ---------- format tags, pairs, tiles ---------- */
.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 8px; border-radius: 7px; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2); white-space: nowrap; }
.tag-out { color: var(--cyan); border-color: rgba(69, 230, 255, .45); background: var(--cyan-soft); }
.tag-lg { height: 34px; font-size: 14px; padding: 0 12px; }
.tag-xl { height: auto; padding: .02em .28em; font-size: .78em; border-radius: .2em; vertical-align: .06em; letter-spacing: 0; }
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); }
.pair { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 14px var(--s4); border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); text-decoration: none; transition: border-color var(--t-base) var(--ease); }
.pair:hover { border-color: rgba(69, 230, 255, .45); }
.pair-line { position: relative; height: 1px; background: var(--line-2); }
.pair-line i { position: absolute; left: 0; top: -1px; width: 3px; height: 3px; border-radius: 50%; background: var(--cyan); opacity: 0; }
.pair:hover .pair-line i { animation: dotrun .9s var(--ease) forwards; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--s4); }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; font-weight: 600; text-decoration: none; transition: border-color var(--t-fast), color var(--t-fast); }
.chip:hover { border-color: rgba(69, 230, 255, .5); color: var(--cyan); }
.chip.is-on { border-color: var(--cyan); color: var(--cyan); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s3); }
.tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); text-decoration: none; transition: border-color var(--t-fast); min-height: 56px; }
.tile:hover { border-color: rgba(69, 230, 255, .45); }
.tile-name { flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .ic { color: var(--text-3); transition: transform var(--t-base) var(--ease), color var(--t-base); }
.tile:hover .ic { transform: translateX(3px); color: var(--cyan); }
.tile button { margin-left: auto; }

/* ---------- flow steps ---------- */
.flow-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6); counter-reset: s; position: relative; }
.flow-steps::before { content: ""; position: absolute; left: 24px; right: 24px; top: 24px; height: 1px; background: linear-gradient(90deg, var(--line-2), var(--cyan), var(--violet), var(--line-2)); opacity: .55; }
.flow-steps li { position: relative; }
.fs-node { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line-2); color: var(--cyan); font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--s5); }
.flow-steps h3 { font-size: var(--fs-h3); margin-bottom: 8px; }
.flow-steps p { color: var(--text-2); font-size: var(--fs-sm); max-width: 36ch; }
@media (max-width: 820px) {
  .flow-steps { grid-template-columns: 1fr; gap: var(--s5); }
  .flow-steps::before { left: 24px; right: auto; top: 24px; bottom: 24px; width: 1px; height: auto; background: linear-gradient(180deg, var(--cyan), var(--violet)); }
  .flow-steps li { padding-left: 72px; } .fs-node { position: absolute; left: 0; top: 0; }
}

/* ---------- facts panel ---------- */
.facts-panel { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: var(--s7); padding: var(--s7); border-radius: var(--r-xl); background: var(--bg-2); border: 1px solid var(--line); }
.fp-intro p { color: var(--text-2); margin: var(--s3) 0 var(--s5); }
.fp-list { margin: 0; display: grid; gap: 0; }
.fp-list div { display: grid; grid-template-columns: 150px 1fr; gap: var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.fp-list div:last-child { border: 0; }
.fp-list dt { font-weight: 600; font-size: var(--fs-sm); }
.fp-list dd { margin: 0; color: var(--text-2); font-size: var(--fs-sm); }
@media (max-width: 860px) { .facts-panel { grid-template-columns: 1fr; padding: var(--s5); gap: var(--s5); } .fp-list div { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- page hero & content ---------- */
.page-hero { padding: var(--s7) 0 var(--s2); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: var(--fs-sm); color: var(--text-3); margin-bottom: var(--s5); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--cyan); }
.ph-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s6); align-items: end; }
.ph-title { font-size: clamp(2rem, 1.3rem + 3vw, 3.5rem); font-weight: 700; letter-spacing: -.04em; line-height: 1.08; }
.ph-sub { color: var(--text-2); font-size: var(--fs-lg); margin-top: var(--s4); max-width: 62ch; }
.ph-facts { display: grid; grid-template-columns: repeat(2, auto); gap: var(--s3) var(--s6); margin: 0; padding: var(--s4) var(--s5); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--bg-2); }
.ph-facts dt { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }
.ph-facts dd { margin: 0; font-weight: 600; font-size: var(--fs-sm); }
.ph-grid + .stage { margin-top: var(--s6); }
.cat-hero-motif .motif { width: 220px; height: 147px; stroke: var(--cyan); }
@media (max-width: 760px) { .ph-grid { grid-template-columns: 1fr; } .cat-hero-motif { display: none; } }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s7); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: var(--s6); } }
.about-format p { color: var(--text-2); margin-bottom: var(--s3); }
.fmt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s4); }
.fmt-card { height: 100%; display: grid; align-content: start; gap: 10px; padding: var(--s5); border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); text-decoration: none; transition: border-color var(--t-base) var(--ease); }
.fmt-card:hover { border-color: rgba(69, 230, 255, .45); }
.fmt-card .tag { justify-self: start; }
.fc-name { font-weight: 650; font-size: var(--fs-lg); }
.fc-desc { color: var(--text-2); font-size: var(--fs-sm); }
.fc-src { color: var(--text-3); font-size: 11px; margin-top: auto; }
.side-card { padding: var(--s5); border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line); display: grid; gap: var(--s3); justify-items: start; }
.side-card .h-small { margin: 0; }
.kv { margin: 0; width: 100%; }
.kv div { display: flex; justify-content: space-between; gap: var(--s4); padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }

/* faq */
.faq { display: grid; gap: var(--s2); }
.faq-item { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); transition: border-color var(--t-base); }
.faq-item[open] { border-color: var(--line-2); }
.faq-item summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--s4); padding: var(--s4) var(--s5); font-weight: 600; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .ic { color: var(--cyan); transition: transform var(--t-base) var(--ease); }
.faq-item[open] summary .ic { transform: rotate(45deg); }
.faq-item p { padding: 0 var(--s5) var(--s5); color: var(--text-2); }

/* directory */
.dir-filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: var(--s3); align-items: end; padding: var(--s4); border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line); position: sticky; top: 76px; z-index: 5; }
.field-search { position: relative; }
.field-search .ic { position: absolute; left: 12px; bottom: 13px; color: var(--text-3); }
.field-search input { padding-left: 38px; }
@media (max-width: 860px) { .dir-filters { grid-template-columns: 1fr 1fr; position: static; } .field-search { grid-column: 1 / -1; } .dir-filters .field:nth-child(2) { grid-column: 1 / -1; } }
.dir-count { margin: var(--s5) 0 var(--s3); color: var(--text-3); font-size: var(--fs-sm); }
.dir-group { margin-top: var(--s5); }
.dir-group h2 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); font-weight: 600; margin-bottom: var(--s3); display: flex; align-items: center; gap: 8px; }
.dir-group h2 .ic { color: var(--cyan); }
.dir-list .pairs { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.empty { display: grid; justify-items: center; gap: var(--s3); text-align: center; padding: var(--s8) var(--s4); border: 1px dashed var(--line-2); border-radius: var(--r-xl); color: var(--text-2); }
.empty h2, .empty h3 { color: var(--text); font-size: var(--fs-h3); }
.empty p { max-width: 52ch; font-size: var(--fs-sm); }

/* search dialog */
.search { position: fixed; inset: 0; z-index: 80; display: grid; align-items: start; justify-items: center; padding: 12vh var(--gutter) var(--gutter); background: rgba(4, 7, 13, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade var(--t-base) var(--ease); }
.search-panel { width: min(640px, 100%); border-radius: var(--r-xl); background: var(--card); border: 1px solid var(--line-2); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .9); overflow: hidden; animation: pop var(--t-base) var(--ease); }
.search-field { display: flex; align-items: center; gap: 12px; padding: 0 var(--s4); border-bottom: 1px solid var(--line); color: var(--text-3); }
.search-field input { flex: 1; min-width: 0; height: 60px; border: 0; background: none; box-shadow: none !important; font-size: var(--fs-lg); padding: 0; }
.kbd-btn { font-family: var(--mono); font-size: 11px; padding: 4px 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg-2); color: var(--text-2); cursor: pointer; }
.search-results { max-height: min(420px, 55vh); overflow-y: auto; padding: 8px; }
.search-results li a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.search-results li a .sr-label { color: var(--text-2); font-size: var(--fs-sm); margin-left: auto; text-align: right; }
.search-results li[aria-selected="true"] a, .search-results li a:hover { background: var(--raised); }
.search-results .sr-empty { padding: 24px 12px; color: var(--text-3); font-size: var(--fs-sm); text-align: center; }
.search-foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px var(--s4); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--text-3); }
.search-foot a { color: var(--cyan); text-decoration: none; }
@media (max-width: 560px) { .search { padding: 0; } .search-panel { border-radius: 0; height: 100%; display: flex; flex-direction: column; } .search-results { max-height: none; flex: 1; } }

/* tools */
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.tool { padding: var(--s5); border-radius: var(--r-xl); background: var(--card); border: 1px solid var(--line); display: grid; gap: var(--s4); align-content: start; }
.tool-wide { grid-column: 1 / -1; }
.tool-head { display: flex; gap: var(--s4); align-items: flex-start; }
.tool-head h2 { font-size: var(--fs-h3); }
.tool-head p { color: var(--text-2); font-size: var(--fs-sm); margin-top: 4px; }
.tool-ic { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--cyan-soft); color: var(--cyan); }
.tool-ic .ic { width: 22px; height: 22px; }
.tool-flow { display: grid; grid-template-columns: 1fr 1fr auto 1fr; gap: var(--s3); align-items: end; }
.swap { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text-2); cursor: pointer; transition: transform var(--t-base) var(--ease), color var(--t-fast); }
.swap:hover { color: var(--cyan); transform: rotate(180deg); }
.tool-out { display: block; padding: var(--s4); border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); font-family: var(--mono); font-size: clamp(1.1rem, 1rem + 1vw, 1.6rem); color: var(--cyan); word-break: break-all; min-height: 64px; }
.tool-out small { display: block; font-size: var(--fs-xs); color: var(--text-3); margin-top: 4px; font-family: var(--font); }
.bases { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.enc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.tool-actions { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.tool-actions .btn { margin-left: auto; }
.tool-err { color: var(--danger); font-size: var(--fs-sm); }
@media (max-width: 860px) { .tools { grid-template-columns: 1fr; } .tool-flow { grid-template-columns: 1fr 1fr; } .tool-flow .field:first-child { grid-column: 1 / -1; } .swap { display: none; } .enc-grid { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .bases { grid-template-columns: 1fr; } }

/* history */
.hist { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: var(--s7); align-items: start; }
.hist-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hist .tiles { grid-template-columns: 1fr; }
.hist-list { display: grid; gap: var(--s2); }
.hist-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: 14px var(--s4); border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.hist-item .hi-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-item .hi-meta { font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.hist-item .hi-actions { display: flex; gap: 6px; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11px; font-weight: 600; font-family: var(--font); }
.badge-ok { background: rgba(84, 240, 188, .12); color: var(--mint); }
.badge-off { background: rgba(155, 170, 194, .12); color: var(--text-2); }
.badge-err { background: rgba(255, 107, 129, .12); color: var(--danger); }
@media (max-width: 860px) { .hist { grid-template-columns: 1fr; } }

/* status */
.status-list { display: grid; gap: var(--s2); }
.status-list li { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s4); align-items: center; padding: var(--s4) var(--s5); border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.status-list .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); }
.status-list .is-ok .dot { background: var(--mint); box-shadow: 0 0 0 4px rgba(84, 240, 188, .14); animation: blink 1.6s ease-in-out infinite; }
.status-list li:nth-child(2n) .dot { animation-delay: .4s; }
.status-list li:nth-child(3n) .dot { animation-delay: .8s; }
@keyframes blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 4px rgba(84, 240, 188, .16); }
  50% { opacity: .35; box-shadow: 0 0 0 7px rgba(84, 240, 188, 0); }
}
.sl-name { font-weight: 600; display: grid; }
.sl-name small { font-weight: 400; color: var(--text-3); font-size: var(--fs-xs); }
.sl-state { font-size: var(--fs-sm); color: var(--text-2); }
.is-ok .sl-state { color: var(--mint); }

/* forms & notices */
.form-card { display: grid; gap: var(--s4); }
.form { display: grid; gap: var(--s4); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
@media (max-width: 620px) { .form-row { grid-template-columns: 1fr; } }
.form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: var(--s4); border-radius: var(--r); border: 1px solid var(--line-2); background: var(--bg-2); font-size: var(--fs-sm); }
.notice .ic { margin-top: 2px; }
.notice p, .notice ul { color: var(--text-2); margin-top: 2px; }
.notice ul { list-style: disc; padding-left: 18px; }
.notice-ok { border-color: rgba(84, 240, 188, .4); } .notice-ok .ic { color: var(--mint); }
.notice-err { border-color: rgba(255, 107, 129, .45); } .notice-err .ic { color: var(--danger); }
.notice-info .ic { color: var(--cyan); }
.notice-warn { border-color: rgba(255, 197, 107, .4); } .notice-warn .ic { color: var(--warn); }

.prose { max-width: 76ch; color: var(--text-2); }
.prose h2, .prose h3 { color: var(--text); margin: 1.6em 0 .5em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose ul { list-style: disc; padding-left: 1.3em; } .prose ol { list-style: decimal; padding-left: 1.3em; }
.prose a { color: var(--cyan); }

/* state pages */
.state { display: grid; justify-items: center; text-align: center; padding: var(--s8) var(--gutter); }
.state .ph-sub { margin-left: auto; margin-right: auto; }
.state-mark { display: grid; justify-items: center; gap: 12px; margin-bottom: var(--s5); }
.state-mark span { color: var(--text-3); letter-spacing: .3em; }

/* overlays & toasts */
.drop-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(4, 7, 13, .82); border: 2px solid var(--cyan); animation: fade var(--t-fast) var(--ease); pointer-events: none; }
.drop-overlay div { display: grid; justify-items: center; gap: var(--s4); font-size: var(--fs-h3); }
.toasts { position: fixed; z-index: 95; right: var(--gutter); bottom: var(--gutter); display: grid; gap: 8px; width: min(380px, calc(100vw - 2 * var(--gutter))); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--raised); border: 1px solid var(--line-2); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .8); font-size: var(--fs-sm); animation: rise var(--t-base) var(--ease); }
.toast.ok .ic { color: var(--mint); } .toast.err .ic { color: var(--danger); } .toast.info .ic { color: var(--cyan); }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity var(--t-base), transform var(--t-base); }

/* footer */
.ftr { margin-top: var(--s9); border-top: 1px solid var(--line); background: var(--bg-2); }
.ftr-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); gap: var(--s7); padding: var(--s7) 0; }
.ftr-claim { color: var(--text-2); margin: var(--s4) 0; }
.ftr-facts { display: grid; gap: 8px; font-size: var(--fs-sm); color: var(--text-3); }
.ftr-facts span { display: flex; gap: 8px; align-items: center; }
.ftr-facts .ic { width: 16px; height: 16px; color: var(--cyan); }
.ftr-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }
.ftr-h { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); font-weight: 600; margin-bottom: var(--s3); }
.ftr-cols li a { display: inline-block; padding: 5px 0; font-size: var(--fs-sm); color: var(--text-2); text-decoration: none; }
.ftr-cols li a:hover { color: var(--text); }
.ftr-bottom { display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; padding: var(--s5) 0; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--text-3); }
@media (max-width: 820px) { .ftr-top { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .ftr-cols { grid-template-columns: 1fr 1fr; } }

/* ---------- motion keyframes ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes travel { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@keyframes swap { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); opacity: .4; } 100% { transform: rotateX(0); } }
@keyframes dotrun { 0% { left: 0; opacity: 0; } 20% { opacity: 1; } 100% { left: calc(100% - 3px); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .file.is-converting .flow-line.l2 i { width: 100%; animation: none; background: var(--cyan); opacity: .5; }
}

/* ==========================================================================
   Admin
   ========================================================================== */
.adm { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.adm-side { position: sticky; top: 0; height: 100vh; padding: var(--s5); border-right: 1px solid var(--line); background: var(--bg-2); display: flex; flex-direction: column; gap: var(--s5); }
.adm-nav { display: grid; gap: 2px; }
.adm-nav a { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; }
.adm-nav a:hover { background: rgba(244, 247, 255, .04); color: var(--text); }
.adm-nav a[aria-current="page"] { background: var(--raised); color: var(--text); box-shadow: inset 2px 0 0 var(--cyan); }
.adm-nav .count { margin-left: auto; font-family: var(--mono); font-size: 11px; background: var(--cyan); color: #04121A; border-radius: 99px; padding: 0 7px; }
.adm-side-foot { margin-top: auto; display: grid; gap: 6px; }
.adm-main { padding: var(--s6) var(--gutter) var(--s8); max-width: 1180px; width: 100%; }
.adm-head { display: flex; justify-content: space-between; align-items: end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s6); }
.adm-head h1 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); letter-spacing: -.03em; }
.adm-head p { color: var(--text-2); margin-top: 4px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.kpi { padding: var(--s4) var(--s5); border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); }
.kpi dt { font-size: var(--fs-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }
.kpi dd { margin: 6px 0 0; font-size: 1.6rem; font-weight: 650; font-family: var(--mono); letter-spacing: -.02em; }
.kpi small { display: block; font-size: var(--fs-xs); color: var(--text-3); font-family: var(--font); font-weight: 400; }
.panel { padding: var(--s5); border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); margin-top: var(--s4); }
.panel h2 { font-size: var(--fs-lg); margin-bottom: var(--s4); display: flex; align-items: center; gap: 10px; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--s4); }
.panel-grid .panel { margin-top: var(--s4); }
.chart { width: 100%; height: 220px; }
.chart .bar { fill: url(#barg); }
.chart .bar-err { fill: var(--danger); opacity: .7; }
.chart text { font-family: var(--mono); font-size: 10px; fill: var(--text-3); }
.table-wrap { overflow-x: auto; margin: 0 calc(-1 * var(--s5)); padding: 0 var(--s5); }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td.mono { font-size: 12px; white-space: nowrap; }
.tbl .ellip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl tr.unread td { font-weight: 600; }
.bars-h { display: grid; gap: 10px; }
.bars-h li { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: var(--fs-sm); }
.bars-h .track { height: 6px; border-radius: 6px; background: var(--raised); overflow: hidden; }
.bars-h .track i { display: block; height: 100%; background: var(--light); border-radius: 6px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: var(--s4); flex-wrap: wrap; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.settings-grid .full { grid-column: 1 / -1; }
.hint { font-size: var(--fs-xs); color: var(--text-3); }
.adm-mobilebar { display: none; }
.filterbar { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: end; margin-bottom: var(--s4); }
.filterbar .field { min-width: 160px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: var(--gutter); }
.login-card { width: min(420px, 100%); padding: var(--s6); border-radius: var(--r-xl); background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow); display: grid; gap: var(--s4); }
.login-card .brand { justify-self: center; margin-bottom: var(--s2); }
.login-card h1 { font-size: var(--fs-h3); text-align: center; }
.login-card .btn { width: 100%; }
@media (max-width: 980px) {
  .adm { grid-template-columns: 1fr; }
  .adm-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: var(--s3) var(--gutter); gap: var(--s3); }
  .adm-nav { grid-auto-flow: column; overflow-x: auto; grid-auto-columns: max-content; }
  .adm-side-foot { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-grid, .settings-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Installer
   ========================================================================== */
.inst { min-height: 100vh; display: grid; place-items: center; padding: var(--s6) var(--gutter); }
.inst-card { width: min(760px, 100%); border-radius: var(--r-xl); background: linear-gradient(180deg, rgba(23, 35, 56, .8), rgba(17, 26, 43, .9)); border: 1px solid var(--line-2); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.inst-card::before { content: ""; position: absolute; left: 10%; right: 10%; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), transparent); }
.inst-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s5) var(--s6); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.inst-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.inst-steps span { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 99px; color: var(--text-3); border: 1px solid var(--line); }
.inst-steps .is-on { color: #04121A; background: var(--cyan); border-color: var(--cyan); }
.inst-steps .is-done { color: var(--mint); border-color: rgba(84, 240, 188, .35); }
.inst-body { padding: var(--s6); display: grid; gap: var(--s5); }
.inst-body h1 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); letter-spacing: -.03em; }
.inst-body > p { color: var(--text-2); }
.checks { display: grid; gap: 6px; }
.checks li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: var(--fs-sm); }
.checks .st-ok { color: var(--mint); } .checks .st-warn { color: var(--warn); } .checks .st-fail { color: var(--danger); }
.checks small { color: var(--text-3); font-family: var(--mono); font-size: 11px; text-align: right; }
.checks h3 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); margin: var(--s4) 0 4px; }
.inst-foot { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding-top: var(--s4); border-top: 1px solid var(--line); }
.inst-foot .btn:last-child { margin-left: auto; }
@media (max-width: 560px) { .inst-body, .inst-head { padding: var(--s5) var(--s4); } }
