/* ============================================================
   xyc design — extensions
   Skill · Plugin · Connector · MCP Server
   One bench for the parts that plug into Quanta.
   ============================================================ */

/* ---------------- sub nav ---------------- */
.xtabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  margin-top: 44px;
  text-align: left;
}
.xtabs a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px 15px 0;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  transition: color 160ms ease;
}
.xtabs a:hover { color: var(--red-deep); }
.xtabs a em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.xtabs a b { font-weight: 500; font-size: 15px; color: var(--ink-2); }
.xtabs a.is-on b { color: var(--ink); }
.xtabs a.is-on em { color: var(--red-deep); }
.xtabs a.is-on { position: relative; }
.xtabs a.is-on::after {
  content: '';
  position: absolute;
  left: 0;
  right: 16px;
  bottom: -1px;
  height: 1px;
  background: var(--ink);
}

/* ---------------- taxonomy ---------------- */
.xtax {
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.xtax-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 24px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}
.xtax-row b {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.xtax-row span { font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.xtax-row em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  color: var(--faint);
  letter-spacing: 0.04em;
}
.xtax-row.is-on {
  background: var(--red-wash);
  border-bottom-color: rgba(224, 82, 82, 0.16);
}
.xtax-row.is-on b { color: var(--red-deep); }
.xtax-row.is-on em { color: var(--red-deep); }

/* ---------------- fact strip ---------------- */
.xfacts3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 34px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.xfacts3 div b {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red-deep);
  margin-bottom: 7px;
  font-weight: 400;
}
.xfacts3 div p { font-size: 13.5px; line-height: 1.65; color: var(--muted); max-width: 36ch; }

/* ---------------- entries ---------------- */
.xentries { display: flex; flex-direction: column; }
.xentry {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 50px;
  align-items: center;
  padding: 64px 0;
  border-top: 1px solid var(--line);
}
.xentry.flip { grid-template-columns: minmax(0, 1.14fr) minmax(0, 0.86fr); }
.xentry.flip .xcopy { order: 2; }
.xcopy { min-width: 0; }
.xkicker {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin-bottom: 12px;
  text-transform: uppercase;
}
.xkicker em { font-style: normal; color: var(--red-deep); }
.xcopy h3 {
  font-family: var(--serif);
  font-size: clamp(25px, 2.5vw, 31px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 12px;
}
.xcopy > p { color: var(--muted); font-size: 14.5px; line-height: 1.68; margin-bottom: 16px; max-width: 52ch; }
.xcopy > p b { color: var(--ink); font-weight: 500; }
.xspecs { list-style: none; border-top: 1px solid var(--line-soft); margin-bottom: 20px; }
.xspecs li {
  position: relative;
  padding: 9px 0 9px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  line-height: 1.58;
  color: var(--muted);
}
.xspecs li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 17px;
  width: 5px;
  height: 1px;
  background: var(--red);
}
.xspecs b { color: var(--ink); font-weight: 500; }
.xaction {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.xdl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 12.5px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.xdl:hover { background: var(--paper-2); border-color: rgba(20,20,19,.24); transform: translateY(-1px); }
.xdl svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.xdl.dark { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.xdl.dark:hover { background: #2c2a26; border-color: #2c2a26; }
.xhint { font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: 0.03em; }

/* ---------------- demo frame ---------------- */
.demo {
  margin: 0;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(20,20,19,.03), 0 30px 60px -46px rgba(20,20,19,.4);
}
.demo-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper-2);
}
.demo-dots { display: flex; gap: 5px; flex: 0 0 auto; }
.demo-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(20,20,19,.16); }
.demo-dots i:nth-child(1) { background: rgba(224,82,82,.5); }
.demo-title {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.demo-live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  flex: 0 0 auto;
}
.demo-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  animation: d-pulse 2.4s ease-in-out infinite;
}
@keyframes d-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
.demo-body {
  padding: 18px;
  min-height: 258px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(224,82,82,.035), transparent 60%),
    var(--card);
}
.demo-cap {
  border-top: 1px solid var(--line-soft);
  padding: 10px 16px 12px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--faint);
  background: var(--paper-2);
}
.demo-cap b { color: var(--muted); font-weight: 500; }

