/* ==========================================================================
   Media Manager — mm.qzent.ai
   Single stylesheet: design tokens, layout, components, animation, themes.
   No external fonts, no external requests.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --brand: #6236d6;
  --brand-2: #8a63f0;
  --brand-3: #3f9df0;
  --brand-soft: rgba(98, 54, 214, .10);
  --brand-line: rgba(98, 54, 214, .28);

  --bg: #f6f7fb;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f2f8;
  --line: #e3e4ee;
  --line-strong: #d2d4e2;

  --fg: #14151c;
  --fg-2: #4a4d5e;
  --fg-3: #7b7f93;

  --ok: #1f9d63;
  --warn: #c98a12;

  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 9px;

  --shadow-sm: 0 1px 2px rgba(18, 20, 40, .06), 0 2px 8px rgba(18, 20, 40, .05);
  --shadow: 0 8px 26px rgba(18, 20, 40, .09);
  --shadow-lg: 0 22px 60px rgba(18, 20, 40, .16);

  --wrap: 1160px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
          "Source Han Sans SC", "Noto Sans CJK SC", Roboto, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

:root[data-theme="dark"] {
  --brand: #8f6cf5;
  --brand-2: #b199ff;
  --brand-3: #5cb2ff;
  --brand-soft: rgba(143, 108, 245, .14);
  --brand-line: rgba(143, 108, 245, .34);

  --bg: #0c0d13;
  --bg-alt: #111219;
  --surface: #15161f;
  --surface-2: #1c1d28;
  --line: #262735;
  --line-strong: #34364a;

  --fg: #eceef6;
  --fg-2: #b3b7c7;
  --fg-3: #868a9c;

  --ok: #43c98c;
  --warn: #e0b355;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .6);
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.68;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .25s ease, color .25s ease;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.24; font-weight: 700; letter-spacing: -.015em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
code, kbd, pre { font-family: var(--mono); }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 3. Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 84px 0; position: relative; }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__head { max-width: 720px; margin-bottom: 44px; }
.section__head--center { margin-left: auto; margin-right: auto; text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand);
  padding: 5px 11px; border-radius: 999px;
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  margin-bottom: 16px;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}

h2.section__title { font-size: clamp(26px, 3.6vw, 38px); }
.section__sub { margin-top: 14px; color: var(--fg-2); font-size: 16.5px; }

/* ---------- 4. Header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background-color .25s ease;
}
.hdr.is-stuck { border-bottom-color: var(--line); }
.hdr__in {
  display: flex; align-items: center; gap: 12px;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--fg); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 9px; box-shadow: var(--shadow-sm); }
.brand__txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-size: 15.5px; letter-spacing: -.01em; }
.brand__sub { font-size: 11px; color: var(--fg-3); font-weight: 500; letter-spacing: .04em; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--fg-2); font-size: 14.5px; font-weight: 500;
  padding: 8px 12px; border-radius: 8px;
  transition: color .18s ease, background-color .18s ease;
}
.nav a:hover { color: var(--fg); background: var(--surface-2); text-decoration: none; }
.nav a.is-active { color: var(--brand); background: var(--brand-soft); }

.hdr__act { display: flex; align-items: center; gap: 8px; margin-left: 6px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; color: var(--fg-2);
  transition: transform .2s ease, border-color .2s ease, color .2s ease, background-color .2s ease;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand-line); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; display: block; }
.card__ico svg { display: block; }

/* Sprite icons: geometry lives in assets/sprite.svg, so paint and sizing must be
   stated here — fill/stroke do not cross the <use> shadow boundary. Symbols that
   need a solid shape set fill/stroke="currentColor" on their own paths. */
svg > use { fill: none; stroke: currentColor; }
.icon-btn .i-moon { display: none; }
:root[data-theme="dark"] .icon-btn .i-moon { display: block; }
:root[data-theme="dark"] .icon-btn .i-sun { display: none; }

.burger { display: none; }

@media (max-width: 900px) {
  .nav {
    position: fixed; inset: 64px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-alt); border-bottom: 1px solid var(--line);
    padding: 10px 20px 18px; box-shadow: var(--shadow);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
  }
  .nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 12px; font-size: 16px; }
  .burger { display: inline-flex; }
}