/* generic demo controls */
.d-btn {
  font: inherit;
  white-space: nowrap;
  font-size: 11.5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.d-btn:hover { background: var(--paper-2); border-color: rgba(20,20,19,.22); }
.d-btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.d-btn.primary:hover { background: #2c2a26; }
.d-btn[disabled] { opacity: 0.5; cursor: default; }
.d-btn.is-done { background: var(--red-wash); border-color: rgba(224,82,82,.35); color: var(--red-deep); }
.d-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-spacer { flex: 1 1 auto; }
.d-label {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.d-chiprow { display: flex; flex-wrap: wrap; gap: 6px; }
.d-chip {
  font: inherit;
  font-size: 10.5px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.d-chip:hover { background: var(--paper-2); color: var(--ink); }
.d-chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.d-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  padding: 0 10px;
  font: inherit;
  font-size: 11.5px;
  color: var(--ink);
}
.d-input::placeholder { color: var(--faint); }
.d-input:focus { outline: none; border-color: rgba(224,82,82,.45); box-shadow: 0 0 0 3px rgba(224,82,82,.08); }
.d-mono { font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: 0.01em; }
.d-hr { height: 1px; background: var(--line-soft); margin: 2px 0; }
.d-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); }
.d-kv b { font-weight: 500; color: var(--ink-2); }
.d-note {
  border: 1px dashed rgba(20,20,19,.16);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
  background: rgba(250,249,245,.6);
}
.d-note b { color: var(--ink); font-weight: 500; }
.d-done { color: var(--red-deep); }

/* ============================================================
   MCP bench
   ============================================================ */
.bench {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(20,20,19,.03), 0 30px 60px -46px rgba(20,20,19,.4);
}
.bench-list {
  border-right: 1px solid var(--line-soft);
  background: var(--paper-2);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bench-head {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 4px 8px 8px;
}
.bench-item {
  font: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.bench-item em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 9px;
  color: var(--faint);
  width: 14px;
  flex: 0 0 auto;
}
.bench-item span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bench-item:hover { background: rgba(20,20,19,.05); }
.bench-item.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(20,20,19,.08); }
.bench-item.on em { color: var(--red-deep); }
.bench-foot {
  margin-top: auto;
  padding: 10px 8px 2px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--faint);
  line-height: 1.6;
}
.bench-stage { min-width: 0; display: flex; flex-direction: column; }
.bench-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.bench-top h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.bench-top .bsub { font-size: 12.5px; color: var(--muted); margin-top: 3px; max-width: 46ch; line-height: 1.55; }
.bench-top .bench-tools { margin-left: auto; display: flex; gap: 6px; flex: 0 0 auto; }
.bench-scene { padding: 16px 20px 20px; flex: 1 1 auto; min-height: 372px; display: flex; }
.bscene { display: none; flex: 1 1 auto; flex-direction: column; gap: 10px; min-width: 0; }
.bscene.on { display: flex; }
.bench-tagline {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
}

/* ask */
.ask-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 12px;
  box-shadow: 0 12px 26px -22px rgba(20,20,19,.5);
}
.ask-q { font-size: 12.5px; color: var(--ink); margin-bottom: 9px; }
.ask-q b { font-family: var(--mono); font-size: 9px; color: var(--red-deep); letter-spacing: 0.08em; margin-right: 6px; }
.ask-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 6px;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.ask-opt:hover { background: var(--paper-2); }
.ask-opt i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(20,20,19,.28);
  flex: 0 0 auto;
  position: relative;
}
.ask-opt.on { border-color: rgba(224,82,82,.4); background: var(--red-wash); color: var(--ink); }
.ask-opt.on i { border-color: var(--red); }
.ask-opt.on i::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--red);
}