@media (max-width: 560px) {
  .brand img { width: 26px; height: 26px; border-radius: 8px; }
  .brand__name { font-size: 14px; white-space: nowrap; }
  .brand__sub { display: none; }
  .hdr__in { gap: 6px; }
  .brand { gap: 8px; }
  .hdr__act { gap: 5px; margin-left: 2px; }
  .hdr__act .btn--sm { padding: 8px 11px; font-size: 13.5px; }
  .icon-btn { width: 36px; height: 36px; }
  .hero { padding: 44px 0 60px; }
}

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 20px; border-radius: 11px;
  border: 1px solid transparent; cursor: pointer;
  font-size: 15px; font-weight: 600; letter-spacing: -.005em;
  text-decoration: none; white-space: nowrap;
  transition: transform .18s ease, box-shadow .22s ease, background-color .2s ease,
              border-color .2s ease, color .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 19px; height: 19px; flex: none; }

.btn--primary {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff; box-shadow: 0 6px 18px rgba(98, 54, 214, .28);
}
.btn--primary:hover { box-shadow: 0 12px 28px rgba(98, 54, 214, .38); }

.btn--ghost {
  background: var(--surface); color: var(--fg);
  border-color: var(--line-strong);
}
.btn--ghost:hover { border-color: var(--brand-line); color: var(--brand); }

.btn--sm { padding: 9px 14px; font-size: 14px; border-radius: 9px; }
.btn--block { width: 100%; }

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  padding: 76px 0 84px;
  overflow: hidden;
  background:
    radial-gradient(900px 460px at 82% -10%, var(--brand-soft), transparent 62%),
    radial-gradient(760px 420px at 4% 8%, rgba(63, 157, 240, .10), transparent 60%);
}
.hero__grid-bg {
  position: absolute; inset: 0; z-index: 0; opacity: .5; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(680px 340px at 50% 24%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(680px 340px at 50% 24%, #000 20%, transparent 78%);
  animation: gridDrift 26s linear infinite;
}
@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 56px 56px, 56px 56px; }
}

.hero__in {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  gap: 56px; align-items: center;
}
@media (max-width: 980px) {
  .hero__in { grid-template-columns: 1fr; gap: 44px; }
}

.hero__badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--fg-2);
  box-shadow: var(--shadow-sm); margin-bottom: 22px;
}
.hero__badge b {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; letter-spacing: .04em;
}

.hero h1 {
  font-size: clamp(32px, 5.1vw, 54px);
  letter-spacing: -.03em;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand-2), var(--brand) 45%, var(--brand-3));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero__cn { display: block; margin-top: 10px; font-size: clamp(19px, 2.5vw, 25px); color: var(--fg-2); font-weight: 600; letter-spacing: 0; }
.hero__lead { margin-top: 20px; font-size: 17px; color: var(--fg-2); max-width: 560px; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__meta {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  margin-top: 24px; font-size: 13.5px; color: var(--fg-3);
}
.hero__meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero__meta svg { width: 16px; height: 16px; flex: none; }

/* Hero visual: replica of the real GUI (Riso "sticker" design language).
   Colors are hard-coded from src/ui/styles.py tokens because they describe the
   application's own palette, not the site palette; the dark set mirrors the
   app's "night" theme. The site theme toggle is what selects `.is-dark`. */
.gui {
  --paper: #fbf3e2;
  --card: #fffdf6;
  --sunken: #f4ead4;
  --note: #fffbe8;
  --ink: #241f38;
  --soft: #4a4460;
  --mute: #6c6580;
  --faint: #b9b2c9;
  --pink: #ff4fa3;
  --blue: #2b50ff;
  --green: #2fbf8f;
  --yellow: #ffc53d;
  --red: #d3284f;
  --blue-tint: #e4e9ff;
  --green-tint: #def4ec;
  --yellow-tint: #fff2cf;
  --red-tint: #fadfe5;
  --sel: #fff3f8;
  --ui: Verdana, "Microsoft YaHei UI", "Microsoft YaHei", Tahoma, sans-serif;
  --display: "Arial Black", "Microsoft YaHei", Verdana, sans-serif;

  position: relative;
  display: flex; flex-direction: column;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 13px;
  overflow: visible;
  box-shadow: 8px 8px 0 rgba(36, 31, 56, .22);
  transform: perspective(1600px) rotateY(-5deg) rotateX(2deg);
  transition: transform .5s cubic-bezier(.2, .8, .25, 1), background-color .3s ease, border-color .3s ease;
}
.gui:hover { transform: perspective(1600px) rotateY(0deg) rotateX(0deg); }
@media (max-width: 980px) { .gui { transform: none; } }

.gui.is-dark {
  --paper: #221d33; --card: #2b2542; --sunken: #1c1829; --note: #251f38;
  --ink: #f5eddc; --soft: #c3bad9; --mute: #8f86ad; --faint: #565070;
  --pink: #ff63ae; --blue: #4d6bff; --green: #3fca9b; --yellow: #ffcd52; --red: #e25672;
  --blue-tint: #2a2f52; --green-tint: #1f3a31; --yellow-tint: #4a4029; --red-tint: #4a2630;
  --sel: #3a2b3a;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .5);
}

.gui__paper {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  border-radius: 16px; overflow: hidden;
  background-image: url("paper-grain.svg");
  background-size: 260px 260px;
  mix-blend-mode: overlay;
  opacity: .5;
}
.gui.is-dark .gui__paper { opacity: .22; mix-blend-mode: soft-light; }
/* Keep the paper grain in its own stacking layer without touching the
   positioning of the window's own layers (the preview panel is absolute). */
.gui { isolation: isolate; }
.gui__menubar, .gui__toolbar, .gui__filterbar, .gui__table, .gui__status { position: relative; z-index: 1; }

/* ── menu bar ───────────────────────────────────────────────────────── */
.gui__menubar {
  display: flex; gap: 1px; flex-wrap: wrap;
  padding: 4px 8px 3px;
  border-bottom: 2px solid var(--ink);
  border-radius: 16px 16px 0 0;
}
.gui__menubar span {
  padding: 3px 7px; border-radius: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--ink);
  cursor: default;
}
.gui__menubar span:first-child { background: var(--pink); color: #fff; }

/* ── toolbar: tilted legend chips + pill buttons ────────────────────── */
.gui__toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 9px 4px;
  flex-wrap: wrap;
}
.gui__legend { display: flex; align-items: center; gap: 6px; margin-right: auto; flex-wrap: wrap; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 25px; padding: 0 9px;
  background: var(--card);
  border: 2px solid var(--ink); border-radius: 11px;
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--ui); font-size: 11.5px; font-weight: 700; color: var(--ink);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.chip:nth-child(4n+1) { transform: rotate(-2deg); }
.chip:nth-child(4n+2) { transform: rotate(1.5deg); }
.chip:nth-child(4n+3) { transform: rotate(-1deg); }
.chip:nth-child(4n+4) { transform: rotate(2deg); }
.chip:hover { background: var(--sunken); }
.chip.is-on {
  background: var(--pink); color: #fff;
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(1px, 1px) rotate(0deg);
}
.chip__dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--c, #f2f2f2);
  border: 2px solid var(--ink);
}
.chip.is-on .chip__dot { border-color: #fff; }

.gui__btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 27px; padding: 0 11px;
  background: var(--card); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--ui); font-size: 11.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.gui__btn:hover { background: var(--sunken); }