/* browser */
.mini-browser {
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: var(--card);
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.mb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper-2);
}
.mb-url {
  flex: 1 1 auto;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 3px 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mb-page { padding: 12px 14px; flex: 1 1 auto; position: relative; }
.mb-site {
  font-family: var(--serif);
  font-size: 15px;
  margin-bottom: 9px;
  color: var(--ink);
}
.mb-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--muted);
  position: relative;
  transition: background 200ms ease, color 200ms ease;
}
.mb-row em { font-family: var(--mono); font-style: normal; font-size: 9px; color: var(--faint); }
.mb-row.is-hit { background: var(--red-wash); color: var(--ink); }
.mb-row.is-hit em { color: var(--red-deep); }
.cursor {
  position: absolute;
  width: 13px;
  height: 13px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
  z-index: 4;
}
.cursor::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--red);
  clip-path: polygon(0 0, 100% 62%, 55% 62%, 42% 100%);
}
.cursor.on { opacity: 1; }
.cursor.tween { transition: transform 750ms cubic-bezier(.3,.7,.2,1), opacity 200ms ease; }

/* memory */
.mem-search { display: flex; gap: 6px; }
.mem-note {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 9px 11px;
  background: var(--card);
  transition: opacity 220ms ease, border-color 220ms ease, background 220ms ease;
}
.mem-note.hide { display: none; }
.mem-note.hit { border-color: rgba(224,82,82,.42); background: var(--red-wash); }
.mem-note .mn-title { font-size: 12px; color: var(--ink); margin-bottom: 3px; }
.mem-note .mn-meta { font-family: var(--mono); font-size: 9px; color: var(--faint); letter-spacing: 0.02em; }
.mem-note .mn-body { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.mem-note.new { animation: d-slide 420ms ease both; }
@keyframes d-slide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* schedule */
.sched-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--card);
}
.sched-row .s-name { font-size: 12px; color: var(--ink); }
.sched-row .s-cron { font-family: var(--mono); font-size: 9px; color: var(--faint); margin-top: 1px; }
.sched-row .s-state {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--faint);
  min-width: 58px;
  text-align: right;
}
.sched-row .s-state.run { color: var(--red-deep); }
.sched-row .s-state.ok { color: var(--ink); }
.switch {
  width: 26px;
  height: 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-3);
  position: relative;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 180ms ease, border-color 180ms ease;
}
.switch::after {
  content: '';
  position: absolute;
  top: 1.5px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--faint);
  transition: transform 180ms ease, background 180ms ease;
}
.switch.on { background: var(--red-wash); border-color: rgba(224,82,82,.4); }
.switch.on::after { transform: translateX(10px); background: var(--red); }

/* consultants */
.cons-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cons {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 9px 10px;
  background: var(--card);
  min-height: 96px;
  display: flex;
  flex-direction: column;
  transition: border-color 200ms ease;
}
.cons b { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.04em; color: var(--ink); }
.cons .c-role { font-size: 10px; color: var(--faint); margin-top: 2px; }
.cons .c-ans { font-size: 11px; line-height: 1.5; color: var(--muted); margin-top: 9px; opacity: 0; transition: opacity 300ms ease; }
.cons.answered .c-ans { opacity: 1; }
.cons.answered { border-color: rgba(224,82,82,.32); }
.cons .c-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--faint); margin-left: auto;
}
.cons.answered .c-dot { background: var(--red); }
.cons-head { display: flex; align-items: center; gap: 6px; }

/* desktop / cua */
.desktop {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(160deg, #f4f1e8, #e9e5d9);
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 16px;
}
.desktop .dt-icons { display: flex; gap: 14px; }
.dt-icon {
  width: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 8.5px;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
}
.dt-icon img {
  width: 30px;
  height: 30px;
  display: block;
  border-radius: 7px;
  box-shadow: 0 6px 12px -8px rgba(20,20,19,.6);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.dt-icon.on img {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(224,82,82,.7), 0 8px 14px -8px rgba(20,20,19,.55);
}
.dt-window {
  position: absolute;
  left: 76px;
  top: 42px;
  right: 18px;
  bottom: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 18px 30px -22px rgba(20,20,19,.6);
  padding: 10px 12px;
  opacity: 0;
  transform: translateY(4px) scale(.985);
  transition: opacity 240ms ease, transform 240ms ease;
}
.dt-window.on { opacity: 1; transform: none; }
.dt-window .w-bar { font-family: var(--mono); font-size: 9px; color: var(--faint); margin-bottom: 8px; }
.dt-window .w-row { font-size: 10.5px; color: var(--muted); padding: 4px 0; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; }
.dt-window .w-row em { font-style: normal; margin-left: auto; color: var(--faint); font-family: var(--mono); font-size: 9px; }
.dt-cursor {
  position: absolute;
  width: 14px;
  height: 14px;
  z-index: 5;
  opacity: 0;
  transform: translate(6px, 6px);
  transition: transform 800ms cubic-bezier(.3,.7,.2,1), opacity 200ms ease;
}
.dt-cursor::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--red-deep);
  clip-path: polygon(0 0, 100% 62%, 55% 62%, 42% 100%);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.25));
}
.dt-cursor.on { opacity: 1; }

/* screen capture */
.screen-area {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(150deg, #efece2, #e3dfd2);
  flex: 1 1 auto;
  min-height: 180px;
  overflow: hidden;
  padding: 14px;
}
.screen-area .sa-bar { display: flex; gap: 6px; margin-bottom: 10px; }
.screen-area .sa-bar i { height: 8px; border-radius: 3px; background: rgba(20,20,19,.1); display: block; }
.screen-area .sa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.screen-area .sa-card { background: var(--card); border: 1px solid var(--line-soft); border-radius: 7px; height: 42px; }
.screen-area .sa-card.tall { grid-column: span 2; height: 54px; }
.screen-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.screen-flash.fire { animation: d-flash 620ms ease; }
@keyframes d-flash {
  0% { opacity: 0; }
  12% { opacity: 0.85; }
  100% { opacity: 0; }
}
.marquee {
  position: absolute;
  border: 1px solid var(--red);
  box-shadow: 0 0 0 1px rgba(255,255,255,.5) inset;
  opacity: 0;
  transition: opacity 240ms ease;
  pointer-events: none;
}
.marquee.on { opacity: 1; }
.marquee::after {
  content: attr(data-size);
  position: absolute;
  right: -1px;
  bottom: -18px;
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--red-deep);
  background: var(--paper);
  padding: 0 3px;
}

/* materials */
.files { display: flex; flex-direction: column; gap: 6px; }
.file-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--card);
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: border-color 160ms ease, background 160ms ease;
}
.file-row .f-ext {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  color: var(--faint);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 4px;
}
.file-row .f-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.file-row .f-mark { font-size: 9.5px; color: var(--faint); font-family: var(--mono); }
.file-row.on { border-color: rgba(224,82,82,.38); background: var(--red-wash); }
.file-row.on .f-mark { color: var(--red-deep); }
.jev {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 22px;
}
.jev span {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  color: var(--muted);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 240ms ease, transform 240ms ease;
}
.jev span.on { opacity: 1; transform: none; }
.jev span.pass { color: var(--red-deep); border-color: rgba(224,82,82,.35); background: var(--red-wash); }

/* pages */
.page-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); }
.page-tab {
  font: inherit;
  font-size: 11px;
  padding: 6px 10px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}