.gui__btn:active { transform: translate(2px, 2px); box-shadow: none; }
.gui__btn svg { width: 14px; height: 14px; fill: currentColor; flex: none; }
.gui__btn--primary {
  background: var(--pink); color: #fff;
  transform: rotate(-1deg);
}
.gui__btn--primary:hover { background: #ff6ab1; }
.gui.is-dark .gui__btn--primary:hover { background: #ff7fbc; }

/* ── filter bar (dashed = not yet filtered) ─────────────────────────── */
.gui__filterbar {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 2px 9px 8px;
}
.gui__fld {
  display: inline-flex; align-items: center; gap: 7px;
  height: 27px; padding: 0 10px; min-width: 104px;
  background: var(--card);
  border: 2px dashed var(--ink); border-radius: 999px;
  font-size: 11.5px;
}
.gui__fld b { font-weight: 700; }
.gui__fld em { font-style: normal; color: var(--mute); }
.gui__fld svg { width: 13px; height: 13px; margin-left: auto; fill: var(--mute); flex: none; }

/* ── table: sticker card rows ───────────────────────────────────────── */
.gui__table { padding: 0 8px; }
.gui__thead {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 74px 44px 104px;
  gap: 7px; align-items: center;
  padding: 5px 8px 6px;
  border-bottom: 2px solid var(--ink);
  font-size: 10.5px; font-weight: 700; color: var(--soft); white-space: nowrap;
}
.gui__rows { display: grid; gap: 7px; padding: 7px 2px; }

.srow {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 74px 44px 104px;
  gap: 7px; align-items: center;
  height: 56px; padding: 0 8px;
  background: var(--card);
  border: 2px solid var(--ink); border-radius: 16px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: background-color .2s ease, opacity .3s ease, box-shadow .2s ease, transform .2s ease;
}
.srow.is-dim { opacity: .3; }
.srow.is-hot {
  background: var(--sel);
  box-shadow: 4px 4px 0 var(--ink), 6px 6px 0 var(--pink);
}

/* row-head tag sticker: flush to the card's left edge, square left corners */
.srow__pill {
  display: flex; align-items: center;
  height: 26px; margin-left: -10px; padding: 0 8px 0 9px;
  border: 2px solid var(--ink); border-left: none;
  border-radius: 0 11px 11px 0;
  background: #f2f2f2; color: #241f38;
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.srow__pill--draft { background: #ffe58a; }
.srow__pill--published { background: #8fe3b1; }
.srow__pill--rework { background: #ff8a8a; }
.srow__pill--none { background: #f2f2f2; }

.srow__name {
  font-size: 12.5px; font-weight: 700; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* AI status: ring badge (ring + tint core + status-coloured label) */
.sbadge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; color: var(--mute); white-space: nowrap;
}
.sbadge i {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 3px solid var(--faint); background: transparent;
}
.sbadge--pending { color: #9a6b00; }
.sbadge--pending i { border-color: var(--yellow); background: var(--yellow-tint); }
.sbadge--running { color: #1d3bd8; }
.sbadge--running i { border-color: var(--blue); background: var(--blue-tint); }
.sbadge--done { color: #157a52; }
.sbadge--done i { border-color: var(--green); background: var(--green-tint); }
.sbadge--failed { color: var(--red); }
.sbadge--failed i { border-color: var(--red); background: var(--red-tint); }
.gui.is-dark .sbadge--pending { color: var(--yellow); }
.gui.is-dark .sbadge--running { color: #8fa0ff; }
.gui.is-dark .sbadge--done { color: #5fd8ab; }
.gui.is-dark .sbadge--failed { color: #ef8296; }

/* media type: tint capsule by category */
.stype {
  justify-self: start;
  padding: 2px 7px; border-radius: 999px;
  background: var(--sunken); color: var(--ink);
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
}
.stype--video { background: var(--blue-tint); }
.stype--audio { background: var(--yellow-tint); }
.stype--image { background: var(--green-tint); }

/* size: meter bar, fill colour follows AI status */
.sbar {
  position: relative; display: block;
  height: 9px; border-radius: 999px;
  background: var(--card); border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(36, 31, 56, .18);
}
.sbar > i {
  position: absolute; inset: 0 auto 0 0;
  border-radius: 999px; background: var(--yellow);
  transition: width .5s cubic-bezier(.3, .9, .3, 1);
}
.sbar > b {
  position: absolute; left: 0; top: 14px;
  font-size: 10px; font-weight: 700; color: var(--soft);
  white-space: nowrap;
}
.sbar--running > i { background: var(--blue); }
.sbar--done > i { background: var(--green); }
.sbar--failed > i { background: var(--red); }

/* ── status bar (brand memory point: yellow strip) ──────────────────── */
.gui__status {
  display: flex; align-items: center; gap: 9px;
  margin-top: 8px; padding: 6px 9px;
  background: var(--yellow); color: var(--ink);
  border-top: 2px solid var(--ink);
  border-radius: 0 0 16px 16px;
  font-size: 11px; font-weight: 700;
}
.gui.is-dark .gui__status { background: var(--ink); color: var(--yellow); }
.gui__status b { font-size: 11.5px; white-space: nowrap; }
.gui__status em {
  font-style: normal; font-weight: 600; font-size: 10.5px; color: #5c4a12;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gui.is-dark .gui__status em { color: var(--yellow); opacity: .72; }
.gui__beats { display: inline-flex; gap: 3px; flex: none; }
.gui__beats i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.gui__chip {
  margin-left: auto; flex: none;
  padding: 2px 8px; border-radius: 999px;
  background: var(--card); color: var(--ink);
  border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
  font-size: 11px; font-weight: 700;
}
.gui.is-dark .gui__chip { background: var(--card); color: var(--ink); }

/* ── hover preview panel ────────────────────────────────────────────── */
.gpop {
  position: absolute; right: 10px; bottom: 44px; z-index: 3;
  width: 164px; border-radius: 12px; overflow: hidden;
  background: var(--card); border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 rgba(36, 31, 56, .22);
  opacity: 0; transform: translateY(8px) scale(.97); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.gpop.is-on { opacity: 1; transform: none; }
.gpop__scan {
  position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--pink), transparent);
  animation: scanY 2.6s ease-in-out infinite;
}
.gpop img { display: block; width: 100%; height: auto; }
.gpop__cap {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 5px 8px; border-top: 2px solid var(--ink);
  font-size: 10px; font-weight: 700;
}
.gpop__cap code { font-family: var(--ui); font-weight: 700; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gpop__cap b { color: var(--pink); }

/* small screens: drop the non-essential columns so rows stay readable */
@media (max-width: 1080px) {
  .gui__thead, .srow { grid-template-columns: 70px minmax(0, 1fr) 80px 104px; }
  .stype { display: none; }
}
@media (max-width: 760px) {
  .gui { font-size: 12px; }
  .gui__thead, .srow { grid-template-columns: 66px minmax(0, 1fr) 76px; gap: 6px; }
  .srow { height: 52px; padding: 0 8px; }
  .sbar { display: none; }
  .gui__toolbar .gui__legend { width: 100%; }
  .gui__menubar span:nth-child(n+4) { display: none; }
  .gpop { width: 150px; right: 6px; bottom: 44px; }
}

/* Floating decorative tag chips behind the hero visual */
.float-tags { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.float-tag {
  position: absolute; width: 44px; height: 44px; opacity: 0;
  animation: floatTag 15s ease-in-out infinite;
}
.float-tag svg { width: 100%; height: 100%; }
@keyframes floatTag {
  0%, 100% { transform: translateY(0) rotate(-6deg); opacity: .1; }
  50% { transform: translateY(-22px) rotate(6deg); opacity: .22; }
}
/* ---------- 7. Feature grid ---------- */
.grid { display: grid; gap: 18px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(276px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
  overflow: hidden;
}
.card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand-3));
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--brand-line); box-shadow: var(--shadow); }
.card:hover::after { transform: scaleX(1); }
.card__ico {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; margin-bottom: 15px;
  background: var(--brand-soft); color: var(--brand);
  border: 1px solid var(--brand-line);
}
.card__ico svg { width: 21px; height: 21px; }
.card h3 { font-size: 16.5px; }
.card p { margin-top: 8px; font-size: 14.5px; color: var(--fg-2); }

.card__en { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--fg-3); margin-top: 5px; }

/* ---------- 8. AI pipeline ---------- */
.pipe {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(214px, 1fr));
  gap: 14px; margin-bottom: 26px;
}
.step {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 18px 20px;
  transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
}
.step__n {
  font-family: var(--mono); font-size: 11.5px; color: var(--fg-3);
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.step__n i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong);
  transition: background-color .3s ease, box-shadow .3s ease;
}
.step h4 { font-size: 15px; }
.step p { margin-top: 7px; font-size: 13.5px; color: var(--fg-2); }
.step__tech {
  display: inline-block; margin-top: 11px; font-family: var(--mono); font-size: 11.5px;
  padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--fg-2);
}
.step.is-active { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); transform: translateY(-3px); }
.step.is-active .step__n i { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.step.is-done { border-color: var(--line); }
.step.is-done .step__n i { background: var(--ok); }

.pipe__bar {
  height: 6px; border-radius: 3px; background: var(--surface-2);
  overflow: hidden; border: 1px solid var(--line);
}
.pipe__bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brand-2), var(--brand), var(--brand-3));
  background-size: 200% 100%;
  animation: hueSlide 3s linear infinite;
  transition: width .5s cubic-bezier(.3, .9, .3, 1);
}
@keyframes hueSlide { to { background-position: 200% 0; } }
.pipe__status {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; font-size: 12.5px; color: var(--fg-3); font-family: var(--mono);
}

.ai-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 26px; }
.fact {
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: 16px 18px; background: var(--surface-2);
}
.fact b { display: block; font-size: 14.5px; }
.fact span { font-size: 13.5px; color: var(--fg-2); }

/* ---------- 9. Download ---------- */
.dl { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 22px; align-items: start; }
@media (max-width: 900px) { .dl { grid-template-columns: 1fr; } }

.dl__main {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 28px;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.dl__main::before {
  content: ""; position: absolute; inset: -60% -20% auto auto; width: 320px; height: 320px;
  background: radial-gradient(circle, var(--brand-soft), transparent 66%);
  pointer-events: none;
}
.dl__ver {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.dl__ver strong { font-size: 25px; letter-spacing: -.02em; }
.dl__ver em { font-style: normal; font-size: 13px; color: var(--fg-3); font-family: var(--mono); }

.specs { display: grid; gap: 0; margin: 20px 0 22px; border-top: 1px solid var(--line); }
.specs li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.specs li span:first-child { color: var(--fg-3); }
.specs li span:last-child { font-family: var(--mono); font-size: 13px; text-align: right; }

.urlbox {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 8px 8px 8px 14px;
  background: var(--surface-2); border: 1px dashed var(--line-strong);
  border-radius: 10px;
}
.urlbox code {
  flex: 1; min-width: 0; font-size: 12.5px; color: var(--fg-2);
  overflow-x: auto; white-space: nowrap; scrollbar-width: none;
}
.urlbox code::-webkit-scrollbar { display: none; }
.urlbox .icon-btn { width: 32px; height: 32px; border-radius: 8px; }
.urlbox .icon-btn svg { width: 16px; height: 16px; }

.dl__side { display: grid; gap: 14px; }
.mini {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
  transition: border-color .2s ease, transform .2s ease;
  color: inherit;
}
a.mini:hover { text-decoration: none; border-color: var(--brand-line); transform: translateY(-3px); }
.mini__ico {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--fg-2); border: 1px solid var(--line);
}
.mini__ico svg { width: 20px; height: 20px; }
.mini b { display: block; font-size: 15px; }
.mini p { font-size: 13.5px; color: var(--fg-2); margin-top: 4px; }
.mini__go { margin-left: auto; align-self: center; color: var(--fg-3); flex: none; }
.mini__go svg { width: 17px; height: 17px; }

.note {
  display: flex; gap: 11px; align-items: flex-start;
  margin-top: 18px; padding: 13px 15px;
  border-radius: 11px; font-size: 13.5px;
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 34%, transparent);
  color: var(--fg-2);
}
.note svg { width: 17px; height: 17px; flex: none; color: var(--warn); margin-top: 2px; }

/* ---------- 10. Backup download path (cloud drive) ---------- */
.drive {
  display: flex; align-items: center; gap: 16px;
  padding: 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.drive:hover { border-color: var(--brand-line); box-shadow: var(--shadow); transform: translateY(-3px); }
.drive__ico {
  width: 48px; height: 48px; flex: none; border-radius: 13px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: 0 6px 16px rgba(98, 54, 214, .3);
}
.drive__ico svg { width: 25px; height: 25px; }
.drive__body { min-width: 0; }
.drive__body b { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 17px; }
.drive__body b em {
  font-style: normal; font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 999px; color: var(--brand);
  background: var(--brand-soft); border: 1px solid var(--brand-line);
}
.drive__body p { font-size: 13.5px; color: var(--fg-2); margin-top: 3px; }
.drive__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.drive--stack { align-items: flex-start; padding: 18px; }
.drive--stack .drive__ico { width: 42px; height: 42px; border-radius: 12px; }
.drive--stack .drive__ico svg { width: 22px; height: 22px; }
.drive--stack .mini__go { align-self: center; }

/* Cloud-drive access code: shown inline so it can be copied without opening the share */
.pw {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 10px; padding: 3px 4px 3px 10px;
  border: 1px dashed var(--line-strong); border-radius: 9px;
  background: var(--surface-2);
  font-size: 12.5px;
}
.pw > span { color: var(--fg-3); }
.pw > code {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  letter-spacing: .06em; color: var(--fg);
}
.pw .icon-btn { width: 26px; height: 26px; border-radius: 7px; }
.pw .icon-btn svg { width: 14px; height: 14px; }
.pill {
  font-size: 11.5px; font-family: var(--mono); padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--fg-2);
}
.pill--ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 12%, transparent); }

.qr {
  display: grid; place-items: center; gap: 12px;
  padding: 22px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  text-align: center;
}
.qr img { width: 168px; height: 168px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 6px; }
.qr b { font-size: 14.5px; }
.qr p { font-size: 13px; color: var(--fg-2); }

/* ---------- 11. Quick start / steps ---------- */
.steps { display: grid; gap: 14px; counter-reset: s; }
.stepper {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px;
  padding: 18px 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .2s ease, transform .2s ease;
}
.stepper:hover { border-color: var(--brand-line); transform: translateX(4px); }
.stepper__n {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border: 1px solid var(--brand-line);
}
.stepper b { font-size: 15.5px; }
.stepper p { font-size: 14px; color: var(--fg-2); margin-top: 5px; }
.stepper code, .req code {
  font-size: 12.5px; padding: 1px 6px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--line);
}

.req { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.req__col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.req__col h4 { font-size: 15px; display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.req__col h4 svg { width: 18px; height: 18px; color: var(--brand); flex: none; }
.req__col li {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13.5px; padding: 7px 0; border-bottom: 1px dashed var(--line);
}
.req__col li:last-child { border-bottom: 0; }
.req__col li span:first-child { color: var(--fg-3); }
.req__col li span:last-child { font-family: var(--mono); font-size: 12.5px; }

/* ---------- 12. Tech stack ---------- */
.techgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(216px, 1fr)); gap: 12px; }
.tech {
  display: flex; flex-direction: column; gap: 3px;
  padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.tech:hover { border-color: var(--brand-line); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.tech b { font-family: var(--mono); font-size: 14px; letter-spacing: -.01em; }
.tech span { font-size: 13px; color: var(--fg-3); }

/* ---------- 13. FAQ ---------- */
.faq { display: grid; gap: 10px; }
.faq details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .2s ease;
}
.faq details[open] { border-color: var(--brand-line); }
.faq summary {
  cursor: pointer; padding: 16px 20px; font-size: 15.5px; font-weight: 600;
  display: flex; align-items: center; gap: 12px; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; margin-left: auto; width: 9px; height: 9px; flex: none;
  border-right: 2px solid var(--fg-3); border-bottom: 2px solid var(--fg-3);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .25s ease;
}
.faq details[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.faq p { padding: 0 20px 18px; font-size: 14.5px; color: var(--fg-2); }

/* ---------- 14. Footer ---------- */
.ftr {
  background: var(--bg-alt); border-top: 1px solid var(--line);
  padding: 54px 0 30px; margin-top: 0;
}
.ftr__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 34px; }
@media (max-width: 820px) { .ftr__grid { grid-template-columns: 1fr 1fr; gap: 26px; } }
@media (max-width: 520px) { .ftr__grid { grid-template-columns: 1fr; } }
.ftr h4 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 14px; }
.ftr li + li { margin-top: 9px; }
.ftr a { color: var(--fg-2); font-size: 14px; }
.ftr a:hover { color: var(--brand); }
.ftr__about p { font-size: 13.5px; color: var(--fg-2); margin-top: 12px; max-width: 320px; }
.ftr__bot {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between;
  font-size: 13px; color: var(--fg-3);
}

/* ---------- 15. Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .25, 1); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal--d1 { transition-delay: .06s; }
.reveal--d2 { transition-delay: .12s; }
.reveal--d3 { transition-delay: .18s; }


/* ---------- 16. Back to top ---------- */
.totop {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--fg-2);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none;
  transition: all .25s ease;
}
.totop.is-on { opacity: 1; transform: none; pointer-events: auto; }
.totop:hover { color: var(--brand); border-color: var(--brand-line); }
.totop svg { width: 20px; height: 20px; }

/* ---------- 17. Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60;
  transform: translate(-50%, 20px);
  background: var(--fg); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 18. Print ---------- */
@media print {
  .hdr, .totop, .toast, .hero__grid-bg, .float-tags { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .step, .mini, .drive, .qr, .dl__main { box-shadow: none; }
}