.page-tab.on { color: var(--ink); border-bottom-color: var(--red); }
.page-preview {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--card);
  padding: 12px 13px;
  flex: 1 1 auto;
}
.page-preview h4 { font-family: var(--serif); font-size: 16px; font-weight: 400; margin-bottom: 3px; letter-spacing: -0.01em; }
.page-preview .pp-meta { font-family: var(--mono); font-size: 8.5px; color: var(--faint); letter-spacing: 0.04em; margin-bottom: 9px; }
.page-preview p { font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.page-preview .pp-line { height: 5px; border-radius: 3px; background: rgba(20,20,19,.07); margin-top: 6px; }
.page-preview .pp-line.short { width: 62%; }

/* ============================================================
   Skill demos
   ============================================================ */
.imgdemo-prompt {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-2);
  border-left: 2px solid var(--red);
  padding: 2px 0 2px 10px;
  min-height: 38px;
}
.imgdemo-prompt b { font-weight: 500; color: var(--ink); }
.img-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: auto;
}
.img-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 7px;
  overflow: hidden;
  background: var(--paper-3);
  border: 1px solid var(--line-soft);
  padding: 0;
  cursor: pointer;
  opacity: 0;
  transform: scale(.96);
  transition: opacity 420ms ease, transform 420ms ease, outline-color 160ms ease;
  outline: 1px solid transparent;
  outline-offset: 1px;
}
.img-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-tile.on { opacity: 1; transform: none; }
.img-tile.sel { outline-color: var(--red); }
.img-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.progress {
  height: 2px;
  background: var(--line-soft);
  border-radius: 2px;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--red);
  transition: width 220ms ease;
}
.vid-frames {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
.vid-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: var(--paper-3);
}
.vid-frame img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.86); }
.vid-frame.is-play { outline: 1.5px solid var(--red); outline-offset: -1.5px; }
.vid-frame::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 30%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
  pointer-events: none;
}
.vid-frame span {
  position: absolute;
  z-index: 1;
  left: 4px;
  bottom: 3px;
  font-family: var(--mono);
  font-size: 7.5px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.vid-log {
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.75;
  color: var(--faint);
  min-height: 54px;
}
.vid-log div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vid-log b { color: var(--ink-2); font-weight: 400; }
.vid-log .ok { color: var(--red-deep); }

/* ============================================================
   Plugin demos
   ============================================================ */
.stream-turn {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--card);
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
}
.stream-q { font-size: 11.5px; color: var(--ink); display: flex; gap: 7px; }
.stream-q em { font-style: normal; color: var(--red-deep); font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em; transform: translateY(1px); }
.stream-think {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.7;
  color: var(--muted);
  border-left: 2px solid var(--line);
  padding-left: 9px;
  min-height: 68px;
  max-height: 96px;
  overflow: hidden;
}
.stream-think .caret {
  display: inline-block;
  width: 5px;
  height: 10px;
  background: var(--red);
  transform: translateY(1px);
  animation: d-caret 1s steps(1) infinite;
}
@keyframes d-caret { 50% { opacity: 0; } }
.status-row { display: flex; gap: 6px; flex-wrap: wrap; }
.status-pill {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  color: var(--faint);
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
}
.status-pill.on { color: var(--ink); border-color: rgba(20,20,19,.2); background: var(--paper-2); }
.status-pill.live { color: var(--red-deep); border-color: rgba(224,82,82,.38); background: var(--red-wash); }
.evt-log {
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.7;
  color: var(--faint);
  border-top: 1px solid var(--line-soft);
  padding-top: 7px;
  min-height: 46px;
  overflow: hidden;
}
.evt-log div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evt-log b { font-weight: 400; color: var(--red-deep); }
.compact-note {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  color: var(--red-deep);
  background: var(--red-wash);
  border: 1px solid rgba(224,82,82,.22);
  border-radius: 8px;
  padding: 6px 9px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 260ms ease, transform 260ms ease;
}
.compact-note.on { opacity: 1; transform: none; }
.compact-note i { width: 5px; height: 5px; border-radius: 50%; background: var(--red); }

.toolscope { display: flex; flex-direction: column; gap: 9px; }
.scope-roles { display: flex; gap: 5px; flex-wrap: wrap; }
.scope-tools { display: flex; flex-wrap: wrap; gap: 5px; }
.tool-chip {
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
  color: var(--faint);
  background: transparent;
  transition: opacity 200ms ease, color 200ms ease, border-color 200ms ease, background 200ms ease, text-decoration-color 200ms ease;
}
.tool-chip.allow {
  color: var(--ink);
  border-color: rgba(20,20,19,.2);
  background: var(--paper-2);
}
.tool-chip.deny {
  opacity: 0.55;
  text-decoration: line-through;
  text-decoration-color: rgba(224,82,82,.7);
}
.scope-code {
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.7;
  color: var(--muted);
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px 10px;
  white-space: pre-wrap;
  word-break: break-word;
}
.scope-code b { color: var(--red-deep); font-weight: 400; }

/* ============================================================
   Connector demos
   ============================================================ */
.chat {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--card);
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.chat-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper-2);
}
.chat-avatar {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 11px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.chat-name { font-size: 11px; color: var(--ink); line-height: 1.2; }
.chat-sub { font-family: var(--mono); font-size: 8px; color: var(--faint); letter-spacing: 0.03em; }
.chat-status {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chat-status i { width: 4px; height: 4px; border-radius: 50%; background: var(--red); }
.chat-body {
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow: hidden;
  flex: 1 1 auto;
  justify-content: flex-end;
}
.msg {
  max-width: 84%;
  font-size: 11px;
  line-height: 1.55;
  padding: 7px 9px;
  border-radius: 10px;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 300ms ease, transform 300ms ease;
}
.msg.on { opacity: 1; transform: none; }
.msg.in { background: var(--paper-2); color: var(--ink-2); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.out { background: var(--ink); color: var(--paper); border-bottom-right-radius: 4px; align-self: flex-end; }
.msg .m-card {
  margin-top: 5px;
  border-top: 1px solid rgba(250,249,245,.22);
  padding-top: 5px;
  font-family: var(--mono);
  font-size: 8.5px;
  color: rgba(250,249,245,.7);
  letter-spacing: 0.03em;
}
.typing {
  align-self: flex-start;
  display: flex;
  gap: 3px;
  padding: 8px 10px;
  background: var(--paper-2);
  border-radius: 10px;
  opacity: 0;
  transition: opacity 200ms ease;
}
.typing.on { opacity: 1; }
.typing i { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); animation: d-typing 1.1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes d-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-3px); opacity: 1; }
}
.chat-foot {
  border-top: 1px solid var(--line-soft);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper-2);
}
.chat-foot .cf-hint { font-family: var(--mono); font-size: 8.5px; color: var(--faint); letter-spacing: 0.02em; }
.qq-window {
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--faint);
  display: flex;
  gap: 8px;
  align-items: center;
}
.qq-window b { color: var(--red-deep); font-weight: 400; }

.wx-login {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  color: var(--muted);
}
.wx-qr {
  width: 34px;
  height: 34px;
  border-radius: 5px;
  border: 1px solid var(--line-soft);
  background:
    repeating-linear-gradient(0deg, rgba(20,20,19,.75) 0 2px, transparent 2px 4px),
    repeating-linear-gradient(90deg, rgba(20,20,19,.7) 0 2px, transparent 2px 4px),
    var(--card);
  flex: 0 0 auto;
}
.wx-login b { color: var(--ink); font-weight: 500; }

.wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 62px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--card);
  padding: 0 10px;
  overflow: hidden;
}
.wave i {
  width: 2.5px;
  height: 6px;
  border-radius: 2px;
  background: rgba(20,20,19,.18);
  transition: background 200ms ease;
}
.wave.live i { background: var(--red); animation: d-wave 1.1s ease-in-out infinite; }
.wave i:nth-child(3n) { animation-delay: .12s; }
.wave i:nth-child(3n+1) { animation-delay: .24s; }
.wave i:nth-child(4n) { animation-delay: .36s; }
@keyframes d-wave {
  0%, 100% { height: 5px; }
  50% { height: 30px; }
}
.asr {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.7;
  color: var(--muted);
  min-height: 34px;
}
.asr b { color: var(--ink); font-weight: 400; }
.tts-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--faint);
  opacity: 0;
  transition: opacity 300ms ease;
}
.tts-bar.on { opacity: 1; }
.tts-bar .play {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center;
  font-size: 6px;
}
.tts-bar .tts-track { flex: 1 1 auto; height: 2px; background: var(--line-soft); border-radius: 2px; overflow: hidden; }
.tts-bar .tts-track i { display: block; height: 100%; width: 0%; background: var(--red); }

/* ============================================================
   Extension page extras
   ============================================================ */
.xinstall { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 40px; align-items: start; }
.xsteps { list-style: none; border-top: 1px solid var(--line-soft); }
.xsteps li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}
.xsteps li em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  color: var(--red-deep);
  padding-top: 2px;
}
.xsteps b { color: var(--ink); font-weight: 500; }
.xnote { margin-top: 16px; font-size: 12px; color: var(--faint); line-height: 1.7; }
.xnote code {
  font-family: var(--mono);
  font-size: 10.5px;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 4px;
}
.xnext-cta { margin-top: 24px; }

@media (max-width: 1080px) {
  .xentry { gap: 34px; }
  .bench { grid-template-columns: 216px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .xentry, .xentry.flip { grid-template-columns: 1fr; gap: 24px; padding: 48px 0; }
  .xentry.flip .xcopy { order: 0; }
  .xinstall { grid-template-columns: 1fr; gap: 26px; }
  .xfacts3 { grid-template-columns: 1fr; gap: 16px; }
  .xtax-row { grid-template-columns: 1fr; gap: 4px; padding: 14px 0; }
  .xtax-row em { display: none; }
  .bench { grid-template-columns: 1fr; }
  .bench-list {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    padding: 10px;
  }
  .bench-head, .bench-foot { display: none; }
  .bench-item { width: auto; flex: 0 0 auto; white-space: nowrap; }
  .bench-item span { overflow: visible; }
  .demo-body { min-height: 240px; }
  .cons-grid { grid-template-columns: 1fr; gap: 6px; }
  .cons { min-height: 0; }
}
@media (max-width: 720px) {
  .xtabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xtabs a:nth-child(2) { padding-right: 0; }
  .demo-body { padding: 14px; }
  .img-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .bench-top { flex-direction: column; gap: 8px; }
  .bench-top .bench-tools { margin-left: 0; }
  .bench-scene { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .wave.live i, .typing i, .demo-live i, .stream-think .caret { animation: none; }
  .cursor.tween, .dt-cursor { transition: none; }
}

/* ---------------- scene head + bits ---------------- */
.bscene-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 4px;
}
.bscene-head h3 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.15;
}
.bscene-head .bsub { font-size: 12.5px; color: var(--muted); margin-top: 4px; max-width: 48ch; line-height: 1.55; }
.bscene-head .bdl { margin-left: auto; flex: 0 0 auto; }
.cursor, .dt-cursor { left: 0; top: 0; }
.ask-result { opacity: 0; transition: opacity 240ms ease; }
.ask-result.on { opacity: 1; }
.br-note, .scr-note, .cua-note, .cons-foot {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  color: var(--faint);
  min-height: 14px;
}
.cons-foot.on { color: var(--red-deep); }
.br-note b, .scr-note b { color: var(--muted); font-weight: 400; }
.img-status, .vid-status {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  color: var(--faint);
  min-height: 13px;
}
.mem-search .d-input { font-size: 11px; }
.scope-name { color: var(--red-deep); }

/* the component's own name, kept out of the small print */
.xkicker { align-items: center; }
.xkicker .xname {
  font-family: var(--mono);
  font-size: 19px;
  letter-spacing: -0.015em;
  text-transform: none;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 4px 10px 5px;
  line-height: 1.25;
}
@media (max-width: 560px) {
  .xkicker .xname { font-size: 16px; padding: 3px 9px 4px; }
}

/* the back link gets its own line, flush with the container edge */
.case-hero .case-back {
  display: flex;
  width: fit-content;
  margin-bottom: 26px;
}

.scope-code .sc-comment { color: var(--faint); }
.scope-code .sc-list { color: var(--ink); }

@media (max-width: 560px) {
  .cf-hint { display: none; }
  .qq-window { white-space: nowrap; }
}

.dt-menubar {
  display: flex;
  gap: 9px;
  align-items: center;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--faint);
  margin: -6px 0 10px;
}
.dt-menubar b { color: var(--muted); font-weight: 400; }
.dt-dock {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(20, 20, 19, 0.08);
}
.dt-dock i { width: 13px; height: 13px; border-radius: 4px; background: rgba(20, 20, 19, 0.13); display: block; }

/* keep the ask result out of the layout until it has an answer */
.ask-result { display: none; }
.ask-result.on { display: block; }
@media (max-width: 900px) {
  .bench-scene { min-height: 0; }
}

/* ============================================================
   MCP · the nine, one by one
   ============================================================ */
.xentry[id] { scroll-margin-top: 96px; }

.xdemo .demo-body { min-height: 240px; }
.tab-panels { flex: 1 1 auto; display: flex; min-height: 0; }
.tpanel {
  display: none;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.tpanel.on { display: flex; }
.tpanel .mini-browser { min-height: 148px; }
.tpanel .cons { min-height: 0; }
.tpanel .cons .c-ans { opacity: 1; }
.tpanel .sched-row { width: 100%; }
.tpanel .page-preview { flex: 1 1 auto; }
.tpanel .jev { min-height: 0; }
.tpanel .jev span { opacity: 1; transform: none; }
.tpanel .mem-note .mn-body { margin-top: 4px; }

/* cua · one desktop, three states */
.xdemo .desktop { min-height: 172px; }
.xdemo[data-state="move"] .dt-cursor { opacity: 1; transform: translate(96px, 40px); }
.xdemo[data-state="click"] .dt-cursor { opacity: 1; transform: translate(96px, 40px); }
.xdemo[data-state="click"] .dt-icon:nth-child(2) img {
  box-shadow: 0 0 0 2px rgba(224, 82, 82, 0.7), 0 8px 14px -8px rgba(20, 20, 19, 0.55);
}
.xdemo[data-state="look"] .dt-cursor { opacity: 1; transform: translate(96px, 40px); }
.xdemo[data-state="look"] .dt-window { opacity: 1; transform: none; }

/* screen · one capture, three crops */
.xdemo .marquee { opacity: 1; }
.xdemo[data-state="full"] .marquee { left: 10px; right: 10px; top: 42px; bottom: 10px; width: auto; height: auto; }
.xdemo[data-state="window"] .marquee { left: 13%; top: 28%; width: 58%; height: 46%; right: auto; bottom: auto; }
.xdemo[data-state="crop"] .marquee { left: 30%; top: 42%; width: 34%; height: 30%; right: auto; bottom: auto; }

/* the section index */
.xindex a span { white-space: nowrap; }

/* tab item: label on the left, big glyph on the right */
.xtabs a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 16px;
  align-items: center;
  padding: 16px 18px 17px 0;
}
.xtabs a em { grid-column: 1; grid-row: 1; }
.xtabs a b { grid-column: 1; grid-row: 2; font-size: 16px; }
.xtabs a .tab-glyph {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 40px;
  height: 40px;
  margin: 0;
  opacity: 0.85;
}

/* glyph sits right after the label, not at the far edge of the column */
.xtabs a {
  grid-template-columns: auto auto;
  justify-content: start;
  column-gap: 14px;
}
